blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
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
689M
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
131 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
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
b3956aa7f538dc7c11260966b0e2553515b08251
a45c5f9fa9914be2ce2a52591e5d8dcfbd000e3f
/src/main/java/tests/TC002_EditLead.java
67850365d54c2ac0b7f899841ec639c564acc346
[]
no_license
jjebaselvan/OATS_framework_jeba
a0ec49970b8680a0002e523cb967ceffba6d10bd
e1f36ec4982f6f21000f3878cfdd3f7e5246680f
refs/heads/master
2020-03-28T23:34:22.886803
2018-09-18T14:09:04
2018-09-18T14:09:04
149,298,256
0
0
null
null
null
null
UTF-8
Java
false
false
712
java
package tests; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import pages.MyHomePage; import wdMethods.ProjectMethods; public class TC002_EditLead extends ProjectMethods { @BeforeClass public void setData() { testCaseName = "TC002_EditLead"; testCaseDescription ="Edit a lead"; category = "Smoke"; author= "jeba"; dataSheetName="TC002"; } @Test(dataProvider="fetchData") public void createLead(String cname, String fname) { new MyHomePage() .clickLeads() .clickFindLeads() .TypeFirstName(fname) .ClicksearchLeads() .clickresultname() .ClickEdit() .Typecompany(cname) .clickupdate(); } }
[ "jai@192.168.0.3" ]
jai@192.168.0.3
a76d239a83e6a56d6fb356a9dfbf3feb44b03e33
508c5fbc1234b362ff8a3b0b70f823bcde7785ed
/src/main/java/com/jusfoun/catalog/common/dao/TreeDao.java
3c6efcc925e38c8a7ef7e598af8d6508247f5471
[]
no_license
liudebin2016/catalog
a077019ebb1843b8219bde19f8ff8a42251026c9
979eb36ca1602b270475a28d57694d1c97ebec88
refs/heads/master
2021-01-10T08:13:22.641125
2016-03-09T06:10:20
2016-03-09T06:10:20
50,328,709
3
2
null
null
null
null
UTF-8
Java
false
false
504
java
package com.jusfoun.catalog.common.dao; import com.jusfoun.catalog.common.entity.TreeEntity; import java.util.List; /** * DAO支持类实现 * @author Connor * @version 2015-12-18 * @param <T> */ public interface TreeDao<T extends TreeEntity<T>> extends CrudDao<T> { /** * 找到所有子节点 * @param entity * @return */ public List<T> findByParentIdsLike(T entity); /** * 更新所有父节点字段 * @param entity * @return */ public int updateParentIds(T entity); }
[ "elite527@hotmail.com" ]
elite527@hotmail.com
30ca3e9204c8b8be0f8da275f34ebd98a1de4223
ad42fec013b68b2c42e1ccbe4913aae84693db07
/app/src/main/java/com/yan/restaurant/bean/OrderDetail.java
795b8eda991935c28fbc5eca8d19339a1405e84a
[]
no_license
DuoDuoYan/myApplication
a7d580e66ead78d01ce71e77de93ac29d3383d0e
33072528ec3ecc8b6fae3d3db76bafd55badd390
refs/heads/master
2022-11-10T17:14:24.810816
2020-06-29T11:10:07
2020-06-29T11:10:07
262,838,299
0
0
null
null
null
null
UTF-8
Java
false
false
486
java
package com.yan.restaurant.bean; import com.google.gson.annotations.SerializedName; import java.io.Serializable; import lombok.Data; @Data public class OrderDetail implements Serializable { private Integer id; private Integer orderNum; //餐桌id private Integer tableNum; //餐桌名 private String tables; private String position; private String food; private String foodName; private Double price; private Integer quantity; }
[ "yancd8366@fxiaoke.com" ]
yancd8366@fxiaoke.com
884daa0147cdcf4cbe5bd39de535f0c67f85afdf
b122d74548ab385cc47252cd3a3ba44406c141dd
/appdom/target/generated-sources/delombok/appstraction/app/style/attr/Attr.java
9503c823ad5f7d8afde379729b98d18ba516a22a
[]
no_license
michan85/Appstraction
d56ba2ed2b19ef8c438ab4730feaafeb87964dbd
3ea70db33c737dc17ee9af37d5f8f1a9ad905604
refs/heads/master
2021-01-22T01:28:12.254904
2014-10-30T17:15:43
2014-10-30T17:15:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
228
java
package appstraction.app.style.attr; import appstraction.app.style.dom.Node; /** * Created by Michael.Hancock on 7/29/2014. */ public interface Attr<T> { public T get(Node owner); public boolean set(Node owner,T v); }
[ "michaeldangerhancock@gmail.com" ]
michaeldangerhancock@gmail.com
bd0076c4685dd7315198b88a90858660c747499b
aab642b4aa3368dfba49b5b13e589857356a4023
/JME/src/com/jmex/audio/openal/OpenALSource.java
0c60f1c8c94950b0896a7f850781ca04d64d0f63
[]
no_license
nathan-liyiming/game
56ebde6851b652dfdb902072d695b9f09dce8307
23d21f4ab55cf8f9aa31ddad83940bdcae583218
refs/heads/master
2016-09-07T18:33:15.460769
2014-02-18T04:17:43
2014-02-18T04:17:43
16,936,755
1
0
null
null
null
null
UTF-8
Java
false
false
2,382
java
/* * Copyright (c) 2003-2009 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'jMonkeyEngine' nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.jmex.audio.openal; import org.lwjgl.openal.AL10; import com.jmex.audio.AudioTrack; /** * Data class used for tracking the current state of an OpenAL Audio Source. * * @author Joshua Slack * @version $Id: OpenALSource.java 4133 2009-03-19 20:40:11Z blaine.dev $ */ public class OpenALSource { private int id = -1; private int state = AL10.AL_STOPPED; private AudioTrack track; public OpenALSource(int id) { this.id = id; } public int getState() { return state; } public void setState(int state) { this.state = state; } public int getId() { return id; } public AudioTrack getTrack() { return track; } public void setTrack(AudioTrack track) { this.track = track; } }
[ "nathan.liyiming@gmail.com" ]
nathan.liyiming@gmail.com
c0aaa9efc3ef2b4984e26e279aab92ecb75e4e0a
6073eec9fb608f7eacc2f45235508a56a4e7049f
/rpc-proxy/src/main/java/com/wheel/rpc/proxy/ProxyServer.java
a31e37b5f460d66b9e9592a16d0863ebce70a478
[]
no_license
haiswang1989/rpcwheel
aa8292781444e96aaa2fab7978cf6141eedc926d
b919300db065cc0c196340a9fa587d20efcc581f
refs/heads/master
2020-03-20T23:28:56.416096
2018-07-09T07:18:53
2018-07-09T07:18:53
137,848,445
2
1
null
null
null
null
UTF-8
Java
false
false
4,205
java
package com.wheel.rpc.proxy; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.apache.commons.collections.CollectionUtils; import com.wheel.rpc.cache.RegistryCache; import com.wheel.rpc.communication.client.impl.netty.NettyRemotingClient; import com.wheel.rpc.communication.server.impl.netty.NettyRemotingServer; import com.wheel.rpc.core.config.bean.RegistryConfigBean; import com.wheel.rpc.core.exception.RpcException; import com.wheel.rpc.core.model.ServiceProviderNode; import com.wheel.rpc.notify.INotify; import com.wheel.rpc.notify.NotifyFactory; import com.wheel.rpc.proxy.common.ProxyServiceCache; import com.wheel.rpc.proxy.handler.server.ProxyAsServerChildHandler; import com.wheel.rpc.proxy.netty.NettyUtils; import com.wheel.rpc.registry.IRegistry; import com.wheel.rpc.registry.RegistryFactory; import lombok.Setter; /** * 代理服务 * <p>Description:</p> * @author hansen.wang * @date 2018年6月7日 上午9:52:58 */ public class ProxyServer { /** proxy server端的worker线程数 */ private int serverWorkerThreadCount; /** proxy server端的boss线程数 */ private int serverBossThreadCount; /** proxy server端监听的端口 */ private int serverPort; /** 当前proxy代理的服务列表 */ private List<Class<?>> proxyServices; /** 注册中心的config信息 */ @Setter private RegistryConfigBean registryConfigBean; private IRegistry registry; public ProxyServer(int serverWorkerThreadCountArgs, int serverBossThreadCountArgs, int serverPortArgs, List<Class<?>> proxyServicesArgs) { this.serverWorkerThreadCount = serverWorkerThreadCountArgs; this.serverBossThreadCount = serverBossThreadCountArgs; this.serverPort = serverPortArgs; this.proxyServices = proxyServicesArgs; } /** * 启动前的初始化 */ public void init(int proxy2ServerWorkerCnt) { check(); registry = RegistryFactory.createRegistry(registryConfigBean); ConcurrentHashMap<String, List<ServiceProviderNode>> servicesProviders = RegistryCache.allServicesProviders(); //初始化与各个服务的提供者的连接 for (Map.Entry<String, List<ServiceProviderNode>> entry : servicesProviders.entrySet()) { String serviceName = entry.getKey(); List<ServiceProviderNode> providerNodes = entry.getValue(); ConcurrentHashMap<ServiceProviderNode, NettyRemotingClient> proxyClients = new ConcurrentHashMap<>(); for (ServiceProviderNode serviceProviderNode : providerNodes) { //创建Proxy与服务提供者的连接 NettyRemotingClient nettyRemotingClient = NettyUtils.createRemotingClient(serviceProviderNode, proxy2ServerWorkerCnt); proxyClients.put(serviceProviderNode, nettyRemotingClient); } //设置到缓存中 ProxyServiceCache.setServiceClients(serviceName, proxyClients); } } /** * check */ private void check() { if(null == registryConfigBean) { throw new RpcException("Registry config can not be null."); } if(CollectionUtils.isEmpty(proxyServices)) { throw new RpcException("Proxy services list can not be emptry."); } } /** * 初始化代理的服务 */ public Thread startProxyServer() { NettyRemotingServer proxyServer = new NettyRemotingServer(serverWorkerThreadCount, serverBossThreadCount, serverPort); proxyServer.setChildChannelInitializer(new ProxyAsServerChildHandler()); proxyServer.init(); Thread waitCloseThread = proxyServer.open(); proxyServer.waitForDown(); return waitCloseThread; } /** * 订阅变化 */ public void subscribe() { for (Class<?> serviceClazz : proxyServices) { String serviceName = serviceClazz.getName(); INotify notify = NotifyFactory.createNotify(serviceName, registryConfigBean); registry.subscribe(notify); } } }
[ "hansen.wang@vipshop.com" ]
hansen.wang@vipshop.com
ceb714e759bbcf94aa3f0aa5d6f21dfb89a677f5
cd81f873c48d1eebb57de9c717cdbab463de1764
/src/test/java/com/thiendz/j6/BeKairshopApplicationTests.java
a2130a88c53c1e682c85469170c5acf93569531e
[]
no_license
PhamHuyThien/karlshop-server
8451d5ef639d78ceb5ee604c6d561472e19575d7
a921ef832f30912ed7a359c27149802e17ddd082
refs/heads/master
2023-07-03T03:45:49.219811
2021-08-07T12:09:05
2021-08-07T12:09:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
210
java
package com.thiendz.j6; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class BeKairshopApplicationTests { @Test void contextLoads() { } }
[ "sync.mail.pc@gmail.com" ]
sync.mail.pc@gmail.com
dd83dbce39df78f4a9fdbdd7651b02c456323e67
a744882fb7cf18944bd6719408e5a9f2f0d6c0dd
/sourcecode8/src/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
93c2b8139609cec2d443a4f4af5b764fdf3e2eb1
[ "Apache-2.0" ]
permissive
hanekawasann/learn
a39b8d17fd50fa8438baaa5b41fdbe8bd299ab33
eef678f1b8e14b7aab966e79a8b5a777cfc7ab14
refs/heads/master
2022-09-13T02:18:07.127489
2020-04-26T07:58:35
2020-04-26T07:58:35
176,686,231
0
0
Apache-2.0
2022-09-01T23:21:38
2019-03-20T08:16:05
Java
UTF-8
Java
false
false
17,463
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * This file is available under and governed by the GNU General Public * License version 2 only, as published by the Free Software Foundation. * However, the following notice accompanied the original version of this * file: * * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at * http://creativecommons.org/publicdomain/zero/1.0/ */ package java.util.concurrent.atomic; import java.util.function.UnaryOperator; import java.util.function.BinaryOperator; import sun.misc.Unsafe; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.security.AccessController; import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; import sun.reflect.CallerSensitive; import sun.reflect.Reflection; /** * A reflection-based utility that enables atomic updates to * designated {@code volatile} reference fields of designated * classes. This class is designed for use in atomic data structures * in which several reference fields of the same node are * independently subject to atomic updates. For example, a tree node * might be declared as * * <pre> {@code * class Node { * private volatile Node left, right; * * private static final AtomicReferenceFieldUpdater<Node, Node> leftUpdater = * AtomicReferenceFieldUpdater.newUpdater(Node.class, Node.class, "left"); * private static AtomicReferenceFieldUpdater<Node, Node> rightUpdater = * AtomicReferenceFieldUpdater.newUpdater(Node.class, Node.class, "right"); * * Node getLeft() { return left; } * boolean compareAndSetLeft(Node expect, Node update) { * return leftUpdater.compareAndSet(this, expect, update); * } * // ... and so on * }}</pre> * * <p>Note that the guarantees of the {@code compareAndSet} * method in this class are weaker than in other atomic classes. * Because this class cannot ensure that all uses of the field * are appropriate for purposes of atomic access, it can * guarantee atomicity only with respect to other invocations of * {@code compareAndSet} and {@code set} on the same updater. * * @param <T> The type of the object holding the updatable field * @param <V> The type of the field * @author Doug Lea * @since 1.5 */ public abstract class AtomicReferenceFieldUpdater<T, V> { /** * Creates and returns an updater for objects with the given field. * The Class arguments are needed to check that reflective types and * generic types match. * * @param tclass the class of the objects holding the field * @param vclass the class of the field * @param fieldName the name of the field to be updated * @param <U> the type of instances of tclass * @param <W> the type of instances of vclass * @return the updater * @throws ClassCastException if the field is of the wrong type * @throws IllegalArgumentException if the field is not volatile * @throws RuntimeException with a nested reflection-based * exception if the class does not hold field or is the wrong type, * or the field is inaccessible to the caller according to Java language * access control */ @CallerSensitive public static <U, W> AtomicReferenceFieldUpdater<U, W> newUpdater(Class<U> tclass, Class<W> vclass, String fieldName) { return new AtomicReferenceFieldUpdaterImpl<U, W>(tclass, vclass, fieldName, Reflection.getCallerClass()); } /** * Protected do-nothing constructor for use by subclasses. */ protected AtomicReferenceFieldUpdater() { } /** * Atomically sets the field of the given object managed by this updater * to the given updated value if the current value {@code ==} the * expected value. This method is guaranteed to be atomic with respect to * other calls to {@code compareAndSet} and {@code set}, but not * necessarily with respect to other changes in the field. * * @param obj An object whose field to conditionally set * @param expect the expected value * @param update the new value * @return {@code true} if successful */ public abstract boolean compareAndSet(T obj, V expect, V update); /** * Atomically sets the field of the given object managed by this updater * to the given updated value if the current value {@code ==} the * expected value. This method is guaranteed to be atomic with respect to * other calls to {@code compareAndSet} and {@code set}, but not * necessarily with respect to other changes in the field. * * <p><a href="package-summary.html#weakCompareAndSet">May fail * spuriously and does not provide ordering guarantees</a>, so is * only rarely an appropriate alternative to {@code compareAndSet}. * * @param obj An object whose field to conditionally set * @param expect the expected value * @param update the new value * @return {@code true} if successful */ public abstract boolean weakCompareAndSet(T obj, V expect, V update); /** * Sets the field of the given object managed by this updater to the * given updated value. This operation is guaranteed to act as a volatile * store with respect to subsequent invocations of {@code compareAndSet}. * * @param obj An object whose field to set * @param newValue the new value */ public abstract void set(T obj, V newValue); /** * Eventually sets the field of the given object managed by this * updater to the given updated value. * * @param obj An object whose field to set * @param newValue the new value * @since 1.6 */ public abstract void lazySet(T obj, V newValue); /** * Gets the current value held in the field of the given object managed * by this updater. * * @param obj An object whose field to get * @return the current value */ public abstract V get(T obj); /** * Atomically sets the field of the given object managed by this updater * to the given value and returns the old value. * * @param obj An object whose field to get and set * @param newValue the new value * @return the previous value */ public V getAndSet(T obj, V newValue) { V prev; do { prev = get(obj); } while (!compareAndSet(obj, prev, newValue)); return prev; } /** * Atomically updates the field of the given object managed by this updater * with the results of applying the given function, returning the previous * value. The function should be side-effect-free, since it may be * re-applied when attempted updates fail due to contention among threads. * * @param obj An object whose field to get and set * @param updateFunction a side-effect-free function * @return the previous value * @since 1.8 */ public final V getAndUpdate(T obj, UnaryOperator<V> updateFunction) { V prev, next; do { prev = get(obj); next = updateFunction.apply(prev); } while (!compareAndSet(obj, prev, next)); return prev; } /** * Atomically updates the field of the given object managed by this updater * with the results of applying the given function, returning the updated * value. The function should be side-effect-free, since it may be * re-applied when attempted updates fail due to contention among threads. * * @param obj An object whose field to get and set * @param updateFunction a side-effect-free function * @return the updated value * @since 1.8 */ public final V updateAndGet(T obj, UnaryOperator<V> updateFunction) { V prev, next; do { prev = get(obj); next = updateFunction.apply(prev); } while (!compareAndSet(obj, prev, next)); return next; } /** * Atomically updates the field of the given object managed by this * updater with the results of applying the given function to the * current and given values, returning the previous value. The * function should be side-effect-free, since it may be re-applied * when attempted updates fail due to contention among threads. The * function is applied with the current value as its first argument, * and the given update as the second argument. * * @param obj An object whose field to get and set * @param x the update value * @param accumulatorFunction a side-effect-free function of two arguments * @return the previous value * @since 1.8 */ public final V getAndAccumulate(T obj, V x, BinaryOperator<V> accumulatorFunction) { V prev, next; do { prev = get(obj); next = accumulatorFunction.apply(prev, x); } while (!compareAndSet(obj, prev, next)); return prev; } /** * Atomically updates the field of the given object managed by this * updater with the results of applying the given function to the * current and given values, returning the updated value. The * function should be side-effect-free, since it may be re-applied * when attempted updates fail due to contention among threads. The * function is applied with the current value as its first argument, * and the given update as the second argument. * * @param obj An object whose field to get and set * @param x the update value * @param accumulatorFunction a side-effect-free function of two arguments * @return the updated value * @since 1.8 */ public final V accumulateAndGet(T obj, V x, BinaryOperator<V> accumulatorFunction) { V prev, next; do { prev = get(obj); next = accumulatorFunction.apply(prev, x); } while (!compareAndSet(obj, prev, next)); return next; } private static final class AtomicReferenceFieldUpdaterImpl<T, V> extends AtomicReferenceFieldUpdater<T, V> { private static final Unsafe unsafe = Unsafe.getUnsafe(); private final long offset; private final Class<T> tclass; private final Class<V> vclass; private final Class<?> cclass; /* * Internal type checks within all update methods contain * internal inlined optimizations checking for the common * cases where the class is final (in which case a simple * getClass comparison suffices) or is of type Object (in * which case no check is needed because all objects are * instances of Object). The Object case is handled simply by * setting vclass to null in constructor. The targetCheck and * updateCheck methods are invoked when these faster * screenings fail. */ AtomicReferenceFieldUpdaterImpl(final Class<T> tclass, final Class<V> vclass, final String fieldName, final Class<?> caller) { final Field field; final Class<?> fieldClass; final int modifiers; try { field = AccessController.doPrivileged(new PrivilegedExceptionAction<Field>() { public Field run() throws NoSuchFieldException { return tclass.getDeclaredField(fieldName); } }); modifiers = field.getModifiers(); sun.reflect.misc.ReflectUtil.ensureMemberAccess(caller, tclass, null, modifiers); ClassLoader cl = tclass.getClassLoader(); ClassLoader ccl = caller.getClassLoader(); if ((ccl != null) && (ccl != cl) && ((cl == null) || !isAncestor(cl, ccl))) { sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); } fieldClass = field.getType(); } catch (PrivilegedActionException pae) { throw new RuntimeException(pae.getException()); } catch (Exception ex) { throw new RuntimeException(ex); } if (vclass != fieldClass) { throw new ClassCastException(); } if (!Modifier.isVolatile(modifiers)) { throw new IllegalArgumentException("Must be volatile type"); } this.cclass = (Modifier.isProtected(modifiers) && caller != tclass) ? caller : null; this.tclass = tclass; if (vclass == Object.class) { this.vclass = null; } else { this.vclass = vclass; } offset = unsafe.objectFieldOffset(field); } /** * Returns true if the second classloader can be found in the first * classloader's delegation chain. * Equivalent to the inaccessible: first.isAncestor(second). */ private static boolean isAncestor(ClassLoader first, ClassLoader second) { ClassLoader acl = first; do { acl = acl.getParent(); if (second == acl) { return true; } } while (acl != null); return false; } void targetCheck(T obj) { if (!tclass.isInstance(obj)) { throw new ClassCastException(); } if (cclass != null) { ensureProtectedAccess(obj); } } void updateCheck(T obj, V update) { if (!tclass.isInstance(obj) || (update != null && vclass != null && !vclass.isInstance(update))) { throw new ClassCastException(); } if (cclass != null) { ensureProtectedAccess(obj); } } public boolean compareAndSet(T obj, V expect, V update) { if (obj == null || obj.getClass() != tclass || cclass != null || (update != null && vclass != null && vclass != update.getClass())) { updateCheck(obj, update); } return unsafe.compareAndSwapObject(obj, offset, expect, update); } public boolean weakCompareAndSet(T obj, V expect, V update) { // same implementation as strong form for now if (obj == null || obj.getClass() != tclass || cclass != null || (update != null && vclass != null && vclass != update.getClass())) { updateCheck(obj, update); } return unsafe.compareAndSwapObject(obj, offset, expect, update); } public void set(T obj, V newValue) { if (obj == null || obj.getClass() != tclass || cclass != null || (newValue != null && vclass != null && vclass != newValue.getClass())) { updateCheck(obj, newValue); } unsafe.putObjectVolatile(obj, offset, newValue); } public void lazySet(T obj, V newValue) { if (obj == null || obj.getClass() != tclass || cclass != null || (newValue != null && vclass != null && vclass != newValue.getClass())) { updateCheck(obj, newValue); } unsafe.putOrderedObject(obj, offset, newValue); } @SuppressWarnings("unchecked") public V get(T obj) { if (obj == null || obj.getClass() != tclass || cclass != null) { targetCheck(obj); } return (V) unsafe.getObjectVolatile(obj, offset); } @SuppressWarnings("unchecked") public V getAndSet(T obj, V newValue) { if (obj == null || obj.getClass() != tclass || cclass != null || (newValue != null && vclass != null && vclass != newValue.getClass())) { updateCheck(obj, newValue); } return (V) unsafe.getAndSetObject(obj, offset, newValue); } private void ensureProtectedAccess(T obj) { if (cclass.isInstance(obj)) { return; } throw new RuntimeException(new IllegalAccessException( "Class " + cclass.getName() + " can not access a protected member of class " + tclass.getName() + " using an instance of " + obj.getClass().getName())); } } }
[ "763803382@qq.com" ]
763803382@qq.com
93a0ecc9abd6a77a1159ac395dee209ad67ab429
55590de584b231b4b063e622c27c0dd18d6c9dde
/src/ttps/dao/InfraestructuraDao.java
7148c2f65e81f7504b43e391d62edd7bb27760ae
[]
no_license
apvenero/Comedor-Universitario-UNLP
6fae5ec4bc0048ad4274d4c8e9c61546c2e5f566
a3a4154093a5d409cb834d48a43499f42547a8ca
refs/heads/master
2021-01-12T12:39:55.647216
2017-10-26T02:31:46
2017-10-26T02:31:46
69,897,850
0
0
null
null
null
null
UTF-8
Java
false
false
129
java
package ttps.dao; import ttps.clases.Sugerencia; public interface InfraestructuraDao extends GenericDao<Sugerencia>{ }
[ "ap.venero@gmail.com" ]
ap.venero@gmail.com
042d044d6908c436efa805b791e80c026485913c
27cf028efd3f361f85e3fc8a9148c503230ab484
/DSExperiment/src/com/hpu/fyx/daoImpl/TeacherDaoImpl.java
d2fad8f2200bef3c9d2abebb656a945abf7ea64c
[]
no_license
Mickxuanyuan/DSExperiment
cea6b96f6ae09f1efd2f976eab8522963eddc07d
62872c821f62138350c5ce85c3437f64a50b9a70
refs/heads/master
2021-06-03T07:33:11.598837
2018-02-08T04:26:24
2018-02-08T04:26:24
58,024,251
0
0
null
null
null
null
UTF-8
Java
false
false
7,888
java
package com.hpu.fyx.daoImpl; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.mybatis.spring.support.SqlSessionDaoSupport; import com.hpu.fyx.dao.TeacherDao; import com.hpu.fyx.model.Major; import com.hpu.fyx.model.Pagination; import com.hpu.fyx.model.Question; import com.hpu.fyx.model.SignIn; import com.hpu.fyx.model.Task; import com.hpu.fyx.model.User; public class TeacherDaoImpl extends SqlSessionDaoSupport implements TeacherDao { private static final String CLASS_NAME = Question.class.getName(); private static final String CLASS_NAME_Major = Major.class.getName(); private static final String CLASS_NAME_User = User.class.getName(); private static final String CLASS_NAME_Task = Task.class.getName(); private static final String CLASS_NAME_SignIn = SignIn.class.getName(); @Override public List<Question> queryQuestionList(Pagination pagination) { Map<String, Object> params = new HashMap<String, Object>(); params.put("pageSize", pagination.getPageSize()); params.put("startIndex", pagination.getStartIndex()); params.put("searchContent", pagination.getSearchContent()); params.put("chapterId", pagination.getChapterId()); return getSqlSession().selectList(CLASS_NAME + ".queryQuestion", params); } @Override public int queryQuestionListCount(Pagination pagination) { Map<String, Object> params = new HashMap<String, Object>(); params.put("searchContent", pagination.getSearchContent()); params.put("chapterId", pagination.getChapterId()); return getSqlSession().selectOne(CLASS_NAME + ".getQuestionCount", params); } @Override public Question updateQuestion(int questionId) { return getSqlSession().selectOne(CLASS_NAME + ".showAQuestion", questionId); } @Override public void editQuestion(Question question) { getSqlSession().update(CLASS_NAME + ".updateQuestion", question); } @Override public void deleteQuestion(String[] ids) { for (String id : ids) { int questionId = Integer.parseInt(id); getSqlSession().delete(CLASS_NAME + ".deleteQuestion", questionId); } } @Override public void addQuestion(Question question) { getSqlSession().insert(CLASS_NAME + ".addQuestion", question); } @Override public List<Major> getMajorList(int userId) { return getSqlSession().selectList(CLASS_NAME_Major + ".getMajorList", userId); } @Override public List<Question> getAllQuestionList(int chapterId) { return getSqlSession().selectList(CLASS_NAME + ".getAllQuestionList", chapterId); } @Override public void insertTask(Task task) { getSqlSession().insert(CLASS_NAME_Task + ".addTask", task); int increaseId = task.getTaskId(); int majorId = task.getMajorId(); List<User> list = new ArrayList<User>(); list = getSqlSession().selectList(CLASS_NAME_User + ".getStudentIdsByMajorId", majorId); String[] questionIds = task.getQuestionIds(); for (User student : list) { for (String questionId : questionIds) { Map<String, Object> params = new HashMap<String, Object>(); params.put("taskId", increaseId); params.put("questionId", questionId); int studentId = student.getId(); params.put("studentId", studentId); getSqlSession().selectList(CLASS_NAME_Task + ".addTaskDetail", params); } } } @Override public List<Task> getTaskList() { return getSqlSession().selectList(CLASS_NAME_Task + ".getTaskList"); } @Override public List<Question> getQuestionCount(int chapterId) { return getSqlSession().selectList(CLASS_NAME + ".queryQuestionCount", chapterId); } @Override public void deleteTask(String[] taskIds) { try { for (String id : taskIds) { int taskId = Integer.parseInt(id); getSqlSession().delete(CLASS_NAME_Task + ".deleteTaskDetail", taskId); getSqlSession().delete(CLASS_NAME_Task + ".deleteTask", taskId); } } catch (Exception e) { System.out.println("有个异常在这哈哈哈哈"); e.printStackTrace(); } } @Override public List<Task> queryEditTask(int taskId) { return getSqlSession().selectList(CLASS_NAME_Task + ".queryEditTask", taskId); } @Override public void updateTask(Task task) { getSqlSession().insert(CLASS_NAME_Task + ".updateTask", task); int taskId = task.getTaskId(); int majorId = task.getMajorId(); List<User> list = new ArrayList<User>(); list = getSqlSession().selectList(CLASS_NAME_User + ".getStudentIdsByMajorId", majorId); String[] questionIds = task.getQuestionIds(); for (User student : list) { for (String questionId : questionIds) { Map<String, Object> params = new HashMap<String, Object>(); params.put("taskId", taskId); params.put("questionId", questionId); int studentId = student.getId(); params.put("studentId", studentId); getSqlSession().selectList(CLASS_NAME_Task + ".addTaskDetail", params); } } } @Override public List<SignIn> querySignInList(int userId) { List<SignIn> signInList = new ArrayList<SignIn>(); List<Major> majorList = getSqlSession().selectList(CLASS_NAME_Major + ".getMajorList", userId); for (Major major : majorList) { int majorId = major.getId(); int studentNumber = getSqlSession().selectOne(CLASS_NAME_User + ".getStudentNumbers", majorId); String majorName = getSqlSession().selectOne(CLASS_NAME_Major + ".getMajorName", majorId); List<Task> list = getSqlSession().selectList(CLASS_NAME_Task + ".queryBaseTask", majorId); for (Task task : list) { SignIn signIn = new SignIn(); signIn.setSignNumber(studentNumber); signIn.setTaskId(task.getTaskId()); String taskDate = task.getDate(); signIn.setDate(taskDate); signIn.setMajor(majorName); Map<String, Object> params = new HashMap<String, Object>(); params.put("majorId", majorId); params.put("taskDate", taskDate); int unSignNumber = getSqlSession().selectOne(CLASS_NAME_User + ".getUnSignNumbers", params); signIn.setUnSignNumber(unSignNumber); signInList.add(signIn); } } return signInList; } @Override public List<SignIn> getSignUpload(String majorName, String date) { Map<String, Object> params = new HashMap<String, Object>(); params.put("majorName", majorName); params.put("taskDate", date); return getSqlSession().selectList(CLASS_NAME_SignIn + ".getSignUpload", params); } @Override public List<SignIn> signInDetail(String majorName, String date) { int majorId = getSqlSession().selectOne(CLASS_NAME_Major + ".getMajorId", majorName); Map<String, Object> params = new HashMap<String, Object>(); params.put("majorId", majorId); params.put("taskDate", date); return getSqlSession().selectList(CLASS_NAME_SignIn + ".getSignUpload", params); } @Override public List<User> signInTotal(int majorId, String startDate, String endDate) { List<User> studentList = getSqlSession().selectList(CLASS_NAME_User + ".getStudenListByMajorId", majorId); List<User> userList = new ArrayList<User>(); for (User user : studentList) { Map<String, Object> params = new HashMap<String, Object>(); params.put("userId", user.getId()); params.put("majorId", majorId); params.put("startDate", startDate); params.put("endDate", endDate); int signTotal = getSqlSession().selectOne(CLASS_NAME_Task + ".getSignTotal", params); int hadSignTotal = getSqlSession().selectOne(CLASS_NAME_Task + ".getHadSign", params); int hadUpload = getSqlSession().selectOne(CLASS_NAME_Task + ".getHadUpload", params); int hadNotSignTotal = signTotal - hadSignTotal; int hadNotUpload = signTotal - hadUpload; user.setHadNotSignTotal(hadNotSignTotal); user.setHadNotUpload(hadNotUpload); user.setSignTotal(hadSignTotal); userList.add(user); } return userList; } }
[ "303062086@qq.com" ]
303062086@qq.com
78fda8cfa077d594873efb90cf5ffcda6d78e655
7078357c834c1d3538af4f66688f5973575996eb
/src/main/java/com/jinxin/service/paygateway/enterprise/citic/util/citicUtil/XmlDataInterfaceService.java
88f3f3beaaded4ad4ef5474f20a7df9aede4657c
[]
no_license
kai0sec/PWeb
1cb33b4d404d3c5e06cf523dc5e9e4e0f2cb0ac0
e21c48928e025340422cb750f7bf8d02b086262f
refs/heads/master
2021-12-04T11:38:37.384544
2015-03-18T01:21:43
2015-03-18T01:21:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,782
java
package com.jinxin.service.paygateway.enterprise.citic.util.citicUtil; import com.lsy.baselib.comPkg.ResultPackage; import com.lsy.baselib.xml.XmlDocument; import com.lsy.baselib.xml.element.XmlEBStream; import com.lsy.baselib.xml.element.XmlField; import com.lsy.baselib.xml.element.XmlList; import com.lsy.baselib.xml.element.XmlRow; import javax.servlet.http.HttpServletRequest; import java.util.*; public class XmlDataInterfaceService { private HashMap xmlcontenthash = new HashMap(); private HashMap datatoxmlhash = new HashMap(); private ArrayList keylist = new ArrayList(); public String resultXml; public void parseResultEBStream(String xmlcontent) throws Exception { if(xmlcontent.equals("")) return; XmlEBStream ebResPkg = XmlDocument.parseXmlEBStream(xmlcontent.trim()); List fldlist = ebResPkg.getAllField(); if (fldlist.size() > 0) { for (int i = 0; i < fldlist.size(); i++) { this.processField((XmlField) fldlist.get(i)); } } List xmllists = ebResPkg.getAllList(); if (xmllists.size() > 0) { for (int j = 0; j < xmllists.size(); j++) { this.processList((XmlList) xmllists.get(j)); } } } public HashMap getXmlContentHash(){ return this.xmlcontenthash; } public String getXmlFieldValue(String fldname) { return (String) xmlcontenthash.get(fldname); } public CommBean getXmlList(String listname) { CommBean bean = (CommBean) xmlcontenthash.get(listname); return bean; } private void processField(XmlField field) throws Exception { String key = field.getName(); String value = field.getValue(); xmlcontenthash.put(key, value); } private void processList(XmlList xmllist) throws Exception { String listname = xmllist.getListName(); CommBean bean = null; String[] header = null; for (int i = 0; i < xmllist.size(); i++) { XmlRow row = (XmlRow) xmllist.getRow(i); List fieldlist = row.listField(); if (i == 0) {// ��һ�в���Header header = new String[fieldlist.size()]; for (int j = 0; j < fieldlist.size(); j++) { XmlField field = (XmlField) fieldlist.get(j); header[j] = field.getName(); } bean = new CommBean(header); } //���������β��� String[] beanrow = new String[fieldlist.size()]; for (int j = 0; j < fieldlist.size(); j++) { XmlField field = (XmlField) fieldlist.get(j); beanrow[j] = field.getValue(); } bean.appendRow(beanrow); } xmlcontenthash.put(listname, bean); } public void setXmlField(String name, String value){ datatoxmlhash.put(name, value); keylist.add(name); } public void setXmlList(String beanname, CommBean bean){ datatoxmlhash.put(beanname, bean); keylist.add(beanname); } public XmlEBStream formXml() throws Exception { XmlEBStream ebResPkg = XmlDocument.createXmlEBStream(); for(int i=0;i<this.keylist.size();i++){ String key = keylist.get(i).toString(); //System.out.println(key); Object value = datatoxmlhash.get(key); if (value instanceof String) { ebResPkg.addField(key, value.toString()); } if (value instanceof CommBean) { CommBean bean = (CommBean)value; this.addXMLListToEBStream(ebResPkg, new CommBean(bean.getData()), key); } } //System.out.println(ebResPkg.asXmlDoc()); this.resultXml = ebResPkg.asXmlDoc(); return ebResPkg; } private void addXMLListToEBStream(XmlEBStream ebpack, CommBean bean, String listname) throws Exception { String[][] data = bean.getData(); String[] header = data[0]; XmlList xmlList = ebpack.addList(listname); while (bean.next()) { XmlRow xmlRow = xmlList.addRow("row"); for (int j = 0; j < header.length; j++) { xmlRow.addField(header[j], bean.getValue(header[j])); } } } }
[ "1027450752@qq.com" ]
1027450752@qq.com
e3be222ca2243f75bfa5658b5b55e13814a9006c
b4ded06e3ef8658c4426264b3681d8cff14959c7
/LMS/src/com/gcit/lms/web/AdminPublisherServlet1.java
1709a0750295b77edc294ed1cde128bbb9353a0b
[]
no_license
vigneshran/LMS
202836235a4d21f2963ea4ad7a2055f5459c7ee6
dcbf4c72c5a0ec7de32ff8aa7a5672e4c514a926
refs/heads/master
2021-01-20T08:40:27.318001
2017-05-03T17:25:23
2017-05-03T17:25:23
90,174,732
0
0
null
null
null
null
UTF-8
Java
false
false
2,155
java
package com.gcit.lms.web; import java.io.IOException; import java.sql.SQLException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.gcit.lms.entity.Author; import com.gcit.lms.entity.Publisher; import com.gcit.lms.service.AdminService; /** * Servlet implementation class AdminPublisherServlet1 */ @WebServlet("/deletePublisher") public class AdminPublisherServlet1 extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public AdminPublisherServlet1() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub response.getWriter().append("Served at: ").append(request.getContextPath()); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); AdminService service = new AdminService(); Publisher deletePublisher = new Publisher(); Integer pubId = Integer.parseInt(request.getParameter("publisherId")); deletePublisher.setPublisherId(pubId); Publisher publisher = null; try { Author originalAuthor = new Author(); publisher = service.returnPublisherObjectById(pubId).get(0); service.deletePublisher(deletePublisher); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } request.setAttribute("deleteMessage", publisher.getPublisherName()); RequestDispatcher rd2 = request.getRequestDispatcher("/adminupdateanddeletepublishers.jsp"); rd2.forward(request, response); } }
[ "rangaraj.vignesh@ou.edu" ]
rangaraj.vignesh@ou.edu
34d86ca3a41ea56a921aaf567ae43f3ecc88d7e6
6e5f456f59c5df0d96baac23f70d67a01dade57a
/src/main/java/org/example/fileUpload/auth/User.java
df42cd45a9d625457348e563b54f0da9dbe45588
[]
no_license
pradyumn1442/assignment4
abe56b9df0a35144009c37162bfa03839a803675
19bce3d8bde795c86dc601b4ca84c72e28fa811b
refs/heads/master
2020-05-19T10:25:52.658352
2015-04-07T18:21:00
2015-04-07T18:21:00
33,560,051
0
0
null
null
null
null
UTF-8
Java
false
false
1,599
java
package org.example.fileUpload.auth; import java.util.Collection; import java.util.Collections; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.userdetails.UserDetails; public class User implements UserDetails { public static UserDetails create(String username, String password, String...authorities) { return new User(username, password, authorities); } private final Collection<GrantedAuthority> authorities_; private final String password_; private final String username_; @SuppressWarnings("unchecked") private User(String username, String password) { this(username, password, Collections.EMPTY_LIST); } private User(String username, String password, String...authorities) { username_ = username; password_ = password; authorities_ = AuthorityUtils.createAuthorityList(authorities); } private User(String username, String password, Collection<GrantedAuthority> authorities) { super(); username_ = username; password_ = password; authorities_ = authorities; } public Collection<GrantedAuthority> getAuthorities() { return authorities_; } public String getPassword() { return password_; } public String getUsername() { return username_; } @Override public boolean isAccountNonExpired() { return true; } @Override public boolean isAccountNonLocked() { return true; } @Override public boolean isCredentialsNonExpired() { return true; } @Override public boolean isEnabled() { return true; } }
[ "pradyumn1442@iiitd.ac.in" ]
pradyumn1442@iiitd.ac.in
2397548375bc0ca970846dbfe639224c094ea23f
386de45dd8a49d81f2b2adc64aa77e7c4ae19e00
/src/test/java/hello/core/AutoWiredTest/AutowiredTest.java
8da55db49105da33a3751ae22e9e3f11c61064d5
[]
no_license
salmon2/spring2_core
b25240ac2483b5b32b2a571837ce2eabdce9c341
30bfc51c418e2dd5c683a1f9023b983b0a694b89
refs/heads/master
2023-02-21T18:10:40.993557
2021-01-18T14:47:43
2021-01-18T14:47:43
328,352,389
1
0
null
null
null
null
UTF-8
Java
false
false
1,110
java
package hello.core.AutoWiredTest; import hello.core.member.Member; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.lang.Nullable; import java.util.Optional; public class AutowiredTest { @Test void AutowiredOption(){ ApplicationContext ac= new AnnotationConfigApplicationContext(TestBean.class); } static class TestBean{ //호출 안됨 @Autowired(required = false) public void setNoBean1(Member member) { System.out.println("setNoBean1 = " + member); } //null 호출 @Autowired public void setNoBean2(@Nullable Member member) { System.out.println("setNoBean2 = " + member); } //Optional.empty 호출 @Autowired(required = false) public void setNoBean3(Optional<Member> member) { System.out.println("setNoBean3 = " + member); } } }
[ "dys04076@naver.com" ]
dys04076@naver.com
c03056c8a33d48cbeec9c91e4048bde6e807e3d9
e72f817b2e2d80125784bb9a8171b9ccd995903c
/app/src/main/java/f/star/iota/milk/ui/moe005tv/moe/MOE005TVFragment.java
d550e406431bafb29df1f1a6ed9270e4187edcd1
[]
no_license
qqq58452077/milk-fresco
9803252ad85a62a0b523c71e9d77c10af73c690b
fd50f3ac0a54f383d9b731f56effd0888d57b7a1
refs/heads/master
2021-12-07T09:01:14.581608
2021-11-29T08:11:19
2021-11-29T08:11:19
206,455,246
9
5
null
2019-09-05T02:12:42
2019-09-05T02:12:42
null
UTF-8
Java
false
false
763
java
package f.star.iota.milk.ui.moe005tv.moe; import android.os.Bundle; import f.star.iota.milk.base.ScrollImageFragment; public class MOE005TVFragment extends ScrollImageFragment<MOE005TVPresenter, MOE005TVAdapter> { public static MOE005TVFragment newInstance(String url) { MOE005TVFragment fragment = new MOE005TVFragment(); Bundle bundle = new Bundle(); bundle.putString("base_url", url); bundle.putString("page_suffix", ".html"); fragment.setArguments(bundle); return fragment; } @Override protected MOE005TVPresenter getPresenter() { return new MOE005TVPresenter(this); } @Override protected MOE005TVAdapter getAdapter() { return new MOE005TVAdapter(); } }
[ "iota.9star@foxmail.com" ]
iota.9star@foxmail.com
ac2a194f745bf938207131dfb6a06c9b0d381ff9
e054c1e6903e4b5eb166d107802c0c2cadd2eb03
/modules/datex-serializer/src/generated/java/eu/datex2/schema/_3/locationreferencing/PointCoordinates.java
86c92d0fa2baa69abfb1288ca1b59a40af4b3fe5
[ "MIT" ]
permissive
svvsaga/gradle-modules-public
02dc90ad2feb58aef7629943af3e0d3a9f61d5cf
e4ef4e2ed5d1a194ff426411ccb3f81d34ff4f01
refs/heads/main
2023-05-27T08:25:36.578399
2023-05-12T14:15:47
2023-05-12T14:33:14
411,986,217
2
1
MIT
2023-05-12T14:33:15
2021-09-30T08:36:11
Java
UTF-8
Java
false
false
5,568
java
package eu.datex2.schema._3.locationreferencing; import java.util.ArrayList; import java.util.List; import eu.datex2.schema._3.common._ExtensionType; import jakarta.xml.bind.annotation.XmlAccessType; import jakarta.xml.bind.annotation.XmlAccessorType; import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlType; /** * <p>Java class for PointCoordinates complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="PointCoordinates"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="latitude" type="{http://datex2.eu/schema/3/common}Float"/&gt; * &lt;element name="longitude" type="{http://datex2.eu/schema/3/common}Float"/&gt; * &lt;element name="heightCoordinate" type="{http://datex2.eu/schema/3/locationReferencing}HeightCoordinate" maxOccurs="3" minOccurs="0"/&gt; * &lt;element name="positionConfidenceEllipse" type="{http://datex2.eu/schema/3/locationReferencing}PositionConfidenceEllipse" minOccurs="0"/&gt; * &lt;element name="horizontalPositionAccuracy" type="{http://datex2.eu/schema/3/locationReferencing}PositionAccuracy" minOccurs="0"/&gt; * &lt;element name="_pointCoordinatesExtension" type="{http://datex2.eu/schema/3/common}_ExtensionType" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PointCoordinates", propOrder = { "latitude", "longitude", "heightCoordinate", "positionConfidenceEllipse", "horizontalPositionAccuracy", "_PointCoordinatesExtension" }) public class PointCoordinates { protected float latitude; protected float longitude; protected List<HeightCoordinate> heightCoordinate; protected PositionConfidenceEllipse positionConfidenceEllipse; protected PositionAccuracy horizontalPositionAccuracy; @XmlElement(name = "_pointCoordinatesExtension") protected _ExtensionType _PointCoordinatesExtension; /** * Gets the value of the latitude property. * */ public float getLatitude() { return latitude; } /** * Sets the value of the latitude property. * */ public void setLatitude(float value) { this.latitude = value; } /** * Gets the value of the longitude property. * */ public float getLongitude() { return longitude; } /** * Sets the value of the longitude property. * */ public void setLongitude(float value) { this.longitude = value; } /** * Gets the value of the heightCoordinate 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 Jakarta XML Binding object. * This is why there is not a <CODE>set</CODE> method for the heightCoordinate property. * * <p> * For example, to add a new item, do as follows: * <pre> * getHeightCoordinate().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link HeightCoordinate } * * */ public List<HeightCoordinate> getHeightCoordinate() { if (heightCoordinate == null) { heightCoordinate = new ArrayList<HeightCoordinate>(); } return this.heightCoordinate; } /** * Gets the value of the positionConfidenceEllipse property. * * @return * possible object is * {@link PositionConfidenceEllipse } * */ public PositionConfidenceEllipse getPositionConfidenceEllipse() { return positionConfidenceEllipse; } /** * Sets the value of the positionConfidenceEllipse property. * * @param value * allowed object is * {@link PositionConfidenceEllipse } * */ public void setPositionConfidenceEllipse(PositionConfidenceEllipse value) { this.positionConfidenceEllipse = value; } /** * Gets the value of the horizontalPositionAccuracy property. * * @return * possible object is * {@link PositionAccuracy } * */ public PositionAccuracy getHorizontalPositionAccuracy() { return horizontalPositionAccuracy; } /** * Sets the value of the horizontalPositionAccuracy property. * * @param value * allowed object is * {@link PositionAccuracy } * */ public void setHorizontalPositionAccuracy(PositionAccuracy value) { this.horizontalPositionAccuracy = value; } /** * Gets the value of the _PointCoordinatesExtension property. * * @return * possible object is * {@link _ExtensionType } * */ public _ExtensionType get_PointCoordinatesExtension() { return _PointCoordinatesExtension; } /** * Sets the value of the _PointCoordinatesExtension property. * * @param value * allowed object is * {@link _ExtensionType } * */ public void set_PointCoordinatesExtension(_ExtensionType value) { this._PointCoordinatesExtension = value; } }
[ "geir.sagberg@gmail.com" ]
geir.sagberg@gmail.com
4a7db0b4b3db01b12201ee13e91f31e2d6923ae8
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Lang/44/org/apache/commons/lang/math/NumberRange_toString_229.java
6500441c4f0d8c120abf9ff42bb0a299e383931d
[]
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
767
java
org apach common lang math code number rang numberrang code repres inclus rang link java lang number object type author href mailto chrise esha christoph elkin author stephen colebourn previous org apach common lang version number rang numberrang rang serializ rang code string code format string rang 'rang min max code string code represent rang string string tostr string tostr string buffer stringbuff buf string buffer stringbuff buf append rang buf append min buf append buf append max buf append string tostr buf string tostr string tostr
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
1929173a642a7e0d660b7eae7dc6c37d663f636d
613ceeb382683760b3ac0aceb8d28ab04a694f2a
/src/main/java/com/xy1m/amplify/model/reference/types/Provider.java
8b7bad14c2ab727b9b8729e9775fd5a9656ae2e7
[ "Apache-2.0" ]
permissive
xy1m/outbrain-amplify-api-java-client
3d156de1cddb0baba438a6214973aa3f75c0d025
056f1367529c0c5812c82e3a1064f18892cddba9
refs/heads/master
2022-11-24T20:35:13.135344
2021-02-03T02:16:54
2021-02-03T02:16:54
251,541,633
2
3
Apache-2.0
2022-11-16T09:25:53
2020-03-31T08:21:08
Java
UTF-8
Java
false
false
131
java
package com.xy1m.amplify.model.reference.types; public enum Provider { LiveRamp, BlueKai, Adobe, IntimateMerger }
[ "zhangzhpeng@gmail.com" ]
zhangzhpeng@gmail.com
582224ab654fd3c2a2716a22eecea8b236f47bda
a6acdf913883335514ac2d4d7288409a3282f226
/src/task/impl/PacketSenderTask.java
740fe95ea8db18a32f97077c19e01e335ff4bca4
[]
no_license
results/VideoClient2
141e5b73b5e4e2646da0c734d1a22140720b22e8
287995f7cce4d64aee634d1ef4a3bbf42f0f3cf7
refs/heads/main
2023-01-11T18:34:04.966478
2020-11-19T21:28:33
2020-11-19T21:28:33
314,374,305
0
0
null
null
null
null
UTF-8
Java
false
false
787
java
package task.impl; import java.io.IOException; import java.net.DatagramPacket; import client.Client; import io.Logger; import io.packet.Packet; import io.packet.PacketHandler; import task.Task; public class PacketSenderTask extends Task { @Override public Object call() { if(!PacketHandler.getPacketOutQueue().isEmpty()) { Packet packet = PacketHandler.getPacketOutQueue().peek();//CHANGE TO POOLLL TO WORK if(packet != null) { try { Client.getSocket().send(new DatagramPacket(packet.getBytes(),packet.getLength(),PacketHandler.getSocketAddress(packet.getAddress(),packet.getPort()))); packet = null; Logger.log("Sent : "+(++Client.pkt)); } catch (IOException e) { packet = null; e.printStackTrace(); } } } return null; } }
[ "sejteit@gmail.com" ]
sejteit@gmail.com
b89222c1a456b376007fb3dc06ced1fc258ed325
d35f2081c7313facc482ab5a0a767e67ef467a11
/src/main/java/com/example/SmartziRegistration/constraint/PasswordConstraintValidator.java
8785a89b24bb0a2bf138658f8bd67df3efd62f93
[]
no_license
banushanv/SmartziWebRegistration
afb8a0a5f84c73dc1002352557b94aed410011bd
b3581964aed38ecb9d67694db8c2eef55f9763e0
refs/heads/master
2020-09-04T05:57:12.100006
2019-11-05T07:14:33
2019-11-05T07:14:33
219,672,138
0
0
null
null
null
null
UTF-8
Java
false
false
2,873
java
package com.example.SmartziRegistration.constraint; import org.passay.*; import org.passay.dictionary.WordListDictionary; import org.passay.dictionary.WordLists; import org.passay.dictionary.sort.ArraysSort; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; import java.io.FileReader; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class PasswordConstraintValidator implements ConstraintValidator<ValidPassword, String> { private DictionaryRule dictionaryRule; @Override public void initialize(ValidPassword constraintAnnotation) { try { String invalidPasswordList = this.getClass().getResource("/invalid-password-list.txt").getFile(); dictionaryRule = new DictionaryRule( new WordListDictionary(WordLists.createFromReader( // Reader around the word list file new FileReader[] { new FileReader(invalidPasswordList) }, // True for case sensitivity, false otherwise false, // Dictionaries must be sorted new ArraysSort() ))); } catch (IOException e) { throw new RuntimeException("could not load word list", e); } } @Override public boolean isValid(String password, ConstraintValidatorContext context) { PasswordValidator validator = new PasswordValidator(Arrays.asList( // at least 8 characters new LengthRule(8, 30), // at least one upper-case character new CharacterRule(EnglishCharacterData.UpperCase, 1), // at least one lower-case character new CharacterRule(EnglishCharacterData.LowerCase, 1), // at least one digit character new CharacterRule(EnglishCharacterData.Digit, 1), // at least one symbol (special character) new CharacterRule(EnglishCharacterData.Special, 1), // no whitespace new WhitespaceRule(), // no common passwords dictionaryRule )); RuleResult result = validator.validate(new PasswordData(password)); if (result.isValid()) { return true; } List<String> messages = validator.getMessages(result); String messageTemplate = messages.stream().collect(Collectors.joining(",")); context.buildConstraintViolationWithTemplate(messageTemplate) .addConstraintViolation() .disableDefaultConstraintViolation(); return false; } }
[ "Banushanv@gmail.com" ]
Banushanv@gmail.com
0a4410e11a0c732a0730efae308eea2688b0434d
50ea86724ca653ff6fb28cffd5577c53493bbf1b
/main/java/fr/eraklys/economy/trading/TradeSession.java
6ebc52234488f8fca07cd80984332280e2e6085c
[]
no_license
Epharos/Eraklys
90259880196302900cc64a5eb2785565fa705346
f6b41b21f9064eda7e9f47c8bf143a76c49eb671
refs/heads/master
2021-04-17T19:39:50.937294
2020-03-30T16:48:32
2020-03-30T16:48:32
249,470,256
3
1
null
null
null
null
UTF-8
Java
false
false
11,729
java
package fr.eraklys.economy.trading; import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; import fr.eraklys.Eraklys; import fr.eraklys.util.ServerPlayerUtil; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.text.TranslationTextComponent; import net.minecraftforge.fml.network.PacketDistributor; public class TradeSession implements IInventory { public ServerPlayerEntity player, trader; public ItemStack[] playerTradingItems = new ItemStack[45], traderTradingItems = new ItemStack[45]; public boolean playerAcceptation = false, traderAcceptation = false; public static Map<ServerPlayerEntity, TradeSession> registeredSessions = new HashMap<ServerPlayerEntity, TradeSession>(); public TradeSession(@Nonnull ServerPlayerEntity p, @Nonnull ServerPlayerEntity t) { player = p; trader = t; playerTradingItems = this.getEmptyItemStackList(playerTradingItems.length); traderTradingItems = this.getEmptyItemStackList(traderTradingItems.length); } /** * Create a trading session. * * @param p : A player from the trading session * @param t : Logically, the other player */ public static void createSession(@Nonnull ServerPlayerEntity p, @Nonnull ServerPlayerEntity t) { TradeSession session = new TradeSession(p, t); TradeSession.registeredSessions.put(p, session); TradeSession.registeredSessions.put(t, session); session.start(); Eraklys.LOGGER.info("A trade has started : " + p.getName().getString() + " <-> " + t.getName().getString()); } /** * Starts the session by opening the trading GUI and the container * * @see ServerPlayerUtil#openTradingScreen(ServerPlayerEntity) */ private void start() { ServerPlayerUtil.openTradingScreen(player); ServerPlayerUtil.openTradingScreen(trader); } /** * When a trade is finished (success or cancelled), ends the trading session * @param p * A player from the trade (can be one player or the other, it will destroy for both player) */ public static void destroySession(@Nonnull ServerPlayerEntity p) { TradeSession session = TradeSession.registeredSessions.get(p); if(session != null) session.destroySession(); } /** * Destroys completely the session by closing players trading screen, sending a message to the players accordingly to the trading state (success or cancelled) and putting a null session for both players */ private void destroySession() { player.closeScreen(); trader.closeScreen(); if(playerAcceptation && traderAcceptation) { player.sendMessage(new TranslationTextComponent("chat.trade.success", trader.getName().getString())); trader.sendMessage(new TranslationTextComponent("chat.trade.success", player.getName().getString())); Eraklys.LOGGER.info("Trade done : " + player.getName().getString() + " <-> " + trader.getName().getString()); } else { player.sendMessage(new TranslationTextComponent("chat.trade.cancelled", trader.getName().getString())); trader.sendMessage(new TranslationTextComponent("chat.trade.cancelled", player.getName().getString())); Eraklys.LOGGER.info("Trade cancelled : " + player.getName().getString() + " <-> " + trader.getName().getString()); } registeredSessions.put(player, null); registeredSessions.put(trader, null); } @Override public void clear() { } @Override public ItemStack decrStackSize(int slotID, int quantity) { if(slotID < player.inventory.getSizeInventory()) return player.inventory.decrStackSize(slotID, quantity); slotID -= player.inventory.getSizeInventory(); if(slotID < playerTradingItems.length) return decrStackSize(slotID, quantity, playerTradingItems); slotID -= playerTradingItems.length; if(slotID < trader.inventory.getSizeInventory()) return trader.inventory.decrStackSize(slotID, quantity); slotID -= trader.inventory.getSizeInventory(); if(slotID < traderTradingItems.length) return decrStackSize(slotID, quantity, traderTradingItems); return ItemStack.EMPTY; } public static ItemStack getAndSplit(ItemStack[] stacks, int index, int amount) { return index >= 0 && index < stacks.length && !stacks[index].isEmpty() && amount > 0 ? stacks[index].split(amount) : ItemStack.EMPTY; } private ItemStack decrStackSize(int slotID, int quantity, ItemStack[] tradingItems) { return tradingItems != null && !tradingItems[slotID].isEmpty() ? getAndSplit(tradingItems, slotID, quantity) : ItemStack.EMPTY; } /** * * @param p * The player to get the slot id from * @param slotID * Which slot id to get from the player's inventory * @return * Player slot ID */ public int getPlayerInventorySlotID(PlayerEntity p, int slotID) { return p == player ? slotID : player.inventory.getSizeInventory() + playerTradingItems.length + slotID; } /** * * @param * Player to get his trading inventory slot id from * @return * Player trading first slot ID * * @see * ContainerTrading#putSlotInServer(PlayerEntity) */ public int getPlayerTradingSlotID(PlayerEntity p) { return p == player ? player.inventory.getSizeInventory() : player.inventory.getSizeInventory() + playerTradingItems.length + trader.inventory.getSizeInventory(); } /** * * @param * Trader to get his trading inventory slot id from * @return * Trader trading first slot ID * * @see * ContainerTrading#putSlotInServer(PlayerEntity) */ public int getTraderTradingSlotID(PlayerEntity p) { return p != player ? player.inventory.getSizeInventory() : player.inventory.getSizeInventory() + playerTradingItems.length + trader.inventory.getSizeInventory(); } @Override public int getSizeInventory() { return player.inventory.getSizeInventory() + trader.inventory.getSizeInventory() + playerTradingItems.length + traderTradingItems.length; } @Override public ItemStack getStackInSlot(int slotID) { if(slotID < player.inventory.getSizeInventory()) return player.inventory.getStackInSlot(slotID); slotID -= player.inventory.getSizeInventory(); if(slotID < playerTradingItems.length) return playerTradingItems[slotID]; slotID -= playerTradingItems.length; if(slotID < trader.inventory.getSizeInventory()) return trader.inventory.getStackInSlot(slotID); slotID -= trader.inventory.getSizeInventory(); if(slotID < traderTradingItems.length) return traderTradingItems[slotID]; return ItemStack.EMPTY; } /** * Fills an inventories (ItemStack array) with empty ItemStacks * @param i * Size of the inventory * @return * An ItemStack array filled with {@link ItemStack#EMPTY} */ public ItemStack[] getEmptyItemStackList(int i) { ItemStack[] items = new ItemStack[i]; for(int a = 0 ; a < i ; a++) items[a] = ItemStack.EMPTY; return items; } @Override public boolean isEmpty() { for(ItemStack stack : playerTradingItems) if(stack != null && stack != ItemStack.EMPTY) return false; for(ItemStack stack : traderTradingItems) if(stack != null && stack != ItemStack.EMPTY) return false; return true; } @SuppressWarnings("unused") @Override public boolean isUsableByPlayer(PlayerEntity e) { return player.isAlive() ? e.getDistanceSq(player) <= 64.0d : false && trader.isAlive() ? e.getDistanceSq(trader) <= 64.0d : false; } @Override public void markDirty() { } @Override public ItemStack removeStackFromSlot(int slotID) { if(slotID < player.inventory.getSizeInventory()) return player.inventory.removeStackFromSlot(slotID); slotID -= player.inventory.getSizeInventory(); if(slotID < playerTradingItems.length) return removeStackFromSlot(slotID, playerTradingItems); slotID -= 9; if(slotID < trader.inventory.getSizeInventory()) return trader.inventory.removeStackFromSlot(slotID); slotID -= trader.inventory.getSizeInventory(); if(slotID < traderTradingItems.length) return removeStackFromSlot(slotID, traderTradingItems); return ItemStack.EMPTY; } public ItemStack removeStackFromSlot(int slotID, ItemStack[] stacks) { if(stacks != null && !stacks[slotID].isEmpty()) { ItemStack stack = stacks[slotID]; stacks[slotID] = ItemStack.EMPTY; return stack; } return ItemStack.EMPTY; } @Override public void setInventorySlotContents(int slotID, ItemStack stack) { if(slotID < player.inventory.getSizeInventory()) { player.inventory.setInventorySlotContents(slotID, stack); return; } slotID -= player.inventory.getSizeInventory(); if(slotID < playerTradingItems.length) { playerTradingItems[slotID] = stack; return; } slotID -= playerTradingItems.length; if(slotID < trader.inventory.getSizeInventory()) { trader.inventory.setInventorySlotContents(slotID, stack); return; } slotID -= trader.inventory.getSizeInventory(); if(slotID < traderTradingItems.length) { traderTradingItems[slotID] = stack; return; } } public ServerPlayerEntity getPlayerInstance(ServerPlayerEntity p) { return p == player ? player : trader; } public ServerPlayerEntity getTraderInstance(ServerPlayerEntity p) { return p != player ? player : trader; } public ItemStack[] getPlayerTradingInventory(ServerPlayerEntity p) { return p == player ? playerTradingItems : traderTradingItems; } /** * Toggles the acceptation state for a given player. * If both acceptance are {@code true}, then the trade is processed and the session is destroyed. * @param sender * The player who needs to get his acceptance toggled */ public static void toggleAcceptationFor(@Nonnull ServerPlayerEntity sender) { TradeSession session = registeredSessions.get(sender); if(sender == session.player) { session.playerAcceptation = !session.playerAcceptation; Eraklys.CHANNEL.send(PacketDistributor.PLAYER.with(() -> session.trader), new PacketUpdateTradingInventory(0)); } else { session.traderAcceptation = !session.traderAcceptation; Eraklys.CHANNEL.send(PacketDistributor.PLAYER.with(() -> session.player), new PacketUpdateTradingInventory(0)); } if(session.playerAcceptation && session.traderAcceptation) { session.processTrade(); session.destroySession(); } } /** * Toggles both players acceptance to false * @see ContainerTrading#slotClick(int, int, net.minecraft.inventory.container.ClickType, PlayerEntity) * @param sender * The player who clicked on a slot and needs to toggle off both acceptances */ public static void toggleBothAcceptations(ServerPlayerEntity sender) { TradeSession session = registeredSessions.get(sender); session.playerAcceptation = false; session.traderAcceptation = false; Eraklys.CHANNEL.send(PacketDistributor.PLAYER.with(() -> session.player), new PacketUpdateTradingInventory(1)); Eraklys.CHANNEL.send(PacketDistributor.PLAYER.with(() -> session.trader), new PacketUpdateTradingInventory(1)); } /** * Processes the trade by transferring trading inventories to trader inventories */ private void processTrade() { for(ItemStack stack : traderTradingItems) { if(stack != null) { if(!player.inventory.addItemStackToInventory(stack)) { player.dropItem(stack, false, true); } } } for(ItemStack stack : playerTradingItems) { if(stack != null) { if(!trader.inventory.addItemStackToInventory(stack)) { trader.dropItem(stack, false, true); } } } for(int i = 0 ; i < 9 ; i++) { playerTradingItems = traderTradingItems = null; } } }
[ "Neox30650@gmail.com" ]
Neox30650@gmail.com
d7e9bb62a533c7a75bea2070d7a618bacf40c453
8838247a6d8a57d8512e6599b458fab5bcfe45f1
/demo/src/main/java/com/example/demo/DAO/PersonDAO.java
8310cbfcdbedf9218980c9caf05831ed95df550d
[]
no_license
pralgomathic/RestDashboard
9bae79e5738ab4278f0c9af16c16317b6a784fae
9ea19c4a68ad67330fdf4122eda5c6a988e8cff3
refs/heads/master
2020-03-06T17:23:35.441074
2018-03-27T13:15:35
2018-03-27T13:15:35
126,989,013
0
0
null
null
null
null
UTF-8
Java
false
false
232
java
package com.example.demo.DAO; import java.util.Map; import com.example.demo.Entity.Person; import org.springframework.stereotype.Repository; @Repository public class PersonDAO { private static Map<Integer, Person> persons; }
[ "jumman@ipvisionsoft.com" ]
jumman@ipvisionsoft.com
a2536ced716d3377b0710720a481010e9e9406c0
84e3dfdf4e7887c0bc421c0771bb6e3eb5f19ead
/opennlp-distr/target/filtered-md/opennlp-tools/src/test/java/opennlp/tools/namefind/DictionaryNameFinderTest.java
030754d4d3d688753ae23340f97e33111a8d9e30
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
shrsv/opennlp-testing
0db621dfc112fe56a1777d90ee53f3adb74c14f4
aad23bcbbedb628dce0e30cf0982a87ff06a5fa9
refs/heads/master
2023-04-23T01:36:18.018271
2020-05-30T23:01:42
2020-05-30T23:01:42
258,618,873
1
0
Apache-2.0
2021-04-26T20:20:05
2020-04-24T20:37:28
HTML
UTF-8
Java
false
false
4,278
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 opennlp.tools.namefind; import opennlp.tools.dictionary.Dictionary; import opennlp.tools.tokenize.SimpleTokenizer; import opennlp.tools.util.Span; import opennlp.tools.util.StringList; import org.junit.Assert; import org.junit.Before; import org.junit.Test; /** * Tests for the {@link DictionaryNameFinder} class. */ public class DictionaryNameFinderTest { private Dictionary mDictionary = new Dictionary(); private TokenNameFinder mNameFinder; public DictionaryNameFinderTest() { StringList vanessa = new StringList(new String[]{"Vanessa"}); mDictionary.put(vanessa); StringList vanessaWilliams = new StringList("Vanessa", "Williams"); mDictionary.put(vanessaWilliams); StringList max = new StringList(new String[]{"Max"}); mDictionary.put(max); StringList michaelJordan = new StringList("Michael", "Jordan"); mDictionary.put(michaelJordan); } @Before public void setUp() throws Exception { mNameFinder = new DictionaryNameFinder(mDictionary); } @Test public void testSingleTokeNameAtSentenceStart() { String sentence = "Max a b c d"; SimpleTokenizer tokenizer = SimpleTokenizer.INSTANCE; String[] tokens = tokenizer.tokenize(sentence); Span[] names = mNameFinder.find(tokens); Assert.assertTrue(names.length == 1); Assert.assertTrue(names[0].getStart() == 0 && names[0].getEnd() == 1); } @Test public void testSingleTokeNameInsideSentence() { String sentence = "a b Max c d"; SimpleTokenizer tokenizer = SimpleTokenizer.INSTANCE; String[] tokens = tokenizer.tokenize(sentence); Span[] names = mNameFinder.find(tokens); Assert.assertTrue(names.length == 1); Assert.assertTrue(names[0].getStart() == 2 && names[0].getEnd() == 3); } @Test public void testSingleTokeNameAtSentenceEnd() { String sentence = "a b c Max"; SimpleTokenizer tokenizer = SimpleTokenizer.INSTANCE; String[] tokens = tokenizer.tokenize(sentence); Span[] names = mNameFinder.find(tokens); Assert.assertTrue(names.length == 1); Assert.assertTrue(names[0].getStart() == 3 && names[0].getEnd() == 4); } @Test public void testLastMatchingTokenNameIsChoosen() { String[] sentence = {"a", "b", "c", "Vanessa"}; Span[] names = mNameFinder.find(sentence); Assert.assertTrue(names.length == 1); Assert.assertTrue(names[0].getStart() == 3 && names[0].getEnd() == 4); } @Test public void testLongerTokenNameIsPreferred() { String[] sentence = {"a", "b", "c", "Vanessa", "Williams"}; Span[] names = mNameFinder.find(sentence); Assert.assertTrue(names.length == 1); Assert.assertTrue(names[0].getStart() == 3 && names[0].getEnd() == 5); } @Test public void testCaseSensitivity() { String[] sentence = {"a", "b", "c", "vanessa", "williams"}; Span[] names = mNameFinder.find(sentence); Assert.assertTrue(names.length == 1); Assert.assertTrue(names[0].getStart() == 3 && names[0].getEnd() == 5); } @Test public void testCaseLongerEntry() { String[] sentence = {"a", "b", "michael", "jordan"}; Span[] names = mNameFinder.find(sentence); Assert.assertTrue(names.length == 1); Assert.assertTrue(names[0].length() == 2); } }
[ "shrijith.sv@gmail.com" ]
shrijith.sv@gmail.com
9245e60967852a2fc4dc5fe40633ced9466b33e3
b433ee84cb0c7a572e80c82c60ec7cbe6292c0d5
/app/src/test/java/com/example/usuario/divisaspaco/ExampleUnitTest.java
4469729dadd5ec2fc81ba83ac1b4024589f09b87
[]
no_license
alejandrogalvezbaena/DivisasPaco
e637e529751a09cb6ea9fabe3e898ba4cc4d89a5
2a6897fc5f8e5f732bc61157fa2db5d625d03b39
refs/heads/master
2021-07-04T16:52:35.155204
2017-09-28T11:45:22
2017-09-28T11:45:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package com.example.usuario.divisaspaco; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "galvez50galvez97@gmail.com" ]
galvez50galvez97@gmail.com
a4c5f6f58f0923a3b6eedd0da636b20273931ebe
ecb2dec00f2143d4221e1723d308ee21ea1b19c9
/app/src/main/java/com/hfad/bitsandpizzas/Pasta.java
278feafb66c0377a50c90a6df3c02da081ba1b67
[]
no_license
christos-christidis/head.first.android.BitsAndPizzas
40f584da724aa5cb1e45a3fb3dd174207c936028
d9f1b428edca841701cee4d8ace816ca436a02c5
refs/heads/master
2022-03-17T07:24:24.684389
2019-04-06T20:24:49
2019-04-06T23:14:31
198,182,071
0
0
null
null
null
null
UTF-8
Java
false
false
539
java
package com.hfad.bitsandpizzas; class Pasta { private final String name; private final int imageResourceId; static final Pasta[] pastas = { new Pasta("Spaghetti Bolognese", R.drawable.spag_bol), new Pasta("Lasagne", R.drawable.lasagne) }; private Pasta(String name, int imageResourceId) { this.name = name; this.imageResourceId = imageResourceId; } String getName() { return name; } int getImageResourceId() { return imageResourceId; } }
[ "christos.christidis86@gmail.com" ]
christos.christidis86@gmail.com
d5b0fe5c391e4240e428cc1f6e52c2968dc4803c
fb45f5e5d97453705381288e975bad84895ce96b
/src/main/java/br/com/alura/jpa/testes/TestandoEstados.java
a67cc1f78c75d92bd63aafd1a99dbe8a80ef2c05
[]
no_license
hariel96/Estudos_JPA_e_Hibernate
39c916b53318e385deeacc48b0621ecaa384fe48
29ce0cd366249b0a47243822277503c51221af18
refs/heads/master
2022-07-11T03:59:54.155253
2020-04-07T15:10:27
2020-04-07T15:10:27
253,829,006
0
0
null
2022-06-21T03:09:31
2020-04-07T15:06:39
Java
ISO-8859-1
Java
false
false
933
java
package br.com.alura.jpa.testes; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import br.com.alura.jpa.modelo.Conta; public class TestandoEstados { public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("contas"); EntityManager em = emf.createEntityManager(); // Objeto transient, não tem id no bd e também não esta sendo gerenciado pela jpa Conta conta = new Conta(); conta.setTitular("Almiro"); conta.setAgencia(1245); conta.setNumero(9346); em.getTransaction().begin(); // transformando objeto de transient em managed, ou seja, fazendo com que o objeto tenha sincronização automatica com o banco em.persist(conta); // remove do bd, faz um delete. A conta passa de managed para removed em.remove(conta); em.getTransaction().commit(); } }
[ "hariel96@gmail.com" ]
hariel96@gmail.com
032fe5876d90b43168a5065285cb1afc49ae49f9
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MOCKITO-3b-8-20-MOEAD-WeightedSum:TestLen:CallDiversity/org/mockito/internal/handler/NullResultGuardian_ESTest.java
72bb280d0a4da532178b6b0f00e1fc1555505e01
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
571
java
/* * This file was automatically generated by EvoSuite * Tue Apr 07 14:47:33 UTC 2020 */ package org.mockito.internal.handler; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class NullResultGuardian_ESTest extends NullResultGuardian_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
a91de841b3d8c01ab52ad3283889b6d403bdcebb
81e43a6a6879684921559605a49ccdf1b4abca88
/liquibase-standard/src/main/java/liquibase/precondition/CustomPrecondition.java
1ef0bdeb6f48d32dd61154bb452baad81f6ddb0b
[ "LicenseRef-scancode-free-unknown", "Apache-2.0" ]
permissive
liquibase/liquibase
248cf123d23f7a385570344c98173650d48d7ac6
39b9d783461cb062003a7b73d277e71c43413876
refs/heads/master
2023-08-24T22:01:48.214653
2023-08-24T20:36:13
2023-08-24T20:36:13
2,019,791
3,668
1,813
Apache-2.0
2023-09-14T16:15:43
2011-07-08T20:08:20
Java
UTF-8
Java
false
false
343
java
package liquibase.precondition; import liquibase.database.Database; import liquibase.exception.CustomPreconditionErrorException; import liquibase.exception.CustomPreconditionFailedException; public interface CustomPrecondition { void check(Database database) throws CustomPreconditionFailedException, CustomPreconditionErrorException; }
[ "suehs@datical.com" ]
suehs@datical.com
1e6c50ca8bd2da1382411707f3b8eb10a427f7a3
e02bc427bb82cd4a66865cd099b60fe2bf54d2f4
/src/main/java/com/kh/portfolio/interceptor/AuthInterceptor.java
431bb473416967b304e718da25ae4c2624dee33c
[]
no_license
sang105kr/portfolio6
8c98600c7274ff100ad16ab37cf8a9adbdb83011
50695268f35979b5dd18bdd99539974c4b00320e
refs/heads/main
2023-03-31T01:19:30.660590
2021-04-01T06:29:55
2021-04-01T06:29:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,825
java
package com.kh.portfolio.interceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.ui.ModelMap; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; import lombok.extern.slf4j.Slf4j; @Slf4j public class AuthInterceptor implements HandlerInterceptor { //컨트롤서 수행전 @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { log.info("AuthInterceptor.preHandle"); //요청URL분석 String uri = request.getRequestURI(); String contextPath = request.getContextPath(); String reqURI = uri.substring(contextPath.length()); HttpSession session = request.getSession(false); log.info("요청uri="+reqURI); if(session == null || session.getAttribute("member") == null) { log.info("권한없는자의 접근시도가 있음"+request.getRemoteAddr()); request.getSession().setAttribute("reqURI", reqURI); response.sendRedirect(request.getContextPath()+"/loginForm"); return false; } return true; } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { log.info("AuthInterceptor.postHandle"); HandlerInterceptor.super.postHandle(request, response, handler, modelAndView); } @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { log.info("AuthInterceptor.afterCompletion"); HandlerInterceptor.super.afterCompletion(request, response, handler, ex); } }
[ "sang105kr@gmail.com" ]
sang105kr@gmail.com
f5c25a9704ec1cee3c3c02b35fdb41eab2040b78
027b42368e671d4ccb244a4a816ad26b455919f2
/app/src/main/java/com/yadong/pattern/creational/prototype/shallow_clone/MailUtil.java
cfee12a2e3bd5a3af6f4c7e624a485d19b00051d
[]
no_license
ydstar/DesignPattern
de38fc9260ea2a6b2c950e8fda72e8fc4da46e50
42f77a4807b058ed5e5f4365e736809d88061cc3
refs/heads/master
2022-04-19T12:30:09.050210
2020-04-16T02:15:26
2020-04-16T02:15:26
138,538,416
19
9
null
null
null
null
UTF-8
Java
false
false
542
java
package com.yadong.pattern.creational.prototype.shallow_clone; import java.text.MessageFormat; public class MailUtil { public static void sendMail(Mail mail){ String outputContent = "向{0}同学,邮件地址:{1},邮件内容:{2}发送邮件成功"; System.out.println(MessageFormat.format(outputContent,mail.getName(),mail.getEmailAddress(),mail.getContent())); } public static void saveOriginMailRecord(Mail mail){ System.out.println("存储originMail记录,originMail:"+mail.getContent()); } }
[ "hydznsqk@163.com" ]
hydznsqk@163.com
33909a13b66e08c9584c463e207a070c7df2c754
7f8583b94ef0727e47796437857c5ada09597237
/src/GameObj.java
dfbfb62397cba7d48a79152d30e7ddc1265be979
[]
no_license
satyaprafful/arkanoid
9344bff5ef310294b1980e6fdbf1a297b356447c
dab0a26b94d3b7866593242a11162eb10a45e111
refs/heads/master
2020-03-25T04:16:26.502914
2018-08-03T06:26:48
2018-08-03T06:26:48
143,277,724
0
0
null
null
null
null
UTF-8
Java
false
false
4,160
java
/** * CIS 120 Game HW * (c) University of Pennsylvania * @version 2.1, Apr 2017 */ import java.awt.Graphics; /** * An object in the game. * * Game objects exist in the game court. They have a position, velocity, size * and bounds. Their velocity controls how they move; their position should * always be within their bounds. */ public abstract class GameObj { /* * Current position of the object (in terms of graphics coordinates) * * Coordinates are given by the upper-left hand corner of the object. This * position should always be within bounds. 0 <= px <= maxX 0 <= py <= maxY */ private int px; private int py; /* Size of object, in pixels. */ private int width; private int height; /* Velocity: number of pixels to move every time move() is called. */ private int vx; private int vy; /* * Upper bounds of the area in which the object can be positioned. Maximum * permissible x, y positions for the upper-left hand corner of the object. */ private int maxX; private int maxY; /** * Constructor */ public GameObj(int vx, int vy, int px, int py, int width, int height, int courtWidth, int courtHeight) { this.vx = vx; this.vy = vy; this.px = px; this.py = py; this.width = width; this.height = height; // take the width and height into account when setting the bounds for the upper // left corner // of the object. this.maxX = courtWidth - width; this.maxY = courtHeight - height; } /*** * GETTERS **********************************************************************************/ public int getPx() { return this.px; } public int getPy() { return this.py; } public int getVx() { return this.vx; } public int getVy() { return this.vy; } public int getWidth() { return this.width; } public int getHeight() { return this.height; } /*** * SETTERS **********************************************************************************/ public void setPx(int px) { this.px = px; clip(); } public void setPy(int py) { this.py = py; clip(); } public void setVx(int vx) { this.vx = vx; } public void setVy(int vy) { this.vy = vy; } /*** * UPDATES AND OTHER METHODS ****************************************************************/ /** * Prevents the object from going outside of the bounds of the area designated * for the object. (i.e. Object cannot go outside of the active area the user * defines for it). */ private void clip() { this.px = Math.min(Math.max(this.px, 0), this.maxX); this.py = Math.min(Math.max(this.py, 0), this.maxY); } /** * Moves the object by its velocity. Ensures that the object does not go outside * its bounds by clipping. */ public void move() { this.px += this.vx; this.py += this.vy; clip(); } /** * Determine whether this game object is currently intersecting another object. * * Intersection is determined by comparing bounding boxes. If the bounding boxes * overlap, then an intersection is considered to occur. * * @param that * The other object * @return Whether this object intersects the other object. */ // To be defined by specific objects. Ball and Rectangle abstract int intersects(GameObj that); abstract void hitWall(); /** * Determine whether the game object will hit another object in the next time * step. If so, return the direction of the other object in relation to this * game object. * * @param that * The other object * @return Direction of impending object, null if all clear. */ abstract void hitObj(GameObj that, int collisionSide); /** * Default draw method that provides how the object should be drawn in the GUI. * This method does not draw anything. Subclass should override this method * based on how their object should appear. * * @param g * The <code>Graphics</code> context used for drawing the object. * Remember graphics contexts that we used in OCaml, it gives the * context in which the object should be drawn (a canvas, a frame, * etc.) */ public abstract void draw(Graphics g); }
[ "satya_prafful47@hotmail.com" ]
satya_prafful47@hotmail.com
06f760fdf73dcba374d8b8558a10fd4f4c96fae6
07b62aacc1ed5a2b631e40aa83dabfaec9d3f5c3
/src/main/ui/CatLawnApp.java
3c9929e6d73894ed0faaf886bdd662d93a98039e
[]
no_license
oliviascarfone/Cat-Lawn-App
df90ac5378d1709a3e9960c0bf25453913efb21f
a58698d425365aed3908788f7b945e19a6ceac63
refs/heads/master
2022-04-22T22:05:16.903092
2020-04-27T05:37:00
2020-04-27T05:37:00
259,214,069
0
0
null
null
null
null
UTF-8
Java
false
false
14,312
java
//package ui; // //import com.google.gson.*; //import com.google.gson.reflect.TypeToken; //import model.*; //import persistance.JsonWriter; //import persistance.YardJsonParser; // //import java.io.*; //import java.util.ArrayList; //import java.util.Scanner; //import java.lang.reflect.Type; // ////ideas taken from AccountNotRobust program // //public class CatLawnApp { // private static final String YARD_FILE = "./data/yard.json"; // boolean keepGoing = true; // String command = null; // Scanner input; // Yard yard; // Yard newYard = new Yard(); // //YardJsonParser parser = new YardJsonParser(this); // Inventory inventory = new Inventory(); // GameItems gameItems = new GameItems(); // GameCats gameCats = new GameCats(); // // // // // public CatLawnApp() { // runCatLawnApp(); // gameItems.listToys(); // gameItems.listFood(); // gameCats.listCommonCats(); // gameCats.listUncommonCats(); // } // // // //EFFECTS: creates a constructor using a yard // public CatLawnApp(Yard yard) { // // gameItems.listToys(); // gameItems.listFood(); // gameCats.listCommonCats(); // gameCats.listUncommonCats(); // } // // // // //EFFECTS: processes user input // private void runCatLawnApp() { // input = new Scanner(System.in); // command = input.nextLine(); // // //loadGame(YARD_FILE); // // // while (keepGoing) { // displayMenu(); // command = input.next(); // command = command.toLowerCase(); // // if (command.equals("quit")) { // keepGoing = false; // } else { // processCommand(command); // } // } // // System.out.println("\nGoodbye!"); // } // // // // EFFECTS: displays menu of options to user // private void displayMenu() { // System.out.println("\nSelect from:"); // System.out.println("\tcats -> see the cats in my yard"); // System.out.println("\tyard -> see the items in my yard"); // System.out.println("\tinventory -> check my inventory"); // System.out.println("\tplace -> place items in yard"); // System.out.println("\tshop -> shop for items"); // System.out.println("\tsave -> save your game"); // System.out.println("\tnew -> create new game"); // System.out.println("\tquit -> quit the game"); // } // // // MODIFIES: this // // EFFECTS: processes user command // private void processCommand(String command) { // if (command.equals("cats")) { // yard.addCatToYard(); // System.out.println(yard.catsInYard()); // } else if (command.equals("yard")) { // showItemsInYard(); // } else if (command.equals("inventory")) { // System.out.println(inventory.checkInventoryItems()); // System.out.println("You have $" + inventory.getBalance()); // } else if (command.equals("place")) { // placeItemsInYard(); // } else if (command.equals("shop")) { // shopItems(); // } else if (command.equals("new")) { // //JsonWriter.saveGame(newYard, YARD_FILE); // } else if (command.equals("save")) { // // //JsonWriter.saveGame(yard, YARD_FILE); // } else { // System.out.println("Invalid selection, please try another menu option"); // } // } // // // // //EFFECTS: places items from the inventory into the yard // private void placeItemsInYard() { // String selectedItemName; // Item selectedItem; // if (inventory.inventoryList.size() == 0) { // System.out.println("You have nothing to place! Try buying something first"); // return; // } else if (inventory.inventoryList.size() > 0) { // System.out.println("type the name of the item you want to place"); // Scanner newscan = new Scanner(System.in); // String option = newscan.nextLine(); // for (int i = 0; inventory.inventoryList.size() > i; i++) { // selectedItem = inventory.inventoryList.get(i).getItem(); // selectedItemName = inventory.inventoryList.get(i).getItem().getName(); // if (selectedItemName.equals(option)) { // inventory.removeItemFromInventory(selectedItem); // System.out.println("placed " + selectedItemName); // yard.addItemToYard(selectedItem); // return; // } // } // System.out.println("item not found, please check inventory and try again"); // } // // } // // //MODIFIES: Inventory // //EFFECTS: purchase an item and add it to inventory // public void shopItems() { // String choice = ""; // // System.out.println("Would you like to purchase food or toys?"); // while (!(choice.equals("food")) || (choice.equals("toys"))) { // System.out.println("\tfood-> buy food"); // System.out.println("\ttoys-> buy toys"); // choice = input.next(); // choice = choice.toLowerCase(); // if (choice.equals("food")) { // buyFood(); // return; // } // if (choice.equals("toys")) { // buyToys(); // return; // } // } // } // // public void buyFood() { // Food selectedFoodToPurchase; // String selectedFoodToPurchaseName; // String choice; // System.out.println(gameItems.showAllFood()); // System.out.println("What would you like to purchase?"); // Scanner input = new Scanner(System.in); // choice = input.nextLine(); // for (int i = 0; gameItems.allFood.size() > i; i++) { // selectedFoodToPurchase = gameItems.allFood.get(i); // selectedFoodToPurchaseName = gameItems.allFood.get(i).getName(); // if (selectedFoodToPurchaseName.equals(choice)) { // if (inventory.buyItem(selectedFoodToPurchase, 1)) { // System.out.println("Purchase Successful!"); // return; // } else { // System.out.println("Insufficient funds!"); // return; // } // } // } // System.out.println("Item not found, please try again"); // // } // // // public void buyToys() { // Toy selectedToyToPurchase; // String selectedToyToPurchaseName; // String choice; // System.out.println(gameItems.showAllToys()); // System.out.println("What would you like to purchase?"); // Scanner input = new Scanner(System.in); // choice = input.nextLine(); // for (int i = 0; gameItems.allToys.size() > i; i++) { // selectedToyToPurchase = gameItems.allToys.get(i); // selectedToyToPurchaseName = gameItems.allToys.get(i).getName(); // if (selectedToyToPurchaseName.equals(choice)) { // if (inventory.buyItem(selectedToyToPurchase, 1)) { // System.out.println("Purchase Successful!"); // return; // } else { // System.out.println("Insufficient funds!"); // return; // } // } // // } // System.out.println("Item not found, please try again"); // // } // // // //EFFECTS: shows the current items placed in the yard // public void showItemsInYard() { // String selection = ""; // // while (!(selection.equals("f") || selection.equals("t"))) { // System.out.println("\tf-> show food"); // System.out.println("\tt-> show toys"); // selection = input.next(); // selection = selection.toLowerCase(); // // if (selection.equals("f")) { // System.out.println(yard.itemsInYard(yard.food)); // } else { // System.out.println(yard.itemsInYard(yard.toys)); // } // return; // } // } // // //// //EFFECTS: saves the state of the Cat Lawn Yard and Inventory to YARD_FILE and INVENTORY_FILE, //// // respectively //// private void saveGame() { //// JsonObject jsonObjectYard = saveYard(); //// //JsonObject jsonObjectInventory = saveInventory(); //// try { //// FileWriter fileWriter = new FileWriter(YARD_FILE); //// fileWriter.write(jsonObjectYard.toString()); //// fileWriter.close(); //// System.out.println("Successfully saved yard data!"); ////// FileWriter fileWriter1 = new FileWriter(INVENTORY_FILE); ////// fileWriter1.write(jsonObjectInventory.toString()); ////// fileWriter1.close(); //// System.out.println("Successfully saved inventory data!"); //// } catch (FileNotFoundException e) { //// System.out.println("Problem saving game data"); //// } catch (IOException e) { //// e.printStackTrace(); //// } //// } // //// public JsonObject saveYard() { //// yardJson = new JsonObject(); //// yardJson.add("cats", saveCats()); //// yardJson.add("food", saveFood()); //// yardJson.add("toys", saveToys()); //// //// return yardJson; //// } // //// public JsonObject saveInventory() { //// inventoryJson = new JsonObject(); //// inventoryJson.addProperty("balance", inventory.getBalance()); //// inventoryJson.add("inventoryList", saveInventoryList()); //// //// return inventoryJson; //// } // //// public JsonArray saveInventoryList() { //// JsonArray saveInventoryList = new JsonArray(); //// for (InventoryEntry i : inventory.inventoryList) { //// Gson gson = new Gson(); //// String saveInventoryEntry = gson.toJson(i); //// saveInventoryList.add(saveInventoryEntry); //// } //// return saveInventoryList; //// } //// //// //// //EFFECTS: saves the cats in the yard into an array of JSON objects //// public JsonArray saveCats() { //// JsonArray saveCats = new JsonArray(); //// for (Cat cat : yard.cats) { //// JsonObject catJson = new JsonObject(); //// catJson.addProperty("name", cat.getName()); //// catJson.addProperty("breed", cat.getBreed()); //// catJson.addProperty("coat", cat.getCoat()); //// catJson.addProperty("rarity", cat.getRarityLevel()); //// catJson.addProperty("foodpref", cat.getFoodPreference()); //// catJson.addProperty("toypref", cat.getToyPreference()); //// saveCats.add(catJson); //// } //// //// return saveCats; //// } //// //// //EFFECTS: saves the food in the yard into an array of JSON objects //// public JsonArray saveFood() { //// JsonArray saveFoods = new JsonArray(); //// for (Item food : yard.food) { //// JsonObject foodJson = new JsonObject(); //// foodJson.addProperty("name", food.getName()); //// foodJson.addProperty("cost", food.getCost()); //// saveFoods.add(foodJson); //// } //// //// return saveFoods; //// } //// //// //EFFECTS: saves the toys in the yard into an array of JSON objects //// public JsonArray saveToys() { //// JsonArray saveToys = new JsonArray(); //// for (Item toy : yard.toys) { //// JsonObject toyJson = new JsonObject(); //// toyJson.addProperty("name", toy.getName()); //// toyJson.addProperty("cost", toy.getCost()); //// saveToys.add(toyJson); //// //// } //// //// return saveToys; //// } // // // //public boolean loadGame(String file) { // // return parser.loadYard(file); // // //} // //loadInventory(); // // //// public void loadYard() { //// JsonParser parser = new JsonParser(); //// try (FileReader reader = new FileReader(YARD_FILE)) { //// JsonObject result = parser.parse(reader).getAsJsonObject(); //// JsonArray loadedCats = result.getAsJsonArray("cats"); //// makeCatsList(loadedCats); //// JsonArray loadedFood = result.getAsJsonArray("food"); //// makeFoodList(loadedFood); //// JsonArray loadedToys = result.getAsJsonArray("toys"); //// makeToyList(loadedToys); //// makeYard(); //// //// } catch (IOException e) { //// emptyYard(); //// } //// } //// //// public void makeCatsList(JsonArray json) { //// Gson gson = new Gson(); //// Type catListType = new TypeToken<ArrayList<Cat>>(){}.getType(); //// ArrayList<Cat> cats = gson.fromJson(json, catListType); //// this.cats = cats; //// } //// //// public void makeFoodList(JsonArray json) { //// Gson gson = new Gson(); //// Type foodListType = new TypeToken<ArrayList<Food>>(){}.getType(); //// ArrayList<Item> foods = gson.fromJson(json, foodListType); //// this.foods = foods; //// } //// //// public void makeToyList(JsonArray json) { //// Gson gson = new Gson(); //// Type toyListType = new TypeToken<ArrayList<Toy>>(){}.getType(); //// ArrayList<Item> toys = gson.fromJson(json, toyListType); //// this.toys = toys; //// } //// // public void makeYard(ArrayList<Cat> cats, ArrayList<Item> foods, ArrayList<Item> toys) { // yard = new Yard(cats, foods, toys); // } // // //// //// //// // //// public void loadInventory() { //// Gson gson = new Gson(); //// try (FileReader reader = new FileReader(INVENTORY_FILE)) { //// Inventory loadedInventoryList = gson.fromJson(reader, Inventory.class); //// inventory = loadedInventoryList; //// } catch (IOException e) { //// emptyInventory(); //// } //// //// } //// //// public void emptyInventory() { //// inventory = new Inventory(); //// } // // public void emptyYard() { // yard = new Yard(); // } // //} // // // // // // // // // //
[ "olivia.scarfone@gmail.com" ]
olivia.scarfone@gmail.com
4c1466de74d119439680401958997297c1e102b4
8f30ec284c29e02d8cacf2ef0b2b901d84fddb7a
/net.dougqh.jak.core/src/net/dougqh/jak/JavaModifiers.java
e545bc1c1b988a4341a6ca0495c689abdeececd7
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
dougqh/JAK
8b7096766b36909262d03a3754ae71b1c8c67e03
e10da7384cce6466530c12378ee782a1d8209b51
refs/heads/master
2021-01-01T16:19:39.434996
2013-04-04T04:01:42
2013-04-04T04:01:42
732,624
11
2
null
2013-04-04T04:01:27
2010-06-21T20:00:44
Java
UTF-8
Java
false
false
6,442
java
package net.dougqh.jak; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; import java.util.Arrays; import java.util.List; import net.dougqh.functional.Filter; import static net.dougqh.jak.Flags.*; import static net.dougqh.jak.Methods.*; public final class JavaModifiers extends Filter<JavaElement> { private static final TypeVariable<?>[] EMPTY_TYPE_VARS = {}; private final int flags; private final TypeVariable<?>[] typeVars; JavaModifiers() { this( NO_FLAGS ); } JavaModifiers( final int flag ) { this.flags = flag; this.typeVars = EMPTY_TYPE_VARS; } JavaModifiers( final JavaModifiers baseModifiers, final int flag ) { if ( baseModifiers.typeVars.length != 0 ) { throw new IllegalStateException(); } this.flags = baseModifiers.flags | flag; this.typeVars = EMPTY_TYPE_VARS; } JavaModifiers( final JavaModifiers baseModifiers, final TypeVariable<?>[] typeVars ) { if ( baseModifiers.typeVars.length != 0 ) { throw new IllegalStateException(); } this.flags = baseModifiers.flags; this.typeVars = typeVars; } @Override public final boolean matches(final JavaElement javaElement) { return ( (javaElement.getFlags() & this.flags) == this.flags ); } public final JavaModifiers public_() { return new JavaModifiers( this, PUBLIC ); } public final JavaModifiers protected_() { return new JavaModifiers( this, PROTECTED ); } public final JavaModifiers private_() { return new JavaModifiers( this, PRIVATE ); } public final JavaModifiers static_() { return new JavaModifiers( this, STATIC ); } public final JavaModifiers abstract_() { return new JavaModifiers( this, ABSTRACT ); } public final JavaModifiers final_() { return new JavaModifiers( this, FINAL ); } public final JavaModifiers synchronized_() { return new JavaModifiers( this, SYNCHRONIZED ); } public final JavaModifiers native_() { return new JavaModifiers( this, NATIVE ); } public final JavaModifiers strictfp_() { return new JavaModifiers( this, STRICTFP ); } public final JavaModifiers volatile_() { return new JavaModifiers( this, VOLATILE ); } public final JavaModifiers transient_() { return new JavaModifiers( this, TRANSIENT ); } public final JavaModifiers varargs() { return new JavaModifiers( this, VAR_ARGS ); } public final JavaModifiers parameterize( final TypeVariable<?>... typeArgs ) { return new JavaModifiers( this, typeArgs ); } public final JavaFieldImpl field( final Type fieldType, final CharSequence fieldName ) { return new JavaFieldImpl( this, fieldType, fieldName ); } public final JavaMethodDescriptor method( final Type returnType, final String methodName ) { return new JavaMethodDescriptor( this, returnType, methodName ); } public final JavaMethodDescriptor method( final Type returnType, final String methodName, final Type arg1Type, final String arg1Name ) { return this.method( returnType, methodName ). arg( arg1Type, arg1Name ); } public final JavaMethodDescriptor method( final Type returnType, final String methodName, final Type arg1Type, final String arg1Name, final Type arg2Type, final String arg2Name ) { return this.method( returnType, methodName ). arg( arg1Type, arg1Name ). arg( arg2Type, arg2Name ); } public final JavaMethodDescriptor method( final Type returnType, final String methodName, final Type arg1Type, final String arg1Name, final Type arg2Type, final String arg2Name, final Type arg3Type, final String arg3Name ) { return this.method( returnType, methodName ). arg( arg1Type, arg1Name ). arg( arg2Type, arg2Name ). arg( arg3Type, arg3Name ); } public final JavaMethodDescriptor method( final Type returnType, final String methodName, final Type... args ) { return this.method( returnType, methodName ).args( args ); } public final JavaMethodDescriptor method( final Type returnType, final String methodName, final List<? extends Type> args ) { return this.method( returnType, methodName ).args( args ); } public final JavaMethodDescriptor init() { return new JavaMethodDescriptor( this, void.class, INIT ); } public final JavaMethodDescriptor init( final Type... args ) { return this.init().args( args ); } public final JavaClassDescriptor class_( final Package aPackage, final String className ) { return new JavaClassDescriptor( this, aPackage.getName() + "." + className ); } public final JavaClassDescriptor class_( final String className ) { return new JavaClassDescriptor( this, className ); } public final JavaInterfaceDescriptor interface_( final String interfaceName ) { return new JavaInterfaceDescriptor( this, interfaceName ); } public final JavaInterfaceDescriptor interface_( final Package aPackage, final String interfaceName ) { return new JavaInterfaceDescriptor( this, aPackage.getName() + "." + interfaceName ); } public final JavaEnumDescriptor enum_( final Package aPackage, final String className ) { return new JavaEnumDescriptor( this, aPackage.getName() + "." + className ); } public final JavaEnumDescriptor enum_( final String className ) { return new JavaEnumDescriptor( this, className ); } public final JavaAnnotationDescriptor $interface( final String annotationName ) { return new JavaAnnotationDescriptor( this, annotationName ); } public final JavaAnnotationDescriptor annotation( final String annotationName ) { return $interface( annotationName ); } public final JavaAnnotationDescriptor $interface( final Package aPackage, final String annotationName ) { return new JavaAnnotationDescriptor( this, aPackage.getName() + "." + annotationName ); } public final JavaAnnotationDescriptor annotation( final Package aPackage, final String annotationName ) { return $interface( aPackage, annotationName ); } final TypeVariable<?>[] typeVars() { return this.typeVars; } final int flags() { return this.flags; } @Override public final int hashCode() { return this.flags; } @Override public final boolean equals( final Object obj ) { if ( obj == this ) { return true; } else if ( ! ( obj instanceof JavaModifiers ) ) { return false; } else { JavaModifiers that = (JavaModifiers)obj; return ( this.flags == that.flags ) && Arrays.equals( this.typeVars, that.typeVars ); } } }
[ "dougqh@gmail.com" ]
dougqh@gmail.com
6f9aa8a695c2b2224fa9f3e1244a51bd417c3173
11db1cf8dd699179a82a2d9a61a6f3fb8ddebd0c
/src/main/java/edu/gatech/nightingale/model/ActualOrPresumedDateOfDeath.java
b910cdc215daa4ca0a7f8f10e9c7509e7d5fb411
[]
no_license
gt-health/nightingale_javalib
f98935939152e9a09ce4a4726513209a2550cac7
c06fc13279c981779c9b1ea83a802158777c4424
refs/heads/master
2020-04-21T08:27:33.330298
2019-02-06T14:40:58
2019-02-06T14:40:58
169,420,259
0
0
null
null
null
null
UTF-8
Java
false
false
878
java
package edu.gatech.nightingale.model; import org.hl7.fhir.dstu3.model.CodeableConcept; import org.hl7.fhir.dstu3.model.Coding; import org.hl7.fhir.dstu3.model.DateTimeType; import org.hl7.fhir.dstu3.model.Observation; import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.primitive.DateTimeDt; @ResourceDef(name = "ActualOrPresumedDateOfDeath", profile = "http://nightingaleproject.github.io/fhirDeathRecord/StructureDefinition/sdr-causeOfDeath-ActualOrPresumedDateOfDeath") public class ActualOrPresumedDateOfDeath extends Observation { private static final long serialVersionUID = 1L; public ActualOrPresumedDateOfDeath() { super(); this.setCode(new CodeableConcept().addCoding(new Coding("http://loinc.org", "81956-5",""))); } public ActualOrPresumedDateOfDeath(DateTimeType valueDateTime) { this(); this.setValue(valueDateTime); } }
[ "Michael.Riley@gtri.gatech.edu" ]
Michael.Riley@gtri.gatech.edu
03b34bfbd757cc4433eecda7ac591e54fd0edbe7
2f1d049a44da902abf301c4b1eb71d8c511a30ad
/app/src/main/java/privacyfriendlyshoppinglist/secuso/org/privacyfriendlyshoppinglist/framework/ui/AbstractAdapter.java
0dc949ef21c440d8deab8e5bd868e59b1653d9b9
[ "Apache-2.0", "CC-BY-2.5", "CC-BY-4.0" ]
permissive
oleole39/privacy-friendly-shopping-list
1a31732cd6351101559df85345fdd55a70605823
fcafb260c311cb6d57784390cd8f4e3e2266fd61
refs/heads/master
2022-05-09T17:54:46.616107
2019-12-19T18:05:56
2019-12-19T18:05:56
257,943,921
0
0
Apache-2.0
2020-04-22T15:35:05
2020-04-22T15:35:05
null
UTF-8
Java
false
false
1,975
java
package privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.framework.ui; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.framework.business.AbstractItem; import privacyfriendlyshoppinglist.secuso.org.privacyfriendlyshoppinglist.framework.business.PFACache; import java.util.List; /** * Description: * Author: Grebiel Jose Ifill Brito * Created: 17.03.17 creation date */ public abstract class AbstractAdapter<Item extends AbstractItem, Cache extends PFACache, ViewHolder extends AbstractViewHolder> extends RecyclerView.Adapter<RecyclerView.ViewHolder> { protected List<Item> list; protected Cache cache; protected int layoutId; public AbstractAdapter(List<Item> list, Cache cache, int layoutId) { this.list = list; this.cache = cache; this.layoutId = layoutId; } public void setList(List<Item> list) { this.list = list; } public List<Item> getList() { return list; } protected void setLayoutId(int layoutId) { this.layoutId = layoutId; } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { Context context = parent.getContext(); View view = LayoutInflater.from(context).inflate(layoutId, parent, false); return createNewViewHolder(view); } @Override public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { ViewHolder holder = (ViewHolder) viewHolder; Item item = list.get(position); holder.processItem(item); } @Override public int getItemCount() { return list == null ? 0 : list.size(); } protected abstract ViewHolder createNewViewHolder(View view); }
[ "wh38esoq@rbg.informatik.tu-darmstadt.de" ]
wh38esoq@rbg.informatik.tu-darmstadt.de
d7432003eff54a6b2aa446a7dd5ea8c2331e762d
98790b1bbd5adb8e5337073a543af69a7d4c1337
/Progetto colazioni/HTML-JAVA/bfast/src/main/java/controllers/PaginaOrdiniConfermare.java
9ae46ee3d18c79cdc1ab4dd578092c067c1ae638
[ "MIT" ]
permissive
itsar19-20/bfast
12f32b6c2df7c6018bfd15ececd7dcf2053ef11b
3d6e8bfa7795c7da673c652cf49a544c0da2ff30
refs/heads/master
2022-11-19T14:06:25.845449
2020-06-17T13:55:26
2020-06-17T13:55:26
226,372,673
3
2
MIT
2022-11-15T23:56:11
2019-12-06T16:53:26
Java
IBM852
Java
false
false
6,512
java
package controllers; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import business.TotaleOrdiniConfermare; import model.Ordine; import utils.OrdiniUtil; @WebServlet("/Dashboard/Ora") public class PaginaOrdiniConfermare extends HttpServlet { private static final long serialVersionUID = 102831973239L; /** * @see HttpServlet#HttpServlet() */ public PaginaOrdiniConfermare() { super(); } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession ses = request.getSession(); TotaleOrdiniConfermare am = new TotaleOrdiniConfermare(); int s= (Integer) ses.getAttribute("ID"); OrdiniUtil[] ou = am.PagVisualizza(s); String htmlRespone = ""; PrintWriter writer = response.getWriter(); htmlRespone += "<!doctype html>\r\n" + "<html lang=\"it-it\">\r\n" + "\r\n" + "<head>\r\n" + " <title>Bfast</title>\r\n" + "\r\n" + "\r\n" + " <!-- Serve per ottimizzare prima i dispositi mobili e poi in base alla necessitÓ utilizzando \r\n" + " le query multimediali CSS. \r\n" + " Per garantire il rendering corretto e lo zoom tattile per tutti i dispositivi -->\r\n" + " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\r\n" + "\r\n" + " <!-- Bootstrap CSS -->\r\n" + " <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css\" integrity=\"sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh\" crossorigin=\"anonymous\">\r\n" + "\r\n" + " <!-- Collegamento con Style.css -->\r\n" + " <link rel=\"stylesheet\" type=\"text/css\" href=\"Style.css\">\r\n" + "\r\n" + "</head>\r\n" + "\r\n" + "<body>\r\n" + "\r\n" + " <!--Navigation-->\r\n" + " <div id=\"content\">\r\n" + " <nav class=\"navbar navbar-expand-lg navbar-light\">\r\n" + " <div class=\"d-inline-flex justify-content-between w-100 align-items-center\">\r\n" + " <div>\r\n" + " <button type=\"button\" id=\"sidebarCollapse\" class=\"btn\">\r\n" + " <img src=\"../img/logo4.png\" class=\"img-fluid\">\r\n" + " </button>\r\n" + " </div> \r\n"+ " <div>\r\n" + " <ul class=\"nav navbar-nav ml-auto\">\r\n" + " <li class=\"nav-item text-white\">\r\n" + " <a class=\"nav-link text-dark\" href=\"../Dashboard/index.html\">Home</a>\r\n" + " </li>\r\n" + " </div> \r\n"+ " </div>\r\n" + " </nav>"; if(ou == null) { htmlRespone +="<p class=\"h1 text-center text-white\"> Nessun ordine da controllare"; }else { for(int a =0;a<ou.length;a++) { htmlRespone += " <div class=\"login mt-50 p-auto\">\r\n" + " <div class=\"login-screen2\">\r\n" + " <div class=\"app-title\">\r\n" + " <h1>Ordine n:"+ou[a].getId() +"</h1>\r\n" + " </div>\r\n" + " <p> Prodotti: "+ou[a].getIngredienti()+" Orario "+ou[a].getOrario()+" Note: "+ou[a].getNote()+"\r\n"+ " <div class=\"login-form d-flex justify-content-center\">\r\n" + "<form action=\"conferma\" method=\"POST\">"+ "<input type=\"hidden\" name=\"Ordine\" value="+ou[a].getId()+" />"+ " <input type=\"submit\" value=\"Conferma\" class=\"btn btn-primary btn-large btn-block bg-success text-white\"> </form>\r\n" + "<form>"+ " <input type=\"button\" class=\"bg-light text-white\"> </form>\r\n" + "<form action=\"rifiuta\" method=\"POST\">"+ "<input type=\"hidden\" name=\"Ordine\" value="+ou[a].getId()+" />"+ " <input type=\"submit\" value=\"Rifiuta\" class=\"btn btn-primary btn-large btn-block bg-danger text-white\"> </form>\r\n" + " </div>\r\n" + "\r\n" + " </div>\r\n" + " </div></br>"; } } htmlRespone += " <!-- Optional JavaScript -->\r\n" + " <!-- jQuery first, then Popper.js, then Bootstrap JS -->\r\n" + " <script src=\"https://code.jquery.com/jquery-3.4.1.slim.min.js\" integrity=\"sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n\" crossorigin=\"anonymous\"></script>\r\n" + " <script src=\"https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js\" integrity=\"sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo\" crossorigin=\"anonymous\"></script>\r\n" + " <script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js\" integrity=\"sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6\" crossorigin=\"anonymous\"></script>\r\n" + "\r\n" + " <script src=\"Regole.js\"></script>\r\n" + "\r\n" + "</body>\r\n" + "\r\n" + "</html>"; writer.println(htmlRespone); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse * response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
[ "57755173+guglielmo-strambini@users.noreply.github.com" ]
57755173+guglielmo-strambini@users.noreply.github.com
db4af110ddf8cb678c53139908cdf252d30ce83c
5d9bac42f485b9a487aaa5d2f62e03a3280de627
/src/test/java/com/internship/sbproject1/service/UserServiceTest.java
de2a3a4a16456d3528a8b36d1262c593bce3e539
[]
no_license
matedanielcristian/sbproject
afd558dbbbcc283f9d6e914ded91035071cfc405
3bcd88edb2b0b0b4b9689ddfed3dd0c86a779aca
refs/heads/main
2023-06-19T10:41:48.413137
2021-07-19T11:17:00
2021-07-19T11:17:00
385,834,069
0
0
null
null
null
null
UTF-8
Java
false
false
8,196
java
package com.internship.sbproject1.service; import com.internship.sbproject1.TestCreationFactory; import com.internship.sbproject1.dto.RequestUserDto; import com.internship.sbproject1.dto.ResponseUserDto; import com.internship.sbproject1.entity.User; import com.internship.sbproject1.repository.UserRepository; import org.junit.Test; import org.junit.jupiter.api.Assertions; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.modelmapper.ModelMapper; import org.springframework.data.domain.*; import java.util.Collections; import java.util.Optional; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; @RunWith(MockitoJUnitRunner.class) public class UserServiceTest extends TestCreationFactory { @InjectMocks public UserService userService; @Mock public ModelMapper mapper; @Mock public UserRepository userRepository; public User user = this.getUser(); public ResponseUserDto responseUserDto = this.getResponseUserDto(); public RequestUserDto requestUserDto = this.getRequestUserDto(); @Test public void findUserByIdTest() { when(userRepository.findById(user.getId())).thenReturn(Optional.of(user)); when(userService.toResponseDto(user)).thenReturn(responseUserDto); ResponseUserDto responseUserDto = userService.findUserById(user.getId()); assertEquals(responseUserDto.getEmail(), user.getEmail()); } @Test(expected = IllegalStateException.class) public void findUserByIdTestExpectIllegalStateException() { when(userRepository.findById(user.getId())).thenThrow(new IllegalStateException("user was not found by id")); when(userService.toResponseDto(user)).thenReturn(responseUserDto); ResponseUserDto responseUserDto = userService.findUserById(user.getId()); } @Test public void getUsersTest() { int pageNo = 1; int pageSize = 10; String sortBy = "id"; User user1 = this.randomUser(); Pageable pageable = PageRequest.of(pageNo, pageSize, Sort.by(sortBy)); Page<User> userPage = new PageImpl<User>(Collections.singletonList(user1)); when(userRepository.findAll(pageable)).thenReturn(userPage); Page<User> userPageResult = userService.getUsers(pageNo, pageSize, sortBy); assertEquals(userPageResult.getTotalElements(), 1); } @Test public void saveUserTest() { RequestUserDto requestUserDto = this.getRequestUserDto(); User user = this.getUser(); ResponseUserDto responseUserDto = this.getResponseUserDto(); when(userRepository.findUserByEmail(requestUserDto.getEmail())).thenReturn(Optional.empty()); when(userService.toResponseDto(user)).thenReturn(responseUserDto); when(userService.RequestToEntity(requestUserDto)).thenReturn(user); ResponseUserDto createdUser = userService.saveUser(requestUserDto); assertEquals(createdUser, responseUserDto); assertEquals(createdUser.getEmail(), responseUserDto.getEmail()); } @Test(expected = IllegalStateException.class) public void saveUserIllegalStateExceptionTest() { RequestUserDto requestUserDto = this.getRequestUserDto(); User user = this.getUser(); User user2 = this.randomUser(); user2.setEmail(user.getEmail()); ResponseUserDto responseUserDto = this.getResponseUserDto(); when(userRepository.findUserByEmail(requestUserDto.getEmail())).thenReturn(Optional.of(user2)); when(userService.toResponseDto(user)).thenReturn(responseUserDto); when(userService.RequestToEntity(requestUserDto)).thenReturn(user); ResponseUserDto createdUser = userService.saveUser(requestUserDto); } @Test public void deleteUserTest() { when(userRepository.existsById(user.getId())).thenReturn(true); userService.deleteUser(user.getId()); verify(userRepository, times(1)).deleteById(user.getId()); } @Test public void updateUserTest() { when(userRepository.save(any(User.class))).thenReturn(user); when(userRepository.findUserByEmail(requestUserDto.getEmail())).thenReturn(Optional.of(user)); when(userRepository.findById(requestUserDto.getId())).thenReturn(Optional.of(user)); when(userService.toResponseDto(user)).thenReturn(responseUserDto); ResponseUserDto editedUser = userService.updateUser(requestUserDto.getId(), requestUserDto); Assertions.assertEquals(editedUser.getId(), requestUserDto.getId()); Assertions.assertEquals(editedUser.getEmail(), requestUserDto.getEmail()); Assertions.assertEquals(editedUser.getFullName(), requestUserDto.getFullName()); Assertions.assertEquals(editedUser.getUserRole(), requestUserDto.getUserRole()); } @Test(expected = IllegalStateException.class) public void updateUserIllegalStateExceptionTest() { when(userRepository.findById(any(Long.class))).thenReturn(Optional.empty()); ResponseUserDto editedUser = userService.updateUser(requestUserDto.getId(), requestUserDto); Assertions.assertEquals(editedUser.getId(), user.getId()); Assertions.assertEquals(editedUser.getEmail(), user.getEmail()); Assertions.assertEquals(editedUser.getFullName(), user.getFullName()); } @Test(expected = IllegalStateException.class) public void updateUserIllegalStateExceptionEmailUsedTest() { User user2 = this.getUser(); user2.setId(20L); when(userRepository.findById(any(Long.class))).thenReturn(Optional.of(user)); when(userRepository.findUserByEmail(requestUserDto.getEmail())).thenReturn(Optional.of(user2)); ResponseUserDto editedUser = userService.updateUser(requestUserDto.getId(), requestUserDto); Assertions.assertEquals(editedUser.getId(), user.getId()); Assertions.assertEquals(editedUser.getEmail(), user.getEmail()); Assertions.assertEquals(editedUser.getFullName(), user.getFullName()); } @Test(expected = IllegalStateException.class) public void deleteUserIllegalStateExceptionTest() { User newUser1 = this.getUser(); newUser1.setId(2L); when(userRepository.existsById(newUser1.getId())).thenReturn(false); userService.deleteUser(newUser1.getId()); } @Test public void toResponseDtoTest() { when(mapper.map(any(User.class), eq(ResponseUserDto.class))).thenReturn(responseUserDto); ResponseUserDto responseUserDto1 = userService.toResponseDto(user); Assertions.assertEquals(user.getId(), responseUserDto1.getId()); Assertions.assertEquals(user.getEmail(), responseUserDto1.getEmail()); Assertions.assertEquals(user.getUserRole(), responseUserDto1.getUserRole()); } @Test public void responseToEntityTest() { when(mapper.map(any(ResponseUserDto.class), eq(User.class))).thenReturn(user); User u2 = userService.ResponseToEntity(responseUserDto); Assertions.assertEquals(u2.getId(), responseUserDto.getId()); } @Test public void toRequestDtoTest() { when(mapper.map(any(User.class), eq(RequestUserDto.class))).thenReturn(requestUserDto); requestUserDto = userService.toRequestDto(user); Assertions.assertEquals(user.getId(), requestUserDto.getId()); Assertions.assertEquals(user.getEmail(), requestUserDto.getEmail()); Assertions.assertEquals(user.getUserRole(), requestUserDto.getUserRole()); Assertions.assertEquals(user.getGender(), requestUserDto.getGender()); } @Test public void requestToEntityTest() { when(mapper.map(any(RequestUserDto.class), eq(User.class))).thenReturn(user); user = userService.RequestToEntity(requestUserDto); Assertions.assertEquals(user.getEmail(), requestUserDto.getEmail()); Assertions.assertEquals(user.getUserRole(), requestUserDto.getUserRole()); Assertions.assertEquals(user.getFullName(), requestUserDto.getFullName()); } }
[ "daniel.mate@fortech.ro" ]
daniel.mate@fortech.ro
2e3b227c39e2c2bc443ea429ff43368b3a4606ab
409740bb312a939597b6064c310b5feb0c498cfd
/SZI/SZI-master/src/main/java/LogicalLayer/Table.java
5e75f2d3b489f65017181f071a9e5585b2b43ac5
[]
no_license
ArtysT/Projekt-szi
e38f4146452a2f1ab083db87e5e7bc7bd6bd00e9
84f7a7ec349c17c452b18adcac89ba3528a49171
refs/heads/master
2021-01-17T07:09:48.768241
2016-06-21T13:01:52
2016-06-21T13:01:52
53,539,119
0
0
null
null
null
null
UTF-8
Java
false
false
3,854
java
package LogicalLayer; import java.io.IOException; import java.util.ArrayList; import java.util.Random; public class Table { //numer stolika protected Integer table_number; //Koordynaty protected Coordinates coords; //lista krzeseł protected SeatCollection seat_collection; //lista miejsc do ktorych moze podejsc kelner protected ArrayList<Coordinates> waiter_place; //status stolika (do wyświetlania koloru stolika) (dopuszczalne wartości normal, order, waiting) protected String state; //konstruktor public Table(Integer table_nr, Coordinates coords /*SeatCollection seat_collection*/) { this.table_number = table_nr; this.coords = coords; //this.seat_collection = seat_collection; this.waiter_place = new ArrayList<Coordinates>(); this.state = "normal"; } //metoda ustawiajaca numer stolika public void setTableNumber(Integer number) { this.table_number = number; }; //metoda ustawiająca koordynaty stolika public void setCoords(Coordinates coords) { this.coords = coords; } //metoda ustawiająca liste krzesel dla stolika public void setSeatCollection( SeatCollection seat_collection) { this.seat_collection = seat_collection; }; //metoda ustawiająca stan stolika public void setState (String a) { this.state = a; } //metoda zwracająca numer stolika public Integer getTableNumber() { return this.table_number; }; //metoda zwracająca koordynaty stolika public Coordinates getCoords() { return this.coords; } //metoda zwracajaca liste krzesel wokol stolika public SeatCollection getSeatCollection() { return this.seat_collection; }; //metoda zwracajaca liste miejsc do ktorych moze podejsc kelner public ArrayList<Coordinates> getWaiterPlace() { if ( this.waiter_place.size() == 0 ) { this.prepareWaiterPlace(); } return this.waiter_place; } //przygotowanie listy współrzędnych czterech narożników do których może podejść kelner private ArrayList<Coordinates> prepareWaiterPlace() { Integer x = this.coords.getColumn(); Integer y = this.coords.getRow(); Coordinates a = new Coordinates(x-1, y-1); Coordinates b = new Coordinates(x-1, y+1); Coordinates c = new Coordinates(x+1, y-1); Coordinates d = new Coordinates(x+1, y+1); ArrayList<Coordinates> list = new ArrayList<Coordinates>(); list.add(a); list.add(b); list.add(c); list.add(d); return list; } //metoda zwracająca stan stolika public String getState() { return this.state; } //generuje losowe zamówienie zamówienie dla danego stolika używając metody makeOrder na obiekcie OrdersService public void randOrder() throws IOException { Integer m =100; Random generator = new Random(); m = generator.nextInt(100); if (m<80) { this.state = "order"; //for(Integer i=0, i<5, i++){ //this.seat_collection.get(i).setChairAsRed } //nie zadziała dopóki stoliki na mapie też nie będą obiektami // OrdersService order = new OrdersService(); // nie mogę stworzyć Ordersa bo wywala błąd z wyjątkami //order.makeOrder(this.table_number); // korzystanie z gotowej funkcji z klasy OrdersService this.state = "waiting"; //dodaj order do listy order, która ma być wyświetlana System.out.println("Złożono zamówienie"); //for(Integer i=0, i<5, i++){ //this.seat_collection.get(i).setChairAsGreen } } else { System.out.println("Nie chce nic zamówić"); }; } }
[ "thenext1p@gmail.com" ]
thenext1p@gmail.com
d26d7807080369cbe2cae6cb66a5d93e8ac3c763
17c30fed606a8b1c8f07f3befbef6ccc78288299
/Mate10_8_1_0/src/main/java/com/android/internal/telephony/HwPhone.java
9809c5cae2209c38eda79b018489d2e3dc0d6072
[]
no_license
EggUncle/HwFrameWorkSource
4e67f1b832a2f68f5eaae065c90215777b8633a7
162e751d0952ca13548f700aad987852b969a4ad
refs/heads/master
2020-04-06T14:29:22.781911
2018-11-09T05:05:03
2018-11-09T05:05:03
157,543,151
1
0
null
2018-11-14T12:08:01
2018-11-14T12:08:01
null
UTF-8
Java
false
false
6,404
java
package com.android.internal.telephony; import android.os.Message; import android.telephony.CellLocation; import android.telephony.Rlog; import com.android.internal.telephony.PhoneConstants.DataState; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType; public class HwPhone { private static final /* synthetic */ int[] -com-android-internal-telephony-uicc-IccCardApplicationStatus$AppTypeSwitchesValues = null; private static final String LOG_TAG = "HwPhone"; private Phone mPhone; private static /* synthetic */ int[] -getcom-android-internal-telephony-uicc-IccCardApplicationStatus$AppTypeSwitchesValues() { if (-com-android-internal-telephony-uicc-IccCardApplicationStatus$AppTypeSwitchesValues != null) { return -com-android-internal-telephony-uicc-IccCardApplicationStatus$AppTypeSwitchesValues; } int[] iArr = new int[AppType.values().length]; try { iArr[AppType.APPTYPE_CSIM.ordinal()] = 1; } catch (NoSuchFieldError e) { } try { iArr[AppType.APPTYPE_ISIM.ordinal()] = 2; } catch (NoSuchFieldError e2) { } try { iArr[AppType.APPTYPE_RUIM.ordinal()] = 3; } catch (NoSuchFieldError e3) { } try { iArr[AppType.APPTYPE_SIM.ordinal()] = 4; } catch (NoSuchFieldError e4) { } try { iArr[AppType.APPTYPE_UNKNOWN.ordinal()] = 6; } catch (NoSuchFieldError e5) { } try { iArr[AppType.APPTYPE_USIM.ordinal()] = 5; } catch (NoSuchFieldError e6) { } -com-android-internal-telephony-uicc-IccCardApplicationStatus$AppTypeSwitchesValues = iArr; return iArr; } public HwPhone(Phone phoneproxy) { this.mPhone = phoneproxy; log("init HwPhone mPhone = " + this.mPhone); } private void log(String msg) { Rlog.d(LOG_TAG, "[PhoneIntfMgr] " + msg); } public String getMeid() { return this.mPhone.getMeid(); } public String getPesn() { return this.mPhone.getPesn(); } public String getNVESN() { return this.mPhone.getNVESN(); } public void closeRrc() { this.mPhone.closeRrc(); } public boolean isCDMAPhone() { if (this.mPhone == null || (((GsmCdmaPhone) this.mPhone).isPhoneTypeGsm() ^ 1) == 0) { return false; } return true; } public void setDefaultMobileEnable(boolean enabled) { this.mPhone.mDcTracker.setEnabledPublic(0, enabled); } public void setDataEnabledWithoutPromp(boolean enabled) { this.mPhone.mDcTracker.setDataEnabled(enabled); } public void setDataRoamingEnabledWithoutPromp(boolean enabled) { this.mPhone.mDcTracker.setDataRoamingEnabledByUser(enabled); } public DataState getDataConnectionState() { return this.mPhone.getDataConnectionState(); } public void setPreferredNetworkType(int networkType, Message response) { this.mPhone.setPreferredNetworkType(networkType, response); } public void getPreferredNetworkType(Message response) { this.mPhone.getPreferredNetworkType(response); } public String getImei() { return this.mPhone.getImei(); } public Phone getPhone() { return this.mPhone; } public int getHwPhoneType() { Rlog.d(LOG_TAG, "[enter]getHwPhoneType"); return this.mPhone.getPhoneType(); } public String getCdmaGsmImsi() { Rlog.d(LOG_TAG, "getCdmaGsmImsi: in HuaweiPhoneService"); return this.mPhone.getCdmaGsmImsi(); } public int getUiccCardType() { Rlog.d(LOG_TAG, "[enter]getUiccCardType"); return this.mPhone.getUiccCardType(); } public CellLocation getCellLocation() { Rlog.d(LOG_TAG, "[enter]getUiccCardType"); return this.mPhone.getCellLocation(); } public String getCdmaMlplVersion() { Rlog.d(LOG_TAG, "getCdmaMlplVersion: in HuaweiPhoneService"); return this.mPhone.getCdmaMlplVersion(); } public String getCdmaMsplVersion() { Rlog.d(LOG_TAG, "getCdmaMsplVersion: in HuaweiPhoneService"); return this.mPhone.getCdmaMsplVersion(); } public void testVoiceLoopBack(int mode) { this.mPhone.testVoiceLoopBack(mode); } public boolean setISMCOEX(String setISMCoex) { return this.mPhone.setISMCOEX(setISMCoex); } public int getUiccAppType() { switch (-getcom-android-internal-telephony-uicc-IccCardApplicationStatus$AppTypeSwitchesValues()[this.mPhone.getCurrentUiccAppType().ordinal()]) { case 1: return 4; case 2: return 5; case 3: return 3; case 4: return 1; case 5: return 2; default: return 0; } } public boolean isRadioAvailable() { return this.mPhone.isRadioAvailable(); } public void setImsSwitch(boolean value) { this.mPhone.setImsSwitch(value); } public boolean getImsSwitch() { return this.mPhone.getImsSwitch(); } public void setImsDomainConfig(int domainType) { this.mPhone.setImsDomainConfig(domainType); } public void handleMapconImsaReq(byte[] Msg) { this.mPhone.handleMapconImsaReq(Msg); } public void getImsDomain(Message Msg) { this.mPhone.getImsDomain(Msg); } public void handleUiccAuth(int auth_type, byte[] rand, byte[] auth, Message Msg) { this.mPhone.handleUiccAuth(auth_type, rand, auth, Msg); } public boolean cmdForECInfo(int event, int action, byte[] buf) { try { return this.mPhone.cmdForECInfo(event, action, buf); } catch (Exception ex) { Rlog.e(LOG_TAG, "cmdForECInfo fail:" + ex); return false; } } public void requestForECInfo(Message msg, int event, byte[] buf) { this.mPhone.sendHWSolicited(msg, event, buf); } public boolean isCtSimCard() { String iccId = this.mPhone.getIccSerialNumber(); if (iccId == null || iccId.length() < 7) { return false; } return HwAllInOneController.isCTCard(iccId.substring(0, 7)); } }
[ "lygforbs0@mail.com" ]
lygforbs0@mail.com
c428e5c21b00a9b8ebba264e7d76412b3323bb79
028cbe18b4e5c347f664c592cbc7f56729b74060
/v2/appserv-tests/devtests/web/servlet-3.0/multiWebFragments/servlet/WFTestFilter.java
f500da987e76b3b9aae7b765cf1da48bbd088f46
[]
no_license
dmatej/Glassfish-SVN-Patched
8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e
269e29ba90db6d9c38271f7acd2affcacf2416f1
refs/heads/master
2021-05-28T12:55:06.267463
2014-11-11T04:21:44
2014-11-11T04:21:44
23,610,469
1
0
null
null
null
null
UTF-8
Java
false
false
2,975
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html * or packager/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at packager/legal/LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" * exception as provided by Oracle in the GPL Version 2 section of the License * file that accompanied this code. * * Modifications: * If applicable, add the following below the License Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * "Portions Copyright [year] [name of copyright owner]" * * Contributor(s): * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ package wftest; import java.io.IOException; import javax.servlet.DispatcherType; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.annotation.WebFilter; @WebFilter(urlPatterns={ "/" }, dispatcherTypes= { DispatcherType.REQUEST }) public class WFTestFilter implements Filter { public void init(FilterConfig filterConfig) throws ServletException { System.out.println(">>> WFTestFilter.init"); } public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { System.out.println(">>> WFTestFilter.doFilter"); req.setAttribute("filterMessage", "WFTestFilterMesg"); chain.doFilter(req, res); } public void destroy() { System.out.println(">>> WFTestFilter.destroy"); } }
[ "swchan2@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5" ]
swchan2@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5
10f2be3a3a073641d951baba6540f3827c8938b7
6f7bd6bfff905117b207a3bbae85afc07066151c
/mybatis-3-mybatis-3.2.3/src/main/java/org/apache/ibatis/mapping/VendorDatabaseIdProvider.java
8ca288e3865047017eabb23e2f30255e9ed53b2e
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
caomao95/mybatis-3.2.3
975e36303cd9b8be9f8335d5e2055ccf5bd7e45c
bb2a737bd36f1e19d6f002f2cdf3b821456e4942
refs/heads/master
2022-07-24T07:45:20.745370
2019-11-18T07:39:41
2019-11-18T07:39:41
218,691,500
0
1
null
2019-11-06T14:03:14
2019-10-31T05:33:50
Java
UTF-8
Java
false
false
2,056
java
package org.apache.ibatis.mapping; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.SQLException; import java.util.Map; import java.util.Properties; import javax.sql.DataSource; import org.apache.ibatis.executor.BaseExecutor; import org.apache.ibatis.logging.Log; import org.apache.ibatis.logging.LogFactory; /** * @author */ public class VendorDatabaseIdProvider implements DatabaseIdProvider { private static final Log log = LogFactory.getLog(BaseExecutor.class); private Properties properties; public String getDatabaseId(DataSource dataSource) { if (dataSource == null) { throw new NullPointerException("dataSource cannot be null"); } try { return getDatabaseName(dataSource); } catch (Exception e) { log.error("Could not get a databaseId from dataSource", e); } return null; } public void setProperties(Properties p) { this.properties = p; } private String getDatabaseName(DataSource dataSource) throws SQLException { String productName = getDatabaseProductName(dataSource); if (this.properties != null) { for (Map.Entry<Object, Object> property : properties.entrySet()) { if (productName.contains((String) property.getKey())) { return (String) property.getValue(); } } // no match, return null return null; } return productName; } private String getDatabaseProductName(DataSource dataSource) throws SQLException { Connection con = null; try { con = dataSource.getConnection(); DatabaseMetaData metaData = con.getMetaData(); return metaData.getDatabaseProductName(); } finally { if (con != null) { try { con.close(); } catch (SQLException e) { // ignored } } } } }
[ "528637588@qq.com" ]
528637588@qq.com
f8328423b021a53831d341123717d168996d321b
ef46c6a2e461631ab97924a5b07c81253baf33cf
/app/src/main/java/bilibqoy/mohirjonnnikibuilova/namozvsquron/Adapter/RecyclerAdapter.java
417e15dc7df8257481b0ee73d485a11fb6ef9f0f
[]
no_license
MsdSdm/NamozvsQuron
0e70a911e9c75464ed3173db826b2172d6b85685
351379914f9b6c22c80624683cb7517b3f8b4983
refs/heads/master
2023-06-01T11:58:23.291646
2021-06-16T11:10:37
2021-06-16T11:10:37
376,809,183
1
0
null
null
null
null
UTF-8
Java
false
false
5,988
java
package bilibqoy.mohirjonnnikibuilova.namozvsquron.Adapter; import android.app.Activity; import android.content.Context; import android.media.AudioManager; import android.media.MediaPlayer; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView; import java.util.List; import bilibqoy.mohirjonnnikibuilova.namozvsquron.R; /** * Created by Taslima on 3/12/2017. */ public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.MyViewHolder> { List<NameModel> seekerCycleModels; Activity activity; NameModel seekerCycleModel; MediaPlayer mediaPlayer; AudioManager mAudioManager; /** * This listener gets triggered whenever the audio focus changes * (i.e., we gain or lose audio focus because of another app or device). */ private AudioManager.OnAudioFocusChangeListener mOnAudioFocusChangeListener = new AudioManager.OnAudioFocusChangeListener() { @Override public void onAudioFocusChange(int focusChange) { if (focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT || focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK) { // The AUDIOFOCUS_LOSS_TRANSIENT case means that we've lost audio focus for a // short amount of time. The AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK case means that // our app is allowed to continue playing sound but at a lower volume. We'll treat // both cases the same way because our app is playing short sound files. // Pause playback and reset player to the start of the file. That way, we can // play the word from the beginning when we resume playback. mediaPlayer.pause(); mediaPlayer.seekTo(0); } else if (focusChange == AudioManager.AUDIOFOCUS_GAIN) { // The AUDIOFOCUS_GAIN case means we have regained focus and can resume playback. mediaPlayer.start(); } else if (focusChange == AudioManager.AUDIOFOCUS_LOSS) { // The AUDIOFOCUS_LOSS case means we've lost audio focus and // Stop playback and clean up resources releaseMediaPlayer(); } } }; private MediaPlayer.OnCompletionListener mCompletionListener = new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mediaPlayer) { // Now that the sound file has finished playing, release the media player resources. releaseMediaPlayer(); } }; public RecyclerAdapter(Activity activity, List<NameModel> seekerCycleModels) { this.activity = activity; this.seekerCycleModels = seekerCycleModels; } @Override public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemview = LayoutInflater.from(parent.getContext()).inflate(R.layout.card_row_update,parent,false); return new MyViewHolder(itemview); } @Override public void onBindViewHolder(final MyViewHolder holder, final int position) { seekerCycleModel = seekerCycleModels.get(position); holder.banname.setText(seekerCycleModel.getBanName()); holder.enname.setText(seekerCycleModel.getEnName()); holder.englishmean.setText(seekerCycleModel.getEnglishmean()); mAudioManager = (AudioManager) activity.getSystemService(Context.AUDIO_SERVICE); holder.play.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { releaseMediaPlayer(); int result = mAudioManager.requestAudioFocus(mOnAudioFocusChangeListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT); if (result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) { mediaPlayer = MediaPlayer.create(activity, seekerCycleModels.get(position).getMp3File()); mediaPlayer.start(); mediaPlayer.setOnCompletionListener(mCompletionListener); } } }); } @Override public int getItemCount() { return seekerCycleModels.size(); } public static class MyViewHolder extends RecyclerView.ViewHolder { TextView banname; TextView enname; TextView englishmean; ImageView play; public MyViewHolder(View itemView) { super(itemView); banname = (TextView) itemView.findViewById(R.id.ban); enname = (TextView) itemView.findViewById(R.id.eng); englishmean = (TextView) itemView.findViewById(R.id.englishMean); play = (ImageView) itemView.findViewById(R.id.play); } } /** * Clean up the media player by releasing its resources. */ public void releaseMediaPlayer() { // If the media player is not null, then it may be currently playing a sound. if (mediaPlayer != null) { // Regardless of the current state of the media player, release its resources // because we no longer need it. mediaPlayer.release(); // Set the media player back to null. For our code, we've decided that // setting the media player to null is an easy way to tell that the media player // is not configured to play an audio file at the moment. mediaPlayer = null; // Regardless of whether or not we were granted audio focus, abandon it. This also // unregisters the AudioFocusChangeListener so we don't get anymore callbacks. mAudioManager.abandonAudioFocus(mOnAudioFocusChangeListener); } } }
[ "64627681+mohirjon4517@users.noreply.github.com" ]
64627681+mohirjon4517@users.noreply.github.com
6022e07cfd0ac844987202fc42b7e23f2c766d86
01ebcdaa3faae0b086d3612fb50b16689535f359
/hashh/src/com/company/Main.java
fac823ffdc27205c7490595e407929b38503b7f8
[]
no_license
Miracle-SE2005/hashh
211c771c82c9549f16c353653a9a1a931e92f3c9
caaf90e6fbb788bf23e61f2c4f2cf60b392bb207
refs/heads/main
2023-05-06T03:43:14.371106
2021-05-30T16:32:55
2021-05-30T16:32:55
372,264,271
0
0
null
null
null
null
UTF-8
Java
false
false
4,305
java
package com.company; import java.util.Objects; import java.util.ArrayList; public class Main { public static void main(String[] args) { // example HashTable<String, Integer> HT = new HashTable<>(); HT.add("first", 1); HT.add("second", 2); HT.add("first", 3); HT.add("third", 4); System.out.println("size() = " + HT.size()); System.out.println("remove() = " + HT.remove("second")); System.out.println("remove() = " + HT.remove("second")); System.out.println("size() = " + HT.size()); System.out.println("isEmpty() = " + HT.isEmpty()); } } class HashTable<K, V> { private ArrayList<HashNode<K, V>> Array; private int countOfBuckets; private int sz; public HashTable() { sz = 0; countOfBuckets = 7; Array = new ArrayList<>(); for (int i = 0; i < countOfBuckets; ++i) { Array.add(null); } } public int size() { return sz; } public boolean isEmpty() { if (sz == 0) { // if size is equal to zero then hast table is empty return true; } else { return false; } } private final int hashCode(K key) { return Objects.hashCode(key); } public V get(K key) { int index = getIndex(key); int hashCode = hashCode(key); HashNode<K, V> cur = Array.get(index); while (cur != null) { if (cur.key.equals(key) && cur.hashCode == hashCode) { // compare their key and hashcode, return cur.value; // if they are equal then we found a right node } cur = cur.next; } return null; // if not found then return null } private int getIndex(K key) { int hashCode = hashCode(key); int index = hashCode % countOfBuckets; if (index < 0) { // index cannot be negative so we take its absolute value index = -index; } return index; } public V remove(K key) { int index = getIndex(key); int hashCode = hashCode(key); HashNode<K, V> cur = Array.get(index); HashNode<K, V> prev = null; while (cur != null) { if (cur.key.equals(key) && hashCode == cur.hashCode) { break; } prev = cur; cur = cur.next; } if (cur == null) { return null; } sz--; if (prev != null) { prev.next = cur.next; } else { Array.set(index, cur.next); } return cur.value; } public void add(K key, V value) { int index = getIndex(key); int hashCode = hashCode(key); HashNode<K, V> cur = Array.get(index); while (cur != null) { if (cur.key.equals(key) && cur.hashCode == hashCode) { cur.value = value; // if it's already in hash table, then just update its value return; } cur = cur.next; } sz++; // otherwise we have to add it cur = Array.get(index); HashNode<K, V> newNode = new HashNode<K, V>(key, value, hashCode); newNode.next = cur; Array.set(index, newNode); if ((1.0*sz)/countOfBuckets >= 0.7) { // if buffer is full, then expand it and rebuild hash table ArrayList<HashNode<K, V>> old = Array; Array = new ArrayList<>(); countOfBuckets = 2*countOfBuckets; sz = 0; for (int i = 0; i < countOfBuckets; ++i) { Array.add(null); } for (HashNode<K, V> x : old) { while (x != null) { add(x.key, x.value); x = x.next; } } } } } class HashNode<K, V> { K key; V value; final int hashCode; HashNode<K, V> next; public HashNode(K newKey, V newValue, int newHashCode) { // constructor this.key = newKey; this.value = newValue; this.hashCode = newHashCode; } }
[ "noreply@github.com" ]
Miracle-SE2005.noreply@github.com
a6ade08ee5e1fc8ce5dc828a9bdf94f518163b75
dd278d86d95295efd5747ecae0529fae55c11c15
/app/src/main/java/com/kisita/wapibus/adapters/WapiBusRecyclerViewAdapter.java
6adc93e7844c3be5e433d231e5be7b509ba03084
[]
no_license
kisita163/wapibus
56e5cd273aaf726c06a6d743dc5cdd4ae88be90d
9fb4a1ea6619a5a5ae80d5be1efb0983520862be
refs/heads/master
2020-12-02T10:11:06.287167
2017-07-09T17:16:12
2017-07-09T17:16:12
96,699,153
0
0
null
null
null
null
UTF-8
Java
false
false
2,778
java
package com.kisita.wapibus.adapters; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.kisita.wapibus.ui.ItemFragment.OnListFragmentInteractionListener; import com.kisita.wapibus.R; import com.kisita.wapibus.TransportContent.TransportContent.TransportItem; import java.util.List; /** * {@link RecyclerView.Adapter} that can display a {@link TransportItem} and makes a call to the * specified {@link OnListFragmentInteractionListener}. * TODO: Replace the implementation with code for your data type. */ public class WapiBusRecyclerViewAdapter extends RecyclerView.Adapter<WapiBusRecyclerViewAdapter.ViewHolder> { private final List<TransportItem> mValues; private final OnListFragmentInteractionListener mListener; public WapiBusRecyclerViewAdapter(List<TransportItem> items, OnListFragmentInteractionListener listener) { mValues = items; mListener = listener; } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.fragment_item, parent, false); return new ViewHolder(view); } @Override public void onBindViewHolder(final ViewHolder holder, int position) { holder.mItem = mValues.get(position); holder.mIdView.setText(mValues.get(position).id); holder.mContentView.setText(mValues.get(position).content); holder.mView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (null != mListener) { // Notify the active callbacks interface (the activity, if the // fragment is attached to one) that an item has been selected. mListener.onListFragmentInteraction(holder.mItem); } } }); } @Override public int getItemCount() { return mValues.size(); } public class ViewHolder extends RecyclerView.ViewHolder { public final View mView; public final TextView mIdView; public final TextView mContentView; public TransportItem mItem; public ViewHolder(View view) { super(view); mView = view; mIdView = (TextView) view.findViewById(R.id.id); mContentView = (TextView) view.findViewById(R.id.content); } @Override public String toString() { return super.toString() + " '" + mContentView.getText() + "'"; } } }
[ "HuguesKi@N8103.tmt.telital.com" ]
HuguesKi@N8103.tmt.telital.com
d431235e95c245d2e6cac45441810c40bffb43ab
600df3590cce1fe49b9a96e9ca5b5242884a2a70
/blimp/client/app/android/javatests/src/org/chromium/blimp/core/MockBlimpClientContextDelegate.java
f5cccdf59df66b01a769b4659d7a4e3f7774b8f6
[ "BSD-3-Clause" ]
permissive
metux/chromium-suckless
efd087ba4f4070a6caac5bfbfb0f7a4e2f3c438a
72a05af97787001756bae2511b7985e61498c965
refs/heads/orig
2022-12-04T23:53:58.681218
2017-04-30T10:59:06
2017-04-30T23:35:58
89,884,931
5
3
BSD-3-Clause
2022-11-23T20:52:53
2017-05-01T00:09:08
null
UTF-8
Java
false
false
1,095
java
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.blimp.core; import android.content.Context; import org.chromium.blimp_public.BlimpClientContextDelegate; /** * Mock {@link BlimpClientContextDelegate}, to test embedder delegate functions. * This test support class only tests Java layer and is not backed by any native code. */ public class MockBlimpClientContextDelegate implements BlimpClientContextDelegate { int mRestartCalled = 0; int mStartUserSignInFlowCalled = 0; public void reset() { mRestartCalled = 0; mStartUserSignInFlowCalled = 0; } public int restartBrowserCalled() { return mRestartCalled; } public int startUserSignInFlowCalled() { return mStartUserSignInFlowCalled; } @Override public void restartBrowser() { mRestartCalled++; } @Override public void startUserSignInFlow(Context context) { mStartUserSignInFlowCalled++; } }
[ "enrico.weigelt@gr13.net" ]
enrico.weigelt@gr13.net
0820d83ed2a6ff6bb7e48105e94550b3ce74542a
20054763b3ce33f12f30d909647eb1f07e6eecc5
/src/com/wira/pmgt/client/ui/events/LogoutEvent.java
347e6b729b5b70975115fb4256e5560d04d90f59
[]
no_license
duggankimani/IConserv
69fc9ce2a1fc82b4eb02dc0e26b1f7f24aa07341
20d38fef419e654b416242e53ab4a8d015f6a66d
refs/heads/master
2021-01-16T23:15:47.696716
2015-04-21T08:47:13
2015-04-21T08:47:13
18,596,450
0
0
null
null
null
null
UTF-8
Java
false
false
777
java
package com.wira.pmgt.client.ui.events; import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.HasHandlers; public class LogoutEvent extends GwtEvent<LogoutEvent.LogoutHandler> { public static Type<LogoutHandler> TYPE = new Type<LogoutHandler>(); public interface LogoutHandler extends EventHandler { void onLogout(LogoutEvent event); } public LogoutEvent() { } @Override protected void dispatch(LogoutHandler handler) { handler.onLogout(this); } @Override public Type<LogoutHandler> getAssociatedType() { return TYPE; } public static Type<LogoutHandler> getType() { return TYPE; } public static void fire(HasHandlers source) { source.fireEvent(new LogoutEvent()); } }
[ "tosh0948@gmail.com" ]
tosh0948@gmail.com
fa86544ce18b9f29b91c2750e63a6d3aa2cdd2c0
7b116c9814a3ad1cc4e01a8b1655b48de941c751
/src/main/java/com/leonov/diplome/config/SuccessAuthenticationHandler.java
8e419d46bbe05a4aa1417289638d4c37c50404cc
[]
no_license
Morphite/WaterAssessment
909b4b39b7ba2d08a01782abe52c1bcb37fd5bf2
b07bf6eb2de1bb73a4f36cb71a064356dc75f730
refs/heads/master
2022-12-17T15:06:30.213133
2020-09-16T12:19:40
2020-09-16T12:19:40
285,024,039
0
0
null
2020-08-04T15:47:38
2020-08-04T15:38:43
null
UTF-8
Java
false
false
1,010
java
package com.leonov.diplome.config; import com.leonov.diplome.model.SecurityUserDetails; import com.leonov.diplome.model.User; import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; import org.springframework.stereotype.Component; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @Component public class SuccessAuthenticationHandler implements AuthenticationSuccessHandler { @Override public void onAuthenticationSuccess(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) throws IOException, ServletException { User currentUser = ((SecurityUserDetails)authentication.getPrincipal()).getUser(); httpServletRequest.getSession().setAttribute("user", currentUser); httpServletResponse.sendRedirect("/objects"); } }
[ "Mykyta_Leonov@epam.com" ]
Mykyta_Leonov@epam.com
3a165a8d7b79e798216b2e8a1d9390f3bd7725d4
ac432abb461523ab6da51efcfae7a649295eb33f
/MavCommon/src/main/java/com/jayfella/jme/vehicle/examples/sounds/EngineSound1.java
05f76175afbf9c6af2e8c659ef61bbc82e7e5b40
[ "BSD-3-Clause", "CC-BY-4.0", "Apache-2.0", "CC-BY-NC-4.0", "CC-BY-NC-SA-4.0", "LicenseRef-scancode-other-copyleft", "Unlicense", "CC0-1.0" ]
permissive
stephengold/jme-vehicles
c9c4c7e153f624de6dbbe441501dd116d9184ce6
0087f93aff63fda6b210b22e7196919de1b2bd17
refs/heads/master
2023-08-17T19:11:22.902024
2023-08-10T08:20:48
2023-08-10T08:20:48
304,941,898
15
3
BSD-3-Clause
2020-10-17T18:20:00
2020-10-17T18:20:00
null
UTF-8
Java
false
false
646
java
package com.jayfella.jme.vehicle.examples.sounds; import com.jayfella.jme.vehicle.Sound; /** * A Sound built around "engine-1.ogg". * * @author Stephen Gold sgold@sonic.net */ public class EngineSound1 extends Sound { // ************************************************************************* // constructors /** * Instantiate the Sound. */ public EngineSound1() { super.addAssetPath("/Audio/engine-1d2.ogg", 13.4f); super.addAssetPath("/Audio/engine-1.ogg", 26.75f); super.addAssetPath("/Audio/engine-1x2.ogg", 53.5f); super.addAssetPath("/Audio/engine-1x4.ogg", 107f); } }
[ "sgold@sonic.net" ]
sgold@sonic.net
daf73215d82b5f7ca3cedf607b5185e84e6bb990
d8cc40718b7af0193479a233a21ea2f03c792764
/aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/transform/AttemptDetailMarshaller.java
480259166b8ecc1f9946d761bdddb208f3c45c90
[ "Apache-2.0" ]
permissive
chaoweimt/aws-sdk-java
1de8c0aeb9aa52931681268cd250ca2af59a83d9
f11d648b62f2615858e2f0c2e5dd69e77a91abd3
refs/heads/master
2021-01-22T03:18:33.038352
2017-05-24T22:40:24
2017-05-24T22:40:24
92,371,194
1
0
null
2017-05-25T06:13:36
2017-05-25T06:13:35
null
UTF-8
Java
false
false
2,868
java
/* * Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.batch.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.batch.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * AttemptDetailMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class AttemptDetailMarshaller { private static final MarshallingInfo<StructuredPojo> CONTAINER_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("container").build(); private static final MarshallingInfo<Long> STARTEDAT_BINDING = MarshallingInfo.builder(MarshallingType.LONG).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("startedAt").build(); private static final MarshallingInfo<Long> STOPPEDAT_BINDING = MarshallingInfo.builder(MarshallingType.LONG).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("stoppedAt").build(); private static final MarshallingInfo<String> STATUSREASON_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("statusReason").build(); private static final AttemptDetailMarshaller instance = new AttemptDetailMarshaller(); public static AttemptDetailMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(AttemptDetail attemptDetail, ProtocolMarshaller protocolMarshaller) { if (attemptDetail == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(attemptDetail.getContainer(), CONTAINER_BINDING); protocolMarshaller.marshall(attemptDetail.getStartedAt(), STARTEDAT_BINDING); protocolMarshaller.marshall(attemptDetail.getStoppedAt(), STOPPEDAT_BINDING); protocolMarshaller.marshall(attemptDetail.getStatusReason(), STATUSREASON_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
3813f517da80a1f149b758733feb387b54c3d8d5
49464cc770aa3bcbc491f7f6faf3b187750105d7
/plugin/src/lang/psi/PascalStructType.java
0be3daf16573662be71d85291324b8bdde340997
[]
no_license
semoro/i-pascal
13d2eec5643c3acc806bd0fea32e6e7506d586c7
3fa78b7705f5ca820b13fbede5e7363557ae167d
refs/heads/master
2021-01-19T18:01:25.818787
2017-05-26T21:21:10
2017-05-26T21:21:10
101,106,209
0
0
null
2017-08-22T20:50:12
2017-08-22T20:50:12
null
UTF-8
Java
false
false
889
java
package com.siberika.idea.pascal.lang.psi; import com.siberika.idea.pascal.lang.psi.impl.PasField; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Collection; import java.util.List; /** * Author: George Bakhtadze * Date: 29/01/2015 */ public interface PascalStructType extends PasEntityScope { @Nullable PasField getField(String name); @NotNull Collection<PasField> getAllFields(); @NotNull List<PasVisibility> getVisibilityList(); @NotNull List<PasClassField> getClassFieldList(); @NotNull List<PasClassProperty> getClassPropertyList(); @NotNull List<PasVarSection> getVarSectionList(); @NotNull List<PasConstSection> getConstSectionList(); @NotNull List<PasTypeSection> getTypeSectionList(); @NotNull List<PasExportedRoutine> getExportedRoutineList(); }
[ "argb32@gmail.com" ]
argb32@gmail.com
713aacab93f8734c829de392f1192b728e68fc1d
f7d2fd168d8364e851ceb4a0cf21e17ee7aee6d3
/app/src/main/java/edu/git/weixin/activity/contacts/DetailActivity.java
6db1492678a501ed0f7f500ab5ddea43c1b20651
[]
no_license
Canoe955/WeiXin
9ba26f9a2344f1cfcfbd9bcec289b2e47c8eb59c
6cdc7aeb6e06fe09cc062887c82fa472e2c82d72
refs/heads/master
2023-05-04T12:48:47.785049
2021-05-19T00:45:48
2021-05-19T00:45:48
366,694,874
0
0
null
null
null
null
UTF-8
Java
false
false
845
java
package edu.git.weixin.activity.contacts; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.ImageView; import edu.git.weixin.R; import edu.git.weixin.fragment.HomePageFragment; public class DetailActivity extends AppCompatActivity { ImageView imageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); imageView = findViewById(R.id.image_homepage_fragment); imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(DetailActivity.this, HomePageFragment.class)); } }); } }
[ "canoe955yan@gmail.com" ]
canoe955yan@gmail.com
154a56de72ce3982b594a76ddedbcf297d62e0a5
b0c8997ee2d3891c7c85d536c763f0ee8d2baf86
/src/main/java/me/shienpro/annotation/Autowired.java
4a95f56c9482c0f5671701ca62d9e7c843add34e
[]
no_license
ShienPro/simple-ioc
b38189263f9a09d21bc71fd53d549b5ff1c059c1
45a57749f5397167a6c268155013d80b09c4fc35
refs/heads/master
2021-06-10T10:52:07.465668
2021-04-11T13:32:44
2021-04-11T13:32:44
165,626,562
1
0
null
null
null
null
UTF-8
Java
false
false
314
java
package me.shienpro.annotation; import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.PARAMETER}) @Documented public @interface Autowired { /** * @return bean name */ String value() default ""; }
[ "805952135@qq.com" ]
805952135@qq.com
7281d76af47f3d09e0f8b39adb24707864b2d7f7
3b0793b0ffa417b47dcee2c70870dcf5063fa569
/CODI/Estacio.java
99ad94a568e1b528c55dd869867a5ea54dd770ff
[]
no_license
roger21gm/ProActive-Travel
0bcb49117fa6ba2f3c0ae3c1a5a8a2e8dbda7821
fa72a33f5c6f6916314cee671f46a32342b06169
refs/heads/master
2020-04-25T14:58:28.422684
2019-02-27T07:08:40
2019-02-27T07:08:40
172,861,640
0
0
null
null
null
null
UTF-8
Java
false
false
2,393
java
/** * @class Estacio * @brief Una estació situada a un lloc des d'on surten diferents tranports cap a altres lloc. * @details Centre des d'on surten una sèrie de transports cap a altres llocs. * Es triga un temps per arribar-hi i un altre per anar-se'n. * @author Amat Martínez Vilà * @version 2017.4.5 */ import java.time.LocalDate; import java.util.*; public class Estacio { ///< Estructura que conté, indexat per lloc de destí i per data, tots els transports que surten de l'estació actual. private TreeMap<LocalDate, HashSet<TransportIndirecte>> transports; ///< Temps que es triga per a arribar fins a l'estació actual. private int tempsFinsAEstacio; public Estacio(){ transports = new TreeMap<>(); tempsFinsAEstacio = 0; } public Estacio(int tempsDes){ this.tempsFinsAEstacio = tempsDes; transports = new TreeMap<>(); } /** * @param dia és una data vàlida. * @post afegeix el transport al destí indicat a la llista el dia corresponent. * @param transport és un transport Indirecte no buit. * @return (void) */ public void afegirTransport(LocalDate dia, TransportIndirecte t){ HashSet<TransportIndirecte> trans_dia = transports.get(dia); if(trans_dia == null) afegirNouDia(dia); transports.get(dia).add(t); } /** * @pre dia és una data vàlida. * @post afegeix el transport al destí indicat a la llista el dia corresponent. * @param dia és el dia en que surt el transport. * @return (void) */ private void afegirNouDia(LocalDate dia){ transports.put(dia,new HashSet<>()); } /** * @pre dia ha de ser un dia que contingui connexions. * @return retorna un iterador de les connexions de la estació actual del dia indicat. En el cas que no n'hi hagi, retorna null; */ public Iterator<TransportIndirecte> retornaConnexions(LocalDate dia){ HashSet<TransportIndirecte> connexions = transports.get(dia); if(connexions!=null) return connexions.iterator(); else return null; } /** * @pre cert * @post Retorna el temps que es triga per arribar fins a l'estació actual. * @return Retorna el temps que es triga per arribar fins a l'estació actual. */ public int obtTempsFinsEstacio() { return tempsFinsAEstacio; } }
[ "noreply@github.com" ]
roger21gm.noreply@github.com
e384a2fa6680529840bf237443ccc60bb716fc9b
a8672cc829a501d0efe13e17ce742e243d70083d
/spring-ch5-rw/src/main/java/com/bytebeats/spring4/sample/App.java
7b4f1040d4455276843b28b6ec5ca9141966982d
[]
no_license
songdinghy/spring4-in-action
d5315494f43bd71c2ac7551c1ddf9e28ef6bd4a1
2f231a682e88be84fee1bcf79f0ff5228a5013f8
refs/heads/master
2021-01-11T13:36:53.063244
2017-05-06T13:08:10
2017-05-06T13:08:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
867
java
package com.bytebeats.spring4.sample; import com.bytebeats.spring4.sample.dao.IOrderDao; import com.bytebeats.spring4.sample.domain.Order; import org.springframework.context.support.ClassPathXmlApplicationContext; import java.util.List; /** * Hello world! * */ public class App { public static void main( String[] args ) { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); IOrderDao orderDao = (IOrderDao) context.getBean("orderDao"); Order order = new Order(); order.setCustomerName("Ricky"); order.setAmount(11); order.setTotalPrice(120.2d); order.setAddress("北京市"); long id = orderDao.insert(order); System.out.println(id); List<Order> list = orderDao.queryOrders(); System.out.println(list); } }
[ "bingbingfeng2@yirendai.com" ]
bingbingfeng2@yirendai.com
788f0b908a85c4c12ebeff053f6ac9174ea6640d
754c471592723bcc1ce4b4f69e2187fff3214308
/erp_biz/src/main/java/com/huangxin/biz/impl/SupplierBiz.java
fa7f8c7990014024a74ef1667cbf59044237a4b5
[]
no_license
huangxin19990101/erp_parent
272507b8933d6d0e4b611c8bb257e8cb42c3d99f
ce1c51c3772608fc095f1da5ee2685798ad90536
refs/heads/master
2020-04-30T08:19:13.910216
2019-03-20T10:43:52
2019-03-20T10:43:52
176,705,317
0
0
null
null
null
null
UTF-8
Java
false
false
462
java
package com.huangxin.biz.impl; import java.util.List; import com.huangxin.biz.ISupplierBiz; import com.huangxin.dao.ISupplierDao; import com.huangxin.entity.Supplier; /** * 部门业务实现类 * @author Kay * */ public class SupplierBiz extends BaseBiz<Supplier> implements ISupplierBiz { private ISupplierDao supplierDao; public void setSupplierDao(ISupplierDao supplierDao) { this.supplierDao = supplierDao; super.setTBaseDao(supplierDao); } }
[ "1843942434@qq.com" ]
1843942434@qq.com
d6dd0aa7c430710dd440f58ee239f5e0234d0c8c
f6349cad38fc4fa124230d26a6ff84e3ea57dfb0
/src/main/java/com/shakil/etailor/config/DBConfig.java
d655104a9adcf5daecd2d71af7bacae43bba84da
[]
no_license
alaminshakil/E-Tailor
ce81bac311c83e35aa54dcfecb54789438faec7a
b20d572b8a5339d5a9e1858c0f15f03c3dce2bbc
refs/heads/master
2022-12-27T17:10:32.322704
2019-07-06T02:56:55
2019-07-06T02:56:55
195,490,483
0
0
null
2022-12-16T10:32:39
2019-07-06T02:55:03
JavaScript
UTF-8
Java
false
false
2,720
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 com.shakil.etailor.config; import java.util.Properties; import javax.sql.DataSource; import org.apache.commons.dbcp.BasicDataSource; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.orm.hibernate4.HibernateTemplate; import org.springframework.orm.hibernate4.HibernateTransactionManager; import org.springframework.orm.hibernate4.LocalSessionFactoryBean; import org.springframework.transaction.annotation.EnableTransactionManagement; /** * * @author Faculty */ @Configuration @EnableTransactionManagement public class DBConfig { @Bean public HibernateTemplate hibernateTemplate() { return new HibernateTemplate(sessionFactory().getObject()); } @Bean public LocalSessionFactoryBean sessionFactory() { LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean(); sessionFactory.setDataSource(getDataSource()); sessionFactory.setPackagesToScan(new String[] { "com.shakil.etailor.model" }); sessionFactory.setHibernateProperties(hibernateProperties()); return sessionFactory; } @Bean public DataSource getDataSource() { BasicDataSource dataSource = new BasicDataSource(); dataSource.setDriverClassName("com.mysql.jdbc.Driver"); dataSource.setUrl("jdbc:mysql://localhost:3306/tailor"); dataSource.setUsername("root"); dataSource.setPassword("123"); return dataSource; } // @Bean // public HibernateTransactionManager hibTransMan() { // return new HibernateTransactionManager(sessionFactory()); // } @Bean @Autowired public HibernateTransactionManager transactionManager(SessionFactory s) { HibernateTransactionManager txManager = new HibernateTransactionManager(); txManager.setSessionFactory(s); return txManager; } private Properties hibernateProperties() { Properties properties = new Properties(); properties.put("hibernate.dialect", "org.hibernate.dialect.MySQLDialect"); properties.put("hibernate.show_sql", true); properties.put("hibernate.format_sql", true); properties.put("hibernate.hbm2ddl.auto", "update"); properties.put("hibernate.use_sql_commnets", true); return properties; } }
[ "R38 (JAVA)@DESKTOP-FDBEVNM" ]
R38 (JAVA)@DESKTOP-FDBEVNM
933f90ce10355d26144f68ed981ef8b56c4779b8
b50f61feea6a61c7771a7f53812a7e1c3a862980
/motocross/src/main/java/com/rosa/swift/mvp/shift/gate/repository/GateKeeperDto.java
27c9a5896f25b7db72487861fb825941fd2f37a0
[]
no_license
LikhanovP/s14_question
eb91c75f926f6dc4c0090872c29a20ea4030dec5
4c524ce45f32cc726770d5c3985c74824db181d0
refs/heads/master
2021-01-19T05:06:35.629216
2017-04-06T10:15:03
2017-04-06T10:15:03
87,414,994
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
package com.rosa.swift.mvp.shift.gate.repository; import com.rosa.swift.core.business.utils.Constants; public class GateKeeperDto { private boolean mEnabled; public GateKeeperDto(String enabled) { mEnabled = enabled != null && enabled.equals(Constants.SAP_TRUE_FLAG); } public boolean isEnabled() { return mEnabled; } }
[ "liqpire@gmail.com" ]
liqpire@gmail.com
f28235468c955ce246cf932020e39fb97154ed24
a6f21179ded104094b669ba33e3c0fdc08708710
/Demo07/Recurrsion/Demo01.java
a167112b05222e328a0c27f5bea0f5399bd676ae
[]
no_license
JolySong/Learn-Java
cc1375d0f8a0e0f5da75251a96faaba28b7bad9f
281adbe97bebffac4e16bcd3970d6202822eba24
refs/heads/master
2023-04-30T18:36:50.654445
2021-05-15T16:58:42
2021-05-15T16:58:42
353,976,194
0
0
null
null
null
null
UTF-8
Java
false
false
903
java
package Recurrsion; import java.util.Scanner; /* 递归的测试案例 */ public class Demo01 { public static void main(String[] args) { // 递归计算1-n之间的和 //show01(); //递归计算阶乘 show02(); } private static void show02() { Scanner sc = new Scanner(System.in); System.out.printf("Please enter num: "); int x = sc.nextInt(); System.out.println(f(x)); } public static int f(int x){ if(x==1){ return 1; } return x*f(x-1); } private static void show01() { Scanner sc = new Scanner(System.in); System.out.printf("Please enter num: "); int a = sc.nextInt(); System.out.println(Sum(a)); } public static int Sum(int n){ if(n == 1){ return 1; } return n+Sum(n-1); } }
[ "854236339Wqq.com" ]
854236339Wqq.com
3b04b779f981de319bfcf59f7f43e3dcb08e3344
a4d1882a398c2cf6ddbbcf593f4db3bd8175c0ca
/src/main/java/generic/B.java
02b4ff397f518d268df6ec4ec7f2a8616f41f791
[]
no_license
wangyaheng/payinterface
10acd7079372fefa47fb163ebb380ef382d184f0
45ce2408b826d03884e84617f519bbd15a5180f2
refs/heads/master
2022-06-13T06:47:47.843841
2020-06-16T09:36:11
2020-06-16T09:36:15
199,612,445
0
0
null
2022-02-11T03:34:52
2019-07-30T08:46:58
Java
UTF-8
Java
false
false
37
java
package generic; public class B { }
[ "704347630@qq.com" ]
704347630@qq.com
fc906f5761a881ee7404e3595dadb9ff8f9ce70c
204ed7097c2eca124ba44a4b8ec32825bc61dcd0
/nms-core-server/src/test/com/yuep/nms/core/server/momanager/service/test/MoListEquals.java
7a1ff7264f5ce3cf8ceaadb280ae8d8731ac9d55
[]
no_license
frankggyy/YUEP
8ee9a7d547f8fa471fda88a42c9e3a31ad3f94d2
827115c99b84b9cbfbc501802b18c06c62c1c507
refs/heads/master
2016-09-16T13:49:11.258476
2011-08-31T13:30:34
2011-08-31T13:30:34
2,299,133
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
1,810
java
/* * $Id: MoListEquals.java, 2011-5-10 ÏÂÎç04:31:00 yangtao Exp $ * * Copyright (c) 2008 Wuhan Yangtze Optical Technology Co., Ltd * All rights reserved. * * This software is copyrighted and owned by YOTC or the copyright holder * specified, unless otherwise noted, and may not be reproduced or distributed * in whole or in part in any form or medium without express written permission. */ package com.yuep.nms.core.server.momanager.service.test; import static org.easymock.EasyMock.reportMatcher; import java.util.List; import org.apache.commons.collections.CollectionUtils; import org.easymock.IArgumentMatcher; import com.yuep.nms.core.common.mocore.model.Mo; /** * <p> * Title: MoListEquals * </p> * <p> * Description: * </p> * * @author yangtao * created 2011-5-10 ÏÂÎç04:31:00 * modified [who date description] * check [who date description] */ public class MoListEquals implements IArgumentMatcher { private List<Mo> in; public MoListEquals(List<Mo> in){ this.in=in; } /** * (non-Javadoc) * @see org.easymock.IArgumentMatcher#appendTo(java.lang.StringBuffer) */ @Override public void appendTo(StringBuffer stringbuffer) { stringbuffer.append(in); } /** * (non-Javadoc) * @see org.easymock.IArgumentMatcher#matches(java.lang.Object) */ @SuppressWarnings("unchecked") @Override public boolean matches(Object obj) { if(!(obj instanceof List)) return false; List<Mo> mos=(List<Mo>)obj; return CollectionUtils.isEqualCollection(in, mos); } public static List<Mo> equals(List<Mo> in) { reportMatcher(new MoListEquals(in)); return in; } }
[ "wanghu-520@163.com" ]
wanghu-520@163.com
61af1572719ad9244476fc41d8efb6a05d86efd6
78f0c061ab38d9c427025a01c23e692563621de3
/app/src/main/java/com/yalladealz/userapp/model/deals/Deal.java
e34a5fc82cd662aacdb0114d5fa1a72246afc436
[]
no_license
Khaled-Helmy/DealsApp
e84684a2b076a9c03033925c00cf5c82bd62689c
aaf96989e4d3cb9348328a09f4757280b1f17d66
refs/heads/master
2022-12-02T11:36:12.594118
2020-08-15T09:24:53
2020-08-15T09:24:53
286,096,470
0
1
null
null
null
null
UTF-8
Java
false
false
11,393
java
package com.yalladealz.userapp.model.deals; import com.google.gson.annotations.SerializedName; import com.yalladealz.userapp.model.History.DealRedeemed; import java.util.List; public class Deal { @SerializedName("deal_start_date") private String dealStartDate; @SerializedName("branch_latitude") private String branchLat; @SerializedName("branch_longitude") private String branchLong; @SerializedName("coupon_valid_from") private String couponValidFrom; @SerializedName("CategoryInfo") private CategoryInfo categoryInfo; @SerializedName("live_deal") private boolean liveDeal; @SerializedName("DealDescriptions") private Object dealDescriptions; @SerializedName("merchant_id") private String merchantId; @SerializedName("cash_on_delivery") private String cashOnDelivery; @SerializedName("youtube_link") private String youtubeLink; @SerializedName("DealRedeemed") private DealRedeemed dealRedeemed; @SerializedName("coupon_valid_to") private String couponValidTo; @SerializedName("max_coupon") private String maxCoupon; @SerializedName("category_id") private String categoryId; @SerializedName("live_days") private String liveDays; @SerializedName("DealOptions") private List<DealOptions> dealOptions; @SerializedName("TypeDescription") private TypeDescription typeDescription; @SerializedName("deal_end_date") private String dealEndDate; @SerializedName("deal_id") private int dealId; @SerializedName("DealFiles") private List<DealFilesItem> dealFiles; @SerializedName("image") private String image; @SerializedName("PrimaryOption") private PrimaryOption primaryOption; @SerializedName("type_id") private String typeId; @SerializedName("deal_type") private String dealType; @SerializedName("end_time") private String endTime; @SerializedName("total_review") private int totalReview; @SerializedName("deal_visible") private boolean dealVisible; @SerializedName("DealReview") private List<DealReviewItem> dealReview; @SerializedName("TypeInfo") private TypeInfo typeInfo; @SerializedName("DealDescription") private DealDescription dealDescription; @SerializedName("start_time") private String startTime; @SerializedName("MerchantInfo") private MerchantInfo merchantInfo; @SerializedName("min_buy") private String minBuy; @SerializedName("CategoryDescription") private CategoryDescription categoryDescription; @SerializedName("max_buy") private String maxBuy; @SerializedName("deal_branches[]") private Object dealBranches; public String getBranchLat() { return branchLat; } public void setBranchLat(String branchLat) { this.branchLat = branchLat; } public String getBranchLong() { return branchLong; } public void setBranchLong(String branchLong) { this.branchLong = branchLong; } public void setDealStartDate(String dealStartDate) { this.dealStartDate = dealStartDate; } public String getDealStartDate() { return dealStartDate; } public void setCouponValidFrom(String couponValidFrom) { this.couponValidFrom = couponValidFrom; } public String getCouponValidFrom() { return couponValidFrom; } public void setCategoryInfo(CategoryInfo categoryInfo) { this.categoryInfo = categoryInfo; } public CategoryInfo getCategoryInfo() { return categoryInfo; } public void setLiveDeal(boolean liveDeal) { this.liveDeal = liveDeal; } public boolean isLiveDeal() { return liveDeal; } public void setDealDescriptions(Object dealDescriptions) { this.dealDescriptions = dealDescriptions; } public Object getDealDescriptions() { return dealDescriptions; } public void setMerchantId(String merchantId) { this.merchantId = merchantId; } public String getMerchantId() { return merchantId; } public void setCashOnDelivery(String cashOnDelivery) { this.cashOnDelivery = cashOnDelivery; } public String getCashOnDelivery() { return cashOnDelivery; } public void setYoutubeLink(String youtubeLink) { this.youtubeLink = youtubeLink; } public String getYoutubeLink() { return youtubeLink; } public DealRedeemed getDealRedeemed() { return dealRedeemed; } public void setDealRedeemed(DealRedeemed dealRedeemed) { this.dealRedeemed = dealRedeemed; } public void setCouponValidTo(String couponValidTo) { this.couponValidTo = couponValidTo; } public String getCouponValidTo() { return couponValidTo; } public void setMaxCoupon(String maxCoupon) { this.maxCoupon = maxCoupon; } public String getMaxCoupon() { return maxCoupon; } public void setCategoryId(String categoryId) { this.categoryId = categoryId; } public String getCategoryId() { return categoryId; } public void setLiveDays(String liveDays) { this.liveDays = liveDays; } public String getLiveDays() { return liveDays; } public void setDealOptions(List<DealOptions> dealOptions) { this.dealOptions = dealOptions; } public List<DealOptions> getDealOptions() { return dealOptions; } public void setTypeDescription(TypeDescription typeDescription) { this.typeDescription = typeDescription; } public TypeDescription getTypeDescription() { return typeDescription; } public void setDealEndDate(String dealEndDate) { this.dealEndDate = dealEndDate; } public String getDealEndDate() { return dealEndDate; } public void setDealId(int dealId) { this.dealId = dealId; } public int getDealId() { return dealId; } public void setDealFiles(List<DealFilesItem> dealFiles) { this.dealFiles = dealFiles; } public List<DealFilesItem> getDealFiles() { return dealFiles; } public void setImage(String image) { this.image = image; } public String getImage() { return image; } public void setPrimaryOption(PrimaryOption primaryOption) { this.primaryOption = primaryOption; } public PrimaryOption getPrimaryOption() { return primaryOption; } public void setTypeId(String typeId) { this.typeId = typeId; } public String getTypeId() { return typeId; } public void setDealType(String dealType) { this.dealType = dealType; } public String getDealType() { return dealType; } public void setEndTime(String endTime) { this.endTime = endTime; } public String getEndTime() { return endTime; } public void setTotalReview(int totalReview) { this.totalReview = totalReview; } public int getTotalReview() { return totalReview; } public void setDealVisible(boolean dealVisible) { this.dealVisible = dealVisible; } public boolean isDealVisible() { return dealVisible; } public List<DealReviewItem> getDealReview() { return dealReview; } public void setDealReview(List<DealReviewItem> dealReview) { this.dealReview = dealReview; } public void setTypeInfo(TypeInfo typeInfo) { this.typeInfo = typeInfo; } public TypeInfo getTypeInfo() { return typeInfo; } public void setDealDescription(DealDescription dealDescription) { this.dealDescription = dealDescription; } public DealDescription getDealDescription() { return dealDescription; } public void setStartTime(String startTime) { this.startTime = startTime; } public String getStartTime() { return startTime; } public void setMerchantInfo(MerchantInfo merchantInfo) { this.merchantInfo = merchantInfo; } public MerchantInfo getMerchantInfo() { return merchantInfo; } public void setMinBuy(String minBuy) { this.minBuy = minBuy; } public String getMinBuy() { return minBuy; } public void setCategoryDescription(CategoryDescription categoryDescription) { this.categoryDescription = categoryDescription; } public CategoryDescription getCategoryDescription() { return categoryDescription; } public void setMaxBuy(String maxBuy) { this.maxBuy = maxBuy; } public String getMaxBuy() { return maxBuy; } public void setDealBranches(Object dealBranches) { this.dealBranches = dealBranches; } public Object getDealBranches() { return dealBranches; } @Override public String toString() { return "Deal{" + "deal_start_date = '" + dealStartDate + '\'' + ",coupon_valid_from = '" + couponValidFrom + '\'' + ",categoryInfo = '" + categoryInfo + '\'' + ",live_deal = '" + liveDeal + '\'' + ",dealDescriptions = '" + dealDescriptions + '\'' + ",merchant_id = '" + merchantId + '\'' + ",cash_on_delivery = '" + cashOnDelivery + '\'' + ",youtube_link = '" + youtubeLink + '\'' + ",dealRedeemed = '" + dealRedeemed + '\'' + ",coupon_valid_to = '" + couponValidTo + '\'' + ",max_coupon = '" + maxCoupon + '\'' + ",category_id = '" + categoryId + '\'' + ",live_days = '" + liveDays + '\'' + ",dealOptions = '" + dealOptions + '\'' + ",typeDescription = '" + typeDescription + '\'' + ",deal_end_date = '" + dealEndDate + '\'' + ",deal_id = '" + dealId + '\'' + ",dealFiles = '" + dealFiles + '\'' + ",image = '" + image + '\'' + ",primaryOption = '" + primaryOption + '\'' + ",type_id = '" + typeId + '\'' + ",deal_type = '" + dealType + '\'' + ",end_time = '" + endTime + '\'' + ",total_review = '" + totalReview + '\'' + ",deal_visible = '" + dealVisible + '\'' + ",dealReview = '" + dealReview + '\'' + ",typeInfo = '" + typeInfo + '\'' + ",dealDescription = '" + dealDescription + '\'' + ",start_time = '" + startTime + '\'' + ",merchantInfo = '" + merchantInfo + '\'' + ",min_buy = '" + minBuy + '\'' + ",categoryDescription = '" + categoryDescription + '\'' + ",max_buy = '" + maxBuy + '\'' + ",deal_branches[] = '" + dealBranches + '\'' + "}"; } }
[ "k.helmyabozead@gmail.com" ]
k.helmyabozead@gmail.com
f2c3cc94876ae66c20e0d1a048ba523bd976003f
a4add42ccc206d5da23b002a49eaf542d6b9fe1a
/src/com/github/util/UrlEncoded.java
f0e597dba4db69d159dde8136af7e19d7fa3b317
[ "BSD-3-Clause" ]
permissive
Translation-tool/translation-tool
f61364f8159932e56ac372d3fe06ba05d2a9185b
8b402d5b7e31e83bf37149f26cbc8141c2f0df32
refs/heads/master
2020-06-04T02:06:18.680142
2012-12-12T15:52:51
2012-12-12T15:52:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
28,642
java
package com.github.util; //======================================================================== //Copyright (c) 2004-2009 Mort Bay Consulting Pty. Ltd. //------------------------------------------------------------------------ //All rights reserved. This program and the accompanying materials //are made available under the terms of the Eclipse Public License v1.0 //and Apache License v2.0 which accompanies this distribution. //The Eclipse Public License is available at //http://www.eclipse.org/legal/epl-v10.html //The Apache License v2.0 is available at //http://www.opensource.org/licenses/apache2.0.php //You may elect to redistribute this code under either of these licenses. //======================================================================== import com.github.util.Utf8Appendable.NotUtf8Exception; import java.io.*; import java.util.Iterator; import java.util.Map; import java.util.logging.Logger; /* ------------------------------------------------------------ */ /** Handles coding of MIME "x-www-form-urlencoded". * <p> * This class handles the encoding and decoding for either * the query string of a URL or the _content of a POST HTTP request. * * <h4>Notes</h4> * The UTF-8 charset is assumed, unless otherwise defined by either * passing a parameter or setting the "org.eclipse.jetty.util.UrlEncoding.charset" * System property. * <p> * The hashtable either contains String single values, vectors * of String or arrays of Strings. * <p> * This class is only partially synchronised. In particular, simple * get operations are not protected from concurrent updates. * * @see java.net.URLEncoder */ public class UrlEncoded extends MultiMap implements Cloneable { private static final Logger LOG = Logger.getLogger(UrlEncoded.class.getName()); public static final String ENCODING = System.getProperty("org.eclipse.jetty.util.UrlEncoding.charset",StringUtil.__UTF8); /* ----------------------------------------------------------------- */ public UrlEncoded(UrlEncoded url) { super(url); } /* ----------------------------------------------------------------- */ public UrlEncoded() { super(6); } /* ----------------------------------------------------------------- */ public UrlEncoded(String s) { super(6); decode(s,ENCODING); } /* ----------------------------------------------------------------- */ public UrlEncoded(String s, String charset) { super(6); decode(s,charset); } /* ----------------------------------------------------------------- */ public void decode(String query) { decodeTo(query,this,ENCODING,-1); } /* ----------------------------------------------------------------- */ public void decode(String query,String charset) { decodeTo(query,this,charset,-1); } /* -------------------------------------------------------------- */ /** Encode Hashtable with % encoding. */ public String encode() { return encode(ENCODING,false); } /* -------------------------------------------------------------- */ /** Encode Hashtable with % encoding. */ public String encode(String charset) { return encode(charset,false); } /* -------------------------------------------------------------- */ /** Encode Hashtable with % encoding. * @param equalsForNullValue if True, then an '=' is always used, even * for parameters without a value. e.g. "blah?a=&b=&c=". */ public synchronized String encode(String charset, boolean equalsForNullValue) { return encode(this,charset,equalsForNullValue); } /* -------------------------------------------------------------- */ /** Encode Hashtable with % encoding. * @param equalsForNullValue if True, then an '=' is always used, even * for parameters without a value. e.g. "blah?a=&b=&c=". */ public static String encode(MultiMap map, String charset, boolean equalsForNullValue) { if (charset==null) charset=ENCODING; StringBuilder result = new StringBuilder(128); Iterator iter = map.entrySet().iterator(); while(iter.hasNext()) { Map.Entry entry = (Map.Entry)iter.next(); String key = entry.getKey().toString(); Object list = entry.getValue(); int s=LazyList.size(list); if (s==0) { result.append(encodeString(key,charset)); if(equalsForNullValue) result.append('='); } else { for (int i=0;i<s;i++) { if (i>0) result.append('&'); Object val=LazyList.get(list,i); result.append(encodeString(key,charset)); if (val!=null) { String str=val.toString(); if (str.length()>0) { result.append('='); result.append(encodeString(str,charset)); } else if (equalsForNullValue) result.append('='); } else if (equalsForNullValue) result.append('='); } } if (iter.hasNext()) result.append('&'); } return result.toString(); } /* -------------------------------------------------------------- */ /** Decoded parameters to Map. * @param content the string containing the encoded parameters */ public static void decodeTo(String content, MultiMap map, String charset) { decodeTo(content,map,charset,-1); } /* -------------------------------------------------------------- */ /** Decoded parameters to Map. * @param content the string containing the encoded parameters */ public static void decodeTo(String content, MultiMap map, String charset, int maxKeys) { if (charset==null) charset=ENCODING; synchronized(map) { String key = null; String value = null; int mark=-1; boolean encoded=false; for (int i=0;i<content.length();i++) { char c = content.charAt(i); switch (c) { case '&': int l=i-mark-1; value = l==0?"": (encoded?decodeString(content,mark+1,l,charset):content.substring(mark+1,i)); mark=i; encoded=false; if (key != null) { map.add(key,value); } else if (value!=null&&value.length()>0) { map.add(value,""); } key = null; value=null; if (maxKeys>0 && map.size()>maxKeys) { LOG.warning("maxFormKeys limit exceeded keys>"+maxKeys); return; } break; case '=': if (key!=null) break; key = encoded?decodeString(content,mark+1,i-mark-1,charset):content.substring(mark+1,i); mark=i; encoded=false; break; case '+': encoded=true; break; case '%': encoded=true; break; } } if (key != null) { int l=content.length()-mark-1; value = l==0?"":(encoded?decodeString(content,mark+1,l,charset):content.substring(mark+1)); map.add(key,value); } else if (mark<content.length()) { key = encoded ?decodeString(content,mark+1,content.length()-mark-1,charset) :content.substring(mark+1); if (key != null && key.length() > 0) { map.add(key,""); } } } } /* -------------------------------------------------------------- */ /** Decoded parameters to Map. * @param raw the byte[] containing the encoded parameters * @param offset the offset within raw to decode from * @param length the length of the section to decode * @param map the {@link MultiMap} to populate */ public static void decodeUtf8To(byte[] raw,int offset, int length, MultiMap map) { decodeUtf8To(raw,offset,length,map,new Utf8StringBuilder()); } /* -------------------------------------------------------------- */ /** Decoded parameters to Map. * @param raw the byte[] containing the encoded parameters * @param offset the offset within raw to decode from * @param length the length of the section to decode * @param map the {@link MultiMap} to populate * @param buffer the buffer to decode into */ public static void decodeUtf8To(byte[] raw,int offset, int length, MultiMap map,Utf8StringBuilder buffer) { synchronized(map) { String key = null; String value = null; // TODO cache of parameter names ??? int end=offset+length; for (int i=offset;i<end;i++) { byte b=raw[i]; try { switch ((char)(0xff&b)) { case '&': value = buffer.length()==0?"":buffer.toString(); buffer.reset(); if (key != null) { map.add(key,value); } else if (value!=null&&value.length()>0) { map.add(value,""); } key = null; value=null; break; case '=': if (key!=null) { buffer.append(b); break; } key = buffer.toString(); buffer.reset(); break; case '+': buffer.append((byte)' '); break; case '%': if (i+2<end) buffer.append((byte)((TypeUtil.convertHexDigit(raw[++i])<<4) + TypeUtil.convertHexDigit(raw[++i]))); break; default: buffer.append(b); break; } } catch(NotUtf8Exception e) { LOG.warning(e.toString()); } } if (key != null) { value = buffer.length()==0?"":buffer.toString(); buffer.reset(); map.add(key,value); } else if (buffer.length()>0) { map.add(buffer.toString(),""); } } } /* -------------------------------------------------------------- */ /** Decoded parameters to Map. * @param in InputSteam to read * @param map MultiMap to add parameters to * @param maxLength maximum number of keys to read or -1 for no limit */ public static void decode88591To(InputStream in, MultiMap map, int maxLength, int maxKeys) throws IOException { synchronized(map) { StringBuffer buffer = new StringBuffer(); String key = null; String value = null; int b; // TODO cache of parameter names ??? int totalLength=0; while ((b=in.read())>=0) { switch ((char) b) { case '&': value = buffer.length()==0?"":buffer.toString(); buffer.setLength(0); if (key != null) { map.add(key,value); } else if (value!=null&&value.length()>0) { map.add(value,""); } key = null; value=null; if (maxKeys>0 && map.size()>maxKeys) { LOG.warning("maxFormKeys limit exceeded keys>"+maxKeys); return; } break; case '=': if (key!=null) { buffer.append((char)b); break; } key = buffer.toString(); buffer.setLength(0); break; case '+': buffer.append(' '); break; case '%': int dh=in.read(); int dl=in.read(); if (dh<0||dl<0) break; buffer.append((char)((TypeUtil.convertHexDigit((byte)dh)<<4) + TypeUtil.convertHexDigit((byte)dl))); break; default: buffer.append((char)b); break; } if (maxLength>=0 && (++totalLength > maxLength)) throw new IllegalStateException("Form too large"); } if (key != null) { value = buffer.length()==0?"":buffer.toString(); buffer.setLength(0); map.add(key,value); } else if (buffer.length()>0) { map.add(buffer.toString(), ""); } } } /* -------------------------------------------------------------- */ /** Decoded parameters to Map. * @param in InputSteam to read * @param map MultiMap to add parameters to * @param maxLength maximum number of keys to read or -1 for no limit */ public static void decodeUtf8To(InputStream in, MultiMap map, int maxLength, int maxKeys) throws IOException { synchronized(map) { Utf8StringBuilder buffer = new Utf8StringBuilder(); String key = null; String value = null; int b; // TODO cache of parameter names ??? int totalLength=0; while ((b=in.read())>=0) { try { switch ((char) b) { case '&': value = buffer.length()==0?"":buffer.toString(); buffer.reset(); if (key != null) { map.add(key,value); } else if (value!=null&&value.length()>0) { map.add(value,""); } key = null; value=null; if (maxKeys>0 && map.size()>maxKeys) { LOG.warning("maxFormKeys limit exceeded keys>"+maxKeys); return; } break; case '=': if (key!=null) { buffer.append((byte)b); break; } key = buffer.toString(); buffer.reset(); break; case '+': buffer.append((byte)' '); break; case '%': int dh=in.read(); int dl=in.read(); if (dh<0||dl<0) break; buffer.append((byte)((TypeUtil.convertHexDigit((byte)dh)<<4) + TypeUtil.convertHexDigit((byte)dl))); break; default: buffer.append((byte)b); break; } } catch(NotUtf8Exception e) { LOG.warning(e.toString()); } if (maxLength>=0 && (++totalLength > maxLength)) throw new IllegalStateException("Form too large"); } if (key != null) { value = buffer.length()==0?"":buffer.toString(); buffer.reset(); map.add(key,value); } else if (buffer.length()>0) { map.add(buffer.toString(), ""); } } } /* -------------------------------------------------------------- */ public static void decodeUtf16To(InputStream in, MultiMap map, int maxLength, int maxKeys) throws IOException { InputStreamReader input = new InputStreamReader(in,StringUtil.__UTF16); StringWriter buf = new StringWriter(8192); IO.copy(input,buf,maxLength); decodeTo(buf.getBuffer().toString(),map,ENCODING,maxKeys); } /* -------------------------------------------------------------- */ /** Decoded parameters to Map. * @param in the stream containing the encoded parameters */ public static void decodeTo(InputStream in, MultiMap map, String charset, int maxLength, int maxKeys) throws IOException { //no charset present, use the configured default if (charset==null) { charset=ENCODING; } if (StringUtil.__UTF8.equalsIgnoreCase(charset)) { decodeUtf8To(in,map,maxLength,maxKeys); return; } if (StringUtil.__ISO_8859_1.equals(charset)) { decode88591To(in,map,maxLength,maxKeys); return; } if (StringUtil.__UTF16.equalsIgnoreCase(charset)) // Should be all 2 byte encodings { decodeUtf16To(in,map,maxLength,maxKeys); return; } synchronized(map) { String key = null; String value = null; int c; int digit=0; int digits=0; int totalLength = 0; ByteArrayOutputStream2 output = new ByteArrayOutputStream2(); int size=0; while ((c=in.read())>0) { switch ((char) c) { case '&': size=output.size(); value = size==0?"":output.toString(charset); output.setCount(0); if (key != null) { map.add(key,value); } else if (value!=null&&value.length()>0) { map.add(value,""); } key = null; value=null; break; case '=': if (key!=null) { output.write(c); break; } size=output.size(); key = size==0?"":output.toString(charset); output.setCount(0); break; case '+': output.write(' '); break; case '%': digits=2; break; default: if (digits==2) { digit=TypeUtil.convertHexDigit((byte)c); digits=1; } else if (digits==1) { output.write((digit<<4) + TypeUtil.convertHexDigit((byte)c)); digits=0; } else output.write(c); break; } totalLength++; if (maxLength>=0 && totalLength > maxLength) throw new IllegalStateException("Form too large"); } size=output.size(); if (key != null) { value = size==0?"":output.toString(charset); output.setCount(0); map.add(key,value); } else if (size>0) map.add(output.toString(charset),""); } } /* -------------------------------------------------------------- */ /** Decode String with % encoding. * This method makes the assumption that the majority of calls * will need no decoding. */ public static String decodeString(String encoded,int offset,int length,String charset) { if (charset==null || StringUtil.isUTF8(charset)) { Utf8StringBuffer buffer=null; for (int i=0;i<length;i++) { char c = encoded.charAt(offset+i); if (c<0||c>0xff) { if (buffer==null) { buffer=new Utf8StringBuffer(length); buffer.getStringBuffer().append(encoded,offset,offset+i+1); } else buffer.getStringBuffer().append(c); } else if (c=='+') { if (buffer==null) { buffer=new Utf8StringBuffer(length); buffer.getStringBuffer().append(encoded,offset,offset+i); } buffer.getStringBuffer().append(' '); } else if (c=='%' && (i+2)<length) { if (buffer==null) { buffer=new Utf8StringBuffer(length); buffer.getStringBuffer().append(encoded,offset,offset+i); } try { byte b=(byte)TypeUtil.parseInt(encoded,offset+i+1,2,16); buffer.append(b); i+=2; } catch(NumberFormatException nfe) { buffer.getStringBuffer().append('%'); } } else if (buffer!=null) buffer.getStringBuffer().append(c); } if (buffer==null) { if (offset==0 && encoded.length()==length) return encoded; return encoded.substring(offset,offset+length); } return buffer.toString(); } else { StringBuffer buffer=null; try { for (int i=0;i<length;i++) { char c = encoded.charAt(offset+i); if (c<0||c>0xff) { if (buffer==null) { buffer=new StringBuffer(length); buffer.append(encoded,offset,offset+i+1); } else buffer.append(c); } else if (c=='+') { if (buffer==null) { buffer=new StringBuffer(length); buffer.append(encoded,offset,offset+i); } buffer.append(' '); } else if (c=='%' && (i+2)<length) { if (buffer==null) { buffer=new StringBuffer(length); buffer.append(encoded,offset,offset+i); } byte[] ba=new byte[length]; int n=0; while(c>=0 && c<=0xff) { if (c=='%') { if(i+2<length) { try { ba[n++]=(byte)TypeUtil.parseInt(encoded,offset+i+1,2,16); i+=3; } catch(NumberFormatException nfe) { ba[n-1] = (byte)'%'; for(char next; ((next=encoded.charAt(++i+offset))!='%');) ba[n++] = (byte)(next=='+' ? ' ' : next); } } else { ba[n++] = (byte)'%'; i++; } } else if (c=='+') { ba[n++]=(byte)' '; i++; } else { ba[n++]=(byte)c; i++; } if (i>=length) break; c = encoded.charAt(offset+i); } i--; buffer.append(new String(ba,0,n,charset)); } else if (buffer!=null) buffer.append(c); } if (buffer==null) { if (offset==0 && encoded.length()==length) return encoded; return encoded.substring(offset,offset+length); } return buffer.toString(); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } } /* ------------------------------------------------------------ */ /** Perform URL encoding. * @param string * @return encoded string. */ public static String encodeString(String string) { return encodeString(string,ENCODING); } /* ------------------------------------------------------------ */ /** Perform URL encoding. * @param string * @return encoded string. */ public static String encodeString(String string,String charset) { if (charset==null) charset=ENCODING; byte[] bytes=null; try { bytes=string.getBytes(charset); } catch(UnsupportedEncodingException e) { // LOG.warn(LogSupport.EXCEPTION,e); bytes=string.getBytes(); } int len=bytes.length; byte[] encoded= new byte[bytes.length*3]; int n=0; boolean noEncode=true; for (int i=0;i<len;i++) { byte b = bytes[i]; if (b==' ') { noEncode=false; encoded[n++]=(byte)'+'; } else if (b>='a' && b<='z' || b>='A' && b<='Z' || b>='0' && b<='9') { encoded[n++]=b; } else { noEncode=false; encoded[n++]=(byte)'%'; byte nibble= (byte) ((b&0xf0)>>4); if (nibble>=10) encoded[n++]=(byte)('A'+nibble-10); else encoded[n++]=(byte)('0'+nibble); nibble= (byte) (b&0xf); if (nibble>=10) encoded[n++]=(byte)('A'+nibble-10); else encoded[n++]=(byte)('0'+nibble); } } if (noEncode) return string; try { return new String(encoded,0,n,charset); } catch(UnsupportedEncodingException e) { // LOG.warn(LogSupport.EXCEPTION,e); return new String(encoded,0,n); } } /* ------------------------------------------------------------ */ /** */ @Override public Object clone() { return new UrlEncoded(this); } }
[ "dmitry.negoda@ecwid.com" ]
dmitry.negoda@ecwid.com
d2d0797668c30674535828d9ff07cc26a37f14b1
b0f9ae1cc77ddb772054dfa03c5547b830f6dab0
/src/main/java/com/anil/recipe/converters/RecipeToRecipeCommand.java
3202d04ae6e51b933b5d19bc27cb4f73d4b2004f
[]
no_license
anilDesaiRamesh/spring5-recipe-app
9b5a621a06f704ef3feb81d20a1faef2dcc1fa77
ce7302ceedcc709eeeb0bb413256ab4034b6a377
refs/heads/master
2020-04-04T14:56:58.720736
2018-11-11T17:57:14
2018-11-11T17:57:14
156,019,399
0
0
null
null
null
null
UTF-8
Java
false
false
2,122
java
/** * */ package com.anil.recipe.converters; import org.springframework.core.convert.converter.Converter; import org.springframework.lang.Nullable; import org.springframework.stereotype.Component; import com.anil.recipe.domain.Category; import com.anil.recipe.domain.Recipe; import com.anil.recipe.domain.commands.RecipeCommand; import lombok.Synchronized; /** * @author Anil_Ramesh * */ @Component public class RecipeToRecipeCommand implements Converter<Recipe, RecipeCommand> { private final CategoryToCategoryCommand categoryConveter; private final IngredientToIngredientCommand ingredientConverter; private final NotesToNotesCommand notesConverter; public RecipeToRecipeCommand(CategoryToCategoryCommand categoryConveter, IngredientToIngredientCommand ingredientConverter, NotesToNotesCommand notesConverter) { this.categoryConveter = categoryConveter; this.ingredientConverter = ingredientConverter; this.notesConverter = notesConverter; } @Synchronized @Nullable @Override public RecipeCommand convert(Recipe source) { if (source == null) { return null; } final RecipeCommand command = new RecipeCommand(); command.setId(source.getId()); command.setCookTime(source.getCookTime()); command.setPrepTime(source.getPrepTime()); command.setDescription(source.getDescription()); command.setDifficulty(source.getDifficulty()); command.setDirections(source.getDirections()); command.setServings(source.getServings()); command.setSource(source.getSource()); command.setUrl(source.getUrl()); command.setNotes(notesConverter.convert(source.getNotes())); if (source.getCategories() != null && source.getCategories().size() > 0) { source.getCategories() .forEach((Category category) -> command.getCategories().add(categoryConveter.convert(category))); } if (source.getIngredients() != null && source.getIngredients().size() > 0) { source.getIngredients() .forEach(ingredient -> command.getIngredients().add(ingredientConverter.convert(ingredient))); } return command; } }
[ "anil.hhh.desai@gmail.com" ]
anil.hhh.desai@gmail.com
f41f53754b654ce6a4bb0fcc8fc966c0e4cd736c
702aa85e14bbf53ccd5a7b5e5bdc157106f49e7f
/Robot Code/src/org/usfirst/frc/team3316/robot/commands/chassis/MoveChassis.java
81f8cf995177bcccbaea7706965c350e24aae680
[]
no_license
frc3316/Steamworks2017
aeb511a511c7bccae15620485f1ff95177cfa275
a1b0dc552ab43f661b807a565dc3ecb52be50f0f
refs/heads/master
2021-01-12T07:49:19.396284
2017-11-04T13:51:41
2017-11-04T13:51:41
77,031,057
0
0
null
2017-01-24T17:33:43
2016-12-21T08:03:06
Java
UTF-8
Java
false
false
878
java
package org.usfirst.frc.team3316.robot.commands.chassis; import org.usfirst.frc.team3316.robot.Robot; import org.usfirst.frc.team3316.robot.commands.DBugCommand; public class MoveChassis extends DBugCommand { double leftV, rightV; /** * Move the chassis using values to the speed controllers * @param l - -1 to 1 * @param r - -1 to 1 */ public MoveChassis(double l, double r) { requires(Robot.chassis); leftV = l; rightV = r; } @Override protected void init() { Robot.chassis.setMotors(0.0, 0.0); } @Override protected void execute() { Robot.chassis.setMotors(leftV, rightV); } @Override protected boolean isFinished() { return false; } @Override protected void fin() { Robot.chassis.setMotors(0.0, 0.0); } @Override protected void interr() { fin(); } }
[ "frc3316@gmail.com" ]
frc3316@gmail.com
cc3372c24cd8333425d443ca5fe8e4ee615b5bd7
bc062abfda9c02c1f1ba09b3ca7cd08a61b87e74
/app/src/main/java/com/iaowoo/mobile/Ui/classification/Activity/im/NewFriendListActivity.java
2b5d3c04df382a98adcb484bb8ba0f5518af09aa
[]
no_license
dadanduo/iaowooProject
2fa8ae549f4a667e8c23c232ecfc81c70bfe7c9f
2fdeabfe65af5b71d378338ff84886ed3d7bd49b
refs/heads/master
2020-07-17T12:54:57.027825
2019-09-03T07:52:52
2019-09-03T07:52:52
206,022,025
0
0
null
null
null
null
UTF-8
Java
false
false
5,262
java
package com.iaowoo.mobile.Ui.classification.Activity.im; import android.os.Bundle; import android.view.View; import android.widget.ListView; import android.widget.TextView; import com.alibaba.fastjson.JSON; import com.iaowoo.mobile.R; import com.iaowoo.mobile.Ui.classification.Activity.TitleBarActivity; import com.iaowoo.mobile.Ui.classification.Adapter.im.NewFriendAdapter; import com.iaowoo.mobile.Ui.classification.Model.im.FriendshipListResponse; import com.plp.underlying.networkframwork.OkhttpManager; import com.plp.underlying.networkframwork.UtilsOkHttpAll; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; public class NewFriendListActivity extends TitleBarActivity { @BindView(R.id.tv_no_data) TextView tvNoData; @BindView(R.id.lv_ship) ListView lvShip; private List<FriendshipListResponse.BodyBean.ContentBean.ListBean> mList; private NewFriendAdapter adapter; private int index; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_im_new_friendlist); ButterKnife.bind(this); initView(); initData(); } private void initView() { setTitle("新朋友"); } private void initData() { mList = new ArrayList<>(); adapter = new NewFriendAdapter(this, mList); lvShip.setAdapter(adapter); adapter.setOnItemButtonClick(new NewFriendAdapter.OnItemButtonClick() { @Override public boolean onButtonClick(int position, View view, int status) { index = position; switch (status) { case 11: //收到了好友邀请 int friendId = mList.get(position).getId(); agreeAddToFriend(friendId); break; case 10: // 发出了好友邀请 break; case 21: // 忽略好友邀请 break; case 20: // 已是好友 break; case 30: // 删除了好友关系 break; } return false; } }); getFriendAll(); } private void getFriendAll() { HashMap<String, Object> paramsMap = new HashMap<>(); paramsMap.put("loginToken",""); OkhttpManager.getInstance(this).requestPostByAsyn(false, UtilsOkHttpAll.IM_QUERY_FRIEND_LIST, "IM_QUERY_FRIEND_LIST", -1, paramsMap, new OkhttpManager.ReCallBack<Object>() { @Override public void onReqSuccess(Object result) { FriendshipListResponse friendshipListResponse = JSON.parseObject(result.toString(), FriendshipListResponse.class); if (friendshipListResponse.getCode().equals(OkhttpManager.SUCESS)) { FriendshipListResponse.BodyBean.ContentBean contentBean = friendshipListResponse.getBody().getContent(); if (contentBean != null) { List<FriendshipListResponse.BodyBean.ContentBean.ListBean> list = contentBean.getList(); if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { FriendshipListResponse.BodyBean.ContentBean.ListBean re = list.get(i); if (re.getStatus() == 10) {//是我发起的添加好友请求 list.remove(re); i--; } } } if (list != null && list.size() > 0) { lvShip.setVisibility(View.VISIBLE); tvNoData.setVisibility(View.GONE); mList.clear(); mList.addAll(list); if (adapter != null) adapter.notifyDataSetChanged(); } else { lvShip.setVisibility(View.GONE); tvNoData.setVisibility(View.VISIBLE); } } } } @Override public void onReqFailed(String errorMsg) { } }); } private void agreeAddToFriend(int friendId) { HashMap<String, Object> params = new HashMap<>(); params.put("loginToken", ""); params.put("friendId", friendId); params.put("status", 20); OkhttpManager.getInstance(this).requestPostByAsyn(false, UtilsOkHttpAll.IM_FRIEND_OPT, "IM_FRIEND_OPT", -1, params, new OkhttpManager.ReCallBack<Object>() { @Override public void onReqSuccess(Object result) { } @Override public void onReqFailed(String errorMsg) { } }); } }
[ "18011009889@163.com" ]
18011009889@163.com
7ce25baf4ba4d2b0348c4d2d20e4664cf65815fe
3a677c2d29b9939452d524f0bbeb5b8b1f4f7a78
/Banco2/src/main/java/Cuenta.java
13d53a2cde2702b66f5888e19679b5ff0bc4197b
[]
no_license
gomezdariogs/EscuelaJava
a210791cb49843593e864b8fbe8b73a05393c112
c3ab42c53efebeeccb201b444b7f899d7742bada
refs/heads/master
2020-03-31T15:37:09.722382
2018-10-11T01:41:09
2018-10-11T01:41:09
152,344,023
0
0
null
null
null
null
UTF-8
Java
false
false
714
java
public class Cuenta { private int numero; private String cliente; private double saldo; //Constructores public Cuenta(int numero, String cliente, double saldo){ this.numero = numero; this.cliente = cliente; this.saldo = saldo; } public Cuenta() { } //Get y Set saldo public double getSaldo(){ return saldo; } public void setSaldo(double saldo){ this.saldo = saldo; } //Metodos pedidos public void depositar(double monto) { this.saldo = this.saldo + monto; } public void extraer(double monto){ if((this.saldo-monto) >=0){ this.saldo = this.saldo - monto; } } }
[ "gomez.dariogs@gmail.com" ]
gomez.dariogs@gmail.com
0d4098e4daca6b91be2cb9ae8c5e652f58e6e759
45e52472b015bbb2a06652d77e7f565fa03491df
/src/main/java/azur/support/web/tool/security/UserNotActivatedException.java
fb283e97689018b0e702d58cda4e326e69952ca3
[]
no_license
malekouar/azur
bd20e25df967a59918f81dea2f8417457e7cd5ed
27980e9bb8a670d145ca474eb979a3f0295e0b19
refs/heads/master
2022-12-22T18:48:45.514876
2019-06-13T22:15:13
2019-06-13T22:15:13
191,839,449
0
0
null
2022-12-16T04:59:34
2019-06-13T22:07:41
Java
UTF-8
Java
false
false
517
java
package azur.support.web.tool.security; import org.springframework.security.core.AuthenticationException; /** * This exception is thrown in case of a not activated user trying to authenticate. */ public class UserNotActivatedException extends AuthenticationException { private static final long serialVersionUID = 1L; public UserNotActivatedException(String message) { super(message); } public UserNotActivatedException(String message, Throwable t) { super(message, t); } }
[ "abou@groupe-t2i.local" ]
abou@groupe-t2i.local
6fcaff7698e769341c46095fc77d5c38acea9b9a
84738552c04c0bef5a65972d4a60791cba91358e
/spring-framework-mq/amqp-messaging/src/main/java/io/github/futurewl/site/validation/NotBlank.java
27fd5510a37f955537995c5eef316a31681101ce
[]
no_license
FutureWL/spring-framework-samples
145b9fa90654a83a9d398e8f96df02a62fbd7cfd
f1414d1670c22b85ebf5b07a5a881601d5daa7d6
refs/heads/master
2022-12-23T12:18:13.691390
2022-01-07T04:15:50
2022-01-07T04:15:50
192,274,234
0
0
null
2022-12-16T04:24:16
2019-06-17T04:21:43
Java
UTF-8
Java
false
false
1,007
java
package io.github.futurewl.site.validation; import javax.validation.Constraint; import javax.validation.Payload; import javax.validation.ReportAsSingleViolation; import javax.validation.constraints.NotNull; import java.lang.annotation.*; @SuppressWarnings("unused") @Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) @Documented @Constraint(validatedBy = {NotBlankValidator.class}) @NotNull @ReportAsSingleViolation public @interface NotBlank { String message() default "{io.github.futurewl.site.validation.NotBlank.message}"; Class<?>[] groups() default {}; Class<? extends Payload>[] payload() default {}; @Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) @Documented static @interface List { NotBlank[] value(); } }
[ "624263934@qq.com" ]
624263934@qq.com
fb92e3d62c1ca56f5e2af2cd46fad5df605faf9b
f581478820a73bb2514f303342a054f6d42246cc
/homework/CalculatesAreaRectangle.java
d2456a842dbfa0f28f9f7a2881cdb794b8dc415f
[]
no_license
Yoce/programacion_Laura-Josselin
c71163a52115bbf2e3c36c8f4448821882a5490e
c8aaf55066cfbfc53ac7a1bfc4bd3f13094ab3d5
refs/heads/master
2021-05-10T13:34:23.575005
2018-04-09T01:12:29
2018-04-09T01:12:29
118,477,762
0
0
null
null
null
null
UTF-8
Java
false
false
750
java
/********** * Autor:Laura Josselin Hernandez Garcia * Nombre: CalculatesAreaRectangle.java * Description: This program calculates the area for rectangle ***********/ import java.util.Scanner; public class CalculatesAreaRectangle{ public static void main (String[]args){ int A; //la altura de un rectangulo int B; //la base de un rectangulo int Area; //El area del rectangulo System.out.println("Ingresa la altura del rectangulo"); Scanner A1 = new Scanner(System.in); A=A1.nextInt(); System.out.println("Ingresa la base del rectangulo"); Scanner B1 = new Scanner(System.in); B=B1.nextInt(); Area=B*A; System.out.println ("El area del rectangulo es " + Area); }//end main }//end CalculatesAreaRectangle
[ "laura990813@gmail.com" ]
laura990813@gmail.com
6a51a8bebd97494c222442ba2fd31ca677b6fe21
b78d5e6c9976f1b79e026a8891f610dd2701d4f4
/final_hotelDesign/src/com/hotel/utils/MessageConstant.java
daf86016ef9aaf9eb1cc29002df8c27c1d437ed2
[]
no_license
Ljy123Usdf/final_hotelDesign
d1f7f55b72622ba81bf30e2d7df064681b04c690
164fb32fd43eda426797dde70cb6ddb765aea038
refs/heads/master
2020-12-10T06:14:28.529705
2020-01-13T05:58:14
2020-01-13T05:58:14
233,521,604
0
0
null
null
null
null
UTF-8
Java
false
false
354
java
package com.hotel.utils; /** * * @author GaoLiWie * @date 2018/7/26 */ public enum MessageConstant { /** * 操作成功 */ MESSAGE_ALERT_SUCCESS("操作成功"), /** * 操作失败 */ MESSAGE_ALERT_ERROR("操作失败"); public String msg; MessageConstant(String msg) { this.msg = msg; } }
[ "1099322665@qq.com" ]
1099322665@qq.com
f96014372f72be447b014d38a979ba8029243a5e
098f3ec1963f809df8a097d7f9a2f469a2be6434
/app/src/main/java/com/example/univnote/InputActivity.java
35feaa91f7aea56560d10a243374575fb083b724
[]
no_license
donuthole8/univnote
d6bd658f0c9af70fe0c256baadac4dbc46cc33f2
b885db0d9844a42e3ded28107dab703ee7341101
refs/heads/master
2023-05-15T06:07:30.931827
2021-06-15T13:39:21
2021-06-15T13:39:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,528
java
package com.example.univnote; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.TextView; import android.media.AudioAttributes; import android.media.AudioManager; import android.media.SoundPool; import android.os.Build; public class InputActivity extends AppCompatActivity { SoundPool soundPool; // 効果音を鳴らす本体(コンポ) int mp3; // 効果音データ(mp3) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_input); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { soundPool = new SoundPool(5, AudioManager.STREAM_MUSIC, 0); } else { AudioAttributes attr = new AudioAttributes.Builder() .setUsage(AudioAttributes.USAGE_MEDIA) .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC) .build(); soundPool = new SoundPool.Builder() .setAudioAttributes(attr) .setMaxStreams(5) .build(); } // ③ 読込処理(CDを入れる) mp3 = soundPool.load(this, R.raw.mp3money, 1); } /*public void Smoking(View view) { soundPool.play(mp3, 1f, 1f, 0, 0, 1f); TextView tv = (TextView)findViewById(R.id.myMoney); money += 25; tv.setText("¥" + String.valueOf(money)); }*/ public void Return(View view) { soundPool.play(mp3, 1f, 1f, 0, 0, 1f); EditText et = (EditText)findViewById(R.id.usedMoney);; TextView tv = (TextView)findViewById(R.id.myMoney); Intent intent = new Intent(); int len = et.getText().toString().length(); if (len == 0 ) { //if (et.getText() == null) { TextView warning = (TextView)findViewById(R.id.warning); warning.setText("使用金額を入力してください"); } else { //MainActivity.money += Integer.valueOf(et.getText().toString()); //tv.setText("¥" + String.valueOf(MainActivity.money)); String data = et.getText().toString(); intent.putExtra(MainActivity.EXTRA_MESSAGE, data); setResult(RESULT_OK, intent); finish(); } } }
[ "muro5866@gmail.com" ]
muro5866@gmail.com
277cf248b3f231fb9af49819b3f0573cac77d4e5
73267be654cd1fd76cf2cb9ea3a75630d9f58a41
/services/cbs/src/main/java/com/huaweicloud/sdk/cbs/v1/model/ReadConfigResp.java
d0573c4e4c0d09cbec30be2aa16a8d079384b57c
[ "Apache-2.0" ]
permissive
huaweicloud/huaweicloud-sdk-java-v3
51b32a451fac321a0affe2176663fed8a9cd8042
2f8543d0d037b35c2664298ba39a89cc9d8ed9a3
refs/heads/master
2023-08-29T06:50:15.642693
2023-08-24T08:34:48
2023-08-24T08:34:48
262,207,545
91
57
NOASSERTION
2023-09-08T12:24:55
2020-05-08T02:27:00
Java
UTF-8
Java
false
false
7,888
java
package com.huaweicloud.sdk.cbs.v1.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.function.Consumer; /** * */ public class ReadConfigResp { @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "image_read_configs") private List<ImageReadConfigResp> imageReadConfigs = null; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "ppt_read_configs") private List<PPTReadConfigResp> pptReadConfigs = null; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "read_type") private Integer readType; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "read_content") private String readContent; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "character_position") private Integer characterPosition; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "read_content_paragragh_times") private List<Integer> readContentParagraghTimes = null; public ReadConfigResp withImageReadConfigs(List<ImageReadConfigResp> imageReadConfigs) { this.imageReadConfigs = imageReadConfigs; return this; } public ReadConfigResp addImageReadConfigsItem(ImageReadConfigResp imageReadConfigsItem) { if (this.imageReadConfigs == null) { this.imageReadConfigs = new ArrayList<>(); } this.imageReadConfigs.add(imageReadConfigsItem); return this; } public ReadConfigResp withImageReadConfigs(Consumer<List<ImageReadConfigResp>> imageReadConfigsSetter) { if (this.imageReadConfigs == null) { this.imageReadConfigs = new ArrayList<>(); } imageReadConfigsSetter.accept(this.imageReadConfigs); return this; } /** * 图片播报配置 * @return imageReadConfigs */ public List<ImageReadConfigResp> getImageReadConfigs() { return imageReadConfigs; } public void setImageReadConfigs(List<ImageReadConfigResp> imageReadConfigs) { this.imageReadConfigs = imageReadConfigs; } public ReadConfigResp withPptReadConfigs(List<PPTReadConfigResp> pptReadConfigs) { this.pptReadConfigs = pptReadConfigs; return this; } public ReadConfigResp addPptReadConfigsItem(PPTReadConfigResp pptReadConfigsItem) { if (this.pptReadConfigs == null) { this.pptReadConfigs = new ArrayList<>(); } this.pptReadConfigs.add(pptReadConfigsItem); return this; } public ReadConfigResp withPptReadConfigs(Consumer<List<PPTReadConfigResp>> pptReadConfigsSetter) { if (this.pptReadConfigs == null) { this.pptReadConfigs = new ArrayList<>(); } pptReadConfigsSetter.accept(this.pptReadConfigs); return this; } /** * ppt播报配置 * @return pptReadConfigs */ public List<PPTReadConfigResp> getPptReadConfigs() { return pptReadConfigs; } public void setPptReadConfigs(List<PPTReadConfigResp> pptReadConfigs) { this.pptReadConfigs = pptReadConfigs; } public ReadConfigResp withReadType(Integer readType) { this.readType = readType; return this; } /** * 播报选项: 0:纯文本播报 1:图片播报 2:ppt播报 默认:0 配置哪项会校验哪项是否为空 * @return readType */ public Integer getReadType() { return readType; } public void setReadType(Integer readType) { this.readType = readType; } public ReadConfigResp withReadContent(String readContent) { this.readContent = readContent; return this; } /** * 纯文本播报内容。 换行符会按400ms的静音进行分割 * @return readContent */ public String getReadContent() { return readContent; } public void setReadContent(String readContent) { this.readContent = readContent; } public ReadConfigResp withCharacterPosition(Integer characterPosition) { this.characterPosition = characterPosition; return this; } /** * 0:左 1:中 2:右 * @return characterPosition */ public Integer getCharacterPosition() { return characterPosition; } public void setCharacterPosition(Integer characterPosition) { this.characterPosition = characterPosition; } public ReadConfigResp withReadContentParagraghTimes(List<Integer> readContentParagraghTimes) { this.readContentParagraghTimes = readContentParagraghTimes; return this; } public ReadConfigResp addReadContentParagraghTimesItem(Integer readContentParagraghTimesItem) { if (this.readContentParagraghTimes == null) { this.readContentParagraghTimes = new ArrayList<>(); } this.readContentParagraghTimes.add(readContentParagraghTimesItem); return this; } public ReadConfigResp withReadContentParagraghTimes(Consumer<List<Integer>> readContentParagraghTimesSetter) { if (this.readContentParagraghTimes == null) { this.readContentParagraghTimes = new ArrayList<>(); } readContentParagraghTimesSetter.accept(this.readContentParagraghTimes); return this; } /** * read_content 每段播报时间 * @return readContentParagraghTimes */ public List<Integer> getReadContentParagraghTimes() { return readContentParagraghTimes; } public void setReadContentParagraghTimes(List<Integer> readContentParagraghTimes) { this.readContentParagraghTimes = readContentParagraghTimes; } @Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } ReadConfigResp that = (ReadConfigResp) obj; return Objects.equals(this.imageReadConfigs, that.imageReadConfigs) && Objects.equals(this.pptReadConfigs, that.pptReadConfigs) && Objects.equals(this.readType, that.readType) && Objects.equals(this.readContent, that.readContent) && Objects.equals(this.characterPosition, that.characterPosition) && Objects.equals(this.readContentParagraghTimes, that.readContentParagraghTimes); } @Override public int hashCode() { return Objects.hash(imageReadConfigs, pptReadConfigs, readType, readContent, characterPosition, readContentParagraghTimes); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ReadConfigResp {\n"); sb.append(" imageReadConfigs: ").append(toIndentedString(imageReadConfigs)).append("\n"); sb.append(" pptReadConfigs: ").append(toIndentedString(pptReadConfigs)).append("\n"); sb.append(" readType: ").append(toIndentedString(readType)).append("\n"); sb.append(" readContent: ").append(toIndentedString(readContent)).append("\n"); sb.append(" characterPosition: ").append(toIndentedString(characterPosition)).append("\n"); sb.append(" readContentParagraghTimes: ").append(toIndentedString(readContentParagraghTimes)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "hwcloudsdk@huawei.com" ]
hwcloudsdk@huawei.com
ed522b0425c26e658a2e5073ee70d0381c995114
f6e3c25c4612c2c3f1700a9cdddba7e999aeb0a1
/src/java/Controller/Login.java
846387d8125f4e2a7ebd2f779e1204a94b7a28d7
[]
no_license
josmar1989/ReporteJavaWeb
db0be0e73ea7f2ad1b328e6d4fdf905d8c603445
a3cb7be955dabea1d79010eee264d0fc2477a8f7
refs/heads/master
2020-07-10T10:01:14.610541
2019-08-25T03:00:19
2019-08-25T03:00:19
204,236,991
0
0
null
null
null
null
UTF-8
Java
false
false
1,493
java
package Controller; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.io.IOException; import javax.servlet.http.*; import javax.servlet.*; import java.sql.*; public class Login extends HttpServlet { private static final long serialVersionUID = 1L; @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); String nombre = request.getParameter("nombre"); String password = request.getParameter("password"); try { Class.forName("com.mysql.jdbc.Driver"); Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/requerimiento","admin","admin"); PreparedStatement pst = conn.prepareStatement("Select usuario,password from usuario where usuario=? and password=?"); pst.setString(1, nombre); pst.setString(2, password); ResultSet rs = pst.executeQuery(); if (rs.next()) { HttpSession newSession = request.getSession(); newSession.setAttribute("nombre", nombre); response.sendRedirect("menuprincipal.jsp"); } else { response.sendRedirect("usuarionoregistrado.jsp"); } } catch (ClassNotFoundException | SQLException e) { e.printStackTrace(); } } }
[ "jospobleteu@gmail.com" ]
jospobleteu@gmail.com
f892ea434ca1e8e6a2124f3b8fd100871bf49d6e
94c029b19c3a85677b6c6c89ca7718b01ddfd5f9
/code-swagger/src/main/java/com/sixkery/suanfa/model.java
efbfe288543abb4b0c7c21660ea2294a13693e1d
[]
no_license
sixkery/trial
1562a4ecaf6371d4940863877e1f451c23122e7e
4f19c2d8c2ddcf20d4b351692301f22e86576b38
refs/heads/master
2023-04-07T20:57:21.899159
2020-08-10T17:30:25
2020-08-10T17:30:25
276,516,124
1
0
null
2021-03-31T22:15:13
2020-07-02T01:08:41
Java
UTF-8
Java
false
false
6,020
java
package com.sixkery.suanfa; /** * 单例设计模式 * * @author sixkery * @date 2020/8/11 */ public class model { public static void main(String[] args) { Singleton instance = Singleton.getInstance(); Singleton instance1 = Singleton.getInstance(); System.out.println(instance1 == instance); } } // 饿汉式(静态常量) class Singleton { // 1. 构造方法私有,外部不能 new private Singleton() { } // 2. 本类内部创建对象实例 private static final Singleton instance = new Singleton(); // 3. 提供一个公有的静态方法,返回实例对象 public static Singleton getInstance() { return instance; } } /** * 1. 优点:写法比较简单,在类加载的时候就完成实例化,避免了线程同步的问题 * 2. 缺点:在类装载的时候就完成了实例化,没有达到懒加载的效果,如果从始至终没有使用过这个实例,就会造成内存浪费。 * 3. 这种方式基于类加载的机制避免了多线程的问题,不过,实例在类加载就实例化,在单例模式中大多数是调用 getInstance 方法 * 但是导致类加载的原因有很多种,因此不能确定有其他的方式(或者其他的静态方法)导致类装载。这时候初始化 instance 就 * 没有达到懒加载的效果 * 结论:这种单例模式可能造成内存浪费 */ // 饿汉式(静态代码块) class Singleton1 { // 1. 构造方法私有,外部不能 new private Singleton1() { } // 2. 本类内部创建对象实例 private static Singleton1 instance; // 静态代码块中实例化 static { instance = new Singleton1(); } // 3. 提供一个公有的静态方法,返回实例对象 public static Singleton1 getInstance() { return instance; } } /** * 这种方式和上面的方式类似,只不过将实例化的过程放到了静态代码块中,也是在类装载的时候,就执行静态代码快里的代码, * 初始化类的实例。 */ // 懒汉式(线程不安全) class Singleton2 { // 1. 构造方法私有,外部不能 new private Singleton2() { } // 2. 本类内部创建对象实例 private static Singleton2 instance; // 3. 提供一个公有的静态方法,当用到该方法时,才创建 instance public static Singleton2 getInstance() { if (instance == null) { instance = new Singleton2(); } return instance; } } /** * 1. 起到了懒加载(lazy loading)的效果,但是只能在单线程中使用。 * 2. 如果在多线程的环境下,一个线程进入到 if (instance == null) 判断语句块,还未来得及继续进行下去。 * 另一个线程也进入了这个判断语句,这时就会产生多个实例,所以在多线程环境下不可用。 * 结论:在实际开发中不要使用这种方式 */ // 懒汉式(线程安全) class Singleton3 { // 1. 构造方法私有,外部不能 new private Singleton3() { } // 2. 本类内部创建对象实例 private static Singleton3 instance; // 3. 提供一个公有的静态方法,当用到该方法时,才创建 instance 添加同步方法,保证线程安全 public static synchronized Singleton3 getInstance() { if (instance == null) { instance = new Singleton3(); } return instance; } } /** * 1. 解决了线程安全的问题 * 2. 效率太低了,每个线程想要获取类的实例的时候,执行 getInstance 方法都要同步,而其实这个方法只需要执行一次就够了 * 后面的想要获取该类的实例,只需要 return 就可以了方法进行同步效率太低, * 结论:在开发中不建议使用 */ // 双重检查单例模式 class Singleton4 { // 1. 构造方法私有,外部不能 new private Singleton4() { } // 2. 本类内部创建对象实例 private static volatile Singleton4 instance; // 3. 提供一个静态公有方法,加入双重检查,解决线程安全问题,同时解决懒加载问题,同时保证了效率问题 public static Singleton4 getInstance() { if (instance == null) { synchronized (Singleton4.class) { if (instance == null) { instance = new Singleton4(); } } } return instance; } } /** * 1. 双重检查(Double-Check)概念是多线程开发中常使用到的。代码中进行了两次判断,可以保证线程安全 * 2. 实例代码只用执行一次,后面再次访问时一个判断直接 return 实例对象避免了反复进行方法的同步 * 3. 线程安全,延迟加载,效率较高 * 4. 在实际开发中,推荐使用 */ // 静态内部类方式 class Singleton5 { // 1. 构造方法私有,外部不能 new private Singleton5() { } // 2. 静态内部类 类装载的时候内部类不会执行,只有调用下边方法才会执行静态内部类的加载,起到了懒加载的效果 private static class SingletonInstance { private static final Singleton5 INSTANCE = new Singleton5(); } // 3. 提供一个静态公有方法, public static Singleton5 getInstance() { return SingletonInstance.INSTANCE; } } /** * 1. 这种方式采用类的装载机制来保证初始化实例时,只有一个线程 * 2. 静态内部类方式在 Singleton 类被装载时并不会立即实例化,而是在需要实例化时,调用 getInstance 方法, * 才会装载 SingletonInstance 类,从而完成实例化, * 3. 类的静态属性只会在第一次加载类的时候初始化,JVM 帮我们保证了线程的安全性,在类进行初始化的时候,别的线程没有办法进入 * 4. 避免了线程不安全,利用静态内部类特点实现延迟加载,效率高,推荐使用。 */
[ "sixkery@163.com" ]
sixkery@163.com
5a5152ed90a1f16da07b63cbbd897f41d7d4c63c
82cbd60cde32f09523a4762e9920d1d74f0e3829
/app/src/main/java/com/xiaozhai/zegobirderp/fragment/PackCheckFragment.java
f90a2237e3ce375240f08cdbd6190e8ebe27836d
[]
no_license
LeonNadal/ZegobirdErp
26805e37e10a6d6bd250908e387dcb99acfbd8c4
b464556aece5b97a212373e6cbd4deddf95b7234
refs/heads/master
2021-08-22T20:07:22.592212
2017-12-01T06:06:21
2017-12-01T06:06:21
110,937,271
0
0
null
null
null
null
UTF-8
Java
false
false
472
java
package com.xiaozhai.zegobirderp.fragment; import android.view.View; import com.xiaozhai.zegobirderp.R; import com.xiaozhai.zegobirderp.base.BaseFragment; /** * Created by Nadal on 2017/11/1. */ public class PackCheckFragment extends BaseFragment { @Override protected View initView() { initTile("打包检验"); isShowCommit(true); View view = View.inflate(mContext, R.layout.fragment_pack_check, null); return view; } }
[ "991759755@qq.com" ]
991759755@qq.com
cd80f26749422fbe3b8e619824d0d82d36f14ea3
7aee296c1768a22387ded262cfc40dc59d75c6dd
/configserver-client/src/main/java/com/cisco/config/client/ServletInitializer.java
c9ecee045f8ad2eaeeda93161c4800e1d15915ce
[]
no_license
lixyu/spring-cloud-demo
23ced892cb1d2b03638cf8315e78bd1e418416b8
7c66357535305dbf007bdf94605c5f69fccf6c01
refs/heads/master
2021-08-23T18:27:55.028601
2017-12-06T02:16:19
2017-12-06T02:16:19
113,188,051
0
0
null
null
null
null
UTF-8
Java
false
false
417
java
package com.cisco.config.client; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer; public class ServletInitializer extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(ConfigserverClientApplication.class); } }
[ "xinyul@cisco.com" ]
xinyul@cisco.com
53d11c12f21fa3405a57525581ff77b1ce81419e
5fb9d5cd069f9df099aed99516092346ee3cf91a
/embedded/src/main/java/org/teiid/test/embedded/netty/PortfolioH2Server.java
2d9ed04d8e2975452130f61fab3f4e8bd2644a42
[]
no_license
kylinsoong/teiid-test
862e238e055481dfb14fb84694b316ae74174467
ea5250fa372c7153ad6e9a0c344fdcfcf10800cc
refs/heads/master
2021-04-19T00:31:41.173819
2017-10-09T06:41:00
2017-10-09T06:41:00
35,716,627
0
0
null
null
null
null
UTF-8
Java
false
false
2,170
java
package org.teiid.test.embedded.netty; import java.io.InputStreamReader; import java.net.InetSocketAddress; import java.util.logging.Level; import javax.sql.DataSource; import org.h2.tools.RunScript; import org.teiid.example.EmbeddedHelper; import org.teiid.runtime.EmbeddedConfiguration; import org.teiid.runtime.EmbeddedServer; import org.teiid.translator.jdbc.h2.H2ExecutionFactory; import org.teiid.transport.SocketConfiguration; import org.teiid.transport.WireProtocol; public class PortfolioH2Server { public static void main(String[] args) throws Exception { EmbeddedHelper.enableLogger(Level.ALL); DataSource ds = EmbeddedHelper.newDataSource("org.h2.Driver", "jdbc:h2:mem://localhost/~/account", "sa", "sa"); RunScript.execute(ds.getConnection(), new InputStreamReader(PortfolioH2Server.class.getClassLoader().getResourceAsStream("data/customer-schema.sql"))); EmbeddedServer server = new EmbeddedServer(); H2ExecutionFactory executionFactory = new H2ExecutionFactory() ; executionFactory.setSupportsDirectQueryProcedure(true); executionFactory.start(); server.addTranslator("translator-h2", executionFactory); server.addConnectionFactory("java:/accounts-ds", ds); EmbeddedConfiguration config = new EmbeddedConfiguration(); config.setTransactionManager(EmbeddedHelper.getTransactionManager()); config.setTimeSliceInMilli(Integer.MAX_VALUE); SocketConfiguration s = new SocketConfiguration(); InetSocketAddress addr = new InetSocketAddress("localhost", 31000); s.setBindAddress(addr.getHostName()); s.setPortNumber(addr.getPort()); s.setProtocol(WireProtocol.teiid); config.addTransport(s); config.setSecurityDomain("teiid-security-file"); config.setSecurityHelper(EmbeddedHelper.getSecurityHelper()); server.start(config); server.deployVDB(PortfolioH2Server.class.getClassLoader().getResourceAsStream("portfolio-h2-vdb.xml")); Thread.sleep(Long.MAX_VALUE); } }
[ "kylinsoong.1214@gmail.com" ]
kylinsoong.1214@gmail.com
a60da41f67257e8fba9c15932b7d7c5eaba2bcbf
909961091b6b69235864acf8cb4b856026101be1
/project_oda/app/src/main/java/my/project/project_oda/src/main/myPage/models/ProductNumber.java
008ac1f2328fea5bfe7a2d9b0ff2ba360cc93ae2
[]
no_license
softsquared-sky/oda-logan
e9758a06adfd7491d802e0cf9458f46d5c9a0969
64caa390b56b30f609dfa111ae7ea120dfcacfa5
refs/heads/master
2020-07-10T01:20:49.062121
2019-09-24T08:53:52
2019-09-24T08:53:52
204,129,703
0
0
null
null
null
null
UTF-8
Java
false
false
191
java
package my.project.project_oda.src.main.myPage.models; public class ProductNumber { private int productNumber; public int getProductNumber() { return productNumber; } }
[ "smj7162@naver.com" ]
smj7162@naver.com
42fead8718e4d58375e67519e514549ce6d145aa
8b16f3b10623ab521ac2425794bdf12db601c242
/app/src/main/java/org/androidtown/jasoseol_assignment/MainActivity.java
939f30fe226bf187f053bc05e31a0c0d8443f9b9
[]
no_license
KimYJin/JasoseolAssignment
123b2bba5df6f719a3a0efd3ba31c1f8641f5743
b318e1a282d0f7f7a5415971c14f37f7d8ae4e5a
refs/heads/master
2020-05-18T07:40:40.178763
2019-05-02T08:13:31
2019-05-02T08:13:31
184,269,304
0
0
null
null
null
null
UTF-8
Java
false
false
3,139
java
package org.androidtown.jasoseol_assignment; import android.database.sqlite.SQLiteDatabase; 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.MenuItem; import android.widget.ListView; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; public class MainActivity extends AppCompatActivity { private ActionBar actionBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); /*create back-button at tool bar*/ Toolbar mToolbar = (Toolbar) findViewById(R.id.list_toolBar); setSupportActionBar(mToolbar); actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeAsUpIndicator(R.drawable.arrow); ListView listView = findViewById(R.id.list_container); //create ListView object CompanyAdapter companyAdapter = new CompanyAdapter(this); //create Adapter object companyAdapter.setItem(getCompanyList()); //set data for items of listView listView.setAdapter(companyAdapter); //set Adapter object to listView } /*activate back-button of tool bar*/ @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: onBackPressed(); return true; } return super.onOptionsItemSelected(item); } /** * do JSON Parsing * @return ArrayList<CompanyItem> */ private ArrayList<CompanyItem> getCompanyList() { ArrayList<CompanyItem> companyList = new ArrayList(); try { JSONArray jsonArray = new JSONArray(loadJSONFromAsset()); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); String companyName = jsonObject.getString("company_name"); String fields = jsonObject.getString("fields"); String image = jsonObject.getString("image"); String endTime = jsonObject.getString("end_time"); companyList.add(new CompanyItem(companyName, fields, image, endTime)); } } catch (JSONException e) { e.printStackTrace(); } return companyList; } /** * read json file * @return String **/ private String loadJSONFromAsset() { String json; try { InputStream is = getAssets().open("Android.json"); int size = is.available(); byte[] buffer = new byte[size]; is.read(buffer); is.close(); json = new String(buffer, "UTF-8"); } catch (IOException ex) { ex.printStackTrace(); return null; } return json; } }
[ "95yjkim95@gmail.com" ]
95yjkim95@gmail.com
92b98d7c3c15a9384cccf65f2036cefd08779ba4
3984714fc240aa4e7acb4ade7954aed5413db63f
/Lessons/3.Lesson/src/cz/spsmb/lesson3rd/ArrayUtils.java
8cce504a3ca075e09fe8edc4850b390ea37670d6
[]
no_license
tadeastondl/SPSMB-PRO-2021
256c28b7aad83a67592b47ec6622e0983868a49d
6af42750b9fe68d08956ee834d5e3a0fc729b17d
refs/heads/main
2023-09-01T23:29:41.487126
2021-11-07T13:53:33
2021-11-07T13:53:33
409,096,120
0
0
null
2021-09-22T06:55:19
2021-09-22T06:55:18
null
UTF-8
Java
false
false
1,521
java
package cz.spsmb.lesson3rd; public class ArrayUtils { /** * Metoda vygeneruje pole s random hodnotou. * * @param size - Velikost pole * @param min - Minimální hodnota * @param max - Maximální hodnota * @return - Pole s náhodnými hodnoty */ public static int[] generate(int size, int min, int max) { int[] array = new int[size]; for (int i = 0; i < array.length; i++) { array[i] = MathUtils.randomNumber(min, max); } return array; } /** * Výpis jednorozměrného pole do terminálu * * @param array */ public static void print(int[] array) { System.out.print("["); boolean first = true; for (int item : array) { if (first) { first = !first; } else { System.out.print(", "); } System.out.print(item); } System.out.println("]"); } /** * Součet celého pole * * @param array * * @return - součet celého pole */ public static int sum(int[] array) { int sum = 0; for (int item : array) { sum += item; } return sum; } /** * Průměrná hodnota pole * * @param array * * @return */ public static double avg(int[] array) { if (array.length == 0) { return 0; } return sum(array) / (double) array.length; } }
[ "lukasmazl@seznam.cz" ]
lukasmazl@seznam.cz
601e83ab63fc5ed0234d86275d16c3fc0b19c348
a9c674f7254f0588f068d3085f46b5e2c1978df1
/GridViewPager/Wearable/src/main/java/com/example/android/wearable/gridviewpager/fragments/DistanceFragment.java
2d7becce068378bcf1b63173cedf7bee93529763
[ "Apache-2.0" ]
permissive
allyjweir/buzz
9df68a84d7a5659e78686521854b9bddd11cdad0
a6bd8b9e00e6ac89ca6e94e70acf2838baff29bd
refs/heads/master
2020-04-06T07:00:52.097159
2015-03-09T08:18:44
2015-03-09T08:18:44
29,972,940
0
0
null
null
null
null
UTF-8
Java
false
false
1,924
java
/* * Copyright (C) 2014 The Android Open Source Project * * 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.example.android.wearable.gridviewpager.fragments; import android.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.example.android.wearable.gridviewpager.R; import com.example.android.wearable.gridviewpager.user.Contact; import com.example.android.wearable.gridviewpager.user.UserSettings; public class DistanceFragment extends Fragment { private int contactNumber; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { contactNumber = this.getArguments().getInt("contact_number"); return inflater.inflate(R.layout.fragment_distance, container, false); } @Override public void onViewCreated(View v, Bundle savedInstanceState) { super.onViewCreated(v, savedInstanceState); Contact contact = UserSettings.getInstance(getActivity()).getContacList().get(contactNumber); ((ImageView) getView().findViewById(R.id.contact_image)).setImageResource(contact.getPicture()); ((TextView) getView().findViewById(R.id.distance_text)).setText(contact.getName() + " " + contact.getDistance()); } }
[ "zaharovs92v@gmail.com" ]
zaharovs92v@gmail.com
8e576b70980cdc53e529456bc6da30bc0ca4a2b4
2627945793f55500887f7ffb90ad5e7f0333aa5b
/net/minecraft/client/renderer/texture/DynamicTexture.java
cd9550c61bda8653697b8bc6924dc5894f1a1945
[]
no_license
ClientPlayground/Lightning-Client
392aec9a84b791de63932473a333ab1585415807
b247c43a69d343abfa13a2a9940598fd07de4e4b
refs/heads/main
2022-07-30T05:05:54.106328
2021-04-18T18:15:43
2021-04-18T18:15:43
359,218,103
4
1
null
null
null
null
UTF-8
Java
false
false
1,296
java
package net.minecraft.client.renderer.texture; import java.awt.image.*; import net.minecraft.client.resources.*; import java.io.*; public class DynamicTexture extends AbstractTexture { private final int[] dynamicTextureData; private final int width; private final int height; public DynamicTexture(final BufferedImage bufferedImage) { this(bufferedImage.getWidth(), bufferedImage.getHeight()); bufferedImage.getRGB(0, 0, bufferedImage.getWidth(), bufferedImage.getHeight(), this.dynamicTextureData, 0, bufferedImage.getWidth()); this.updateDynamicTexture(); } public DynamicTexture(final int textureWidth, final int textureHeight) { this.width = textureWidth; this.height = textureHeight; this.dynamicTextureData = new int[textureWidth * textureHeight]; TextureUtil.allocateTexture(this.getGlTextureId(), textureWidth, textureHeight); } @Override public void loadTexture(final IResourceManager resourceManager) throws IOException { } public void updateDynamicTexture() { TextureUtil.uploadTexture(this.getGlTextureId(), this.dynamicTextureData, this.width, this.height); } public int[] getTextureData() { return this.dynamicTextureData; } }
[ "nebulalol@icloud.com" ]
nebulalol@icloud.com
ac51e625d8e97d6c96839f21c4538b87e14ae42b
b56738946de169d20ca91ee3b788551e78514e75
/src/fileio/Input.java
2bfab5d139e58cfbbc00f42184cf954b5ac7b4ef
[]
no_license
AlexandraAncuta13/Proiect-Energy-System-Etapa-2
5931cb653ffd5cd04194ace67549bc48fc7c29e7
b9fcdadc8692b33842427ce100e6f6210ce46fdd
refs/heads/main
2023-02-18T06:03:02.998257
2021-01-21T11:16:22
2021-01-21T11:16:22
331,598,074
0
0
null
null
null
null
UTF-8
Java
false
false
888
java
package fileio; import java.util.List; /** * Informatii despre input */ public final class Input { private final int numberOfTurns; private final InitialData initialData; private final List<MonthlyUpdates> monthlyUpdates; public Input() { this.numberOfTurns = 0; this.initialData = null; this.monthlyUpdates = null; } public Input(final int numberOfTurns, final InitialData initialData, final List<MonthlyUpdates> monthlyUpdates) { this.numberOfTurns = numberOfTurns; this.initialData = initialData; this.monthlyUpdates = monthlyUpdates; } public int getNumberOfTurns() { return numberOfTurns; } public InitialData getInitialData() { return initialData; } public List<MonthlyUpdates> getMonthlyUpdates() { return monthlyUpdates; } }
[ "alexandra.ancuta@stud.acs.upb.ro" ]
alexandra.ancuta@stud.acs.upb.ro
7063df0a2e2016129a622f3fd15c259ab12e0b46
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mobileqqi/classes.jar/eoz.java
dc4dae532b164172e5d7695b2bc926daf0237132
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
3,697
java
import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.PointF; import com.tencent.mobileqq.activity.recent.cur.DragRelativeLayout; import com.tencent.mobileqq.activity.recent.cur.DragRelativeLayout.IDragViewProvider; import com.tencent.qphone.base.util.QLog; import java.util.List; public class eoz implements Runnable { public static final int a = 50; private PointF jdField_a_of_type_AndroidGraphicsPointF = new PointF(); private int b; public eoz(DragRelativeLayout paramDragRelativeLayout, PointF paramPointF) { this.jdField_a_of_type_AndroidGraphicsPointF.set(paramPointF); this.b = -1; } public Bitmap a() { Object localObject2 = null; Object localObject1 = localObject2; if (this.b >= 0) { localObject1 = localObject2; if (this.b >= DragRelativeLayout.a().length) {} } try { localObject1 = BitmapFactory.decodeResource(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout.getResources(), DragRelativeLayout.a()[this.b]); return localObject1; } catch (Throwable localThrowable) { do { localObject1 = localObject2; } while (!QLog.isColorLevel()); QLog.e("DragRelativeLayout", 2, "decodeBitmap failed" + localThrowable, localThrowable); } return null; } public void run() { if (this.b == DragRelativeLayout.a().length) { if (this == DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout)) { DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout, null); } DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout, null); if (DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout) == 2) { List localList = DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout).a(); if ((DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout) != null) && (localList.size() > 0)) { DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout, 5); DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout, new eoy(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout, localList)); DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout, null); } } } for (;;) { this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout.invalidate(); return; DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout, -1); if (QLog.isColorLevel()) { QLog.d("Drag", 2, "DONE!"); } DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout, true); break; DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout, -1); if (QLog.isColorLevel()) { QLog.d("Drag", 2, "DONE!"); } DragRelativeLayout.a(this.jdField_a_of_type_ComTencentMobileqqActivityRecentCurDragRelativeLayout, true); break; this.b += 1; } } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mobileqqi\classes.jar * Qualified Name: eoz * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
fecebd1eff2515acc8def12d7668f67deb22bbae
354786d09e45fdf017303aca4c45a61f6e623352
/src/test/java/com/toysrus/automation/lib/Data.java
ce941295ff749acba207b61a5ad523664ceb0cd9
[]
no_license
mlinderman1/tru_automation
378cdd043b1ff94b480d1a32db5a6649b08ebb14
1d1a4d297ed9a74cc8fe120e191dd4fbaa74e8c7
refs/heads/master
2020-03-08T05:04:07.861070
2018-02-05T19:36:48
2018-02-05T19:36:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,804
java
package com.toysrus.automation.lib; import java.util.ArrayList; public class Data { private String user__fname; private String user__lname; private String user__address1; private String user__address2; private String user__city; private String user__state; private String user__zip; private String user__phone; private String user__email; public Data(String user__fname, String user__lname, String user__address1, String user__address2, String user__city, String user__state, String user__zip, String user__phone, String user__email) { { this.user__fname = user__fname; this.user__lname = user__lname; this.user__address1 = user__address1; this.user__address2 = user__address2; this.user__city = user__city; this.user__state = user__state; this.user__zip = user__zip; this.user__phone = user__phone; this.user__email = user__email; } } public static class user1 { //Shipping public static final String user__shipping__first_name = "John"; public static final String user__shipping__last_name = "Doe"; public static final String user__shipping__address1 = "1 Geoffrey Way"; public static final String user__shipping__address2 = ""; public static final String user__shipping__city = "Wayne"; public static final String user__shipping__state = "NJ"; public static final String user__shipping__zip = "07470"; public static final String user__shipping__phone = "1234567890"; //Pickup public static final String user__pickup__first_name = "John"; public static final String user__pickup__last_name = "Doe"; public static final String user__pickup__phone = "1234567890"; public static final String user__pickup__email = "tru.linderman@gmail.com"; //Billing public static final String user__billing__first_name = "John"; public static final String user__billing__last_name = "Doe"; public static final String user__billing__address1 = "1 Geoffrey Way"; public static final String user__billing__address2 = ""; public static final String user__billing__city = "Wayne"; public static final String user__billing__state = "NJ"; public static final String user__billing__zip = "07470"; public static final String user__billing__phone = "1234567890"; public static final String user__email = "tru.linderman@gmail.com"; } public static ArrayList search_Items() { ArrayList<String> search_items = new ArrayList<String>(); search_items.add("barbie"); search_items.add("ninja turtle"); search_items.add("batman"); search_items.add("mickey mouse"); search_items.add("baby doll"); search_items.add("five nights at freddys"); search_items.add("nerf gun"); search_items.add("crayola"); search_items.add("pool"); search_items.add("swing set"); search_items.add("play yard"); search_items.add("crib"); search_items.add("stroller"); search_items.add("car seat"); search_items.add("diapers"); search_items.add("bib"); // search_items.add("onesie"); search_items.add("sippy cup"); return search_items; } public static class credit_card__Visa{ public static final String credit_card__number = "4111111111111111"; public static final String credit_card__expiration_month = "01"; public static final String credit_card__expiration_year = "2019"; public static final String credit_card__cvv = "111"; } // public static class credit_card__Visa{ // public static final String credit_card__number = "4387751111111111"; // public static final String credit_card__expiration_month = "01"; // public static final String credit_card__expiration_year = "2019"; // public static final String credit_card__cvv = "111"; // } public static class credit_card__Amex{ public static final String credit_card__number = "370000000000101"; public static final String credit_card__expiration_month = "01"; public static final String credit_card__expiration_year = "2019"; public static final String credit_card__cvv = "1111"; } public static class credit_card__Master_Card{ public static final String credit_card__number = "5442981111111114"; public static final String credit_card__expiration_month = "01"; public static final String credit_card__expiration_year = "2019"; public static final String credit_card__cvv = "111"; } public static class credit_card__PLCC{ public static final String credit_card__number = "6045860000000001"; public static final String credit_card__cvv = "111"; } // CREDIT CARDS // // COBRANDED // 5243636714843171 // 111 // 2019-01 // // COBRANDED // 5237704245602827 // 111 // 2019-01 }
[ "Michael.Linderman@toysrus.com" ]
Michael.Linderman@toysrus.com
7cdc6b3fac2da895f3f6147ab9339048946e75f0
99b64725a621b5a9bbe90046566024a94ff61cdc
/Trunk_Jun_09_08/src/com/bagnet/nettracer/tracing/utils/taskmanager/MorningDutiesDJReport.java
11fb5605a8d72071ec287860a2eaef7c965b4d5b
[]
no_license
cyril23/testone
f38832016329bf655fdc120cadae7159b9be05fb
41797a2bfd00102f39b7e908a792e51523890d00
refs/heads/master
2020-08-31T19:13:33.378927
2015-02-11T01:24:04
2015-02-11T01:24:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,822
java
package com.bagnet.nettracer.tracing.utils.taskmanager; import com.bagnet.nettracer.tracing.db.Station; public class MorningDutiesDJReport { Station station; int dayTwoCount = 0; int dayThreeCount = 0; int dayFourCount = 0; int yDayTwoCount; int yDayThreeCount; int yDayFourCount; public int getTotalCalls(){ return dayTwoCount + dayThreeCount + dayFourCount; } public int getTotalYesterdayCalls(){ return yDayTwoCount+yDayThreeCount+yDayFourCount; } public int getTotalYesterdayCompleteCalls(){ return yDayTwoComplete+yDayThreeComplete+yDayFourComplete; } public int getYesterdaysTwoPercent(){ if(yDayTwoCount == 0){ return 0; } else { return yDayTwoComplete / yDayTwoCount * 100; } } public int getYesterdaysThreePercent(){ if(yDayThreeCount == 0){ return 0; } else { return yDayThreeComplete / yDayThreeCount * 100; } } public int getYesterdaysFourPercent(){ if(yDayFourCount == 0){ return 0; } else { return yDayFourComplete / yDayFourCount * 100; } } public int getYesterdaysTotalPercent(){ if(getTotalYesterdayCalls() == 0){ return 0; } else { return getTotalYesterdayCompleteCalls() / getTotalYesterdayCalls() * 100; } } public Station getStation() { return station; } public void setStation(Station station) { this.station = station; } public int getDayTwoCount() { return dayTwoCount; } public void setDayTwoCount(int dayTwoCount) { this.dayTwoCount = dayTwoCount; } public int getDayThreeCount() { return dayThreeCount; } public void setDayThreeCount(int dayThreeCount) { this.dayThreeCount = dayThreeCount; } public int getDayFourCount() { return dayFourCount; } public void setDayFourCount(int dayFourCount) { this.dayFourCount = dayFourCount; } public int getyDayTwoCount() { return yDayTwoCount; } public void setyDayTwoCount(int yDayTwoCount) { this.yDayTwoCount = yDayTwoCount; } public int getyDayThreeCount() { return yDayThreeCount; } public void setyDayThreeCount(int yDayThreeCount) { this.yDayThreeCount = yDayThreeCount; } public int getyDayFourCount() { return yDayFourCount; } public void setyDayFourCount(int yDayFourCount) { this.yDayFourCount = yDayFourCount; } public int getyDayTwoComplete() { return yDayTwoComplete; } public void setyDayTwoComplete(int yDayTwoComplete) { this.yDayTwoComplete = yDayTwoComplete; } public int getyDayThreeComplete() { return yDayThreeComplete; } public void setyDayThreeComplete(int yDayThreeComplete) { this.yDayThreeComplete = yDayThreeComplete; } public int getyDayFourComplete() { return yDayFourComplete; } public void setyDayFourComplete(int yDayFourComplete) { this.yDayFourComplete = yDayFourComplete; } int yDayTwoComplete; int yDayThreeComplete; int yDayFourComplete; }
[ "mloupas@nettracer.aero" ]
mloupas@nettracer.aero
7aa6f4815b8bee0973992907d9eb8518eef773c3
1feebb635280bb042160746e919a3e4079d7f13b
/WireWorldModule/src/application/WireWorldAutomaton.java
a1735b3abcf648148c5e9958f5be484b433e193b
[]
no_license
JustSayMeh/Cellular_Automaton
c92e2eef015b2ffaa887bc07a3243646c113d3bd
5c9a6811a75a7d41a78262584d1c27be025fd70e
refs/heads/master
2020-03-18T19:43:23.322993
2018-05-29T15:47:47
2018-05-29T15:47:47
135,173,205
0
0
null
null
null
null
UTF-8
Java
false
false
1,642
java
package application; import Automatons.TDCellularAutomaton; public class WireWorldAutomaton extends TDCellularAutomaton{ public WireWorldAutomaton(int csz, int rsz, boolean tr) { super(csz, rsz, tr); Tor = tr; } @Override public void tick() { changed = false; for (int i = 0; i < rSize; i++) { for (int j = 0; j < cSize; j++){ int status = boxes[i][j]; if (status == 0) continue; if (status == 3) { int count = 0; cboxes[i][j] = boxes[i][j]; int ui = (i == 0)? rSize - 1: i - 1; int di = (i + 1 == rSize)? 0: i + 1; int lj = (j == 0)? cSize - 1: j - 1; int rj = (j + 1 == cSize)? 0: j + 1; if (((i - 1 >= 0 && j - 1 >= 0) || Tor) && boxes[ui][lj] == 1) count += 1; if ((i - 1 >= 0 || Tor) && boxes[ui][j] == 1) count += 1; if (((i - 1 >= 0 && j + 1 < boxes[i].length) || Tor) && boxes[ui][rj] == 1) count += 1; if ((j + 1 < boxes[i].length || Tor) && boxes[i][rj] == 1) count += 1; if ((j - 1 >= 0 || Tor) && boxes[i][lj] == 1) count += 1; if (((i + 1 < boxes.length && j - 1 >= 0) || Tor) && boxes[di][lj] == 1) count += 1; if ((i + 1 < boxes.length || Tor)&& boxes[di][j] == 1) count += 1; if (((i + 1 < boxes.length && j + 1 < boxes[i].length) || Tor) && boxes[di][rj] == 1) count += 1; if (count >= 1 && count < 3) cboxes[i][j] = 1; }else cboxes[i][j] = boxes[i][j] + 1; if (cboxes[i][j] != boxes[i][j]) changed = true; } } int[][] cp = boxes; boxes = cboxes; cboxes = cp; } }
[ "noreply@github.com" ]
JustSayMeh.noreply@github.com
0e5765d3495efc6a506cbb69e1b2d9f29bf744ac
cb58a4dbeecbdde54e3125b01938982f78736818
/AppAnalytics/src/main/java/com/AppAnalytics/dao/UserDao.java
54e07f3e9a5cfcb99c5712089b42cb20f5389f11
[]
no_license
Ezio15/AppAnalytics-restService
566438f03cc310edfe0a682518ad2854dc6990ff
43aed3b21b348660ddec8dcb57dec5bf0bbbfa3f
refs/heads/master
2020-04-04T10:24:53.622713
2018-11-02T11:06:46
2018-11-02T11:06:46
155,853,849
0
1
null
null
null
null
UTF-8
Java
false
false
439
java
package com.AppAnalytics.dao; import com.AppAnalytics.models.TblUserCredentials; import com.AppAnalytics.models.TblUserProfile; public interface UserDao { Boolean isEmailExists(String email); Integer saveUser(TblUserProfile userProfile); void updateUser(TblUserProfile userProfile); boolean registerUser(TblUserCredentials userCredentials); TblUserCredentials authUser(TblUserCredentials userCredentials); }
[ "noreply@github.com" ]
Ezio15.noreply@github.com
c633555659792838a53dfb51e39579e55b1e47f2
9e6c7e838f4594155a54ee956799f9ba925381ab
/app/src/main/java/pers/lonestar/pixelcanvas/activity/SearchActivity.java
a91ad7987b0de90290031255b3eccdb74ff16627
[ "MIT" ]
permissive
LoneStarFateZero/PixelCanvas
27a53cfb911dc248bb60146899f49c852b8faf10
a839849ada0f686a1261361ccf87ecf9c775c9d5
refs/heads/master
2020-04-26T08:20:57.968737
2019-06-04T05:46:46
2019-06-04T05:46:46
173,420,693
7
1
null
null
null
null
UTF-8
Java
false
false
3,148
java
package pers.lonestar.pixelcanvas.activity; import android.content.Intent; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentStatePagerAdapter; import androidx.viewpager.widget.ViewPager; import com.google.android.material.tabs.TabLayout; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; import pers.lonestar.pixelcanvas.R; import pers.lonestar.pixelcanvas.fragment.SearchCanvasFragment; import pers.lonestar.pixelcanvas.fragment.SearchUserFragment; public class SearchActivity extends BaseSwipeBackActivity { private static SearchActivity instance; private TabLayout tabLayout; private ViewPager viewPager; private Toolbar toolbar; private List<Fragment> fragmentList = new ArrayList<>(); private String queryData; public static SearchActivity getInstance() { return instance; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_search); instance = this; Intent intent = getIntent(); queryData = intent.getStringExtra("query_data"); initView(); addFragment(); } private void initView() { tabLayout = (TabLayout) findViewById(R.id.search_tablayout); viewPager = (ViewPager) findViewById(R.id.search_viewpager); toolbar = (Toolbar) findViewById(R.id.search_activity_toolbar); toolbar.setTitle("搜索结果"); toolbar.setTitleTextAppearance(this, R.style.TitleStyle); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeButtonEnabled(true); } } private void addFragment() { final String[] titles = new String[]{"作品", "用户"}; for (String title : titles) { tabLayout.addTab(tabLayout.newTab().setText(title)); } SearchCanvasFragment searchCanvasFragment = new SearchCanvasFragment(); searchCanvasFragment.setQueryCanvasName(queryData); SearchUserFragment searchUserFragment = new SearchUserFragment(); searchUserFragment.setQueryCanvasName(queryData); fragmentList.add(searchCanvasFragment); fragmentList.add(searchUserFragment); viewPager.setAdapter(new FragmentStatePagerAdapter(getSupportFragmentManager()) { @NonNull @Override public Fragment getItem(int position) { return fragmentList.get(position); } @Override public int getCount() { return fragmentList.size(); } @NotNull @Override public CharSequence getPageTitle(int position) { return titles[position]; } }); tabLayout.setupWithViewPager(viewPager); } }
[ "1589186895@qq.com" ]
1589186895@qq.com
e8ad679a794f83a4ed0213d347f48d392610ee4e
2bb8103b1234bbeaf49a789ed0340dcad80e68a1
/android/src/main/java/be/ugent/zeus/hydra/util/facebook/event/tasks/AsyncPicGetter.java
ab908bf2fa2caac754d193af0eeb47c0814fd43a
[]
no_license
axd1967/Hydra-old-AS
30fe5e41c733af5caaf1ce690811ce70b96063c5
3e39cc6cdf806239099574f61d444427813f7a55
refs/heads/master
2021-01-10T13:21:59.951798
2015-12-18T10:37:28
2015-12-18T10:43:03
48,246,966
0
0
null
null
null
null
UTF-8
Java
false
false
1,167
java
/** * * @author Tom Naessens Tom.Naessens@UGent.be 3de Bachelor Informatica Universiteit Gent * */ package be.ugent.zeus.hydra.util.facebook.event.tasks; import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.widget.ImageView; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; public class AsyncPicGetter extends AsyncTask<Void, Void, Drawable> { ImageView image; String url; public AsyncPicGetter(ImageView image, String url) { this.image = image; this.url = url; } @Override protected Drawable doInBackground(Void... params) { InputStream is = null; try { url = url.replace("\\/", "/"); is = (InputStream) new URL(url).getContent(); } catch (MalformedURLException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } return Drawable.createFromStream(is, "Event picture"); } @Override protected void onPostExecute(Drawable result) { image.setImageDrawable(result); } }
[ "alexander.duytschaever@gmail.com" ]
alexander.duytschaever@gmail.com
be0347a1df6c895ca4b79cd8e15cb27515bd0dae
af183b387407acef71f737b50b7a24843024f17d
/src/Persons.java
fdfe4b5bc0163be2b851ec95afa22904e4a7aae5
[]
no_license
CrazyBugLady/murder_mistery_game
85b6923bd13cfcc41b6624be46127f08372e8a1f
a340a2c9e138437be1b990df425323a5eb190a33
refs/heads/master
2021-05-29T10:19:37.463361
2015-01-13T07:32:13
2015-01-13T07:32:13
null
0
0
null
null
null
null
ISO-8859-1
Java
false
false
13,673
java
import java.io.*; import javax.xml.parsers.*; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.*; import javax.xml.transform.dom.*; import org.w3c.dom.*; import java.util.Random; public class Persons { String person = ""; String questionid = ""; String[] avaiable_persons = new String[15]; String[] avaiable_questions = new String[15]; int my_indices = 0; Detective_Functions Detective = new Detective_Functions(); public NodeList createNodeList(String Filename, String Elementname) throws Exception { // Damit der Reader nicht andauernd wiederholt werden muss... DocumentBuilderFactory fabrik = DocumentBuilderFactory.newInstance(); DocumentBuilder aufbau = fabrik.newDocumentBuilder(); Document xmlbaum = aufbau.parse(Filename); NodeList newNodeList = xmlbaum.getElementsByTagName(Elementname); return newNodeList; } public void all_Persons() throws Exception { // zeige alle Personen, die du bisher aufrufen kannst NodeList Gespraeche = createNodeList("Gespraeche.xml", "Gespraech"); int Anzahl_Gespraeche = Gespraeche.getLength(); for(int i = 0; i < Anzahl_Gespraeche; i++) { Element Gespraech = (Element) Gespraeche.item(i); String freigeschaltet = Gespraech.getAttribute("freigeschaltet"); String Person = Gespraech.getAttribute("Person"); if(indice_ask(freigeschaltet)) { System.out.println(" * " + Person); avaiable_persons[i] = Person; } } } public void all_questions() throws Exception { // Alle Fragen zeigen, die man bisher freigeschaltet hat NodeList Gespraeche = createNodeList("Gespraeche.xml", "Gespraech"); for(int g = 0; g<Gespraeche.getLength(); g++) { Element Gespraech = (Element) Gespraeche.item(g); String Person = Gespraech.getAttribute("Person"); if(Person.equalsIgnoreCase(this.person)) { NodeList Fragen = Gespraech.getElementsByTagName("Frage"); for(int f = 0; f< Fragen.getLength(); f++) { Element Frage = (Element) Fragen.item(f); // Wir wollen nun wissen, welche Frage für uns bereits freigeschaltet ist und welche wir noch nicht gefragt haben. Zuallererst müssen wir wissen, ob wir sie bereits gestellt haben. Wenn wir sie schon gestellt haben, sind sie natürlich schon freigeschaltet, umgekehrt nicht. if(Frage.getAttribute("gefragt").equalsIgnoreCase("nein")) { if(indice_ask(Frage.getAttribute("notwendiges_wissen"))) { System.out.println("(" + Frage.getAttribute("id") + ")" + " " + Frage.getTextContent()); avaiable_questions[f] = Frage.getAttribute("id"); } } } } } } public void ask_question() throws Exception { // Frage stellen, nachdem alle Angaben geprüft wurden DocumentBuilderFactory fabrik = DocumentBuilderFactory.newInstance(); DocumentBuilder aufbau = fabrik.newDocumentBuilder(); Document xmlbaum = aufbau.parse("Gespraeche.xml"); NodeList Gespraeche = xmlbaum.getElementsByTagName("Gespraech"); for(int g = 0; g < Gespraeche.getLength(); g++) { Element Gespraech = (Element) Gespraeche.item(g); if(Gespraech.getAttribute("Person").equalsIgnoreCase(this.person)) { NodeList Fragen = Gespraech.getElementsByTagName("Frage"); NodeList Antworten = Gespraech.getElementsByTagName("Antwort"); for(int a = 0; a < Antworten.getLength(); a++) { Element Antwort = (Element) Antworten.item(a); Element Frage = (Element) Fragen.item(a); if(Antwort.getAttribute("frageid").equals(this.questionid)) { if(Frage.hasAttribute("minispiel")) { if(game_1()) { set_question_true(Frage, xmlbaum); } } else { set_question_true(Frage, xmlbaum); } System.out.println(this.person + ": " + Antwort.getTextContent()); } } } } } public void all_notices(boolean filtern, String belastet_wen) throws Exception { // Alle Notizen abrufen entweder gefiltert oder ungefiltert (nach Verdächtigten) my_indices = 0; NodeList Indizien = createNodeList("Fall.xml", "Indiz"); System.out.println("_______________________________________________"); for(int i = 0; i<Indizien.getLength(); i++) { Element Indiz = (Element) Indizien.item(i); if(indice_ask(Indiz.getAttribute("name"))) { if(filtern & Indiz.getAttribute("entlastet_wen").equalsIgnoreCase(belastet_wen)) { if(!Indiz.hasAttribute("in_verbindung_mit2") || (Indiz.hasAttribute("in_verbindung_mit2") && indice_ask(Indiz.getAttribute("in_verbindung_mit2")))) { System.err.println("+" + Indiz.getTextContent()); if(my_indices >= 1) { // Was spricht FÜR den Angeklagten / die Angeklagte bzw... gegen die Behauptung my_indices--; } } } if(filtern & Indiz.getAttribute("belastet_wen").equalsIgnoreCase(belastet_wen)) { // Wenn man filtern möchte (für Verdächtigung) // Und es ein Indiz ist, das denjenigen belastet, den man belasten möchte // weitersuchen für den Fall, dass es gewisse nur in Verbindung mit anderen Beweisen gibt... if(!Indiz.hasAttribute("in_verbindung_mit") || (Indiz.hasAttribute("in_verbindung_mit") & indice_ask(Indiz.getAttribute("in_verbindung_mit")))) { my_indices++; // Man hat einen weiteren Beweis System.out.println("-" + Indiz.getTextContent()); } } else if(!filtern) { my_indices++; System.out.println("-" + Indiz.getTextContent()); } } } System.out.println("Anzahl Indizien: " + my_indices); System.out.println("_______________________________________________"); } // geile Rückgabemethoden xD public void set_indice_true(String indice) throws Exception { DocumentBuilderFactory fabrik = DocumentBuilderFactory.newInstance(); DocumentBuilder aufbau = fabrik.newDocumentBuilder(); Document xmlbaum = aufbau.parse("Fall.xml"); NodeList Indizien = xmlbaum.getElementsByTagName("Indiz"); for(int i = 0; i<Indizien.getLength(); i++) { Element Indiz = (Element) Indizien.item(i); if(Indiz.getAttribute("name").equalsIgnoreCase(indice)) { Indiz.setAttribute("entdeckt", "Ja"); TransformerFactory.newInstance().newTransformer().transform( new DOMSource(xmlbaum), new StreamResult(new FileOutputStream("Fall.xml"))); } } // Hier wird ein neues Indiz auf true gesetzt, das wir im Laufe unserer Ermittlungen noch brauchen könnten. } public void doResetAllIndices() throws Exception { // Alle Indizien werden zurück auf nicht entdeckt gestellt DocumentBuilderFactory fabrik = DocumentBuilderFactory.newInstance(); DocumentBuilder aufbau = fabrik.newDocumentBuilder(); Document xmlbaum = aufbau.parse("Fall.xml"); NodeList Indizien = xmlbaum.getElementsByTagName("Indiz"); for(int i = 0; i < Indizien.getLength(); i++) { Element Indiz = (Element) Indizien.item(i); if(!Indiz.getAttribute("name").equalsIgnoreCase("automatisch")) { Indiz.setAttribute("entdeckt", "Nein"); } TransformerFactory.newInstance().newTransformer().transform( new DOMSource(xmlbaum), new StreamResult(new FileOutputStream("Fall.xml"))); } } public void doResetAllQuestions() throws Exception { // Alle Fragen zurückstellen DocumentBuilderFactory fabrik = DocumentBuilderFactory.newInstance(); DocumentBuilder aufbau = fabrik.newDocumentBuilder(); Document xmlbaum = aufbau.parse("Gespraeche.xml"); NodeList Fragen= xmlbaum.getElementsByTagName("Frage"); for(int f = 0; f < Fragen.getLength(); f++) { Element Frage = (Element) Fragen.item(f); Frage.setAttribute("gefragt", "nein"); } TransformerFactory.newInstance().newTransformer().transform( new DOMSource(xmlbaum), new StreamResult(new FileOutputStream("Gespraeche.xml"))); } public boolean indice_ask(String indice) throws Exception { boolean indiz_gefunden = false; // Hier werden die Indizien abgefragt. Wenn sie = true sind, haben wir sie schon. Wenn sie gleich false sind, haben wir sie noch nicht. if(!indice.equals("")) { NodeList Indizien = createNodeList("Fall.xml", "Indiz"); for(int i = 0; i<Indizien.getLength(); i++) { Element Indiz = (Element) Indizien.item(i); if(Indiz.getAttribute("name").equalsIgnoreCase(indice)) { if(Indiz.getAttribute("entdeckt").equalsIgnoreCase("Nein")) // Ist als Wert Nein eingetragen, dann haben wir es noch nicht herausgefunden { indiz_gefunden = false; // Wir haben bisher noch nichts darüber hinausfinden können } else { indiz_gefunden = true; // Wir haben dieses Indiz bereits! } } } } else { indiz_gefunden = true; } return indiz_gefunden; } public void doSetPerson(String Person_typed) { // Angabe für Person getestet einstellen. if(isPersonUsable(Person_typed)) { // Wenn diese Person benutzbar ist this.person = Person_typed; } else { this.person = ""; } } public void doSetQuestion(String Question_typed) { // Angabe für Frage getestet einstellen. if(isQuestionUsable(Question_typed)) { // Wenn diese Person benutzbar ist this.questionid = Question_typed; } else { this.questionid = ""; } } public boolean isPersonFilled() { // Konnte Person gefüllt werden? if(person.equals("")) { return false; } else { return true; } } public boolean isQuestionFilled() { // Konnte Frage gefüllt werden? if(questionid.equals("")) { return false; } else { return true; } } public boolean isPersonUsable(String Person_typed) // isPersonUsable { // Gibt es die Person überhaupt? boolean avaiable = false; for(int i = 0; i < avaiable_persons.length; i++) { if(avaiable_persons[i] == null) { avaiable = false; } else if (avaiable_persons[i].equalsIgnoreCase(Person_typed)) { avaiable = true; break; } } return avaiable; } public boolean isQuestionUsable(String Question_typed) // isQuestionUsable { // Gibt es die Frage überhaupt? boolean avaiable = false; for(int i = 0; i < avaiable_questions.length; i++) { if(avaiable_questions[i] == null) { avaiable = false; } else if(avaiable_questions[i].equalsIgnoreCase(Question_typed)) { avaiable = true; break; } } return avaiable; } public void set_question_true(Element Frage, Document xmlbaum) throws Exception { // Stelle die Frage auf true => wurde gestellt Frage.setAttribute("gefragt", "ja"); // Man kann diese Frage nicht noch einmal fragen if(Frage.hasAttribute("gibt_wissen")) { set_indice_true(Frage.getAttribute("gibt_wissen")); TransformerFactory.newInstance().newTransformer().transform( new DOMSource(xmlbaum), new StreamResult(new FileOutputStream("Gespraeche.xml"))); } } public boolean game_1() { // Minispiel 1 für die Fragen // Zufallszahlen kreieren int randomnumber; int me = 0; int person2; Random RandomCreate = new Random(); System.out.println("Minispiel 1 - Würfelspiel"); System.out.println("*****************************************************************************************"); System.out.println("Das ist ein Würfelspiel. Hier musst du schätzen, welche Zahl als nächstes gewürfelt wird.\n Die Zahl sollte zwischen 1 und 7 liegen (1-6)"); System.out.println("*****************************************************************************************"); // Zufallsnummern erstellen randomnumber = RandomCreate.nextInt(6) + 1; person2 = RandomCreate.nextInt(6) + 1; while(me == 0) { System.out.println("Bitte gebe die Zahl ein, die du schätzst:"); me = Detective.doSayNumber(); } System.out.println("*****************************************************************************************"); System.out.println("Schätzung des Gegners: " + person2); System.out.println("Tatsächliche Lösung: " + randomnumber); System.out.println("*****************************************************************************************"); // prüfen, wer die richtige Nummer erraten hat ... if(randomnumber == me) { System.out.println("Du hast gewonnen und erhälst nun deine Antworten."); return true; } else if (randomnumber == person2) { System.out.println("Satz mit x, das war wohl nix. Du hast leider verloren, kannst es aber nochmal versuchen."); return false; } else { System.out.println("Hm... unentschieden... so erhälst du deine Antworten jedenfalls nicht."); return false; } } }
[ "snatsch@gmx.ch" ]
snatsch@gmx.ch
4fa383fcf19749ae2768d1b7e095320eec1dd763
639437d2d764971680f4c9cf9cf2108b2898b245
/sdk/datahub-java-sdk/src/main/java/macaca/datahub/common/Utils.java
742df3872abca1ebf9c64d81faaaee3e5663d1e8
[ "MIT" ]
permissive
macacajs/macaca-datahub
b06df95e1a6dccba84e09783de248ea3cb8025cb
cc22e536de55c7b4ba7958f19a190c8f6e2d53de
refs/heads/master
2023-08-27T11:45:35.474410
2022-12-16T08:40:19
2022-12-16T08:40:19
111,818,989
546
71
MIT
2023-09-11T04:07:47
2017-11-23T14:28:42
JavaScript
UTF-8
Java
false
false
3,690
java
package macaca.datahub.common; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import org.apache.http.HttpEntity; import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.message.BasicNameValuePair; import org.apache.http.util.EntityUtils; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; public class Utils { // private final Log log = LogFactory.getLog(getClass()); private HttpGet httpget = null; private CloseableHttpClient httpclient = HttpClients.createDefault(); private CloseableHttpResponse response = null; private HttpEntity entity = null; private JSONObject jsonResponse = null; private String stringResponse = ""; public Utils() { } public Object request(String method, String url, Object data) throws Exception { if ("GET".equals(method.toUpperCase())) { return getRequest(url); } else if ("POST".equals(method.toUpperCase())) { return postRequest(url, (JSONObject) data); } return null; } private void printResponse(String stringResponse) throws Exception { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if (stringResponse.length() > 800) { System.out.println(df.format(new java.util.Date()) + " Response:" + stringResponse.substring(0, 800) + "...more response is ignored.."); } else { System.out.println(df.format(new java.util.Date()) + " Response:" + stringResponse); } } private void printRequest(String stringRequest) throws Exception { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); System.out.println(df.format(new java.util.Date()) + " Request:" + stringRequest); } private Object getRequest(String url) throws Exception { try { printRequest(url); httpget = new HttpGet(url); response = httpclient.execute(httpget); entity = response.getEntity(); if (entity != null) { stringResponse = EntityUtils.toString(entity); printResponse(stringResponse); jsonResponse = JSON.parseObject(stringResponse); return jsonResponse.get("data"); } } catch (ClientProtocolException e) { e.printStackTrace(); } return null; } private Object postRequest(String url, JSONObject jsonBody) throws Exception { List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); for (String key : jsonBody.keySet()) { String value = jsonBody.get(key).toString(); nameValuePairs.add(new BasicNameValuePair(key, value)); } HttpPost httppost = new HttpPost(url); httppost.setHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "UTF-8")); try { CloseableHttpResponse res = httpclient.execute(httppost); String json2 = EntityUtils.toString(res.getEntity(), "utf-8"); System.out.println(json2); } catch (ClientProtocolException e) { e.printStackTrace(); } return null; } }
[ "xudafeng@126.com" ]
xudafeng@126.com
fe0664dd7ee941d651753b266a91f4ac2655fd16
6a106233fbdd8ad3f6d90eb0b5474cd56946025a
/src/main/java/org/marlabs/iis/project/ProjectIISRepositoryImpl.java
7019229b94ced93dff5808963eebc2f713e496e2
[]
no_license
pk-gupta/multi-datasource-with-jdbc-template
e51e1caeb80ae0811a0202cce862829418e1e4ae
e65004c0f88ce7ffb2d2d96e51a9c6c07213ceb8
refs/heads/master
2020-06-24T07:02:51.646025
2019-07-25T19:23:02
2019-07-25T19:23:02
198,889,161
0
0
null
null
null
null
UTF-8
Java
false
false
878
java
package org.marlabs.iis.project; import java.sql.SQLException; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; @Repository public class ProjectIISRepositoryImpl implements ProjectIISRepository{ @Autowired @Qualifier("jdbcIIS") private JdbcTemplate jdbcTemplate; @Transactional(readOnly=true) public List<ProjectIISVo> listProjects() throws Exception { try { String sql = "SELECT * from Projects"; return jdbcTemplate.query(sql, new ProjectMapper()); } catch (Exception e) { throw new SQLException("--Error message in ProjectIISRepositoryImpl listProjects()----", e); } } }
[ "sagar.pkgupta@gmail.com" ]
sagar.pkgupta@gmail.com
e46b09622045a67ecd9ca9c5a1c94bff70604715
5469c57b2dcac42db7d2ed961724f8647df81fca
/TME8/Exo47/ArrayListReversible.java
30bfb0885ba7dfc6256085bbf8737f0535ab069d
[]
no_license
abdxxw/2i002
0f2040c726b189d32cafed95664cc1617e4a98ab
26398622602f7e5082dea2ea54ea7a469472aaf6
refs/heads/main
2023-05-31T11:28:52.707082
2021-06-01T11:41:58
2021-06-01T11:41:58
372,511,114
3
0
null
null
null
null
UTF-8
Java
false
false
910
java
import java.util.ArrayList; public class ArrayListReversible<Object> extends ArrayList<Object> implements Reversible{ private boolean inverse; public ArrayListReversible(boolean b){ super(); inverse=b; } public void inverser(){ for(int i=0;i<this.size()/2;i++){ inverse = false; Object temp = get(i); if(temp instanceof StringReversible) ((StringReversible) temp).inverser(); inverse = true; this.set(i,this.get(i)); this.set(this.size()-i-1,temp); } } public Object get(int index){ if(inverse) return super.get(this.size()-index-1); else return super.get(index); } public String toString(){ String temp=""; for( Object o : this) temp +=o.toString()+"\n"; return temp; } }
[ "abdowvg69@gmail.com" ]
abdowvg69@gmail.com
f549611711dd4f8e16f1e2363bd2abf735c8aa1b
3842c9ae03373bea5dc1b2121697020ca72175c1
/Codigo/Banco/src/banco/Login.java
31134aaedcd6dc21731d72bad16816bf63b08310
[]
no_license
walteregv95/-IPC2-Fase2
887c0e969a9c8fb03ef930a4b48caa7daaa654b4
99106018a1fce9c8b5839e5719d275868d8005c8
refs/heads/master
2020-12-02T19:49:48.470422
2017-07-06T06:23:03
2017-07-06T06:23:03
96,393,808
0
0
null
null
null
null
UTF-8
Java
false
false
3,510
java
package banco; import javax.swing.*; import java.awt.GridLayout; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; public class Login extends JFrame{ JPanel panel; JLabel Usuario,TipoCuenta,Contraseña,Login; JTextField txtUsuario; JPasswordField txtContraseña; JButton BotonLogin; JComboBox cmbOpcionCuenta; public static String[] usuario = new String [5]; String [] contraseña = new String [5]; String combo; public Login() { usuario[0] = "walter"; usuario[1] = "eliette"; usuario[2] = "*"; usuario[3] = "*"; usuario[4] = "*"; contraseña[0]= "admin"; contraseña[1] = "201504216"; contraseña[2] = "*"; contraseña[3] = "*"; contraseña[4] = "*"; setBounds(200, 50, 370, 300); panel = new JPanel(); panel.setBackground(Color.LIGHT_GRAY); setContentPane(panel); panel.setLayout(null ); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Usuario = new JLabel("Usuario"); TipoCuenta = new JLabel("Tipo de Cuenta"); Contraseña = new JLabel("Contraseña"); Login = new JLabel("LOGIN"); txtUsuario = new JTextField(); txtContraseña = new JPasswordField(); cmbOpcionCuenta = new JComboBox(); BotonLogin = new JButton("Entrar"); Login.setBounds(150,3,85,30); panel.add(Login); TipoCuenta.setBounds(100,30,85,30); panel.add(TipoCuenta); cmbOpcionCuenta.setBounds(100,55,125,20); cmbOpcionCuenta.addItem("Servicio al Cliente"); cmbOpcionCuenta.addItem("Receptor Pagador"); cmbOpcionCuenta.addItem("Administrador"); panel.add(cmbOpcionCuenta); Usuario.setBounds(100,70,85,30); panel.add(Usuario); txtUsuario.setBounds(100,95,125,20); panel.add(txtUsuario); Contraseña.setBounds(100,110,85,30); panel.add(Contraseña); txtContraseña.setBounds(100,140,125,20); panel.add(txtContraseña); BotonLogin.setBounds(110,185,100,30); panel.add(BotonLogin); BotonLogin.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { combo = (String) cmbOpcionCuenta.getSelectedItem(); for (int i = 0;i<5;i++){ if(usuario[i].equals(txtUsuario.getText())&& contraseña[i].equals(txtContraseña.getText())){ if (combo.equals("Servicio al Cliente")){ CuentaHabientes enlace = new CuentaHabientes (); enlace.setVisible(true); dispose();}else if (combo.equals("Receptor Pagador")){ Receptor_Pagador enlace = new Receptor_Pagador (); enlace.setVisible(true); dispose(); } break; } else if(i==4) {JOptionPane.showMessageDialog( null, "Usuario o Contraseña incorrecta" );} } } }); setVisible(true); } }
[ "walteregv95@gmail.com" ]
walteregv95@gmail.com
33a47bc9c28055936d72e108526c2a25f37d04da
e89f3c04a0f7bc26d4a068406c4f6fe0ffe8a149
/Section3/src/com/assignment/collections/LinkedHashSetExample.java
1462593ef7ba1a191e496bea3e8e3a228c7e6295
[ "MIT" ]
permissive
Rohit-1609/Core_Java
e5c174e0c36fd75268dbeab1518b88ecd451c7a4
9ebdf7c2058ec9688a893e49e7c43fd6edb3f5a8
refs/heads/main
2023-08-26T07:35:42.254834
2021-10-11T12:54:12
2021-10-11T12:54:12
413,026,581
0
0
null
null
null
null
UTF-8
Java
false
false
710
java
package com.corejava.assignment.collections; import java.util.Iterator; import java.util.LinkedHashSet; public class LinkedHashSetExample { public static void main(String[] args) { LinkedHashSet linkedhashset= new LinkedHashSet(); linkedhashset.add(25); linkedhashset.add("java"); linkedhashset.add('R'); linkedhashset.add(25); linkedhashset.add(null); linkedhashset.add(21); linkedhashset.add(87); linkedhashset.add(66); linkedhashset.add("apple"); linkedhashset.add("hello"); linkedhashset.add(45); System.out.println("Hashset element are:"); Iterator iterator =linkedhashset.iterator(); while(iterator.hasNext()) { System.out.println(iterator.next()); } } }
[ "rohittembhu5555@gmail.com" ]
rohittembhu5555@gmail.com
d7dfb5b4e8acbbc1cc8ae86dd989baa6ab1498e6
116898bcb34c29b27d2da24c1d9687d9997cab40
/Tower of Hanoi/tower.java
f6a6c80f4d48239bddd3dcbecc760094996a2568
[]
no_license
Gking19/Tower-of-Hanoi
f8bc1378f118f77afd055ea37e0fe20283c97fe3
61d66cd9d8a9db29bb65b0ecce3b7ea281d03da4
refs/heads/master
2021-01-10T17:43:26.635382
2016-03-18T15:30:07
2016-03-18T15:30:07
53,604,700
1
0
null
null
null
null
UTF-8
Java
false
false
1,607
java
import java.util.ArrayList; /** * Creates a tower object which holds an ArrayList of discs. * * @author Gary Carlson * @version v2 */ public class Tower { ArrayList<Disc> tower; private int removedSize; public Tower(int Size){ tower = new ArrayList<Disc>(Size); } public Tower(){ this(3); } public boolean moveDisc(Tower fromTower, Tower toTower){ /** * Moves disc between fromTower and toTower * @return true if successfully moved disc, false for any other case */ int checkDisk = tower.get(0).getDiscSize(); if (fromTower == toTower){ System.out.println("Invalid movement, disc already on tower, choose different tower."); return false; } else if (toTower.getDisc()!=0 || fromTower.getDisc() > toTower.getDisc()){ System.out.println("Invalid movement, moving disc is bigger than placed disc."); return false; } else{ fromTower.removeDisc(); toTower.addDisc(); return true; } } public int getDisc(){ if(tower.size() == 0){ return 0; } else{ return tower.get(0).getDiscSize(); } } public int removeDisc(){ removedSize = this.getDisc(); if(tower.size() > 0){ tower.remove(0); return removedSize; } return removedSize; } public boolean addDisc(){ Disc disc = new Disc(); tower.add(0,disc); return true; } }
[ "gcgking897@gmail.com" ]
gcgking897@gmail.com
f04e5e913da2c1bb9abc4cb124a4bb543f487a43
cbabcb51854f3c0a9f3f335cb57a4e6f5dc01b30
/src/main/java/io/github/hjipster/application/aop/logging/LoggingAspect.java
73f6a8d596e5b272a5587bd1b921b95a917db1d4
[]
no_license
hjipster/hjipsterApp
0154c313a0d852d5e5134d933a9f3f839bbca79e
c69c7c3a0d5d7d535c5d4f863b213b1505eca5ba
refs/heads/master
2021-08-31T23:26:15.237265
2017-12-23T13:11:42
2017-12-23T13:11:42
115,196,317
0
0
null
null
null
null
UTF-8
Java
false
false
3,870
java
package io.github.hjipster.application.aop.logging; import io.github.jhipster.config.JHipsterConstants; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.env.Environment; import java.util.Arrays; /** * Aspect for logging execution of service and repository Spring components. * * By default, it only runs with the "dev" profile. */ @Aspect public class LoggingAspect { private final Logger log = LoggerFactory.getLogger(this.getClass()); private final Environment env; public LoggingAspect(Environment env) { this.env = env; } /** * Pointcut that matches all repositories, services and Web REST endpoints. */ @Pointcut("within(@org.springframework.stereotype.Repository *)" + " || within(@org.springframework.stereotype.Service *)" + " || within(@org.springframework.web.bind.annotation.RestController *)") public void springBeanPointcut() { // Method is empty as this is just a Pointcut, the implementations are in the advices. } /** * Pointcut that matches all Spring beans in the application's main packages. */ @Pointcut("within(io.github.hjipster.application.repository..*)"+ " || within(io.github.hjipster.application.service..*)"+ " || within(io.github.hjipster.application.web.rest..*)") public void applicationPackagePointcut() { // Method is empty as this is just a Pointcut, the implementations are in the advices. } /** * Advice that logs methods throwing exceptions. * * @param joinPoint join point for advice * @param e exception */ @AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e") public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e); } else { log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL"); } } /** * Advice that logs when a method is entered and exited. * * @param joinPoint join point for advice * @return result * @throws Throwable throws IllegalArgumentException */ @Around("applicationPackagePointcut() && springBeanPointcut()") public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { if (log.isDebugEnabled()) { log.debug("Enter: {}.{}() with argument[s] = {}", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(), Arrays.toString(joinPoint.getArgs())); } try { Object result = joinPoint.proceed(); if (log.isDebugEnabled()) { log.debug("Exit: {}.{}() with result = {}", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(), result); } return result; } catch (IllegalArgumentException e) { log.error("Illegal argument: {} in {}.{}()", Arrays.toString(joinPoint.getArgs()), joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName()); throw e; } } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
f69bd93643977091024cb611331f6300f0fe5a35
dbfe40b6b87124fcb1a89906a2fe6518eda8665e
/eMayorRepresentationLayer/src/org/apache/struts/taglib/bean/ResourceTag.java
a1c9c148eb274989e5da5327040ebe4e8625ca33
[]
no_license
BackupTheBerlios/emayor
1fc04a0411908b6c189b5dfaa1e11f9d25c37884
daa5627cbf1461323fef5771c23bb16c66ad02aa
refs/heads/master
2016-09-06T19:26:16.110107
2006-05-04T07:27:38
2006-05-04T07:27:38
40,069,904
1
1
null
null
null
null
UTF-8
Java
false
false
4,332
java
/* * $Id: ResourceTag.java,v 1.1 2006/02/01 15:32:57 emayor Exp $ * * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.struts.taglib.bean; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; import org.apache.struts.util.MessageResources; import org.apache.struts.taglib.TagUtils; /** * Define a scripting variable based on the contents of the specified * web application resource. * * @version $Rev: 54929 $ $Date: 2006/02/01 15:32:57 $ */ public class ResourceTag extends TagSupport { // ------------------------------------------------------------- Properties /** * Buffer size to use when reading the input stream. */ protected static final int BUFFER_SIZE = 256; /** * The name of the scripting variable that will be exposed as a page * scope attribute. */ protected String id = null; public String getId() { return (this.id); } public void setId(String id) { this.id = id; } /** * Return an InputStream to the specified resource if this is non-null. */ protected String input = null; public String getInput() { return (this.input); } public void setInput(String input) { this.input = input; } /** * The message resources for this package. */ protected static MessageResources messages = MessageResources.getMessageResources( "org.apache.struts.taglib.bean.LocalStrings"); /** * The module-relative URI of the resource whose contents are to * be exposed. */ protected String name = null; public String getName() { return (this.name); } public void setName(String name) { this.name = name; } // --------------------------------------------------------- Public Methods /** * Retrieve the required property and expose it as a scripting variable. * * @exception JspException if a JSP exception has occurred */ public int doStartTag() throws JspException { // Acquire an input stream to the specified resource InputStream stream = pageContext.getServletContext().getResourceAsStream(name); if (stream == null) { JspException e = new JspException(messages.getMessage("resource.get", name)); TagUtils.getInstance().saveException(pageContext, e); throw e; } // If we are returning an InputStream, do so and return if (input != null) { pageContext.setAttribute(id, stream); return (SKIP_BODY); } // Accumulate the contents of this resource into a StringBuffer try { StringBuffer sb = new StringBuffer(); InputStreamReader reader = new InputStreamReader(stream); char buffer[] = new char[BUFFER_SIZE]; int n = 0; while (true) { n = reader.read(buffer); if (n < 1) { break; } sb.append(buffer, 0, n); } reader.close(); pageContext.setAttribute(id, sb.toString()); } catch (IOException e) { TagUtils.getInstance().saveException(pageContext, e); throw new JspException(messages.getMessage("resource.get", name)); } return (SKIP_BODY); } /** * Release all allocated resources. */ public void release() { super.release(); id = null; input = null; name = null; } }
[ "emayor" ]
emayor
772015c90bf6854805e388e5f448b3ee84054f69
a5905be13321c8163a302dcc8027d7d8792212fe
/DroidCafeWithSettings/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/androidx/transition/R.java
4000bd0b2b4a544399334ab6ac28f1924d3d2b3a
[]
no_license
Gabryan1995/Android_Tutorial_Apps
a7870c06c7c4b655a35b12145c85956670c890eb
4c85dff30db048e37c06e6be707f1291d4408b4b
refs/heads/master
2022-12-25T23:40:03.089139
2020-10-11T09:58:19
2020-10-11T09:58:19
303,090,796
0
0
null
null
null
null
UTF-8
Java
false
false
11,116
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package androidx.transition; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f04002c; public static final int font = 0x7f04012b; public static final int fontProviderAuthority = 0x7f04012d; public static final int fontProviderCerts = 0x7f04012e; public static final int fontProviderFetchStrategy = 0x7f04012f; public static final int fontProviderFetchTimeout = 0x7f040130; public static final int fontProviderPackage = 0x7f040131; public static final int fontProviderQuery = 0x7f040132; public static final int fontStyle = 0x7f040133; public static final int fontVariationSettings = 0x7f040134; public static final int fontWeight = 0x7f040135; public static final int ttcIndex = 0x7f0402a7; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f0600a3; public static final int notification_icon_bg_color = 0x7f0600a4; public static final int ripple_material_light = 0x7f0600af; public static final int secondary_text_default_material_light = 0x7f0600b1; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f070053; public static final int compat_button_inset_vertical_material = 0x7f070054; public static final int compat_button_padding_horizontal_material = 0x7f070055; public static final int compat_button_padding_vertical_material = 0x7f070056; public static final int compat_control_corner_material = 0x7f070057; public static final int compat_notification_large_icon_max_height = 0x7f070058; public static final int compat_notification_large_icon_max_width = 0x7f070059; public static final int notification_action_icon_size = 0x7f0700f7; public static final int notification_action_text_size = 0x7f0700f8; public static final int notification_big_circle_margin = 0x7f0700f9; public static final int notification_content_margin_start = 0x7f0700fa; public static final int notification_large_icon_height = 0x7f0700fb; public static final int notification_large_icon_width = 0x7f0700fc; public static final int notification_main_column_padding_top = 0x7f0700fd; public static final int notification_media_narrow_margin = 0x7f0700fe; public static final int notification_right_icon_size = 0x7f0700ff; public static final int notification_right_side_padding_top = 0x7f070100; public static final int notification_small_icon_background_padding = 0x7f070101; public static final int notification_small_icon_size_as_large = 0x7f070102; public static final int notification_subtext_size = 0x7f070103; public static final int notification_top_pad = 0x7f070104; public static final int notification_top_pad_large_text = 0x7f070105; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f08008a; public static final int notification_bg = 0x7f08008b; public static final int notification_bg_low = 0x7f08008c; public static final int notification_bg_low_normal = 0x7f08008d; public static final int notification_bg_low_pressed = 0x7f08008e; public static final int notification_bg_normal = 0x7f08008f; public static final int notification_bg_normal_pressed = 0x7f080090; public static final int notification_icon_background = 0x7f080091; public static final int notification_template_icon_bg = 0x7f080092; public static final int notification_template_icon_low_bg = 0x7f080093; public static final int notification_tile_bg = 0x7f080094; public static final int notify_panel_notification_icon_bg = 0x7f080095; } public static final class id { private id() {} public static final int action_container = 0x7f09002f; public static final int action_divider = 0x7f090031; public static final int action_image = 0x7f090033; public static final int action_text = 0x7f09003c; public static final int actions = 0x7f09003d; public static final int async = 0x7f090045; public static final int blocking = 0x7f090049; public static final int chronometer = 0x7f090057; public static final int forever = 0x7f090086; public static final int ghost_view = 0x7f090089; public static final int icon = 0x7f090092; public static final int icon_group = 0x7f090094; public static final int info = 0x7f090097; public static final int italic = 0x7f090099; public static final int line1 = 0x7f09009e; public static final int line3 = 0x7f09009f; public static final int normal = 0x7f0900b7; public static final int notification_background = 0x7f0900ba; public static final int notification_main_column = 0x7f0900bb; public static final int notification_main_column_container = 0x7f0900bc; public static final int parent_matrix = 0x7f0900c5; public static final int right_icon = 0x7f0900d2; public static final int right_side = 0x7f0900d3; public static final int save_image_matrix = 0x7f0900d6; public static final int save_non_transition_alpha = 0x7f0900d7; public static final int save_scale_type = 0x7f0900d8; public static final int tag_transition_group = 0x7f09010e; public static final int tag_unhandled_key_event_manager = 0x7f09010f; public static final int tag_unhandled_key_listeners = 0x7f090110; public static final int text = 0x7f090111; public static final int text2 = 0x7f090112; public static final int time = 0x7f09011d; public static final int title = 0x7f09011e; public static final int transition_current_scene = 0x7f090125; public static final int transition_layout_save = 0x7f090126; public static final int transition_position = 0x7f090127; public static final int transition_scene_layoutid_cache = 0x7f090128; public static final int transition_transform = 0x7f090129; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f0a0011; } public static final class layout { private layout() {} public static final int notification_action = 0x7f0c0041; public static final int notification_action_tombstone = 0x7f0c0042; public static final int notification_template_custom_big = 0x7f0c0043; public static final int notification_template_icon_group = 0x7f0c0044; public static final int notification_template_part_chronometer = 0x7f0c0045; public static final int notification_template_part_time = 0x7f0c0046; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f100068; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f11016a; public static final int TextAppearance_Compat_Notification_Info = 0x7f11016b; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f11016c; public static final int TextAppearance_Compat_Notification_Time = 0x7f11016d; public static final int TextAppearance_Compat_Notification_Title = 0x7f11016e; public static final int Widget_Compat_NotificationActionContainer = 0x7f11023d; public static final int Widget_Compat_NotificationActionText = 0x7f11023e; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f04002c }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] FontFamily = { 0x7f04012d, 0x7f04012e, 0x7f04012f, 0x7f040130, 0x7f040131, 0x7f040132 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f04012b, 0x7f040133, 0x7f040134, 0x7f040135, 0x7f0402a7 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; } }
[ "gabryan1995@gmail.com" ]
gabryan1995@gmail.com