blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
aa6f23bbc13b88211f136aa11ac212c8f3773239
f5f143087f35fa67fa4c54cad106a32e1fb45c0e
/src/com/jpexs/decompiler/flash/types/MORPHFOCALGRADIENT.java
d1aaacb40a62d28345f7ec3157405d0f613a1d13
[]
no_license
SiverDX/SWFCopyValues
03b665b8f4ae3a2a22f360ea722813eeb52b4ef0
d146d8dcf6d1f7a69aa0471f85b852e64cad02f7
refs/heads/master
2022-07-29T06:56:55.446686
2021-12-04T09:48:48
2021-12-04T09:48:48
324,795,135
0
1
null
null
null
null
UTF-8
Java
false
false
2,892
java
/* * Copyright (C) 2010-2018 JPEXS, All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ package com.jpexs.decompiler.flash.types; import com.jpexs.decompiler.flash.types.annotations.SWFType; import java.io.Serializable; /** * Well, this structure is undocumented, but exists * * @author JPEXS */ public class MORPHFOCALGRADIENT extends MORPHGRADIENT implements Serializable { @SWFType(BasicType.FIXED8) public float startFocalPoint; @SWFType(BasicType.FIXED8) public float endFocalPoint; @Override public GRADIENT getEndGradient() { FOCALGRADIENT ret = new FOCALGRADIENT(); ret.spreadMode = spreadMode; ret.interpolationMode = interPolationMode; ret.gradientRecords = new GRADRECORD[gradientRecords.length]; for (int m = 0; m < gradientRecords.length; m++) { ret.gradientRecords[m] = gradientRecords[m].getEndRecord(); } ret.focalPoint = endFocalPoint; return ret; } @Override public GRADIENT getStartGradient() { FOCALGRADIENT ret = new FOCALGRADIENT(); ret.spreadMode = spreadMode; ret.interpolationMode = interPolationMode; ret.gradientRecords = new GRADRECORD[gradientRecords.length]; for (int m = 0; m < gradientRecords.length; m++) { ret.gradientRecords[m] = gradientRecords[m].getStartRecord(); } ret.focalPoint = startFocalPoint; return ret; } @Override public GRADIENT getGradientAt(int ratio) { FOCALGRADIENT ret = new FOCALGRADIENT(); ret.spreadMode = spreadMode; ret.interpolationMode = interPolationMode; ret.gradientRecords = new GRADRECORD[gradientRecords.length]; for (int m = 0; m < gradientRecords.length; m++) { int gratio = (gradientRecords[m].startRatio + (gradientRecords[m].endRatio - gradientRecords[m].startRatio) * ratio / 65535); ret.gradientRecords[m] = new GRADRECORD(); ret.gradientRecords[m].color = morphColor(gradientRecords[m].startColor, gradientRecords[m].endColor, ratio); ret.gradientRecords[m].ratio = gratio; } ret.focalPoint = (startFocalPoint + (endFocalPoint - startFocalPoint) * ratio / 65535); return ret; } }
[ "kai.zahn@yahoo.de" ]
kai.zahn@yahoo.de
7799252c2707f6d104f71fdd0d898e82c97862e8
c856b2baf017ae964683bdcccbe1dcaf1e37c8f8
/CER/plugin/provider/fermat-cer-plugin-provider-dolartoday-bitdubai/src/main/java/com/bitdubai/fermat_cer_plugin/layer/provider/dolartoday/developer/bitdubai/version_1/exceptions/CantInitializeDolarTodayProviderDatabaseException.java
56b1d8d19e22c14332b2cb1c0c110c93b9a25709
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
Miguelcldn/fermat
846e23853e91ce246451e9aa47c96140a38c2023
37c9eb5fae7b866596fd13477ab1c1d4436822d4
refs/heads/master
2020-04-05T01:59:01.323366
2015-12-10T17:33:51
2015-12-10T17:33:51
46,994,194
0
0
null
2015-11-27T18:24:00
2015-11-27T18:24:00
null
UTF-8
Java
false
false
1,318
java
package com.bitdubai.fermat_cer_plugin.layer.provider.dolartoday.developer.bitdubai.version_1.exceptions; import com.bitdubai.fermat_api.FermatException; /** * The Class <code>package com.bitdubai.fermat_cer_plugin.layer.provider.dolartoday.developer.bitdubai.version_1.exceptions.CantInitializeDolarTodayProviderDatabaseException</code> * is thrown when an error occurs initializing database * <p/> * * Created by Alejandro Bicelis - (abicelis@gmail.com) on 08/12/15. * * @version 1.0 * @since Java JDK 1.7 */ public class CantInitializeDolarTodayProviderDatabaseException extends FermatException { public static final String DEFAULT_MESSAGE = "CAN'T INTIALIZE DOLARTODAY PROVIDER DATABASE EXCEPTION"; public CantInitializeDolarTodayProviderDatabaseException(final String message, final Exception cause, final String context, final String possibleReason) { super(message, cause, context, possibleReason); } public CantInitializeDolarTodayProviderDatabaseException(final String message, final Exception cause) { this(message, cause, "", ""); } public CantInitializeDolarTodayProviderDatabaseException(final String message) { this(message, null); } public CantInitializeDolarTodayProviderDatabaseException() { this(DEFAULT_MESSAGE); } }
[ "abicelis@gmail.com" ]
abicelis@gmail.com
167ec5a2f921de0c33a65e544d0b1350018ba103
f02f6a5c5579a3989a93633504d1e7e5071202b2
/aquarius-lock-starter/src/main/java/com/nepxion/aquarius/lock/annotation/EnableLock.java
d40024a6e5c464fcfc44229d3372773fa0605ea5
[ "Apache-2.0" ]
permissive
Nepxion/Aquarius
5215de642ebd935233962e2ef88f7d62994da0d2
df9b0b9ac1083733572d2767b7c3abfdbccb1b24
refs/heads/master
2023-04-13T16:24:58.377809
2023-04-09T12:32:57
2023-04-09T12:32:57
110,342,369
427
162
Apache-2.0
2021-06-23T06:50:42
2017-11-11T12:06:53
Java
UTF-8
Java
false
false
746
java
package com.nepxion.aquarius.lock.annotation; /** * <p>Title: Nepxion Aquarius</p> * <p>Description: Nepxion Aquarius</p> * <p>Copyright: Copyright (c) 2017-2050</p> * <p>Company: Nepxion</p> * @author Haojun Ren * @version 1.0 */ import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.context.annotation.Import; import com.nepxion.aquarius.lock.aop.LockImportSelector; @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @Import(LockImportSelector.class) public @interface EnableLock { }
[ "1394997@qq.com" ]
1394997@qq.com
0a8e097bdca78ca84143f9f562247a6c4a697035
6073527eb3952e8d5918dbba94e775061258d79a
/TileEntity/TileEntityCrystalCharger.java
f886d2001449c6f5670f54446174103328c3aee5
[]
no_license
fishingdemon/ChromatiCraft
b5daf9c04379ead8f2fde935471cc461d558c147
3c257cd27ab2675df19596901f71785e9d336fb3
refs/heads/master
2021-01-18T07:19:32.348950
2015-03-18T11:03:53
2015-03-18T11:03:53
32,453,869
0
0
null
2015-03-18T11:03:17
2015-03-18T11:03:17
null
UTF-8
Java
false
false
4,105
java
/******************************************************************************* * @author Reika Kalseki * * Copyright 2015 * * All rights reserved. * Distribution of the software in any form is only allowed with * explicit, prior permission from the owner. ******************************************************************************/ package Reika.ChromatiCraft.TileEntity; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import Reika.ChromatiCraft.Auxiliary.ChromaStacks; import Reika.ChromatiCraft.Base.TileEntity.InventoriedCrystalReceiver; import Reika.ChromatiCraft.Items.ItemStorageCrystal; import Reika.ChromatiCraft.Magic.ElementTagCompound; import Reika.ChromatiCraft.Registry.ChromaItems; import Reika.ChromatiCraft.Registry.ChromaTiles; import Reika.ChromatiCraft.Registry.CrystalElement; import Reika.DragonAPI.Base.OneSlotMachine; import Reika.DragonAPI.Libraries.MathSci.ReikaMathLibrary; import Reika.DragonAPI.Libraries.Registry.ReikaItemHelper; public class TileEntityCrystalCharger extends InventoriedCrystalReceiver implements OneSlotMachine { private float angle; public static final int CAPACITY = 120000; @Override public void updateEntity(World world, int x, int y, int z, int meta) { super.updateEntity(world, x, y, z, meta); if (!world.isRemote && this.getCooldown() == 0 && checkTimer.checkCap()) { this.checkAndRequest(); } if (this.hasItem()) { for (CrystalElement e : energy.elementSet()) { int max = this.getMaxTransfer(e); int amt = this.getEnergy(e); ItemStorageCrystal cry = this.item(); int put = Math.min(max, Math.min(amt, cry.getSpace(e, inv[0]))); if (put > 0) { cry.addEnergy(inv[0], e, put); this.drainEnergy(e, put); } } } } public float getAngle() { return angle; } private ItemStorageCrystal item() { return ((ItemStorageCrystal)inv[0].getItem()); } private int getMaxTransfer(CrystalElement e) { int max = 10+(int)Math.sqrt(this.getEnergy(e)); return this.hasSpeedUpgrade() ? 8*max : max; } public boolean hasSpeedUpgrade() { return ReikaItemHelper.matchStacks(inv[1], ChromaStacks.speedUpgrade); } private void checkAndRequest() { for (int i = 0; i < CrystalElement.elements.length; i++) { CrystalElement e = CrystalElement.elements[i]; int capacity = this.getMaxStorage(e); int space = capacity-this.getEnergy(e); if (space > 0) { this.requestEnergy(e, space); } } } @Override public void onPathBroken(CrystalElement e) { } @Override public int getReceiveRange() { return 20; } @Override public boolean isConductingElement(CrystalElement e) { return e != null; } @Override public int maxThroughput() { return 250; } @Override public boolean canConduct() { return true; } @Override public boolean isItemValidForSlot(int slot, ItemStack is) { switch(slot) { case 0: return ChromaItems.STORAGE.matchWith(is); case 1: return ReikaItemHelper.matchStacks(is, ChromaStacks.speedUpgrade); default: return false; } } @Override public boolean canExtractItem(int slot, ItemStack is, int side) { return slot == 0 && ChromaItems.STORAGE.matchWith(is) && this.item().isFull(is); } @Override public int getSizeInventory() { return 2; } @Override public int getInventoryStackLimit() { return 1; } @Override public ChromaTiles getTile() { return ChromaTiles.CHARGER; } @Override protected void animateWithTick(World world, int x, int y, int z) { if (world == null) { angle = 0; return; } int energy = this.energy.getTotalEnergy(); if (this.hasItem()) { ElementTagCompound tag = this.item().getStoredTags(inv[0]); energy += tag.getTotalEnergy(); } if (energy > 0) { angle += ReikaMathLibrary.logbase(energy, 2); if (angle >= 180) { //ReikaSoundHelper.playSound(ChromaSounds., x+0.5, y+0.5, z+0.5, 1, 1); angle -= 180; } } } @Override public int getMaxStorage(CrystalElement e) { return CAPACITY; } public boolean hasItem() { return inv[0] != null && ChromaItems.STORAGE.matchWith(inv[0]); } }
[ "reikasminecraft@gmail.com" ]
reikasminecraft@gmail.com
3f51994a8b903b86f5a4963ef6825ff3eac20f5c
5b08528bc2d20446021e8949e59cade9b67037f5
/src/main/java/com/github/sujankumarmitra/otpservice/exception/v1/OtpNotFoundException.java
a57edce70d0a6826d9b86930dd2e8379f754e979
[]
no_license
SujanKumarMitra/otp-service
e8e244793dc0612f26adf54cfbdba425942290bd
1f89d494decf6dba33b5f6432af8f634b43c9f1a
refs/heads/master
2023-04-13T00:53:30.232055
2021-04-25T03:02:30
2021-04-25T03:02:30
357,385,664
0
0
null
null
null
null
UTF-8
Java
false
false
498
java
package com.github.sujankumarmitra.otpservice.exception.v1; import com.github.sujankumarmitra.otpservice.model.v1.Otp; /** * This exception is thrown when any operation(except create) is attempted on an non-existing {@link Otp} * * @author skmitra * @version 1 */ public class OtpNotFoundException extends RuntimeException { /** * @param otpId the id of the otp */ public OtpNotFoundException(String otpId) { super("Otp with id='" + otpId + "' not found"); } }
[ "mitrakumarsujan@gmail.com" ]
mitrakumarsujan@gmail.com
4c51c4b8d391c845950e2ec2b3bba2986a31fb35
92225460ebca1bb6a594d77b6559b3629b7a94fa
/src/com/kingdee/eas/fdc/finance/IAcctConCost.java
e7402dd170e476ef58756bbe0f570e825541f184
[]
no_license
yangfan0725/sd
45182d34575381be3bbdd55f3f68854a6900a362
39ebad6e2eb76286d551a9e21967f3f5dc4880da
refs/heads/master
2023-04-29T01:56:43.770005
2023-04-24T05:41:13
2023-04-24T05:41:13
512,073,641
0
1
null
null
null
null
UTF-8
Java
false
false
2,056
java
package com.kingdee.eas.fdc.finance; import com.kingdee.bos.BOSException; //import com.kingdee.bos.metadata.*; import com.kingdee.bos.framework.*; import com.kingdee.bos.util.*; import com.kingdee.bos.Context; import java.lang.String; import com.kingdee.bos.metadata.entity.EntityViewInfo; import com.kingdee.eas.common.EASBizException; import com.kingdee.bos.dao.IObjectPK; import com.kingdee.bos.metadata.entity.SelectorItemCollection; import com.kingdee.eas.framework.CoreBaseCollection; import com.kingdee.bos.util.*; import com.kingdee.bos.metadata.entity.FilterInfo; import com.kingdee.bos.BOSException; import com.kingdee.bos.Context; import com.kingdee.eas.framework.CoreBaseInfo; import com.kingdee.bos.framework.*; import com.kingdee.eas.framework.ICoreBase; public interface IAcctConCost extends ICoreBase { public AcctConCostInfo getAcctConCostInfo(IObjectPK pk) throws BOSException, EASBizException; public AcctConCostInfo getAcctConCostInfo(IObjectPK pk, SelectorItemCollection selector) throws BOSException, EASBizException; public AcctConCostInfo getAcctConCostInfo(String oql) throws BOSException, EASBizException; public void update(IObjectPK pk, AcctConCostInfo model) throws BOSException, EASBizException; public void updatePartial(AcctConCostInfo model, SelectorItemCollection selector) throws BOSException, EASBizException; public void updateBigObject(IObjectPK pk, AcctConCostInfo model) throws BOSException; public void delete(IObjectPK pk) throws BOSException, EASBizException; public AcctConCostCollection getAcctConCostCollection() throws BOSException; public AcctConCostCollection getAcctConCostCollection(EntityViewInfo view) throws BOSException; public AcctConCostCollection getAcctConCostCollection(String oql) throws BOSException; public IObjectPK[] delete(FilterInfo filter) throws BOSException, EASBizException; public IObjectPK[] delete(String oql) throws BOSException, EASBizException; public void delete(IObjectPK[] arrayPK) throws BOSException, EASBizException; }
[ "yfsmile@qq.com" ]
yfsmile@qq.com
3506e3eb57571303d09aade267690f49780b85ad
bdba2f681a4afae15dbb721211885651ed84d5ff
/src/main/java/com/springboot/whb/study/rpc/rpc_v2/core/RpcService.java
fa585699dca8bb1af7c26b2b95552c318a9dcc79
[]
no_license
whb1990/springboot-study
f699f667f218fe8836d2231dde4044292fe2e751
9d2f9dbaee050c2a06a999b061c41c5d209aae01
refs/heads/master
2022-06-27T12:40:14.531140
2019-11-04T08:10:39
2019-11-04T08:10:39
196,312,743
1
0
null
2022-06-17T02:16:22
2019-07-11T03:22:57
Java
UTF-8
Java
false
false
4,692
java
package com.springboot.whb.study.rpc.rpc_v2.core; import com.google.common.base.Joiner; import com.springboot.whb.study.rpc.rpc_v2.config.ServiceConfig; import com.springboot.whb.study.rpc.rpc_v2.io.protocol.DefaultMessageProtocol; import com.springboot.whb.study.rpc.rpc_v2.io.protocol.MessageProtocol; import com.springboot.whb.study.rpc.rpc_v2.register.ServiceRegister; import com.springboot.whb.study.rpc.rpc_v2.register.ZkServiceRegister; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.concurrent.BasicThreadFactory; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * @author: whb * @date: 2019/8/19 9:57 * @description: RPC服务 */ @Slf4j @Data public class RpcService { /** * k 是接口全名称 * v 是对应的对象包含的详细信息 */ private Map<String, ServiceConfig> serviceConfigMap = new HashMap<>(); /** * 端口号 */ private int port; /** * 服务注册 */ private ServiceRegister serviceRegister; /** * 连接器还未抽象处理,使用的还是BIO模型 */ private ServiceConnection serviceConnection; /** * 服务处理器 */ private ServiceHandler serviceHandler; /** * 线程池 */ ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10, 100, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(1000), new BasicThreadFactory.Builder().namingPattern(Joiner.on("-").join("service-thread-pool-", "%s")).build()); public RpcService(int port) { this.port = port; this.serviceHandler = new ServiceHandler(this); this.serviceHandler.setMessageProtocol(new DefaultMessageProtocol()); this.serviceRegister = new ZkServiceRegister(); } /** * 设置消息协议 * * @param messageProtocol */ public void setMessageProtocol(MessageProtocol messageProtocol) { if (this.serviceHandler == null) { throw new RuntimeException("套接字处理器无效"); } this.serviceHandler.setMessageProtocol(messageProtocol); } /** * 添加服务接口 * * @param interfaceClass * @param ref * @param <T> */ public <T> void addService(Class<T> interfaceClass, T ref) { String interfaceName = interfaceClass.getName(); ServiceConfig<T> serviceConfig = ServiceConfig.convert(interfaceName, interfaceClass, ref, this); serviceConfigMap.put(interfaceName, serviceConfig); } /** * 注册服务 */ private void register() { //服务注册,在网络监听启动之前就需要完成 serviceConfigMap.values().forEach(serviceRegister::register); } /** * 服务启动 */ public void start() { this.register(); log.info("服务注册完成"); this.serviceConnection = new ServiceConnection(); this.serviceConnection.init(port, serviceHandler); threadPoolExecutor.execute(serviceConnection); //优雅关闭 Runtime.getRuntime().addShutdownHook(new Thread(() -> { RpcService.this.destroy(); })); } /** * 通过反射执行,执行结果封装RpcResponse * * @param request * @param <K> * @param <V> * @return */ public <K, V> RpcResponse invoke(RpcRequest request) { if (request == null) { RpcResponse<V> response = new RpcResponse<>(); response.setResult(null); response.setIsError(true); response.setErrorMsg("未知异常"); return response; } String className = request.getClassName(); //暂时不考虑没有对应的serviceConfig的情况 ServiceConfig<K> serviceConfig = serviceConfigMap.get(className); K ref = serviceConfig.getRef(); try { Method method = ref.getClass().getMethod(request.getMethodName(), request.getParameterTypes()); V result = (V) method.invoke(ref, request.getArguments()); RpcResponse<V> response = new RpcResponse<>(); response.setResult(result); response.setIsError(false); response.setErrorMsg(""); return response; } catch (Exception e) { } return null; } /** * 关闭服务 */ public void destroy() { this.serviceConnection.destory(); log.info("服务端关闭了"); } }
[ "270028806@qq.com" ]
270028806@qq.com
62d6740525fb46ce83c2dda102ea7012b88477a7
36bf98918aebe18c97381705bbd0998dd67e356f
/projects/aspectj-1.6.9/aspectjtools1.6.9/org/aspectj/runtime/internal/cflowstack/ThreadStackFactoryImpl.java
d5d1afa51906ee15cb71ef1ff3dbe242848e180f
[]
no_license
ESSeRE-Lab/qualitas.class-corpus
cb9513f115f7d9a72410b3f5a72636d14e4853ea
940f5f2cf0b3dc4bd159cbfd49d5c1ee4d06d213
refs/heads/master
2020-12-24T21:22:32.381385
2016-05-17T14:03:21
2016-05-17T14:03:21
59,008,169
2
1
null
null
null
null
UTF-8
Java
false
false
1,544
java
/* ******************************************************************* * Copyright (c) 2004 IBM Corporation * * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Andy Clement initial implementation * ******************************************************************/ package org.aspectj.runtime.internal.cflowstack; import java.util.Stack; public class ThreadStackFactoryImpl implements ThreadStackFactory { private static class ThreadStackImpl extends ThreadLocal implements ThreadStack { public Object initialValue() { return new Stack(); } public Stack getThreadStack() { return (Stack)get(); } } public ThreadStack getNewThreadStack() { return new ThreadStackImpl(); } private static class ThreadCounterImpl extends ThreadLocal implements ThreadCounter { public Object initialValue() { return new Counter(); } public Counter getThreadCounter() { return (Counter)get(); } public void inc() { getThreadCounter().value++; } public void dec() { getThreadCounter().value--; } public boolean isNotZero() { return getThreadCounter().value!= 0; } static class Counter { protected int value = 0; } } public ThreadCounter getNewThreadCounter() { return new ThreadCounterImpl(); } }
[ "marco.zanoni@disco.unimib.it" ]
marco.zanoni@disco.unimib.it
18d89d85e964435e0a22cd6d0747d6f2c03a88eb
2a59a003262c12b198a9c6240d892b30e94b74b2
/src/main/java/com/lvcyong/application/config/LocaleConfiguration.java
174826e1724c57529ea621af11f9fa29e1f96c3c
[]
no_license
lvcyong/jhipster-monolithic-react
c45fb33b915e45b2783694aac4b6bf86c21837ea
b2d546ed83ee56529d697eda0861139d010aeeab
refs/heads/master
2020-04-17T10:44:06.137070
2019-01-19T05:57:36
2019-01-19T05:57:36
166,511,896
0
0
null
2019-01-19T06:08:32
2019-01-19T05:57:26
Java
UTF-8
Java
false
false
1,066
java
package com.lvcyong.application.config; import io.github.jhipster.config.locale.AngularCookieLocaleResolver; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.config.annotation.*; import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; @Configuration public class LocaleConfiguration implements WebMvcConfigurer { @Bean(name = "localeResolver") public LocaleResolver localeResolver() { AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver(); cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY"); return cookieLocaleResolver; } @Override public void addInterceptors(InterceptorRegistry registry) { LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); localeChangeInterceptor.setParamName("language"); registry.addInterceptor(localeChangeInterceptor); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
9620f0973f73d7ff1536ac3dd4b02414f858ace2
1274a14cafff5c4394a70e9623c45c1dddb5ec26
/programming-practice/src/main/java/challenges/leetcode/BuildingH2O.java
57c319c63ca9c10f2838c8adc064146137cd81c6
[]
no_license
Itsmayank10/algorithms-design-and-analysis
b9c2658145401f75d01844b03de6deeca9b9b193
03ef86de66f25fbf108e64e7b901535b4b844a8d
refs/heads/master
2023-01-02T09:54:18.321985
2019-09-21T05:02:55
2019-09-21T05:02:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,910
java
package challenges.leetcode; import challenges.AbstractCustomTestRunner; import java.util.concurrent.Semaphore; /** * 1117. Building H2O * * There are two kinds of threads, oxygen and hydrogen. Your goal is to group these threads to form water molecules. There is a barrier where each thread has to * wait until a complete molecule can be formed. Hydrogen and oxygen threads will be given releaseHydrogen and releaseOxygen methods respectively, which will allow * them to pass the barrier. These threads should pass the barrier in groups of three, and they must be able to immediately bond with each other to form a water * molecule. You must guarantee that all the threads from one molecule bond before any other threads from the next molecule do. * * In other words: * If an oxygen thread arrives at the barrier when no hydrogen threads are present, it has to wait for two hydrogen threads. * If a hydrogen thread arrives at the barrier when no other threads are present, it has to wait for an oxygen thread and another hydrogen thread. * We don’t have to worry about matching the threads up explicitly; that is, the threads do not necessarily know which other threads they are paired up with. * The key is just that threads pass the barrier in complete sets; thus, if we examine the sequence of threads that bond and divide them into groups of three, * each group should contain one oxygen and two hydrogen threads. * * Write synchronization code for oxygen and hydrogen molecules that enforces these constraints. * * Example 1: * Input: "HOH" * Output: "HHO" * Explanation: "HOH" and "OHH" are also valid answers. * * Example 2: * Input: "OOHHHH" * Output: "HHOHHO" * Explanation: "HOHHHO", "OHHHHO", "HHOHOH", "HOHHOH", "OHHHOH", "HHOOHH", "HOHOHH" and "OHHOHH" are also valid answers. * * Constraints: * Total length of input string will be 3n, where 1 ≤ n ≤ 20. * Total number of H will be 2n in the input string. * Total number of O will be n in the input string. * * @author Hxkandwal */ public class BuildingH2O extends AbstractCustomTestRunner { class H2OCheckRelease { private Semaphore hydrogenSemaphore; private Semaphore oxygenSemaphore; public H2OCheckRelease() { hydrogenSemaphore = new Semaphore(2); oxygenSemaphore = new Semaphore(0); } public void hydrogen(Runnable releaseHydrogen) throws InterruptedException { hydrogenSemaphore.acquire(); // releaseHydrogen.run() outputs "H". Do not change or remove this line. releaseHydrogen.run(); if (hydrogenSemaphore.availablePermits() == 0) oxygenSemaphore.release(); } public void oxygen(Runnable releaseOxygen) throws InterruptedException { oxygenSemaphore.acquire(); // releaseOxygen.run() outputs "O". Do not change or remove this line. releaseOxygen.run(); hydrogenSemaphore.release(2); } } class H2OMultiAcquireRelease { private Semaphore hydrogenSemaphore; private Semaphore oxygenSemaphore; public H2OMultiAcquireRelease() { hydrogenSemaphore = new Semaphore(2); oxygenSemaphore = new Semaphore(0); } public void hydrogen(Runnable releaseHydrogen) throws InterruptedException { hydrogenSemaphore.acquire(); // releaseHydrogen.run() outputs "H". Do not change or remove this line. releaseHydrogen.run(); oxygenSemaphore.release(); } public void oxygen(Runnable releaseOxygen) throws InterruptedException { oxygenSemaphore.acquire(2); // releaseOxygen.run() outputs "O". Do not change or remove this line. releaseOxygen.run(); hydrogenSemaphore.release(2); } } }
[ "himanshuk.19@gmail.com" ]
himanshuk.19@gmail.com
1ee4c9c39bde96509afc40e498bca2316cbdf506
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdas/applicationModule/src/test/java/applicationModulepackageJava8/Foo756Test.java
5bc9ad161e60ec1470399246160ff387813839b6
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
481
java
package applicationModulepackageJava8; import org.junit.Test; public class Foo756Test { @Test public void testFoo0() { new Foo756().foo0(); } @Test public void testFoo1() { new Foo756().foo1(); } @Test public void testFoo2() { new Foo756().foo2(); } @Test public void testFoo3() { new Foo756().foo3(); } @Test public void testFoo4() { new Foo756().foo4(); } @Test public void testFoo5() { new Foo756().foo5(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
908bf95fb974c087fbe5107bb4fc87b43bc294e7
69cd40059a7a1ecb41af4e70662982f9d66ef651
/app/src/main/java/com/example/kotlindemo/activity/NativePageActivity.java
a2ffb20eed572b4dc4d4ea9f5e330cd7f1733f5a
[]
no_license
haibowen/ZeroToOne
078a2ca93f64977901b4256e3e6d9d3ea66f63db
ddb581215164f9c995252c05b7bc65c9aa2d345e
refs/heads/master
2023-07-11T20:48:04.032140
2021-04-29T01:29:20
2021-04-29T01:29:20
344,458,071
0
0
null
null
null
null
UTF-8
Java
false
false
2,206
java
package com.example.kotlindemo.activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TextView; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import com.example.kotlindemo.R; import com.idlefish.flutterboost.FlutterBoost; import com.idlefish.flutterboost.containers.FlutterBoostActivity; import java.util.HashMap; import io.flutter.embedding.android.FlutterActivityLaunchConfigs; public class NativePageActivity extends AppCompatActivity implements View.OnClickListener { private TextView mOpenNative; private TextView mOpenFlutter; private TextView mOpenFlutterFragment; @Override protected void onResume() { super.onResume(); } @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.native_page); mOpenNative = findViewById(R.id.open_native); mOpenFlutter = findViewById(R.id.open_flutter); // mOpenFlutterFragment = findViewById(R.id.open_flutter_fragment); mOpenNative.setOnClickListener(this); mOpenFlutter.setOnClickListener(this); // mOpenFlutterFragment.setOnClickListener(this); } @Override public void onClick(View v) { HashMap<String, Object> params = new HashMap<>(); params.put("test1","v_test1"); params.put("test2","v_test2"); if (v == mOpenNative) { NativeRouter.openPageByUrl(this, NativeRouter.NATIVE_PAGE_URL,params); } else if (v == mOpenFlutter) { Intent intent = new FlutterBoostActivity.CachedEngineIntentBuilder(FlutterBoostActivity.class, FlutterBoost.ENGINE_ID) .backgroundMode(FlutterActivityLaunchConfigs.BackgroundMode.opaque) .destroyEngineWithActivity(false) .url("flutterPage") .urlParams(params) .build(this); startActivity(intent); } else if (v == mOpenFlutterFragment) { NativeRouter.openPageByUrl(this, NativeRouter.FLUTTER_FRAGMENT_PAGE_URL,params); } } }
[ "password" ]
password
37bc634da0d062d2915deeeb833f4016e5072a1d
222c56bda708da134203560d979fb90ba1a9da8d
/uapunit测试框架/modeler/src/client/uap/workflow/modeler/uecomponent/Notation.java
5bd1213de7d16782f0f4c25a0d4b214b35ea6b1f
[]
no_license
langpf1/uapunit
7575b8a1da2ebed098d67a013c7342599ef10ced
c7f616bede32bdc1c667ea0744825e5b8b6a69da
refs/heads/master
2020-04-15T00:51:38.937211
2013-09-13T04:58:27
2013-09-13T04:58:27
12,448,060
0
1
null
null
null
null
UTF-8
Java
false
false
391
java
package uap.workflow.modeler.uecomponent; import javax.swing.ImageIcon; import javax.swing.JLabel; public class Notation extends JLabel { private String notationGroup; public Notation(ImageIcon icon) { super(icon); } public String getNotationGroup() { return notationGroup; } public void setNotationGroup(String notationGroup) { this.notationGroup = notationGroup; } }
[ "langpf1@yonyou.com" ]
langpf1@yonyou.com
360e275f1885785045d1b5cbc52a84570ffbcdcb
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Chart/17/org/jfree/chart/entity/ChartEntity_readObject_406.java
83e8740df0c80276a25e060e7d62b0bfa94d5ade
[]
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
861
java
org jfree chart entiti captur inform compon chart bar line chart entiti chartent cloneabl public cloneabl publicclon serializ serial support param stream input stream except ioexcept error class found except classnotfoundexcept classpath problem read object readobject object input stream objectinputstream stream except ioexcept class found except classnotfoundexcept stream read object defaultreadobject area serial util serialutil read shape readshap stream
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
8ad0e77bff6a3c2d5fbb84cafc99e60989ff30ef
2824daf9890092bd737293e39ef6dc86a621ff0d
/src/main/java/week13/d05/MultipleLineWriter.java
15868feb5c74da97e5a22d08a5c648ac155b8860
[]
no_license
Lipek71/training-solutions
b445f075bec762d1eac40a4b71c68c622a7840c7
64598d9a483bb545f691106000817425194cb358
refs/heads/master
2023-03-11T11:12:25.019437
2021-02-22T23:57:47
2021-02-22T23:57:47
309,207,145
0
0
null
null
null
null
UTF-8
Java
false
false
309
java
package week13.d05; public class MultipleLineWriter implements LineWriter { @Override public String writeLine(BillItem item) { return String.format("%13s %5d * %d = %6d", item.getName(), item.getNumber(), item.getUnitPrice(), item.getNumber() * item.getUnitPrice()); } }
[ "lipek71@gmail.com" ]
lipek71@gmail.com
96fbc103af7837f8670b2a1e657484aaa4e27cfb
33322577b1cecb1635bf18d88eeeea8592e98c14
/main/src/test/java/io/novaordis/events/log4j/impl/ParsersTest.java
e95f6a5a93cde8eb0a013db959e34939634d203d
[ "Apache-2.0" ]
permissive
ovidiuf/events-log4j-parser
8c8b1b0015a4037797737a491779d686b0ddca65
3adba9b3b9ef418f7958456c3fa4d5b9fe281643
refs/heads/master
2021-09-04T18:54:11.162199
2018-01-21T10:30:19
2018-01-21T10:30:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,736
java
/* * Copyright (c) 2017 Nova Ordis LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.novaordis.events.log4j.impl; import org.junit.Test; import io.novaordis.utilities.parsing.ParsingException; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; /** * @author Ovidiu Feodorov <ovidiu@novaordis.com> * @since 6/2/17 */ public class ParsersTest { // Constants ------------------------------------------------------------------------------------------------------- // Static ---------------------------------------------------------------------------------------------------------- // Attributes ------------------------------------------------------------------------------------------------------ // Constructors ---------------------------------------------------------------------------------------------------- // Public ---------------------------------------------------------------------------------------------------------- // Tests ----------------------------------------------------------------------------------------------------------- // find() ---------------------------------------------------------------------------------------------------------- @Test public void find_NoCategory() throws Exception { ParsingResult r = Parsers.find("blah", 0, '[', ']', 1L); assertNull(r); } @Test public void find() throws Exception { ParsingResult r = Parsers.find(" something [this is what we expect] something else", 0, '[', ']', 1L); assertNotNull(r); assertEquals("this is what we expect", r.getValue()); assertEquals(35, r.getNext()); } @Test public void find_NestedBrackets() throws Exception { ParsingResult r = Parsers.find(" blah [this [is [what] we] [expect]] something else", 0, '[', ']', 1L); assertNotNull(r); assertEquals("this [is [what] we] [expect]", r.getValue()); assertEquals(36, r.getNext()); } @Test public void find_UnbalancedNestedBracketsNotPartOfCategory() throws Exception { ParsingResult r = Parsers.find("blah [ blah2 ] ] something else", 0, '[', ']', 1L); assertNotNull(r); assertEquals(" blah2 ", r.getValue()); assertEquals(14, r.getNext()); } @Test public void find_UnbalancedNestedBrackets() throws Exception { try { Parsers.find(" blah [ ", 0, '[', ']', 7L); fail("should have thrown exception"); } catch(ParsingException e) { String msg = e.getMessage(); assertTrue(msg.contains("unbalanced")); assertTrue(msg.contains("[")); assertTrue(msg.contains("]")); assertEquals(7L, e.getLineNumber().longValue()); // where the bracket sequence starts assertEquals(6, e.getPositionInLine().intValue()); } } @Test public void find_UnbalancedNestedBrackets2() throws Exception { try { Parsers.find(" blah [ something [ something else ] ", 0, '[', ']', 7L); fail("should have thrown exception"); } catch(ParsingException e) { String msg = e.getMessage(); assertTrue(msg.contains("unbalanced")); assertTrue(msg.contains("[")); assertTrue(msg.contains("]")); assertEquals(7L, e.getLineNumber().longValue());; // where the bracket sequence starts assertEquals(6, e.getPositionInLine().intValue()); } } // Package protected ----------------------------------------------------------------------------------------------- // Protected ------------------------------------------------------------------------------------------------------- // Private --------------------------------------------------------------------------------------------------------- // Inner classes --------------------------------------------------------------------------------------------------- }
[ "ovidiu@novaordis.com" ]
ovidiu@novaordis.com
237850e15103d909ec036dfe3e0a2b936231ca2a
ee829d74c1c8ef4e0da952851add2d30c601fa65
/src/tw/brad/bradjava/Brad43.java
1cc05bc706393d9d6b5910f7b5b1bc0d08d7e9f1
[]
no_license
mesa5/bradjava
9a7adcc21ad5610d9371af197c3bc7a4a0395c1e
80e57d1ec0d3f2d6993c49f97e5499fb253dd13e
refs/heads/master
2020-05-21T23:48:18.803986
2016-09-25T02:46:00
2016-09-25T02:46:00
65,650,464
0
0
null
null
null
null
UTF-8
Java
false
false
450
java
package tw.brad.bradjava; // Exception Call Stack public class Brad43 { public static void main(String[] args){ Brad433 obj1 = new Brad433(); try{ obj1.m3(); }catch (Exception ee){ } } } class Brad431 { void m1()throws Exception{ throw new Exception(); } } class Brad432 extends Brad431 { void m2() throws Exception{ m1(); } } class Brad433 extends Brad432 { void m3() throws Exception{ m2(); } }
[ "brad@brad.tw" ]
brad@brad.tw
0d57b8fc78ebef652a896086aec30ccde8ade808
434babe03baa725a416473d64068fea0e60e9c01
/src/admin/ks/MyAdminKsOne.java
0805697ee446263b9d8ccda670f2de843ea17925
[]
no_license
dragonfeng12138/CA_Exam
2aa614ec1e2f6924b7b34dc29953b3f4c8c563ab
2e2d5a60013bc75b8a55b8421d81f265fd01b31f
refs/heads/master
2023-06-01T11:11:59.071427
2021-06-20T09:01:50
2021-06-20T09:01:50
378,601,382
0
0
null
null
null
null
GB18030
Java
false
false
2,944
java
package admin.ks; import java.awt.BorderLayout; import java.awt.Font; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.util.LinkedList; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.UIManager; import javax.swing.table.DefaultTableModel; import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper; import SqlLink.*; import manage.Kstm; public class MyAdminKsOne extends JFrame implements ActionListener { JPanel p1, p2; ImageIcon icon; JButton b1,b2; JTable table; JScrollPane pane; KstmCon dao; JLabel l1; Kstm ks; int no; public MyAdminKsOne(int no) { this.no = no; icon = new ImageIcon("img/log/logo.png"); l1=new JLabel("考试信息"); dao=new KstmCon(); p1=new JPanel(); p2=new JPanel(); b1=new JButton("确定"); b2=new JButton("下载"); table=new JTable(); pane=new JScrollPane(table); b1.addActionListener(this); b2.addActionListener(this); p1.add(l1); p2.add(b1); p2.add(b2); this.add(p1,BorderLayout.NORTH); this.add(pane,BorderLayout.CENTER); this.add(p2,BorderLayout.SOUTH); this.setTitle("Admin"); this.setBounds(300,300,700,500); this.setResizable(false); this.setVisible(true); //this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setIconImage(icon.getImage());// 给窗体设置图标方法 LinkedList<Kstm> list=dao.findTm(no); Object[][] content=new Object[list.size()][5]; for(int i=0;i<list.size();i++) { ks=list.get(i); content[i][0]=ks.getNo() + ""; content[i][1]=ks.getId() + ""; content[i][2]=ks.getFen() + ""; content[i][3]=ks.getT() + ""; content[i][4]=ks.getF() + ""; } Object head[]={"题号","原题号","分值", "正确数", "错误数"}; DefaultTableModel dtm=(DefaultTableModel)table.getModel(); dtm.setDataVector(content, head); } @Override public void actionPerformed(ActionEvent e) { // TODO 自动生成的方法存根 Object obj = e.getSource(); if(obj == b1) { this.dispose(); return; } else if(obj == b2) { try { new MyAdminKsOneExc(no).generateReport(); } catch (Exception e1) { // TODO 自动生成的 catch 块 e1.printStackTrace(); }; JOptionPane.showMessageDialog(this, "下载成功"); return; } } public static void main(String args[]) { try { BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.translucencySmallShadow; org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF(); } catch(Exception e) { //TODO exception } UIManager.put("RootPane.setupButtonVisible", false); new MyAdminKsOne(1001); } }
[ "email@example.com" ]
email@example.com
31dccb4acfd3cf3cf633b72075c233054d0c4a07
ac82c09fd704b2288cef8342bde6d66f200eeb0d
/projects/OG-Analytics/src/main/java/com/opengamma/analytics/math/differentiation/ScalarFirstOrderDifferentiator.java
2d0a90e50755a9edff03080eab3397b5a374c4d2
[ "Apache-2.0" ]
permissive
cobaltblueocean/OG-Platform
88f1a6a94f76d7f589fb8fbacb3f26502835d7bb
9b78891139503d8c6aecdeadc4d583b23a0cc0f2
refs/heads/master
2021-08-26T00:44:27.315546
2018-02-23T20:12:08
2018-02-23T20:12:08
241,467,299
0
2
Apache-2.0
2021-08-02T17:20:41
2020-02-18T21:05:35
Java
UTF-8
Java
false
false
5,435
java
/** * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.math.differentiation; import org.apache.commons.lang.Validate; import com.opengamma.analytics.math.MathException; import com.opengamma.analytics.math.function.Function1D; import com.opengamma.util.ArgumentChecker; /** * Differentiates a scalar function with respect to its argument using finite difference. * <p> * For a function $y = f(x)$ where $x$ and $y$ are scalars, this class produces * a gradient function $g(x)$, i.e. a function that returns the gradient for * each point $x$, where $g$ is the scalar $\frac{dy}{dx}$. */ public class ScalarFirstOrderDifferentiator implements Differentiator<Double, Double, Double> { private static final double DEFAULT_EPS = 1e-5; private static final double MIN_EPS = Math.sqrt(Double.MIN_NORMAL); private static final FiniteDifferenceType DIFF_TYPE = FiniteDifferenceType.CENTRAL; private final double _eps; private final double _twoEps; private final FiniteDifferenceType _differenceType; /** * Uses the default values of differencing type (central) and eps (10<sup>-5</sup>). */ public ScalarFirstOrderDifferentiator() { this(DIFF_TYPE, DEFAULT_EPS); } /** * Uses the default value of eps (10<sup>-5</sup>) * @param differenceType The differencing type to be used in calculating the gradient function */ public ScalarFirstOrderDifferentiator(final FiniteDifferenceType differenceType) { this(differenceType, DEFAULT_EPS); } /** * @param differenceType {@link FiniteDifferenceType#FORWARD}, {@link FiniteDifferenceType#BACKWARD}, or {@link FiniteDifferenceType#CENTRAL}. In most situations, * {@link FiniteDifferenceType#CENTRAL} is preferable. Not null * @param eps The step size used to approximate the derivative. If this value is too small, the result will most likely be dominated by noise. * Use around 10<sup>5</sup> times the domain size. */ public ScalarFirstOrderDifferentiator(final FiniteDifferenceType differenceType, final double eps) { Validate.notNull(differenceType); if (eps < MIN_EPS) { throw new IllegalArgumentException("eps is too small. A good value is 1e-5*size of domain. The minimum value is " + MIN_EPS); } _differenceType = differenceType; _eps = eps; _twoEps = 2 * _eps; } @Override public Function1D<Double, Double> differentiate(final Function1D<Double, Double> function) { Validate.notNull(function); switch (_differenceType) { case FORWARD: return new Function1D<Double, Double>() { @SuppressWarnings("synthetic-access") @Override public Double evaluate(final Double x) { Validate.notNull(x, "x"); return (function.evaluate(x + _eps) - function.evaluate(x)) / _eps; } }; case CENTRAL: return new Function1D<Double, Double>() { @SuppressWarnings("synthetic-access") @Override public Double evaluate(final Double x) { Validate.notNull(x, "x"); return (function.evaluate(x + _eps) - function.evaluate(x - _eps)) / _twoEps; } }; case BACKWARD: return new Function1D<Double, Double>() { @SuppressWarnings("synthetic-access") @Override public Double evaluate(final Double x) { Validate.notNull(x, "x"); return (function.evaluate(x) - function.evaluate(x - _eps)) / _eps; } }; default: throw new IllegalArgumentException("Can only handle forward, backward and central differencing"); } } @Override public Function1D<Double, Double> differentiate(final Function1D<Double, Double> function, final Function1D<Double, Boolean> domain) { Validate.notNull(function); Validate.notNull(domain); final double[] wFwd = new double[] {-3. / _twoEps, 4. / _twoEps, -1. / _twoEps }; final double[] wCent = new double[] {-1. / _twoEps, 0., 1. / _twoEps }; final double[] wBack = new double[] {1. / _twoEps, -4. / _twoEps, 3. / _twoEps }; return new Function1D<Double, Double>() { @SuppressWarnings("synthetic-access") @Override public Double evaluate(final Double x) { Validate.notNull(x, "x"); ArgumentChecker.isTrue(domain.evaluate(x), "point {} is not in the function domain", x.toString()); final double[] y = new double[3]; double[] w; if (!domain.evaluate(x + _eps)) { if (!domain.evaluate(x - _eps)) { throw new MathException("cannot get derivative at point " + x.toString()); } y[0] = function.evaluate(x - _twoEps); y[1] = function.evaluate(x - _eps); y[2] = function.evaluate(x); w = wBack; } else { if (!domain.evaluate(x - _eps)) { y[0] = function.evaluate(x); y[1] = function.evaluate(x + _eps); y[2] = function.evaluate(x + _twoEps); w = wFwd; } else { y[0] = function.evaluate(x - _eps); y[2] = function.evaluate(x + _eps); w = wCent; } } double res = y[0] * w[0] + y[2] * w[2]; if (w[1] != 0) { res += y[1] * w[1]; } return res; } }; } }
[ "cobaltblue.ocean@gmail.com" ]
cobaltblue.ocean@gmail.com
a32b5decec79112fc18c3447f3f82779fe6b7901
7e713646a0619267b421aafa41a9afeeaf7a0108
/src/main/java/com/gdztyy/inca/service/IPubEntryService.java
cf7de726bfc3e62a99e04e2f6d9bf8d68929a6aa
[]
no_license
liutaota/ipl
4757e35d1100ca892f2137b690ee4b43b908dc19
9d53b9044ba56b6ea65f1347a779d4b66e075bea
refs/heads/master
2023-03-21T11:28:42.663574
2021-03-05T08:49:33
2021-03-05T08:49:33
344,747,852
0
0
null
null
null
null
UTF-8
Java
false
false
279
java
package com.gdztyy.inca.service; import com.gdztyy.inca.entity.PubEntry; import com.baomidou.mybatisplus.extension.service.IService; /** * <p> * 服务类 * </p> * * @author peiqy * @since 2020-08-18 */ public interface IPubEntryService extends IService<PubEntry> { }
[ "liutao@qq.com" ]
liutao@qq.com
461106f74d4d6b7d2f5b7cc90830bdbcedb1db76
09b9ef9f4d622d8c4aedb82be4d520f92a683d0f
/net.sf.anathema.charms/src/net/sf/anathema/charms/xml/traits/TraitedCharm.java
3e44e8135047ee49f704c2331bfed6ab5c5b5f2e
[]
no_license
anathema/anathema-rcp
a10491b7b3eae5d6cce2c7eb480110f741a86dd4
558a47659a96a7065ab703d43740a353b43e96de
refs/heads/master
2020-02-26T14:50:50.304707
2009-10-20T11:12:27
2009-10-20T11:12:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,459
java
package net.sf.anathema.charms.xml.traits; import net.sf.anathema.charms.traits.CharmTraits; import net.sf.anathema.charms.tree.ICharmId; import net.sf.anathema.lib.exception.PersistenceException; import net.sf.anathema.lib.xml.ElementUtilities; import org.dom4j.Element; public class TraitedCharm implements ITraitedCharm { private static final String ATTRIB_PRIMARY_MINIMUM = "primaryMinimum"; //$NON-NLS-1$ private static final String ATTRIB_ESSENCE_MINIMUM = "essenceMinimum"; //$NON-NLS-1$ private static final String ATTRIB_CHARM_ID = "charmId"; //$NON-NLS-1$ private final Element charmTraitsElement; public TraitedCharm(Element charmTraitsElement) { this.charmTraitsElement = charmTraitsElement; } @Override public CharmTraits createDto() throws PersistenceException { CharmTraits charmTraits = new CharmTraits(); charmTraits.essenceMinimum = getValue(ATTRIB_ESSENCE_MINIMUM); charmTraits.primaryMinimum = getValue(ATTRIB_PRIMARY_MINIMUM); return charmTraits; } private int getValue(String attributeName) throws PersistenceException { return ElementUtilities.getIntAttrib(charmTraitsElement, attributeName, 1); } @Override public boolean hasId(ICharmId charmId) { String charmIdAttribute = charmTraitsElement.attributeValue(ATTRIB_CHARM_ID); String charmIdPattern = charmId.getIdPattern(); return charmIdAttribute.equals(charmIdPattern); } }
[ "sandra.sieroux@googlemail.com" ]
sandra.sieroux@googlemail.com
1156c97127bfa460300b960f9aa8f9420c49c96d
d974af1ea3a31566644e595a2f9fab3c7209ace1
/src/programmers_level2/WordRelay.java
216b4b578c463500ffb9534d780aede82713f1dd
[]
no_license
banjjoknim/codingTest
2930993db865e1c8fda18a9a8573c773d6c9b068
b5b1da8763b4edac488d4831ed7c0730efe6b193
refs/heads/master
2023-06-05T21:37:27.295251
2021-06-22T07:31:14
2021-06-22T07:31:14
287,068,121
0
0
null
null
null
null
UTF-8
Java
false
false
1,677
java
package programmers_level2; import java.util.ArrayList; import java.util.Arrays; import java.util.List; // 영어 끝말잇기 // 22시 53분 시작. 23시 25분 완료. public class WordRelay { public int[] solution(int n, String[] words) { int[] answer = new int[2]; int size = 0; int[] numbers = new int[n]; numbers[0] = n; for (int i = 1; i < n; i++) { numbers[i] = i; } List<String> list = new ArrayList<>(); while (size < words.length) { String nowWord = words[size]; if (!list.isEmpty()) { String lastWord = list.get(list.size() - 1); if (lastWord.charAt(lastWord.length() - 1) != nowWord.charAt(0)) { break; } } if (!list.contains(nowWord)) { list.add(nowWord); size++; continue; } break; } if (size == words.length) { return new int[]{0, 0}; } answer[0] = numbers[(size + 1) % n]; answer[1] = (int) Math.ceil((size + 1) / (double) n); return answer; } public static void main(String[] args) { WordRelay wordRelay = new WordRelay(); int n = 3; int n2 = 2; String[] words = {"tank", "kick", "know", "wheel", "land", "dream", "mother", "robot", "tank"}; String[] words2 = {"hello", "one", "even", "never", "now", "world", "draw"}; System.out.println(Arrays.toString(wordRelay.solution(n, words))); System.out.println(Arrays.toString(wordRelay.solution(n2, words2))); } }
[ "zhfxmtkachdt@daum.net" ]
zhfxmtkachdt@daum.net
1d79d2d83198514c8e4f069f02028b5d1b19f567
06056f2f45e72419c7f4b11c97be29d3ac0804ab
/app/src/main/java/com/rachel/world/data/processing/Nick.java
34a13132f0558f2b12e2906cc2b97ebb997c2e42
[]
no_license
Rachel-hsw/world
50f0d87ebd51cab1a8db819c34d797c964e8c9d6
1de3c471d29ce009b8ab6d8ff196ef4b51b0251a
refs/heads/master
2023-01-02T02:18:04.905817
2020-11-03T14:29:54
2020-11-03T14:29:54
304,267,517
1
0
null
null
null
null
UTF-8
Java
false
false
585
java
package com.rachel.world.data.processing; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import com.rachel.world.R; import com.rachel.world.view.activity.MainActivity; //底片效果 public class Nick extends MergeHandler implements BitmapProcessor { @Override public Bitmap createProcessedBitmap(Bitmap originalBitmap) { Bitmap mergeBitmap = BitmapFactory.decodeResource(MainActivity.getContext().getResources(), R.drawable.pro_nick); Bitmap processedBitmap = merge(mergeBitmap, originalBitmap, 0, 0,null,null); return processedBitmap; } }
[ "1623404291@qq.com" ]
1623404291@qq.com
28fea8be5da7ca7473c42d7171cbdfdb7fcda765
f27fa4bde5f0eff9b49760da554c95f443b85e97
/wfe-core/src/main/java/ru/runa/wfe/job/impl/CacheUsageStatisticLogger.java
e22c2547e3b5ee060428367e678656a9694434ce
[]
no_license
estet90/runawfe-server
b46958780f0afd997e965afe4ac1e705740a0d1f
1ff59f1dcbfd159c7b06227ca4b182448c8cfbf4
refs/heads/master-dkononov
2021-01-01T16:24:03.867379
2018-05-28T17:33:45
2018-05-28T17:33:45
97,826,153
0
0
null
2018-05-28T17:33:46
2017-07-20T11:11:12
Java
UTF-8
Java
false
false
1,179
java
/* * This file is part of the RUNA WFE project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; version 2.1 * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ package ru.runa.wfe.job.impl; import ru.runa.wfe.commons.TransactionalExecutor; import ru.runa.wfe.commons.cache.CacheStatistic; /** * Periodic action to drop cache usage statistic to log. * * @author Konstantinov Aleksey */ public class CacheUsageStatisticLogger extends JobTask<TransactionalExecutor> { @Override protected void execute() throws Exception { CacheStatistic.logCounters(); } }
[ "tarwirdur@ya.ru" ]
tarwirdur@ya.ru
96d5491100f6a66a04ee5586a627264adc73f675
70ab4ad77435fbd0c893a4487c21b2bd232b8b1d
/components/org.wso2.carbon.identity.oauth.dcr/src/main/java/org/wso2/carbon/identity/oauth/dcr/exception/UnRegistrationException.java
579c3ff748fa55d60ff669f45665207ffe11466c
[ "Apache-2.0" ]
permissive
janakamarasena/identity-inbound-auth-oauth-clone
47d5dd05f10b66fc72ce8e0e14fcec7cb7607ad2
cb6115d55c7256811934715c0f2d200e4cff2fb0
refs/heads/master
2022-12-20T02:48:35.448565
2020-10-24T18:49:48
2020-10-24T18:49:48
306,883,487
0
1
Apache-2.0
2020-10-24T19:33:54
2020-10-24T12:55:32
Java
UTF-8
Java
false
false
723
java
package org.wso2.carbon.identity.oauth.dcr.exception; import org.wso2.carbon.identity.oauth.dcr.DCRException; /** * Exception class used to handle exceptions occur during un registering an OAuth application. */ public class UnRegistrationException extends DCRException { public UnRegistrationException(String message) { super(message); } public UnRegistrationException(String errorCode, String message) { super(errorCode, message); } public UnRegistrationException(String message, Throwable cause) { super(message, cause); } public UnRegistrationException(String errorCode, String message, Throwable cause) { super(errorCode, message, cause); } }
[ "janakamarasena@gmail.com" ]
janakamarasena@gmail.com
725f3e3bb0b5e00f3901eeb0f4e9f8e9cb2f9506
5a90cbdba7170bdfb3f49f1094f90e8de1c9f430
/java/basic/src/main/java/strings/Replacing.java
6c69414d2d5c72e5098c873cdfffaf2340a78150
[]
no_license
dimu/fortnight
df717aecab02e1dcd70713e89bbefc92dc74aa43
42912977bd1940143ac030541730c827045ae696
refs/heads/master
2023-08-03T23:37:53.696563
2023-03-22T03:45:55
2023-03-22T03:45:55
191,578,687
0
0
null
2023-07-22T08:11:16
2019-06-12T13:40:50
Java
UTF-8
Java
false
false
552
java
package strings; //: strings/Replacing.java import static net.mindview.util.Print.*; public class Replacing { static String s = Splitting.knights; public static void main(String[] args) { print(s.replaceFirst("f\\w+", "located")); print(s.replaceAll("shrubbery|tree|herring","banana")); } } /* Output: Then, when you have located the shrubbery, you must cut down the mightiest tree in the forest... with... a herring! Then, when you have found the banana, you must cut down the mightiest banana in the forest... with... a banana! *///:~
[ "wenxiang0705@qq.com" ]
wenxiang0705@qq.com
3483fc4d0d363d35c0e0532a471cd74841f6f3d5
776b3f77f5dbd5501b94ffdc4c37d96889b6b8f9
/testlib/src/main/java/news/fan/testlib/LoginSession.java
2f3929a71197ca7803b6f273e490c632bb2a8aad
[]
no_license
kisdy502/FanNews
98d4d2da609e53831a8a09ba72dd12e8fa6be79c
24ebd204ab8e013e280e1720bd22b193abc1f19e
refs/heads/master
2021-04-27T00:22:01.863913
2018-04-04T09:58:19
2018-04-04T09:58:19
123,800,598
0
0
null
null
null
null
UTF-8
Java
false
false
704
java
package news.fan.testlib; /** * 利用原型模式实现防止其它开发人员修改User * 任然可以通过反射修改 * Created by Administrator on 2018/3/15. */ //避免DCL的耗性能写法,确保线程安全同时,延迟单例对象实例化 public class LoginSession { private static class SessionHolder { private final static LoginSession instance = new LoginSession(); } private LoginSession() { } public static LoginSession getInstance() { return SessionHolder.instance; } User loginUser; public User getLoginUser() { return loginUser.clone(); } void setLoginUser(User user) { loginUser = user; } }
[ "bwply2009@163.com" ]
bwply2009@163.com
fc204f31ac191c800e74d8eefcc36cedd847fa6c
27c885cbfe1fd99e153c9cf1d956237d125bdfa6
/halfpipe-core/src/main/java/halfpipe/logging/LogbackFactory.java
75661c5654a7e472e0ed97b67ae6834ddde2fe36
[]
no_license
agilemobiledev/halfpipe
27881e89d9783b1968492dc2a8ee471dbeb8c41f
75d7fe3958c276f52679ea8f8671bbb3c87e6d9c
refs/heads/master
2021-01-17T06:36:58.483347
2013-05-29T17:28:18
2013-05-29T17:28:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,733
java
package halfpipe.logging; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.filter.ThresholdFilter; import ch.qos.logback.classic.net.SyslogAppender; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.ConsoleAppender; import ch.qos.logback.core.FileAppender; import ch.qos.logback.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy; import ch.qos.logback.core.rolling.RollingFileAppender; import ch.qos.logback.core.rolling.TimeBasedRollingPolicy; import ch.qos.logback.core.spi.FilterAttachable; import com.google.common.base.Optional; import static halfpipe.configuration.LoggingConfiguration.*; public class LogbackFactory { private LogbackFactory() { /* singleton */ } public static SyslogAppender buildSyslogAppender(SyslogConfiguration syslog, LoggerContext context, String name, Optional<String> logFormat) { final SyslogAppender appender = new SyslogAppender(); appender.setName(name); appender.setContext(context); appender.setSyslogHost(syslog.host.get()); appender.setFacility(syslog.facility.get().toString()); addThresholdFilter(appender, syslog.threshold.get()); for (String format : logFormat.asSet()) { appender.setSuffixPattern(format); } appender.start(); return appender; } public static FileAppender<ILoggingEvent> buildFileAppender(FileConfiguration file, LoggerContext context, Optional<String> logFormat) { final LogFormatter formatter = new LogFormatter(context, file.timeZone.get()); for (String format : logFormat.asSet()) { formatter.setPattern(format); } formatter.start(); final FileAppender<ILoggingEvent> appender = file.archive.get() ? new RollingFileAppender<ILoggingEvent>() : new FileAppender<ILoggingEvent>(); appender.setAppend(true); appender.setContext(context); appender.setLayout(formatter); appender.setFile(file.currentLogFilename.get()); appender.setPrudent(false); addThresholdFilter(appender, file.threshold.get()); if (file.archive.get()) { final DefaultTimeBasedFileNamingAndTriggeringPolicy<ILoggingEvent> triggeringPolicy = new DefaultTimeBasedFileNamingAndTriggeringPolicy<ILoggingEvent>(); triggeringPolicy.setContext(context); final TimeBasedRollingPolicy<ILoggingEvent> rollingPolicy = new TimeBasedRollingPolicy<ILoggingEvent>(); rollingPolicy.setContext(context); rollingPolicy.setFileNamePattern(file.archivedLogFilenamePattern.get()); rollingPolicy.setTimeBasedFileNamingAndTriggeringPolicy( triggeringPolicy); triggeringPolicy.setTimeBasedRollingPolicy(rollingPolicy); rollingPolicy.setMaxHistory(file.archivedFileCount.get()); ((RollingFileAppender<ILoggingEvent>) appender).setRollingPolicy(rollingPolicy); ((RollingFileAppender<ILoggingEvent>) appender).setTriggeringPolicy(triggeringPolicy); rollingPolicy.setParent(appender); rollingPolicy.start(); } appender.stop(); appender.start(); return appender; } public static ConsoleAppender<ILoggingEvent> buildConsoleAppender(ConsoleConfiguration console, LoggerContext context, Optional<String> logFormat) { final LogFormatter formatter = new LogFormatter(context, console.timeZone.get()); for (String format : logFormat.asSet()) { formatter.setPattern(format); } formatter.start(); final ConsoleAppender<ILoggingEvent> appender = new ConsoleAppender<ILoggingEvent>(); appender.setContext(context); appender.setLayout(formatter); addThresholdFilter(appender, console.threshold.get()); appender.start(); return appender; } private static void addThresholdFilter(FilterAttachable<ILoggingEvent> appender, Level threshold) { final ThresholdFilter filter = new ThresholdFilter(); filter.setLevel(threshold.toString()); filter.start(); appender.addFilter(filter); } }
[ "spencer@gibb.us" ]
spencer@gibb.us
dbefff0fcd1bdb9e3d9ffa95171ec6f7e23c2e4e
36bf98918aebe18c97381705bbd0998dd67e356f
/projects/argouml-0.34/argouml/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java
17c4aba47f712f6fdfd8ffb1ea1fb20bdaa356dc
[ "BSD-3-Clause", "LicenseRef-scancode-other-permissive" ]
permissive
ESSeRE-Lab/qualitas.class-corpus
cb9513f115f7d9a72410b3f5a72636d14e4853ea
940f5f2cf0b3dc4bd159cbfd49d5c1ee4d06d213
refs/heads/master
2020-12-24T21:22:32.381385
2016-05-17T14:03:21
2016-05-17T14:03:21
59,008,169
2
1
null
null
null
null
UTF-8
Java
false
false
7,734
java
/* $Id: ProfileMeta.java 19614 2011-07-20 12:10:13Z linus $ ***************************************************************************** * Copyright (c) 2008,2010 Contributors - see below * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * maas - Initial implementation * tfmorris ***************************************************************************** * * Some portions of this file was previously release using the BSD License: */ // Copyright (c) 2008 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written // agreement is hereby granted, provided that the above copyright notice // and this paragraph appear in all copies. This software program and // documentation are copyrighted by The Regents of the University of // California. The software program and documentation are supplied "AS // IS", without any accompanying services from The Regents. The Regents // does not warrant that the operation of the program will be // uninterrupted or error-free. The end-user understands that the program // was developed for research purposes and is advised not to rely // exclusively on the program for any reason. IN NO EVENT SHALL THE // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, // UPDATES, ENHANCEMENTS, OR MODIFICATIONS. package org.argouml.profile.internal; import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.apache.log4j.Logger; import org.argouml.cognitive.Critic; import org.argouml.cognitive.ToDoItem; import org.argouml.model.Model; import org.argouml.profile.CoreProfileReference; import org.argouml.profile.Profile; import org.argouml.profile.ProfileException; import org.argouml.profile.ProfileModelLoader; import org.argouml.profile.ProfileReference; import org.argouml.profile.ResourceModelLoader; import org.argouml.profile.internal.ocl.CrOCL; import org.argouml.profile.internal.ocl.InvalidOclException; /** * Meta Profile which defines the TaggedValues to be used in User defined * Profiles * * @author maas */ public class ProfileMeta extends Profile { private static final Logger LOG = Logger.getLogger(ProfileMeta.class); private static final String PROFILE_FILE = "metaprofile.xmi"; private ProfileReference profileReference = null; private Collection model = null; Set<Critic> critics = null; /** * Creates a new instance of this profile * * @throws ProfileException if something goes wrong */ public ProfileMeta() throws ProfileException { super(); try { profileReference = new CoreProfileReference(PROFILE_FILE); } catch (MalformedURLException e) { throw new ProfileException( "Exception while creating profile reference.", e); } } private Collection getModel() { if (model == null) { ProfileModelLoader profileModelLoader = new ResourceModelLoader(); try { model = profileModelLoader.loadModel(profileReference); } catch (ProfileException e) { LOG.error("Exception loading metaprofile " + PROFILE_FILE, e); } if (model == null) { model = new ArrayList(); model.add(Model.getModelManagementFactory().createModel()); } } return model; } private void loadWellFormednessRules() { critics = new HashSet<Critic>(); try { critics.add(new CrOCL("context ModelElement inv: " + "self.taggedValue->" + "exists(x|x.type.name='Dependency') implies " + "self.stereotype->exists(x|x.name = 'Profile')", "The 'Dependency' tag definition should be applied" + " only to profiles.", null, ToDoItem.MED_PRIORITY, null, null, "http://argouml.tigris.org/")); } catch (InvalidOclException e) { e.printStackTrace(); } try { critics.add(new CrOCL("context ModelElement inv: " + "self.taggedValue->" + "exists(x|x.type.name='Figure') or " + "exists(x|x.type.name='Description') or " + "exists(x|x.type.name='i18n') or " + "exists(x|x.type.name='KnowledgeType') or " + "exists(x|x.type.name='MoreInfoURL') or " + "exists(x|x.type.name='Priority') or " + "exists(x|x.type.name='Description') or " + "exists(x|x.type.name='SupportedDecision') or " + "exists(x|x.type.name='Headline') " + "implies " + "self.stereotype->exists(x|x.name = 'Critic')", "Misuse of Metaprofile TaggedValues", "The 'Figure', 'i18n', 'KnowledgeType', 'MoreInfoURL', " + "'Priority', 'SupportedDecision', 'Description' " + "and 'Headline' tag definitions " + "should be applied only to OCL critics.", ToDoItem.MED_PRIORITY, null, null, "http://argouml.tigris.org/")); } catch (InvalidOclException e) { e.printStackTrace(); } try { critics.add(new CrOCL("context Stereotype inv: " + "self.namespace.stereotype->exists(x|x.name = 'Profile')", "Stereotypes should be declared inside a Profile. ", "Please add the <<Profile>> stereotype to " + "the containing Namespace", ToDoItem.MED_PRIORITY, null, null, "http://argouml.tigris.org/")); } catch (InvalidOclException e) { e.printStackTrace(); } setCritics(critics); } @Override public String getDisplayName() { return "MetaProfile"; } @Override public Collection getProfilePackages() throws ProfileException { return Collections.unmodifiableCollection(getModel()); } @Override public Collection<Object> getLoadedPackages() { if (model == null) { return Collections.emptyList(); } else { return Collections.unmodifiableCollection(model); } } @Override public Set<Critic> getCritics() { if (critics == null) { loadWellFormednessRules(); } return super.getCritics(); } }
[ "marco.zanoni@disco.unimib.it" ]
marco.zanoni@disco.unimib.it
4f734950b0ddc554b20f7e9bcf0f1d62a2bef845
09a2c65b4bb4b8bfb1590d395aa2cc93dbbe5d56
/CortexSE/jpf-symbc/src/examples/uberlazy/TestDynamicDispatch.java
f00896ce544184b3178a93064dfbf5cca859c5f4
[]
no_license
nunomachado/cortex-tool
0399e0f40c5eeb21cdaa55e061e687884b347518
96cb758d3f0ab9f06ef3b924020fdc8c0ca9516a
refs/heads/master
2021-05-23T02:49:10.154302
2020-12-27T11:59:16
2020-12-27T11:59:16
49,576,792
9
5
null
null
null
null
UTF-8
Java
false
false
1,252
java
// // Copyright (C) 2006 United States Government as represented by the // Administrator of the National Aeronautics and Space Administration // (NASA). All Rights Reserved. // // This software is distributed under the NASA Open Source Agreement // (NOSA), version 1.3. The NOSA has been approved by the Open Source // Initiative. See the file NOSA-1.3-JPF at the top of the distribution // directory tree for the complete NOSA document. // // THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY // KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT // LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO // SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR // A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT // THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT // DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE. // package uberlazy; import gov.nasa.jpf.symbc.Symbolic; public class TestDynamicDispatch { @Symbolic("true") Node n; public void run () { if(n != null) { n.print();; } } public static void main(String[] args) { TestDynamicDispatch dynamic = new TestDynamicDispatch(); dynamic.run(); } }
[ "nuno.machado@ist.utl.pt" ]
nuno.machado@ist.utl.pt
86c421ab7c8402a05d7c882cc4fb4e5175fc4893
d960eb9cbaea5bcd4e45ab9db1ca7e0d72c75146
/compensate/core/src/main/java/com/weweibuy/framework/compensate/annotation/EnableCompensate.java
ef09e0a1103e91e217a924ee5cf16937891f8233
[]
no_license
weweibuy/weweibuy-framework
fff0affdbcb8eba94e4bdab7efadb44522381c56
715cf6b0061659b0c88733f55170f1a6fa8b8d0b
refs/heads/master
2023-08-18T01:33:56.810364
2023-08-14T15:03:30
2023-08-14T15:03:30
177,300,316
72
27
null
2023-09-14T19:45:17
2019-03-23T14:41:07
Java
UTF-8
Java
false
false
811
java
package com.weweibuy.framework.compensate.annotation; import com.weweibuy.framework.compensate.config.CompensateAdvisorConfig; import com.weweibuy.framework.compensate.config.CompensateAutoConfiguration; import org.springframework.context.annotation.Import; import org.springframework.core.Ordered; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * @author durenhao * @date 2020/2/13 21:23 **/ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Import({CompensateAutoConfiguration.class, CompensateAdvisorConfig.class}) public @interface EnableCompensate { /** * 切面执行顺序 * * @return */ int order() default Ordered.LOWEST_PRECEDENCE; }
[ "ak514250@126.com" ]
ak514250@126.com
52cf6edbe00bd9df81b0dfc47dd2523742ba7c68
ce55e10448040cf27b4abccc9fb2b46e83ffb434
/trunk/qclive/qclive-core/src/test/java/gov/nih/nci/ncicb/tcga/dcc/qclive/common/action/ArchiveFileAdderFastTest.java
ad9bd1c2ad169288dc9de827268d63485e2486b3
[]
no_license
NCIP/tcga-sandbox-v1
0518dee6ee9e31a48c6ebddd1c10d20dca33c898
c8230c07199ddaf9d69564480ff9124782525cf5
refs/heads/master
2021-01-19T04:07:08.906026
2013-05-29T18:00:15
2013-05-29T18:00:15
87,348,860
1
7
null
null
null
null
UTF-8
Java
false
false
4,219
java
/* * Software License, Version 1.0 Copyright 2011 SRA International, Inc. * Copyright Notice. The software subject to this notice and license includes both human * readable source code form and machine readable, binary, object code form (the "caBIG * Software"). * * Please refer to the complete License text for full details at the root of the project. */ package gov.nih.nci.ncicb.tcga.dcc.qclive.common.action; import gov.nih.nci.ncicb.tcga.dcc.ConstantValues; import gov.nih.nci.ncicb.tcga.dcc.common.bean.Archive; import gov.nih.nci.ncicb.tcga.dcc.qclive.bean.Experiment; import gov.nih.nci.ncicb.tcga.dcc.qclive.common.ManifestParserImpl; import gov.nih.nci.ncicb.tcga.dcc.qclive.common.QcContext; import org.apache.commons.io.IOUtils; import org.junit.Test; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import static org.junit.Assert.assertTrue; /** * Test class for AddFileToArchive * * @author Jessica Chen Last updated by: $Author$ * @version $Rev$ */ public class ArchiveFileAdderFastTest { private static final String SAMPLES_DIR = Thread.currentThread() .getContextClassLoader().getResource("samples").getPath() + File.separator; @Test public void test() throws Processor.ProcessorException, IOException { BufferedReader reader = null; try { // run and verify that file has been copied and manifest includes new // file String manifest = SAMPLES_DIR + "qclive" + File.separator + "addFileToArchive" + File.separator + "MANIFEST.txt"; File manifestFile = new File(manifest); System.out.println("Manifest file: " + manifestFile); if (manifestFile.exists()) { // delete in case it is there so don't skew results // noinspection ResultOfMethodCallIgnored manifestFile.delete(); } // noinspection ResultOfMethodCallIgnored manifestFile.createNewFile(); String fileToAdd = SAMPLES_DIR + "qclive" + File.separator + "dataMatrix" + File.separator + "Test.sdrf"; ArchiveFileAdder fileAdder = new ArchiveFileAdder(Experiment.TYPE_GSC, null, fileToAdd); // make an archive Archive gscArchive = new Archive(); gscArchive.setArchiveType(Archive.TYPE_LEVEL_1); gscArchive.setExperimentType(Experiment.TYPE_GSC); gscArchive.setArchiveFile(new File(SAMPLES_DIR + "qclive" + File.separator + "addFileToArchive" + ConstantValues.COMPRESSED_ARCHIVE_EXTENSION)); gscArchive.setDeployLocation(SAMPLES_DIR + "qclive" + File.separator + "addFileToArchive" + ConstantValues.COMPRESSED_ARCHIVE_EXTENSION); Archive cgccArchive = new Archive(); cgccArchive.setArchiveType(Archive.TYPE_AUX); cgccArchive.setExperimentType(Experiment.TYPE_CGCC); fileAdder.setManifestParser(new ManifestParserImpl()); QcContext context = new QcContext(); fileAdder.execute(gscArchive, context); File createdFile = new File(SAMPLES_DIR + "qclive" + File.separator + "addFileToArchive" + File.separator + "Test.sdrf"); assertTrue(createdFile.exists()); // verify the copied file is listed in the manifest //noinspection IOResourceOpenedButNotSafelyClosed reader = new BufferedReader(new FileReader(manifestFile)); StringBuffer manifestText = new StringBuffer(); String line; while ((line = reader.readLine()) != null) { manifestText.append(line); } assertTrue(context.getErrors().toString(), manifestText.toString() .contains("Test.sdrf")); createdFile.deleteOnExit(); manifestFile.deleteOnExit(); } finally { IOUtils.closeQuietly(reader); } } }
[ "reillysm@mail.nih.gov" ]
reillysm@mail.nih.gov
aa1901ad6d9ded47aa315ade6e3a29dfbbb32347
2e59950c3a0e32c9748c1e3303d5530f6e9b67ca
/Thinksns_v4.0/src/com/abcs/haiwaigou/view/HotHeaderView.java
52c73368d7a6e678742510eb2a73cdc59a158d4f
[]
no_license
xiaozhugua/Myhuarenb
a27e87451c792a76ade79fc29d7050997ac2bdf6
9a81815ce90a7b4e5c22ff99fb8fc5e13844d326
refs/heads/master
2021-01-23T02:05:42.432793
2017-05-31T04:05:42
2017-05-31T04:05:42
92,902,840
0
1
null
null
null
null
UTF-8
Java
false
false
754
java
package com.abcs.haiwaigou.view; import android.content.Context; import android.util.AttributeSet; import android.widget.LinearLayout; import com.abcs.sociax.android.R; /** * Created by zjz on 2016/4/11. */ public class HotHeaderView extends LinearLayout { public HotHeaderView(Context context) { super(context); init(context); } public HotHeaderView(Context context, AttributeSet attrs) { super(context, attrs); init(context); } public HotHeaderView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context); } public void init(final Context context) { inflate(context, R.layout.hwg_hot_header, this); } }
[ "1343012815@qq.com" ]
1343012815@qq.com
8d156aa1784492aa029b64d5315ef1a23973e6c6
359b0f270437098757047f6ec57273e7b9d77414
/src/IO/二进制IO/Foo.java
dbd3c97f46bb5c6d4b9884ed9df68666dd3b3b1c
[]
no_license
Yuwenbiao/JavaProgram
21bc97cb567dab8b9c27c966a52b37f591874a0c
087c5b5a6085e51280ce2a04b1bcf9cbb25cbaf8
refs/heads/master
2021-05-12T14:31:01.610775
2018-04-01T13:25:01
2018-04-01T13:25:01
116,957,477
0
0
null
null
null
null
UTF-8
Java
false
false
200
java
package IO.二进制IO; import java.io.Serializable; public class Foo implements Serializable { private int v1; private static double v2; private transient A v3 = new A(); } class A { }
[ "2383299053@qq.com" ]
2383299053@qq.com
1bd66d7a6294b231219154afdb39854ef1ee68e8
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/34/461.java
e8dcb930734d3671a48e52b6bc10a9505575b47f
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
627
java
package <missing>; public class GlobalMembers { public static int Main() { int n; int m; String tempVar = ConsoleInput.scanfRead(); if (tempVar != null) { n = Integer.parseInt(tempVar); } if (n == 1) { System.out.print("End"); return 0; } else { while (true) { if (n % 2 == 0) { m = n; n = n / 2; System.out.printf("%d/2=%d",m,n); System.out.print("\n"); } else { m = n; n = 3 * n + 1; System.out.printf("%d*3+1=%d",m,n); System.out.print("\n"); } if (n == 1) { break; } } System.out.print("End"); } return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
3847a02ea1484c808e792f72b12a70f43a27fc68
a59ac307b503ff470e9be5b1e2927844eff83dbe
/wheatfield/branches/rkylin-wheatfield-DSRW/wheatfield/src/main/java/com/rkylin/wheatfield/manager/CreditInfoManager.java
b8b40524b5913af5f6d16080128772dea59afde8
[]
no_license
yangjava/kylin-wheatfield
2cc82ee9e960543264b1cfc252f770ba62669e05
4127cfca57a332d91f8b2ae1fe1be682b9d0f5fc
refs/heads/master
2020-12-02T22:07:06.226674
2017-07-03T07:59:15
2017-07-03T07:59:15
96,085,446
0
4
null
null
null
null
UTF-8
Java
false
false
534
java
/* * Powered By rkylin-code-generator * Web Site: http://www.chanjetpay.com * Since 2014 - 2015 */ package com.rkylin.wheatfield.manager; import java.util.List; import com.rkylin.wheatfield.pojo.CreditInfo; import com.rkylin.wheatfield.pojo.CreditInfoQuery; public interface CreditInfoManager { void saveCreditInfo(CreditInfo creditInfo); CreditInfo findCreditInfoById(Long id); List<CreditInfo> queryList(CreditInfoQuery query); void deleteCreditInfoById(Long id); void deleteCreditInfo(CreditInfoQuery query); }
[ "yangjava@users.noreply.github.com" ]
yangjava@users.noreply.github.com
5b1febd4e0533198c62bdcb0c95e8953baa4f632
e51de484e96efdf743a742de1e91bce67f555f99
/Android/triviacrack_src/src/com/google/android/gms/internal/ex$1.java
2855d7fa41d77367f92bb25c24639adce1fc4843
[]
no_license
adumbgreen/TriviaCrap
b21e220e875f417c9939f192f763b1dcbb716c69
beed6340ec5a1611caeff86918f107ed6807d751
refs/heads/master
2021-03-27T19:24:22.401241
2015-07-12T01:28:39
2015-07-12T01:28:39
28,071,899
0
0
null
null
null
null
UTF-8
Java
false
false
1,058
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.google.android.gms.internal; import android.content.Context; // Referenced classes of package com.google.android.gms.internal: // ex, am, dt, fz, // fa, gb, ak, fx, // gc final class e implements Runnable { final Context a; final dt b; final fa c; final gc d; final String e; public void run() { fz fz1 = fz.a(a, new am(), false, false, null, b.k); fz1.setWillNotDraw(true); c.a(fz1); gb gb1 = fz1.f(); gb1.a("/invalidRequest", c.a); gb1.a("/loadAdURL", c.b); gb1.a("/log", ak.g); gb1.a(d); fx.a("Loading the JS library."); fz1.loadUrl(e); } (Context context, dt dt1, fa fa1, gc gc, String s) { a = context; b = dt1; c = fa1; d = gc; e = s; super(); } }
[ "klayderpus@chimble.net" ]
klayderpus@chimble.net
195a5eef46ea79dab59b2c2f76040e53731254f6
d33ab66f23331fa0e45dcc518171140f43515eea
/src/main/java/com/zhuojian/ct/algorithm/cnn/RunCNN.java
22bbc899160977063e39491e18c4cfd0fb87feb4
[]
no_license
qaz734913414/ct-zhuojian
bf7e01de180f56576ba09a9cddbe3fdec6cac1ba
121eb32ed7b87ad44d830e9c64d6f21b8b04a0ae
refs/heads/master
2021-01-13T09:19:56.862417
2016-03-23T05:45:47
2016-03-23T05:45:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,529
java
package com.zhuojian.ct.algorithm.cnn; import java.io.IOException; /** * ATTENTION!!! * 1. Record 中数据是按行组织的,不同于matlab的按列组织 */ public class RunCNN { public static void runCnn() { String modelName = "E:\\dataset\\model.cnn"; LayerBuilder builder = new LayerBuilder(); builder.addLayer(Layer.buildInputLayer(new Layer.Size(28, 28))); builder.addLayer(Layer.buildConvLayer(6, new Layer.Size(5, 5))); builder.addLayer(Layer.buildSampLayer(new Layer.Size(2, 2))); builder.addLayer(Layer.buildConvLayer(12, new Layer.Size(5, 5))); builder.addLayer(Layer.buildSampLayer(new Layer.Size(2, 2))); builder.addLayer(Layer.buildOutputLayer(10)); CNN cnn = new CNN(builder, 10); String fileName = "E:\\dataset\\train"; DataSet dataSet = new DataSet(); dataSet.load(fileName, ","); cnn.train(dataSet, 3);// cnn.saveModel(modelName); //CNN cnn = CNN.loadModel(modelName); DataSet testSet = new DataSet(); testSet.load("E:\\dataset\\test", ","); cnn.predict(testSet, "E:\\dataset\\result"); System.out.println("\n\n\n\n\n\n"); try { System.out.println(new CalculatePrecision().getPrecision("E:\\dataset\\result", "E:\\dataset\\test.predict")); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) { new TimedTest(new TimedTest.TestTask() { @Override public void process() { runCnn(); } }, 1).test(); ConcurenceRunner.stop(); } }
[ "root@localhost.localdomain" ]
root@localhost.localdomain
10f011c0d3e8ffffaddfd021b7bfa821955e700d
93613ce1278d5873100922bae9fb64a9b9b1ec33
/src/src/main/java/com/fuzzyacornindustries/pokemonmd/item/ItemClayTablet.java
26cd6684119cd96699dd503d298c74fc2e483f83
[]
no_license
SpikybumJolteon/PokemonMD
8cd0f8d0e110fb25360ea5569f5e1b31a6f76007
5b11ca46c1ea6a75db276614a823efee1cefcefd
refs/heads/master
2020-03-17T01:52:58.695572
2018-11-02T17:25:01
2018-11-02T17:25:01
133,170,244
0
0
null
null
null
null
UTF-8
Java
false
false
592
java
package com.fuzzyacornindustries.pokemonmd.item; import com.fuzzyacornindustries.pokemonmd.creativetabs.PokemonMDCreativeTabs; import com.fuzzyacornindustries.pokemonmd.library.ModInfo; import net.minecraft.item.Item; public class ItemClayTablet extends Item { public static String itemName = "claytablet"; public ItemClayTablet() { this.maxStackSize = 1; this.setUnlocalizedName(itemName); this.setTextureName(ModInfo.MODID + ":" + getItemName()); this.setCreativeTab(PokemonMDCreativeTabs.tabPokemonMDItems); } static public String getItemName() { return itemName; } }
[ "fuzzy_acorn_ind@hotmail.com" ]
fuzzy_acorn_ind@hotmail.com
901ee05f0f4d18584f811f3e288eb2b0ce46795b
acfa6806265e2ce80f85d6ca48340d6aed8b190c
/src/main/java/se/java/threadpool/ThreadPoolExecutorTest.java
d00a6baff926350d3cf0d81abc9ea77fa90b33ae
[]
no_license
wp518cookie/review
302c615adf8ecf81a99756e03421e98dd55c2d25
5230791fc7a6cf53c55d2ea586d8cc65a71c1204
refs/heads/master
2021-09-13T09:04:09.939459
2018-04-27T13:10:48
2018-04-27T13:10:48
107,087,873
0
0
null
null
null
null
UTF-8
Java
false
false
581
java
package se.java.threadpool; import java.util.concurrent.TimeUnit; /** * Created by Administrator on 2018/1/19. */ public class ThreadPoolExecutorTest { public static void main(String[] args) throws Exception { Thread a = new Thread(new Task()); a.start(); a.interrupt(); } private static class Task implements Runnable { public void run() { try { TimeUnit.SECONDS.sleep(3); } catch (InterruptedException e) { System.out.println("interrupted"); } } } }
[ "403704156@qq.com" ]
403704156@qq.com
6a98d40e795c25b6aaaef38fb0743c9be190cde0
2122d24de66635b64ec2b46a7c3f6f664297edc4
/spring/spring-boot/spring-boot-batch-sample/src/main/java/jcg/demo/zheng/springbootbatchdemo/step/SimpleProcessor.java
c6c038f3ae4e1a2153efd38a60bd6a54f58a9371
[]
no_license
yiminyangguang520/Java-Learning
8cfecc1b226ca905c4ee791300e9b025db40cc6a
87ec6c09228f8ad3d154c96bd2a9e65c80fc4b25
refs/heads/master
2023-01-10T09:56:29.568765
2022-08-29T05:56:27
2022-08-29T05:56:27
92,575,777
5
1
null
2023-01-05T05:21:02
2017-05-27T06:16:40
Java
UTF-8
Java
false
false
353
java
package jcg.demo.zheng.springbootbatchdemo.step; import org.springframework.batch.item.ItemProcessor; /** * @author min */ public class SimpleProcessor implements ItemProcessor<String, String> { @Override public String process(String data) throws Exception { System.out.println("process for " + data); return data.toUpperCase(); } }
[ "litz-a@glodon.com" ]
litz-a@glodon.com
92ffe3e15248bddd05e28cd225a045ed5de57120
7e551e651755889dbbd7a78280005de762d0e442
/app/src/main/java/me/jessyan/mvparms/demo/mvp/model/entity/GoodsDetails.java
d199897e6fcbbdb851234e5bbfe6b44ba75dbc3b
[]
no_license
danielguomin/enjoy
876c58a3c3c30a0cfd632579473e4ea4da005eb7
29d1a65908f2f37234520dd0f675c0aa570f9087
refs/heads/master
2020-03-22T17:42:49.306766
2018-08-01T02:55:14
2018-08-01T02:55:14
140,410,987
0
0
null
null
null
null
UTF-8
Java
false
false
7,671
java
package me.jessyan.mvparms.demo.mvp.model.entity; import java.util.List; /** * Created by guomin on 2018/7/29. */ public class GoodsDetails { public class Goods { private int attention; private int cnt; private double costPrice; private String goodsId; private String merchId; private String image; private double marketPrice; private String name; private int sales; private double salePrice; private String title; private String mobileDetail; private String shareUrl; private String goodsSpecValues; private List<GoodsSpec> goodsSpecList; private List<GoodsSpecValue> goodsSpecValueList; public int getAttention() { return attention; } public void setAttention(int attention) { this.attention = attention; } public int getCnt() { return cnt; } public void setCnt(int cnt) { this.cnt = cnt; } public double getCostPrice() { return costPrice; } public void setCostPrice(double costPrice) { this.costPrice = costPrice; } public String getGoodsId() { return goodsId; } public void setGoodsId(String goodsId) { this.goodsId = goodsId; } public String getMerchId() { return merchId; } public void setMerchId(String merchId) { this.merchId = merchId; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public double getMarketPrice() { return marketPrice; } public void setMarketPrice(double marketPrice) { this.marketPrice = marketPrice; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getSales() { return sales; } public void setSales(int sales) { this.sales = sales; } public double getSalePrice() { return salePrice; } public void setSalePrice(double salePrice) { this.salePrice = salePrice; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getMobileDetail() { return mobileDetail; } public void setMobileDetail(String mobileDetail) { this.mobileDetail = mobileDetail; } public String getShareUrl() { return shareUrl; } public void setShareUrl(String shareUrl) { this.shareUrl = shareUrl; } public String getGoodsSpecValues() { return goodsSpecValues; } public void setGoodsSpecValues(String goodsSpecValues) { this.goodsSpecValues = goodsSpecValues; } public List<GoodsSpec> getGoodsSpecList() { return goodsSpecList; } public void setGoodsSpecList(List<GoodsSpec> goodsSpecList) { this.goodsSpecList = goodsSpecList; } public List<GoodsSpecValue> getGoodsSpecValueList() { return goodsSpecValueList; } public void setGoodsSpecValueList(List<GoodsSpecValue> goodsSpecValueList) { this.goodsSpecValueList = goodsSpecValueList; } @Override public String toString() { return "Goods{" + "attention=" + attention + ", cnt=" + cnt + ", costPrice=" + costPrice + ", goodsId='" + goodsId + '\'' + ", merchId='" + merchId + '\'' + ", image='" + image + '\'' + ", marketPrice=" + marketPrice + ", name='" + name + '\'' + ", sales=" + sales + ", salePrice=" + salePrice + ", title='" + title + '\'' + ", mobileDetail='" + mobileDetail + '\'' + ", shareUrl='" + shareUrl + '\'' + ", goodsSpecValues='" + goodsSpecValues + '\'' + ", goodsSpecList=" + goodsSpecList + ", goodsSpecValueList=" + goodsSpecValueList + '}'; } } public class GoodsSpec { private String specId; private String specName; public String getSpecId() { return specId; } public void setSpecId(String specId) { this.specId = specId; } public String getSpecName() { return specName; } public void setSpecName(String specName) { this.specName = specName; } @Override public String toString() { return "GoodsSpec{" + "specId='" + specId + '\'' + ", specName='" + specName + '\'' + '}'; } } public class GoodsSpecValue { private String specId; private String specValueId; private String specValueName; public String getSpecId() { return specId; } public void setSpecId(String specId) { this.specId = specId; } public String getSpecValueId() { return specValueId; } public void setSpecValueId(String specValueId) { this.specValueId = specValueId; } public String getSpecValueName() { return specValueName; } public void setSpecValueName(String specValueName) { this.specValueName = specValueName; } @Override public String toString() { return "GoodsSpecValue{" + "specId='" + specId + '\'' + ", specValueId='" + specValueId + '\'' + ", specValueName='" + specValueName + '\'' + '}'; } } public class Promotion { private String id; private String rule; private String title; private String type; private String typeDesc; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getRule() { return rule; } public void setRule(String rule) { this.rule = rule; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getTypeDesc() { return typeDesc; } public void setTypeDesc(String typeDesc) { this.typeDesc = typeDesc; } @Override public String toString() { return "Promotion{" + "id='" + id + '\'' + ", rule='" + rule + '\'' + ", title='" + title + '\'' + ", type='" + type + '\'' + ", typeDesc='" + typeDesc + '\'' + '}'; } } }
[ "guomin@mapbar.com" ]
guomin@mapbar.com
894d1acadc000cf675636a33294ef03dc4b70d3c
c8bf1df473f0a1cf5d4bd58e697570a6803790a6
/codegen/src/main/java/org/exolab/castor/builder/binding/xml/descriptors/ExcludesDescriptor.java
7a0cf853f840a3f3c1597ee71a9f15fd1bce8c8a
[]
no_license
j-white/hacked-castor
0adbe590c359fa5567856ea89e61541507800d76
6cd86a43f892643d15cfb089d34fc25cf49b6a69
refs/heads/master
2021-01-20T16:55:33.166799
2017-02-24T14:04:16
2017-02-24T14:04:16
82,838,036
0
1
null
2017-02-23T21:35:39
2017-02-22T18:20:40
Java
UTF-8
Java
false
false
6,109
java
/* * This class was automatically generated with * <a href="http://www.castor.org">Castor 1.1</a>, using an XML * Schema. * $Id$ */ package org.exolab.castor.builder.binding.xml.descriptors; //---------------------------------/ //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.builder.binding.xml.Excludes; /** * Class ExcludesDescriptor. * * @version $Revision$ $Date$ */ public class ExcludesDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { //--------------------------/ //- Class/Member Variables -/ //--------------------------/ /** * Field _elementDefinition. */ private boolean _elementDefinition; /** * Field _nsPrefix. */ private java.lang.String _nsPrefix; /** * Field _nsURI. */ private java.lang.String _nsURI; /** * Field _xmlName. */ private java.lang.String _xmlName; /** * Field _identity. */ private org.exolab.castor.xml.XMLFieldDescriptor _identity; //----------------/ //- Constructors -/ //----------------/ public ExcludesDescriptor() { super(); _nsURI = "http://www.castor.org/SourceGenerator/Binding"; _xmlName = "excludes"; _elementDefinition = true; //-- set grouping compositor setCompositorAsSequence(); org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; org.exolab.castor.mapping.FieldHandler handler = null; org.exolab.castor.xml.FieldValidator fieldValidator = null; //-- initialize attribute descriptors //-- initialize element descriptors //-- _excludeList desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.builder.binding.xml.Exclude.class, "_excludeList", "exclude", org.exolab.castor.xml.NodeType.Element); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { Excludes target = (Excludes) object; return target.getExclude(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { Excludes target = (Excludes) object; target.addExclude( (org.exolab.castor.builder.binding.xml.Exclude) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { try { Excludes target = (Excludes) object; target.removeAllExclude(); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } public java.lang.Object newInstance(java.lang.Object parent) { return new org.exolab.castor.builder.binding.xml.Exclude(); } }; desc.setHandler(handler); desc.setNameSpaceURI("http://www.castor.org/SourceGenerator/Binding"); desc.setRequired(true); desc.setMultivalued(true); addFieldDescriptor(desc); addSequenceElement(desc); java.util.List substitutionGroupes_excludeList = new java.util.ArrayList(); desc.setSubstitutes(substitutionGroupes_excludeList); //-- validation code for: _excludeList fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(1); { //-- local scope } desc.setValidator(fieldValidator); } //-----------/ //- Methods -/ //-----------/ /** * Method getAccessMode. * * @return the access mode specified for this class. */ public org.exolab.castor.mapping.AccessMode getAccessMode( ) { return null; } /** * Method getIdentity. * * @return the identity field, null if this class has no * identity. */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { return _identity; } /** * Method getJavaClass. * * @return the Java class represented by this descriptor. */ public java.lang.Class getJavaClass( ) { return org.exolab.castor.builder.binding.xml.Excludes.class; } /** * Method getNameSpacePrefix. * * @return the namespace prefix to use when marshaling as XML. */ public java.lang.String getNameSpacePrefix( ) { return _nsPrefix; } /** * Method getNameSpaceURI. * * @return the namespace URI used when marshaling and * unmarshaling as XML. */ public java.lang.String getNameSpaceURI( ) { return _nsURI; } /** * Method getValidator. * * @return a specific validator for the class described by this * ClassDescriptor. */ public org.exolab.castor.xml.TypeValidator getValidator( ) { return this; } /** * Method getXMLName. * * @return the XML Name for the Class being described. */ public java.lang.String getXMLName( ) { return _xmlName; } /** * Method isElementDefinition. * * @return true if XML schema definition of this Class is that * of a global * element or element with anonymous type definition. */ public boolean isElementDefinition( ) { return _elementDefinition; } }
[ "jesse@opennms.org" ]
jesse@opennms.org
a787c5fc78ae883afe9f33830bc6711796eb0ed2
8f658bb2f11fdafad22fc324758ecf5ef9dee18e
/app/src/main/java/com/shuangpin/rich/linechart/hellocharts/gesture/ChartZoomer.java
f62df008495c91216337badc59077be986bb636f
[]
no_license
XiePengLearn/FuXiBao
9835379e1b4d03a6aa761189910c031816ac7434
dcfba04a20fe1bfb47802a25a4b6c24410005ca7
refs/heads/master
2020-07-03T01:31:46.408699
2019-08-11T09:14:26
2019-08-11T09:14:26
201,741,879
1
0
null
null
null
null
UTF-8
Java
false
false
4,280
java
package com.shuangpin.rich.linechart.hellocharts.gesture; import android.content.Context; import android.graphics.PointF; import android.view.MotionEvent; import com.shuangpin.rich.linechart.hellocharts.computator.ChartComputator; import com.shuangpin.rich.linechart.hellocharts.model.Viewport; /** * Encapsulates zooming functionality. */ public class ChartZoomer { public static final float ZOOM_AMOUNT = 0.25f; private ZoomerCompat zoomer; private ZoomType zoomType; private PointF zoomFocalPoint = new PointF();// Used for double tap zoom private PointF viewportFocus = new PointF(); private Viewport scrollerStartViewport = new Viewport(); // Used only for zooms and flings public ChartZoomer(Context context, ZoomType zoomType) { zoomer = new ZoomerCompat(context); this.zoomType = zoomType; } public boolean startZoom(MotionEvent e, ChartComputator computator) { zoomer.forceFinished(true); scrollerStartViewport.set(computator.getCurrentViewport()); if (!computator.rawPixelsToDataPoint(e.getX(), e.getY(), zoomFocalPoint)) { // Focus point is not within content area. return false; } zoomer.startZoom(ZOOM_AMOUNT); return true; } public boolean computeZoom(ChartComputator computator) { if (zoomer.computeZoom()) { // Performs the zoom since a zoom is in progress. final float newWidth = (1.0f - zoomer.getCurrZoom()) * scrollerStartViewport.width(); final float newHeight = (1.0f - zoomer.getCurrZoom()) * scrollerStartViewport.height(); final float pointWithinViewportX = (zoomFocalPoint.x - scrollerStartViewport.left) / scrollerStartViewport.width(); final float pointWithinViewportY = (zoomFocalPoint.y - scrollerStartViewport.bottom) / scrollerStartViewport.height(); float left = zoomFocalPoint.x - newWidth * pointWithinViewportX; float top = zoomFocalPoint.y + newHeight * (1 - pointWithinViewportY); float right = zoomFocalPoint.x + newWidth * (1 - pointWithinViewportX); float bottom = zoomFocalPoint.y - newHeight * pointWithinViewportY; setCurrentViewport(computator, left, top, right, bottom); return true; } return false; } public boolean scale(ChartComputator computator, float focusX, float focusY, float scale) { /** * Smaller viewport means bigger zoom so for zoomIn scale should have value <1, for zoomOout >1 */ final float newWidth = scale * computator.getCurrentViewport().width(); final float newHeight = scale * computator.getCurrentViewport().height(); if (!computator.rawPixelsToDataPoint(focusX, focusY, viewportFocus)) { // Focus point is not within content area. return false; } float left = viewportFocus.x - (focusX - computator.getContentRectMinusAllMargins().left) * (newWidth / computator.getContentRectMinusAllMargins().width()); float top = viewportFocus.y + (focusY - computator.getContentRectMinusAllMargins().top) * (newHeight / computator.getContentRectMinusAllMargins().height()); float right = left + newWidth; float bottom = top - newHeight; setCurrentViewport(computator, left, top, right, bottom); return true; } private void setCurrentViewport(ChartComputator computator, float left, float top, float right, float bottom) { Viewport currentViewport = computator.getCurrentViewport(); if (ZoomType.HORIZONTAL_AND_VERTICAL == zoomType) { computator.setCurrentViewport(left, top, right, bottom); } else if (ZoomType.HORIZONTAL == zoomType) { computator.setCurrentViewport(left, currentViewport.top, right, currentViewport.bottom); } else if (ZoomType.VERTICAL == zoomType) { computator.setCurrentViewport(currentViewport.left, top, currentViewport.right, bottom); } } public ZoomType getZoomType() { return zoomType; } public void setZoomType(ZoomType zoomType) { this.zoomType = zoomType; } }
[ "769783182@qq.com" ]
769783182@qq.com
163a52e3f25f47ee938fbc4f271e6c85b70b6ff1
49d4bd08f8dbeca63a5df0c0017da53a9416655b
/metrics4j/src/test/java/org/kairosdb/metrics4j/internal/MetricsGathererTest.java
04a549d0bb22c4014e97d99a6c973ee2bea6b271
[ "Apache-2.0" ]
permissive
kairosdb/metrics4j
4f169a853cc6164f6ba96cf114bc0c0e5d9aca32
5e60680c2c08a0b065db3e2af8a5d2cfd9cfbc87
refs/heads/master
2023-06-22T22:56:08.093115
2022-12-27T21:40:49
2022-12-27T21:40:49
151,353,422
5
2
Apache-2.0
2023-09-01T18:10:08
2018-10-03T02:56:34
Java
UTF-8
Java
false
false
4,035
java
package org.kairosdb.metrics4j.internal; import org.junit.jupiter.api.Test; import org.kairosdb.metrics4j.collectors.MetricCollector; import org.kairosdb.metrics4j.reporting.LongValue; import org.kairosdb.metrics4j.reporting.MetricReporter; import java.time.Duration; import java.time.Instant; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; public class MetricsGathererTest { private class TestMetricsGatherer extends MetricsGatherer { private Map<TagKey, AgedMetricCollector> m_collectors = new HashMap<>(); public void addCollector(TagKey tagKey, AgedMetricCollector collector) { m_collectors.put(tagKey, collector); } @Override public MetricCollector getCollector(TagKey tagKey) { return null; } @Override protected ArgKey getArgKey() { return new ArgKey() { @Override public List<String> getConfigPath() { return Collections.emptyList(); } @Override public String getMethodName() { return "testMethod"; } @Override public String getClassName() { return "org.TestClass"; } }; } @Override protected Map<TagKey, AgedMetricCollector> getCollectors() { return m_collectors; } } private class TestCollector implements MetricCollector { private final boolean m_report; public TestCollector(boolean report) { m_report = report; } @Override public void reportMetric(MetricReporter metricReporter) { if (m_report) metricReporter.put("myField", new LongValue(42)); } @Override public void setContextProperties(Map<String, String> contextProperties) { } } private class FixedMetricCollector extends MetricsGatherer.AgedMetricCollector { private Duration m_age; public FixedMetricCollector(Duration age, MetricCollector metricCollector) { super(metricCollector); m_age = age; } @Override public Duration getAge() { return m_age; } } @Test public void testAgedOutCollector() { TestMetricsGatherer tmg = new TestMetricsGatherer(); MetricsGatherer.AgedMetricCollector metricCollector = mock(MetricsGatherer.AgedMetricCollector.class); when(metricCollector.getAge()).thenReturn(Duration.ofMinutes(11)); when(metricCollector.getMetricCollector()).thenReturn(new TestCollector(false)); tmg.addCollector(TagKey.newBuilder().addTag("tag1", "value1").build(), metricCollector); tmg.gatherMetrics(Instant.now()); assertThat(tmg.getCollectors()).isEmpty(); verify(metricCollector, never()).updateLastUsed(); } @Test public void testAgedOutCollector_reporting_but_aged() { TestMetricsGatherer tmg = new TestMetricsGatherer(); MetricsGatherer.AgedMetricCollector metricCollector = mock(MetricsGatherer.AgedMetricCollector.class); when(metricCollector.getAge()).thenReturn(Duration.ofMinutes(11)); when(metricCollector.getMetricCollector()).thenReturn(new TestCollector(true)); tmg.addCollector(TagKey.newBuilder().addTag("tag1", "value1").build(), metricCollector); tmg.gatherMetrics(Instant.now()); assertThat(tmg.getCollectors().size()).isEqualTo(1); verify(metricCollector).updateLastUsed(); } @Test public void testAgedOutCollector_not_reporting_not_aged() { TestMetricsGatherer tmg = new TestMetricsGatherer(); MetricsGatherer.AgedMetricCollector metricCollector = mock(MetricsGatherer.AgedMetricCollector.class); when(metricCollector.getAge()).thenReturn(Duration.ofMinutes(1)); when(metricCollector.getMetricCollector()).thenReturn(new TestCollector(false)); tmg.addCollector(TagKey.newBuilder().addTag("tag1", "value1").build(), metricCollector); tmg.gatherMetrics(Instant.now()); assertThat(tmg.getCollectors().size()).isEqualTo(1); verify(metricCollector, never()).updateLastUsed(); } }
[ "brianhks1@gmail.com" ]
brianhks1@gmail.com
d3bb763ae717cbad0f81b7e668538940514c4cf4
e08314b8c22df72cf3aa9e089624fc511ff0d808
/src/selfdefine/com/ces/component/qyptqyxxgl/service/QyptqyxxglService.java
931b0930c3ddc3b1019a362b4b6ad2ef6570ddce
[]
no_license
quxiongwei/qhzyc
46acd4f6ba41ab3b39968071aa114b24212cd375
4b44839639c033ea77685b98e65813bfb269b89d
refs/heads/master
2020-12-02T06:38:21.581621
2017-07-12T02:06:10
2017-07-12T02:06:10
96,864,946
0
3
null
null
null
null
UTF-8
Java
false
false
406
java
package com.ces.component.qyptqyxxgl.service; import org.springframework.stereotype.Component; import com.ces.component.trace.dao.TraceShowModuleDao; import com.ces.component.trace.service.base.TraceShowModuleDefineDaoService; import com.ces.xarch.core.entity.StringIDEntity; @Component public class QyptqyxxglService extends TraceShowModuleDefineDaoService<StringIDEntity, TraceShowModuleDao> { }
[ "qu.xiongwei@cesgroup.com.cn" ]
qu.xiongwei@cesgroup.com.cn
0df310e0fb49deafa93821be4693a47abdbf2cf0
c9e706eb685b1e9e368456d9f9677a7b63a9056d
/src/main/java/goals/save_file_manipulation/MAIN_ConvertSparseToTFRecord.java
906cf88d654f4e4bbe203928135dd8609bded1c7
[]
no_license
mws262/qwop-controls
e568920e634de10b887fdb468cd9e5aefba410bf
c9a17f8697a069d4ae761bd5ba09e798bf5c7615
refs/heads/master
2022-10-13T18:38:44.168837
2020-07-01T21:23:01
2020-07-01T21:23:01
153,288,826
0
0
null
2022-10-04T23:47:19
2018-10-16T13:20:30
PureBasic
UTF-8
Java
false
false
1,840
java
package goals.save_file_manipulation; import com.google.common.base.Preconditions; import data.SparseDataToDenseTFRecord; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.List; import java.util.Objects; /** * Take a sparsely-saved datafile (i.e. states not recorded at every timestep), and turn it into a densely-saved * TFRecord binary which can be used here or in the Python TensorFlow stuff. * * @author matt */ public class MAIN_ConvertSparseToTFRecord { private static final Logger logger = LogManager.getLogger(MAIN_ConvertSparseToTFRecord.class); public static void main(String[] args) throws FileNotFoundException { File loadFile = new File("./src/main/resources/saved_data/11_1_18/"); File outFile = new File("./src/main/resources/saved_data/11_1_18/"); String filterTerm = ""; Preconditions.checkArgument(loadFile.isDirectory()); Preconditions.checkArgument(outFile.isDirectory()); if (!loadFile.exists()) { throw new FileNotFoundException("Could not find input file."); } if (outFile.mkdir()) { logger.info("Output directory created: " + outFile.getPath()); } List<File> filesToConvert = new ArrayList<>(); File[] files = loadFile.listFiles(); for (File f : Objects.requireNonNull(files)) { if (f.toString().contains("SavableSingleGame") && f.toString().contains(filterTerm)) { filesToConvert.add(f); } } SparseDataToDenseTFRecord converter = new SparseDataToDenseTFRecord(outFile.getAbsolutePath()); converter.trimLast = 4; converter.convert(filesToConvert, true); } }
[ "mws262@cornell.edu" ]
mws262@cornell.edu
b001fe5136ca6dd9bb21b7477fdc097081cb1829
fd3ab3001c035dbb7f1982ae81c146fa99ee5979
/java/steps/yaks-knative/src/main/java/org/citrusframework/yaks/knative/actions/eventing/CreateTriggerAction.java
6f8d7f117d4a6aabadbd2e9553ba20e324d338c0
[ "Apache-2.0" ]
permissive
nicolaferraro/yaks
2db7c62e9bc36686d0892053e1cce4561e2c7d34
f4b8149c056aad323744040edb8ceb4650f4b535
refs/heads/master
2021-08-17T23:50:02.213851
2020-07-24T09:02:27
2020-07-24T09:02:27
196,998,086
0
0
null
2019-07-15T12:51:38
2019-07-15T12:51:38
null
UTF-8
Java
false
false
5,264
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.citrusframework.yaks.knative.actions.eventing; import java.util.HashMap; import java.util.Map; import com.consol.citrus.context.TestContext; import io.fabric8.knative.eventing.v1alpha1.TriggerBuilder; import io.fabric8.knative.eventing.v1alpha1.TriggerSpecBuilder; import org.citrusframework.yaks.knative.KnativeSettings; import org.citrusframework.yaks.knative.KnativeSupport; import org.citrusframework.yaks.knative.actions.AbstractKnativeAction; /** * @author Christoph Deppisch */ public class CreateTriggerAction extends AbstractKnativeAction { private final String triggerName; private final String serviceName; private final String channelName; private final Map<String, String> filterOnAttributes; public CreateTriggerAction(Builder builder) { super("create-trigger", builder); this.triggerName = builder.triggerName; this.serviceName = builder.serviceName; this.channelName = builder.channelName; this.filterOnAttributes = builder.filterOnAttributes; } @Override public void doExecute(TestContext context) { TriggerSpecBuilder triggerSpec = new TriggerSpecBuilder() .withBroker(brokerName(context)); addServiceSubscriber(triggerSpec, context); addChannelSubscriber(triggerSpec, context); addFilterOnAttributes(triggerSpec, context); TriggerBuilder triggerBuilder = new TriggerBuilder() .withApiVersion("eventing.knative.dev/v1") .withNewMetadata() .withNamespace(namespace(context)) .withName(context.replaceDynamicContentInString(triggerName)) .withLabels(KnativeSettings.getDefaultLabels()) .endMetadata() .withSpec(triggerSpec.build()); KnativeSupport.createResource(getKubernetesClient(), namespace(context), KnativeSupport.eventingCRDContext("triggers"), triggerBuilder.build()); } private void addFilterOnAttributes(TriggerSpecBuilder triggerSpec, TestContext context) { if (!filterOnAttributes.isEmpty()) { triggerSpec.withNewFilter() .withAttributes(context.resolveDynamicValuesInMap(filterOnAttributes)) .endFilter(); } } private void addChannelSubscriber(TriggerSpecBuilder triggerSpec, TestContext context) { if (channelName != null) { triggerSpec.withNewSubscriber() .withNewRef() .withApiVersion("messaging.knative.dev/v1") .withKind("InMemoryChannel") .withName(context.replaceDynamicContentInString(channelName)) .endRef() .endSubscriber(); } } private void addServiceSubscriber(TriggerSpecBuilder triggerSpec, TestContext context) { if (serviceName != null) { triggerSpec.withNewSubscriber() .withNewRef() .withApiVersion("v1") .withKind("Service") .withName(context.replaceDynamicContentInString(serviceName)) .endRef() .endSubscriber(); } } /** * Action builder. */ public static class Builder extends AbstractKnativeAction.Builder<CreateTriggerAction, Builder> { private String triggerName; private String serviceName; private String channelName; private Map<String, String> filterOnAttributes = new HashMap<>(); public Builder name(String triggerName) { this.triggerName = triggerName; return this; } public Builder onService(String serviceName) { this.serviceName = serviceName; return this; } public Builder onChannel(String channelName) { this.channelName = channelName; return this; } public Builder filter(Map<String, String> filter) { this.filterOnAttributes.putAll(filter); return this; } public Builder filter(String attributeName, String value) { this.filterOnAttributes.put(attributeName, value); return this; } @Override public CreateTriggerAction build() { return new CreateTriggerAction(this); } } }
[ "cdeppisch@redhat.com" ]
cdeppisch@redhat.com
09ecb4e826bae379fea7490d3649dc5f99ed9ae8
ed03478dc06eb8fea7c98c03392786cd04034b82
/src/com/era/community/search/ui/action/SearchAction.java
ab139a74ccafe666188a1f1ee801b039f06bf4ae
[]
no_license
sumit-kul/cera
264351934be8f274be9ed95460ca01fa9fc23eed
34343e2f5349bab8f5f78b9edf18f2e0319f62d5
refs/heads/master
2020-12-25T05:17:19.207603
2016-09-04T00:02:31
2016-09-04T00:02:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,897
java
package com.era.community.search.ui.action; import support.community.database.QueryPaginator; import support.community.framework.AbstractIndexAction; import support.community.framework.CommandBean; import support.community.framework.IndexCommandBean; import support.community.framework.IndexCommandBeanImpl; import support.community.lucene.search.EntitySearchScroller; import com.era.community.base.CommunityEraContextManager; import com.era.community.blog.dao.BlogEntry; import com.era.community.communities.dao.Community; import com.era.community.doclib.dao.Document; import com.era.community.events.dao.Event; import com.era.community.forum.dao.ForumTopic; import com.era.community.search.index.CecEntityIndex; import com.era.community.search.index.CecEntitySearcher; import com.era.community.wiki.dao.WikiEntry; /** * This action searches within a single community. * * @spring.bean name="/cid/[cec]/srch/search.do" */ public class SearchAction extends AbstractIndexAction { /* Injected references */ private CommunityEraContextManager contextManager; private CecEntityIndex index; protected String getView(IndexCommandBean bean) throws Exception { return "/srch/search-results"; } protected QueryPaginator getScroller(IndexCommandBean bean) throws Exception { Command cmd = (Command)bean; if (cmd.getQueryText()==null||cmd.getQueryText().trim().length()==0) throw new Exception("No search query has been entered>"); searchCurrentCommunity(cmd); if (cmd.getSearchType().equals("frm")) return searchForum(cmd); else if (cmd.getSearchType().equals("doc")) return searchDoclib(cmd); else if (cmd.getSearchType().equals("wki")) return searchWiki(cmd); else if (cmd.getSearchType().equals("evt")) return searchEvents(cmd); else if (cmd.getSearchType().equals("blg")) return searchBlogs(cmd); else throw new Exception("Invalid search type ["+cmd.getSearchType()+"]"); } /* * This method is getting the number of results, not getting the results. */ private void searchCurrentCommunity(Command cmd) throws Exception { CecEntitySearcher searcher = (CecEntitySearcher)index.getIndexSearcher(); EntitySearchScroller scroller = searcher.search(cmd.getQueryText(), getCurrentCommunity(), CecEntitySearcher.DEFAULT_ENTITY_TYPES); cmd.setHitCountForCommunity(scroller.readRowCount()); } private QueryPaginator searchForum(Command cmd) throws Exception { CecEntitySearcher searcher = (CecEntitySearcher)index.getIndexSearcher(); return searcher.search(cmd.getQueryText(), getCurrentCommunity(), ForumTopic.class); } private QueryPaginator searchDoclib(Command cmd) throws Exception { CecEntitySearcher searcher = (CecEntitySearcher)index.getIndexSearcher(); return searcher.search(cmd.getQueryText(), getCurrentCommunity(), Document.class); } private QueryPaginator searchWiki(Command cmd) throws Exception { CecEntitySearcher searcher = (CecEntitySearcher)index.getIndexSearcher(); return searcher.search(cmd.getQueryText(), getCurrentCommunity(), WikiEntry.class); } private QueryPaginator searchEvents(Command cmd) throws Exception { CecEntitySearcher searcher = (CecEntitySearcher)index.getIndexSearcher(); return searcher.search(cmd.getQueryText(), getCurrentCommunity(), Event.class); } private QueryPaginator searchBlogs(Command cmd) throws Exception { CecEntitySearcher searcher = (CecEntitySearcher)index.getIndexSearcher(); return searcher.search(cmd.getQueryText(), BlogEntry.class); } private Community getCurrentCommunity() throws Exception { return contextManager.getContext().getCurrentCommunity(); } public static class Command extends IndexCommandBeanImpl implements CommandBean { private String queryText; private String searchType; private int hitCountForCommunity; public final String getQueryText() { return queryText; } public final void setQueryText(String queryText) { this.queryText = queryText; } public final String getSearchType() { return searchType; } public final void setSearchType(String searchType) { this.searchType = searchType; } public final String getSearchTypeText() { if (getSearchType().equals("frm")) return "forum"; else if (getSearchType().equals("doc")) return "library"; else if (getSearchType().equals("wki")) return "wiki"; else if (getSearchType().equals("evt")) return "event calendar"; else return ""; } public final int getHitCountForCommunity() { return hitCountForCommunity; } public final void setHitCountForCommunity(int hitCountForCommunity) { this.hitCountForCommunity = hitCountForCommunity; } } public final void setContextHolder(CommunityEraContextManager contextManager) { this.contextManager = contextManager; } public final void setIndex(CecEntityIndex index) { this.index = index; } }
[ "sumitkul2005@gmail.com" ]
sumitkul2005@gmail.com
caaa03196b0ba18dfec44523a8194dbee786fc14
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/10/10_98255deed1000568cadf9d964870f6c59e9c3186/EditorInputTransferDropTargetListener/10_98255deed1000568cadf9d964870f6c59e9c3186_EditorInputTransferDropTargetListener_t.java
acc8ff4a906d03542dd774a09559d37078ed4069
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,368
java
/******************************************************************************* * Copyright (c) 2009 Jens von Pilgrim and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Jens von Pilgrim - initial API and implementation ******************************************************************************/ package org.eclipse.gef3d.ext.multieditor.dnd; import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.draw2d.geometry.Point; import org.eclipse.gef.Request; import org.eclipse.gef.ui.parts.GraphicalEditor; import org.eclipse.gef3d.ext.multieditor.IMultiEditor; import org.eclipse.swt.dnd.DND; import org.eclipse.swt.dnd.DropTargetEvent; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.part.EditorInputTransfer; import org.eclipse.ui.part.EditorInputTransfer.EditorInputData; /** * Drop target listener to be used by a multi editor to enable opening new * diagrams (or models) in the editor by simply dropping the editor input onto * the 3D scene. This listener is to be added to the viewer during * configuration, i.e. in {@link GraphicalEditor#configureGraphicalViewer()} * just like that: * <p> * <code><pre> * getGraphicalViewer().addDropTargetListener( * new EditorInputTransferDropTargetListener(this)); * </pre></code> * </p> * * @author Jens von Pilgrim * @version $Revision$ * @since Apr 15, 2009 * @see ResourceTransferDropTargetListener */ public class EditorInputTransferDropTargetListener extends AbstractDropOnMultiEditorTargetListener { /** * @param i_multiEditor, viewer is retrieved via * {@link IAdaptable#getAdapter(Class)} */ public EditorInputTransferDropTargetListener(IMultiEditor i_multiEditor) { super(i_multiEditor, EditorInputTransfer.getInstance()); } /** * {@inheritDoc}. Creates an {@link EditorInputDropRequest} and sets * location of event if possible. * * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#createTargetRequest() */ @Override protected Request createTargetRequest() { EditorInputDropRequest request = new EditorInputDropRequest(getMultiEditor()); DropTargetEvent event = getCurrentEvent(); if (event != null) { request.setLocation(new Point(event.x, event.y)); } return request; } /** * {@inheritDoc} * * @see org.eclipse.gef3d.ext.multieditor.dnd.AbstractDropOnMultiEditorTargetListener#acceptEvent(org.eclipse.swt.dnd.DropTargetEvent) */ @Override protected int acceptEvent(DropTargetEvent i_event) { if (i_event.data instanceof EditorInputTransfer.EditorInputData[]) { EditorInputTransfer.EditorInputData[] editorInputsData = (EditorInputData[]) i_event.data; for (EditorInputTransfer.EditorInputData data : editorInputsData) if (!getMultiEditor().acceptsInput(data.input)) { return DND.DROP_NONE; } else { return DND.DROP_COPY; } } if (EditorInputTransfer.getInstance().isSupportedType( i_event.currentDataType)) { return DND.DROP_COPY; } else { return DND.DROP_NONE; } } /** * {@inheritDoc}. * <p> * Returns true if at least one editor input could be retrieved from the * given event. * * @see org.eclipse.gef3d.ext.multieditor.dnd.AbstractDropOnMultiEditorTargetListener#retrieveEventData(org.eclipse.swt.dnd.DropTargetEvent) */ @Override protected boolean retrieveEventData(DropTargetEvent i_event) { EditorInputDropRequest request = (EditorInputDropRequest) getTargetRequest(); List<IEditorInput> editorInputs = null; if (i_event.data instanceof EditorInputTransfer.EditorInputData[]) { editorInputs = new ArrayList<IEditorInput>(); EditorInputTransfer.EditorInputData[] editorInputsData = (EditorInputData[]) i_event.data; for (EditorInputTransfer.EditorInputData data : editorInputsData) { editorInputs.add(data.input); } } if (editorInputs == null || editorInputs.isEmpty()) { return false; } request.setEditorInputs(editorInputs); return true; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c6a86dbafca35ed4f90d533bd3f5c23a1c192f64
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/neo4j/learning/606/DefaultPageCacheTracerTest.java
392742ba802f52d6d81cc6b605320f0f86021cf9
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,891
java
/* * Copyright (c) 2002-2018 "Neo4j," * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.neo4j.io.pagecache.tracing; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.io.File; import java.io.IOException; import org.neo4j.io.ByteUnit; import org.neo4j.io.pagecache.PageSwapper; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.is; @SuppressWarnings( "WeakerAccess" ) // This test is accessed in neo4j-jfr. public class DefaultPageCacheTracerTest { private PageCacheTracer tracer; private PageSwapper swapper; @BeforeEach public void setUp() { tracer = new DefaultPageCacheTracer(); swapper = new DummyPageSwapper( "filename", (int) ByteUnit.kibiBytes( 8 ) ); } @Test void mustCountEvictions() { try ( EvictionRunEvent evictionRunEvent = tracer.beginPageEvictions( 2 ) ) { try ( EvictionEvent evictionEvent = evictionRunEvent.beginEviction() ) { FlushEvent flushEvent = evictionEvent.flushEventOpportunity().beginFlush( 0, 0, swapper ); flushEvent.addBytesWritten( 12 ); flushEvent.done(); } try ( EvictionEvent evictionEvent = evictionRunEvent.beginEviction() ) { FlushEvent flushEvent = evictionEvent.flushEventOpportunity().beginFlush( 0, 0, swapper ); flushEvent.addBytesWritten( 12 ); flushEvent.done(); evictionEvent.threwException( new IOException() ); } try ( EvictionEvent evictionEvent = evictionRunEvent.beginEviction() ) { FlushEvent flushEvent = evictionEvent.flushEventOpportunity().beginFlush( 0, 0, swapper ); flushEvent.addBytesWritten( 12 ); flushEvent.done(); evictionEvent.threwException( new IOException() ); } evictionRunEvent.beginEviction() .close(); } assertCounts( 0, 0, 0, 0, 4, 2, 3, 0, 36, 0, 0, 0d); } @Test void mustCountFileMappingAndUnmapping() { tracer.mappedFile( new File( "a" ) ); assertCounts( 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0d ); tracer.unmappedFile( new File( "a" ) ); assertCounts( 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0d ); } @Test void mustCountFlushes() { try ( MajorFlushEvent cacheFlush = tracer.beginCacheFlush() ) { cacheFlush.flushEventOpportunity().beginFlush( 0, 0, swapper ).done(); cacheFlush.flushEventOpportunity().beginFlush( 0, 0, swapper ).done(); cacheFlush.flushEventOpportunity().beginFlush( 0, 0, swapper ).done(); } assertCounts( 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0d ); try ( MajorFlushEvent fileFlush = tracer.beginFileFlush( swapper ) ) { fileFlush.flushEventOpportunity().beginFlush( 0, 0, swapper ).done(); fileFlush.flushEventOpportunity().beginFlush( 0, 0, swapper ).done(); fileFlush.flushEventOpportunity().beginFlush( 0, 0, swapper ).done(); } assertCounts( 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0d ); } @Test void shouldCalculateHitRatio() { assertThat( "hitRation", tracer.hitRatio(), closeTo( 0d, 0.0001 ) ); tracer.hits( 3 ); tracer.faults( 7 ); assertThat( "hitRation", tracer.hitRatio(), closeTo( 3.0 / 10, 0.0001 ) ); } @Test void usageRatio() { assertThat( tracer.usageRatio(), is( Double.NaN ) ); tracer.maxPages( 10 ); assertThat( tracer.usageRatio(), closeTo( 0d, 0.0001 ) ); tracer.faults( 5 ); assertThat( tracer.usageRatio(), closeTo( 0.5, 0.0001 ) ); tracer.faults( 5 ); tracer.evictions( 5 ); assertThat( tracer.usageRatio(), closeTo( 0.5, 0.0001 ) ); tracer.faults( 5 ); assertThat( tracer.usageRatio(), closeTo( 1d, 0.0001 ) ); } private void assertCounts( long pins, long unpins, long hits, long faults, long evictions, long evictionExceptions, long flushes, long bytesRead, long bytesWritten, long filesMapped, long filesUnmapped, double hitRatio ) { assertThat( "pins", tracer.pins(), is( pins ) ); assertThat( "unpins", tracer.unpins(), is( unpins ) ); assertThat( "hits", tracer.hits(), is( hits ) ); assertThat( "faults", tracer.faults(), is( faults ) ); assertThat( "evictions", tracer.evictions(), is( evictions ) ); assertThat( "evictionExceptions", tracer.evictionExceptions(), is( evictionExceptions ) ); assertThat( "flushes", tracer.flushes(), is( flushes ) ); assertThat( "bytesRead", tracer.bytesRead(), is( bytesRead ) ); assertThat( "bytesWritten", tracer.bytesWritten(), is( bytesWritten ) ); assertThat( "filesMapped", tracer.filesMapped(), is( filesMapped ) ); assertThat( "filesUnmapped", tracer.filesUnmapped(), is( filesUnmapped ) ); assertThat( "hitRatio", tracer.hitRatio(), closeTo( hitRatio, 0.0001 ) ); } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
db33b31a36ade51c7880afe143c2fb22bda7f8c1
863acb02a064a0fc66811688a67ce3511f1b81af
/sources/p005cm/aptoide/p006pt/home/apps/C3762pd.java
8fc16a804a9f196d188756d15a485714839c7bfc
[ "MIT" ]
permissive
Game-Designing/Custom-Football-Game
98d33eb0c04ca2c48620aa4a763b91bc9c1b7915
47283462b2066ad5c53b3c901182e7ae62a34fc8
refs/heads/master
2020-08-04T00:02:04.876780
2019-10-06T06:55:08
2019-10-06T06:55:08
211,914,568
1
1
null
null
null
null
UTF-8
Java
false
false
502
java
package p005cm.aptoide.p006pt.home.apps; import p026rx.p027b.C0132p; /* renamed from: cm.aptoide.pt.home.apps.pd */ /* compiled from: lambda */ public final /* synthetic */ class C3762pd implements C0132p { /* renamed from: a */ private final /* synthetic */ AppsPresenter f7174a; public /* synthetic */ C3762pd(AppsPresenter appsPresenter) { this.f7174a = appsPresenter; } public final Object call(Object obj) { return this.f7174a.mo14748d((App) obj); } }
[ "tusharchoudhary0003@gmail.com" ]
tusharchoudhary0003@gmail.com
79ddb75dab7349bb0ba701c89587c70b413ee936
c238f72675449d842a9533f975c22dc5f240427e
/src/main/java/org/kuali/kra/iacuc/auth/IacucProtocolReviewNotRequiredAuthorizer.java
bb2daa2b887ea0d47781db1b892ce1571748dec8
[]
no_license
ua-eas/ksd-kc5.2.1-foundation
03df619bbffd24f822e13dd046e78ead2b6cbb8a
acf6bd1ef9cf976e7a93e31ad791b33a3c8e3a17
refs/heads/development
2022-06-09T09:11:24.777326
2020-07-06T18:21:17
2020-07-06T18:21:17
20,941,107
0
1
null
2020-06-15T19:07:36
2014-06-17T22:06:46
Java
UTF-8
Java
false
false
1,396
java
/* * Copyright 2005-2014 The Kuali Foundation * * Licensed under the Educational Community 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.opensource.org/licenses/ecl1.php * * 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.kuali.kra.iacuc.auth; import org.kuali.kra.iacuc.actions.IacucProtocolActionType; import org.kuali.kra.infrastructure.RoleConstants; public class IacucProtocolReviewNotRequiredAuthorizer extends IacucProtocolAuthorizer { private static final String NAMESPACE = "KC-UNT"; /** * @see org.kuali.kra.irb.auth.ProtocolAuthorizer#isAuthorized(java.lang.String, org.kuali.kra.irb.auth.ProtocolTask) */ @Override public boolean isAuthorized(String userId, IacucProtocolTask task) { return kraAuthorizationService.hasRole(userId, NAMESPACE, RoleConstants.IACUC_ADMINISTRATOR) && canExecuteAction(task.getProtocol(), IacucProtocolActionType.IACUC_REVIEW_NOT_REQUIRED); } }
[ "shaloo@email.arizona.edu" ]
shaloo@email.arizona.edu
b55adf037154c7390e8e7bc71adc40e15e87dc05
0915dc2f6d625571fe9fef5ca851b43a951992a0
/src/main/commons/jetbrick/commons/cache/NoCache.java
559713b9bc73af2a3e483fb5145d8906f867e6cd
[]
no_license
subchen/jetbrick-legacy
3936d6ffb1a5f4a83cf942c6b62c568f0f0e57ca
ac6470cee724190aace0008ee0d99d67b33cc4c1
refs/heads/master
2023-06-15T20:25:04.666990
2014-05-11T12:58:56
2014-05-11T12:58:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,070
java
package jetbrick.commons.cache; import java.util.Collections; import java.util.List; public class NoCache implements Cache { public static final Cache NO_CACHE = new NoCache(); @Override public boolean exists(Object key) { return false; } @Override public Object get(Object key) { return null; } @Override public <K, V> V get(K key, CacheValueCreator<K, V> valueCreator) { return null; } @Override public <K, V> V get(K key, CacheValueCreator<K, V> valueCreator, int timeToLiveSeconds, int timeToIdleSeconds) { return null; } @Override public void put(Object key, Object value) { } @Override public void put(Object key, Object value, int timeToLiveSeconds, int timeToIdleSeconds) { } @Override public void remove(Object key) { } @Override public void clear() { } @Override public List<Object> getKeys() { return Collections.emptyList(); } @Override public int getSize() { return 0; } }
[ "subchen@gmail.com" ]
subchen@gmail.com
64f208f05ff6502cd1afe8df9d1c6015f8344aa7
22361430ab12e5a7c1eba4664293fc4a39051d9b
/QMRServer/src/com/game/arrow/message/ResRoundArrowExteriorMessage.java
1da089b7f9eae2b04aef2ed40672df890a3e056c
[]
no_license
liuziangexit/QMR
ab93a66623e670a7f276683d94188d1b627db853
91ea3bd35ee3a1ebf994fb3fd6ffdbaa6fbf4d22
refs/heads/master
2020-03-30T00:22:31.028514
2017-12-20T05:41:17
2017-12-20T05:41:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,696
java
package com.game.arrow.message; import com.game.message.Message; import org.apache.mina.core.buffer.IoBuffer; /** * @author Commuication Auto Maker * * @version 1.0.0 * * 同步弓箭外观消息 */ public class ResRoundArrowExteriorMessage extends Message{ //玩家id private long playerid; //弓箭等级 private int arrowid; /** * 写入字节缓存 */ public boolean write(IoBuffer buf){ //玩家id writeLong(buf, this.playerid); //弓箭等级 writeInt(buf, this.arrowid); return true; } /** * 读取字节缓存 */ public boolean read(IoBuffer buf){ //玩家id this.playerid = readLong(buf); //弓箭等级 this.arrowid = readInt(buf); return true; } /** * get 玩家id * @return */ public long getPlayerid(){ return playerid; } /** * set 玩家id */ public void setPlayerid(long playerid){ this.playerid = playerid; } /** * get 弓箭等级 * @return */ public int getArrowid(){ return arrowid; } /** * set 弓箭等级 */ public void setArrowid(int arrowid){ this.arrowid = arrowid; } @Override public int getId() { return 151106; } @Override public String getQueue() { return null; } @Override public String getServer() { return null; } @Override public String toString(){ StringBuffer buf = new StringBuffer("["); //玩家id buf.append("playerid:" + playerid +","); //弓箭等级 buf.append("arrowid:" + arrowid +","); if(buf.charAt(buf.length()-1)==',') buf.deleteCharAt(buf.length()-1); buf.append("]"); return buf.toString(); } }
[ "ctl70000@163.com" ]
ctl70000@163.com
182c7127165543c266de57a6d4f9c2fea87ab27a
43b6aa98e66e06711c018ea441abfbaf33bc7f38
/sources/com/google/firebase/auth/UserProfileChangeRequest.java
b15886600b0ace6aa735fa0e5d11faa0433a509c
[]
no_license
nagpalShaurya/tic-tac-toe
8d4c6c093f923d0d27419f8da2b8c50c4a3a78de
28cb820916a591ab5137df43343fee8fd0df9482
refs/heads/master
2020-07-06T23:51:50.683624
2019-08-21T09:41:55
2019-08-21T09:41:55
203,176,484
3
0
null
null
null
null
UTF-8
Java
false
false
3,366
java
package com.google.firebase.auth; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable.Creator; import android.support.annotation.Nullable; import android.text.TextUtils; import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable; import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter; import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Class; import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Constructor; import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Field; import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Param; import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Reserved; @Class(creator = "UserProfileChangeRequestCreator") @Reserved({1}) public class UserProfileChangeRequest extends AbstractSafeParcelable { public static final Creator<UserProfileChangeRequest> CREATOR = new zzz(); @Field(getter = "getDisplayName", mo7664id = 2) private String zzhw; @Field(getter = "getPhotoUrl", mo7664id = 3) private String zzhx; @Field(getter = "shouldRemoveDisplayName", mo7664id = 4) private boolean zzhy; @Field(getter = "shouldRemovePhotoUri", mo7664id = 5) private boolean zzhz; private Uri zzia; public static class Builder { private String zzhw; private boolean zzhy; private boolean zzhz; private Uri zzia; public Builder setDisplayName(@Nullable String str) { if (str == null) { this.zzhy = true; } else { this.zzhw = str; } return this; } public Builder setPhotoUri(@Nullable Uri uri) { if (uri == null) { this.zzhz = true; } else { this.zzia = uri; } return this; } public UserProfileChangeRequest build() { String str = this.zzhw; Uri uri = this.zzia; return new UserProfileChangeRequest(str, uri == null ? null : uri.toString(), this.zzhy, this.zzhz); } } @Constructor UserProfileChangeRequest(@Param(mo7667id = 2) String str, @Param(mo7667id = 3) String str2, @Param(mo7667id = 4) boolean z, @Param(mo7667id = 5) boolean z2) { this.zzhw = str; this.zzhx = str2; this.zzhy = z; this.zzhz = z2; this.zzia = TextUtils.isEmpty(str2) ? null : Uri.parse(str2); } @Nullable public String getDisplayName() { return this.zzhw; } public final String zzal() { return this.zzhx; } @Nullable public Uri getPhotoUri() { return this.zzia; } public final boolean zzck() { return this.zzhy; } public final boolean zzcl() { return this.zzhz; } public void writeToParcel(Parcel parcel, int i) { int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel); SafeParcelWriter.writeString(parcel, 2, getDisplayName(), false); SafeParcelWriter.writeString(parcel, 3, this.zzhx, false); SafeParcelWriter.writeBoolean(parcel, 4, this.zzhy); SafeParcelWriter.writeBoolean(parcel, 5, this.zzhz); SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader); } }
[ "shauryanagpal1998@gmail.com" ]
shauryanagpal1998@gmail.com
cbf49648923caf018df43a5c3b6dca4c36b1f53e
f525deacb5c97e139ae2d73a4c1304affb7ea197
/gitv/src/main/java/com/tvos/apps/utils/AnimationUtil.java
1af3b8e39b228ddaa3d42da794c75512e566979c
[]
no_license
AgnitumuS/gitv
93b2359e1bf9f2b6c945298c61c5c6dbfeea49b3
242c9a10a0aeb41b9589de9f254e6ce9f57bd77a
refs/heads/master
2021-08-08T00:50:10.630301
2017-11-09T08:10:33
2017-11-09T08:10:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,979
java
package com.tvos.apps.utils; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.LinearInterpolator; import com.gitvdemo.video.R; public class AnimationUtil { private static int ANIMATION_X = R.array.voice_more_app_array; private static int ANIMATION_Y = R.array.voice_new_live_array; class AnonymousClass1 extends AnimatorListenerAdapter { private final /* synthetic */ boolean val$focused; private final /* synthetic */ View val$view; AnonymousClass1(boolean z, View view) { this.val$focused = z; this.val$view = view; } public void onAnimationEnd(Animator animation) { if (!this.val$focused) { this.val$view.setLayerType(0, null); this.val$view.setTag(AnimationUtil.ANIMATION_X, null); this.val$view.setTag(AnimationUtil.ANIMATION_Y, null); } } } public static void startFadein(View view, float start, float end, long duration) { Animation animation = new AlphaAnimation(start, end); animation.setDuration(duration); view.startAnimation(animation); } public static void zoomAnimation(View view, boolean focused, float scale, int microsecond) { zoomAnimation(view, focused, scale, microsecond, true); } public static void zoomAnimation(View view, boolean focused, float scale, int microsecond, boolean needSoftwareLayer) { ObjectAnimator ax = (ObjectAnimator) view.getTag(ANIMATION_X); ObjectAnimator ay = (ObjectAnimator) view.getTag(ANIMATION_Y); if (ax != null) { ax.end(); } if (ay != null) { ay.end(); } view.setTag(ANIMATION_X, null); view.setTag(ANIMATION_Y, null); if (focused) { ax = ObjectAnimator.ofFloat(view, "scaleX", new float[]{1.0f, scale}); ay = ObjectAnimator.ofFloat(view, "scaleY", new float[]{1.0f, scale}); } else { ax = ObjectAnimator.ofFloat(view, "scaleX", new float[]{scale, 1.0f}); ay = ObjectAnimator.ofFloat(view, "scaleY", new float[]{scale, 1.0f}); } if (needSoftwareLayer) { view.setLayerType(2, null); } ax.setDuration((long) microsecond); ax.setInterpolator(new LinearInterpolator()); view.setTag(ANIMATION_X, ax); ax.start(); ay.setDuration((long) microsecond); ay.setInterpolator(new LinearInterpolator()); ay.addListener(new AnonymousClass1(focused, view)); view.setTag(ANIMATION_Y, ay); ay.start(); } public static void setAlphaAnimation(View view, float start, float end, long time) { ObjectAnimator oa = ObjectAnimator.ofFloat(view, "alpha", new float[]{start, end}); oa.setDuration(time); oa.start(); } public static void setScaleAnimation(View view, float start, float end, long time) { ObjectAnimator ox = ObjectAnimator.ofFloat(view, "scaleX", new float[]{start, end}); ObjectAnimator oy = ObjectAnimator.ofFloat(view, "scaleY", new float[]{start, end}); AnimatorSet set = new AnimatorSet(); set.setDuration(time); set.playTogether(new Animator[]{ox, oy}); set.start(); } public static void scaleView(View v, float t, int duration) { v.setLayerType(1, null); AnimatorSet set = new AnimatorSet(); r1 = new Animator[2]; r1[0] = ObjectAnimator.ofFloat(v, "scaleX", new float[]{v.getScaleX(), t}); r1[1] = ObjectAnimator.ofFloat(v, "scaleY", new float[]{v.getScaleY(), t}); set.playTogether(r1); set.setDuration((long) duration).start(); } }
[ "liuwencai@le.com" ]
liuwencai@le.com
6a3d0998106668b9eb2815a64e3902873868c545
96c5d6f05d80b7ed0f049dbecc5d888aca4486e4
/src/main/java/com/ebay/soap/eBLBaseComponents/AttributeRecommendationsType.java
d98994d8fc65d5b34709c298943b1d2d13ff12dc
[]
no_license
lespaul361/eBaySDK939
4bb445b9553960e24b74e6ff3f8e8cc9fcb36e74
717b31e5611d499b11c3843adef18078e21ce914
refs/heads/master
2020-03-25T04:02:57.220508
2018-08-03T03:50:19
2018-08-03T03:50:19
114,824,989
0
0
null
null
null
null
UTF-8
Java
false
false
3,799
java
package com.ebay.soap.eBLBaseComponents; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import org.w3c.dom.Element; /** * * This type was deprecated with Version 805 along with the <b>GetItemRecommendations</b> call. * * * <p>Java class for AttributeRecommendationsType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="AttributeRecommendationsType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="AttributeSetArray" type="{urn:ebay:apis:eBLBaseComponents}AttributeSetArrayType" minOccurs="0"/> * &lt;any/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AttributeRecommendationsType", propOrder = { "attributeSetArray", "any" }) public class AttributeRecommendationsType implements Serializable { private final static long serialVersionUID = 12343L; @XmlElement(name = "AttributeSetArray") protected AttributeSetArrayType attributeSetArray; @XmlAnyElement(lax = true) protected List<Object> any; /** * Gets the value of the attributeSetArray property. * * @return * possible object is * {@link AttributeSetArrayType } * */ public AttributeSetArrayType getAttributeSetArray() { return attributeSetArray; } /** * Sets the value of the attributeSetArray property. * * @param value * allowed object is * {@link AttributeSetArrayType } * */ public void setAttributeSetArray(AttributeSetArrayType value) { this.attributeSetArray = value; } /** * * * @return * array of * {@link Element } * {@link Object } * */ public Object[] getAny() { if (this.any == null) { return new Object[ 0 ] ; } return ((Object[]) this.any.toArray(new Object[this.any.size()] )); } /** * * * @return * one of * {@link Element } * {@link Object } * */ public Object getAny(int idx) { if (this.any == null) { throw new IndexOutOfBoundsException(); } return this.any.get(idx); } public int getAnyLength() { if (this.any == null) { return 0; } return this.any.size(); } /** * * * @param values * allowed objects are * {@link Element } * {@link Object } * */ public void setAny(Object[] values) { this._getAny().clear(); int len = values.length; for (int i = 0; (i<len); i ++) { this.any.add(values[i]); } } protected List<Object> _getAny() { if (any == null) { any = new ArrayList<Object>(); } return any; } /** * * * @param value * allowed object is * {@link Element } * {@link Object } * */ public Object setAny(int idx, Object value) { return this.any.set(idx, value); } }
[ "lespaul36@gmail.com" ]
lespaul36@gmail.com
b28a1e2d23109fbfd9321c665daf22281ffba12b
0c7a1f6917e9db647daecc974d63ff11b69b0fda
/TruyenTNV_Web/src/main/java/vn/com/fis/controller/css/PrepaidListManagementController.java
8181c69c5c30082e924f00d41f41745e4f904d11
[]
no_license
rsfirst/TruyenTNV
3971441a2a222f72a06517a74f4bff6f684e38a8
091f29039054975b61f107c52a53e38311931a40
refs/heads/master
2022-07-05T23:08:14.312035
2020-03-11T03:58:37
2020-03-11T03:58:37
241,400,377
0
0
null
2022-06-29T18:00:36
2020-02-18T15:44:13
JavaScript
UTF-8
Java
false
false
2,758
java
package vn.com.fis.controller.css; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import vn.com.fis.business.css.PrepaidListManagementBusiness; import vn.com.fis.model.css.PrepaidListManagementSearchInput; import vn.com.fis.model.css.PrepaidListManagementSearchOutput; import vn.com.fis.utils.css.CommonConstant; import vn.com.fis.utils.css.Constants; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.List; @Controller public class PrepaidListManagementController { /** * The Constant LOG. */ private static final Logger LOG = LoggerFactory.getLogger(PrepaidListManagementController.class); @Autowired PrepaidListManagementBusiness prepaidListManagementBusiness; @RequestMapping(value = Constants.ACTION_PREPAID_LIST_MANAGEMENT_SEARCH, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @PreAuthorize("eimSecured('" + Constants.ITEM_CODE.PREPAID_LIST_MANAGEMENT + "')") public ResponseEntity<?> searchPrepaidList(HttpServletRequest request, @RequestBody PrepaidListManagementSearchInput input) throws Exception { String nomeMetodo = ".searchPrepaidList() "; LOG.info(LOG.getName() + nomeMetodo + " user: " + SecurityContextHolder.getContext().getAuthentication().getName() + CommonConstant.BEGIN_LOG); LOG.info(LOG.getName() + CommonConstant.PARAMETER + "; userExcute: " + input.getUserExcute() + "; fromDate = " + input.getFromDate() + "; toDate = " + input.getToDate()); List<PrepaidListManagementSearchOutput> lstResult = new ArrayList<PrepaidListManagementSearchOutput>(); try { lstResult = prepaidListManagementBusiness.searchPrepaidList(request, input); } catch (Exception ex) { ex.printStackTrace(); LOG.error(ex.getMessage(), ex); LOG.info(LOG.getName() + nomeMetodo + CommonConstant.END_LOG); throw new Exception(ex.getMessage()); } LOG.info(LOG.getName() + nomeMetodo + CommonConstant.END_LOG); return new ResponseEntity<List<PrepaidListManagementSearchOutput>>(lstResult, HttpStatus.OK); } }
[ "anhvuong6996@gmail.com" ]
anhvuong6996@gmail.com
18f964e7291eab57e49192aa5f019c66b3e56886
fb52263c4b30487b4943122a9e29b5a348093e86
/src/main/java/uk/ac/ebi/jmzidml/model/mzidml/Measure.java
41fed8b8adf8094ca108488f6c26ae1d30413fa2
[]
no_license
germa/jmzIdentML
d54671994080e0f572f5d2d5bf16cf83c21ec8b6
96ae13493bb63b9c8f946ad4dfe045f515573ea7
refs/heads/master
2020-04-01T17:25:33.595453
2018-06-19T14:11:35
2018-06-19T14:11:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,245
java
package uk.ac.ebi.jmzidml.model.mzidml; import uk.ac.ebi.jmzidml.model.CvParamCapable; import uk.ac.ebi.jmzidml.model.CvParamListCapable; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * References to CV terms defining the measures about product ions to be reported in SpectrumIdentificationItem * * <p>Java class for MeasureType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="MeasureType"&gt; * &lt;complexContent&gt; * &lt;extension base="{http://psidev.info/psi/pi/mzIdentML/1.1}IdentifiableType"&gt; * &lt;sequence&gt; * &lt;element name="cvParam" type="{http://psidev.info/psi/pi/mzIdentML/1.1}CVParamType" maxOccurs="unbounded"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "MeasureType", propOrder = { "cvParam" }) public class Measure extends Identifiable implements Serializable, CvParamListCapable { private final static long serialVersionUID = 100L; @XmlElement(required = true) protected List<CvParam> cvParam; /** * Gets the value of the cvParam property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the cvParam property. * * <p> * For example, to add a new item, do as follows: * <pre> * getCvParam().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link CvParam } * * */ public List<CvParam> getCvParam() { if (cvParam == null) { cvParam = new ArrayList<CvParam>(); } return this.cvParam; } }
[ "ypriverol@gmail.com" ]
ypriverol@gmail.com
e3ab91d29150a3c1a81fe96efb1bb5abe81e21c3
69276b63e50054ab28fab2c4ff222a9846fd566f
/oktatas/jpaspringboot/src/main/java/jpaspringboot/Employee.java
a363fa0e895a964d67bff215059f1e077b3c629e
[]
no_license
BirkasTivadar/senior-solutions
2dbde7780edeb7ecd09fa1730a5e9ad7ac446b25
32b691dfabfe93ccedcec7668e3db1492f8ed8f1
refs/heads/master
2023-08-20T18:13:00.221615
2021-10-26T19:11:04
2021-10-26T19:11:04
308,442,029
0
0
null
null
null
null
UTF-8
Java
false
false
658
java
package jpaspringboot; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class Employee { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; public Employee() { } public Employee(String name) { this.name = name; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "birkastivadar@gmail.com" ]
birkastivadar@gmail.com
36cdc2562f9ea906ef4a67cad51bdc80dae2d0fa
062e6e7a36cf65f82e33f762e6eac7058f9baa1d
/sky-common/sky-common-minio/src/main/java/com/cloud/common/minio/http/MinioEndpoint.java
484d18135dbd295237ba8fe3abe0637cbf0bc96d
[]
no_license
sengeiou/sky
066d5b02ad7c2659ba85237071bd69754f0bdc15
ba12c4d5a1a83241e61d033d26d239575f75e69b
refs/heads/master
2022-10-04T18:49:40.659033
2020-06-07T23:45:46
2020-06-07T23:45:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,344
java
/* * Copyright (c) 2018-2025, lengleng 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 the pig4cloud.com developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: lengleng (wangiegie@gmail.com) */ package com.cloud.common.minio.http; import com.pig4cloud.common.minio.service.MinioTemplate; import com.pig4cloud.common.minio.vo.MinioItem; import com.pig4cloud.common.minio.vo.MinioObject; import io.minio.messages.Bucket; import lombok.AllArgsConstructor; import lombok.SneakyThrows; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.util.HashMap; import java.util.List; import java.util.Map; /** * minio 对外提供服务端点 * * @author lengleng * <p> * minio.endpoint.enable */ @ConditionalOnProperty(name = "minio.endpoint.enable", havingValue = "true") @RestController @AllArgsConstructor @RequestMapping("${minio.endpoint.name:/minio}") public class MinioEndpoint { private final MinioTemplate template; /** * Bucket Endpoints */ @SneakyThrows @PostMapping("/bucket/{bucketName}") public Bucket createBucker(@PathVariable String bucketName) { template.createBucket(bucketName); return template.getBucket(bucketName).get(); } @SneakyThrows @GetMapping("/bucket") public List<Bucket> getBuckets() { return template.getAllBuckets(); } @SneakyThrows @GetMapping("/bucket/{bucketName}") public Bucket getBucket(@PathVariable String bucketName) { return template.getBucket(bucketName).orElseThrow(() -> new IllegalArgumentException("Bucket Name not found!")); } @SneakyThrows @DeleteMapping("/bucket/{bucketName}") @ResponseStatus(HttpStatus.ACCEPTED) public void deleteBucket(@PathVariable String bucketName) { template.removeBucket(bucketName); } /** * Object Endpoints */ @SneakyThrows @PostMapping("/object/{bucketName}") public MinioObject createObject(@RequestBody MultipartFile object, @PathVariable String bucketName) { String name = object.getOriginalFilename(); template.putObject(bucketName, name, object.getInputStream(), object.getSize(), object.getContentType()); return new MinioObject(template.getObjectInfo(bucketName, name)); } @SneakyThrows @PostMapping("/object/{bucketName}/{objectName}") public MinioObject createObject(@RequestBody MultipartFile object, @PathVariable String bucketName, @PathVariable String objectName) { template.putObject(bucketName, objectName, object.getInputStream(), object.getSize(), object.getContentType()); return new MinioObject(template.getObjectInfo(bucketName, objectName)); } @SneakyThrows @GetMapping("/object/{bucketName}/{objectName}") public List<MinioItem> filterObject(@PathVariable String bucketName, @PathVariable String objectName) { return template.getAllObjectsByPrefix(bucketName, objectName, true); } @SneakyThrows @GetMapping("/object/{bucketName}/{objectName}/{expires}") public Map<String, Object> getObject(@PathVariable String bucketName, @PathVariable String objectName, @PathVariable Integer expires) { Map<String, Object> responseBody = new HashMap<>(8); // Put Object info responseBody.put("bucket", bucketName); responseBody.put("object", objectName); responseBody.put("url", template.getObjectURL(bucketName, objectName, expires)); responseBody.put("expires", expires); return responseBody; } @SneakyThrows @ResponseStatus(HttpStatus.ACCEPTED) @DeleteMapping("/object/{bucketName}/{objectName}/") public void deleteObject(@PathVariable String bucketName, @PathVariable String objectName) { template.removeObject(bucketName, objectName); } }
[ "wangyongtao@ijiuyue.com" ]
wangyongtao@ijiuyue.com
288a9d58fd2633c374c214542ea478392e9bd742
7c83b3cf100af54fc1aa9b82b9367f9a58696372
/src/main/java/org/lanternpowered/server/world/extent/UnmodifiableBiomeViewTransform.java
f5cb3cd02f9b6a500ff0b36428fe01adf0cf7f35
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
GustaveHooghmoed/LanternServer
c971eb284fdc18554f4aceefef47f40f116e4f14
61b3d181e87d571bcea01fbab8093a0a718578f8
refs/heads/master
2021-05-14T14:29:46.643758
2017-09-21T13:15:46
2017-12-30T14:10:59
115,972,253
1
0
null
2018-01-02T03:48:32
2018-01-02T03:48:32
null
UTF-8
Java
false
false
2,631
java
/* * This file is part of LanternServer, licensed under the MIT License (MIT). * * Copyright (c) LanternPowered <https://www.lanternpowered.org> * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the Software), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.lanternpowered.server.world.extent; import com.flowpowered.math.vector.Vector3i; import org.lanternpowered.server.world.extent.worker.LanternBiomeVolumeWorker; import org.spongepowered.api.util.DiscreteTransform3; import org.spongepowered.api.world.extent.UnmodifiableBiomeVolume; import org.spongepowered.api.world.extent.worker.BiomeVolumeWorker; public class UnmodifiableBiomeViewTransform extends AbstractBiomeViewTransform<UnmodifiableBiomeVolume> implements UnmodifiableBiomeVolume { public UnmodifiableBiomeViewTransform(UnmodifiableBiomeVolume volume, DiscreteTransform3 transform) { super(volume, transform); } @Override public UnmodifiableBiomeVolume getBiomeView(Vector3i newMin, Vector3i newMax) { return new UnmodifiableBiomeViewDownsize(this.volume, this.inverseTransform.transform(newMin), this.inverseTransform.transform(newMax)).getBiomeView(this.transform); } @Override public UnmodifiableBiomeVolume getBiomeView(DiscreteTransform3 transform) { return new UnmodifiableBiomeViewTransform(this.volume, this.transform.withTransformation(transform)); } @Override public BiomeVolumeWorker<? extends UnmodifiableBiomeVolume> getBiomeWorker() { return new LanternBiomeVolumeWorker<>(this); } }
[ "seppevolkaerts@hotmail.com" ]
seppevolkaerts@hotmail.com
cff8fefdc5568a8e2fcfd9615b056d260911d141
f23920b48cc856cc856e0c9eea2c03d8698102ca
/mike-base/src/main/java/microtech/hxswork/com/latte/init/ConfigKeys.java
35824e80bba8559c6157196744d34f6fda16fe2c
[]
no_license
hxs2mr/imocc
24bf7664f89c46d757e07fb1f614d9fc2b0d8135
c5d2820cfd7b922866a5dacc738074f3fdf4e052
refs/heads/master
2021-09-06T20:19:17.439309
2018-02-11T02:23:26
2018-02-11T02:23:26
110,219,073
0
0
null
null
null
null
UTF-8
Java
false
false
332
java
package microtech.hxswork.com.latte.init; /** * Created by microtech on 2017/11/10. */ public enum ConfigKeys { API_HOST, APPLICATION_CONTEXT, CONFIG_READY, ICON, LOADER_DELAYED, INTERCEPTOR, WX_CHAT_APP_ID, WX_CHAT_APP_SECRET, ACTIVITY, HANDLER, JAVASCRIPT_INTERFACE, WEB_HOST }
[ "Hxs19941213" ]
Hxs19941213
2eba3c037cb432fab341b67fd6fe347d68b83da9
e37994a367046c7ab85a45984fdd76a43929a245
/src/main/java/com/github/sergueik/ssstfx/SideCommand.java
1eb20743efbb623dd2d34a660ba7bf71bc736765
[ "MIT" ]
permissive
sergueik/SSSTFX
7ce87beb032d4282014317725e1905c0ac8d5a31
5005cc5c2954d5fa387e7b1a2321c7812a2dffa8
refs/heads/master
2022-06-02T14:09:28.762604
2022-05-30T12:32:29
2022-05-30T12:32:29
157,012,745
1
2
MIT
2022-05-20T20:53:13
2018-11-10T19:08:55
Java
UTF-8
Java
false
false
3,053
java
package com.github.sergueik.ssstfx; /** * Copyright 2018 Serguei Kouzmine */ import static java.lang.String.format; import java.util.Date; import java.util.List; import java.util.Map; import com.github.sergueik.ssstfx.Operation; /** * Selenium IDE TNG Side Command JSON mapped class * @author: Serguei Kouzmine (kouzmine_serguei@yahoo.com) */ final class SideCommand { private String name; private String id; private String command; private String comment; private String target; private String value; // extracted fields private Selector selector; private String selectorValue; private Operation operation; // "operationArgument" would be redundant with value public String getName() { return name; } public void setName(String data) { this.name = data; } public String getId() { return id; } public Selector getSelector() { return selector; } public void setSelector(Selector data) { this.selector = data; } public void setSelector(String data) { System.err .println(String.format("Executing setSelector from: \"%s\"", data)); if (!data.isEmpty()) { System.err.println("Processing: " + data); if (data.matches("^(\\w+)=(.+)$")) { String sel = data.replaceFirst("=(.+)$", ""); System.err.println("setSelector extracted sel: " + data); for (Selector obj : Selector.values()) { if (obj.getSelector().equals(sel)) { this.selector = obj; this.selectorValue = data.replaceFirst(String.format("^%s=", sel), ""); } } } } } public String getSelectorValue() { return selectorValue; } public void setSelectorValue(String data) { this.selectorValue = data; } public Operation getOperation() { return operation; } public void setOperation(Operation data) { this.operation = data; } public void setOperation(String data) { for (Operation op : Operation.values()) { if (op.getOperation().equals(data)) { this.operation = op; } } } public void setId(String data) { this.id = data; } public String getCommand() { return command; } public void setCommand(String data) { this.command = data; } public String getComment() { return comment; } public void setComment(String data) { this.comment = data; } public String getTarget() { return target; } public void setTarget(String target) { this.target = target; } public String getValue() { return value; } public void setValue(String data) { this.value = data; } @Override public String toString() { return new StringBuilder().append(format("\"id\": \"%s\"\n", id)) .append(format("\"name\": \"%s\"\n", name)) .append(format("\"command\": \"%s\"\n", command)) .append(format("\"comment\": \"%s\"\n", comment)) .append(format("\"target\": \"%s\"\n", target)) .append(format("\"selector\": \"%s\"\n", selector)) .append(format("\"selectorValue\": \"%s\"\n", selectorValue)) .append(format("\"operation\": \"%s\"\n", operation)) .append(format("\"value\": \"%s\"\n", value)).toString(); } }
[ "kouzmine_serguei@yahoo.com" ]
kouzmine_serguei@yahoo.com
861c75ffe63877c1a1646e1cc3f52acbb268f57a
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.horizon-Horizon/sources/X/AnonymousClass0Pi.java
73f1f7ac6552393f8997f3eac04131156ef138db
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
1,805
java
package X; import com.facebook.inject.ApplicationScoped; import java.util.ArrayDeque; import javax.annotation.Nullable; /* renamed from: X.0Pi reason: invalid class name */ public final class AnonymousClass0Pi { public static final ArrayDeque<AnonymousClass0Pi> A04 = new ArrayDeque<>(32); @Nullable public AnonymousClass0pN A00; @Nullable public AnonymousClass0QF A01; public AnonymousClass0Qe A02; @Nullable public Byte A03; @Nullable public static AnonymousClass0Pi A00(@Nullable Object obj, @Nullable AbstractC06640p5 r4) { AnonymousClass0Pi pollFirst; if (obj != null || r4 == null) { return null; } ArrayDeque<AnonymousClass0Pi> arrayDeque = A04; synchronized (arrayDeque) { pollFirst = arrayDeque.pollFirst(); } if (pollFirst == null) { pollFirst = new AnonymousClass0Pi(); } AnonymousClass0Qe r2 = AnonymousClass0Qe.A01.get(); pollFirst.A02 = r2; byte b = r2.A00; r2.A00 = (byte) (1 | b); pollFirst.A03 = Byte.valueOf(b); AnonymousClass0pN r0 = (AnonymousClass0pN) r4.getScope(ApplicationScoped.class); pollFirst.A00 = r0; pollFirst.A01 = r0.A01(); return pollFirst; } public final void A01() { AnonymousClass0QF r0 = this.A01; if (r0 != null) { AnonymousClass0pN.A00(r0); this.A01 = null; } this.A00 = null; Byte b = this.A03; if (b != null) { this.A02.A00 = b.byteValue(); this.A03 = null; } this.A02 = null; ArrayDeque<AnonymousClass0Pi> arrayDeque = A04; synchronized (arrayDeque) { arrayDeque.addFirst(this); } } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
ec3a3cd453e14ff73b510ba639958ce8b75db2cd
cfd4a68aad521aac7b1f3af1c868dfdd397666ab
/order-puller/src/main/java/com/topscore/omnichannel/order/config/WebConfig.java
d735ee366ecdfb55b47650b1a271c9939c8e3738
[]
no_license
meiyanzhong/order
ff91ba9afc6d8e117916537ec96bab1948030d3a
72612593823a349f26627034cb404e2324b35820
refs/heads/master
2021-09-01T05:15:17.224869
2017-12-25T02:03:19
2017-12-25T02:03:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
762
java
package com.topscore.omnichannel.order.config; import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory; import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import static io.undertow.UndertowOptions.ENABLE_HTTP2; @Configuration public class WebConfig { @Bean public EmbeddedServletContainerFactory embeddedServletContainerFactory() { UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory(); factory.addBuilderCustomizers(builder -> builder.setServerOption(ENABLE_HTTP2, true)); return factory; } }
[ "dengbin19910916@163.com" ]
dengbin19910916@163.com
466bea6a14efc12648a6b0e72932aef5b8644fc3
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Chart/25/org/jfree/data/xy/XYSeriesCollection_hashCode_391.java
f60ecb55046a9d8bec24b9e748397260273d0383
[]
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
723
java
org jfree data repres collect link seri xyseri object dataset seri collect xyseriescollect abstract interv dataset abstractintervalxydataset return hash code hash code hash code hashcod question equal data data hash code hashcod
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
9d1f303943ad69e0c67a8f0b3612943ef42bcfda
5e49e02ed64df262155f04f00b6408b7b9db1ac9
/securitypermission-db/src/main/java/securitypermission_db/authority/controller/AuthorityController.java
52223b3b1591a1359073f248dec5da2d46cde779
[]
no_license
WPZC/cloudutils
490d564d591180c886b0355f813f84b14ffc5db7
58f1c9b705448ec384d128415ab5df3d093bdadd
refs/heads/master
2022-12-04T11:33:25.756567
2020-08-19T09:57:27
2020-08-19T09:57:27
286,442,396
0
0
null
null
null
null
UTF-8
Java
false
false
999
java
package securitypermission_db.authority.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import securitypermission_db.authority.globalregister.GlobalController; import securitypermission_db.commondb.entity.RoleEntity; import securitypermission_db.commondb.entity.UserEntity; import java.util.List; /** * @author wqy * @version 1.0 * @date 2020/5/28 11:09 */ @Controller @RequestMapping(value = "/ac") public class AuthorityController extends GlobalController { @RequestMapping(value = "/findByUserName",method = {RequestMethod.POST}) @ResponseBody public UserEntity findByUserName(@RequestParam("username") String username){ return userService.findByUserName(username); } @PostMapping(value = "/findByUserRole") @ResponseBody public List<RoleEntity> findByUserRole(@RequestParam("id") Long id){ return roleService.findByUserRole(id); } }
[ "1272722954@qq.com" ]
1272722954@qq.com
10bafde21baf77b7c57b037397b49b095deb2fe6
cf8ce47e5f608740169e671625034feffb9260e9
/commons-pyh/src/main/java/com/programyourhome/common/util/BeanCopier.java
0c9f6b8d773a793fa83ba4f98d9a5fcce73b5992
[]
no_license
ewjmulder/program-your-home
a0c98980e7859c29bcb5014238a0542db783959b
ed3f6b64f12d3fd03e38e5dacbb3c049c9a2770a
refs/heads/master
2020-12-20T12:33:18.718302
2017-12-19T11:04:40
2017-12-19T11:04:40
23,797,369
6
0
null
null
null
null
UTF-8
Java
false
false
1,441
java
package com.programyourhome.common.util; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; @Component public class BeanCopier { /* * TODO / IDEA: Create own mapper that has a param for a class that defines what source fields to copy instead of what target fields * to set. Also, validation on inheritance not needed per see, is choice of using caller if it makes sence (won't break anything). * @Inject * private ObjectMapper objectMapper; * @Inject * private MrBeanModule mrBeanModule; * final Class<?> propertyClassWithSetters = this.mrBeanModule.getMaterializer().resolveAbstractType(this.objectMapper.getDeserializationConfig(), * this.objectMapper.getTypeFactory().constructSimpleType(propertyClass, new JavaType[0])).getRawClass(); */ public <T> T copyToNew(final Object source, final Class<T> targetClass) { T newInstance; try { newInstance = targetClass.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new IllegalStateException("Class " + targetClass + " could not be instantiazed with newInstance()."); } return this.copyTo(source, newInstance); } public <T> T copyTo(final Object source, final T target) { BeanUtils.copyProperties(source, target); return target; } }
[ "ewjmulder@yahoo.com" ]
ewjmulder@yahoo.com
4449224c6b4087a979a58d51ddb4177944e1fce6
92dd6bc0a9435c359593a1f9b309bb58d3e3f103
/src/May2021Leetcode/_0329LongestIncreasingPathInAMatrix.java
ce3f1f46d619de07fef746e091b90c741434d713
[ "MIT" ]
permissive
darshanhs90/Java-Coding
bfb2eb84153a8a8a9429efc2833c47f6680f03f4
da76ccd7851f102712f7d8dfa4659901c5de7a76
refs/heads/master
2023-05-27T03:17:45.055811
2021-06-16T06:18:08
2021-06-16T06:18:08
36,981,580
3
3
null
null
null
null
UTF-8
Java
false
false
1,447
java
package May2021Leetcode; public class _0329LongestIncreasingPathInAMatrix { public static void main(String[] args) { System.out.println(longestIncreasingPath( new int[][] { new int[] { 9, 9, 4 }, new int[] { 6, 6, 8 }, new int[] { 2, 1, 1 } })); System.out.println(longestIncreasingPath( new int[][] { new int[] { 3, 4, 5 }, new int[] { 3, 2, 6 }, new int[] { 2, 2, 1 } })); } public static int longestIncreasingPath(int[][] matrix) { if (matrix == null || matrix.length == 0) return 0; int maxLength = 0; int[][] cache = new int[matrix.length][matrix[0].length]; for (int i = 0; i < matrix.length; i++) { for (int j = 0; j < matrix[0].length; j++) { maxLength = Math.max(maxLength, dfs(i, j, matrix[i][j], matrix, cache)); } } return maxLength; } public static int dfs(int x, int y, int currVal, int[][] matrix, int[][] cache) { if (cache[x][y] != 0) return cache[x][y]; int length = 1; int[][] dirs = new int[][] { new int[] { -1, 0 }, new int[] { 1, 0 }, new int[] { 0, -1 }, new int[] { 0, 1 } }; for (int i = 0; i < dirs.length; i++) { int newX = x + dirs[i][0]; int newY = y + dirs[i][1]; if (newX < 0 || newY < 0 || newX >= matrix.length || newY >= matrix[0].length) continue; if (matrix[newX][newY] <= currVal) continue; length = Math.max(length, 1 + dfs(newX, newY, matrix[newX][newY], matrix, cache)); } cache[x][y] = length; return length; } }
[ "hsdars@gmail.com" ]
hsdars@gmail.com
e379da56802aa7702cabdf9ccb4850049b9e8d1a
7811e51a71efc9a6ef7ced212f59165b53b36e80
/spring-boot-shiro-sample/src/main/java/com/stormpath/shiro/samples/springboot/common/model/ErrorMessage.java
3d30cfc268e2332d93ff566fcd9b1bbd237a2b81
[ "Apache-2.0" ]
permissive
zb872676223/shiro-sample
673a22ad12543775859474bfdf090d085389d6da
e3b09cf13082d0b2da7066040293a22597526dd6
refs/heads/master
2020-04-27T20:47:37.635824
2019-02-15T02:35:55
2019-02-15T02:36:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
258
java
package com.stormpath.shiro.samples.springboot.common.model; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; /** * @author litz-a */ @Getter @Setter @AllArgsConstructor public class ErrorMessage { private String error; }
[ "litz-a@glodon.com" ]
litz-a@glodon.com
eea0c3bda664150531be6830703db8414c9ea8cb
29227577f1b07a9fcada5d38d6c57cded3515cb2
/src/main/java/nanocad/AtomTypeTest.java
1d584af903228f2c1ef1ce648316f7261ed93a46
[ "Apache-2.0" ]
permissive
SciGaP/seagrid-rich-client
ad11edd2691c0ac1863591e106cb5f4f19d6d633
b7114b3bb4bb3796e8f9ab3b49e5bd08f9fc005e
refs/heads/master
2023-06-23T16:33:10.356706
2022-06-16T02:27:46
2022-06-16T02:27:46
45,587,225
1
8
Apache-2.0
2023-06-14T22:43:06
2015-11-05T04:19:15
Java
UTF-8
Java
false
false
8,024
java
package nanocad; import nanocad.util.YesNoDialog; import nanocad.util.atomProperty; public class AtomTypeTest { protected atomProperty currentProperty; protected atom atomToTest; protected group groupToTestIn; private boolean verbose = false; protected boolean showPopups = false; /** * Insert the method's description here. * Creation date: (6/20/00 11:35:43 AM) * @param testingAtom atom * @param testingGroup group */ public AtomTypeTest(atom testingAtom, group testingGroup) { atomToTest = testingAtom; groupToTestIn = testingGroup; // System.out.println(" $$$%%%$$$ groupToTestIn = " + testingGroup); } protected boolean askMetalTransitionNumber(int propertyToTest) { int mtNumber = currentProperty.getParameterAsInt(propertyToTest); return yesNoDialog("Is this metal's transition number" + mtNumber + "?"); } //Type Testers protected boolean AtomicNumberEq(int propertyToTest) { int aNumber = atomToTest.atomicNumber(); int iparam = currentProperty.getParameterAsInt(propertyToTest); return (iparam == aNumber); } //sends the simple (non-ANDed) property to the appropiate function public boolean evaluate(int propertyToTest) { byte propertyType = currentProperty.getPropertyType(propertyToTest); //if(verbose == true){ // System.out.println("Testing " + propertyType);//} switch (propertyType) { case 0 : return Metal(propertyToTest); case 1 : return isCyclic(propertyToTest); case 2 : return AtomicNumberEq(propertyToTest); case 3 : return NumBondsGr(propertyToTest); case 4 : return NumXBondsGr(1, propertyToTest); case 5 : return NumXBondsGr(2, propertyToTest); case 6 : return NumXBondsGr(3, propertyToTest); case 7 : return Not(propertyToTest); case 8 : //one adjacent Such That return XAdjST(1, propertyToTest); case 9 : //two adjacent Such That return XAdjST(2, propertyToTest); case 10 : //etc return XAdjST(3, propertyToTest); case 11 : //etc return XAdjST(4, propertyToTest); case 12 : return XatomsYbondedST(1, 2, propertyToTest); case 13 : return XatomsYbondedST(2, 2, propertyToTest); case 14 : return XatomsYbondedST(3, 2, propertyToTest); case 15 : return XatomsYbondedST(4, 2, propertyToTest); case 16 : return XatomsYbondedST(1, 3, propertyToTest); case 17 : return XatomsYbondedST(2, 3, propertyToTest); case 18 : return XatomsYbondedST(3, 3, propertyToTest); case 19 : return XatomsYbondedST(4, 3, propertyToTest); case 23 : return askMetalTransitionNumber(propertyToTest); case 24: return yesNoDialog("Is this atom a carbonium ion?"); default : //System.out.println("Attempt to reference NYI property"); return false; } } /** * Insert the method's description here. * Creation date: (7/19/2000 2:07:46 PM) */ public void highlightCurrentAtom() { atomToTest.setHighlighted(true); atomToTest.getGroup().paint(); } /** * Insert the method's description here. * Creation date: (6/27/00 2:12:35 PM) * @return boolean * @param X int */ protected boolean isConnectedToCurrentAtomInXSteps(atom a, int x) { if (x == 0) return (a == atomToTest); if (a.isMarked()) return false; a.setMarked(true); int i = 0; while (i < groupToTestIn.bondList.size()) { bond b = (bond) groupToTestIn.bondList.elementAt(i); atom oAtom = b.otherAtom(a); if (oAtom != null) if (isConnectedToCurrentAtomInXSteps(oAtom, x - 1)) return true; i++; } return false; } /** * Insert the method's description here. * Creation date: (6/26/00 1:23:57 PM) * @return boolean * @param propertyToTest atomProperty */ public boolean isCyclic(int propertyToTest) { //System.out.println("ANU !!! : groupToTestIn.atomList.size() = " + groupToTestIn.atomList.size() ); for(int i = 0; i < groupToTestIn.atomList.size(); i++) // For each atom ((atom) groupToTestIn.atomList.elementAt(i)).setMarked(false); // unmark everything return isConnectedToCurrentAtomInXSteps(atomToTest, currentProperty.getParameterAsInt(propertyToTest)); } protected boolean Metal(int propertyToTest) { return false; } protected boolean Not(int propertyToEvaluate) { atomProperty parameter = currentProperty.getParameterAsProperty(propertyToEvaluate); AtomTypeTest subTest = new AtomTypeTest(atomToTest, groupToTestIn); boolean subTestResult = subTest.property(parameter, showPopups); return (!subTestResult); } protected boolean NumBondsGr(int propertyToEvaluate) { int bnum = currentProperty.getParameterAsInt(propertyToEvaluate); return (bnum < atomToTest.currentNumBonds()); } protected boolean NumXBondsGr(int x, int propertyToEvaluate) { //returns true of the atom has more than parameter bonds of order x int i = 0; int bondnum = 0; int iparam = currentProperty.getParameterAsInt(propertyToEvaluate); while ((i < groupToTestIn.bondList.size()) && (bondnum <= iparam)) { if ((((bond) groupToTestIn.bondList.elementAt(i)).order() == x) && (((bond) groupToTestIn.bondList.elementAt(i)).otherAtom(atomToTest) != null)) bondnum++; i++; } return (bondnum > iparam); } // Another removal of same functions brought to you by stenhous 11/17/02 protected boolean property(atomProperty property, boolean popups) { if (popups) return propertyWithPopups(property); else return propertyWithoutPopups(property); } public boolean propertyWithoutPopups(atomProperty property) { showPopups = false; currentProperty = property; for (int i = 0;i < property.numberOfProperties(); i++) { if (!(evaluate(i))) { return false; } } return true; } public boolean propertyWithPopups(atomProperty property) { showPopups = true; currentProperty = property; for (int i = 0;i < property.numberOfProperties(); i++) { if (!(evaluate(i))) { return false; } } return true; } /** * Insert the method's description here. * Creation date: (7/19/2000 2:07:46 PM) */ public void unhighlightCurrentAtom() { atomToTest.setHighlighted(false); } /** * Insert the method's description here. * Creation date: (6/27/00 2:43:04 PM) */ public void verbose() { verbose = true; } protected boolean XAdjST(int x, int propertyToTest) { //returns true of there are x atoms adjacent with this property //this would not normally be the most efficient way to do this, but // based on the way atom checks to see if somethingroupToTestIn is adjacent... int i = 0; int numFound = 0; AtomTypeTest subTest; // if((groupToTestIn == null) || (groupToTestIn.bondList == null)) /* if(groupToTestIn == null) System.err.println("@@@@@@@@@@@@@@@@@@@@@@@@@@ ERROR!!!!!!!!! $$$$$$$$"); */ while ((i < groupToTestIn.bondList.size()) && numFound < x) { bond b = (bond) groupToTestIn.bondList.elementAt(i); atom oAtom = b.otherAtom(atomToTest); if (oAtom != null) { subTest = new AtomTypeTest(oAtom, groupToTestIn); if (subTest.property(currentProperty.getParameterAsProperty(propertyToTest), showPopups)) numFound++; } i++; } return (numFound == x); } protected boolean XatomsYbondedST(int x, int y, int propertyToTest) { //returns true of there are x atoms connected with y-order bonds that have this property //this would not normally be the most efficient way to do this, but // based on the way atom checks to see if somethingroupToTestIn is adjacent... int i = 0; int numFound = 0; AtomTypeTest subTest; while ((i < groupToTestIn.bondList.size()) && numFound < x) { bond b = (bond) groupToTestIn.bondList.elementAt(i); if (b.order() == y) { atom oAtom = b.otherAtom(atomToTest); if (oAtom != null) { subTest = new AtomTypeTest(oAtom, groupToTestIn); if (subTest.property(currentProperty.getParameterAsProperty(propertyToTest), showPopups)) numFound++; } } i++; } return (numFound == x); } protected boolean yesNoDialog(String question) { if(showPopups) { highlightCurrentAtom(); YesNoDialog questionDialog = new YesNoDialog(question); questionDialog.ask(); unhighlightCurrentAtom(); return questionDialog.userAnsweredYes(); } else return false; } }
[ "supun.nakandala@gmail.com" ]
supun.nakandala@gmail.com
0ebbd3ed1aec2d2baed1bbb293056b4323772c71
c6401ed00e8bc3832cacc5ec3203de5538dc95c8
/wikibrain-spatial/src/main/java/ags/utils/dataStructures/MinHeap.java
18525c2df8badf14a15d7671275e744eefda6a9f
[ "Apache-2.0" ]
permissive
shilad/wikibrain
6fa94cc71fb1c1fd34c47d4d914affe43f86c280
bb804edd073f6a1762efd7828bcef6d8bf4ad89b
refs/heads/master
2023-03-17T02:51:21.889006
2018-01-16T05:18:37
2018-01-16T05:18:37
10,455,939
56
37
null
2018-03-20T04:21:14
2013-06-03T14:10:08
Java
UTF-8
Java
false
false
277
java
package ags.utils.dataStructures; /** * */ public interface MinHeap<T> { public int size(); public void offer(double key, T value); public void replaceMin(double key, T value); public void removeMin(); public T getMin(); public double getMinKey(); }
[ "shilad@gmail.com" ]
shilad@gmail.com
6412070c8de23996a1c9bd38aae149d684c2adb3
f567c98cb401fc7f6ad2439cd80c9bcb45e84ce9
/src/main/java/com/alipay/api/domain/CardDomainVO.java
3583e8703c33d0a5188131b3eff3e70800126ec3
[ "Apache-2.0" ]
permissive
XuYingJie-cmd/alipay-sdk-java-all
0887fa02f857dac538e6ea7a72d4d9279edbe0f3
dd18a679f7543a65f8eba2467afa0b88e8ae5446
refs/heads/master
2023-07-15T23:01:02.139231
2021-09-06T07:57:09
2021-09-06T07:57:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
890
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 卡域模型 * * @author auto create * @since 1.0, 2015-09-22 11:07:41 */ public class CardDomainVO extends AlipayObject { private static final long serialVersionUID = 8473495756565756871L; /** * 值域域名的描述值,固定为”金融” */ @ApiField("description") private String description; /** * 值域域名,固定为“FINANCE” */ @ApiField("domain_name") private String domainName; public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } public String getDomainName() { return this.domainName; } public void setDomainName(String domainName) { this.domainName = domainName; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
694132fd0358b43e4fb7e088fb05310cb9db2d16
40cd4da5514eb920e6a6889e82590e48720c3d38
/desktop/applis/apps/bean/bean_games/pokemonbean/src/main/java/aiki/beans/moves/MoveBeanClickItem.java
860cf10cd409d30f55d450218f2e184a3dcb1760
[]
no_license
Cardman/projects
02704237e81868f8cb614abb37468cebb4ef4b31
23a9477dd736795c3af10bccccb3cdfa10c8123c
refs/heads/master
2023-08-17T11:27:41.999350
2023-08-15T07:09:28
2023-08-15T07:09:28
34,724,613
4
0
null
2020-10-13T08:08:38
2015-04-28T10:39:03
Java
UTF-8
Java
false
false
426
java
package aiki.beans.moves; import aiki.beans.PokemonBeanStruct; import code.bean.nat.*; import code.bean.nat.*; import code.bean.nat.*; import code.bean.nat.*; public class MoveBeanClickItem implements NatCaller{ @Override public NaSt re(NaSt _instance, NaSt[] _args){ return new NaStSt(( (MoveBean) ((PokemonBeanStruct)_instance).getInstance()).clickItem(NaPa.convertToNumber(_args[0]).intStruct())); } }
[ "f.desrochettes@gmail.com" ]
f.desrochettes@gmail.com
a8b10c255f84c606b009565bbe76e9afb49205ad
f92fc2fbbfde756ecdfda07b361285d2b0f4b4d8
/src/main/java/ninechapter_algorithm/chapter7_array_and_number/twosumclosest/Solution.java
b073ba482c8a5f404cba2b12127f3797f11018b5
[]
no_license
blueaken/JianTestPlayGround
9dbfde62273f9d8593e111bdc201b61ccfcfbfd9
02a962d17a6e7172b96807a785b16e7987fe3f1f
refs/heads/master
2023-08-04T09:13:19.512764
2023-07-15T11:17:25
2023-07-15T11:17:25
19,551,504
1
2
null
null
null
null
UTF-8
Java
false
false
956
java
package ninechapter_algorithm.chapter7_array_and_number.twosumclosest; import java.util.Arrays; /** * Author: blueaken * Date: 6/2/16 09:36 */ public class Solution { /** * @param nums an integer array * @param target an integer * @return the difference between the sum and the target */ public int twoSumCloset(int[] nums, int target) { // Write your code here if(nums == null) { return -1; } Arrays.sort(nums); int start = 0; int end = nums.length - 1; int minDiff = Integer.MAX_VALUE; while (start < end) { int diff = nums[start] + nums[end] - target; if (diff == 0) { return 0; } minDiff = Math.min(Math.abs(diff), minDiff); if (diff > 0) { end--; } else { start++; } } return minDiff; } }
[ "blueaken@gmail.com" ]
blueaken@gmail.com
10d5f57d9d28f2197a61119b9bdb77626f739cfc
7be20a190be8710b747d0d5405545b128442722a
/happyi/src/main/java/org/thvc/happyi/utils/guide/AnimationFactory.java
235330496b6dd3261164ec4ce51121791d29e2ce
[]
no_license
XieQinghua/klandroid
da7072060369f12acac586dbe2833e044aa6459d
edbc6196a2500e92063515e7a5302eafec6a8d63
refs/heads/master
2021-01-23T07:37:54.520416
2017-03-28T10:52:07
2017-03-28T10:52:07
86,412,862
0
0
null
null
null
null
UTF-8
Java
false
false
2,696
java
package org.thvc.happyi.utils.guide; import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.graphics.Point; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; /** * create by huangxinqi * 该方法的作用是 构造显示新手指引时的动画效果 */ public class AnimationFactory implements IAnimationFactory { private static final String ALPHA = "alpha"; private static final float INVISIBLE = 0f; private static final float VISIBLE = 1f; private final AccelerateDecelerateInterpolator interpolator; public AnimationFactory() { interpolator = new AccelerateDecelerateInterpolator(); } @Override public void fadeInView(View target, long duration, final AnimationStartListener listener) { ObjectAnimator oa = ObjectAnimator.ofFloat(target, ALPHA, INVISIBLE, VISIBLE); oa.setDuration(duration).addListener(new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animator) { listener.onAnimationStart(); } @Override public void onAnimationEnd(Animator animator) { } @Override public void onAnimationCancel(Animator animator) { } @Override public void onAnimationRepeat(Animator animator) { } }); oa.start(); } @Override public void fadeOutView(View target, long duration, final AnimationEndListener listener) { ObjectAnimator oa = ObjectAnimator.ofFloat(target, ALPHA, INVISIBLE); oa.setDuration(duration).addListener(new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animator) { } @Override public void onAnimationEnd(Animator animator) { listener.onAnimationEnd(); } @Override public void onAnimationCancel(Animator animator) { } @Override public void onAnimationRepeat(Animator animator) { } }); oa.start(); } @Override public void animateTargetToPoint(MaterialShowcaseView showcaseView, Point point) { AnimatorSet set = new AnimatorSet(); ObjectAnimator xAnimator = ObjectAnimator.ofInt(showcaseView, "showcaseX", point.x); ObjectAnimator yAnimator = ObjectAnimator.ofInt(showcaseView, "showcaseY", point.y); set.playTogether(xAnimator, yAnimator); set.setInterpolator(interpolator); set.start(); } }
[ "305413135@qq.com" ]
305413135@qq.com
f66786da6b726daa7dec96b5544c2ca672ca8b68
f662526b79170f8eeee8a78840dd454b1ea8048c
/org/apache/logging/log4j/message/LocalizedMessageFactory.java
388e478ff5aa94b64769dc232598f18184ec9349
[]
no_license
jason920612/Minecraft
5d3cd1eb90726efda60a61e8ff9e057059f9a484
5bd5fb4dac36e23a2c16576118da15c4890a2dff
refs/heads/master
2023-01-12T17:04:25.208957
2020-11-26T08:51:21
2020-11-26T08:51:21
316,170,984
0
0
null
null
null
null
UTF-8
Java
false
false
2,337
java
/* */ package org.apache.logging.log4j.message; /* */ /* */ import java.util.ResourceBundle; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class LocalizedMessageFactory /* */ extends AbstractMessageFactory /* */ { /* */ private static final long serialVersionUID = -1996295808703146741L; /* */ private final transient ResourceBundle resourceBundle; /* */ private final String baseName; /* */ /* */ public LocalizedMessageFactory(ResourceBundle resourceBundle) { /* 39 */ this.resourceBundle = resourceBundle; /* 40 */ this.baseName = null; /* */ } /* */ /* */ public LocalizedMessageFactory(String baseName) { /* 44 */ this.resourceBundle = null; /* 45 */ this.baseName = baseName; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public String getBaseName() { /* 54 */ return this.baseName; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public ResourceBundle getResourceBundle() { /* 63 */ return this.resourceBundle; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ public Message newMessage(String key) { /* 71 */ if (this.resourceBundle == null) { /* 72 */ return new LocalizedMessage(this.baseName, key); /* */ } /* 74 */ return new LocalizedMessage(this.resourceBundle, key); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public Message newMessage(String key, Object... params) { /* 88 */ if (this.resourceBundle == null) { /* 89 */ return new LocalizedMessage(this.baseName, key, params); /* */ } /* 91 */ return new LocalizedMessage(this.resourceBundle, key, params); /* */ } /* */ } /* Location: F:\dw\server.jar!\org\apache\logging\log4j\message\LocalizedMessageFactory.class * Java compiler version: 7 (51.0) * JD-Core Version: 1.1.3 */
[ "jasonya2206@gmail.com" ]
jasonya2206@gmail.com
f303d8992668b4a920530f994d21c9a26a06ee7f
d6e998009c764149ccbb10454ee545bf6a14264e
/src/com/sun/corba/se/spi/activation/ServerHolder.java
7a3fcb80536ae0a2d1a6acd382e1cbe10ba50610
[]
no_license
DierMeng/JDK8-Source-Chinese-Comments
23bded49355daf5439bdf4376ba5b69ce4bd0c23
e51336f82878dfa4084eaff3f18cf066d7055e21
refs/heads/master
2022-05-11T08:37:07.968017
2022-03-20T14:15:34
2022-03-20T14:15:34
242,528,069
6
2
null
null
null
null
UTF-8
Java
false
false
1,099
java
package com.sun.corba.se.spi.activation; /** * com/sun/corba/se/spi/activation/ServerHolder.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u221/13320/corba/src/share/classes/com/sun/corba/se/spi/activation/activation.idl * Thursday, July 4, 2019 4:38:18 AM PDT */ /** Server callback API, passed to Activator in active method. */ public final class ServerHolder implements org.omg.CORBA.portable.Streamable { public com.sun.corba.se.spi.activation.Server value = null; public ServerHolder () { } public ServerHolder (com.sun.corba.se.spi.activation.Server initialValue) { value = initialValue; } public void _read (org.omg.CORBA.portable.InputStream i) { value = com.sun.corba.se.spi.activation.ServerHelper.read (i); } public void _write (org.omg.CORBA.portable.OutputStream o) { com.sun.corba.se.spi.activation.ServerHelper.write (o, value); } public org.omg.CORBA.TypeCode _type () { return com.sun.corba.se.spi.activation.ServerHelper.type (); } }
[ "1375057013@qq.com" ]
1375057013@qq.com
62d70b89b8f61d4ece536328ab6b43230e1fa666
db579f64fde2d538f4bce1681e0d5667e039a4f9
/YiBoLibrary/src/com/cattong/sns/impl/renren/RenRenUserAdapter.java
792752a5b82a4a154955b5276e81d5b13de874d4
[ "Apache-2.0" ]
permissive
ax003d/YiBo
dc3a57464e8b6a878d4dc081ecab00a68f8ba23a
b49c25e614926aaf9bb88e33c72db79414c10b82
refs/heads/master
2021-01-18T08:50:15.549797
2013-03-18T09:38:02
2013-03-18T09:38:02
8,870,741
0
1
null
null
null
null
UTF-8
Java
false
false
7,999
java
package com.cattong.sns.impl.renren; import static com.cattong.commons.util.ParseUtil.getRawString; import java.text.ParseException; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import com.cattong.commons.LibException; import com.cattong.commons.LibResultCode; import com.cattong.commons.ServiceProvider; import com.cattong.commons.util.ParseUtil; import com.cattong.commons.util.StringUtil; import com.cattong.entity.Education; import com.cattong.entity.Gender; import com.cattong.entity.Location; import com.cattong.entity.Work; import com.cattong.entity.Education.SchoolType; import com.cattong.sns.entity.User; public class RenRenUserAdapter { public static User createSimpleUser(String jsonString) throws LibException { try { JSONObject json = new JSONObject(jsonString); return createSimpleUser(json); } catch (JSONException e) { throw new LibException(LibResultCode.JSON_PARSE_ERROR, e); } } public static User createUser(String jsonString) throws LibException { try { JSONObject json = new JSONObject(jsonString); return createUser(json); } catch (JSONException e) { throw new LibException(LibResultCode.JSON_PARSE_ERROR, e); } } /** * 从JSON字符串创建User对象列表 * * @param jsonString * JSON字符串 * @return User对象列表 * @throws LibException */ public static List<User> createSimpleUserList(String jsonString) throws LibException { try { if ("[]".equals(jsonString) || "{}".equals(jsonString)) { return new ArrayList<User>(0); } JSONArray jsonArray = new JSONArray(jsonString); int size = jsonArray.length(); List<User> userList = new ArrayList<User>(size); for (int i = 0; i < size; i++) { userList.add(createSimpleUser(jsonArray.getJSONObject(i))); } return userList; } catch (JSONException e) { throw new LibException(LibResultCode.JSON_PARSE_ERROR, e); } } public static List<User> createUserList(String jsonString) throws LibException { try { if ("[]".equals(jsonString) || "{}".equals(jsonString)) { return new ArrayList<User>(0); } JSONArray jsonArray = new JSONArray(jsonString); int size = jsonArray.length(); List<User> userList = new ArrayList<User>(size); for (int i = 0; i < size; i++) { userList.add(createUser(jsonArray.getJSONObject(i))); } return userList; } catch (JSONException e) { throw new LibException(LibResultCode.JSON_PARSE_ERROR, e); } } public static List<String> createUserIdList(String jsonString) throws LibException { try { if ("[]".equals(jsonString) || "{}".equals(jsonString)) { return new ArrayList<String>(0); } JSONArray jsonArray = new JSONArray(jsonString); int size = jsonArray.length(); List<String> listUserId = new ArrayList<String>(size); for (int i = 0; i < size; i++) { listUserId.add(jsonArray.getString(i)); } return listUserId; } catch (JSONException e) { throw new LibException(LibResultCode.JSON_PARSE_ERROR, e); } } public static String createUserId(String jsonString) throws LibException { try { if ("[]".equals(jsonString) || "{}".equals(jsonString)) { return null; } JSONObject json = new JSONObject(jsonString); String userId = json.getString("uid"); return userId; } catch (JSONException e) { throw new LibException(LibResultCode.JSON_PARSE_ERROR, e); } } /** * 从JSON对象创建User对象,包级别访问权限控制 * * @param json * JSON对象 * @return User对象 * @throws LibException */ static User createSimpleUser(JSONObject json) throws LibException { User user = new User(); user.setUserId(ParseUtil.getRawString("uid", json)); user.setScreenName(ParseUtil.getRawString("name", json)); user.setName(user.getScreenName()); user.setHeadUrl(ParseUtil.getRawString("headurl", json)); user.setServiceProvider(ServiceProvider.RenRen); return user; } static User createUser(JSONObject json) throws LibException { try { User user = new User(); user.setServiceProvider(ServiceProvider.RenRen); user.setUserId(json.getString("uid")); user.setScreenName(getRawString("name", json)); user.setName(user.getScreenName()); user.setTinyUrl(getRawString("tinyurl", json)); user.setHeadUrl(getRawString("headurl", json)); user.setMainUrl(getRawString("mainurl", json)); if (!json.isNull("sex")) { int gender = json.getInt("sex"); if (gender == 1) { user.setGender(Gender.Male); } else if (gender == 0) { user.setGender(Gender.Female); } else { user.setGender(Gender.Unkown); } } if (!json.isNull("star")) { int star = json.getInt("star"); user.setStar(false); if (star == 1) { user.setStar(true); } } if (!json.isNull("zidou")) { int zidou = json.getInt("zidou"); user.setVip(false); if (zidou == 1) { user.setVip(true); } } if (!json.isNull("vip")) { user.setVipLevel(json.getInt("vip")); } if (!json.isNull("birthday")) { String birthdayStr = json.getString("birthday"); if (StringUtil.isNotEmpty(birthdayStr)) { birthdayStr = birthdayStr.replaceFirst("17", "19"); Date birthday = ParseUtil.getDate(birthdayStr, "yyyy-MM-dd"); user.setBirthday(birthday); } } if (!json.isNull("hometown_location")) { Location hometown = new Location(); hometown.setCountry(getRawString("country", json)); hometown.setProvince(getRawString("province", json)); hometown.setCity(getRawString("city", json)); user.setHometown(hometown.getFormatedAddress()); } if (!json.isNull("work_history")) { List<Work> workHistory = new ArrayList<Work>(); JSONArray jsonArray = json.getJSONArray("work_history"); for (int i = 0; i < jsonArray.length(); i++) { JSONObject workJson = jsonArray.getJSONObject(i); Work work = new Work(); work.setEmployer(ParseUtil.getRawString("company_name",workJson)); work.setStartDate(ParseUtil.getDate("start_date", workJson, "yyyy-MM-dd")); work.setEndDate(ParseUtil.getDate("end_date", workJson, "yyyy-MM-dd")); workHistory.add(work); } user.setWorkHistory(workHistory); } List<Education> educationHistory = new ArrayList<Education>(); if (!json.isNull("university_history")) { JSONArray jsonArray = json.getJSONArray("university_history"); for (int i = 0; i < jsonArray.length(); i++) { JSONObject educationJson = jsonArray.getJSONObject(i); Education education = new Education(); education.setSchool( ParseUtil.getRawString("name", educationJson)); education.setDepartment( ParseUtil.getRawString("department", educationJson)); education.setYear( ParseUtil.getRawString("year", educationJson)); education.setSchoolType(SchoolType.COLLEGE); educationHistory.add(education); } } if (!json.isNull("hs_history")) { JSONArray jsonArray = json.getJSONArray("hs_history"); for (int i = 0; i < jsonArray.length(); i++) { JSONObject educationJson = jsonArray.getJSONObject(i); Education education = new Education(); education.setSchool(ParseUtil.getRawString("name", educationJson)); education.setYear(ParseUtil.getRawString("grad_year", educationJson)); education.setSchoolType(SchoolType.HIGH_SCHOOL); educationHistory.add(education); } } user.setEducationHistory(educationHistory); return user; } catch (JSONException e) { throw new LibException(LibResultCode.JSON_PARSE_ERROR, e); } catch (ParseException e) { throw new LibException(LibResultCode.DATE_PARSE_ERROR, e); } } }
[ "cattong@cattong-THINK" ]
cattong@cattong-THINK
a8f3ab5bc8da6df48ce9187e671c678d5ec2f810
125b073f9d405efe6e9ae5f9edeb8ea093d8a525
/AnnoncesBateauGenerique/src/fr/RivaMedia/AnnoncesBateauGenerique/tab/alertes/TabMesAlertesFormulaires.java
56f7eaebe88c82a59439a5a52559be765a29ba2d
[]
no_license
kevindjf/kevin-flo-entreprise
68c34ac2e63e247e1f9409bd4e65661a9bc9e044
4eefa913d1e9fe581008bc2a879a0034becd997d
refs/heads/master
2021-01-10T08:23:35.969822
2014-04-19T13:58:47
2014-04-19T13:58:47
48,982,588
0
0
null
null
null
null
UTF-8
Java
false
false
5,608
java
package fr.RivaMedia.AnnoncesBateauGenerique.tab.alertes; import java.util.ArrayList; import java.util.List; import android.annotation.SuppressLint; import android.app.Activity; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.fortysevendeg.swipelistview.BaseSwipeListViewListener; import com.fortysevendeg.swipelistview.SwipeListView; import fr.RivaMedia.AnnoncesBateauGenerique.R; import fr.RivaMedia.AnnoncesBateauGenerique.adapter.AlerteListAdapter; import fr.RivaMedia.AnnoncesBateauGenerique.fragments.MesAlertes; import fr.RivaMedia.AnnoncesBateauGenerique.model.Alerte; import fr.RivaMedia.AnnoncesBateauGenerique.net.NetAlerte; import fr.RivaMedia.AnnoncesBateauGenerique.tab.core.Tab; import fr.RivaMedia.AnnoncesBateauGenerique.utils.JetonManager; @SuppressLint("ValidFragment") public class TabMesAlertesFormulaires extends Tab { View _view; Activity _activity; MesAlertes _fragment; List<Alerte> _alertes = new ArrayList<Alerte>(); SwipeListView _liste = null; AlerteListAdapter _adapter = null; AsyncTask<Void, Void, Void> task = null; public TabMesAlertesFormulaires(String titre, Activity activity, MesAlertes fragment){ super(titre,activity.getResources().getDrawable(R.drawable.logo_vendre_blanc)); this._activity = activity; this._fragment = fragment; } public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) { _view = inflater.inflate(R.layout.liste_swipe_views, container, false); //task = new ChargerAlertesTask(); //task.execute(); return _view; } public void chargerAlertes(){ charger(); remplir(); ajouterListeners(); if(_alertes.size()==0){ ((TextView)_view.findViewById(R.id.vide).findViewById(R.id.vide_text)).setText(R.string.aucun_alerte); _view.findViewById(R.id.vide).setVisibility(View.VISIBLE); }else{ _view.findViewById(R.id.vide).setVisibility(View.GONE); } } @Override public void onResume() { super.onResume(); if(getActivity() != null){ _fragment.afficherProgressFormulaires(true); getActivity().runOnUiThread(new Runnable(){ public void run(){ if(task == null){ task = new ChargerAlertesTask(); task.execute(); } _fragment.afficherProgressFormulaires(false); } }); } } public void charger(){ _liste = (SwipeListView) _view.findViewById(R.id.list); } public void remplir(){ if(getActivity() != null){ _adapter = new AlerteListAdapter(getActivity(), _alertes, true); _liste.setAdapter(_adapter); } } public void ajouterListeners(){ _liste.setSwipeListViewListener(null); _liste.setSwipeListViewListener(new BaseSwipeListViewListener() { @Override public void onOpened(int position, boolean toRight) { } @Override public void onClosed(int position, boolean fromRight) { } @Override public void onListChanged() { } @Override public void onMove(int position, float x) { } @Override public void onStartOpen(int position, int action, boolean right) { Log.d("swipe", String.format("onStartOpen %d - action %d", position, action)); } @Override public void onStartClose(int position, boolean right) { Log.d("swipe", String.format("onStartClose %d", position)); } @Override public void onClickFrontView(int position) { Log.d("swipe", String.format("onClickFrontView %d", position)); } @Override public void onClickBackView(int position) { new SupprimmerAlertesTask().execute(_alertes.get(position).getId()); supprimerPosition(position); } @Override public void onDismiss(int[] reverseSortedPositions) { } }); } protected void supprimerPosition(int position){ _liste.dismiss(position); _liste.dismissSelected(); _liste.unselectedChoiceStates(); } public void supprimmerAlerteDeListe(String idAlerte){ /* int position = 0; for(Alerte alerte : _alertes){ if(alerte.getId().equals(idAlerte)){ supprimerPosition(position); } position++; } */ } /* --------------------------------------------------------------------------- */ class ChargerAlertesTask extends AsyncTask<Void, Void, Void> { protected Void doInBackground(Void...donnees) { JetonManager jm = new JetonManager(getActivity()); String jeton = jm.getJeton(); _alertes.clear(); _alertes.addAll(NetAlerte.getAlertes(jeton)); getActivity().runOnUiThread(new Runnable(){ @Override public void run() { chargerAlertes(); task = null; } }); return null; } protected void onPostExecute(){ } } /* --------------------------------------------------------------------------- */ class SupprimmerAlertesTask extends AsyncTask<String, Void, Void> { protected Void doInBackground(String...alerteId) { final String idAlerte = alerteId[0]; final String ok = NetAlerte.supprimerAlerte(idAlerte); if(getActivity() != null){ getActivity().runOnUiThread(new Runnable(){ @SuppressLint("DefaultLocale") @Override public void run() { if(!ok.toLowerCase().equals("false")) supprimmerAlerteDeListe(idAlerte); task = null; } }); } return null; } protected void onPostExecute(){ } } }
[ "champigny.florent@gmail.com" ]
champigny.florent@gmail.com
0e37c367c77df0db007eac74bf1c8e8a4b1dc2aa
ed28460c5d24053259ab189978f97f34411dfc89
/Software Engineering/Java Web/Web Development Basics/January - 2018/04. State Management/Demo/Demo/src/javache/http/HttpRequestImpl.java
802235602535456497aa9373923c67098b1dccd7
[]
no_license
Dimulski/SoftUni
6410fa10ba770c237bac617205c86ce25c5ec8f4
7954b842cfe0d6f915b42702997c0b4b60ddecbc
refs/heads/master
2023-01-24T20:42:12.017296
2020-01-05T08:40:14
2020-01-05T08:40:14
48,689,592
2
1
null
2023-01-12T07:09:45
2015-12-28T11:33:32
Java
UTF-8
Java
false
false
3,993
java
package javache.http; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.Arrays; import java.util.HashMap; import java.util.List; public class HttpRequestImpl implements HttpRequest { private String method; private String requestUrl; private HashMap<String, String> headers; private HashMap<String, String> bodyParameters; private HashMap<String, String> cookies; // private HttpSession session; public HttpRequestImpl(String requestContent) { this.initMethod(requestContent); this.initRequestUrl(requestContent); this.initHeaders(requestContent); this.initBodyParameters(requestContent); this.initCookies(); // this.session = new HttpSessionImpl(); } private void initCookies() { this.cookies = new HashMap<>(); if (!this.headers.containsKey("Cookie")) { return; } String cookieHeader = this.headers.get("Cookie"); String[] cookiePairs = cookieHeader.split("; "); for (String cookiePair : cookiePairs) { String[] pair = cookiePair.split("="); this.cookies.put(pair[0], pair[1]); } } private void initMethod(String requestContent) { this.setMethod(requestContent.split("\\s")[0]); } private void initRequestUrl(String requestContent) { this.setRequestUrl(requestContent.split("\\s")[1]); } private void initHeaders(String requestContent) { this.headers = new HashMap<>(); List<String> requestParams = Arrays.asList( requestContent.split("\\r\\n")); int i = 1; while (i < requestParams.size() && requestParams.get(i).length() > 0) { String[] headerKeyValuePair = requestParams.get(i).split("\\:\\s"); this.addHeader(headerKeyValuePair[0], headerKeyValuePair[1]); i++; } } private void initBodyParameters(String requestContent) { if (this.getMethod().equals("POST")) { this.bodyParameters = new HashMap<>(); List<String> requestParams = Arrays.asList(requestContent.split("\\r\\n")); if (requestParams.size() > this.headers.size() + 2) { List<String> bodyParams = Arrays.asList(requestParams.get(this.headers.size() + 2).split("\\&")); for (int i = 0; i < bodyParams.size(); i++) { String[] bodyKeyValuePair = bodyParams.get(i).split("\\="); try { this.addBodyParameter(bodyKeyValuePair[0], URLDecoder.decode(bodyKeyValuePair[1], "UTF-8")); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } } } } // @Override // public HttpSession getSession() { // return this.session; // } @Override public HashMap<String, String> getHeaders() { return this.headers; } @Override public HashMap<String, String> getBodyParameters() { return this.bodyParameters; } @Override public HashMap<String, String> getCookies() { return this.cookies; } @Override public String getMethod() { return this.method; } @Override public void setMethod(String method) { this.method = method; } @Override public String getRequestUrl() { return this.requestUrl; } @Override public void setRequestUrl(String requestUrl) { this.requestUrl = requestUrl; } @Override public void addHeader(String header, String value) { this.headers.putIfAbsent(header, value); } @Override public void addBodyParameter(String parameter, String value) { this.bodyParameters.putIfAbsent(parameter, value); } @Override public boolean isResource() { return this.getRequestUrl().contains("."); } }
[ "george.dimulski@gmail.com" ]
george.dimulski@gmail.com
2aac15822141a2b5485a6ff32de78388d520a753
e3864f0c50b9276ff404d95bc1e35ff9c85b32e7
/mgcrab-consolidation/vanilladb-comm/src/main/java/org/vanilladb/comm/protocols/events/ZabRequest.java
5bce3dc55f283c86c5b04e81b66089f970d6f138
[]
no_license
nthu-datalab/mgcrab
107d5e7726d9aff95be81c1f84ba87e16aa1726c
f818d31acb722b4bcc559d878d5bb38efbd3ad00
refs/heads/master
2021-05-03T15:27:32.721726
2018-02-06T15:13:51
2018-02-06T15:13:51
120,476,989
0
0
null
null
null
null
UTF-8
Java
false
false
485
java
package org.vanilladb.comm.protocols.events; import net.sf.appia.core.AppiaEventException; import net.sf.appia.core.Channel; import net.sf.appia.core.Event; import net.sf.appia.core.Session; public class ZabRequest extends Event { private Object obj; public ZabRequest(Channel channel, int direction, Session src, Object o) throws AppiaEventException { super(channel, direction, src); this.obj = o; } public Object getObject() { return obj; } }
[ "sam123456777@gmail.com" ]
sam123456777@gmail.com
d2f595c0c51fc320bde16f6cd18881fb4ed2ac07
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
/src/chosun/ciis/fc/acct/rec/FC_ACCT_2352_LCURLISTRecord.java
5bad9aa8eaf8775da058b4954f8b9d7baa6f059c
[]
no_license
nosmoon/misdevteam
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
1829d5bd489eb6dd307ca244f0e183a31a1de773
refs/heads/master
2020-04-15T15:57:05.480056
2019-01-10T01:12:01
2019-01-10T01:12:01
164,812,547
1
0
null
null
null
null
UHC
Java
false
false
1,149
java
/*************************************************************************************************** * 파일명 : .java * 기능 : 독자우대-구독신청 * 작성일자 : 2007-05-22 * 작성자 : 김대섭 ***************************************************************************************************/ /*************************************************************************************************** * 수정내역 : * 수정자 : * 수정일자 : * 백업 : ***************************************************************************************************/ package chosun.ciis.fc.acct.rec; import java.sql.*; import chosun.ciis.fc.acct.dm.*; import chosun.ciis.fc.acct.ds.*; /** * */ public class FC_ACCT_2352_LCURLISTRecord extends java.lang.Object implements java.io.Serializable{ public String busn_dd_clsf_cd; public FC_ACCT_2352_LCURLISTRecord(){} public void setBusn_dd_clsf_cd(String busn_dd_clsf_cd){ this.busn_dd_clsf_cd = busn_dd_clsf_cd; } public String getBusn_dd_clsf_cd(){ return this.busn_dd_clsf_cd; } } /* 작성시간 : Thu Apr 16 16:12:43 KST 2009 */
[ "DLCOM000@172.16.30.11" ]
DLCOM000@172.16.30.11
cad203f46a784658488987458883ca792b5d428e
a0c750f0ec36a4dbca4d7ab7cd3a476008e6f474
/src/main/java/com/alibaba/dubbo/rpc/support/DelegateExporter.java
e59c8e29758641a60b7a1d84ee687c42c44cc9e5
[]
no_license
Fyypumpkin/dubbo-decompile-source
dc7251f6db19e6f8134ed49360add502a71f698b
2510460f89dec2d7bc11769507cc37882f9b7ba7
refs/heads/master
2020-06-10T10:25:00.460681
2019-06-25T04:26:55
2019-06-25T04:26:55
193,633,856
0
0
null
null
null
null
UTF-8
Java
false
false
652
java
/* * Decompiled with CFR 0.139. */ package com.alibaba.dubbo.rpc.support; import com.alibaba.dubbo.rpc.Exporter; import com.alibaba.dubbo.rpc.Invoker; public class DelegateExporter<T> implements Exporter<T> { private final Exporter<T> exporter; public DelegateExporter(Exporter<T> exporter) { if (exporter == null) { throw new IllegalArgumentException("exporter can not be null"); } this.exporter = exporter; } @Override public Invoker<T> getInvoker() { return this.exporter.getInvoker(); } @Override public void unexport() { this.exporter.unexport(); } }
[ "fyypumpkin@gmail.com" ]
fyypumpkin@gmail.com
77d6eac2bb90a5207fdf671c01a9a8531062c43e
fb5bfb5b4cf7a118cb858490953e69517d8060a4
/src/ch15/ex30/access/Access.java
4915782b836a2d20d1ca94045c1e37946321d2f2
[]
no_license
v777779/jbook
573dd1e4e3847ed51c9b6b66d2b098bf8eb58af5
09fc56a27e9aed797327f01ea955bdf1815d0d54
refs/heads/master
2021-09-19T08:14:16.299382
2018-07-25T14:03:12
2018-07-25T14:03:12
86,017,001
0
0
null
null
null
null
UTF-8
Java
false
false
1,105
java
package ch15.ex30.access; import lib.utils.Holder; /** * Created by V1 on 18-Feb-17. */ public class Access { private static <T> void checkType(Holder<T> h, T value) { System.out.println("\nHolder <"+ h.getName()+">:"); System.out.println("Holder :"+h.getValue()); h.setValue(value); System.out.println("Holder :"+h.getValue()); } public static void app() { System.out.println("\n====ACCESS==="); System.out.println("\nExercise 30 Primitive w Generic Check\n"); Holder<Character> hc = new Holder<>('w'); Holder<Byte> hb = new Holder<>((byte)1); Holder<Short> hs = new Holder<>((short)120); Holder<Integer> hi = new Holder<>(150); Holder<Long> hl = new Holder<>(1000L); Holder<Float> hf = new Holder<>(1.232F); Holder<Double> hd = new Holder<>(3.750); checkType(hc,'s'); checkType(hb,(byte)2); checkType(hs,(short)240); checkType(hi,(300)); checkType(hl,2000L); checkType(hf,2.4343F); checkType(hd,4.278); } }
[ "vadim.v.voronov@gmail.com" ]
vadim.v.voronov@gmail.com
19a2b3c966225c363d79fa74ba93d27750066f63
cc5a7d0bfe6519e2d462de1ac9ef793fb610f2a7
/api1/src/main/java/com/heb/pm/entity/IngredientStatementHeader.java
3252570b48473ca590459ddd0014d196eaa27d28
[]
no_license
manosbatsis/SAVEFILECOMPANY
d21535a46aebedf2a425fa231c678658d4b017a4
c33d41cf13dd2ff5bb3a882f6aecc89b24a206be
refs/heads/master
2023-03-21T04:46:23.286060
2019-10-10T10:38:02
2019-10-10T10:38:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,623
java
package com.heb.pm.entity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.springframework.data.domain.Sort; import javax.persistence.*; import java.io.Serializable; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; /** * Represents a dynamic attribute of a IngredientStatementHeader. * * @author m594201 * @since 2.0.9 */ @Entity @Table(name="sl_ingrd_stmt_hdr") public class IngredientStatementHeader implements Serializable { public static final char DELETE_CODE = 'D'; public static final char UPDATE_CODE = 'C'; public static final char ADD_CODE = 'A'; // These are the values that are set when a UPC does not have a nutrient statement attached to it. public static final long[] EMPTY_SCALE_NUTRIENT_STATEMENT_NUMBERS = {0, 9999999}; private static final long serialVersionUID = 1L; private static final String DEFAULT_SORT = "statementNumber"; private static final String DISPLAY_NAME_FORMAT = "Ingredient Statement %d"; // Modified this delimiter to NOT contain a space after comma, since this is how the mainframe sends ingredients // to ePlum private static final String INGREDIENT_DELIMITER = ","; @Id @Column(name = "pd_ingrd_stmt_no") private long statementNumber; @Column(name = "PD_INGRD_MAINT_DT") private LocalDate maintenanceDate; @Column(name = "PD_INGRD_MAINT_SW") private boolean maintenanceSwitch; @Column(name = "PD_MAINT_TYP_CD") private char maintenanceCode; @JsonIgnoreProperties("ingredientStatementHeader") @OneToMany(mappedBy = "ingredientStatementHeader", fetch = FetchType.LAZY, orphanRemoval = true, cascade = CascadeType.ALL) @OrderBy(value = "pd_ingrd_pct DESC") private List<IngredientStatementDetail> ingredientStatementDetails = new ArrayList<>(); @JsonIgnoreProperties("ingredientStatementHeader") @OneToMany(fetch = FetchType.LAZY) @JoinColumn(name = "INGR_STATEMENT_NUM", referencedColumnName = "pd_ingrd_stmt_no", insertable = false, updatable = false) private List<ScaleUpc> scaleUpcs; /** * Gets scale upcs. * * @return the scale upcs */ public List<ScaleUpc> getScaleUpcs() { return scaleUpcs; } /** * Sets scale upcs. * * @param scaleUpcs the scale upcs */ public void setScaleUpcs(List<ScaleUpc> scaleUpcs) { this.scaleUpcs = scaleUpcs; } /** * Gets ingredient statement details. * * @return the ingredient statement details */ public List<IngredientStatementDetail> getIngredientStatementDetails() { return ingredientStatementDetails; } /** * Sets ingredient statement details. * * @param ingredientStatementDetails the ingredient statement details */ public void setIngredientStatementDetails(List<IngredientStatementDetail> ingredientStatementDetails) { this.ingredientStatementDetails = ingredientStatementDetails; } /** * Gets statement number. * * @return the statement number */ public long getStatementNumber() { return statementNumber; } /** * Sets statement number. * * @param statementNumber the statement number */ public void setStatementNumber(long statementNumber) { this.statementNumber = statementNumber; } /** * Returns a default sort for the table. * * @return A default sort for the table. */ public static Sort getDefaultSort() { return new Sort(new Sort.Order(Sort.Direction.ASC, IngredientStatementHeader.DEFAULT_SORT)); } /** * Returns the maintenance date. * * @return the maintenance date. */ public LocalDate getMaintenanceDate() { return maintenanceDate; } /** * Sets the maintenance date. * * @param maintenanceDate The maintenance date. */ public void setMaintenanceDate(LocalDate maintenanceDate) { this.maintenanceDate = maintenanceDate; } /** * Returns true if it needs maintenance. * * @return Boolean value to whether it needs maintenance or not. */ public boolean isMaintenanceSwitch() { return maintenanceSwitch; } /** * Sets the maintenance switch. * * @param maintenanceSwitch Boolean value to whether it needs maintenance or not. */ public void setMaintenanceSwitch(boolean maintenanceSwitch) { this.maintenanceSwitch = maintenanceSwitch; } /** * Returns the maintenance code. * * @return the maintenance code. */ public char getMaintenanceCode() { return maintenanceCode; } /** * Sets the maintenance code. * * @param maintenanceCode the maintenance code. */ public void setMaintenanceCode(char maintenanceCode) { this.maintenanceCode = maintenanceCode; } /** * Returns a full string representation of the ingredient statement as it would be displayed on a nutrition label. * * @return A full string representation of the ingredient statement as it would be displayed on a nutrition label. */ public String getIngredientsText() { StringBuilder ingredientStatementBuilder = new StringBuilder(); if(this.getIngredientStatementDetails() != null) { for (int i = 0; i < this.getIngredientStatementDetails().size(); i++) { if (i != 0) { ingredientStatementBuilder.append(IngredientStatementHeader.INGREDIENT_DELIMITER); } ingredientStatementBuilder.append( this.getIngredientStatementDetails().get(i).getIngredient().getDisplayText()); } } return ingredientStatementBuilder.toString(); } /** * Returns a string representation of this object that is presentable on the GUI. * * @return A string representation of this object that is presentable on the GUI. */ public String getDisplayName() { return String.format(IngredientStatementHeader.DISPLAY_NAME_FORMAT, this.statementNumber); } }
[ "tran.than@heb.com" ]
tran.than@heb.com
17378e622a5732538b9b84ac211955a1de46eace
2f0f1e853018499ae47177888e48fe4b12200e2e
/day_5_copying_objects/Student.java
844e7922acf0c3176591be673e117e0d7cc2e18a
[]
no_license
PankajAgade/Core-java
c7e87516378298137ad96ac30e1bbf9b33405c20
487a8a2e87016311fe7e49958c398aaa720401ce
refs/heads/main
2023-01-05T02:54:22.518480
2020-10-29T16:14:16
2020-10-29T16:14:16
308,380,077
2
0
null
null
null
null
UTF-8
Java
false
false
211
java
package day_5_copying_objects; public class Student { int rollno; String name; Student (int a, String b) { rollno=a; name=b; } Student (Student X) { this.rollno=X.rollno; this.name=X.name; } }
[ "pankajagade.pa@gmail.com" ]
pankajagade.pa@gmail.com
e04d4f2a7d1fe5bf9660caffe3885ef88a82146a
d48cfe7bb65c3169dea931f605d62b4340222d75
/chinahrd-hrbi/hrd-etl/src/main/java/net/chinahrd/etl/sql/BatchSql.java
f9770282e5d924494b181d4ef29eb72af59a6352
[]
no_license
a559927z/doc
7b65aeff1d4606bab1d7f71307d6163b010a226d
04e812838a5614ed78f8bbfa16a377e7398843fc
refs/heads/master
2022-12-23T12:09:32.360591
2019-07-15T17:52:54
2019-07-15T17:52:54
195,972,411
0
0
null
2022-12-16T07:47:50
2019-07-09T09:02:38
JavaScript
UTF-8
Java
false
false
1,937
java
/** *net.chinahrd.etl.sql */ package net.chinahrd.etl.sql; import java.sql.ResultSet; import net.chinahrd.utils.db.DatabaseUtil; /** * 分页sql执行器 * * @author htpeng 2017年5月2日下午6:49:03 */ public abstract class BatchSql { private static final String asName="num"; private String sql; /** * 排序字段 */ protected String orderColumn; /** * 数据库操作类 */ private DatabaseUtil databaseUtil; /** * 获取分页查询Sql语句 * @param sql sql语句 * @param start 查询开始位置 * @param end 查询结束位置 * @param batchNum 查询数量 * @return */ protected abstract String getBachSql(String sql,int start,int end,int batchNum,int count) ; /** * 检验分页配置是否有效 * @return * @throws Exception */ protected abstract boolean vaild() throws Exception ; /** * 查询总条数 * @return * @throws Exception */ public int quertCount() throws Exception { ResultSet rs =this.databaseUtil.query(sql); while (rs.next()) { return rs.getInt(asName); } return 0; } /** * 设置数据库连接 * @param databaseUtil 数据库连接 */ public void setDatabaseUtil(DatabaseUtil databaseUtil) { this.databaseUtil=databaseUtil; } /** * 设置sql * @param sql 查询sql */ public void setSql(String sql) { StringBuffer sqlBuff=new StringBuffer("SELECT COUNT(1) "); sqlBuff.append(asName); sqlBuff.append(" FROM ("); sqlBuff.append(sql); sqlBuff.append(") AS aa"); this.sql=sqlBuff.toString(); } /** * 设置排序字段 (目前SQLserver需要使用) * @param order 排序字段 */ public void setOrderColumn(String orderColumn) { this.orderColumn=orderColumn; } /** * @return */ protected String getOrderColumn() { return this.orderColumn; } }
[ "a559927z@163.com" ]
a559927z@163.com
490c8a1a8fdf13e6c9d01c9dfbe26422b9f35cb2
bf7b4c21300a8ccebb380e0e0a031982466ccd83
/middlewareConcepts2014-master/Assignment3/lib/jacorb-3.4/test/regression/src/test/java/org/jacorb/test/orb/ORBSingletonTest.java
063492d2ac3443d90fa12f106642eb1a403a20d4
[]
no_license
Puriakshat/Tuberlin
3fe36b970aabad30ed95e8a07c2f875e4912a3db
28dcf7f7edfe7320c740c306b1c0593a6c1b3115
refs/heads/master
2021-01-19T07:30:16.857479
2014-11-06T18:49:16
2014-11-06T18:49:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,127
java
package org.jacorb.test.orb; /* * JacORB - a free Java ORB * * Copyright (C) 1997-2012 Gerald Brose / The JacORB Team. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ import static org.junit.Assert.fail; import org.jacorb.orb.ORBSingleton; import org.junit.Test; /** * A very simple test that checks whether some methods in the singleton ORB * are correctly flagged as forbidden (NO_IMPLEMENT). * @author Andre Spiegel spiegel@gnu.org */ public class ORBSingletonTest { @Test public void test_disallowed_methods() { ORBSingleton orbs = new org.jacorb.orb.ORBSingleton(); try { orbs.create_exception_list(); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.create_list(77); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.create_named_value("", null, 0); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.create_operation_list((org.omg.CORBA.Object)null); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.create_operation_list((org.omg.CORBA.OperationDef)null); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.string_to_object(""); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.create_environment(); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.create_context_list(); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.create_output_stream(); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.get_current(); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.get_default_context(); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.get_next_response(); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.list_initial_services(); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.object_to_string(null); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.poll_next_response(); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.resolve_initial_references(""); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } catch (Exception ex) { fail ("should have raised NO_IMPLEMENT"); } try { orbs.send_multiple_requests_deferred(null); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.send_multiple_requests_oneway(null); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.run(); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.shutdown(true); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.work_pending(); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } try { orbs.perform_work(); fail ("should have raised NO_IMPLEMENT"); } catch (org.omg.CORBA.NO_IMPLEMENT ex) { // ok } } }
[ "puri.akshat@gmail.com" ]
puri.akshat@gmail.com
1e366396613888a2bac49c58d79a673b81b5b3a5
9d1039fe3fdf05feca31d5912c77e14e4aaa0eea
/xwiki-platform-core/xwiki-platform-wikistream/xwiki-platform-wikistream-streams/xwiki-platform-wikistream-stream-xar/src/test/java/org/xwiki/wikistream/xar/XARIntegrationTests.java
906a88036846a569899f4d78376a32d262c4801b
[]
no_license
yongchristophertang/xwiki-platform
3a37d14fa1f499f48a8eb061d738bcb6abe6427f
d019ff17aa74a66d1fbecaa14b0e8b5ba28f1822
refs/heads/master
2021-01-14T13:38:45.825096
2014-04-09T14:44:59
2014-04-09T14:44:59
18,627,175
1
0
null
null
null
null
UTF-8
Java
false
false
1,962
java
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.xwiki.wikistream.xar; import java.io.File; import java.util.Date; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.xwiki.extension.test.ExtensionPackager; import org.xwiki.test.annotation.AllComponents; import org.xwiki.wikistream.test.integration.WikiStreamTestSuite; import org.xwiki.wikistream.test.integration.WikiStreamTestSuite.Scope; /** * Run all tests found in the classpath. These {@code *.test} files must follow the conventions described in * {@link org.xwiki.wikistream.test.integration.TestDataParser}. * * @version $Id$ */ @RunWith(WikiStreamTestSuite.class) @AllComponents @Scope("xar") public class XARIntegrationTests { @BeforeClass public static void beforeClass() throws Exception { File folder = new File("target/test-" + new Date().getTime()).getAbsoluteFile(); ExtensionPackager extensionPackager = new ExtensionPackager(null, folder); extensionPackager.generateExtensions(); System.setProperty("extension.repository", folder.getAbsolutePath()); } }
[ "thomas.mortagne@gmail.com" ]
thomas.mortagne@gmail.com
b183d7579d7bbc90f7c610c0db2f434874284770
9b75d8540ff2e55f9ff66918cc5676ae19c3bbe3
/bazaar8.apk-decompiled/sources/com/crashlytics/android/core/RemoveRepeatsStrategy.java
5b1fec6d3645cf9fb193495cd602a70f6834c1f9
[]
no_license
BaseMax/PopularAndroidSource
a395ccac5c0a7334d90c2594db8273aca39550ed
bcae15340907797a91d39f89b9d7266e0292a184
refs/heads/master
2020-08-05T08:19:34.146858
2019-10-06T20:06:31
2019-10-06T20:06:31
212,433,298
2
0
null
null
null
null
UTF-8
Java
false
false
2,490
java
package com.crashlytics.android.core; import java.util.HashMap; public class RemoveRepeatsStrategy implements StackTraceTrimmingStrategy { public final int maxRepetitions; public RemoveRepeatsStrategy() { this(1); } public static boolean isRepeatingSequence(StackTraceElement[] stackTraceElementArr, int i2, int i3) { int i4 = i3 - i2; if (i3 + i4 > stackTraceElementArr.length) { return false; } for (int i5 = 0; i5 < i4; i5++) { if (!stackTraceElementArr[i2 + i5].equals(stackTraceElementArr[i3 + i5])) { return false; } } return true; } public static StackTraceElement[] trimRepeats(StackTraceElement[] stackTraceElementArr, int i2) { int i3; HashMap hashMap = new HashMap(); StackTraceElement[] stackTraceElementArr2 = new StackTraceElement[stackTraceElementArr.length]; int i4 = 0; int i5 = 0; int i6 = 1; while (i4 < stackTraceElementArr.length) { StackTraceElement stackTraceElement = stackTraceElementArr[i4]; Integer num = (Integer) hashMap.get(stackTraceElement); if (num == null || !isRepeatingSequence(stackTraceElementArr, num.intValue(), i4)) { stackTraceElementArr2[i5] = stackTraceElementArr[i4]; i5++; i3 = i4; i6 = 1; } else { int intValue = i4 - num.intValue(); if (i6 < i2) { System.arraycopy(stackTraceElementArr, i4, stackTraceElementArr2, i5, intValue); i5 += intValue; i6++; } i3 = (intValue - 1) + i4; } hashMap.put(stackTraceElement, Integer.valueOf(i4)); i4 = i3 + 1; } StackTraceElement[] stackTraceElementArr3 = new StackTraceElement[i5]; System.arraycopy(stackTraceElementArr2, 0, stackTraceElementArr3, 0, stackTraceElementArr3.length); return stackTraceElementArr3; } public StackTraceElement[] getTrimmedStackTrace(StackTraceElement[] stackTraceElementArr) { StackTraceElement[] trimRepeats = trimRepeats(stackTraceElementArr, this.maxRepetitions); return trimRepeats.length < stackTraceElementArr.length ? trimRepeats : stackTraceElementArr; } public RemoveRepeatsStrategy(int i2) { this.maxRepetitions = i2; } }
[ "MaxBaseCode@gmail.com" ]
MaxBaseCode@gmail.com
e4641ec33e84f3bcaa6494134ae4ddfc8593910e
937409534ae7a0b02cfc8f6f1ef50edddb8dc564
/app/src/main/java/com/yueban/architecturedemo/util/adapter/BaseFragmentPagerAdapter.java
94b929e52cda2274648bc1483509e6323478096a
[ "Apache-2.0" ]
permissive
yueban/ArchitectureDemo
62f1d2b1961e5afb55ffaff954917b1e280c8c77
f605eb23f8518eabd76dc9d95e191476975981db
refs/heads/master
2021-01-01T19:05:05.729828
2017-08-27T04:48:16
2017-08-27T05:12:49
98,503,416
0
0
null
null
null
null
UTF-8
Java
false
false
1,223
java
package com.yueban.architecturedemo.util.adapter; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.view.ViewGroup; import java.util.List; /** * @author yueban * @date 2017/7/27 * @email fbzhh007@gmail.com */ public class BaseFragmentPagerAdapter extends FragmentPagerAdapter { protected List<Fragment> fragments; protected List<String> titles; public BaseFragmentPagerAdapter(FragmentManager fm, List<Fragment> fragments) { this(fm, fragments, null); } public BaseFragmentPagerAdapter(FragmentManager fm, List<Fragment> fragments, List<String> titles) { super(fm); this.fragments = fragments; this.titles = titles; } @Override public Fragment getItem(int position) { return fragments.get(position); } @Override public CharSequence getPageTitle(int position) { if (titles != null) { return titles.get(position); } return ""; } @Override public int getCount() { return fragments.size(); } @Override public void destroyItem(ViewGroup container, int position, Object object) { super.destroyItem(container, position, object); } }
[ "fbzhh007@gmail.com" ]
fbzhh007@gmail.com
256bbe9e8113d68264a4578f0b600c00707eb650
7705dd182d8918aecd86e419b6bb5fca6b914ef1
/4-24 每日一题/src/二叉树平衡检验/Main.java
8d0323c8050bf91fc200ffeb6cad2e13aa7e8cb6
[]
no_license
WE-hai/java_practice
577a997d84303f41771d354ebf95ef33f8a2fb0c
02d3c02b67fcfdeb04bfd7fa14109b5ef7067eec
refs/heads/master
2022-11-27T16:54:20.795612
2020-11-29T09:14:36
2020-11-29T09:14:36
208,614,729
0
0
null
2022-11-16T08:34:02
2019-09-15T15:29:35
JavaScript
UTF-8
Java
false
false
626
java
package 二叉树平衡检验; public class Main { public int getDeep(TreeNode root) { if (root == null) { return 0; } return Math.max(getDeep(root.left),getDeep(root.right))+1; } public boolean isBalance(TreeNode root) { if (root == null) { return true; } else { int left = getDeep(root.left); int right = getDeep(root.right); if (Math.abs(left-right) > 1) { return false; } else { return isBalance(root.left) && isBalance(root.right); } } } }
[ "943239470@qq.com" ]
943239470@qq.com
a3fd5569ce846dc878e3cc277e2cac9c50585c41
725074c95f29f4fae17f2163a545c492511b4841
/src/main/java/blusunrize/immersiveengineering/common/util/compat/HarvestcraftHelper.java
89e973e62a396eddb19f161ee88f1d671b49ec21
[]
no_license
Stonebound/ImmersiveEngineering
f323d8473f5e8993bca1896a88ffe76e1623facd
37c7e913a5a450aae7faf962d5345b7b895de9c3
refs/heads/master
2022-04-19T14:24:00.501870
2017-10-14T19:09:54
2017-10-14T19:09:54
107,047,279
0
0
null
2017-10-15T20:35:46
2017-10-15T20:35:45
null
UTF-8
Java
false
false
3,038
java
package blusunrize.immersiveengineering.common.util.compat; import blusunrize.immersiveengineering.api.tool.AssemblerHandler; import blusunrize.immersiveengineering.api.tool.AssemblerHandler.RecipeQuery; import blusunrize.immersiveengineering.api.tool.BelljarHandler; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreIngredient; import java.lang.reflect.Field; import java.util.HashMap; public class HarvestcraftHelper extends IECompatModule { @Override public void preInit() { } @Override public void init() { //Pams Harvest Craft uses fluids with OreDict entries, so this is my workaround >_> final ItemStack waterBucket = new ItemStack(Items.WATER_BUCKET); AssemblerHandler.registerSpecialQueryConverters(o -> { if(!(o instanceof OreIngredient)) return null; if(((OreIngredient)o).apply(waterBucket)) return new RecipeQuery(new FluidStack(FluidRegistry.WATER,1000), 1000); return null; }); final Fluid milk = FluidRegistry.getFluid("milk"); if(milk!=null) { final ItemStack milkBucket = new ItemStack(Items.MILK_BUCKET); AssemblerHandler.registerSpecialQueryConverters(o -> { if(!(o instanceof Ingredient)) return null; if(((Ingredient)o).apply(milkBucket)) return new RecipeQuery(new FluidStack(milk, 1000), 1000); return null; }); } } static HashMap<String, Item> seeds = new HashMap<String, Item>(); static HashMap<String, Item> foods = new HashMap<String, Item>(); static HashMap<String, Block> crops = new HashMap<String, Block>(); @Override public void postInit() { try { Class c_Types = Class.forName("com.pam.harvestcraft.blocks.CropRegistry"); if(c_Types!=null) { Field f_seeds = c_Types.getDeclaredField("seeds"); Field f_foods = c_Types.getDeclaredField("foods"); Field f_crops = c_Types.getDeclaredField("crops"); f_seeds.setAccessible(true); f_foods.setAccessible(true); f_crops.setAccessible(true); seeds = (HashMap<String, Item>)f_seeds.get(null); foods = (HashMap<String, Item>)f_foods.get(null); crops = (HashMap<String, Block>)f_crops.get(null); Field f_cropNames = c_Types.getDeclaredField("cropNames"); for(String type : (String[])f_cropNames.get(null)) addType(type); } }catch(Exception e){ e.printStackTrace(); } } static void addType(String type) { Item itemSeeds = seeds.get(type); Item itemFood = foods.get(type); Block blockCrop = crops.get(type); if(itemSeeds!=null && itemFood!=null && blockCrop!=null) BelljarHandler.cropHandler.register(new ItemStack(itemSeeds), new ItemStack[]{new ItemStack(itemFood,3),new ItemStack(itemSeeds)}, new ItemStack(Blocks.DIRT), blockCrop.getDefaultState()); } }
[ "danny.rad10@yahoo.de" ]
danny.rad10@yahoo.de
4ca9727732b9d9af58c290e5f32ebfef9d2a131b
7f20b1bddf9f48108a43a9922433b141fac66a6d
/csplugins/trunk/toronto/jm/cy3-stateless-taskfactory-alt1/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMenuManager.java
869248c0c71bed525c6c5ca3045d24998dc6d556
[]
no_license
ahdahddl/cytoscape
bf783d44cddda313a5b3563ea746b07f38173022
a3df8f63dba4ec49942027c91ecac6efa920c195
refs/heads/master
2020-06-26T16:48:19.791722
2013-08-28T04:08:31
2013-08-28T04:08:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,264
java
package org.cytoscape.view.vizmap.gui.internal; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Map; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import org.cytoscape.application.CyApplicationManager; import org.cytoscape.application.swing.CyAction; import org.cytoscape.view.vizmap.gui.SelectedVisualStyleManager; import org.cytoscape.view.vizmap.gui.internal.task.generators.GenerateValuesTaskFactory; import org.cytoscape.view.vizmap.gui.internal.theme.IconManager; import org.cytoscape.view.vizmap.gui.util.DiscreteMappingGenerator; import org.cytoscape.work.TaskFactory; import org.cytoscape.work.TaskManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.l2fprod.common.propertysheet.PropertySheetPanel; /** * Manager for all Vizmap-local menu items. * */ public class VizMapperMenuManager { private static final Logger logger = LoggerFactory.getLogger(VizMapperMenuManager.class); // Metadata private static final String METADATA_MENU_KEY = "menu"; private static final String METADATA_TITLE_KEY = "title"; private static final String MAIN_MENU = "main"; private static final String CONTEXT_MENU = "context"; // Menu items under the tool button private final JPopupMenu mainMenu; // Context menu private final JPopupMenu rightClickMenu; // Context Menu Preset items private final JMenu edit; private final JMenu generateValues; private IconManager iconManager; // Injected from resource file. private String generateMenuLabel; private String generateIconId; private String modifyMenuLabel; private String modifyIconId; private JMenu modifyValues; private final TaskManager taskManager; private final PropertySheetPanel panel; private final SelectedVisualStyleManager manager; private final CyApplicationManager appManager; public VizMapperMenuManager(final TaskManager taskManager, final PropertySheetPanel panel, final SelectedVisualStyleManager manager, final CyApplicationManager appManager) { if (taskManager == null) throw new NullPointerException("TaskManager is null."); this.taskManager = taskManager; this.appManager = appManager; this.manager = manager; this.panel = panel; // Will be shown under the button next to Visual Style Name mainMenu = new JPopupMenu(); // Context menu rightClickMenu = new JPopupMenu(); this.edit = new JMenu("Edit"); rightClickMenu.add(edit); this.generateValues = new JMenu("Mapping Value Generators"); this.rightClickMenu.add(generateValues); // modifyValues = new JMenu(modifyMenuLabel); } public void setIconManager(IconManager iconManager) { this.iconManager = iconManager; } public void setGenerateMenuLabel(String generateMenuLabel) { this.generateMenuLabel = generateMenuLabel; } public void setGenerateIconId(String generateIconId) { this.generateIconId = generateIconId; } public JPopupMenu getMainMenu() { return mainMenu; } public JPopupMenu getContextMenu() { return rightClickMenu; } /** * Custom listener for dynamic menu management * */ public void onBind(final CyAction action, Map properties) { final Object serviceType = properties.get("service.type"); if (serviceType != null && serviceType.toString().equals("vizmapUI.contextMenu")) { Object menuTitle = properties.get("title"); if(menuTitle == null) throw new NullPointerException("Title is missing for a menu item"); final JMenuItem menuItem = new JMenuItem(menuTitle.toString()); menuItem.addActionListener(action); edit.add(menuItem); } } public void onUnbind(final CyAction service, Map properties) { // FIXME: implement this } /** * Add menu items to proper locations. * * @param taskFactory * @param properties */ public void addTaskFactory(final TaskFactory taskFactory, @SuppressWarnings("rawtypes") Map properties) { // first filter the service... final Object serviceType = properties.get("service.type"); if ( serviceType == null || !(serviceType instanceof String) || !((String)serviceType).equals("vizmapUI.taskFactory") ) return; final Object menuDef = properties.get(METADATA_MENU_KEY); if (menuDef == null) throw new NullPointerException("Menu metadata is missing."); // This is a menu item for Main Command Button. final Object title = properties.get(METADATA_TITLE_KEY); if (title == null) throw new NullPointerException("Title metadata is missing."); // Add new menu to the pull-down final JMenuItem menuItem = new JMenuItem(title.toString()); // menuItem.setIcon(iconManager.getIcon(iconId)); menuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { taskManager.execute(taskFactory.createTaskIterator()); } }); if(menuDef.toString().equals(MAIN_MENU)) mainMenu.add(menuItem); else if(menuDef.toString().equals(CONTEXT_MENU)) edit.add(menuItem); } public void removeTaskFactory(final TaskFactory taskFactory, Map properties) { } public void addMappingGenerator(final DiscreteMappingGenerator<?> generator, @SuppressWarnings("rawtypes") Map properties) { final Object serviceType = properties.get(METADATA_MENU_KEY); if (serviceType == null) throw new NullPointerException( "Service Type metadata is null. This value is required."); // This is a menu item for Main Command Button. final Object title = properties.get(METADATA_TITLE_KEY); if (title == null) throw new NullPointerException("Title metadata is missing."); // Create mapping generator task factory final GenerateValuesTaskFactory taskFactory = new GenerateValuesTaskFactory(generator, panel, manager, appManager); // Add new menu to the pull-down final JMenuItem menuItem = new JMenuItem(title.toString()); // menuItem.setIcon(iconManager.getIcon(iconId)); menuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { taskManager.execute(taskFactory.createTaskIterator()); } }); generateValues.add(menuItem); } public void removeMappingGenerator(final DiscreteMappingGenerator<?> generator, @SuppressWarnings("rawtypes") Map properties) { // FIXME } }
[ "jm@0ecc0d97-ab19-0410-9704-bfe1a75892f5" ]
jm@0ecc0d97-ab19-0410-9704-bfe1a75892f5
b04604dba29bf6a52533b368adfae071bf5f3525
610ae0a8be6b9e0a8371dcbbc20f76896b53d3e3
/src/main/java/com/tencent/ads/model/ExposureDetailStruct.java
5b3bde19d14e20fc27595c7a91f97b23195b38f3
[ "Apache-2.0" ]
permissive
TencentAd/marketing-api-java-sdk
d106c6e4cd6e47857a0c63f23fd95e97a34666f3
f9c7e5d06202e05f8f7317e5bf69b61080829de9
refs/heads/master
2023-07-23T10:01:28.748383
2023-07-13T03:07:34
2023-07-13T03:07:34
266,974,939
31
14
Apache-2.0
2022-05-20T21:54:42
2020-05-26T07:32:11
Java
UTF-8
Java
false
false
3,951
java
/* * Marketing API * Marketing API * * OpenAPI spec version: 1.3 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package com.tencent.ads.model; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import java.util.Objects; /** 诊断详情-曝光明细 */ @ApiModel(description = "诊断详情-曝光明细") public class ExposureDetailStruct { @SerializedName("effect_data") private ExposureEffectDataStruct effectData = null; @SerializedName("effect_data_trends") private List<ExposureEffectDataTrendsItem> effectDataTrends = null; @SerializedName("targeting_label_contribution") private ExposureTargetingLabelContributionStruct targetingLabelContribution = null; public ExposureDetailStruct effectData(ExposureEffectDataStruct effectData) { this.effectData = effectData; return this; } /** * Get effectData * * @return effectData */ @ApiModelProperty(value = "") public ExposureEffectDataStruct getEffectData() { return effectData; } public void setEffectData(ExposureEffectDataStruct effectData) { this.effectData = effectData; } public ExposureDetailStruct effectDataTrends( List<ExposureEffectDataTrendsItem> effectDataTrends) { this.effectDataTrends = effectDataTrends; return this; } public ExposureDetailStruct addEffectDataTrendsItem( ExposureEffectDataTrendsItem effectDataTrendsItem) { if (this.effectDataTrends == null) { this.effectDataTrends = new ArrayList<ExposureEffectDataTrendsItem>(); } this.effectDataTrends.add(effectDataTrendsItem); return this; } /** * Get effectDataTrends * * @return effectDataTrends */ @ApiModelProperty(value = "") public List<ExposureEffectDataTrendsItem> getEffectDataTrends() { return effectDataTrends; } public void setEffectDataTrends(List<ExposureEffectDataTrendsItem> effectDataTrends) { this.effectDataTrends = effectDataTrends; } public ExposureDetailStruct targetingLabelContribution( ExposureTargetingLabelContributionStruct targetingLabelContribution) { this.targetingLabelContribution = targetingLabelContribution; return this; } /** * Get targetingLabelContribution * * @return targetingLabelContribution */ @ApiModelProperty(value = "") public ExposureTargetingLabelContributionStruct getTargetingLabelContribution() { return targetingLabelContribution; } public void setTargetingLabelContribution( ExposureTargetingLabelContributionStruct targetingLabelContribution) { this.targetingLabelContribution = targetingLabelContribution; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ExposureDetailStruct exposureDetailStruct = (ExposureDetailStruct) o; return Objects.equals(this.effectData, exposureDetailStruct.effectData) && Objects.equals(this.effectDataTrends, exposureDetailStruct.effectDataTrends) && Objects.equals( this.targetingLabelContribution, exposureDetailStruct.targetingLabelContribution); } @Override public int hashCode() { return Objects.hash(effectData, effectDataTrends, targetingLabelContribution); } @Override public String toString() { Gson gson = new Gson(); return gson.toJson(this); } /** * 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 "); } }
[ "dennyqian@tencent.com" ]
dennyqian@tencent.com
48d51832b08f5135680139b6d9c6886aa6f5570c
c0aa19f9775b6c0444d0d79b95a81f35cad52475
/boosh-personality/src/main/java/com/oneops/boo/shell/Main.java
3d3ce595f98833af125788fac182a033ea1faebc
[ "Apache-2.0" ]
permissive
oneops/boosh
eb39f31d29fc32511f5c0b6d047892afb0aecd95
93787b3a3e4d8cc21ae8958b7da3e53fbad67f42
refs/heads/master
2021-09-23T18:59:23.964839
2021-09-08T13:12:18
2021-09-08T13:12:18
90,679,021
4
1
Apache-2.0
2020-04-24T04:44:35
2017-05-08T22:45:23
Java
UTF-8
Java
false
false
2,379
java
/* * Copyright 2017-present Walmart, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.oneops.boo.shell; import com.google.inject.Module; import com.planet57.gossip.Level; import com.planet57.gshell.MainSupport; import com.planet57.gshell.branding.Branding; import com.planet57.gshell.logging.LoggingSystem; import com.planet57.gshell.logging.logback.LogbackLoggingSystem; import com.planet57.gshell.logging.logback.TargetConsoleAppender; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List; /** * Command-line bootstrap for {@code boosh}. */ public class Main extends MainSupport { @Override protected Branding createBranding() { return new BrandingImpl(); } /** * Force logback to use current {@link System#out} reference before they are adapted by ThreadIO. */ @Override protected void setupLogging(@Nullable final Level level) { TargetConsoleAppender.setTarget(System.out); // adapt configuration properties for logging unless already set if (level != null) { maybeSetProperty("shell.logging.console.threshold", level.name()); maybeSetProperty("shell.logging.file.threshold", level.name()); maybeSetProperty("shell.logging.root-level", level.name()); } super.setupLogging(level); } /** * Helper to only set a property if not already set. */ private void maybeSetProperty(final String name, final String value) { if (System.getProperty(name) == null) { System.setProperty(name, value); } } @Override protected void configure(@Nonnull final List<Module> modules) { super.configure(modules); modules.add(binder -> { binder.bind(LoggingSystem.class).to(LogbackLoggingSystem.class); }); } public static void main(final String[] args) throws Exception { new Main().boot(args); } }
[ "jason@planet57.com" ]
jason@planet57.com
52f575668d303cc36e26484ca98ce2e7c0ba63c4
0d4a2464c0fec2288f868cc19f76bc377c9ad24f
/shopping-files-plugin/src/main/java/com/shoppingfilesplugin/shoppingfilesplugin/plugin/controller/FileNewController.java
f08378effee28a9eddb3d106036e71b69fb0c63b
[]
no_license
albertmaxwell/NewShopping
b940b07b9457d690a610f3dca07e78f97eb26637
c5ded1845404c7de1c53e57b8cb9be302c3911e1
refs/heads/master
2022-07-16T09:03:37.686020
2019-12-20T10:37:34
2019-12-20T10:37:34
202,852,094
0
0
null
2022-06-29T17:37:08
2019-08-17T07:51:39
HTML
UTF-8
Java
false
false
6,177
java
package com.shoppingfilesplugin.shoppingfilesplugin.plugin.controller; import com.alibaba.shopping.common.common.enums.ErrorCode; import com.alibaba.shopping.common.common.exception.ResultException; import com.alibaba.shopping.common.common.vo.ResultVo; import com.shoppingfilesplugin.shoppingfilesplugin.plugin.runner.FilePluginConfig; import com.shoppingfilesplugin.shoppingfilesplugin.plugin.service.FileServicePluginFiles; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * 文件访问服务 * @author 盛凯 2018-11-1 * */ @RestController @RequestMapping("file_plugin") public class FileNewController { @Autowired private FileServicePluginFiles fileServicePluginFiles; @Value("${files.controller.enable:false}") private boolean controllerEnable; /** * 文件上传 * @param file * @param suffix * @return */ @RequestMapping(value="upload", method=RequestMethod.POST) public ResultVo upload(@RequestParam("file") MultipartFile file , @RequestParam("suffix") String suffix , @RequestParam(value = "busName", required = false) String busName //业务名 , HttpServletRequest request) { ResultVo resultVo = null; if(!controllerEnable) { resultVo = new ResultVo(); resultVo.setCode(ErrorCode.ERROR.getCode()); resultVo.setMessage("文件服务未开启"); return resultVo; } String path = request.getContextPath(); FilePluginConfig fpc = FilePluginConfig.getInstance(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/" + fpc.getFileWebPrefix() + "/"; try { if(file == null || StringUtils.isEmpty(suffix)) { throw new ResultException(ErrorCode.PARAM_ERROR.getCode(), "参数错误"); } resultVo = fileServicePluginFiles.upload(file, suffix, basePath, busName); } catch (ResultException e) { e.printStackTrace(); resultVo = e.getResultVO(); } return resultVo; } @RequestMapping(value = "/find", method={RequestMethod.GET} ,produces={"application/json"}) public Map find(@RequestParam(value="id", required=true) String id) { Map result = null; try { result = fileServicePluginFiles.find(id); } catch (Exception e) { e.printStackTrace(); // result.put("code", 500); // result.put("message", "接口访问异常"); // result.put("ok", false); // result.put("data", null); } return result; } @RequestMapping(value = "/finds", method={RequestMethod.GET} ,produces={"application/json"}) public Map finds(@RequestParam(value="ids", required=true) String ids) { Map result = null; try { result = fileServicePluginFiles.finds(ids); } catch (Exception e) { e.printStackTrace(); // result.put("code", 500); // result.put("message", "接口访问异常"); // result.put("ok", false); // result.put("data", null); } return result; } /** * 多文件上传 * @param file * @param suffix * @return */ @RequestMapping(value="uploads", method=RequestMethod.POST) public ResultVo uploads(@RequestParam("file") List<MultipartFile> file , @RequestParam("suffix") String suffix , @RequestParam(value = "busName", required = false) String busName //业务名 , HttpServletRequest request) { ResultVo resultVo = new ResultVo<>(); resultVo.setOk(true); if(!controllerEnable) { resultVo = new ResultVo(); resultVo.setCode(ErrorCode.ERROR.getCode()); resultVo.setMessage("文件服务未开启"); resultVo.setOk(false); return resultVo; } String[] s = suffix.split(","); if(file.size() != s.length) { resultVo = new ResultVo(); resultVo.setCode(ErrorCode.ERROR.getCode()); resultVo.setMessage("文件与后缀不对应"); resultVo.setOk(false); return resultVo; } //传输文件 List<String> ids = new ArrayList<>(); for(int i=0; i<file.size(); i++) { ResultVo<String> temp = upload(file.get(i), s[i], busName, request); if(10000 == temp.getCode()) { ids.add(temp.getData()); } else { resultVo.setMessage("部分文件未上传"); } } resultVo.setData(ids); return resultVo; } /** * 多文件上传 * @param file * @param suffix * @return */ @RequestMapping(value="/swfUploads", method=RequestMethod.POST) public ResultVo swfUploads(MultipartFile Filedata,HttpServletRequest request, HttpServletResponse response, String ID, String Filename , String album_id) { MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; //MultipartFile multipartFile = (MultipartFile) request; List<MultipartFile> file=new ArrayList<>(); file.add(Filedata); String suffix="png"; String busName="业务图片"; ResultVo resultVo = new ResultVo<>(); resultVo.setOk(true); if(!controllerEnable) { resultVo = new ResultVo(); resultVo.setCode(ErrorCode.ERROR.getCode()); resultVo.setMessage("文件服务未开启"); resultVo.setOk(false); return resultVo; } String[] s = suffix.split(","); if(file.size() != s.length) { resultVo = new ResultVo(); resultVo.setCode(ErrorCode.ERROR.getCode()); resultVo.setMessage("文件与后缀不对应"); resultVo.setOk(false); return resultVo; } //传输文件 List<String> ids = new ArrayList<>(); for(int i=0; i<file.size(); i++) { ResultVo<String> temp = upload(file.get(i), s[i], busName, request); if(10000 == temp.getCode()) { ids.add(temp.getData()); } else { resultVo.setMessage("部分文件未上传"); } } resultVo.setData(ids); return resultVo; } }
[ "jhy..1008611" ]
jhy..1008611