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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5c522128cab011744a88c2b364266c0e93d1b97b
|
3c6f4bb030a42d19ce8c25a931138641fb6fd495
|
/hk-api-services/src/main/java/com/hongkun/finance/api/controller/redpacket/RedPacketController.java
|
cd702920dbf8ffda4bc8549fa7168eb04c5357d8
|
[] |
no_license
|
happyjianguo/finance-hkjf
|
93195df26ebb81a8b951a191e25ab6267b73aaca
|
0389a6eac966ee2e4887b6db4f99183242ba2d4e
|
refs/heads/master
| 2020-07-28T13:42:40.924633
| 2019-08-03T00:22:19
| 2019-08-03T00:22:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,286
|
java
|
package com.hongkun.finance.api.controller.redpacket;
import com.alibaba.dubbo.config.annotation.Reference;
import com.hongkun.finance.user.model.RegUser;
import com.hongkun.finance.user.support.security.annotation.ActionLog;
import com.hongkun.finance.user.utils.BaseUtil;
import com.hongkun.finance.vas.constants.VasConstants;
import com.hongkun.finance.vas.facade.VasRedpacketFacade;
import com.hongkun.finance.vas.model.VasRedpacketInfo;
import com.hongkun.finance.vas.service.VasRedpacketInfoService;
import com.yirun.framework.core.annotation.Token;
import com.yirun.framework.core.enums.PlatformSourceEnums;
import com.yirun.framework.core.model.ResponseEntity;
import com.yirun.framework.core.utils.AppResultUtil;
import com.yirun.framework.core.utils.pager.Pager;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Map;
/**
* @Description : 红包相关Controller
* @Project : framework
* @Program Name : com.hongkun.finance.api.controller.redpacket.RedPacketController
* @Author : pengwu@hongkun.com.cn 吴鹏
*/
@Controller
@RequestMapping("/redPacketController")
public class RedPacketController {
@Reference
private VasRedpacketInfoService redpacketInfoService;
@Reference
private VasRedpacketFacade redpacketFacade;
/**
* @param state 获取的红包状态:0-未领取,1-已领取,2-已过期
* @param pager {currentPage 当前页码
* pageSize} 每页条数
* @return : Map<String,Object>
* @Description : 获取用户红包记录
* @Method_Name : getRedPacketInfoList
* @Creation Date : 2018年03月09日 下午14:25:50
* @Author : pengwu@hongkun.com.cn
*/
@RequestMapping("/getRedPacketInfoList")
@ResponseBody
public Map<String,Object> getRedPacketInfoList(int state, Pager pager){
RegUser regUser = BaseUtil.getLoginUser();
ResponseEntity result = redpacketInfoService.getRedPacketInfoList(regUser.getId(),state,pager);
return AppResultUtil.successOfListInProperties((List<VasRedpacketInfo>)result.getResMsg(),"查询成功"
,"value","endTime","state","key");
}
/**
* @param key 红包key
* @param typeValue 11-IOS,12-ANDROID
* @return : Map<String,Object>
* @Description : 激活红包
* @Method_Name : exchangeRedPacketInfo
* @Creation Date : 2018年03月09日 下午14:49:50
* @Author : pengwu@hongkun.com.cn
*/
@RequestMapping("/exchangeRedPacketInfo")
@ResponseBody
@ActionLog(msg = "用户兑换红包, 红包兑换码: {args[0]}, 兑换来源: {args[1]}")
public Map<String,Object> exchangeRedPacketInfo(String key,int typeValue){
if (StringUtils.isBlank(key)){
AppResultUtil.errorOfMsg("红包兑换码不能为空!");
}
RegUser regUser = BaseUtil.getLoginUser();
ResponseEntity result = redpacketFacade.exchangeRedPacketInfo(regUser.getId(),key, PlatformSourceEnums
.typeByValue(typeValue));
return AppResultUtil.mapOfResponseEntity(result);
}
}
|
[
"zc.ding@foxmail.com"
] |
zc.ding@foxmail.com
|
bb6a1a91a515c09816b4c70dd8984a064eaa58ca
|
c1b940c548890b1f8834586ddcda06ad79bcb533
|
/messenger/src/main/java/by/vironit/training/basumatarau/messenger/service/util/VisitableContactEntryVo.java
|
88c764049d411e3f698949e7a6e2ebe9652fa712
|
[] |
no_license
|
basumatarau/instant-messenger-app
|
355e53deee45fada2a667e61a77ca6e4a70d7515
|
9c3333f38c3e1fb48a017191a09e6c2f1a79633d
|
refs/heads/master
| 2022-09-25T00:44:43.335849
| 2019-09-24T11:13:09
| 2019-09-24T11:13:09
| 199,909,978
| 3
| 0
| null | 2022-09-08T01:01:49
| 2019-07-31T18:35:54
|
Java
|
UTF-8
|
Java
| false
| false
| 331
|
java
|
package by.vironit.training.basumatarau.messenger.service.util;
import by.vironit.training.basumatarau.messenger.dto.IncomingMessageDto;
public interface VisitableContactEntryVo
<T extends MessagingServiceVisitor,
R extends IncomingMessageDto> {
void accept(T visitor, R msg) throws InstantiationException;
}
|
[
"basumatarau@gmail.com"
] |
basumatarau@gmail.com
|
d04c35ffde360133b85578a78b317d3e2762b51e
|
0493acd9dbc7df55a9302be799aa938f9381d3b2
|
/main/com/ctp/CThostFtdcQryFrontStatusField.java
|
cc35f0a117355e11a9c8aeae1362cfa729cdb4b8
|
[] |
no_license
|
elan2wang/jctp
|
4ac2828d205b85ad3bcdfcb1aa8a29f812e013f4
|
c3d25d1958815c82116c8b44be15703cf5b3e53d
|
refs/heads/master
| 2021-01-16T19:36:22.006804
| 2017-08-28T16:07:22
| 2017-08-28T16:07:22
| 100,178,852
| 2
| 5
| null | 2017-10-08T07:21:28
| 2017-08-13T13:34:30
|
C++
|
UTF-8
|
Java
| false
| false
| 1,385
|
java
|
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.ctp;
public class CThostFtdcQryFrontStatusField {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected CThostFtdcQryFrontStatusField(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(CThostFtdcQryFrontStatusField obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
ctpapiJNI.delete_CThostFtdcQryFrontStatusField(swigCPtr);
}
swigCPtr = 0;
}
}
public void setFrontID(int value) {
ctpapiJNI.CThostFtdcQryFrontStatusField_FrontID_set(swigCPtr, this, value);
}
public int getFrontID() {
return ctpapiJNI.CThostFtdcQryFrontStatusField_FrontID_get(swigCPtr, this);
}
public CThostFtdcQryFrontStatusField() {
this(ctpapiJNI.new_CThostFtdcQryFrontStatusField(), true);
}
}
|
[
"shohokh@gmail.com"
] |
shohokh@gmail.com
|
789039c8ecfd0f4b5a72de2a192852d4d994084d
|
a55b85b6dd6a4ebf856b3fd80c9a424da2cd12bd
|
/core/src/main/java/org/marketcetera/module/ModuleFactory.java
|
470698a014b66223711ef41e4213e6b338545c36
|
[] |
no_license
|
jeffreymu/marketcetera-2.2.0-16652
|
a384a42b2e404bcc6140119dd2c6d297d466596c
|
81cdd34979492f839233552432f80b3606d0349f
|
refs/heads/master
| 2021-12-02T11:18:01.399940
| 2013-08-09T14:36:21
| 2013-08-09T14:36:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,626
|
java
|
package org.marketcetera.module;
import org.marketcetera.util.log.I18NBoundMessage;
import org.marketcetera.util.log.ActiveLocale;
import org.marketcetera.util.misc.ClassVersion;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/* $License$ */
/**
* A factory for creating module instance(s). Each module
* factory must have an public constructor that doesn't
* accept any arguments.
* <p>
* Instances of module factory are created automatically
* by the {@link ModuleManager} when {@link ModuleManager#init() initializing}.
* The module manager uses the {@link java.util.ServiceLoader} mechanism for
* discovering <code>ModuleFactory</code> and loading implementations.
* <p>
* Only a single instance of <code>ModuleFactory</code> implementation exists
* within the module manager. However, do note that multiple instances
* may be created and then discarded when
* {@link org.marketcetera.module.ModuleManager#refresh() reloading}
* the factories.
* <p>
* If the factory does not support
* {@link #isMultipleInstances() multiple}
* module instances, a singleton module instance is
* created, when the module factory is loaded, <b>if</b> the
* factory doesn't need any parameters to create module
* instance. If the factory does need parameters to create
* module instance, the instance needs to manually created
* by the user via the <code>ModuleManager</code> by supplying the
* value of those parameters.
* <p>
* If the factory supports modules that can be
* {@link #isAutoInstantiate() auto-instantiated} its
* create method should be able to create new module
* instances by accepting the module instance URN as the
* only parameter to its {@link #create(Object[])} method.
*
* And the {@link #getParameterTypes()} method should return
* a List that contains <code>ModuleURN.class</code> as its first element,
* otherwise an error is thrown when initializing the factory.
* <p>
* {@link #isAutoInstantiate()} value is ignored when the factory
* doesn't support multiple instances.
*
* @author anshul@marketcetera.com
* @version $Id: ModuleFactory.java 16154 2012-07-14 16:34:05Z colin $
* @since 1.0.0
*/
@ClassVersion("$Id: ModuleFactory.java 16154 2012-07-14 16:34:05Z colin $") //$NON-NLS-1$
public abstract class ModuleFactory {
/**
* Creates an instance of the factory, given the parameters.
* <p>
* This operation is never invoked concurrently. The module framework
* ensures that only a single instance of this operation is active in
* a thread at any point in time. If this operation is slow, it may delay
* creation of other modules from the same provider.
*
* @param inParameters the parameters for creating the module, the types
* of these parameters match those returned by
* {@link #getParameterTypes()}
*
* @return the module instance
*
* @throws ModuleCreationException if there were errors creating
* the module instance.
*/
public abstract Module create(Object... inParameters)
throws ModuleCreationException;
/**
* Returns the list of parameter types as expected by the
* {@link #create(Object[])} method above.
*
* @return the list of parameter types, cannot be null.
*/
public final Class[] getParameterTypes() {
return mParameterTypes.clone();
}
/**
* Returns true if factory supports multiple module instances
*
* @return true if the factory supports multiple module instances
*/
public final boolean isMultipleInstances() {
return mMultipleInstances;
}
/**
* Returns true if the factory supports auto-instantiated modules.
* ie. modules that are automatically instantiated by the framework
* when a request to create a data flow references their URN
* (with the instance name) when they do not exist.
* The framework extracts the instance name and supplies it to the
* factory to instantiate the module.
* <p>
* If a factory supports auto-instantiated modules, it should be
* able to create new module instances by accepting a single string
* attribute the value of which is the module instance URN as
* requested in the original data flow request.
* Such factory classes's {@link #getParameterTypes()} should always
* return a list of size 1, only containing <code>ModuleURN.class</code>.
*
* This condition is verified when the factory is loaded by the
* module framework, and if this condition is not found to be true,
* the module framework fails to load the factory class.
*
* @return if the factory supports auto-instantiated modules.
*/
public final boolean isAutoInstantiate() {
return mAutoInstantiate;
}
/**
* Returns the name of the module provider. A module
* provider URI has the following form.<br/>
* <code>metc:provType:providerName</code>
*
* @return the provider's URN
*/
public final ModuleURN getProviderURN() {
return mURN;
}
/**
* Returns the localized description of this module.
*
* @return the localized description
*/
public final I18NBoundMessage getProviderDescription() {
return mDescription;
}
/**
* Creates an instance.
*
* @param inURN the provider URN.
* @param inDescription the provider's description
* @param inMultipleInstances if the factory supports multiple
* module instances
* @param inAutoInstantiate if the factory supports auto-instantiated
* modules. This parameter is ignored if
* <code>inSupportsMultipleInstances</code> parameter is false. If this
* parameter is true, the factory should only need a parameter of
* type {@link ModuleURN} when creating new instances.
* @param inParameterTypes the types of parameters expected when creating
* new module instances via {@link #create(Object[])}
*/
protected ModuleFactory(ModuleURN inURN,
I18NBoundMessage inDescription,
boolean inMultipleInstances,
boolean inAutoInstantiate,
Class... inParameterTypes) {
mURN = inURN;
mDescription = inDescription;
mMultipleInstances = inMultipleInstances;
mAutoInstantiate = inAutoInstantiate;
mParameterTypes =
inParameterTypes == null
? new Class[0]
: inParameterTypes.clone();
}
/**
* Returns the provider info describing the factory.
*
* @return the provider info for the factory.
*/
final ProviderInfo getProviderInfo() {
return new ProviderInfo(
getProviderURN(),
getParameterTypes(),
isMultipleInstances(),
isAutoInstantiate(),
getProviderDescription().getText(ActiveLocale.getLocale()),
mLock.isLocked(),
mLock.getQueueLength());
}
/**
* Returns the lock that should be used for serializing
* factory operations.
*
* @return the factory lock.
*/
final Lock getLock() {
return mLock;
}
private final ReentrantLock mLock = new ReentrantLock();
private final ModuleURN mURN;
private final I18NBoundMessage mDescription;
private final boolean mMultipleInstances;
private final boolean mAutoInstantiate;
private final Class[] mParameterTypes;
}
|
[
"vladimir_petrovich@yahoo.com"
] |
vladimir_petrovich@yahoo.com
|
e053122d72f2645b157dde991171bb029f6f143d
|
bcd4762b1961dfa3cdebe8d24ab20760eb1a9732
|
/phloc-web/src/test/java/com/phloc/web/proxy/HttpProxyConfigTest.java
|
1d8a9d13053da70145d9e8d830d1e545b38bb996
|
[] |
no_license
|
phlocbg/phloc-webbasics
|
4d7d773f7d8fc90349432982e647d66aa2b322b8
|
c1a4c5ffab91c89abf27e080601b509061e9cf47
|
refs/heads/master
| 2023-07-20T01:39:32.772637
| 2023-07-14T16:23:00
| 2023-07-14T16:23:00
| 41,255,519
| 0
| 0
| null | 2022-12-06T00:05:48
| 2015-08-23T15:42:00
|
Java
|
UTF-8
|
Java
| false
| false
| 5,021
|
java
|
/**
* Copyright (C) 2006-2015 phloc systems
* http://www.phloc.com
* office[at]phloc[dot]com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.phloc.web.proxy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.net.Proxy;
import org.junit.Test;
import com.phloc.commons.collections.ContainerHelper;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
* Test class for class {@link HttpProxyConfig}.
*
* @author Philip Helger
*/
public final class HttpProxyConfigTest
{
@Test
public void testAll ()
{
try
{
final HttpProxyConfig aPC = new HttpProxyConfig (EHttpProxyType.HTTP, "host", 8080);
assertEquals (EHttpProxyType.HTTP, aPC.getType ());
assertEquals ("host", aPC.getHost ());
assertEquals (8080, aPC.getPort ());
assertNotNull (aPC.getNonProxyHosts ());
assertTrue (aPC.getNonProxyHosts ().isEmpty ());
assertNotNull (aPC.getAsProxy ());
assertEquals (Proxy.Type.HTTP, aPC.getAsProxy ().type ());
aPC.activateGlobally ();
}
finally
{
HttpProxyConfig.deactivateGlobally ();
}
}
@Test
@SuppressFBWarnings ({ "NP_NONNULL_PARAM_VIOLATION", "TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED" })
public void testInvalid ()
{
try
{
// null type not allowed
new HttpProxyConfig (null, "host", 8080);
fail ();
}
catch (final NullPointerException ex)
{}
try
{
// null host not allowed
new HttpProxyConfig (EHttpProxyType.HTTPS, null, 8080);
fail ();
}
catch (final NullPointerException ex)
{}
try
{
// empty host not allowed
new HttpProxyConfig (EHttpProxyType.HTTPS, "", 8080);
fail ();
}
catch (final IllegalArgumentException ex)
{}
try
{
// port invalid
new HttpProxyConfig (EHttpProxyType.HTTPS, "host", -1);
fail ();
}
catch (final IllegalArgumentException ex)
{}
try
{
// port invalid
new HttpProxyConfig (EHttpProxyType.HTTPS, "host", 100456);
fail ();
}
catch (final IllegalArgumentException ex)
{}
}
@Test
public void testNonProxyPorts ()
{
try
{
HttpProxyConfig aPC = new HttpProxyConfig (EHttpProxyType.HTTP, "host", 8080);
assertNotNull (aPC.getNonProxyHosts ());
assertTrue (aPC.getNonProxyHosts ().isEmpty ());
aPC.activateGlobally ();
aPC = new HttpProxyConfig (EHttpProxyType.HTTP, "host", 8080, ContainerHelper.newList ("localhost"));
assertNotNull (aPC.getNonProxyHosts ());
assertEquals (1, aPC.getNonProxyHosts ().size ());
assertTrue (aPC.getNonProxyHosts ().contains ("localhost"));
assertFalse (aPC.getNonProxyHosts ().contains ("127.0.0.1"));
aPC.activateGlobally ();
aPC = new HttpProxyConfig (EHttpProxyType.HTTP, "host", 8080, ContainerHelper.newList ("localhost", "127.0.0.1"));
assertNotNull (aPC.getNonProxyHosts ());
assertEquals (2, aPC.getNonProxyHosts ().size ());
assertTrue (aPC.getNonProxyHosts ().contains ("localhost"));
assertTrue (aPC.getNonProxyHosts ().contains ("127.0.0.1"));
aPC.activateGlobally ();
aPC = new HttpProxyConfig (EHttpProxyType.HTTP, "host", 8080, ContainerHelper.newList (null,
"localhost",
"",
"127.0.0.1",
"",
"",
"",
""));
assertNotNull (aPC.getNonProxyHosts ());
assertEquals (2, aPC.getNonProxyHosts ().size ());
assertTrue (aPC.getNonProxyHosts ().contains ("localhost"));
assertTrue (aPC.getNonProxyHosts ().contains ("127.0.0.1"));
aPC.activateGlobally ();
}
finally
{
HttpProxyConfig.deactivateGlobally ();
}
}
}
|
[
"bg@phloc.com"
] |
bg@phloc.com
|
72132a82fd4a4ed53abf706fb747264f4fe24210
|
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
|
/com.tencent.mm/classes.jar/com/tencent/mm/autogen/b/fw.java
|
91079037754fd58dc7806e0a8245e8881b696e9a
|
[] |
no_license
|
tsuzcx/qq_apk
|
0d5e792c3c7351ab781957bac465c55c505caf61
|
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
|
refs/heads/main
| 2022-07-02T10:32:11.651957
| 2022-02-01T12:41:38
| 2022-02-01T12:41:38
| 453,860,108
| 36
| 9
| null | 2022-01-31T09:46:26
| 2022-01-31T02:43:22
|
Java
|
UTF-8
|
Java
| false
| false
| 5,510
|
java
|
package com.tencent.mm.autogen.b;
import android.content.ContentValues;
import android.database.Cursor;
import com.tencent.mm.bk.a;
import com.tencent.mm.sdk.storage.IAutoDBItem;
import com.tencent.mm.sdk.storage.IAutoDBItem.MAutoDBInfo;
import com.tencent.mm.sdk.storage.observer.StorageObserverOwner;
import com.tencent.mm.sdk.storage.sql.Column;
import com.tencent.mm.sdk.storage.sql.SingleTable;
import java.lang.reflect.Field;
import java.util.Map;
import org.json.JSONObject;
public abstract class fw
extends IAutoDBItem
{
public static final IAutoDBItem.MAutoDBInfo DB_INFO = aJm();
public static final String[] INDEX_CREATE;
public static final Column ROWID;
public static final SingleTable TABLE = new SingleTable("OpenIMFinderInfoNew");
public static final Column kQf;
public static final Column kQg;
private static final int kQj;
private static final int kQk;
private static final StorageObserverOwner<fw> observerOwner = new StorageObserverOwner();
private static final int rowid_HASHCODE;
public String field_finder_username;
public String field_openIMUsername;
private boolean kQh = true;
private boolean kQi = true;
static
{
ROWID = new Column("rowid", "long", TABLE.getName(), "");
kQf = new Column("openIMUsername", "string", TABLE.getName(), "");
kQg = new Column("finder_username", "string", TABLE.getName(), "");
INDEX_CREATE = new String[0];
kQj = "openIMUsername".hashCode();
kQk = "finder_username".hashCode();
rowid_HASHCODE = "rowid".hashCode();
}
public static IAutoDBItem.MAutoDBInfo aJm()
{
IAutoDBItem.MAutoDBInfo localMAutoDBInfo = new IAutoDBItem.MAutoDBInfo();
localMAutoDBInfo.fields = new Field[2];
localMAutoDBInfo.columns = new String[3];
StringBuilder localStringBuilder = new StringBuilder();
localMAutoDBInfo.columns[0] = "openIMUsername";
localMAutoDBInfo.colsMap.put("openIMUsername", "TEXT PRIMARY KEY ");
localStringBuilder.append(" openIMUsername TEXT PRIMARY KEY ");
localStringBuilder.append(", ");
localMAutoDBInfo.primaryKey = "openIMUsername";
localMAutoDBInfo.columns[1] = "finder_username";
localMAutoDBInfo.colsMap.put("finder_username", "TEXT");
localStringBuilder.append(" finder_username TEXT");
localMAutoDBInfo.columns[2] = "rowid";
localMAutoDBInfo.sql = localStringBuilder.toString();
if (localMAutoDBInfo.primaryKey == null) {
localMAutoDBInfo.primaryKey = "rowid";
}
return localMAutoDBInfo;
}
private JSONObject toJSON()
{
JSONObject localJSONObject = new JSONObject();
try
{
a.b(localJSONObject, "openIMUsername", this.field_openIMUsername);
a.b(localJSONObject, "finder_username", this.field_finder_username);
return localJSONObject;
}
catch (Exception localException) {}
return localJSONObject;
}
public void convertFrom(ContentValues paramContentValues, boolean paramBoolean)
{
if (paramContentValues.containsKey("openIMUsername"))
{
this.field_openIMUsername = paramContentValues.getAsString("openIMUsername");
if (paramBoolean) {
this.kQh = true;
}
}
if (paramContentValues.containsKey("finder_username"))
{
this.field_finder_username = paramContentValues.getAsString("finder_username");
if (paramBoolean) {
this.kQi = true;
}
}
if (paramContentValues.containsKey("rowid")) {
this.systemRowid = paramContentValues.getAsLong("rowid").longValue();
}
}
public void convertFrom(Cursor paramCursor)
{
String[] arrayOfString = paramCursor.getColumnNames();
if (arrayOfString == null) {
return;
}
int i = 0;
int j = arrayOfString.length;
label20:
int k;
if (i < j)
{
k = arrayOfString[i].hashCode();
if (kQj != k) {
break label65;
}
this.field_openIMUsername = paramCursor.getString(i);
this.kQh = true;
}
for (;;)
{
i += 1;
break label20;
break;
label65:
if (kQk == k) {
this.field_finder_username = paramCursor.getString(i);
} else if (rowid_HASHCODE == k) {
this.systemRowid = paramCursor.getLong(i);
}
}
}
public ContentValues convertTo()
{
ContentValues localContentValues = new ContentValues();
if (this.kQh) {
localContentValues.put("openIMUsername", this.field_openIMUsername);
}
if (this.kQi) {
localContentValues.put("finder_username", this.field_finder_username);
}
if (this.systemRowid > 0L) {
localContentValues.put("rowid", Long.valueOf(this.systemRowid));
}
return localContentValues;
}
public IAutoDBItem.MAutoDBInfo getDBInfo()
{
return DB_INFO;
}
public String[] getIndexCreateSQL()
{
return INDEX_CREATE;
}
public StorageObserverOwner<? extends fw> getObserverOwner()
{
return observerOwner;
}
public Object getPrimaryKeyValue()
{
return this.field_openIMUsername;
}
public SingleTable getTable()
{
return TABLE;
}
public String getTableName()
{
return TABLE.getName();
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes4.jar
* Qualified Name: com.tencent.mm.autogen.b.fw
* JD-Core Version: 0.7.0.1
*/
|
[
"98632993+tsuzcx@users.noreply.github.com"
] |
98632993+tsuzcx@users.noreply.github.com
|
098e3dca37d66d2f2a3d34500517454c0385e77c
|
ba005c6729aed08554c70f284599360a5b3f1174
|
/lib/selenium-server-standalone-3.4.0/org/apache/http/impl/client/ProxyClient.java
|
25f2594213db5bde7b0f89e6141411e5000e44f5
|
[] |
no_license
|
Viral-patel703/Testyourbond-aut0
|
f6727a6da3b1fbf69cc57aeb89e15635f09e249a
|
784ab7a3df33d0efbd41f3adadeda22844965a56
|
refs/heads/master
| 2020-08-09T00:27:26.261661
| 2017-11-07T10:12:05
| 2017-11-07T10:12:05
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,730
|
java
|
package org.apache.http.impl.client;
import java.io.IOException;
import java.net.Socket;
import org.apache.http.ConnectionReuseStrategy;
import org.apache.http.HttpEntity;
import org.apache.http.HttpException;
import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.HttpRequestInterceptor;
import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.StatusLine;
import org.apache.http.auth.AuthSchemeRegistry;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.AuthState;
import org.apache.http.auth.Credentials;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.params.HttpClientParamConfig;
import org.apache.http.client.protocol.RequestClientConnControl;
import org.apache.http.config.ConnectionConfig;
import org.apache.http.conn.HttpConnectionFactory;
import org.apache.http.conn.ManagedHttpClientConnection;
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.conn.routing.RouteInfo.LayerType;
import org.apache.http.conn.routing.RouteInfo.TunnelType;
import org.apache.http.entity.BufferedHttpEntity;
import org.apache.http.impl.DefaultConnectionReuseStrategy;
import org.apache.http.impl.auth.BasicSchemeFactory;
import org.apache.http.impl.auth.DigestSchemeFactory;
import org.apache.http.impl.auth.HttpAuthenticator;
import org.apache.http.impl.auth.KerberosSchemeFactory;
import org.apache.http.impl.auth.NTLMSchemeFactory;
import org.apache.http.impl.auth.SPNegoSchemeFactory;
import org.apache.http.impl.conn.ManagedHttpClientConnectionFactory;
import org.apache.http.impl.execchain.TunnelRefusedException;
import org.apache.http.message.BasicHttpRequest;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpParamConfig;
import org.apache.http.params.HttpParams;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.HttpContext;
import org.apache.http.protocol.HttpProcessor;
import org.apache.http.protocol.HttpRequestExecutor;
import org.apache.http.protocol.ImmutableHttpProcessor;
import org.apache.http.protocol.RequestTargetHost;
import org.apache.http.protocol.RequestUserAgent;
import org.apache.http.util.Args;
import org.apache.http.util.EntityUtils;
public class ProxyClient
{
private final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory;
private final ConnectionConfig connectionConfig;
private final RequestConfig requestConfig;
private final HttpProcessor httpProcessor;
private final HttpRequestExecutor requestExec;
private final ProxyAuthenticationStrategy proxyAuthStrategy;
private final HttpAuthenticator authenticator;
private final AuthState proxyAuthState;
private final AuthSchemeRegistry authSchemeRegistry;
private final ConnectionReuseStrategy reuseStrategy;
public ProxyClient(HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory, ConnectionConfig connectionConfig, RequestConfig requestConfig)
{
this.connFactory = (connFactory != null ? connFactory : ManagedHttpClientConnectionFactory.INSTANCE);
this.connectionConfig = (connectionConfig != null ? connectionConfig : ConnectionConfig.DEFAULT);
this.requestConfig = (requestConfig != null ? requestConfig : RequestConfig.DEFAULT);
httpProcessor = new ImmutableHttpProcessor(new HttpRequestInterceptor[] { new RequestTargetHost(), new RequestClientConnControl(), new RequestUserAgent() });
requestExec = new HttpRequestExecutor();
proxyAuthStrategy = new ProxyAuthenticationStrategy();
authenticator = new HttpAuthenticator();
proxyAuthState = new AuthState();
authSchemeRegistry = new AuthSchemeRegistry();
authSchemeRegistry.register("Basic", new BasicSchemeFactory());
authSchemeRegistry.register("Digest", new DigestSchemeFactory());
authSchemeRegistry.register("NTLM", new NTLMSchemeFactory());
authSchemeRegistry.register("Negotiate", new SPNegoSchemeFactory());
authSchemeRegistry.register("Kerberos", new KerberosSchemeFactory());
reuseStrategy = new DefaultConnectionReuseStrategy();
}
@Deprecated
public ProxyClient(HttpParams params)
{
this(null, HttpParamConfig.getConnectionConfig(params), HttpClientParamConfig.getRequestConfig(params));
}
public ProxyClient(RequestConfig requestConfig)
{
this(null, null, requestConfig);
}
public ProxyClient() {
this(null, null, null);
}
@Deprecated
public HttpParams getParams()
{
return new BasicHttpParams();
}
@Deprecated
public AuthSchemeRegistry getAuthSchemeRegistry()
{
return authSchemeRegistry;
}
public Socket tunnel(HttpHost proxy, HttpHost target, Credentials credentials)
throws IOException, HttpException
{
Args.notNull(proxy, "Proxy host");
Args.notNull(target, "Target host");
Args.notNull(credentials, "Credentials");
HttpHost host = target;
if (host.getPort() <= 0) {
host = new HttpHost(host.getHostName(), 80, host.getSchemeName());
}
HttpRoute route = new HttpRoute(host, requestConfig.getLocalAddress(), proxy, false, RouteInfo.TunnelType.TUNNELLED, RouteInfo.LayerType.PLAIN);
ManagedHttpClientConnection conn = (ManagedHttpClientConnection)connFactory.create(route, connectionConfig);
HttpContext context = new BasicHttpContext();
HttpRequest connect = new BasicHttpRequest("CONNECT", host.toHostString(), HttpVersion.HTTP_1_1);
BasicCredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(new AuthScope(proxy), credentials);
context.setAttribute("http.target_host", target);
context.setAttribute("http.connection", conn);
context.setAttribute("http.request", connect);
context.setAttribute("http.route", route);
context.setAttribute("http.auth.proxy-scope", proxyAuthState);
context.setAttribute("http.auth.credentials-provider", credsProvider);
context.setAttribute("http.authscheme-registry", authSchemeRegistry);
context.setAttribute("http.request-config", requestConfig);
requestExec.preProcess(connect, httpProcessor, context);
HttpResponse response;
for (;;) {
if (!conn.isOpen()) {
Socket socket = new Socket(proxy.getHostName(), proxy.getPort());
conn.bind(socket);
}
authenticator.generateAuthResponse(connect, proxyAuthState, context);
response = requestExec.execute(connect, conn, context);
int status = response.getStatusLine().getStatusCode();
if (status < 200) {
throw new HttpException("Unexpected response to CONNECT request: " + response.getStatusLine());
}
if (!authenticator.isAuthenticationRequested(proxy, response, proxyAuthStrategy, proxyAuthState, context))
break;
if (!authenticator.handleAuthChallenge(proxy, response, proxyAuthStrategy, proxyAuthState, context)) {
break;
}
if (reuseStrategy.keepAlive(response, context))
{
HttpEntity entity = response.getEntity();
EntityUtils.consume(entity);
} else {
conn.close();
}
connect.removeHeaders("Proxy-Authorization");
}
int status = response.getStatusLine().getStatusCode();
if (status > 299)
{
HttpEntity entity = response.getEntity();
if (entity != null) {
response.setEntity(new BufferedHttpEntity(entity));
}
conn.close();
throw new TunnelRefusedException("CONNECT refused by proxy: " + response.getStatusLine(), response);
}
return conn.getSocket();
}
}
|
[
"VIRUS-inside@users.noreply.github.com"
] |
VIRUS-inside@users.noreply.github.com
|
1a13f563a929250aba4d288c9de166027051154c
|
5783255be48d293919df28f933142d2fd9ff6791
|
/16_RefelectionAnnoatation/src/main/java/learn/reflection/spring/annotation/Component.java
|
bd0516fb60bb764d87abfdf0068c2684aa198e3a
|
[] |
no_license
|
AvinashTiwari/TestingFramework
|
96c8aa2d81d3f9024a1ba077a953e9f1ff54820c
|
16b24b300c72c4c05a3e7f351b783b55cc0f06cf
|
refs/heads/master
| 2022-11-24T21:35:43.570258
| 2021-02-20T00:22:29
| 2021-02-20T00:22:29
| 142,796,114
| 0
| 1
| null | 2022-11-16T12:19:36
| 2018-07-29T21:15:58
|
HTML
|
UTF-8
|
Java
| false
| false
| 198
|
java
|
package learn.reflection.spring.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Component {
}
|
[
"qwe123kids@gmail.com"
] |
qwe123kids@gmail.com
|
b94cb6d948c51683aa3e0bac5f4d0e32f358fd87
|
db2a87d7af621679921bfdcd93a212230684793a
|
/src/cn/javass/dp/simplefactory/example3/Api.java
|
fe5c72b6ca3ada0b21e78512b67cef4993063fcf
|
[] |
no_license
|
Wilsoncyf/designpattern
|
fa5f8a50e0d89f644ccb7edc1971465f3d21d3e4
|
11f62dd0753a7848c9de0453ee021a845347ebaa
|
refs/heads/master
| 2022-12-05T02:48:24.323214
| 2020-08-31T15:50:02
| 2020-08-31T15:50:02
| 290,809,079
| 1
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 366
|
java
|
package cn.javass.dp.simplefactory.example3;
/**
* 某个接口(通用的、抽象的、非具体的功能的)
*/
public interface Api {
/**
* 某个具体的功能方法的定义,用test1来演示一下。
* 这里的功能很简单,把传入的s打印输出即可
* @param s 任意想要打印输出的字符串
*/
public void test1(String s);
}
|
[
"417187306@qq.com"
] |
417187306@qq.com
|
ec33cffbabf4e0d72c6fe2fadb90c6a72f9e8343
|
2ffe0018d8d6b421e941c0e3ff9ecfaabc63165c
|
/fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/editors/AbstractFormEditor.java
|
abeda22068c661b4e42ae9570b1765d5df9298ea
|
[] |
no_license
|
opensagres/mongodb-ide
|
8b5a8f41828017d425bd88b18c5638a211aab31f
|
a39d31b076cf27900c263894e55a2f6b6be67fbe
|
refs/heads/master
| 2023-06-10T14:00:41.340032
| 2014-05-13T11:26:56
| 2014-05-13T11:26:56
| 4,914,729
| 2
| 2
| null | 2014-05-13T11:26:57
| 2012-07-05T20:31:06
|
Java
|
UTF-8
|
Java
| false
| false
| 4,950
|
java
|
/*******************************************************************************
* Copyright (C) 2012 Angelo Zerr <angelo.zerr@gmail.com>, Pascal Leclercq <pascal.leclercq@gmail.com>
* 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:
* Angelo ZERR - initial API and implementation
* Pascal Leclercq - initial API and implementation
*******************************************************************************/
package fr.opensagres.nosql.ide.ui.editors;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.forms.editor.FormEditor;
import fr.opensagres.nosql.ide.core.utils.StringUtils;
import fr.opensagres.nosql.ide.ui.internal.Trace;
import fr.opensagres.nosql.ide.ui.internal.extensions.EditorPageDescriptor;
import fr.opensagres.nosql.ide.ui.internal.extensions.EditorPagesRegistry;
/**
* Abstract Form Editor.
*
*/
public abstract class AbstractFormEditor<EditorInput extends IEditorInput>
extends FormEditor {
@Override
protected final void addPages() {
try {
onBeforeAddPages();
doAddPages();
try {
doAddExtensionPages();
} catch (CoreException e) {
Trace.trace(Trace.STRING_SEVERE,
"Error while adding pextension pages in the editor ", e);
}
onAfterAddPages();
} catch (PartInitException e) {
Trace.trace(Trace.STRING_SEVERE,
"Error while adding page in the editor ", e);
}
}
/**
* Methods called before addPages.
*/
protected void onBeforeAddPages() {
// Do nothing
}
/**
* Methods called after addPages.
*/
protected void onAfterAddPages() {
// Do nothing
}
@Override
public void doSaveAs() {
// Do nothing
}
public void doSave(IProgressMonitor monitor) {
onBeforeSave(monitor);
onSave(monitor);
onAfterSave(monitor);
}
/**
* Method called on before save.
*
* @param monitor
*/
protected void onBeforeSave(IProgressMonitor monitor) {
// commit pages
commitPages(true);
}
/**
* Method called on after save.
*
* @param monitor
*/
protected void onAfterSave(IProgressMonitor monitor) {
// modify the dirty state.
editorDirtyStateChanged();
}
@Override
public boolean isSaveAsAllowed() {
return false;
}
@Override
@SuppressWarnings("unchecked")
public EditorInput getEditorInput() {
return (EditorInput) super.getEditorInput();
}
private void doAddExtensionPages() throws CoreException, PartInitException {
String editorId = getEditorId();
if (editorId != null) {
List<EditorPageDescriptor> editorDescriptor = EditorPagesRegistry
.getRegistry().getDescriptors(editorId);
if (editorDescriptor != null) {
int pageIndex = 0;
String pageText = null;
for (EditorPageDescriptor descriptor : editorDescriptor) {
IEditorPart page = descriptor.createPage(this);
pageIndex = this.addPage(page, super.getEditorInput());
pageText = descriptor.getTitle();
if (pageText != null) {
this.setPageText(pageIndex, pageText);
}
}
}
}
}
@Override
protected void createPages() {
// creates pages
super.createPages();
// modify the title of the editor if needed.
String partName = getOverridePartName();
if (StringUtils.isNotEmpty(partName)) {
super.setPartName(partName);
}
// select a page if needed on page loaded.
String pageId = getActivePageIdOnLoad();
if (StringUtils.isNotEmpty(pageId)) {
super.setActivePage(pageId);
}
}
protected String getOverridePartName() {
return null;
}
protected String getActivePageIdOnLoad() {
IEditorInput input = getEditorInput();
if (input instanceof AbstractEditorInput) {
return ((AbstractEditorInput) input).getActivePageIdOnLoad();
}
return null;
}
public void contributeToToolbar(IToolBarManager manager) {
}
protected String getEditorId() {
return null;
}
/**
* Subclass should implement this method to add pages to the editor using
* 'addPage(IFormPage)' method.
*
* @throws PartInitException
*/
protected abstract void doAddPages() throws PartInitException;
/**
* Saves the contents of this editor.
* <p>
* Subclasses must override this method to implement the open-save-close
* lifecycle for an editor. For greater details, see
* <code>IEditorPart</code>
* </p>
*
* @see IEditorPart
*/
protected abstract void onSave(IProgressMonitor monitor);
}
|
[
"angelo.zerr@gmail.com"
] |
angelo.zerr@gmail.com
|
c529de2a34dca9086b0581ebd4575da48afb887f
|
168a79723a06dbfcef923b46cb31978cee9e1106
|
/OpenCV-for-Java/opencv2.4.13/ch12/Ch12_3_1OpticalFlowPyrLK.java
|
675b038d060d813c34e13bf24db376347b396a45
|
[] |
no_license
|
jash-git/OpenCV-for-Java_code
|
69a505fd6bc3c77bbc3b82f80e9e33de18c1e041
|
c3536aa286a0e1433ff13962612cffb06d1bb994
|
refs/heads/master
| 2020-12-02T14:00:57.215225
| 2019-12-31T05:18:05
| 2019-12-31T05:18:05
| 231,030,154
| 2
| 0
| null | null | null | null |
BIG5
|
Java
| false
| false
| 6,477
|
java
|
package ch12;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import javax.swing.JFrame;
import javax.swing.JPanel;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfByte;
import org.opencv.core.MatOfFloat;
import org.opencv.core.MatOfInt;
import org.opencv.core.MatOfInt4;
import org.opencv.core.MatOfPoint;
import org.opencv.core.MatOfPoint2f;
import org.opencv.core.Point;
import org.opencv.core.Range;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.core.Size;
import org.opencv.highgui.VideoCapture;
import org.opencv.imgproc.Imgproc;
import org.opencv.video.Video;
import org.opencv.core.CvType;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.Synthesizer;
import javax.sound.midi.MidiChannel;
public class Ch12_3_1OpticalFlowPyrLK {
static{ System.loadLibrary(Core.NATIVE_LIBRARY_NAME); }
public static void main(String arg[]) throws Exception{
JFrame frame2 = new JFrame("OpticalFlowPyrLK");
frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame2.setSize(640,480);
frame2.setBounds(300,100, frame2.getWidth()+50, 50+frame2.getHeight());
Panel panel2 = new Panel();
frame2.setContentPane(panel2);
frame2.setVisible(true);
//-- 2. Read the video stream
VideoCapture capture =new VideoCapture(0);//0表第1支CCD,1是第2支
Mat webcam_image=new Mat();
MatOfPoint2f mMOP2fptsThis=new MatOfPoint2f();
MatOfPoint2f mMOP2fptsPrev=new MatOfPoint2f();
MatOfPoint2f mMOP2fptsSafe = new MatOfPoint2f();
MatOfFloat mMOFerr=new MatOfFloat();
MatOfByte mMOBStatus=new MatOfByte();
Mat matOpFlowThis = new Mat();
Mat matOpFlowPrev = new Mat();
List<Point> pts, corners, cornersThis, cornersPrev;
List<Byte> byteStatus;
int x, y,iLineThickness = 3;
Point pt, pt1, pt2;
Scalar colorOpticalFlow = new Scalar(0, 255,0);
Mat mRgba;
capture.read(webcam_image);
frame2.setSize(webcam_image.width()+40,webcam_image.height()+60);
if( capture.isOpened())
{
while( true )
{
Thread.sleep(200);
capture.read(webcam_image);
if( !webcam_image.empty() )
{
mRgba=webcam_image.clone();
int qualityLevel = 40;
MatOfPoint MOPcorners = new MatOfPoint();
if (mMOP2fptsPrev.rows() == 0) {
// first time through the loop so we need prev and this mats
// plus prev points
// get this mat
Imgproc.cvtColor(mRgba, matOpFlowThis, Imgproc.COLOR_RGBA2GRAY);
// copy that to prev mat
matOpFlowThis.copyTo(matOpFlowPrev);
// get prev corners
Imgproc.goodFeaturesToTrack(matOpFlowPrev, MOPcorners, qualityLevel, 0.05, 20);
mMOP2fptsPrev.fromArray(MOPcorners.toArray());
// get safe copy of this corners
mMOP2fptsPrev.copyTo(mMOP2fptsSafe);
}
else
{
//Log.d("Baz", "Opflow");
// we've been through before so
// this mat is valid. Copy it to prev mat
matOpFlowThis.copyTo(matOpFlowPrev);
// get this mat
Imgproc.cvtColor(mRgba, matOpFlowThis, Imgproc.COLOR_RGBA2GRAY);
// get the corners for this mat
Imgproc.goodFeaturesToTrack(matOpFlowThis, MOPcorners, qualityLevel, 0.05, 20);
mMOP2fptsThis.fromArray(MOPcorners.toArray());
// retrieve the corners from the prev mat
// (saves calculating them again)
mMOP2fptsSafe.copyTo(mMOP2fptsPrev);
// and save this corners for next time through
mMOP2fptsThis.copyTo(mMOP2fptsSafe);
}
// Parameters:
// prevImg first 8-bit input image
// nextImg second input image
// prevPts vector of 2D points for which the flow needs to be found; point coordinates must be single-precision floating-point numbers.
// nextPts output vector of 2D points (with single-precision floating-point coordinates) containing the calculated new positions of input features in the second image; when OPTFLOW_USE_INITIAL_FLOW flag is passed, the vector must have the same size as in the input.
// status output status vector (of unsigned chars); each element of the vector is set to 1 if the flow for the corresponding features has been found, otherwise, it is set to 0.
// err output vector of errors; each element of the vector is set to an error for the corresponding feature, type of the error measure can be set in flags parameter; if the flow wasn't found then the error is not defined (use the status parameter to find such cases).
Video.calcOpticalFlowPyrLK(matOpFlowPrev, matOpFlowThis, mMOP2fptsPrev, mMOP2fptsThis, mMOBStatus, mMOFerr);
cornersPrev = mMOP2fptsPrev.toList();
cornersThis = mMOP2fptsThis.toList();
byteStatus = mMOBStatus.toList();
y = byteStatus.size() - 1;
for (x = 0; x < y; x++) {
if (byteStatus.get(x) == 1) {
pt = cornersThis.get(x);
pt2 = cornersPrev.get(x);
Core.circle(mRgba, pt, 5, colorOpticalFlow, iLineThickness - 1);
Core.line(mRgba, pt, pt2, colorOpticalFlow, iLineThickness);
}
}
panel2.setimagewithMat(mRgba); //
frame2.repaint();
}
else
{
System.out.println("無補抓任何畫面!");
break;
}
}
}
return;
}
}
|
[
"gitea@fake.local"
] |
gitea@fake.local
|
5115077478e56562fcdbcefc62e9e1a8f2624b19
|
5e57520287d4fe212e3d83f911df47167d83a287
|
/SafiFastAgi1.7/src/org/apache/mina/example/tapedeck/LoadCommand.java
|
a1d530f253c08409f528255e87de5ae06ed48208
|
[] |
no_license
|
acastroy/safiserver-all
|
dc2f0dfedbf994d7a4f7803907cea836530c9cec
|
039be68c5d4f7e65fd53f4a836eac39b3d349230
|
refs/heads/master
| 2020-03-31T19:38:06.020158
| 2010-10-30T10:16:45
| 2010-10-30T10:16:45
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,455
|
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.apache.mina.example.tapedeck;
/**
* Represents the <code>load <tape></code> command.
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev: 587133 $, $Date: 2008/05/29 07:04:19 $
*/
public class LoadCommand extends Command {
public static final String NAME = "load";
private final int tapeNumber;
public LoadCommand(int tapeNumber) {
this.tapeNumber = tapeNumber;
}
public int getTapeNumber() {
return tapeNumber;
}
@Override
public String getName() {
return NAME;
}
}
|
[
"steamedcotton@254595da-98a2-11de-83f8-39e71e4dc75d"
] |
steamedcotton@254595da-98a2-11de-83f8-39e71e4dc75d
|
1a723862c95a74baad11cb62f38fafa110d43e08
|
e04b92a384ce4742b4431988effbf08973c7a7c7
|
/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexSettingsPresenter.java
|
eaa99f2938d044148fad5d0379a578588b7afe87
|
[
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"CDDL-1.0",
"EPL-1.0",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-proprietary-license",
"CC-BY-4.0",
"MPL-1.0",
"Apache-2.0"
] |
permissive
|
gcdev373/stroom
|
c84c6e9af33cd99f6d75ab159078ed2aac61831f
|
7eabafa137f1acdba88708b1061ef928ac096541
|
refs/heads/master
| 2021-06-20T03:51:25.607821
| 2020-07-16T08:56:38
| 2020-07-16T08:56:38
| 204,675,801
| 0
| 0
|
Apache-2.0
| 2019-08-27T11:08:56
| 2019-08-27T10:08:56
| null |
UTF-8
|
Java
| false
| false
| 5,982
|
java
|
/*
* Copyright 2017 Crown Copyright
*
* 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 stroom.search.solr.client.presenter;
import com.google.gwt.core.client.GWT;
import com.google.inject.Inject;
import com.google.web.bindery.event.shared.EventBus;
import com.gwtplatform.mvp.client.HasUiHandlers;
import com.gwtplatform.mvp.client.View;
import stroom.alert.client.event.AlertEvent;
import stroom.dispatch.client.Rest;
import stroom.dispatch.client.RestFactory;
import stroom.docref.DocRef;
import stroom.entity.client.presenter.DocumentSettingsPresenter;
import stroom.entity.client.presenter.ReadOnlyChangeHandler;
import stroom.query.api.v2.ExpressionOperator;
import stroom.query.api.v2.ExpressionOperator.Op;
import stroom.data.client.presenter.EditExpressionPresenter;
import stroom.search.solr.client.presenter.SolrIndexSettingsPresenter.SolrIndexSettingsView;
import stroom.search.solr.shared.SolrConnectionConfig;
import stroom.search.solr.shared.SolrConnectionConfig.InstanceType;
import stroom.search.solr.shared.SolrIndexDataSourceFieldUtil;
import stroom.search.solr.shared.SolrIndexDoc;
import stroom.search.solr.shared.SolrIndexResource;
import java.util.List;
public class SolrIndexSettingsPresenter extends DocumentSettingsPresenter<SolrIndexSettingsView, SolrIndexDoc> implements SolrIndexSettingsUiHandlers {
private static final SolrIndexResource SOLR_INDEX_RESOURCE = GWT.create(SolrIndexResource.class);
private final EditExpressionPresenter editExpressionPresenter;
private final RestFactory restFactory;
@Inject
public SolrIndexSettingsPresenter(final EventBus eventBus,
final SolrIndexSettingsView view,
final EditExpressionPresenter editExpressionPresenter,
final RestFactory restFactory) {
super(eventBus, view);
this.editExpressionPresenter = editExpressionPresenter;
this.restFactory = restFactory;
view.setUiHandlers(this);
view.setRententionExpressionView(editExpressionPresenter.getView());
}
@Override
protected void onBind() {
registerHandler(editExpressionPresenter.addDirtyHandler(dirty -> setDirty(true)));
}
@Override
public void onChange() {
setDirty(true);
}
@Override
public void onTestConnection() {
final SolrIndexDoc index = new SolrIndexDoc();
onWrite(index);
final Rest<String> rest = restFactory.create();
rest
.onSuccess(result -> AlertEvent.fireInfo(this, "Success", result.toString(), null))
.call(SOLR_INDEX_RESOURCE)
.solrConnectionTest(index);
}
@Override
public String getType() {
return SolrIndexDoc.DOCUMENT_TYPE;
}
@Override
protected void onRead(final DocRef docRef, final SolrIndexDoc index) {
final SolrConnectionConfig connectionConfig = index.getSolrConnectionConfig();
if (connectionConfig != null) {
getView().setInstanceType(connectionConfig.getInstanceType());
getView().setSolrUrls(connectionConfig.getSolrUrls());
getView().setZkHosts(connectionConfig.getZkHosts());
getView().setZkPath(connectionConfig.getZkPath());
getView().setUseZk(connectionConfig.isUseZk());
}
getView().setDescription(index.getDescription());
getView().setCollection(index.getCollection());
if (index.getRetentionExpression() == null) {
index.setRetentionExpression(new ExpressionOperator.Builder().op(Op.AND).build());
}
editExpressionPresenter.init(restFactory, docRef, SolrIndexDataSourceFieldUtil.getDataSourceFields(index));
editExpressionPresenter.read(index.getRetentionExpression());
}
@Override
protected void onWrite(final SolrIndexDoc index) {
final SolrConnectionConfig connectionConfig = new SolrConnectionConfig();
connectionConfig.setInstanceType(getView().getInstanceType());
connectionConfig.setSolrUrls(getView().getSolrUrls());
connectionConfig.setZkHosts(getView().getZkHosts());
connectionConfig.setZkPath(getView().getZkPath());
connectionConfig.setUseZk(getView().isUseZk());
index.setSolrConnectionConfig(connectionConfig);
index.setDescription(getView().getDescription().trim());
if (getView().getCollection().trim().length() == 0) {
index.setCollection(null);
} else {
index.setCollection(getView().getCollection().trim());
}
index.setRetentionExpression(editExpressionPresenter.write());
}
public interface SolrIndexSettingsView extends View, ReadOnlyChangeHandler, HasUiHandlers<SolrIndexSettingsUiHandlers> {
String getDescription();
void setDescription(String description);
String getCollection();
void setCollection(String collection);
InstanceType getInstanceType();
void setInstanceType(InstanceType instanceType);
List<String> getSolrUrls();
void setSolrUrls(List<String> solrUrls);
boolean isUseZk();
void setUseZk(boolean useZk);
List<String> getZkHosts();
void setZkHosts(List<String> zkHosts);
String getZkPath();
void setZkPath(String zkPath);
void setRententionExpressionView(final View view);
}
}
|
[
"stroomdev66@gmail.com"
] |
stroomdev66@gmail.com
|
7e7fffd851d01d073c58ff361906cf75c1bde3b2
|
4d39274b5de5438d7b0101d216df5ddd2af76ed3
|
/app/src/main/java/com/d/newlist/StudentAdapter.java
|
2ac78df241532b28c2a7f96cbce88c59740c3f3c
|
[] |
no_license
|
huuhuybn/NewList
|
3d1b104598666e737555d4774af2d8843206024e
|
9791e3c7233d5e0805bee47de4ea14d6423700dc
|
refs/heads/master
| 2020-06-21T18:22:46.745426
| 2019-07-18T06:25:47
| 2019-07-18T06:25:47
| 197,525,107
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,259
|
java
|
package com.d.newlist;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import java.util.List;
public class StudentAdapter extends RecyclerView.Adapter<StudentHolder> {
private Context context;
private List<Student> studentList;
public StudentAdapter(Context context, List<Student> studentList) {
this.context = context;
this.studentList = studentList;
}
@NonNull
@Override
public StudentHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View view =
LayoutInflater.from(context).
inflate(R.layout.student, viewGroup, false);
StudentHolder student = new StudentHolder(view);
return student;
}
@Override
public void onBindViewHolder(@NonNull final StudentHolder studentHolder, int position) {
final Student student = studentList.get(position);
studentHolder.tvId.setText(student.id);
studentHolder.tvName.setText(student.name);
studentHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(context,
"Item Click " + studentHolder.getAdapterPosition(),
Toast.LENGTH_SHORT).show();
}
});
studentHolder.tvId.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(context,
"Item Click " + student.id,
Toast.LENGTH_SHORT).show();
}
});
studentHolder.tvName.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(context,
"Item Click " + student.name,
Toast.LENGTH_SHORT).show();
}
});
}
@Override
public int getItemCount() {
return studentList.size();
}
}
|
[
"huuhuybn@gmail.com"
] |
huuhuybn@gmail.com
|
036f3abc405a5a3151c76454b131acb8deefc13b
|
74cfe03426f96bc769f2ff8f50839e8398c8a2cc
|
/app/src/main/java/com/futuretongfu/ui/component/dialog/RegistUserTypeDialog.java
|
865392262ef5a3fc1cbc3ee9206049a33151a744
|
[] |
no_license
|
KqSMea8/ShouDuFu
|
c39b3cf59a8f86a0aee1182de73762ed363a6e5a
|
2ae031cbb90e946935334f14dd5f03414afcdb18
|
refs/heads/master
| 2020-05-30T10:42:26.086711
| 2019-06-01T01:42:56
| 2019-06-01T01:42:56
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,909
|
java
|
package com.futuretongfu.ui.component.dialog;
import android.app.Dialog;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import com.futuretongfu.R;
import com.futuretongfu.bean.entity.RegistUserTypeBean;
import com.futuretongfu.utils.StringUtil;
import com.futuretongfu.utils.To;
import java.util.List;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* 注册--选择收货地址
*/
public class RegistUserTypeDialog extends Dialog {
@Bind(R.id.tv_usertype1)
TextView tvUsertype1;
@Bind(R.id.tv_usertype2)
TextView tvUsertype2;
@Bind(R.id.tv_usertype3)
TextView tvUsertype3;
@Bind(R.id.tv_usertype4)
TextView tvUsertype4;
private Context context;
List<RegistUserTypeBean> data;
public RegistUserTypeDialog(Context context,List<RegistUserTypeBean> data) {
super(context, R.style.dialogWindowAnim);
this.context = context;
this.data = data;
setContentView(R.layout.dialog_regist_usertype_layout);
setCancelable(true);
setCanceledOnTouchOutside(true); //设置触摸对话框意外的地方取消对话框
ButterKnife.bind(this);
initData();
}
private void initData() {
if (null!=data&&data.size()>=3){
tvUsertype1.setText(data.get(0).getName()+": "+data.get(0).getRemark());
tvUsertype2.setText(data.get(1).getName()+": "+data.get(1).getRemark());
tvUsertype3.setText(data.get(2).getName()+": "+data.get(2).getRemark());
tvUsertype4.setText(data.get(3).getName()+": "+data.get(3).getRemark());
}
}
@OnClick({R.id.btn_ok})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.btn_ok:
dismiss();
break;
}
}
}
|
[
"you@example.com"
] |
you@example.com
|
24d61b952efbee244f2c5574e89394a03e1f01bb
|
07abcad3885092aef8abe76e0d78c2296d7fcd1b
|
/twoFactor/src/main/java/org/openTwoFactor/server/util/TwoFactorServerXstreamUtils.java
|
136e6d68f5faa5b4bcd28f838c37ac0cd084a668
|
[] |
no_license
|
mchyzer/openTwoFactor
|
df3acfc07f2f385999bd081eeaf2bfc937ee8ff0
|
6a62b59d176b13a1bc51a0b60a258cef7ea1012c
|
refs/heads/master
| 2023-08-28T19:06:16.817966
| 2023-08-14T17:30:34
| 2023-08-14T17:30:34
| 10,210,206
| 2
| 2
| null | 2021-06-04T01:00:06
| 2013-05-22T02:42:06
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 3,646
|
java
|
/*
* @author mchyzer
* $Id: TwoFactorServerXstreamUtils.java,v 1.1 2013/06/20 06:02:50 mchyzer Exp $
*/
package org.openTwoFactor.server.util;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.openTwoFactor.server.cache.TfEhcacheController;
import org.openTwoFactor.server.config.TwoFactorServerConfig;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.converters.javabean.JavaBeanConverter;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.mapper.MapperWrapper;
/**
*
*/
public class TwoFactorServerXstreamUtils {
/** logger */
private static final Log log = TwoFactorServerUtils.getLog(TfEhcacheController.class);
/**
* get xstream with all client aliases intact
* @return xstream
*/
public static XStream retrieveXstream() {
return retrieveXstream(TfRestClassLookup.getAliasClassMap());
}
/**
*
* @param aliasClassMap for xstream
* @return xstream, configured to use
*/
@SuppressWarnings("deprecation")
public static XStream retrieveXstream(Map<String, Class<?>> aliasClassMap) {
boolean ignoreExtraneousFields = true;
XStream xStream = null;
if (ignoreExtraneousFields) {
xStream = new XStream(new DomDriver()) {
/**
*
*/
@Override
protected MapperWrapper wrapMapper(MapperWrapper next) {
return new MapperWrapper(next) {
/**
*
* @see edu.internet2.middleware.grouperClientExt.com.thoughtworks.xstream.mapper.MapperWrapper#shouldSerializeMember(java.lang.Class, java.lang.String)
*/
@Override
public boolean shouldSerializeMember(Class definedIn, String fieldName) {
boolean definedInNotObject = definedIn != Object.class;
if (definedInNotObject) {
return super.shouldSerializeMember(definedIn, fieldName);
}
log.debug("Cant find field: " + fieldName);
return false;
}
};
}
};
} else {
xStream = new XStream(new DomDriver());
}
//xStream.registerConverter(new JavaBeanConverter(xStream.getMapper()));
xStream.registerConverter(new
JavaBeanConverter(xStream.getMapper(), "class"), -20);
//dont try to get fancy
xStream.setMode(XStream.NO_REFERENCES);
for (String key : TwoFactorServerUtils.nonNull(aliasClassMap).keySet()) {
xStream.alias(key, aliasClassMap.get(key));
}
xStream.autodetectAnnotations(true);
//see if omitting fields
String fieldsToOmit = TwoFactorServerConfig.retrieveConfig().propertyValueString("grouper.webService.omitXmlProperties");
if (!TwoFactorServerUtils.isBlank(fieldsToOmit)) {
List<String> fieldsToOmitList = TwoFactorServerUtils.splitTrimToList(fieldsToOmit, ",");
for (String fieldToOmit: fieldsToOmitList) {
if (!TwoFactorServerUtils.isBlank(fieldToOmit)) {
try {
int dotIndex = fieldToOmit.lastIndexOf('.');
String className = fieldToOmit.substring(0, dotIndex);
String propertyName = fieldToOmit.substring(dotIndex+1, fieldToOmit.length());
Class<?> theClass = TwoFactorServerUtils.forName(className);
xStream.omitField(theClass, propertyName);
} catch (Exception e) {
throw new RuntimeException("Problem with grouper.webService.omitXmlProperties: " + fieldsToOmit + ", " + e.getMessage(), e);
}
}
}
}
return xStream;
}
}
|
[
"mchyzer@yahoo.com"
] |
mchyzer@yahoo.com
|
32f536346f7446b91331cddeebd14ba58de372f9
|
27c4a5b470b167ced1ece66407b0404377f87aca
|
/JavaSE/LGame-0.3.2(OpenGL)/src/other/srpg/org/loon/framework/javase/game/srpg/ability/SRPGAbilityOption.java
|
dd2aef93ac24bff1bad79bcf70854932fedaf510
|
[] |
no_license
|
truecping1982/LGame
|
ae13b8595bc0778f44649eaa71453504aca45b50
|
b4c10a8e79a2e00373a6b6f47c51cb2dc7aa2aaa
|
refs/heads/master
| 2020-06-26T21:02:13.597244
| 2011-11-19T09:09:01
| 2011-11-19T09:09:01
| 2,807,646
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,528
|
java
|
package org.loon.framework.javase.game.srpg.ability;
/**
* Copyright 2008 - 2011
*
* 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.
*
* @project loonframework
* @author chenpeng
* @email:ceponline@yahoo.com.cn
* @version 0.1
*/
public class SRPGAbilityOption {
public boolean counter;
public boolean extinctmp;
public int attack_value;
public int[] warp_pos;
public boolean warp;
private static SRPGAbilityOption instance;
public static SRPGAbilityOption getInstance(boolean flag) {
if (instance == null) {
instance = new SRPGAbilityOption(flag);
} else {
instance.set(flag);
}
return instance;
}
public static SRPGAbilityOption getInstance() {
return getInstance(true);
}
public SRPGAbilityOption(boolean flag) {
this.set(flag);
}
public void set(boolean flag) {
this.counter = flag;
this.extinctmp = true;
this.attack_value = 0;
this.warp = false;
this.warp_pos = null;
}
public void setWarpPos(int x, int y) {
this.warp_pos = new int[] { x, y };
}
}
|
[
"javachenpeng@yahoo.com"
] |
javachenpeng@yahoo.com
|
f28da6de7290251f82531bc041152ce1c4705e99
|
4ed0d3ad57a111c99b21445754553f533594feac
|
/kodilla-stream/src/main/java/com/kodilla/stream/book/Book.java
|
f1a71e9aa2921516995643ce8649e34560e07e61
|
[] |
no_license
|
KrzysiekPrzybylski/Krzysztof-Przybylski--Kodilla-JAVA
|
631e5eef3fa86cb18704843d1efe0b06b43edda3
|
a0a8e03bf53cf3a30e7154061265aace7eacf0a6
|
refs/heads/master
| 2023-06-05T06:04:57.575520
| 2021-07-01T10:39:54
| 2021-07-01T10:39:54
| 309,326,706
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,018
|
java
|
package com.kodilla.stream.book;
public final class Book {
private final String title;
private final String author;
private final int yearOfPublication;
private final String signature;
public Book(String title, String author, int yearOfPublication, String signature) {
this.title = title;
this.author = author;
this.yearOfPublication = yearOfPublication;
this.signature = signature;
}
public String getTitle() {
return title;
}
public String getAuthor() {
return author;
}
public int getYearOfPublication() {
return yearOfPublication;
}
public String getSignature() {
return signature;
}
@Override
public String toString() {
return "Book{" +
"title='" + title + '\'' +
", author='" + author + '\'' +
", yearOfPublication=" + yearOfPublication +
", signature='" + signature + '\'' +
'}';
}
}
|
[
"krzy.przybylski@gmail.com"
] |
krzy.przybylski@gmail.com
|
a084bc37758f609d916f31aadb9af3247c551c88
|
cfc60fc1148916c0a1c9b421543e02f8cdf31549
|
/src/testcases/CWE606_Unchecked_Loop_Condition/CWE606_Unchecked_Loop_Condition__fromDB_71a.java
|
dcd84ac8b8a975f2d0b73b9f65dd324dc9b0bf9d
|
[
"LicenseRef-scancode-public-domain"
] |
permissive
|
zhujinhua/GitFun
|
c77c8c08e89e61006f7bdbc5dd175e5d8bce8bd2
|
987f72fdccf871ece67f2240eea90e8c1971d183
|
refs/heads/master
| 2021-01-18T05:46:03.351267
| 2012-09-11T16:43:44
| 2012-09-11T16:43:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,772
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE606_Unchecked_Loop_Condition__fromDB_71a.java
Label Definition File: CWE606_Unchecked_Loop_Condition.label.xml
Template File: sources-sinks-71a.tmpl.java
*/
/*
* @description
* CWE: 606 Unchecked Input for Loop Condition
* BadSource: fromDB Read a string from a database connection
* GoodSource: hardcoded int in string form
* Sinks:
* GoodSink: validate loop variable
* BadSink : loop variable not validated
* Flow Variant: 71 Data flow: data passed as an Object reference argument from one method to another in different classes in the same package
*
* */
package testcases.CWE606_Unchecked_Loop_Condition;
import testcasesupport.*;
import java.sql.*;
import javax.servlet.http.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.logging.Logger;
public class CWE606_Unchecked_Loop_Condition__fromDB_71a extends AbstractTestCase
{
public void bad() throws Throwable
{
String data;
Logger log_bad = Logger.getLogger("local-logger");
data = ""; /* init data */
Connection conn = null;
PreparedStatement statement = null;
ResultSet rs = null;
BufferedReader buffread = null;
InputStreamReader instrread = null;
try {
/* setup the connection */
conn = IO.getDBConnection();
/* prepare the query */
statement = conn.prepareStatement("select name from users where id=?");
/* get user input for the userid */
IO.writeLine("Enter a userid to login as (number): ");
instrread = new InputStreamReader(System.in);
buffread = new BufferedReader(instrread);
int num = Integer.parseInt(buffread.readLine());
statement.setInt(1, num);
rs = statement.executeQuery();
data = rs.getString(1);
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
finally {
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
/* clean up database objects */
try {
if( rs != null )
{
rs.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing rs");
}
finally {
try {
if( statement != null )
{
statement.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing statement");
}
finally {
try {
if( conn != null )
{
conn.close();
}
}
catch( SQLException se)
{
log_bad.warning("Error closing conn");
}
}
}
}
(new CWE606_Unchecked_Loop_Condition__fromDB_71b()).bad_sink((Object)data );
}
public void good() throws Throwable
{
goodG2B();
goodB2G();
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B() throws Throwable
{
String data;
data = "5";
(new CWE606_Unchecked_Loop_Condition__fromDB_71b()).goodG2B_sink((Object)data );
}
/* goodB2G() - use badsource and goodsink */
private void goodB2G() throws Throwable
{
String data;
Logger log_bad = Logger.getLogger("local-logger");
data = ""; /* init data */
Connection conn = null;
PreparedStatement statement = null;
ResultSet rs = null;
BufferedReader buffread = null;
InputStreamReader instrread = null;
try {
/* setup the connection */
conn = IO.getDBConnection();
/* prepare the query */
statement = conn.prepareStatement("select name from users where id=?");
/* get user input for the userid */
IO.writeLine("Enter a userid to login as (number): ");
instrread = new InputStreamReader(System.in);
buffread = new BufferedReader(instrread);
int num = Integer.parseInt(buffread.readLine());
statement.setInt(1, num);
rs = statement.executeQuery();
data = rs.getString(1);
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
finally {
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
/* clean up database objects */
try {
if( rs != null )
{
rs.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing rs");
}
finally {
try {
if( statement != null )
{
statement.close();
}
}
catch( SQLException se )
{
log_bad.warning("Error closing statement");
}
finally {
try {
if( conn != null )
{
conn.close();
}
}
catch( SQLException se)
{
log_bad.warning("Error closing conn");
}
}
}
}
(new CWE606_Unchecked_Loop_Condition__fromDB_71b()).goodB2G_sink((Object)data );
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"amitf@chackmarx.com"
] |
amitf@chackmarx.com
|
4dd5d389f549b9a5682aeec9c902a10515b4fac5
|
eb814d04a6d47d3cf546d801944cd55d96146450
|
/src/main/java/com/emusicstore/controller/ProductController.java
|
30326183ef8a913929c879da29d0e63bc7d31d97
|
[] |
no_license
|
marom/eMusicStore
|
b6007b4ba9b29f49e787e33a04bf652266929cfd
|
4cfedd09b82a3694876d59b03f346ba6666e02bb
|
refs/heads/master
| 2021-01-10T07:14:18.304290
| 2019-01-09T12:15:02
| 2019-01-09T12:15:02
| 54,060,750
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,540
|
java
|
package com.emusicstore.controller;
import com.emusicstore.model.Product;
import com.emusicstore.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* Created by maro on 21/03/16.
*/
@Controller
@RequestMapping("/product")
public class ProductController {
@Autowired
private ProductService productService;
@RequestMapping("/productList/all")
public String getProducts(Model model) {
List<Product> products = productService.getProductList();
model.addAttribute("products", products);
return "productList";
}
@RequestMapping("/viewProduct/{productId}")
public String viewProduct(@PathVariable int productId, Model model) {
Product product = productService.getProductById(productId);
model.addAttribute("product", product);
return "viewProduct";
}
@RequestMapping("/productList")
public String getProductByCategory(@RequestParam("searchCondition") String serachCondition, Model model) {
List<Product> products = productService.getProductList();
model.addAttribute("products", products);
model.addAttribute("searchCondition", serachCondition);
return "productList";
}
}
|
[
"maro.muszynski@gmail.com"
] |
maro.muszynski@gmail.com
|
5fbcbf1b16b4a753aa37f47c416d972618cb54c1
|
409bdfcaa53e73a69c816da3605001c6e0e7042d
|
/1.JavaSyntax/src/com/javarush/task/task04/task0404/Cat.java
|
9c0e1fbfb319ea0bc991f8b6040894b39b6a8c6c
|
[] |
no_license
|
sebelousov/javarushtasks
|
2a4c8ebcdba94196276b61688bb73ccf2cad039e
|
2710a327278ba04b40637cd5918491ef70ced117
|
refs/heads/master
| 2023-03-25T09:41:19.840213
| 2021-03-24T13:56:49
| 2021-03-24T13:56:49
| 351,092,038
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 301
|
java
|
package com.javarush.task.task04.task0404;
/*
Учет котов
*/
public class Cat {
private static int catsCount = 0;
public static void addNewCat() {
Cat.catsCount++;
//напишите тут ваш код
}
public static void main(String[] args) {
}
}
|
[
"bsn@list.ru"
] |
bsn@list.ru
|
1de05829fe3dc87b943df5e3d17aee9d4d887df8
|
31612282fb9a7d372594a29b408728bf19da1baa
|
/src/main/java/jp/ats/platemail/mail/MessageDigest.java
|
5e2cc27ed0f5357140388a9a97668f5544b81119
|
[] |
no_license
|
ats-jp/platemail
|
170ad51f82170e819ff72c95d1401f4c55fd0b68
|
301e11a56723997e78bf480d594ea5959af2bc6c
|
refs/heads/master
| 2022-09-27T09:04:01.588691
| 2022-01-04T16:20:51
| 2022-01-04T16:20:51
| 116,322,810
| 0
| 0
| null | 2022-09-01T22:35:57
| 2018-01-05T00:54:17
|
Java
|
UTF-8
|
Java
| false
| false
| 300
|
java
|
package jp.ats.platemail.mail;
import java.util.List;
/**
* メールの全情報のうち、使用頻度の高い重要な情報を持つことを表す
*/
public interface MessageDigest {
byte[] getRawMessage();
List<HeaderElement> getHeaderElements();
List<Recipient> getRecipients();
}
|
[
"ats.t.chiba@gmail.com"
] |
ats.t.chiba@gmail.com
|
52be7fbf0486559db45386b499f696252f078ec4
|
78348f3d385a2d1eddcf3d7bfee7eaf1259d3c6e
|
/examples/uml/fr.inria.diverse.puzzle.uml.compositestructures.metamodel/src/CompositeStructures/InvocationActions/Trigger.java
|
7e2f05c989e1961626edd353875072a670da071e
|
[] |
no_license
|
damenac/puzzle
|
6ac0a2fba6eb531ccfa7bec3a5ecabf6abb5795e
|
f74b23fd14ed5d6024667bf5fbcfe0418dc696fa
|
refs/heads/master
| 2021-06-14T21:23:05.874869
| 2017-03-27T10:24:31
| 2017-03-27T10:24:31
| 40,361,967
| 3
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,206
|
java
|
/**
*/
package CompositeStructures.InvocationActions;
import CompositeStructures.Ports.Port;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Trigger</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link CompositeStructures.InvocationActions.Trigger#getPort <em>Port</em>}</li>
* </ul>
* </p>
*
* @see CompositeStructures.InvocationActions.InvocationActionsPackage#getTrigger()
* @model abstract="true"
* @generated
*/
public interface Trigger extends EObject {
/**
* Returns the value of the '<em><b>Port</b></em>' reference list.
* The list contents are of type {@link CompositeStructures.Ports.Port}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Port</em>' reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Port</em>' reference list.
* @see CompositeStructures.InvocationActions.InvocationActionsPackage#getTrigger_Port()
* @model
* @generated
*/
EList<Port> getPort();
} // Trigger
|
[
"damenac@gmail.com"
] |
damenac@gmail.com
|
8307713cc535bed01a49fe43a386ad519cf3af71
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_1d3d5f2b15397ff0a73d44415d5af212d2a9d277/NMEASentenceFactory/2_1d3d5f2b15397ff0a73d44415d5af212d2a9d277_NMEASentenceFactory_t.java
|
245557c468b0036fec852f61ed48168c9fbccf56
|
[] |
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
| 3,080
|
java
|
/*******************************************************************************
* Copyright (c) 2008, 2009 Bug Labs, Inc.
* 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 Bug Labs, Inc. nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
package com.buglabs.nmea2;
import com.buglabs.nmea.sentences.NMEAParserException;
/**
* This factory will return a valid NMEA object based on a NMEA string, or null
* if no match is available.
*
* @author kgilmer
*
*/
public class NMEASentenceFactory {
/**
* An array of supported message types.
*/
public static final String[] SENTENCE_TYPES = { "$PTTK", "$GPGGA", "$GPRMC", "$GPGSV" };
/**
* @param gpsData
* @return A Concrete NMEA object or null if there is no match.
* @throws NMEAParserException
*/
public static AbstractNMEASentence getSentence(String gpsData) throws NMEAParserException {
if (gpsData == null) {
throw new NMEAParserException("Input data is NULL.");
}
try {
if (gpsData.startsWith(SENTENCE_TYPES[0])) {
return new PTTK(gpsData);
}
if (gpsData.startsWith(SENTENCE_TYPES[1])) {
return new GGA(gpsData);
}
if (gpsData.startsWith(SENTENCE_TYPES[2])) {
return new RMC(gpsData);
}
if (gpsData.startsWith(SENTENCE_TYPES[3])) {
return new GSV(gpsData);
}
} catch (RuntimeException e) {
//Convert unchecked exceptions into parse exceptions.
throw new NMEAParserException("Runtime exception occurred: " + e.getMessage(), e);
}
return null;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
d0b9d7a9e63c1752f97c1b621aa3013e4357432a
|
a6d91539ac2e61e4c632319e725287f57186856c
|
/src/com/plugins/dictionary/service/spring/SpringDictionaryService.java
|
ee44cedf21301e79f47db4489cbfd02ad8df56c4
|
[] |
no_license
|
liuguicheng/IntegrationGame
|
5c3bd6b783f5ab21ff1eeb88be4f471d76c53499
|
f4bc906713ac6b3ed25d5e497f3341269e38cd88
|
refs/heads/master
| 2020-02-26T15:54:33.835922
| 2016-12-24T02:28:42
| 2016-12-24T02:28:42
| 70,869,636
| 0
| 0
| null | 2016-10-27T13:46:02
| 2016-10-14T03:13:19
|
Java
|
GB18030
|
Java
| false
| false
| 8,283
|
java
|
package com.plugins.dictionary.service.spring;
import java.util.List;
import org.springframework.beans.BeanUtils;
import org.springline.beans.cache.CacheHelper;
import org.springline.orm.Page;
import com.console.ConsoleHelper;
import com.plugins.dictionary.DictionaryHelper;
import com.plugins.dictionary.command.DicDataEditInfo;
import com.plugins.dictionary.command.DicTypeEditInfo;
import com.plugins.dictionary.command.DicTypeQueryInfo;
import com.plugins.dictionary.entity.DicData;
import com.plugins.dictionary.entity.DicType;
import com.plugins.dictionary.service.IDictionaryService;
import com.plugins.dictionary.service.dao.IDictionaryDao;
public class SpringDictionaryService implements IDictionaryService {
/**注入dictionaryDao*/
private IDictionaryDao dictionaryDao;
/**
* @param dictionaryDao the dictionaryDao to set
*/
public void setDictionaryDao(IDictionaryDao dictionaryDao) {
this.dictionaryDao = dictionaryDao;
}
/**
* @see com.plugins.dionary.service.IDictionaryService#getDicTQueryPage(com.plugins.dictionary.command.DicTypeQueryInfo)
*/
public Page getDicTypeQueryPage(DicTypeQueryInfo info) {
return this.dictionaryDao.getDicTypeQueryPage(info);
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#selectAllDicType()
*/
public List selectAllDicType() {
return this.dictionaryDao.loadAll(DicType.class, "typeSort");
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#getDicTypeById(java.lang.String)
*/
public DicType getDicTypeById(String id) {
return (DicType)this.dictionaryDao.load(DicType.class, id);
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#saveDicType(com.plugins.dictionary.command.DicTypeEditInfo)
*/
public void saveDicType(DicTypeEditInfo info) {
DicType dicType = new DicType();
String currentCode = info.getTypeCode();
if (info.getTypeId() != null && info.getTypeId().trim().length() != 0) {
dicType = this.getDicTypeById(info.getTypeId());
currentCode = dicType.getTypeCode();
}
//判断类型编码是否存在重复,如果重复抛异常
if (this.dictionaryDao.checkExitTypeCode(dicType.getTypeCode(), info.getTypeCode())) {
throw new RuntimeException("类型编码『" + info.getTypeCode() + "』已被使用,请重新编辑类型编码!");
}
try {
BeanUtils.copyProperties(info, dicType, new String[] {"typeId"});//拷贝数据
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
this.dictionaryDao.save(dicType);
if (!info.getTypeCode().equals(currentCode)) {
//当字典编码发生改变时,级联更新字典内容表的数据,以便进行同步
this.dictionaryDao.updateDicData(info.getTypeCode(), currentCode);
//当字典编码改变时,注入新的字典,并注销旧的字典
this.registerData(dicType.getTypeCode());
}
//当新增时注入字典
if (info.getTypeId() == null || info.getTypeId().trim().length() == 0) {
this.registerData(info.getTypeCode());
}
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#getMaxTypeSort()
*/
public Integer getMaxTypeSort() {
return this.dictionaryDao.getMaxTypeSort();
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#getMaxDataCode(java.lang.String, java.lang.String)
*/
public String getMaxDataCode(String typeCode, String isLonger, Integer dataLong) {
int maxDataCode = this.dictionaryDao.getMaxDataCode(typeCode);
String dataCode = "" + maxDataCode;
if (isLonger.equals(ConsoleHelper.YES)) {//定长
dataCode = String.format("%0" + dataLong + "d", maxDataCode);
}
return dataCode;
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#selectAllDicDataByCode(java.lang.String)
*/
public List selectAllDicDataByCode(String typeCode) {
return this.dictionaryDao.loadAll(DicData.class, "typeCode", typeCode, "dataSort");
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#getDicTypeByCode(java.lang.String)
*/
public DicType getDicTypeByCode(String typeCode) {
DicType dicType = null;
List list = this.dictionaryDao.loadAll(DicType.class, "typeCode", typeCode, "typeSort");
if (list != null && list.size() > 0) {
dicType = new DicType();
dicType = (DicType)list.get(0);
}
return dicType;
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#getDicDataById(java.lang.String)
*/
public DicData getDicDataById(String dataId) {
return (DicData)this.dictionaryDao.load(DicData.class, dataId);
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#getMaxDataSort(java.lang.String)
*/
public Integer getMaxDataSort(String typeCode) {
return this.dictionaryDao.getMaxDataSort(typeCode);
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#saveDicData(com.plugins.dictionary.command.DicDataEditInfo)
*/
public void saveDicData(DicDataEditInfo info) {
DicData dicData = new DicData();
if (info.getDataId() != null && info.getDataId().trim().length() != 0) {
BeanUtils.copyProperties(info, dicData);//拷贝数据
} else {
if (info.getTypeWay().equals(DicData.AUTO_GENERATE)) {//如果是系统生成方式
dicData.setDataCode(this.getMaxDataCode(info.getTypeCode(), info.getIsLonger(), info.getDataLength()));
} else {//手工录入方式
//根据类型编码判断内容编码是否存在
if (!this.dictionaryDao.checkExitDataCode(info.getDataCode(), info.getTypeCode())) {
throw new RuntimeException("字典编码『" + info.getDataCode() + "』已被使用,请重新编辑字典编码!");
}
}
BeanUtils.copyProperties(info, dicData, new String[] {"dataId"});//拷贝数据
}
this.dictionaryDao.save(dicData);
//更新之后刷新字典
this.refreshData(dicData.getTypeCode());
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#deleteDicData(java.lang.String[])
*/
public void deleteDicData(String[] ids) {
if (ids == null || ids.length == 0) return;
DicData dicData = null;
for (int nI = 0; nI < ids.length; nI++) {
dicData = new DicData();
dicData = this.getDicDataById(ids[nI]);
if (dicData != null) {
dicData.setIsValid(ConsoleHelper.NO);
this.dictionaryDao.update(dicData);
//更新后刷新字典
this.refreshData(dicData.getTypeCode());
}
}
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#updateDicData(java.lang.String[])
*/
public void updateDicData(String[] ids) {
if (ids == null || ids.length == 0) return;
DicData dicData = null;
for (int nI = 0; nI < ids.length; nI++) {
dicData = new DicData();
dicData = this.getDicDataById(ids[nI]);
if (dicData != null) {
dicData.setIsValid(ConsoleHelper.YES);//正常使用
this.dictionaryDao.update(dicData);
//更新后刷新字典
this.refreshData(dicData.getTypeCode());
}
}
}
/**
* @see com.plugins.dictionary.service.IDictionaryService#deleteDicType(java.lang.String[])
*/
public void deleteDicType(String[] ids) {
if (ids == null || ids.length == 0) return;
DicType dicType = null;
for (int nI = 0; nI < ids.length; nI++) {
dicType = new DicType();
dicType = this.getDicTypeById(ids[nI]);
if (dicType != null) {
//删除相关的字典内容数据
this.dictionaryDao.deleteDicData(dicType.getTypeCode());
this.dictionaryDao.delete(dicType);
//删除后注销原有的字典
}
}
}
/**
* 刷新字典
* @param typeCode
*/
private void refreshData(String typeCode) {
CacheHelper.getInstance().dispatchRefreshEvent(typeCode);
}
/**
* 注入字典
* @param typeCode
*/
private void registerData(String typeCode) {
DictionaryHelper.getInstance().registerConnector(typeCode);
}
@Override
public String getDicDataByType(String typeCode, String code) {
List<DicData> dics = this.selectAllDicDataByCode(typeCode);
for(DicData dic: dics){
if(dic.getDataCode().equals(code)){
return dic.getDataName();
}
}
return "";
}
}
|
[
"282303392@qq.com"
] |
282303392@qq.com
|
470aba85399087b3a19e8215af00a88eafac3ff2
|
79595075622ded0bf43023f716389f61d8e96e94
|
/app/src/main/java/com/android/okhttp/internal/http/RequestException.java
|
e4df8546d446ab7a2c363cbaf167feecec7412e7
|
[] |
no_license
|
dstmath/OppoR15
|
96f1f7bb4d9cfad47609316debc55095edcd6b56
|
b9a4da845af251213d7b4c1b35db3e2415290c96
|
refs/heads/master
| 2020-03-24T16:52:14.198588
| 2019-05-27T02:24:53
| 2019-05-27T02:24:53
| 142,840,716
| 7
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 297
|
java
|
package com.android.okhttp.internal.http;
import java.io.IOException;
public final class RequestException extends Exception {
public RequestException(IOException cause) {
super(cause);
}
public IOException getCause() {
return (IOException) super.getCause();
}
}
|
[
"toor@debian.toor"
] |
toor@debian.toor
|
ef9b7eb3c28d773f19cd9d111678c8c2ad49a1fa
|
a79c006dc4ae5755a025e71d9a97a71dd5b30d4e
|
/yhcrtSocket/src/main/java/com/yhcrt/tcpip/util/Constans.java
|
ef32240273bef414d1363e0f38a9913ecaa3f13c
|
[] |
no_license
|
chocoai/workspace
|
d62774d92e255662374dae1894e36e08ea9529e6
|
ab0e20d7945ef8af439d848625eb30eb8f46e668
|
refs/heads/master
| 2020-04-13T07:37:52.922076
| 2018-11-09T11:03:09
| 2018-11-09T11:03:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,399
|
java
|
package com.yhcrt.tcpip.util;
import java.net.Socket;
import java.util.HashMap;
import java.util.Map;
public class Constans {
// key:imei
public static Map<String, Socket> clientMap = new HashMap<String, Socket>();
public static Map<String, String> clientKeyMap = new HashMap<String, String>();
public static Map<String, Object> socketReturnMap = new HashMap<String, Object>();
/****服务端错误码*******/
public final static Integer SUCCESS = 0; //成功
public final static Integer DISCONNECT_ERROR = 1; //断开连接
public final static Integer INNER_ERROR = 500; //断开连接
// 起始符 CHAR[4]
public final static String BEGIN_CODE = "{";
//协议版本号 CHAR[3]
public final static String PROTO_VERSION = "1";
//类别代码(接口编号)
public final static String FUN_HEART = "T2"; //客户端心跳报文
public final static String FUN_HEART_R = "S2"; //客户端心跳报文回复
public final static String FUN_START = "T1"; //开机通知--登陆
public final static String FUN_START_R = "S1"; //开机通知--登陆
public final static String FUN_WEATHER = "T47"; //终端请求获取天气
public final static String FUN_WEATHER_R = "S47"; //回复
public final static String FUN_BLOOD = "T45"; //血压上传
public final static String FUN_BLOOD_R = "S45"; //回复
public final static String FUN_HEART_RATE = "T28"; //心率-脉搏上传
public final static String FUN_HEART_RATE_R = "S28"; //
public final static String FUN_BLOOD_GLUCOSE = "T59"; //血糖上传
public final static String FUN_BLOOD_GLUCOSE_R = "S59"; //
public final static String FUN_STEP_NUM = "T50"; //步数上传
public final static String FUN_STEP_NUM_R = "S50"; //
public final static String FUN_LOCAL = "T29"; //位置上传
public final static String FUN_LOCAL_R = "S29"; //
public final static String FUN_CONTACTS_SET = "S57"; //联系人设置
public final static String FUN_GET_LOCAL = "S13"; //主动定位
public final static String FUN_GET_HEART_RATE = "S5"; //主动测心率
public final static String FUN_GET_BLOOD = "115"; //主动测血压
public final static String FUN_HEART_RATE_LIMIT = "47"; //心率阀值设置
public final static String FUN_DATA_RATE = "datarate"; //数据频率采集设置
// 结束符 CHAR[4]
public final static String END_CODE = "}";
}
|
[
"250344934@qq.com"
] |
250344934@qq.com
|
d54413d28153ca732837a3ca893173ddc9787a41
|
f680094f6d14de8d3f57bd25013729f2d5578592
|
/test/org/encog/neural/networks/TestConsistency.java
|
156673c96e3d0c2172bb61505982c5bf4295df79
|
[] |
no_license
|
bernardobreder/demo-neural-network
|
82dc070f04eb8995ece040274a9c04e06c5cb153
|
adf4485064bc4c1cf9dbad2f54242e31e23bdcd2
|
refs/heads/master
| 2022-04-07T06:19:31.087748
| 2020-02-10T11:58:47
| 2020-02-10T11:58:47
| 104,338,038
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,450
|
java
|
/*
* Encog(tm) Core v3.3 - Java Version
* http://www.heatonresearch.com/encog/
* https://github.com/encog/encog-java-core
* Copyright 2008-2014 Heaton Research, 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.
*
* For more information on Heaton Research copyrights, licenses
* and trademarks visit:
* http://www.heatonresearch.com/copyright
*/
package org.encog.neural.networks;
import org.encog.mathutil.randomize.ConsistentRandomizer;
import org.encog.ml.data.MLDataSet;
import org.encog.neural.networks.training.propagation.resilient.ResilientPropagation;
import org.encog.persist.EncogDirectoryPersistence;
import org.encog.util.benchmark.EncoderTrainingFactory;
import org.encog.util.simple.EncogUtility;
import org.junit.Assert;
import junit.framework.TestCase;
public class TestConsistency extends TestCase {
public static final double[] EXPECTED_WEIGHTS1 = { 0.008012107263322008, 1.3830172071769407, -0.027657273609111438,
0.3926920473512011, -0.5591917997643333, -0.03508764590487992, -0.8339860696052167, 0.1371821074024733,
0.6804152092361858, 0.9587552253200567, -0.9363149724379914, -0.28898946379986346, 1.0572222265035895,
0.3146739685034085, -0.8752594385878787, 0.4819077576654748, 0.7108891944426319, 0.7165167879211988,
-0.49437671786974574, -0.5433328356252362, -0.563603612348345, 0.559330141185627 };
public static final double[] EXPECTED_WEIGHTS2 = { 0.040412107263322006, 1.6318492071769406, 0.058742726390888546,
0.43589204735120113, -0.5159917997643333, 0.008112354095120074, -0.8555860696052167, 0.07497410740247332,
0.7668152092361858, 0.9911552253200567, -0.8643149724379915, -0.26738946379986345, 1.0788222265035896,
0.3470739685034085, -0.8302594385878788, 1.1248619976654748, 0.7984891944426319, 0.6841167879211988,
-0.6059767178697457, -0.6729328356252361, -0.720851612348345, 0.551830141185627 };
public void testRPROPConsistency() {
MLDataSet training = EncoderTrainingFactory.generateTraining(4, false);
BasicNetwork network = EncogUtility.simpleFeedForward(4, 2, 0, 4, true);
(new ConsistentRandomizer(-1, 1, 50)).randomize(network);
ResilientPropagation rprop = new ResilientPropagation(network, training);
for (int i = 0; i < 5; i++) {
rprop.iteration();
}
Assert.assertArrayEquals(EXPECTED_WEIGHTS1, network.getFlat().getWeights(), 0.0001);
for (int i = 0; i < 5; i++) {
rprop.iteration();
}
Assert.assertArrayEquals(EXPECTED_WEIGHTS2, network.getFlat().getWeights(), 0.0001);
double e = network.calculateError(training);
Assert.assertEquals(0.0767386807494191, e, 0.00001);
}
public void testFileConsistency() {
MLDataSet training = EncoderTrainingFactory.generateTraining(4, false);
BasicNetwork network = (BasicNetwork) EncogDirectoryPersistence
.loadResourceObject("org/encog/data/encodernet.eg");
double e = network.calculateError(training);
Assert.assertEquals(0.0767386807494191, e, 0.00001);
}
}
|
[
"bernardobreder@gmail.com"
] |
bernardobreder@gmail.com
|
03d03269ab922868b69e666431454f7ff897c92d
|
ce5311579cd772034ce71ec49c8be8c2faa31fe4
|
/modules/platform/nuxeo-platform-importer/nuxeo-importer-stream/src/test/java/org/nuxeo/lib/stream/tests/pattern/TestPatternBoundedQueuingChronicle.java
|
02db4e7f16b08ed43241083b838e832c9af15aa4
|
[
"Apache-2.0"
] |
permissive
|
bjalon/nuxeo
|
c02c6df2dfae8208fffe8bd397d0a62d1e6cc242
|
f0a2d3a97848b5be6b1490922dd7c2aba128e675
|
refs/heads/master
| 2023-08-24T11:59:42.851168
| 2021-07-14T08:13:25
| 2021-07-14T08:13:25
| 385,863,409
| 0
| 0
|
Apache-2.0
| 2021-07-14T08:11:08
| 2021-07-14T08:11:07
| null |
UTF-8
|
Java
| false
| false
| 1,748
|
java
|
/*
* (C) Copyright 2016 Nuxeo SA (http://nuxeo.com/) and others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.nuxeo.lib.stream.tests.pattern;
import static org.junit.Assume.assumeFalse;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
import org.nuxeo.lib.stream.log.LogManager;
import org.nuxeo.lib.stream.log.chronicle.ChronicleLogManager;
import org.nuxeo.runtime.test.runner.FeaturesRunner;
public class TestPatternBoundedQueuingChronicle extends TestPatternBoundedQueuing {
protected Path basePath;
@Before
public void skipWindowsThatDontCleanTempFolder() {
assumeFalse(TestPatternQueuingChronicle.IS_WIN);
}
@Rule
public TemporaryFolder folder = new TemporaryFolder(new File(FeaturesRunner.getBuildDirectory()));
@After
public void resetBasePath() throws IOException {
basePath = null;
}
@Override
public LogManager createManager() throws Exception {
if (basePath == null) {
basePath = folder.newFolder().toPath();
}
return new ChronicleLogManager(basePath);
}
}
|
[
"bdelbosc@nuxeo.com"
] |
bdelbosc@nuxeo.com
|
2b4af2b3ec16544f6ddf111655a89eb4c0195e33
|
104b421e536d1667a70f234ec61864f9278137c4
|
/code/com/example/example75f1799f07eb/Manifest.java
|
e18a72fa970d153ec0f5cd782bf1998484aa2e94
|
[] |
no_license
|
AshwiniVijayaKumar/Chrome-Cars
|
f2e61347c7416d37dae228dfeaa58c3845c66090
|
6a5e824ad5889f0e29d1aa31f7a35b1f6894f089
|
refs/heads/master
| 2021-01-15T11:07:57.050989
| 2016-05-13T05:01:09
| 2016-05-13T05:01:09
| 58,521,050
| 1
| 0
| null | 2016-05-11T06:51:56
| 2016-05-11T06:51:56
| null |
UTF-8
|
Java
| false
| false
| 519
|
java
|
package com.example.example75f1799f07eb;
public final class Manifest
{
public static final class permission
{
public static final String C2D_MESSAGE = "com.app.app2694da75cd4e.permission.C2D_MESSAGE";
public static final String MAPS_RECEIVE = "com.app.app2694da75cd4e.permission.MAPS_RECEIVE";
}
}
/* Location: C:\Users\ADMIN\Desktop\foss\dex2jar-2.0\classes-dex2jar.jar!\com\example\example75f1799f07eb\Manifest.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"ASH ABHI"
] |
ASH ABHI
|
9fdcfddaec78bbd048bf78aca5b1bfa09450c479
|
c16ea32a4cddb6b63ad3bacce3c6db0259d2bacd
|
/google/ads/googleads/v6/googleads-java/gapic-googleads-java/src/main/java/com/google/ads/googleads/v6/services/stub/GrpcInvoiceServiceStub.java
|
31128fe46e51b7e4b8cf406e3e77c8fbc0db8115
|
[
"Apache-2.0"
] |
permissive
|
dizcology/googleapis-gen
|
74a72b655fba2565233e5a289cfaea6dc7b91e1a
|
478f36572d7bcf1dc66038d0e76b9b3fa2abae63
|
refs/heads/master
| 2023-06-04T15:51:18.380826
| 2021-06-16T20:42:38
| 2021-06-16T20:42:38
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,136
|
java
|
/*
* Copyright 2021 Google 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.ads.googleads.v6.services.stub;
import com.google.ads.googleads.v6.services.ListInvoicesRequest;
import com.google.ads.googleads.v6.services.ListInvoicesResponse;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsExtractor;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.common.collect.ImmutableMap;
import com.google.longrunning.stub.GrpcOperationsStub;
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* gRPC stub implementation for the InvoiceService service API.
*
* <p>This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator-java")
public class GrpcInvoiceServiceStub extends InvoiceServiceStub {
private static final MethodDescriptor<ListInvoicesRequest, ListInvoicesResponse>
listInvoicesMethodDescriptor =
MethodDescriptor.<ListInvoicesRequest, ListInvoicesResponse>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.ads.googleads.v6.services.InvoiceService/ListInvoices")
.setRequestMarshaller(ProtoUtils.marshaller(ListInvoicesRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListInvoicesResponse.getDefaultInstance()))
.build();
private final UnaryCallable<ListInvoicesRequest, ListInvoicesResponse> listInvoicesCallable;
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
private final GrpcStubCallableFactory callableFactory;
public static final GrpcInvoiceServiceStub create(InvoiceServiceStubSettings settings)
throws IOException {
return new GrpcInvoiceServiceStub(settings, ClientContext.create(settings));
}
public static final GrpcInvoiceServiceStub create(ClientContext clientContext)
throws IOException {
return new GrpcInvoiceServiceStub(
InvoiceServiceStubSettings.newBuilder().build(), clientContext);
}
public static final GrpcInvoiceServiceStub create(
ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
return new GrpcInvoiceServiceStub(
InvoiceServiceStubSettings.newBuilder().build(), clientContext, callableFactory);
}
/**
* Constructs an instance of GrpcInvoiceServiceStub, using the given settings. This is protected
* so that it is easy to make a subclass, but otherwise, the static factory methods should be
* preferred.
*/
protected GrpcInvoiceServiceStub(InvoiceServiceStubSettings settings, ClientContext clientContext)
throws IOException {
this(settings, clientContext, new GrpcInvoiceServiceCallableFactory());
}
/**
* Constructs an instance of GrpcInvoiceServiceStub, using the given settings. This is protected
* so that it is easy to make a subclass, but otherwise, the static factory methods should be
* preferred.
*/
protected GrpcInvoiceServiceStub(
InvoiceServiceStubSettings settings,
ClientContext clientContext,
GrpcStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
GrpcCallSettings<ListInvoicesRequest, ListInvoicesResponse> listInvoicesTransportSettings =
GrpcCallSettings.<ListInvoicesRequest, ListInvoicesResponse>newBuilder()
.setMethodDescriptor(listInvoicesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListInvoicesRequest>() {
@Override
public Map<String, String> extract(ListInvoicesRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("customer_id", String.valueOf(request.getCustomerId()));
return params.build();
}
})
.build();
this.listInvoicesCallable =
callableFactory.createUnaryCallable(
listInvoicesTransportSettings, settings.listInvoicesSettings(), clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
public GrpcOperationsStub getOperationsStub() {
return operationsStub;
}
@Override
public UnaryCallable<ListInvoicesRequest, ListInvoicesResponse> listInvoicesCallable() {
return listInvoicesCallable;
}
@Override
public final void close() {
shutdown();
}
@Override
public void shutdown() {
backgroundResources.shutdown();
}
@Override
public boolean isShutdown() {
return backgroundResources.isShutdown();
}
@Override
public boolean isTerminated() {
return backgroundResources.isTerminated();
}
@Override
public void shutdownNow() {
backgroundResources.shutdownNow();
}
@Override
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
return backgroundResources.awaitTermination(duration, unit);
}
}
|
[
"bazel-bot-development[bot]@users.noreply.github.com"
] |
bazel-bot-development[bot]@users.noreply.github.com
|
019a48200b85035d2861270e166eea624ad5acc0
|
7d9147f42358d85df4f3b077c8eca7ae57b0816a
|
/src/com/nieyue/util/MyFileURL.java
|
07060a62bc75d0308ead977b7ca98e05302831c0
|
[] |
no_license
|
nieyue/DecisionTreeC45
|
dc30ffa490a6d16ebffe3421e14e689dd94fb811
|
cfa0e92c1a4c541757bf7d895798ee5a8dce362a
|
refs/heads/master
| 2020-03-18T01:54:06.553816
| 2018-06-08T16:18:10
| 2018-06-08T16:18:10
| 134,165,058
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 408
|
java
|
package com.nieyue.util;
public class MyFileURL {
public static String getFileName(String fileURL) throws Exception{
if(fileURL.contains("/")){
String[] str = fileURL.split("/");
if(str!=null&&!str.equals("")){
fileURL=str[str.length-1];
}
}
return fileURL;
}
public static void main(String[] args) throws Exception {
System.out.println(getFileName("dfsd/dfds//aaa/.jsp"));
}
}
|
[
"278076304@qq.com"
] |
278076304@qq.com
|
c29f0482d8c04d038045ea236453038347974bd4
|
5985089c3126cafed1124a5f5ff2518ef551818f
|
/bitcamp-java-basic/src/main/java/com/eomcs/io2/ex01/Exam0710.java
|
0690984cb3bd765149bcf4d5693c5729fc65fc7f
|
[] |
no_license
|
seonggwonlee/bitcamp-workspace
|
113d393ca5a898f2e8e824b095e31e331054cc26
|
ed756e09c694ae58ea6d9c32979a8a6921387b2e
|
refs/heads/master
| 2023-01-30T00:34:54.079084
| 2020-12-10T12:01:05
| 2020-12-10T12:01:05
| 281,343,071
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 942
|
java
|
package io2.ex01;
import java.io.File;
public class Exam0710 {
// 1) 현재 디렉토리의 파일 및 디렉토리 출력
// 2) 디렉토리 안의 목록을 출력하는 코드를 별도의 메서드로 분리
// 3) 하위 디렉토리 파일 및 디렉토리 목록 출력
// 4) 하위 디렉토리 내용을 출력할 때는 인덴트를 추가한다.
// 5) 인덴트 처리 부분을 별도의 메서드로 추출 (extract method)
public static void main(String[] args) {
File dir = new File(".");
listPrintFiles(dir, 0);
}
static void listPrintFiles(File dir, int level) {
File[] files = dir.listFiles();
for(File file : files) {
printIndent(level);
System.out.println(file.getName());
if (file.isDirectory()) {
listPrintFiles(file, level + 1);
}
}
}
static void printIndent(int level) {
for (int i = 0; i < level; i++) {
System.out.print(" ");
}
System.out.print("|-- ");
}
}
|
[
"sysktho@gmail.com"
] |
sysktho@gmail.com
|
5448d724c793a70c01f5c69b2e38b23669fbc979
|
8799ac7be9e0fe8a80ea2ae002beb7a68a1a4392
|
/Algorithm/BaekJoon Algorithm/BJ10828.java
|
1b8b48b04cf7ba74b737ef16f6337960d9e7aea5
|
[] |
no_license
|
jeon9825/TIP
|
c45f73db7e1f9dffc8edf5a4268f0d7ee14e6709
|
fc8067e4597189b1762453ed29ba91d000e03160
|
refs/heads/master
| 2021-08-18T10:00:26.373784
| 2021-08-05T13:52:42
| 2021-08-05T13:52:42
| 174,329,195
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,233
|
java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.StringTokenizer;
public class BJ10828 {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(reader.readLine());
Deque<Integer> stack = new ArrayDeque<>();
StringTokenizer tokenizer;
for (int i = 0; i < N; i++) {
tokenizer = new StringTokenizer(reader.readLine());
String command = tokenizer.nextToken();
if (command.equals("push")) {
int value = Integer.parseInt(tokenizer.nextToken());
stack.push(value);
} else if (command.equals("pop")) {
if (!stack.isEmpty())
System.out.println(stack.pop());
else
System.out.println(-1);
} else if (command.equals("size")) {
System.out.println(stack.size());
} else if (command.equals("empty")) {
if (stack.isEmpty())
System.out.println(1);
else
System.out.println(0);
} else if (command.equals("top"))
if (!stack.isEmpty())
System.out.println(stack.peek());
else
System.out.println(-1);
}
}
}
|
[
"jeon9825@naver.com"
] |
jeon9825@naver.com
|
1ee2b9fff73fa5bc44bd74293d2207f2ed05d625
|
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
|
/ant_cluster/10443/src_1.java
|
21903f655b9233bd6f70f9c07d01cc0d03de16ba
|
[] |
no_license
|
martinezmatias/GenPat-data-C3
|
63cfe27efee2946831139747e6c20cf952f1d6f6
|
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
|
refs/heads/master
| 2022-04-25T17:59:03.905613
| 2020-04-15T14:41:34
| 2020-04-15T14:41:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,392
|
java
|
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package org.apache.tools.ant.taskdefs;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Vector;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
/**
* Ant task to read input line from console.
*
* @author Ulrich Schmidt <usch@usch.net>
*/
public class Input extends Task
{
private String validargs = null;
private String message = "";
private String addproperty = null;
private String input = null;
/**
* No arg constructor.
*/
public Input()
{
}
/**
* Defines the name of a property to be created from input. Behaviour is
* according to property task which means that existing properties cannot be
* overriden.
*
* @param addproperty Name for the property to be created from input
*/
public void setAddproperty( String addproperty )
{
this.addproperty = addproperty;
}
/**
* Sets the Message which gets displayed to the user during the build run.
*
* @param message The message to be displayed.
*/
public void setMessage( String message )
{
this.message = message;
}
/**
* Sets surrogate input to allow automated testing.
*
* @param testinput The new Testinput value
*/
public void setTestinput( String testinput )
{
this.input = testinput;
}
/**
* Defines valid input parameters as comma separated String. If set, input
* task will reject any input not defined as accepted and requires the user
* to reenter it. Validargs are case sensitive. If you want 'a' and 'A' to
* be accepted you need to define both values as accepted arguments.
*
* @param validargs A comma separated String defining valid input args.
*/
public void setValidargs( String validargs )
{
this.validargs = validargs;
}
// copied n' pasted from org.apache.tools.ant.taskdefs.Exit
/**
* Set a multiline message.
*
* @param msg The feature to be added to the Text attribute
*/
public void addText( String msg )
{
message += project.replaceProperties( msg );
}
/**
* Actual test method executed by jakarta-ant.
*
* @exception TaskException
*/
public void execute()
throws TaskException
{
Vector accept = null;
if( validargs != null )
{
accept = new Vector();
StringTokenizer stok = new StringTokenizer( validargs, ",", false );
while( stok.hasMoreTokens() )
{
accept.addElement( stok.nextToken() );
}
}
log( message, Project.MSG_WARN );
if( input == null )
{
try
{
BufferedReader in = new BufferedReader( new InputStreamReader( System.in ) );
input = in.readLine();
if( accept != null )
{
while( !accept.contains( input ) )
{
log( message, Project.MSG_WARN );
input = in.readLine();
}
}
}
catch( IOException e )
{
throw new TaskException( "Failed to read input from Console.", e );
}
}
// not quite the original intention of this task but for the sake
// of testing ;-)
else
{
if( accept != null && ( !accept.contains( input ) ) )
{
throw new TaskException( "Invalid input please reenter." );
}
}
// adopted from org.apache.tools.ant.taskdefs.Property
if( addproperty != null )
{
if( project.getProperty( addproperty ) == null )
{
project.setProperty( addproperty, input );
}
else
{
log( "Override ignored for " + addproperty, Project.MSG_VERBOSE );
}
}
}
}
|
[
"375833274@qq.com"
] |
375833274@qq.com
|
f4264c8d32376f413b3510128728b105e4eb674b
|
b6e99b0346572b7def0e9cdd1b03990beb99e26f
|
/src/gcom/gerencial/bean/CobrancaAcaoSituacaoHelper.java
|
a780f1b14915f91a5ffca2b57e71a73407e47ab1
|
[] |
no_license
|
prodigasistemas/gsan
|
ad64782c7bc991329ce5f0bf5491c810e9487d6b
|
bfbf7ad298c3c9646bdf5d9c791e62d7366499c1
|
refs/heads/master
| 2023-08-31T10:47:21.784105
| 2023-08-23T17:53:24
| 2023-08-23T17:53:24
| 14,600,520
| 19
| 20
| null | 2015-07-29T19:39:10
| 2013-11-21T21:24:16
|
Java
|
UTF-8
|
Java
| false
| false
| 2,693
|
java
|
package gcom.gerencial.bean;
import java.math.BigDecimal;
import java.util.Collection;
public class CobrancaAcaoSituacaoHelper {
private Integer id;
private String descricao;
private Collection colecaoCobrancaAcaoDebito;
private Integer quantidadeDocumento;
private BigDecimal valorDoumento;
private BigDecimal porcentagemQuantidade;
private BigDecimal porcentagemValor;
public CobrancaAcaoSituacaoHelper(Integer id, String descricao,
Integer quantidadeDocumento, BigDecimal valorDoumento) {
this.id = id;
this.descricao = descricao;
this.quantidadeDocumento = quantidadeDocumento;
this.valorDoumento = valorDoumento;
}
/**
* @return Retorna o campo quantidadeDocumento.
*/
public Integer getQuantidadeDocumento() {
return quantidadeDocumento;
}
/**
* @param quantidadeDocumento
* O quantidadeDocumento a ser setado.
*/
public void setQuantidadeDocumento(Integer quantidadeDocumento) {
this.quantidadeDocumento = quantidadeDocumento;
}
/**
* @return Retorna o campo colecaoCobrancaAcaoDebito.
*/
public Collection getColecaoCobrancaAcaoDebito() {
return colecaoCobrancaAcaoDebito;
}
/**
* @param colecaoCobrancaAcaoDebito
* O colecaoCobrancaAcaoDebito a ser setado.
*/
public void setColecaoCobrancaAcaoDebito(
Collection colecaoCobrancaAcaoDebito) {
this.colecaoCobrancaAcaoDebito = colecaoCobrancaAcaoDebito;
}
/**
* @return Retorna o campo descricao.
*/
public String getDescricao() {
return descricao;
}
/**
* @param descricao
* O descricao a ser setado.
*/
public void setDescricao(String descricao) {
this.descricao = descricao;
}
/**
* @return Retorna o campo id.
*/
public Integer getId() {
return id;
}
/**
* @param id
* O id a ser setado.
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return Retorna o campo valorDoumento.
*/
public BigDecimal getValorDoumento() {
return valorDoumento;
}
/**
* @param valorDoumento
* O valorDoumento a ser setado.
*/
public void setValorDoumento(BigDecimal valorDoumento) {
this.valorDoumento = valorDoumento;
}
public BigDecimal getPorcentagemQuantidade() {
return porcentagemQuantidade;
}
public void setPorcentagemQuantidade(BigDecimal porcentagemQuantidade) {
this.porcentagemQuantidade = porcentagemQuantidade;
}
public BigDecimal getPorcentagemValor() {
return porcentagemValor;
}
public void setPorcentagemValor(BigDecimal porcentagemValor) {
this.porcentagemValor = porcentagemValor;
}
}
|
[
"piagodinho@gmail.com"
] |
piagodinho@gmail.com
|
d78d5db3dde1f8a6f35ff4fde390b0e85267987e
|
c337294844845f6d6b736d664f5a71efe720d65b
|
/site/src/site-ear/resources/generated/org/reverse/SnpArticulosAutores2Id.java
|
945201f7c93f7483290f2eafa85187ba94f64fca
|
[] |
no_license
|
MGDevelopment/site-jrun
|
25ad663b4a9d0b9b07cf0a3d4ef436594976ad5b
|
0547d837bbd1ed7328b4e8d775adf9defd622981
|
refs/heads/master
| 2020-06-05T02:28:11.102960
| 2013-09-10T13:12:27
| 2013-09-10T13:12:27
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,415
|
java
|
package org.reverse;
// Generated Oct 20, 2010 10:21:56 AM by Hibernate Tools 3.4.0.Beta1
import java.util.Date;
/**
* SnpArticulosAutores2Id generated by hbm2java
*/
public class SnpArticulosAutores2Id implements java.io.Serializable {
private long idArticulo;
private long idAutor;
private String usrAlta;
private Date FAlta;
private String usrModi;
private Date FModi;
private String idUsrAlta;
private String idUsrModi;
private byte orden;
private String role;
public SnpArticulosAutores2Id() {
}
public SnpArticulosAutores2Id(long idArticulo, long idAutor, String usrAlta, Date FAlta, byte orden, String role) {
this.idArticulo = idArticulo;
this.idAutor = idAutor;
this.usrAlta = usrAlta;
this.FAlta = FAlta;
this.orden = orden;
this.role = role;
}
public SnpArticulosAutores2Id(long idArticulo, long idAutor, String usrAlta, Date FAlta, String usrModi, Date FModi, String idUsrAlta, String idUsrModi, byte orden, String role) {
this.idArticulo = idArticulo;
this.idAutor = idAutor;
this.usrAlta = usrAlta;
this.FAlta = FAlta;
this.usrModi = usrModi;
this.FModi = FModi;
this.idUsrAlta = idUsrAlta;
this.idUsrModi = idUsrModi;
this.orden = orden;
this.role = role;
}
public long getIdArticulo() {
return this.idArticulo;
}
public void setIdArticulo(long idArticulo) {
this.idArticulo = idArticulo;
}
public long getIdAutor() {
return this.idAutor;
}
public void setIdAutor(long idAutor) {
this.idAutor = idAutor;
}
public String getUsrAlta() {
return this.usrAlta;
}
public void setUsrAlta(String usrAlta) {
this.usrAlta = usrAlta;
}
public Date getFAlta() {
return this.FAlta;
}
public void setFAlta(Date FAlta) {
this.FAlta = FAlta;
}
public String getUsrModi() {
return this.usrModi;
}
public void setUsrModi(String usrModi) {
this.usrModi = usrModi;
}
public Date getFModi() {
return this.FModi;
}
public void setFModi(Date FModi) {
this.FModi = FModi;
}
public String getIdUsrAlta() {
return this.idUsrAlta;
}
public void setIdUsrAlta(String idUsrAlta) {
this.idUsrAlta = idUsrAlta;
}
public String getIdUsrModi() {
return this.idUsrModi;
}
public void setIdUsrModi(String idUsrModi) {
this.idUsrModi = idUsrModi;
}
public byte getOrden() {
return this.orden;
}
public void setOrden(byte orden) {
this.orden = orden;
}
public String getRole() {
return this.role;
}
public void setRole(String role) {
this.role = role;
}
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof SnpArticulosAutores2Id) ) return false;
SnpArticulosAutores2Id castOther = ( SnpArticulosAutores2Id ) other;
return (this.getIdArticulo()==castOther.getIdArticulo())
&& (this.getIdAutor()==castOther.getIdAutor())
&& ( (this.getUsrAlta()==castOther.getUsrAlta()) || ( this.getUsrAlta()!=null && castOther.getUsrAlta()!=null && this.getUsrAlta().equals(castOther.getUsrAlta()) ) )
&& ( (this.getFAlta()==castOther.getFAlta()) || ( this.getFAlta()!=null && castOther.getFAlta()!=null && this.getFAlta().equals(castOther.getFAlta()) ) )
&& ( (this.getUsrModi()==castOther.getUsrModi()) || ( this.getUsrModi()!=null && castOther.getUsrModi()!=null && this.getUsrModi().equals(castOther.getUsrModi()) ) )
&& ( (this.getFModi()==castOther.getFModi()) || ( this.getFModi()!=null && castOther.getFModi()!=null && this.getFModi().equals(castOther.getFModi()) ) )
&& ( (this.getIdUsrAlta()==castOther.getIdUsrAlta()) || ( this.getIdUsrAlta()!=null && castOther.getIdUsrAlta()!=null && this.getIdUsrAlta().equals(castOther.getIdUsrAlta()) ) )
&& ( (this.getIdUsrModi()==castOther.getIdUsrModi()) || ( this.getIdUsrModi()!=null && castOther.getIdUsrModi()!=null && this.getIdUsrModi().equals(castOther.getIdUsrModi()) ) )
&& (this.getOrden()==castOther.getOrden())
&& ( (this.getRole()==castOther.getRole()) || ( this.getRole()!=null && castOther.getRole()!=null && this.getRole().equals(castOther.getRole()) ) );
}
public int hashCode() {
int result = 17;
result = 37 * result + (int) this.getIdArticulo();
result = 37 * result + (int) this.getIdAutor();
result = 37 * result + ( getUsrAlta() == null ? 0 : this.getUsrAlta().hashCode() );
result = 37 * result + ( getFAlta() == null ? 0 : this.getFAlta().hashCode() );
result = 37 * result + ( getUsrModi() == null ? 0 : this.getUsrModi().hashCode() );
result = 37 * result + ( getFModi() == null ? 0 : this.getFModi().hashCode() );
result = 37 * result + ( getIdUsrAlta() == null ? 0 : this.getIdUsrAlta().hashCode() );
result = 37 * result + ( getIdUsrModi() == null ? 0 : this.getIdUsrModi().hashCode() );
result = 37 * result + this.getOrden();
result = 37 * result + ( getRole() == null ? 0 : this.getRole().hashCode() );
return result;
}
}
|
[
"mgoldsman@gmail.com"
] |
mgoldsman@gmail.com
|
8e730e7ed6864d5faf9817031e08fe649aaa2eb2
|
e82c1473b49df5114f0332c14781d677f88f363f
|
/MBS/src/main/java/nta/mss/info/HospitalDto.java
|
b87d8c0cff9d8a3ea2e34b6a8c70d1103fa40b0b
|
[] |
no_license
|
zhiji6/mih
|
fa1d2279388976c901dc90762bc0b5c30a2325fc
|
2714d15853162a492db7ea8b953d5b863c3a8000
|
refs/heads/master
| 2023-08-16T18:35:19.836018
| 2017-12-28T09:33:19
| 2017-12-28T09:33:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,754
|
java
|
package nta.mss.info;
/**
*
* @author DEV-HuanLT
*
*/
public class HospitalDto {
private Integer hospitalId;
private String hospitalCode;
private String hospitalName;
private Integer hospitalParentId;
private String hospitalIconPath;
private String locale;
private String email;
private Byte timeZone;
private Byte isUseVaccine;
private Byte isUseMt;
public HospitalDto(Integer hospitalId, String hospitalCode, String hospitalName, Integer hospitalParentId,
String hospitalIconPath, String locale, String email, Byte timeZone, Byte isUseVaccine, Byte isUseMt) {
super();
this.hospitalId = hospitalId;
this.hospitalCode = hospitalCode;
this.hospitalName = hospitalName;
this.hospitalParentId = hospitalParentId;
this.hospitalIconPath = hospitalIconPath;
this.locale = locale;
this.email = email;
this.timeZone = timeZone;
this.isUseVaccine = isUseVaccine;
this.isUseMt = isUseMt;
}
public Integer getHospitalId() {
return hospitalId;
}
public void setHospitalId(Integer hospitalId) {
this.hospitalId = hospitalId;
}
public String getHospitalCode() {
return hospitalCode;
}
public void setHospitalCode(String hospitalCode) {
this.hospitalCode = hospitalCode;
}
public String getHospitalName() {
return hospitalName;
}
public void setHospitalName(String hospitalName) {
this.hospitalName = hospitalName;
}
public Integer getHospitalParentId() {
return hospitalParentId;
}
public void setHospitalParentId(Integer hospitalParentId) {
this.hospitalParentId = hospitalParentId;
}
public String getHospitalIconPath() {
return hospitalIconPath;
}
public void setHospitalIconPath(String hospitalIconPath) {
this.hospitalIconPath = hospitalIconPath;
}
public String getLocale() {
return locale;
}
public void setLocale(String locale) {
this.locale = locale;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Byte getTimeZone() {
return timeZone;
}
public void setTimeZone(Byte timeZone) {
this.timeZone = timeZone;
}
public Byte getIsUseVaccine() {
return isUseVaccine;
}
public void setIsUseVaccine(Byte isUseVaccine) {
this.isUseVaccine = isUseVaccine;
}
public Byte getIsUseMt() {
return isUseMt;
}
public void setIsUseMt(Byte isUseMt) {
this.isUseMt = isUseMt;
}
@Override
public String toString() {
return "HospitalDto [hospitalId=" + hospitalId + ", hospitalCode=" + hospitalCode + ", hospitalName="
+ hospitalName + ", hospitalParentId=" + hospitalParentId + ", hospitalIconPath=" + hospitalIconPath
+ ", locale=" + locale + ", email=" + email + ", timeZone=" + timeZone + ", isUseVaccine="
+ isUseVaccine + ", isUseMt=" + isUseMt + "]";
}
}
|
[
"duc_nt@nittsusystem-vn.com"
] |
duc_nt@nittsusystem-vn.com
|
9705b12ae6b133829396873b693c452fe44b18b6
|
8b44b268bf5493f8706ab71201dd8080e277f5fb
|
/javase/src/test/java/org/asuki/common/lock/AccumulatorSpaceship.java
|
a41a1c3c69fa4f85869399ee842c302562d0ac99
|
[] |
no_license
|
AsukiLiu/Java-Common
|
1e53c1fe55effced33ab72e4199d42ceee513244
|
b17f23e956e2e635f27d3b46dec9bc597779fd11
|
refs/heads/master
| 2020-04-06T07:01:49.516877
| 2016-09-03T16:05:48
| 2016-09-03T16:05:48
| 45,544,720
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 919
|
java
|
package org.asuki.common.lock;
import java.util.concurrent.atomic.LongAccumulator;
import com.google.common.base.Objects;
public class AccumulatorSpaceship implements Spaceship {
private final LongAccumulator x = new LongAccumulator((x, y) -> x + y, 0L);
private final LongAccumulator y = new LongAccumulator((x, y) -> x + y, 0L);
@Override
public int read(int[] coordinates) {
// coordinates[0] = x.intValue();
// coordinates[1] = y.intValue();
coordinates[0] = (int) x.get();
coordinates[1] = (int) y.get();
return 1;
}
@Override
public int write(int xDelta, int yDelta) {
x.accumulate(xDelta);
y.accumulate(yDelta);
return 1;
}
@Override
public String toString() {
return Objects.toStringHelper(this).add("x", this.x.intValue())
.add("y", this.y.intValue()).toString();
}
}
|
[
"andyhome.liu@gmail.com"
] |
andyhome.liu@gmail.com
|
e0277dfa5282935d162851c54f2a201d9ff89375
|
1cbf46c147b09a878235da8010f427eb2447bab5
|
/src/main/java/ljtao/book_study/effective_java/source_code/chapter4/item23/hierarchy/Square.java
|
6c3582fc8383e998af989884f47fb24ab59b43b4
|
[] |
no_license
|
mathLjtao/MyJavaStudy
|
54b90fbb0f285a611b73d72477a605d875563716
|
d9a934e95b2f24bf854a4c359dd04d3fb8acd0d9
|
refs/heads/master
| 2022-12-22T02:01:24.856371
| 2021-09-16T13:15:20
| 2021-09-16T13:15:20
| 188,509,645
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 239
|
java
|
package ljtao.book_study.effective_java.source_code.chapter4.item23.hierarchy;
// Class hierarchy replacement for a tagged class (Page 110-11)
class Square extends Rectangle {
Square(double side) {
super(side, side);
}
}
|
[
"43426976+mathLjtao@users.noreply.github.com"
] |
43426976+mathLjtao@users.noreply.github.com
|
8130fd96787ad30360110a217d4d1d152a1694f4
|
e631cde389a6331f6abfa80ee263f27aefab4985
|
/mars/venus/SettingsAssembleAllAction.java
|
d2ee65cc9d175aefb5282cdfd57a4af473f38ae6
|
[
"MIT"
] |
permissive
|
aeris170/Dark-Side-of-MARS
|
1433e9e07213f9d3e5c93df753688e77bfea6ea6
|
6214696faa4567990e4795a7f5251ae3b816aeac
|
refs/heads/master
| 2020-05-05T13:02:22.830338
| 2020-04-27T00:38:13
| 2020-04-27T00:38:13
| 180,056,418
| 4
| 0
|
MIT
| 2020-04-27T00:38:14
| 2019-04-08T02:42:21
|
Java
|
UTF-8
|
Java
| false
| false
| 2,127
|
java
|
package mars.venus;
import mars.simulator.*;
import mars.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
/*
Copyright (c) 2003-2006, Pete Sanderson and Kenneth Vollmar
Developed by Pete Sanderson (psanderson@otterbein.edu)
and Kenneth Vollmar (kenvollmar@missouristate.edu)
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.
(MIT license, http://www.opensource.org/licenses/mit-license.html)
*/
/**
* Action class for the Settings menu item to determine whether assemble operation applies
* only to current file or to all files in its directory.
*/
public class SettingsAssembleAllAction extends GuiAction {
public SettingsAssembleAllAction(String name, Icon icon, String descrip,
Integer mnemonic, KeyStroke accel, VenusUI gui) {
super(name, icon, descrip, mnemonic, accel, gui);
}
public void actionPerformed(ActionEvent e) {
Globals.getSettings().setAssembleAllEnabled(
((JCheckBoxMenuItem) e.getSource()).isSelected());
}
}
|
[
"aeris170@users.noreply.github.com"
] |
aeris170@users.noreply.github.com
|
4bc79ad59d9971c93805efaad234106eb758012a
|
2046f83c396714fa627c8d3618ea4efcb94467ed
|
/tests/burgers/ReceiptTest.java
|
0e676155de24d1f10ef4d2b4bf39db9c73224177
|
[] |
no_license
|
bwielk/BillsBurger
|
1ac18ff857dbefc48e7d8c08293c289d8d709e54
|
ad854a8ecdcf41674de790812657e9667517009c
|
refs/heads/master
| 2021-08-29T10:57:01.477519
| 2017-12-13T19:54:33
| 2017-12-13T19:54:33
| 112,102,336
| 0
| 0
| null | null | null | null |
WINDOWS-1252
|
Java
| false
| false
| 5,631
|
java
|
package burgers;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class ReceiptTest {
private Till till1;
private Burger burger1;
private Burger burger2;
private Burger burger3;
private FitBurger fitBurger1;
private FitBurger fitBurger2;
private DeluxeBurger deluxeBurger1;
private DeluxeBurger deluxeBurger2;
private Drink drink1;
private Drink drink2;
private Chips chips1;
private Chips chips2;
private FreeClassicBurgerVoucher voucher1;
private Receipt receipt;
@Before
public void before(){
receipt = new Receipt();
till1 = new Till();
burger1 = new Burger("Classic Burger", MeatType.BEEF, BreadType.WHOLEMEAL);//3.0
burger2 = new Burger("Beef brgr", MeatType.BEEF, BreadType.RYE);//4.6
burger3 = new Burger("Chick brgr", MeatType.CHICKEN, BreadType.WHEAT);//4.3
fitBurger1 = new FitBurger("Fit beef", MeatType.BEEF);//3.6
fitBurger2 = new FitBurger("Fit chicken", MeatType.CHICKEN);//3.8
deluxeBurger1 = new DeluxeBurger("Deluxe beef", MeatType.BEEF, BreadType.RYE);//3.5
deluxeBurger2 = new DeluxeBurger("Deluxe chicken", MeatType.CHICKEN, BreadType.WHEAT);//4
drink1 = new Drink("Coca Cola", 1.00, DrinkType.SOFT, DrinkSize.SMALL);
drink2 = new Drink("Coca Cola Zero", 1.50, DrinkType.SOFT, DrinkSize.MEDIUM);
chips1 = new Chips("French chips", ChipsSize.SMALL, 1.20);
chips2 = new Chips("American chips", ChipsSize.MEDIUM, 1.30);//1.95
till1.addAddition(burger2, Addition.HALOUMI);
till1.addAddition(burger2, Addition.CHEDDAR);
till1.addAddition(burger2, Addition.SALAD);
till1.addAddition(burger2, Addition.SALAD);
till1.addAddition(burger3, Addition.TOMATO);
till1.addAddition(burger3, Addition.MOZZARELLA);
till1.addAddition(burger3, Addition.MOZZARELLA);
till1.addAddition(fitBurger1, Addition.PEPPERS);
till1.addAddition(fitBurger1, Addition.TOMATO);
till1.addAddition(fitBurger2, Addition.MOZZARELLA);
till1.addAddition(fitBurger2, Addition.PICKLES);
till1.addDeluxeAddition(deluxeBurger1, drink1);
till1.addDeluxeAddition(deluxeBurger2, drink1);
till1.addDeluxeAddition(deluxeBurger2, chips1);
voucher1 = new FreeClassicBurgerVoucher();
}
@Test
public void transactionOnReceiptHasNOTBeenPaid(){
assertEquals(false, receipt.isPaid());
}
@Test
public void transactionHasBeenPaid(){
till1.newTransaction();
till1.addBurger(new Burger("Beef burger", MeatType.BEEF, BreadType.WHEAT));
till1.addBurger(new Burger("Pig burger", MeatType.PORK, BreadType.WHEAT));
till1.addProduct(new Drink("Pepsi", 1.00, DrinkType.SOFT, DrinkSize.SMALL));
Receipt newReceipt = till1.completeTransaction();
assertEquals(true, newReceipt.isPaid());
}
@Test
public void receiptHoldsTheTotal(){
till1.newTransaction();
till1.addBurger(burger1);//3
till1.addBurger(fitBurger1);//3.6
till1.addBurger(deluxeBurger2);//4
assertEquals("The total transaction is £ 10.60", till1.completeTransaction().getTotal());
assertEquals(true, till1.completeTransaction().isPaid());
}
@Test
public void receiptIsReleasedAfterVoucherTransactionA(){
till1.newTransaction();
till1.addBurger(deluxeBurger1);//3.5
till1.addBurger(deluxeBurger2);//4
till1.addBurger(burger1);//3
till1.addBurger(fitBurger2);//3.8
till1.addBurger(fitBurger1);//3.6
till1.addProduct(drink1);//1.00
till1.addProduct(drink2);//1.50
assertEquals("The total transaction is £ 17.40", till1.completeTransactionWithVoucher(voucher1).getTotal());
assertEquals(1, till1.getUsedVouchers());
assertEquals(17.40, till1.getIncome(), 0.1);
}
@Test
public void receiptIsReleasedAfterVoucherTransactionB(){
till1.newTransaction();
till1.addBurger(burger1);//3
till1.addBurger(burger1);//3
till1.addBurger(fitBurger2);//3.8
till1.addBurger(fitBurger1);//3.6
till1.addProduct(drink2);//1.50
till1.addProduct(drink2);//1.50
till1.addProduct(chips2);//1.95
till1.addProduct(chips2);//1.95
assertEquals("The total transaction is £ 17.30", till1.completeTransactionWithVoucher(voucher1).getTotal());
assertEquals(1, till1.getUsedVouchers());
assertEquals(17.30, till1.getIncome(), 0.1);
}
@Test
public void receiptIsReleasedAfterTransactionVersionB(){
till1.newTransaction();
till1.addBurger(burger1);//3
till1.addBurger(burger1);//3
till1.addBurger(fitBurger2);//3.8
till1.addBurger(fitBurger1);//3.6
till1.addProduct(drink2);//1.50
till1.addProduct(drink2);//1.50
till1.addProduct(chips2);//1.95
till1.addProduct(chips2);//1.95
assertEquals("The total transaction is £ 20.30", till1.completeTransaction().getTotal());
assertEquals(20.30, till1.getIncome(), 0.1);
}
@Test
public void receiptIsReleasedAfterVoucherTransactionC(){
till1.addBurger(burger1);//3
till1.addProduct(drink2);//1.50
till1.addProduct(drink2);//1.50
till1.addProduct(chips1);//1.56
till1.addProduct(chips2);//1.95
till1.addProduct(chips1);//1.56
till1.addBurger(burger1);//3
assertEquals("The total transaction is £ 11.07", till1.completeTransactionWithVoucher(voucher1).getTotal());
assertEquals(1, till1.getUsedVouchers());
}
@Test
public void receiptIsReleasedAfterVoucherTransactionD(){
till1.addBurger(burger1);//3
till1.addProduct(drink1);//1.00
till1.addProduct(drink2);//1.50
till1.addBurger(deluxeBurger2);//4
till1.addProduct(chips1);//1.56
till1.addProduct(chips2);//1.95
till1.addProduct(chips1);//1.56
till1.addBurger(deluxeBurger2);//4
till1.addBurger(burger1);//3
assertEquals("The total transaction is £ 18.57", till1.completeTransactionWithVoucher(voucher1).getTotal());
assertEquals(1, till1.getUsedVouchers());
}
}
|
[
"bwielk@gmail.com"
] |
bwielk@gmail.com
|
1c97ea17f83459a0815685802cf585ec36a2b042
|
52019a46c8f25534afa491a5f68bf5598e68510b
|
/plugins/html-viewer/src/main/java/org/nakedobjects/plugins/html/context/PersistentObjectMapping.java
|
f169eb36d9b226fb9393202b87ca31314319e0c9
|
[
"Apache-2.0"
] |
permissive
|
JavaQualitasCorpus/nakedobjects-4.0.0
|
e765b4980994be681e5562584ebcf41e8086c69a
|
37ee250d4c8da969eac76749420064ca4c918e8e
|
refs/heads/master
| 2023-08-29T13:48:01.268876
| 2020-06-02T18:07:23
| 2020-06-02T18:07:23
| 167,005,009
| 0
| 1
|
Apache-2.0
| 2022-06-10T22:44:43
| 2019-01-22T14:08:50
|
Java
|
UTF-8
|
Java
| false
| false
| 2,988
|
java
|
package org.nakedobjects.plugins.html.context;
import org.nakedobjects.metamodel.adapter.NakedObject;
import org.nakedobjects.metamodel.adapter.oid.Oid;
import org.nakedobjects.metamodel.adapter.version.Version;
import org.nakedobjects.metamodel.commons.debug.DebugString;
import org.nakedobjects.metamodel.commons.ensure.Assert;
import org.nakedobjects.metamodel.spec.NakedObjectSpecification;
import org.nakedobjects.runtime.context.NakedObjectsContext;
import org.nakedobjects.runtime.persistence.PersistenceSession;
import org.nakedobjects.runtime.persistence.adaptermanager.AdapterManager;
public class PersistentObjectMapping implements ObjectMapping {
private final Oid oid;
private final NakedObjectSpecification specification;
private Version version;
public PersistentObjectMapping(final NakedObject adapter) {
oid = adapter.getOid();
Assert.assertFalse("OID is for transient", oid.isTransient());
Assert.assertFalse("adapter is for transient", adapter.isTransient());
specification = adapter.getSpecification();
version = adapter.getVersion();
}
public void debug(final DebugString debug) {
debug.appendln(specification.getFullName());
if (version != null) {
debug.appendln(version.toString());
}
}
public Oid getOid() {
return oid;
}
public NakedObject getObject() {
return getPersistenceSession().loadObject(oid, specification);
}
@Override
public int hashCode() {
return oid.hashCode();
}
@Override
public boolean equals(final Object obj) {
if (obj.getClass() == PersistentObjectMapping.class) {
return ((PersistentObjectMapping) obj).oid.equals(oid);
}
return false;
}
@Override
public String toString() {
return (specification == null ? "null" : specification.getSingularName()) + " : " + oid + " : " + version;
}
public Version getVersion() {
return version;
}
public void checkVersion(final NakedObject object) {
object.checkLock(getVersion());
}
public void updateVersion() {
final NakedObject adapter = getAdapterManager().getAdapterFor(oid);
version = adapter.getVersion();
}
public void restoreToLoader() {
final Oid oid = getOid();
final NakedObject adapter = getPersistenceSession().recreateAdapter(oid, specification);
adapter.setOptimisticLock(getVersion());
}
///////////////////////////////////////////////////////
// Dependencies (from context)
///////////////////////////////////////////////////////
private static AdapterManager getAdapterManager() {
return getPersistenceSession().getAdapterManager();
}
private static PersistenceSession getPersistenceSession() {
return NakedObjectsContext.getPersistenceSession();
}
}
// Copyright (c) Naked Objects Group Ltd.
|
[
"taibi@sonar-scheduler.rd.tut.fi"
] |
taibi@sonar-scheduler.rd.tut.fi
|
9ca384b7a6c0a5640f3431833754d74b9a88e45a
|
2ee9a8936f889bade976b475d5ed257f49f8a32f
|
/core/src/main/java/com/huawei/openstack4j/model/workflow/ActionExecution.java
|
8495cc16cefecbcd8132d99871737872c4058b78
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
huaweicloud/huaweicloud-sdk-java
|
f44532a5e6eae867e9620923a9467ed431d13611
|
c1372d4be2d86382dfd20ccc084ae66c5ca4a4ce
|
refs/heads/master
| 2023-09-01T06:10:00.487173
| 2022-09-01T01:50:12
| 2022-09-01T01:50:12
| 148,595,939
| 49
| 45
|
NOASSERTION
| 2023-07-18T02:12:39
| 2018-09-13T07:01:08
|
Java
|
UTF-8
|
Java
| false
| false
| 3,649
|
java
|
/*******************************************************************************
* Copyright 2016 ContainX and OpenStack4j
*
* 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.
*******************************************************************************/
/*******************************************************************************
* Huawei has modified this source file.
* Copyright 2018 Huawei Technologies Co.,Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
* *******************************************************************************/
/*
*
*/
package com.huawei.openstack4j.model.workflow;
import java.util.List;
import java.util.Map;
import com.huawei.openstack4j.common.Buildable;
import com.huawei.openstack4j.model.workflow.builder.ActionExecutionBuilder;
/**
* An action execution.
*
* @author Renat Akhmerov
*/
public interface ActionExecution extends Execution, Buildable<ActionExecutionBuilder> {
/**
* @return The name of the corresponding task.
*/
String getTaskName();
/**
* @return The id of the corresponding task execution.
*/
String getTaskExecutionId();
/**
* @return The name of the action.
*/
String getName();
/**
* @return {@code True} if the result of this action execution is accepted.
*/
Boolean isAccepted();
/**
* @return The input parameters of this action execution.
*/
Map<String, ?> getInput();
/**
* @return The output of this action execution.
*/
Map<String, ?> getOutput();
}
|
[
"289228042@qq.com"
] |
289228042@qq.com
|
a258b2ee767d89cefc7fdeab418643d10f575689
|
10c05d8a5676b37b3a703c5839a31d80a759077f
|
/src/main/java/zadanie_5/MovablePoint.java
|
17c67f99c4cea3e5299eeb1d8428d2ad7a6df491
|
[] |
no_license
|
JAVApoz29/JavaZaawansowana
|
900e5510d2da3becebdc4c1e9de603e588647490
|
8e36f3cecf540a3323aa067baf29663889480892
|
refs/heads/main
| 2023-02-25T13:04:46.802780
| 2021-02-06T14:56:09
| 2021-02-06T14:56:09
| 334,359,793
| 0
| 5
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 578
|
java
|
package zadanie_5;
public class MovablePoint implements Movable {
int x;
int y;
int xSpeed;
int ySpeed;
public MovablePoint(int x, int y, int xSpeed, int ySpeed) {
this.x = x;
this.y = y;
this.xSpeed = xSpeed;
this.ySpeed = ySpeed;
}
@Override
public void moveUp() {
y += ySpeed;
}
@Override
public void moveDown() {
y -= ySpeed;
}
@Override
public void moveLeft() {
x -= xSpeed;
}
@Override
public void moveRight() {
x += xSpeed;
}
}
|
[
"marcin.szupke.sda@gmail.com"
] |
marcin.szupke.sda@gmail.com
|
a12300368e093ee1881fdc4955b65f6687bfcd96
|
4b5b8d0f6818f5cc145135b14f37ca444dc2436a
|
/modules/web/src/com/haulmont/sampler/web/ui/charts/charts/incrementalupdate/xy/UpdateXyChartSample.java
|
d9ff727b8a916f7e088b54dba94ba04f9290cde7
|
[
"Apache-2.0"
] |
permissive
|
phoenix110/sampler
|
021331474c05bae02649c248705fe33794de0893
|
45c31b4e6bfff31ee04dd5f01248bece2cfe89f0
|
refs/heads/master
| 2020-06-12T04:27:15.351095
| 2019-06-20T12:24:41
| 2019-06-20T12:24:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,305
|
java
|
package com.haulmont.sampler.web.ui.charts.charts.incrementalupdate.xy;
import com.haulmont.cuba.core.global.Metadata;
import com.haulmont.cuba.gui.UiComponents;
import com.haulmont.cuba.gui.components.Button;
import com.haulmont.cuba.gui.components.Label;
import com.haulmont.cuba.gui.components.Timer;
import com.haulmont.cuba.gui.model.CollectionContainer;
import com.haulmont.cuba.gui.screen.*;
import com.haulmont.sampler.entity.PointValue;
import org.apache.commons.lang3.RandomUtils;
import javax.inject.Inject;
import java.util.List;
@UiController("update-xy-chart")
@UiDescriptor("update-xy-chart.xml")
@LoadDataBeforeShow
public class UpdateXyChartSample extends ScreenFragment {
@Inject
private CollectionContainer<PointValue> pointsDc;
@Inject
private Metadata metadata;
@Inject
private Label<String> statusLabel;
@Inject
private UiComponents uiComponents;
private Timer timer;
@Subscribe
protected void onInit(InitEvent event) {
timer = uiComponents.create(Timer.NAME);
timer.setDelay(5000);
timer.setRepeating(true);
getHostScreen().getWindow().addTimer(timer);
timer.addTimerActionListener(timerActionEvent -> {
addDate();
removeDate();
});
timer.start();
}
@Subscribe("startTimer")
protected void onStartTimerClick(Button.ClickEvent event) {
timer.start();
statusLabel.setValue("Update enabled");
}
@Subscribe("stopTimer")
protected void onStopTimerClick(Button.ClickEvent event) {
timer.stop();
statusLabel.setValue("Update disabled");
}
private void addDate() {
pointsDc.getMutableItems().add(generatePointValue());
}
private void removeDate() {
List<PointValue> items = pointsDc.getMutableItems();
if (!items.isEmpty()) {
items.remove(0);
}
}
private PointValue generatePointValue() {
PointValue pointValue = metadata.create(PointValue.class);
pointValue.setX((RandomUtils.nextInt(0, 20) - 5) * RandomUtils.nextDouble(0, 1));
pointValue.setY((RandomUtils.nextInt(0, 40) - 20) * RandomUtils.nextDouble(0, 1));
pointValue.setValue(RandomUtils.nextInt(10, 100));
return pointValue;
}
}
|
[
"glebfox@gmail.com"
] |
glebfox@gmail.com
|
78f22321244fd436b5a2b8c7abfc5d3bdb3fce4e
|
187b211464d5a30a6865fcc4a00986ec02243d49
|
/luckwine-synthesize/luckwine-synthesize-api/src/main/java/com/luckwine/synthesize/model/base/SmsLog.java
|
ca041ad1bb4bcbae21e5582a04b892e1c219564b
|
[] |
no_license
|
guangtong-information/luckwine-mall
|
3b7fa3d809d9b1e9575e2643ea6915aedcb781e8
|
a564126d8a9b63e6650f72590f63af834822bf2e
|
refs/heads/master
| 2022-06-27T07:12:17.243240
| 2020-09-04T09:35:54
| 2020-09-04T09:35:54
| 171,574,799
| 10
| 10
| null | 2022-06-21T00:56:34
| 2019-02-20T00:53:24
|
TSQL
|
UTF-8
|
Java
| false
| false
| 754
|
java
|
package com.luckwine.synthesize.model.base;
import com.luckwine.parent.entitybase.request.BaseRequest;
import lombok.Data;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
@Data
@Table(name = "sms_log")
public class SmsLog extends BaseRequest{
@Id
private String id;
//短信模板id
private String smsCode;
//手机号(用户登录号)
private String mobile;
//短信模板内容
private String content;
//短信供应商-返回响应码
private String resultCode;
//短信供应商-返回响应描述
private String resultMsg;
//创建时间
private Date createTime;
//更新时间
private Date updateTime;
}
|
[
"th15817161961@gmail.com"
] |
th15817161961@gmail.com
|
040166d7324e55a4b41f20a351843027400d685b
|
4fd380b338cab14efa9508f54c443cefb1e5e5ff
|
/spf4j-core/src/main/java/org/spf4j/ssdump2/avro/package-info.java
|
499ef18ff57efe982d062284ac9b65c59a57d421
|
[] |
no_license
|
josecarloscanova/spf4j
|
73f576ec990844c52194bf0f14104a8c96396ffb
|
f9113225ef8ce58ea7fa3e88deae3bebaf223b38
|
refs/heads/master
| 2020-12-03T03:51:48.970722
| 2017-06-23T16:09:41
| 2017-06-23T16:09:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 883
|
java
|
/*
* Copyright (c) 2001, Zoltan Farkas All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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.
*/
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings
package org.spf4j.ssdump2.avro;
|
[
"zolyfarkas@yahoo.com"
] |
zolyfarkas@yahoo.com
|
06f6b0ba689d77343535a07594bec49efb9a09f5
|
2615da6bb099dcf3490e8c545f05d6765e10cccf
|
/cascading-hadoop/src/main/shared-io/cascading/tap/hadoop/io/MultiRecordReaderIterator.java
|
9480fee91e110165c3e3ec372ffbec042439214e
|
[
"Apache-2.0"
] |
permissive
|
Cascading/cascading
|
d10f5140b6b9be0c3dba7d9868573b30723b4476
|
2b7346e43b5e5fef6dd88e07e90ac056386c51f0
|
refs/heads/3.3
| 2020-04-05T07:19:23.212618
| 2018-03-23T04:24:05
| 2018-03-23T14:46:12
| 227,086
| 182
| 57
|
NOASSERTION
| 2018-12-03T03:31:28
| 2009-06-14T20:31:37
|
Java
|
UTF-8
|
Java
| false
| false
| 5,448
|
java
|
/*
* Copyright (c) 2007-2017 Xplenty, Inc. All Rights Reserved.
*
* Project and contact information: http://www.cascading.org/
*
* This file is part of the Cascading project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cascading.tap.hadoop.io;
import java.io.IOException;
import cascading.flow.FlowProcess;
import cascading.flow.hadoop.MapRed;
import cascading.flow.hadoop.util.HadoopUtil;
import cascading.tap.Tap;
import cascading.tap.TapException;
import cascading.tuple.Tuple;
import cascading.util.CloseableIterator;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.mapred.InputFormat;
import org.apache.hadoop.mapred.InputSplit;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.JobConfigurable;
import org.apache.hadoop.mapred.RecordReader;
import org.apache.hadoop.mapred.Reporter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static cascading.flow.hadoop.util.HadoopUtil.asJobConfInstance;
/**
* Class TapIterator is an implementation of {@link cascading.util.CloseableIterator}. It is returned by {@link cascading.tap.Tap} instances when
* opening the taps resource for reading.
*/
public class MultiRecordReaderIterator implements CloseableIterator<RecordReader>
{
/** Field LOG */
private static final Logger LOG = LoggerFactory.getLogger( MultiRecordReaderIterator.class );
private final FlowProcess<? extends Configuration> flowProcess;
/** Field tap */
private final Tap tap;
/** Field inputFormat */
private InputFormat inputFormat;
/** Field conf */
private Configuration conf;
/** Field splits */
private InputSplit[] splits;
/** Field reader */
private RecordReader reader;
/** Field lastReader */
private RecordReader lastReader;
/** Field currentSplit */
private int currentSplit = 0;
/** Field complete */
private boolean complete = false;
/**
* Constructor TapIterator creates a new TapIterator instance.
*
* @throws IOException when
*/
public MultiRecordReaderIterator( FlowProcess<? extends Configuration> flowProcess, Tap tap ) throws IOException
{
this.flowProcess = flowProcess;
this.tap = tap;
this.conf = flowProcess.getConfigCopy();
initialize();
}
private void initialize() throws IOException
{
// prevent collisions of configuration properties set client side if now cluster side
String property = flowProcess.getStringProperty( "cascading.node.accumulated.source.conf." + Tap.id( tap ) );
if( property == null )
{
// default behavior is to accumulate paths, so remove any set prior
conf = HadoopUtil.removePropertiesFrom( conf, "mapred.input.dir", "mapreduce.input.fileinputformat.inputdir" ); // hadoop2
tap.sourceConfInit( flowProcess, conf );
}
JobConf jobConf = asJobConfInstance( conf );
inputFormat = jobConf.getInputFormat();
if( inputFormat instanceof JobConfigurable )
( (JobConfigurable) inputFormat ).configure( jobConf );
// do not test for existence, let hadoop decide how to handle the given path
// this delegates globbing to the inputformat on split generation.
splits = inputFormat.getSplits( jobConf, 1 );
if( splits.length == 0 )
complete = true;
}
private RecordReader makeReader( int currentSplit ) throws IOException
{
LOG.debug( "reading split: {}", currentSplit );
Reporter reporter = Reporter.NULL;
if( flowProcess instanceof MapRed )
reporter = ( (MapRed) flowProcess ).getReporter(); // may return Reporter.NULL
return inputFormat.getRecordReader( splits[ currentSplit ], asJobConfInstance( conf ), reporter );
}
/**
* Method hasNext returns true if there more {@link Tuple} instances available.
*
* @return boolean
*/
public boolean hasNext()
{
getNextReader();
return !complete;
}
/**
* Method next returns the next {@link Tuple}.
*
* @return Tuple
*/
public RecordReader next()
{
if( complete )
throw new IllegalStateException( "no more values" );
try
{
getNextReader();
return reader;
}
finally
{
reader = null;
}
}
private void getNextReader()
{
if( complete || reader != null )
return;
try
{
if( currentSplit < splits.length )
{
if( lastReader != null )
lastReader.close();
reader = makeReader( currentSplit++ );
lastReader = reader;
}
else
{
complete = true;
}
}
catch( IOException exception )
{
throw new TapException( "could not get next tuple", exception );
}
}
public void remove()
{
throw new UnsupportedOperationException( "unimplemented" );
}
@Override
public void close() throws IOException
{
if( lastReader != null )
lastReader.close();
}
}
|
[
"chris@wensel.net"
] |
chris@wensel.net
|
c89663ddf7af4a93567c11b8990cfe7b5dbf46b5
|
1c3efc6e953032c4a72db38fbda8d3a046f6a39c
|
/spring-ioc/src/main/java/bitcamp/java106/step06/CarFactory.java
|
81aacb8d4fa361d2e1323bdc702ce1b5e3afa5ad
|
[] |
no_license
|
Roktar/Bitcamp
|
0ec49a91b45e686f6fb22be5523b5fa4b1799071
|
c297eeff409bce686c3e404f36a36bcaab0cd7d0
|
refs/heads/master
| 2021-03-27T11:13:15.320024
| 2018-08-10T07:35:34
| 2018-08-10T07:35:34
| 122,951,923
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 862
|
java
|
package bitcamp.java106.step06;
public class CarFactory {
public static Car create(String model) {
Car c = new Car();
switch(model) {
case "티코" :
c.setMaker("대우자동차");
c.setModel("Tico");
c.setCc(890);
return c;
case "소나타" :
c.setMaker("현대자동차");
c.setModel("Sonata");
c.setCc(1980);
return c;
case "SM5" :
c.setMaker("르노삼성자동차");
c.setModel("SM5");
c.setCc(1990);
return c;
default :
c.setMaker("비트자동차");
c.setModel("자바휘웅");
c.setCc(5000);
return c;
}
}
}
|
[
"outofsight_@naver.com"
] |
outofsight_@naver.com
|
b9c6ffe6a8690d68732f6861af1e7c7dcb28a1eb
|
44d8aa309f709422f32d4815490a3eec05544489
|
/build/src/main/java/com/mypurecloud/sdk/v2/model/ContentQuickReplyV2.java
|
08bbdf22b95ec5c24d7fa9e33d24d987aca6794c
|
[
"MIT"
] |
permissive
|
MyPureCloud/platform-client-sdk-java
|
a25146f15a0ef96f5c0c4655af3dc8aa77e48843
|
250d47418a9642fce5c7d6697f87d978ec39a257
|
refs/heads/master
| 2023-08-17T01:42:17.287918
| 2023-08-15T07:03:28
| 2023-08-15T07:03:28
| 86,601,855
| 7
| 14
|
MIT
| 2023-02-27T14:26:49
| 2017-03-29T15:56:50
|
HTML
|
UTF-8
|
Java
| false
| false
| 3,042
|
java
|
package com.mypurecloud.sdk.v2.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.util.Objects;
import java.util.ArrayList;
import java.io.IOException;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mypurecloud.sdk.v2.model.ContentQuickReply;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;
/**
* Quick reply object V2.
*/
@ApiModel(description = "Quick reply object V2.")
public class ContentQuickReplyV2 implements Serializable {
private String title = null;
private List<ContentQuickReply> actions = new ArrayList<ContentQuickReply>();
/**
* Text to show as the title of the quick reply.
**/
public ContentQuickReplyV2 title(String title) {
this.title = title;
return this;
}
@ApiModelProperty(example = "null", required = true, value = "Text to show as the title of the quick reply.")
@JsonProperty("title")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
/**
* An array of quick reply objects.
**/
public ContentQuickReplyV2 actions(List<ContentQuickReply> actions) {
this.actions = actions;
return this;
}
@ApiModelProperty(example = "null", required = true, value = "An array of quick reply objects.")
@JsonProperty("actions")
public List<ContentQuickReply> getActions() {
return actions;
}
public void setActions(List<ContentQuickReply> actions) {
this.actions = actions;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContentQuickReplyV2 contentQuickReplyV2 = (ContentQuickReplyV2) o;
return Objects.equals(this.title, contentQuickReplyV2.title) &&
Objects.equals(this.actions, contentQuickReplyV2.actions);
}
@Override
public int hashCode() {
return Objects.hash(title, actions);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ContentQuickReplyV2 {\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" actions: ").append(toIndentedString(actions)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"purecloud-jenkins@ininica.com"
] |
purecloud-jenkins@ininica.com
|
8111b293c3aab238764d4e328ba757e5c60e0fbf
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/15/15_b26a9833812533b8d6e5e5236c235ee1a7737075/DemoLcd/15_b26a9833812533b8d6e5e5236c235ee1a7737075_DemoLcd_t.java
|
d38f3c64dd97b0e5173face190e88c5eb350c333
|
[] |
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
| 7,643
|
java
|
/*
* Copyright (c) 2013 by Gerrit Grunwald
*
* 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 eu.hansolo.enzo.lcd;
import eu.hansolo.enzo.common.ValueEvent;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import java.util.Random;
public class DemoLcd extends Application {
private static final Random RND = new Random();
private static int noOfNodes = 0;
private static final String[] STYLE_CLASSES = {
"lcd-beige",
"lcd-blue",
"lcd-orange",
"lcd-red",
"lcd-yellow",
"lcd-white",
"lcd-gray",
"lcd-black",
"lcd-green",
"lcd-green-darkgreen",
"lcd-blue2",
"lcd-blue-black",
"lcd-blue-darkblue",
"lcd-blue-lightblue",
"lcd-blue-gray",
"lcd-standard",
"lcd-lightgreen",
"lcd-standard-green",
"lcd-blue-blue",
"lcd-red-darkred",
"lcd-darkblue",
"lcd-purple",
"lcd-black-red",
"lcd-darkgreen",
"lcd-amber",
"lcd-lightblue",
"lcd-green-black",
"lcd-yellow-black",
"lcd-black-yellow",
"lcd-lightgreen-black",
"lcd-darkpurple",
"lcd-darkamber",
"lcd-blue-lightblue2",
"lcd-gray-purple",
"lcd-sections",
"lcd-flat-turqoise",
"lcd-flat-gree-sea",
"lcd-flat-emerland",
"lcd-flat-nephritis",
"lcd-flat-peter-river",
"lcd-flat-belize-hole",
"lcd-flat-amethyst",
"lcd-flat-wisteria",
"lcd-flat-sunflower",
"lcd-flat-orange",
"lcd-flat-carrot",
"lcd-flat-pumpkin",
"lcd-flat-alizarin",
"lcd-flat-pomegranate",
"lcd-flat-clouds",
"lcd-flat-silver",
"lcd-flat-concrete",
"lcd-flat-asbestos",
"lcd-flat-wet-asphalt",
"lcd-flat-midnight-blue"
};
private Lcd control;
private long lastTimerCall;
private double charge;
private int styleClassCounter;
private AnimationTimer timer;
@Override public void init() {
control = LcdBuilder.create()
.prefWidth(1280)
.prefHeight(400)
//.styleClass(Lcd.STYLE_CLASS_GREEN_DARKGREEN)
.foregroundShadowVisible(true)
.crystalOverlayVisible(true)
.title("Room Temp")
.batteryVisible(true)
.signalVisible(true)
.alarmVisible(true)
.unit("°C")
.unitVisible(true)
.decimals(2)
.animationDurationInMs(1500)
.minMeasuredValueDecimals(2)
.minMeasuredValueVisible(true)
.maxMeasuredValueDecimals(2)
.maxMeasuredValueVisible(true)
.formerValueVisible(true)
.threshold(26)
.thresholdVisible(true)
.trendVisible(true)
.numberSystemVisible(false)
.lowerRightTextVisible(true)
.lowerRightText("Info")
//.valueFont(Lcd.LcdFont.BUS)
.valueFont(Lcd.LcdFont.LCD)
.animated(true)
.build();
control.addEventHandler(ValueEvent.VALUE_EXCEEDED, new EventHandler<ValueEvent>() {
@Override public void handle(ValueEvent valueEvent) {
System.out.println("exceeded");
}
});
charge = 0.0;
styleClassCounter = 0;
lastTimerCall = System.nanoTime();
timer = new AnimationTimer() {
@Override public void handle(long now) {
if (now > lastTimerCall + 5_000_000_000l) {
styleClassCounter ++;
if (styleClassCounter >= STYLE_CLASSES.length) {
styleClassCounter = 0;
control.setMainInnerShadowVisible(true);
control.setForegroundShadowVisible(true);
control.setCrystalOverlayVisible(true);
}
control.getStyleClass().setAll("lcd", STYLE_CLASSES[styleClassCounter]);
System.out.println(control.getStyleClass());
control.setValue(RND.nextDouble() * 100);
control.setTrend(Lcd.Trend.values()[RND.nextInt(5)]);
charge += 0.02;
if (charge > 1.0) charge = 0.0;
control.setBatteryCharge(charge);
control.setSignalStrength(charge);
if (styleClassCounter > 34) {
control.setMainInnerShadowVisible(false);
control.setForegroundShadowVisible(false);
control.setCrystalOverlayVisible(false);
}
lastTimerCall = now;
}
}
};
}
@Override public void start(Stage stage) {
StackPane pane = new StackPane();
pane.setPadding(new Insets(10, 10, 10, 10));
pane.getChildren().setAll(control);
Scene scene = new Scene(pane, Color.TRANSPARENT);
stage.setTitle("Lcd demo");
stage.centerOnScreen();
//stage.initStyle(StageStyle.UNDECORATED);
stage.setScene(scene);
stage.show();
timer.start();
calcNoOfNodes(scene.getRoot());
System.out.println(noOfNodes + " Nodes in SceneGraph");
}
public static void main(String[] args) {
launch(args);
}
// ******************** Misc **********************************************
private static void calcNoOfNodes(Node node) {
if (node instanceof Parent) {
if (((Parent) node).getChildrenUnmodifiable().size() != 0) {
ObservableList<Node> tempChildren = ((Parent) node).getChildrenUnmodifiable();
noOfNodes += tempChildren.size();
for (Node n : tempChildren) {
calcNoOfNodes(n);
//System.out.println(n.getStyleClass().toString());
}
}
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
7678d7033611bd05a8c7be9dbf74e64f45500ed7
|
13798c6d1b3d25829b24129c3d2e33ff12ab7428
|
/movie-database-tutorial/movie-database-client/src/com/codename1/demos/moviedb/MovieImpl.java
|
0f59510a5073bc9012e2d12becd434c1824bd5ea
|
[] |
no_license
|
shannah/CN1RPC-demos
|
5cc69f4ee3cf65d66554fad2a5b428e90f653316
|
5ba93d555ceee8a31327561c15a2d7e82460c59f
|
refs/heads/master
| 2016-09-05T21:35:56.567033
| 2015-07-11T22:18:02
| 2015-07-11T22:18:02
| 38,891,645
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,524
|
java
|
// DO NOT MODIFY THIS FILE. IT HAS BEEN AUTOMATICALLY GENERATED
// CHANGES MAY BE OVERWRITTEN WITHOUT NOTICE
package com.codename1.demos.moviedb;
import com.codename1.io.Externalizable;
import com.codename1.io.Util;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
public class MovieImpl extends Movie implements Externalizable, ExternalizableFactory.Versioned {
int __version = 1;
public void setVersion(int version) {
__version=version;
}
@Override
public String getObjectId() {
return "com.codename1.demos.moviedb.Movie";
}
@Override
public int getVersion() {
return __version;
}
@Override
public void externalize(DataOutputStream out) throws IOException {
if (__version == 1) {
out.writeInt(this.id);
Util.writeUTF(this.name, out);
out.writeInt(this.year);
Util.writeUTF(this.synopsis, out);
}
else {
throw new RuntimeException("Unsupported write version for entity "+getObjectId()+" version "+__version+"");
}
}
@Override
public void internalize(int version, DataInputStream in) throws IOException {
if (version == 1) {
__version = version;
this.id = in.readInt();
this.name = Util.readUTF(in);
this.year = in.readInt();
this.synopsis = Util.readUTF(in);
}
else {
throw new RuntimeException("Unsupported read version for entity "+getObjectId()+" version "+version+"");
}
}
}
|
[
"steve@weblite.ca"
] |
steve@weblite.ca
|
0b38115efee96177eb7588c0cd6d2c22414db961
|
ef066660938a8817606a1b0ccc6ea9365ffdcf30
|
/fault-localization-toolset/src/main/java/se/de/hu_berlin/informatik/faultlocalizer/sbfl/localizers/M2.java
|
f2990ebaf9bed1795000a36f4c469d30f28d2d2a
|
[] |
no_license
|
yerlikaya61/BugLoRD
|
eca1e005c9a0b7cb7151db2515d6354255637bb2
|
ed8ea25da7a57baaf9dd537ca43a9122773373f1
|
refs/heads/master
| 2020-05-02T14:19:56.152268
| 2019-03-28T10:32:53
| 2019-03-28T10:32:53
| 178,007,289
| 0
| 0
| null | 2019-03-27T14:07:24
| 2019-03-27T14:07:24
| null |
UTF-8
|
Java
| false
| false
| 1,229
|
java
|
/*
* This file is part of the "STARDUST" project.
*
* (c) Fabian Keller <hello@fabian-keller.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
package se.de.hu_berlin.informatik.faultlocalizer.sbfl.localizers;
import se.de.hu_berlin.informatik.faultlocalizer.sbfl.AbstractSpectrumBasedFaultLocalizer;
import se.de.hu_berlin.informatik.spectra.core.ComputationStrategies;
import se.de.hu_berlin.informatik.spectra.core.INode;
/**
* M2 fault localizer $\frac{\EF}{\EF+\NP+2(\NF+\EP)}$
*
* @param <T>
* type used to identify nodes in the system
*/
public class M2<T> extends AbstractSpectrumBasedFaultLocalizer<T> {
/**
* Create fault localizer
*/
public M2() {
super();
}
@Override
public double suspiciousness(final INode<T> node, ComputationStrategies strategy) {
if (node.getEF(strategy) == 0) {
return 0;
}
return (double)node.getEF(strategy)
/ (double)(node.getEF(strategy) + node.getNP(strategy) + 2.0d * (node.getNF(strategy) + node.getEP(strategy)));
}
@Override
public String getName() {
return "M2";
}
}
|
[
"heiden@informatik.hu-berlin.de"
] |
heiden@informatik.hu-berlin.de
|
a63e25eefc0b7ec9fd933612ca70ee90a4be4b46
|
1428d670a3897ce159111b2e777fad0ca13a03e4
|
/src/com/askj/animal/dto/AnimaldeathDTO.java
|
cefb9e9ab6cef1fc50404a3f54dfc17607aa09dc
|
[] |
no_license
|
wangxiaoyu92/zhsyj_V_2_0
|
5684d0f4e7ed41e340456b9bfdae92057d5d15ec
|
9ec18cd35b637b3c93f843e1a7f3b23e31079a71
|
refs/heads/master
| 2022-06-06T05:43:51.654005
| 2020-04-29T08:33:52
| 2020-04-29T08:33:52
| 259,864,851
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,051
|
java
|
package com.askj.animal.dto;
/**
*
* AnimaldeathDTO:动物死亡信息
*
* AnimaldeathDTO的描述:
*
* @author : zk
* @version : V1.0
*/
public class AnimaldeathDTO {
//动物死亡信息id
private String animaldeathid;
//动物信息id
private String animalinfoid;
//死亡时间
private String deathdate;
//死亡体重
private String deathweight;
//死亡原因(对应aa10表deathreason)
private String deathreason;
//处理方法(对应aa10表treatmentmode)
private String treatmentmode;
//症状及用药描述
private String symptom;
//动物编号
private String animalinfono;
public String getAnimaldeathid() {
return animaldeathid;
}
public void setAnimaldeathid(String animaldeathid) {
this.animaldeathid = animaldeathid;
}
public String getAnimalinfoid() {
return animalinfoid;
}
public void setAnimalinfoid(String animalinfoid) {
this.animalinfoid = animalinfoid;
}
public String getDeathdate() {
return deathdate;
}
public void setDeathdate(String deathdate) {
this.deathdate = deathdate;
}
public String getDeathweight() {
return deathweight;
}
public void setDeathweight(String deathweight) {
this.deathweight = deathweight;
}
public String getDeathreason() {
return deathreason;
}
public void setDeathreason(String deathreason) {
this.deathreason = deathreason;
}
public String getTreatmentmode() {
return treatmentmode;
}
public void setTreatmentmode(String treatmentmode) {
this.treatmentmode = treatmentmode;
}
public String getSymptom() {
return symptom;
}
public void setSymptom(String symptom) {
this.symptom = symptom;
}
public String getAnimalinfono() {
return animalinfono;
}
public void setAnimalinfono(String animalinfono) {
this.animalinfono = animalinfono;
}
}
|
[
"wangxiaoyu92@163.com"
] |
wangxiaoyu92@163.com
|
7223dc50262c490dba61e19aa68ef6308ed5ac4e
|
62e334192393326476756dfa89dce9f0f08570d4
|
/tk_code/tiku-essay-app/essay-common/src/main/java/com/huatu/tiku/essay/entity/EssayQuestionBelongPaperArea.java
|
d0de989b159f84aba6de51593b261c2a6390029b
|
[] |
no_license
|
JellyB/code_back
|
4796d5816ba6ff6f3925fded9d75254536a5ddcf
|
f5cecf3a9efd6851724a1315813337a0741bd89d
|
refs/heads/master
| 2022-07-16T14:19:39.770569
| 2019-11-22T09:22:12
| 2019-11-22T09:22:12
| 223,366,837
| 1
| 2
| null | 2022-06-30T20:21:38
| 2019-11-22T09:15:50
|
Java
|
UTF-8
|
Java
| false
| false
| 1,463
|
java
|
package com.huatu.tiku.essay.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* 地区表
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "v_essay_area")
@EqualsAndHashCode(callSuper = false)
@Builder
@DynamicUpdate
@DynamicInsert
public class EssayQuestionBelongPaperArea implements Serializable {
@Id
protected long id;
@Column(columnDefinition = "smallint default 0")
protected int bizStatus;
@Column(columnDefinition = "smallint default 1")
protected int status;
@Column(columnDefinition = "varchar(128) default ''")
protected String creator;
@Column(columnDefinition = "varchar(128) default ''")
protected String modifier;
@Temporal(TemporalType.TIMESTAMP)
@Column(updatable = false)
@org.hibernate.annotations.CreationTimestamp
protected Date gmtCreate;
@org.hibernate.annotations.UpdateTimestamp
@Temporal(TemporalType.TIMESTAMP)
protected Date gmtModify;
//地区名称
private String name;
//上级城市id
private long pId;
//优先级(越小越靠前)
private int sort;
}
|
[
"jelly_b@126.com"
] |
jelly_b@126.com
|
3320ff49939c5a7b04b8cfefe0e9c997d695f101
|
8d210db735191c5a14cf2db57b0b02877daf8784
|
/src/ch10/controller/Controller.java
|
75b8b31b53e71778a6241578d5bbb7ee4819154d
|
[] |
no_license
|
1326670425/TIJ
|
0cc127642ca13b26729fae267512d9df3f03f53f
|
a8f58dde62d2fd8955d130f81feed5de3d7833b1
|
refs/heads/master
| 2020-04-13T23:23:49.016618
| 2019-08-08T09:57:42
| 2019-08-08T09:57:42
| 163,505,084
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 711
|
java
|
/**
* @Title Controller.java
* @Package ch10.controller
* @Description TODO
* @author 吴扬颉
* @date 2019年1月7日
* @version 1.0
*/
package ch10.controller;
import java.util.*;
/**
* @ClassName Controller
* @Description 管理并触发事件的实际控制框架
* @author 吴扬颉
* @date 2019年1月7日
*
*/
public class Controller {
private List<Event> eventList = new ArrayList<Event>();
public void addEvent(Event c){ eventList.add(c); }
public void run(){
while(eventList.size() > 0){
for(Event e : new ArrayList<Event>(eventList)){
if(e.ready()){
System.out.println(e);
e.action();
eventList.remove(e);
}
}
}
}
}
|
[
"1326670425@qq.com"
] |
1326670425@qq.com
|
2aa2847a1cb1fc701ca71371877ec1afe43a92f8
|
75f9adce0c4b88e9e542912ad88679a1a5e1c7b1
|
/src/main/java/com/mascova/talarion/domain/Image.java
|
900c2c41cf20717b2aa3a1b5b5a195a8fecf059b
|
[] |
no_license
|
irfanr/talarion
|
6835912e9a06bc4aa2e0c5d935280d81ee7f8b8a
|
6df170ab754beee2b0985a86950271ff585aa9c3
|
refs/heads/master
| 2021-01-13T13:20:34.323320
| 2015-09-15T11:46:53
| 2015-09-15T11:46:53
| 35,561,879
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 996
|
java
|
package com.mascova.talarion.domain;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Version;
@Entity
public class Image implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Version
private Long version;
private String name;
private String path;
private String type;
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;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
|
[
"irfan.romadona@gmail.com"
] |
irfan.romadona@gmail.com
|
c1b029fe1014146d18b8e98b7b026afa7523eebf
|
22ab12ab777e82cdb7f533cd5a07190e7b747401
|
/src/main/java/mekanism/client/model/robit/RobitBakedModel.java
|
531f54ed0c5134ab0de18d42bb48b98d5baaca44
|
[
"MIT"
] |
permissive
|
TehStoneMan/Mekanism
|
5550fea83a60f7f77a6fda0e207cc2e65864dc93
|
24108d99ed37cebc90e08dd70169b8dc4d820379
|
refs/heads/master
| 2022-01-30T08:57:50.060438
| 2022-01-01T18:19:23
| 2022-01-01T18:19:23
| 33,217,796
| 0
| 0
| null | 2016-08-04T12:53:34
| 2015-04-01T00:32:42
|
Java
|
UTF-8
|
Java
| false
| false
| 5,301
|
java
|
package mekanism.client.model.robit;
import com.google.common.collect.ImmutableList;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import mekanism.api.robit.RobitSkin;
import mekanism.client.RobitSpriteUploader;
import mekanism.client.model.MekanismModelCache;
import mekanism.client.model.baked.ExtensionBakedModel;
import mekanism.client.render.lib.QuadTransformation;
import mekanism.client.render.lib.QuadTransformation.TextureFilteredTransformation;
import mekanism.client.render.lib.QuadUtils;
import mekanism.common.entity.EntityRobit;
import mekanism.common.item.ItemRobit;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemOverride;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.data.IModelData;
import net.minecraftforge.client.model.data.ModelDataMap;
public class RobitBakedModel extends ExtensionBakedModel<ResourceLocation> {
private final RobitItemOverrideList overrideList;
public RobitBakedModel(IBakedModel original) {
super(original);
this.overrideList = new RobitItemOverrideList(super.getOverrides());
}
@Nonnull
@Override
public ItemOverrideList getOverrides() {
return overrideList;
}
@Override
public List<BakedQuad> createQuads(QuadsKey<ResourceLocation> key) {
List<BakedQuad> quads = key.getQuads();
if (RobitSpriteUploader.UPLOADER != null) {
ResourceLocation selectedTexture = key.getData();
//Only replace missing textures (which should in general be #robit in the actual json without a mapping to it)
//TODO: This technically doesn't behave quite right for textures that are not replaced given the sprites on the
// model likely are on a different atlas than the robit textures, so the render type will be wrong
QuadTransformation transformation = QuadTransformation.texture(RobitSpriteUploader.UPLOADER.getSprite(selectedTexture));
transformation = TextureFilteredTransformation.of(transformation, rl -> rl.getPath().equals("missingno"));
quads = QuadUtils.transformBakedQuads(quads, transformation);
}
return quads;
}
@Nullable
@Override
public QuadsKey<ResourceLocation> createKey(QuadsKey<ResourceLocation> key, IModelData data) {
ResourceLocation skinTexture = data.getData(EntityRobit.SKIN_TEXTURE_PROPERTY);
if (skinTexture == null) {
return null;
}
return key.data(skinTexture, skinTexture.hashCode(), ResourceLocation::equals);
}
@Override
protected RobitBakedModel wrapModel(IBakedModel model) {
return new RobitBakedModel(model);
}
private static class RobitItemOverrideList extends ItemOverrideList {
private final ItemOverrideList original;
RobitItemOverrideList(ItemOverrideList original) {
this.original = original;
}
@Nullable
@Override
public IBakedModel resolve(@Nonnull IBakedModel model, @Nonnull ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity) {
if (!stack.isEmpty() && stack.getItem() instanceof ItemRobit) {
RobitSkin skin = ((ItemRobit) stack.getItem()).getRobitSkin(stack).getSkin();
if (skin.getCustomModel() != null) {
//If the skin has a custom model look it up and if it isn't the model we are currently resolving for
// (to avoid stack overflow and recursion), then lookup the overrides of that model
IBakedModel customModel = MekanismModelCache.INSTANCE.getRobitSkin(skin);
if (customModel != null && customModel != model) {
return customModel.getOverrides().resolve(customModel, stack, world, entity);
}
}
List<ResourceLocation> textures = skin.getTextures();
if (!textures.isEmpty()) {
//Assuming the skin actually has textures (it should), grab the first texture as the model data
ModelDataMap modelData = new ModelDataMap.Builder().withInitial(EntityRobit.SKIN_TEXTURE_PROPERTY, textures.get(0)).build();
// perform any overrides the original may have (most likely it doesn't have any)
// and then wrap the baked model so that it makes use of the model data
IBakedModel resolved = original.resolve(model, stack, world, entity);
if (resolved == null) {
resolved = model;
}
return new RobitModelDataBakedModel(resolved, modelData);
}
}
return original.resolve(model, stack, world, entity);
}
@Nonnull
@Override
public ImmutableList<ItemOverride> getOverrides() {
return original.getOverrides();
}
}
}
|
[
"sara@freimer.com"
] |
sara@freimer.com
|
4edb79b7215df9583f0159c91daad6024eb725e0
|
dbe59da45f4cee95debb721141aeab16f44b4cac
|
/src/main/java/com/syuesoft/sell/sellwork/service/CarFixService.java
|
ae60932ad25be40c3f1738916fae4284d9aff882
|
[] |
no_license
|
tonyliu830204/UESoft
|
5a8a546107f2093ee920facf6d93eedd1affd248
|
9dd48ff19f40556d1892688f6426e4bfe68c7d10
|
refs/heads/master
| 2021-01-23T15:51:00.782632
| 2014-03-26T15:56:46
| 2014-03-26T15:56:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,872
|
java
|
package com.syuesoft.sell.sellwork.service;
import com.syuesoft.model.BasUsers;
import com.syuesoft.sell.sellwork.vo.CarFixVo;
import com.syuesoft.util.Json;
import com.syuesoft.util.Msg;
public interface CarFixService {
//获取车辆档案信息(在库代销,新建档案)
public Json getCarInfor(CarFixVo carFixVo)throws Exception;
/**
*
* @Title: getCarFixInfor
* @Description: TODO(获取加装汇总信息)
* @param @param carFixVo
* @param @return 设定文件
* @return Object 返回类型
* @throws
*/
public Json getCarFixInforNoFinish(CarFixVo carFixVo)throws Exception;
/**
*
* @Title: getCarFixInfor
* @Description: TODO(获取审核汇总信息)
* @param @param carFixVo
* @param @return 设定文件
* @return Object 返回类型
* @throws
*/
public Json getCarFixInforExamine(CarFixVo carFixVo)throws Exception;
/**
*
* @Title: getCarFixInfor
* @Description: TODO(申请加装)
* @param @param carFixVo
* @param @return 设定文件
* @return Object 返回类型
* @throws
*/
public void doApplyFix(CarFixVo carFixVo, BasUsers user)throws Exception;
/**
*
* @Title: getCarFixDetail
* @Description: TODO(获取加装明细)
* @param @param carFixVo
* @param @return 设定文件
* @return Object 返回类型
* @throws
*/
public Json getCarFixDetail(CarFixVo carFixVo)throws Exception;
/**
*
* @Title: examineCarFix
* @Description: TODO(修改加装审核状态)
* @param @param carFixVo
* @param @return 设定文件
* @return Object 返回类型
* @throws
*/
public Msg updateCarFixExamineState(CarFixVo carFixVo)throws Exception;
/**
*
* @Title: findDefaulePartStore
* @Description: TODO(查询默认的销售加装仓)
* @param 设定文件
* @return void 返回类型
* @throws
*/
public String findDefaulePartStore(CarFixVo carFixVo)throws Exception;
/**
*
* @Title: save
* @Description: TODO(保存加装项目以及配件)
* @param @param carFixVo 设定文件
* @return void 返回类型
* @throws
*/
public void save(CarFixVo carFixVo, BasUsers user)throws Exception;
/**
*
* @Title: findPart
* @Description: TODO(查询配件)
* @param @param carFixVo
* @param @return 设定文件
* @return Object 返回类型
* @throws
*/
public Json findPart(CarFixVo carFixVo)throws Exception;
/**
*
* @Title: findItem
* @Description: TODO(查询项目)
* @param @param carFixVo
* @param @return 设定文件
* @return Object 返回类型
* @throws
*/
public Json findItem(CarFixVo carFixVo)throws Exception;
/**
*
* @Title: updateCarFixFinishState
* @Description: TODO(修改加装完成情况)
* @param @param carFixVo 设定文件
* @return void 返回类型
* @throws
*/
public void updateCarFixFinishState(CarFixVo carFixVo)throws Exception;
/**
*
* @Title: updateCarFixFinishState
* @Description: TODO(修改加装总金额)
* @param @param carFixVo 设定文件
* @return void 返回类型
* @throws
*/
public void updateCarFixAmount(CarFixVo carFixVo)throws Exception;
/**
*
* @Title: totemoney
* @Description: TODO(计算加装总金额)
* @param @param carFixVo 设定文件
* @return Double 返回类型
* @throws
*/
public Double totemoney(CarFixVo carFixVo)throws Exception;
}
|
[
"liweinan0423@gmail.com"
] |
liweinan0423@gmail.com
|
c07cce33e729dc32e1e788901a489bd8e62e5750
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/MATH-32b-8-2-FEMO-WeightedSum:TestLen:CallDiversity/org/apache/commons/math3/geometry/partitioning/BSPTree_ESTest.java
|
89d8aed73a0ced20d0b12484b4e1a091c73269d8
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547
| 2020-08-10T15:14:49
| 2020-08-10T15:14:49
| 285,804,495
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 567
|
java
|
/*
* This file was automatically generated by EvoSuite
* Fri Apr 03 14:20:13 UTC 2020
*/
package org.apache.commons.math3.geometry.partitioning;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class BSPTree_ESTest extends BSPTree_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
ce306c68044fffe00a42766393cd95dab5541918
|
90c799b3726c45c6d1219b04c8666b2522937182
|
/src/msa/TranscriptionString.java
|
11fa487038eae5ed66eeece1c98a380ef752ae9d
|
[] |
no_license
|
kulashish/speech-text-msa
|
c027e2e3339ef1d8578cd560ac081c071c506ca6
|
dee05889c3933a81f40a3c1a11ef9f0cd2a748e9
|
refs/heads/master
| 2021-03-12T19:55:56.434204
| 2015-07-29T23:50:03
| 2015-07-29T23:50:03
| 39,921,743
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 395
|
java
|
package msa;
import java.util.ArrayList;
public class TranscriptionString {
// the complete transcription sequence by a user
public String transcriptionSequence;
// the list of words (i.e. each word from the whole sequence)
public ArrayList<String> wordList;
// the timestamps for each individual words
public ArrayList<String> timestamps;
public TranscriptionString()
{
}
}
|
[
"kulashish@gmail.com"
] |
kulashish@gmail.com
|
e2ba7ef869a23c082d91d19690e9d9df7e5b5639
|
5c5d8b67333b538d4859d8c3c40a28e4b2a0eec8
|
/src/org/proteomecommons/www/region/Region.java
|
30e00305e6fc6dfe1452185c009f3aa8257c4537
|
[] |
no_license
|
jfalkner/ProteomeCommons.org
|
0bbe0255f465a8f74e267daefe5920d41b1e540e
|
a8de104abb67094bb622204730c30fb835a21308
|
refs/heads/master
| 2020-06-06T02:53:23.455892
| 2013-09-19T05:46:26
| 2013-09-19T05:46:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,584
|
java
|
/*
* Copyright 2005 The Regents of the University of Michigan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.proteomecommons.www.region;
import java.sql.ResultSet;
import org.proteomecommons.www.country.Country;
import org.proteomecommons.www.country.CountryUtil;
/**
*
* @author James "Augie" Hill - augman85@gmail.com
*/
public class Region {
public int regionID = -1;
public String region = null, regionCode = null;
public Country country = null;
public Region(ResultSet rs) {
try {
this.regionID = rs.getInt("regionID");
this.region = rs.getString("region");
this.regionCode = rs.getString("regionCode");
this.country = CountryUtil.getCountry(rs.getInt("countryID"));
} catch (Exception e) {
}
}
public Region(int regionID, String region, String regionCode, int countryID) {
this.regionID = regionID;
this.region = region;
this.regionCode = regionCode;
this.country = CountryUtil.getCountry(countryID);
}
}
|
[
"jayson@dell-desktop.example.com"
] |
jayson@dell-desktop.example.com
|
ce82dd261f6b50c6d47ec5e679b5239703100526
|
1327665ddac4a831bd402d3ea6d203042d59e408
|
/yuewan/src/main/java/com/tuwan/yuewan/nim/uikit/glide/ImageLoaderKit.java
|
16110da95e04953a18198c045d829201f2949f87
|
[] |
no_license
|
767954322/Android2
|
7dfeb522e087e75eabd4ce56230f965f1a794d64
|
c542bc326c61f74a38f22bb6ae427d5af5da1b54
|
refs/heads/master
| 2020-03-19T01:19:57.837798
| 2018-05-31T05:52:14
| 2018-05-31T05:52:14
| 135,538,043
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,458
|
java
|
package com.tuwan.yuewan.nim.uikit.glide;
import android.content.Context;
import android.graphics.Bitmap;
import android.text.TextUtils;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.netease.nimlib.sdk.uinfo.UserInfoProvider;
import com.sina.weibo.sdk.utils.LogUtil;
import com.tuwan.yuewan.nim.uikit.NimUIKit;
import com.tuwan.yuewan.nim.uikit.common.framework.NimSingleThreadExecutor;
import com.tuwan.yuewan.nim.uikit.common.ui.imageview.HeadImageView;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* 图片缓存管理组件
*/
public class ImageLoaderKit {
private static final String TAG = "ImageLoaderKit";
private Context context;
public ImageLoaderKit(Context context) {
this.context = context;
}
/**
* 清空图像缓存
*/
public void clear() {
NIMGlideModule.clearMemoryCache(context);
}
/**
* 构建图像缓存
*/
public void buildImageCache() {
// clear avatar cache
clear();
// build self avatar cache
List<String> accounts = new ArrayList<>(1);
accounts.add(NimUIKit.getAccount());
NimUIKit.getImageLoaderKit().buildAvatarCache(accounts);
}
private void buildAvatarCache(List<String> accounts) {
if (accounts == null || accounts.isEmpty()) {
return;
}
UserInfoProvider.UserInfo userInfo;
for (String account : accounts) {
userInfo = NimUIKit.getUserInfoProvider().getUserInfo(account);
if (userInfo != null) {
asyncLoadAvatarBitmapToCache(userInfo.getAvatar());
}
}
LogUtil.i(TAG, "build avatar cache completed, avatar count=" + accounts.size());
}
/**
* 获取通知栏提醒所需的头像位图,只存内存缓存/磁盘缓存中取,如果没有则返回空,自动发起异步加载
* 注意:该方法在后台线程执行
*/
public Bitmap getNotificationBitmapFromCache(String url) {
if (TextUtils.isEmpty(url)) {
return null;
}
final int imageSize = HeadImageView.DEFAULT_AVATAR_NOTIFICATION_ICON_SIZE;
Bitmap cachedBitmap = null;
try {
cachedBitmap = Glide.with(context)
.asBitmap()
.load(url)
.apply(new RequestOptions()
.centerCrop()
.override(imageSize, imageSize))
.submit()
.get(200, TimeUnit.MILLISECONDS)// 最大等待200ms
;
} catch (Exception e) {
e.printStackTrace();
}
return cachedBitmap;
}
/**
* 异步加载头像位图到Glide缓存中
*/
private void asyncLoadAvatarBitmapToCache(final String url) {
if (TextUtils.isEmpty(url)) {
return;
}
final int imageSize = HeadImageView.DEFAULT_AVATAR_THUMB_SIZE;
NimSingleThreadExecutor.getInstance().execute(new Runnable() {
@Override
public void run() {
Glide.with(context)
.load(url)
.submit(imageSize, imageSize);
}
});
}
}
|
[
"18911211362@163.com"
] |
18911211362@163.com
|
b7105d821965e32cbb5945c13cd7bdd66f266198
|
191c180622a6421cdbb93bbffd22318e3abe19f3
|
/src/main/java/io/ruin/model/map/Direction.java
|
e2093902c5b9f6a611e17880aa49edf84cd90db7
|
[] |
no_license
|
Dmm-PS/novea-norse-runesuite
|
4248f1bb2041c68db8aead0d9b82d28200d3b5ec
|
03f89d3e7b9b510c17cd9705ea72d0df9bb691ec
|
refs/heads/master
| 2022-07-29T03:30:53.590073
| 2020-05-24T21:25:41
| 2020-05-24T21:25:41
| 266,627,424
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,445
|
java
|
package io.ruin.model.map;
public enum Direction {
/**
* DO NOT REORDER
*/
NORTH_WEST(-1, 1, 768), //0
NORTH(0, 1, 1024), //1
NORTH_EAST(1, 1, 1280), //2
WEST(-1, 0, 512), //3
EAST(1, 0, 1536), //4
SOUTH_WEST(-1, -1, 256), //5
SOUTH(0, -1, 0), //6
SOUTH_EAST(1, -1, 1792); //7
public final int deltaX, deltaY;
public final int clientValue;
Direction(int deltaX, int deltaY, int clientValue) {
this.deltaX = deltaX;
this.deltaY = deltaY;
this.clientValue = clientValue;
}
public static Direction get(String cardinal) {
switch(cardinal.toUpperCase()) {
case "N": return Direction.NORTH;
case "NW": return Direction.NORTH_WEST;
case "NE": return Direction.NORTH_EAST;
case "W": return Direction.WEST;
case "E": return Direction.EAST;
case "SW": return Direction.SOUTH_WEST;
case "SE": return Direction.SOUTH_EAST;
default: return Direction.SOUTH;
}
}
public static Direction getFromObjectDirection(int direction) {
switch (direction) {
case 0:
return SOUTH;
case 1:
return WEST;
case 2:
return NORTH;
case 3:
return EAST;
default:
return null;
}
}
public static Direction fromDoorDirection(int direction) {
switch (direction) {
case 0:
return WEST;
case 1:
return NORTH;
case 2:
return EAST;
case 3:
return SOUTH;
default:
return null;
}
}
public static Direction getDirection(Position src, Position dest) {
int deltaX = dest.getX() - src.getX();
int deltaY = dest.getY() - src.getY();
return getDirection(deltaX, deltaY);
}
public static Direction getDirection(int deltaX, int deltaY) {
if (deltaX != 0)//normalize
deltaX /= Math.abs(deltaX);
if (deltaY != 0)
deltaY /= Math.abs(deltaY);
for (Direction d: Direction.values()) {
if (d.deltaX == deltaX && d.deltaY == deltaY)
return d;
}
return null;
}
}
|
[
"tardisfan121@gmail.com"
] |
tardisfan121@gmail.com
|
cf4e6af6a8dba2769c9460d65993e37cf91c08b2
|
ba4948c4b6ad2b3e3376f43acbf4ed42ff43c6e0
|
/src/main/java/com/alipay/api/request/KoubeiMarketingDataBizadviserMemberprofileQueryRequest.java
|
129cb88b25253d9d3a73ccfda45158010afb96cb
|
[
"Apache-2.0"
] |
permissive
|
midoujia/alipay-sdk-java-all
|
638a99943f1d05e4bdf0870dd40a62c5c6c6059b
|
fc41e3a0102f6c446dbf2a5b7a9f21ee6ca91884
|
refs/heads/master
| 2023-09-02T14:45:02.224806
| 2021-11-16T10:07:35
| 2021-11-16T10:07:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,293
|
java
|
package com.alipay.api.request;
import com.alipay.api.domain.KoubeiMarketingDataBizadviserMemberprofileQueryModel;
import java.util.Map;
import com.alipay.api.AlipayRequest;
import com.alipay.api.internal.util.AlipayHashMap;
import com.alipay.api.response.KoubeiMarketingDataBizadviserMemberprofileQueryResponse;
import com.alipay.api.AlipayObject;
/**
* ALIPAY API: koubei.marketing.data.bizadviser.memberprofile.query request
*
* @author auto create
* @since 1.0, 2021-06-24 14:21:25
*/
public class KoubeiMarketingDataBizadviserMemberprofileQueryRequest implements AlipayRequest<KoubeiMarketingDataBizadviserMemberprofileQueryResponse> {
private AlipayHashMap udfParams; // add user-defined text parameters
private String apiVersion="1.0";
/**
* 经营参谋会员人物画像查询
*/
private String bizContent;
public void setBizContent(String bizContent) {
this.bizContent = bizContent;
}
public String getBizContent() {
return this.bizContent;
}
private String terminalType;
private String terminalInfo;
private String prodCode;
private String notifyUrl;
private String returnUrl;
private boolean needEncrypt=false;
private AlipayObject bizModel=null;
public String getNotifyUrl() {
return this.notifyUrl;
}
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
public String getReturnUrl() {
return this.returnUrl;
}
public void setReturnUrl(String returnUrl) {
this.returnUrl = returnUrl;
}
public String getApiVersion() {
return this.apiVersion;
}
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
public void setTerminalType(String terminalType){
this.terminalType=terminalType;
}
public String getTerminalType(){
return this.terminalType;
}
public void setTerminalInfo(String terminalInfo){
this.terminalInfo=terminalInfo;
}
public String getTerminalInfo(){
return this.terminalInfo;
}
public void setProdCode(String prodCode) {
this.prodCode=prodCode;
}
public String getProdCode() {
return this.prodCode;
}
public String getApiMethodName() {
return "koubei.marketing.data.bizadviser.memberprofile.query";
}
public Map<String, String> getTextParams() {
AlipayHashMap txtParams = new AlipayHashMap();
txtParams.put("biz_content", this.bizContent);
if(udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public void putOtherTextParam(String key, String value) {
if(this.udfParams == null) {
this.udfParams = new AlipayHashMap();
}
this.udfParams.put(key, value);
}
public Class<KoubeiMarketingDataBizadviserMemberprofileQueryResponse> getResponseClass() {
return KoubeiMarketingDataBizadviserMemberprofileQueryResponse.class;
}
public boolean isNeedEncrypt() {
return this.needEncrypt;
}
public void setNeedEncrypt(boolean needEncrypt) {
this.needEncrypt=needEncrypt;
}
public AlipayObject getBizModel() {
return this.bizModel;
}
public void setBizModel(AlipayObject bizModel) {
this.bizModel=bizModel;
}
}
|
[
"ben.zy@antfin.com"
] |
ben.zy@antfin.com
|
98ec4c93c234c8bd61235b8d94f13e66dd95bedc
|
efc256721d2d07022f562fb28c6a21ffdb396fdc
|
/wrench-http-server-parent/wrench-grizzly-http-server/src/main/java/ir/piana/dev/wrench/module/httpserver/grizzly/QPGrizzlyHttpServerModule.java
|
d7c11c51d439b1851960ef999ef289c291f87229
|
[] |
no_license
|
pianairco/piana-wrench
|
bc467528d35943d191fa3c52a9dc4aa08e16338a
|
8b7baea7fae303ad2beb53abe308fc5e3a317cfa
|
refs/heads/master
| 2020-04-27T07:40:12.145415
| 2019-03-27T07:49:19
| 2019-03-27T07:49:19
| 174,143,578
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,208
|
java
|
package ir.piana.dev.wrench.module.httpserver.grizzly;
import ir.piana.dev.wrench.core.module.QPBaseModule;
import org.glassfish.grizzly.http.server.*;
import org.jpos.transaction.Context;
public class QPGrizzlyHttpServerModule extends QPBaseModule {
private String host;
private int port;
private HttpServer server;
@Override
protected void configBeforeRegisterQPModule() throws Exception {
host = cfg.get("host", "localhost");
port = cfg.getInt("port", 9090);
}
@Override
protected void initBeforeRegisterQPModule() throws Exception {
server = new HttpServer();
final ServerConfiguration config = server.getServerConfiguration();
final NetworkListener listener =
new NetworkListener("grizzly",
host,
port);
server.addListener(listener);
server.getServerConfiguration().addHttpHandler(
new HttpHandler() {
public void service(Request request, Response response) throws Exception {
response.suspend();
Context context = new Context();
context.put("qp-httpmodule-request",
new QPGrizzlyHttpRequest(request));
context.put("qp-httpmodule-response",
new QPGrizzlyHttpResponseBuilder(response));
out(context);
}
});
}
// @Override
// protected void initBeforeRegisterQPModule() throws Exception {
// server = new HttpServer();
// final ServerConfiguration config = server.getServerConfiguration();
// final NetworkListener listener =
// new NetworkListener("grizzly",
// host,
// port);
// server.addListener(listener);
// server.getServerConfiguration().addHttpHandler(
// new HttpHandler() {
// public void service(Request request, Response response) throws Exception {
// response.suspend();
// Context context = new Context();
// context.put("qp-httpmodule-request",
// new QPGrizzlyHttpRequest(request));
// context.put("qp-httpmodule-response",
// new QPGrizzlyHttpResponseBuilder(response));
// out(context);
// }
// });
// }
@Override
protected void configForSpringContext() throws Exception {
}
@Override
protected void initAfterRegisterQPModule() throws Exception {
}
@Override
protected void configAfterRegisterQPModule() throws Exception {
}
@Override
protected void startQPModule() throws Exception {
try {
server.start();
} catch (Exception e) {
System.err.println(e);
}
}
@Override
protected void stopQPModule() throws Exception {
}
@Override
protected void destroyQPModule() throws Exception {
}
}
|
[
"Rahmati@office.dml.com"
] |
Rahmati@office.dml.com
|
6adc86fe73a8c9d22dd2f3f9b3b9d0004d5b0a28
|
a46aaa6d3c3f1a45d309f44c31a2c9cf106d0d45
|
/test/ut_3DHome/src/com/borqs/se/unittests/SEObjectModelTest.java
|
3241c93415145faf1716113e303cd9c7d2ed96b7
|
[] |
no_license
|
liugod/hdhome
|
e6a76aeb4126fa91941ac900ac02755d39463fbc
|
621776fb411c09352340cbafdd5591f357f623e9
|
refs/heads/master
| 2021-01-20T16:30:32.798990
| 2013-09-24T09:43:23
| 2013-09-24T09:43:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,343
|
java
|
package com.borqs.se.unittests;
import android.database.Cursor;
import android.test.AndroidTestCase;
import com.borqs.se.home3d.ModelInfo;
import com.borqs.se.home3d.ProviderUtils;
import com.borqs.se.scene.SESceneInfo;
import java.util.Collection;
import java.util.HashMap;
/// test camera data from database
public class SEObjectModelTest extends AndroidTestCase {
private static float MIN_THRESHOLD = 0.000005f;
HashMap<String, ModelInfo> mAllModelInfoMap = new HashMap<String, ModelInfo>();
private int mDbCount;
protected void setupData() {
Cursor cursor = ProviderUtils.queryAllModelInfo(getContext(), SESceneInfo.DEFAULT_SCENE_NAME);
if (null != cursor) {
mDbCount = cursor.getCount();
ModelInfo.parseAllFromCursor(cursor, mAllModelInfoMap);
cursor.close();
} else {
mDbCount = 0;
}
}
@Override
protected void setUp() throws Exception {
super.setUp();
setupData();
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
mAllModelInfoMap.clear();
mAllModelInfoMap = null;
}
/// all camera data should be existing.
public void testExisting() {
assertNotNull("test model info not null", mAllModelInfoMap);
assertFalse("test model info not empty", mAllModelInfoMap.isEmpty());
}
/// all camera should have been located in the y-z face with x = 0
public void testIdenticalName() {
assertEquals("test every model has identical name", mDbCount, mAllModelInfoMap.size());
}
/// all camera should have been target in the y-z face with x = 0
public void testModelType() {
Collection<ModelInfo> allInfo = mAllModelInfoMap.values();
for (ModelInfo info : allInfo) {
assertTrue("test known model type of " + info.mName, ModelInfo.isKnownType(info.mType));
}
}
/// all the axis should have been normalized, so each length is 1.
public void testSlotType() {
Collection<ModelInfo> allInfo = mAllModelInfoMap.values();
for (ModelInfo info : allInfo) {
assertTrue("TODO: test known slot type of " + info.mName, ModelInfo.isKnownSlotType(info.mSlotType));
}
}
/// all the axis should have been normalized, so each length is 1.
public void testPrimitiveType() {
Collection<ModelInfo> allInfo = mAllModelInfoMap.values();
for (ModelInfo info : allInfo) {
assertTrue("TODO: test known slot type of " + info.mName, ModelInfo.isKnownPrimitiveType(info.mSlotType));
}
}
/// all the axis should have been normalized, so each length is 1.
public void testTargetVesselType() {
Collection<ModelInfo> allInfo = mAllModelInfoMap.values();
for (ModelInfo info : allInfo) {
assertTrue("TODO: test known slot type of " + info.mName, ModelInfo.isKnownTargetVesselType(info.mSlotType));
}
}
/// all the axis should have been normalized, so each length is 1.
public void testKeyword() {
Collection<ModelInfo> allInfo = mAllModelInfoMap.values();
for (ModelInfo info : allInfo) {
assertTrue("TODO: test known slot type of " + info.mName, ModelInfo.isKnownKeyword(info.mKeyWords));
}
}
}
|
[
"liuhuadong78@gmail.com"
] |
liuhuadong78@gmail.com
|
85ad71b782e78e39d00ae016e7060e66e62aef6f
|
b23e3675bbf253c17f22de097ca73b6d2555bc2f
|
/bitcamp-web-06/src/main/java/bitcamp/pms/servlet/DispatcherServlet.java
|
504e75a13abe02e0b4f6af12fa06f5131afc79fd
|
[] |
no_license
|
tjr7788/bitcamp-cloud-computing
|
0f088dc8c84fe4d4a3adee7e61a53830517f88d8
|
982a32718868c4aac6ed5e2103252f4d8871c9b7
|
refs/heads/master
| 2020-03-22T04:48:18.497052
| 2018-09-05T02:03:45
| 2018-09-05T02:03:45
| 139,522,345
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,244
|
java
|
package bitcamp.pms.servlet;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@SuppressWarnings("serial")
@WebServlet("/app/*")
public class DispatcherServlet extends HttpServlet {
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String pathInfo = request.getPathInfo();
response.setContentType("text/html;charset=UTF-8");
RequestDispatcher rd = request.getRequestDispatcher(pathInfo);
rd.include(request, response);
String view = (String) request.getAttribute("view");
if (view != null && view.startsWith("redirect:")) {
response.sendRedirect(view.substring(9));
} else if (view != null) {
rd = request.getRequestDispatcher(view);
rd.include(request, response);
} else {
rd = request.getRequestDispatcher("/error.jsp");
rd.forward(request, response);
}
}
}
|
[
"sig4213@naver.com"
] |
sig4213@naver.com
|
a1b891ecd9da1693b15320d4634f3db3c279ea93
|
b5c4bcf54aeb2bcb4f6d8b389eb5894a35d34e97
|
/com/sun/xml/bind/Util.java
|
4947be564c4b05ff1d2375056ef520bf4ff63f72
|
[] |
no_license
|
mulderbaba/webservices-osgi
|
d233daf266c12e102a6e7a2b795d8f43c0dbddfb
|
7090b58bd4cdf5fab4af14d54cb20bb45c074de2
|
refs/heads/master
| 2021-06-02T00:34:49.408686
| 2017-07-27T12:39:42
| 2017-07-27T12:39:42
| 98,534,028
| 2
| 2
| null | 2021-02-03T19:27:23
| 2017-07-27T12:37:43
|
Java
|
UTF-8
|
Java
| false
| false
| 2,870
|
java
|
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package com.sun.xml.bind;
import java.util.logging.Logger;
/**
* @author Kohsuke Kawaguchi
*/
public final class Util {
private Util() {} // no instanciation
/**
* Gets the logger for the caller's class.
*
* @since 2.0
*/
public static Logger getClassLogger() {
try {
StackTraceElement[] trace = new Exception().getStackTrace();
return Logger.getLogger(trace[1].getClassName());
} catch( SecurityException e) {
return Logger.getLogger("com.sun.xml.bind"); // use the default
}
}
/**
* Reads the system property value and takes care of {@link SecurityException}.
*/
public static String getSystemProperty(String name) {
try {
return System.getProperty(name);
} catch( SecurityException e ) {
return null;
}
}
}
|
[
"mert@t2.com.tr"
] |
mert@t2.com.tr
|
cf8b11f8ad75edd2934774d1f9535cea02604eeb
|
0907c886f81331111e4e116ff0c274f47be71805
|
/sources/com/appnext/banners/BannerAd.java
|
f0e19bb4737dab2233651e50d6dcfac5f75f3cb9
|
[
"MIT"
] |
permissive
|
Minionguyjpro/Ghostly-Skills
|
18756dcdf351032c9af31ec08fdbd02db8f3f991
|
d1a1fb2498aec461da09deb3ef8d98083542baaf
|
refs/heads/Android-OS
| 2022-07-27T19:58:16.442419
| 2022-04-15T07:49:53
| 2022-04-15T07:49:53
| 415,272,874
| 2
| 0
|
MIT
| 2021-12-21T10:23:50
| 2021-10-09T10:12:36
|
Java
|
UTF-8
|
Java
| false
| false
| 4,960
|
java
|
package com.appnext.banners;
import android.content.Context;
import com.appnext.core.Ad;
import com.appnext.core.c;
import com.appnext.core.callbacks.OnECPMLoaded;
class BannerAd extends Ad {
protected static final String TID = "301";
protected static final String VID = "2.5.1.472";
public String getAUID() {
return "1000";
}
public void getECPM(OnECPMLoaded onECPMLoaded) {
}
public String getTID() {
return TID;
}
public String getVID() {
return "2.5.1.472";
}
public boolean isAdLoaded() {
return false;
}
public void loadAd() {
}
public void showAd() {
}
protected BannerAd(Ad ad) {
super(ad);
}
public BannerAd(Context context, String str) {
super(context, str);
}
/* access modifiers changed from: protected */
public String getSessionId() {
return super.getSessionId();
}
/* access modifiers changed from: protected */
public void setAdRequest(c cVar) {
super.setAdRequest(cVar);
}
/* access modifiers changed from: protected */
public c getAdRequest() {
return super.getAdRequest();
}
/* JADX WARNING: Can't fix incorrect switch cases order */
/* JADX WARNING: Code restructure failed: missing block: B:14:0x004a, code lost:
if (r8.equals("a") != false) goto L_0x004e;
*/
/* JADX WARNING: Code restructure failed: missing block: B:31:0x0087, code lost:
if (r8.equals("a") != false) goto L_0x008b;
*/
/* JADX WARNING: Removed duplicated region for block: B:34:0x008d A[RETURN] */
/* JADX WARNING: Removed duplicated region for block: B:35:0x0090 A[RETURN] */
/* Code decompiled incorrectly, please refer to instructions dump. */
public java.lang.String getTemId(com.appnext.banners.BannerAdData r8) {
/*
r7 = this;
java.lang.String r8 = r8.getRevenueType()
java.lang.String r0 = "cpi"
boolean r8 = r8.equals(r0)
r0 = 0
java.lang.String r1 = "b"
java.lang.String r2 = "a"
r3 = -1
r4 = 1
if (r8 == 0) goto L_0x0060
com.appnext.banners.d r8 = com.appnext.banners.d.S()
java.lang.String r5 = "BANNER_cpiActiveFlow"
java.lang.String r8 = r8.get(r5)
java.lang.String r8 = r8.toLowerCase()
int r5 = r8.hashCode()
r6 = 2
switch(r5) {
case 97: goto L_0x0046;
case 98: goto L_0x003e;
case 99: goto L_0x0034;
case 100: goto L_0x002a;
default: goto L_0x0029;
}
L_0x0029:
goto L_0x004d
L_0x002a:
java.lang.String r0 = "d"
boolean r8 = r8.equals(r0)
if (r8 == 0) goto L_0x004d
r0 = 3
goto L_0x004e
L_0x0034:
java.lang.String r0 = "c"
boolean r8 = r8.equals(r0)
if (r8 == 0) goto L_0x004d
r0 = 2
goto L_0x004e
L_0x003e:
boolean r8 = r8.equals(r1)
if (r8 == 0) goto L_0x004d
r0 = 1
goto L_0x004e
L_0x0046:
boolean r8 = r8.equals(r2)
if (r8 == 0) goto L_0x004d
goto L_0x004e
L_0x004d:
r0 = -1
L_0x004e:
if (r0 == 0) goto L_0x005d
if (r0 == r4) goto L_0x005a
if (r0 == r6) goto L_0x0057
java.lang.String r8 = "109"
return r8
L_0x0057:
java.lang.String r8 = "106"
return r8
L_0x005a:
java.lang.String r8 = "103"
return r8
L_0x005d:
java.lang.String r8 = "100"
return r8
L_0x0060:
com.appnext.banners.d r8 = com.appnext.banners.d.S()
java.lang.String r5 = "BANNER_cpcActiveFlow"
java.lang.String r8 = r8.get(r5)
java.lang.String r8 = r8.toLowerCase()
int r5 = r8.hashCode()
r6 = 97
if (r5 == r6) goto L_0x0083
r0 = 98
if (r5 == r0) goto L_0x007b
goto L_0x008a
L_0x007b:
boolean r8 = r8.equals(r1)
if (r8 == 0) goto L_0x008a
r0 = 1
goto L_0x008b
L_0x0083:
boolean r8 = r8.equals(r2)
if (r8 == 0) goto L_0x008a
goto L_0x008b
L_0x008a:
r0 = -1
L_0x008b:
if (r0 == 0) goto L_0x0090
java.lang.String r8 = "203"
return r8
L_0x0090:
java.lang.String r8 = "200"
return r8
*/
throw new UnsupportedOperationException("Method not decompiled: com.appnext.banners.BannerAd.getTemId(com.appnext.banners.BannerAdData):java.lang.String");
}
}
|
[
"66115754+Minionguyjpro@users.noreply.github.com"
] |
66115754+Minionguyjpro@users.noreply.github.com
|
c91f9dbdf166b8d568d54e14a1dd39db0ec78468
|
a8bd6f50c27892f9876de769f1777edeba29f06d
|
/services/viewsdb/src/com/vcs_demo_nov27/dao/DatetimeTypeDao.java
|
26a4133e4b879c476a1716cfa593fa4fbfeb0cde
|
[] |
no_license
|
kavyasree7/vcs_demo_nov27
|
d44e6e331e48c6a254a64ed87fab1352e3d22aa1
|
a8f92e967982c450f3ec8aca0651c779e9b846dd
|
refs/heads/master
| 2021-09-04T05:36:11.685631
| 2018-01-16T11:33:41
| 2018-01-16T11:33:41
| 112,153,246
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,207
|
java
|
/*Copyright (c) 2016-2017 wavemaker.com All Rights Reserved.
This software is the confidential and proprietary information of wavemaker.com You shall not disclose such Confidential Information and shall use it only in accordance
with the terms of the source code license agreement you entered into with wavemaker.com*/
package com.vcs_demo_nov27.dao;
/*This is a Studio Managed File. DO NOT EDIT THIS FILE. Your changes may be reverted by Studio.*/
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.orm.hibernate5.HibernateTemplate;
import org.springframework.stereotype.Repository;
import com.wavemaker.runtime.data.dao.WMGenericDaoImpl;
import com.vcs_demo_nov27.DatetimeType;
/**
* Specifies methods used to obtain and modify DatetimeType related information
* which is stored in the database.
*/
@Repository("viewsdb.DatetimeTypeDao")
public class DatetimeTypeDao extends WMGenericDaoImpl<DatetimeType, Integer> {
@Autowired
@Qualifier("viewsdbTemplate")
private HibernateTemplate template;
public HibernateTemplate getTemplate() {
return this.template;
}
}
|
[
"kavya.sree@wavemaker.com"
] |
kavya.sree@wavemaker.com
|
280c78cc4decd456445affb650b53a4cd5c0d07c
|
2c9e0541ed8a22bcdc81ae2f9610a118f62c4c4d
|
/harmony/tests/vts/vm/src/test/vm/jvmti/funcs/SetEventNotificationMode/SetEventNotificationMode0104/SetEventNotificationMode0104.java
|
c4e04cb9bc87f99f02005967fa94bb9fd140868b
|
[
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] |
permissive
|
JetBrains/jdk8u_tests
|
774de7dffd513fd61458b4f7c26edd7924c7f1a5
|
263c74f1842954bae0b34ec3703ad35668b3ffa2
|
refs/heads/master
| 2023-08-07T17:57:58.511814
| 2017-03-20T08:13:25
| 2017-03-20T08:16:11
| 70,048,797
| 11
| 9
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 889
|
java
|
/*
Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.apache.harmony.vts.test.vm.jvmti;
/**
* @author Valentin Al. Sitnick
* @version $Revision: 1.1 $
*
*/
public class SetEventNotificationMode0104 {
static public void main(String args[]) {
return;
}
}
|
[
"vitaly.provodin@jetbrains.com"
] |
vitaly.provodin@jetbrains.com
|
487c8fe3442e7dd4228aaf70d82713f3166fca9c
|
4af46c51990059c509ed9278e8708f6ec2067613
|
/java/l2server/gameserver/network/clientpackets/RequestSendExecutedUIEventsCount.java
|
0e7664b1b5d36b61dd9240bc11022558ccfcb95f
|
[] |
no_license
|
bahamus007/l2helios
|
d1519d740c11a66f28544075d9e7c628f3616559
|
228cf88db1981b1169ea5705eb0fab071771a958
|
refs/heads/master
| 2021-01-12T13:17:19.204718
| 2017-11-15T02:16:52
| 2017-11-15T02:16:52
| 72,180,803
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 373
|
java
|
package l2server.gameserver.network.clientpackets;
import l2server.log.Log;
/**
* @author MegaParzor!
*/
public class RequestSendExecutedUIEventsCount extends L2GameClientPacket
{
@Override
public void readImpl()
{
}
@Override
public void runImpl()
{
// TODO
Log.info(getType() + " packet was received from " + getClient() + ".");
}
}
|
[
"singto52@hotmail.com"
] |
singto52@hotmail.com
|
a81165f3b348b51ce37f226c65d437d8449e2282
|
12fcdfa41e36a3ea64e20bc3e98f6aaa8b3e66a4
|
/app/src/main/java/com/africa/crm/businessmanagement/baseutil/common/util/ImageUtils.java
|
6c3b4813a124988a625b961a5f20fcb89ace6244
|
[] |
no_license
|
guojin2092/BusinessManagementProject
|
8265351a4b8f0860bc137b661463f63c3d35c0b9
|
9f51ed63dba83c755d258a47046e65efef23e955
|
refs/heads/master
| 2020-04-05T20:36:32.031207
| 2019-02-13T05:33:48
| 2019-02-13T05:33:48
| 157,188,062
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,976
|
java
|
package com.africa.crm.businessmanagement.baseutil.common.util;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;
/**
* ImageUtils
* <ul>
* convert between Bitmap, byte array, Drawable
* <li>{@link #bitmapToByte(Bitmap)}</li>
* <li>{@link #bitmapToDrawable(Bitmap)}</li>
* <li>{@link #byteToBitmap(byte[])}</li>
* <li>{@link #byteToDrawable(byte[])}</li>
* <li>{@link #drawableToBitmap(Drawable)}</li>
* <li>{@link #drawableToByte(Drawable)}</li>
* </ul>
* <ul>
* get image
* <li>{@link #getInputStreamFromUrl(String, int)}</li>
* <li>{@link #getBitmapFromUrl(String, int)}</li>
* <li>{@link #getDrawableFromUrl(String, int)}</li>
* </ul>
* <ul>
* scale image
* <li>{@link #scaleImageTo(Bitmap, int, int)}</li>
* <li>{@link #scaleImage(Bitmap, float, float)}</li>
* </ul>
*
* @author <a href="http://www.trinea.cn" target="_blank">Trinea</a> 2012-6-27
*/
public class ImageUtils {
private ImageUtils() {
throw new AssertionError();
}
/**
* convert Bitmap to byte array
*
* @param b
* @return
*/
public static byte[] bitmapToByte(Bitmap b) {
if (b == null) {
return null;
}
ByteArrayOutputStream o = new ByteArrayOutputStream();
b.compress(Bitmap.CompressFormat.PNG, 100, o);
return o.toByteArray();
}
/**
* convert byte array to Bitmap
*
* @param b
* @return
*/
public static Bitmap byteToBitmap(byte[] b) {
return (b == null || b.length == 0) ? null : BitmapFactory.decodeByteArray(b, 0, b.length);
}
/**
* convert Drawable to Bitmap
*
* @param d
* @return
*/
public static Bitmap drawableToBitmap(Drawable d) {
return d == null ? null : ((BitmapDrawable)d).getBitmap();
}
/**
* convert Bitmap to Drawable
*
* @param b
* @return
*/
public static Drawable bitmapToDrawable(Bitmap b) {
return b == null ? null : new BitmapDrawable(b);
}
/**
* convert Drawable to byte array
*
* @param d
* @return
*/
public static byte[] drawableToByte(Drawable d) {
return bitmapToByte(drawableToBitmap(d));
}
/**
* convert byte array to Drawable
*
* @param b
* @return
*/
public static Drawable byteToDrawable(byte[] b) {
return bitmapToDrawable(byteToBitmap(b));
}
/**
* get input stream from network by imageurl, you need to close inputStream yourself
*
* @param imageUrl
* @param readTimeOutMillis
* @return
* @see ImageUtils#getInputStreamFromUrl(String, int, boolean)
*/
public static InputStream getInputStreamFromUrl(String imageUrl, int readTimeOutMillis) {
return getInputStreamFromUrl(imageUrl, readTimeOutMillis, null);
}
/**
* get input stream from network by imageurl, you need to close inputStream yourself
*
* @param imageUrl
* @param readTimeOutMillis read time out, if less than 0, not set, in mills
* @param requestProperties http request properties
* @return
* @throws MalformedURLException
* @throws IOException
*/
public static InputStream getInputStreamFromUrl(String imageUrl, int readTimeOutMillis,
Map<String, String> requestProperties) {
InputStream stream = null;
try {
URL url = new URL(imageUrl);
HttpURLConnection con = (HttpURLConnection)url.openConnection();
HttpUtils.setURLConnection(requestProperties, con);
if (readTimeOutMillis > 0) {
con.setReadTimeout(readTimeOutMillis);
}
stream = con.getInputStream();
} catch (MalformedURLException e) {
IOUtils.close(stream);
throw new RuntimeException("MalformedURLException occurred. ", e);
} catch (IOException e) {
IOUtils.close(stream);
throw new RuntimeException("IOException occurred. ", e);
}
return stream;
}
/**
* get drawable by imageUrl
*
* @param imageUrl
* @param readTimeOutMillis
* @return
* @see ImageUtils#getDrawableFromUrl(String, int, boolean)
*/
public static Drawable getDrawableFromUrl(String imageUrl, int readTimeOutMillis) {
return getDrawableFromUrl(imageUrl, readTimeOutMillis, null);
}
/**
* get drawable by imageUrl
*
* @param imageUrl
* @param readTimeOutMillis read time out, if less than 0, not set, in mills
* @param requestProperties http request properties
* @return
*/
public static Drawable getDrawableFromUrl(String imageUrl, int readTimeOutMillis,
Map<String, String> requestProperties) {
InputStream stream = getInputStreamFromUrl(imageUrl, readTimeOutMillis, requestProperties);
Drawable d = Drawable.createFromStream(stream, "src");
IOUtils.close(stream);
return d;
}
/**
* get Bitmap by imageUrl
*
* @param imageUrl
* @param readTimeOut
* @return
* @see ImageUtils#getBitmapFromUrl(String, int, boolean)
*/
public static Bitmap getBitmapFromUrl(String imageUrl, int readTimeOut) {
return getBitmapFromUrl(imageUrl, readTimeOut, null);
}
/**
* get Bitmap by imageUrl
*
* @param imageUrl
* @param requestProperties http request properties
* @return
*/
public static Bitmap getBitmapFromUrl(String imageUrl, int readTimeOut, Map<String, String> requestProperties) {
InputStream stream = getInputStreamFromUrl(imageUrl, readTimeOut, requestProperties);
Bitmap b = BitmapFactory.decodeStream(stream);
IOUtils.close(stream);
return b;
}
/**
* scale image
*
* @param org
* @param newWidth
* @param newHeight
* @return
*/
public static Bitmap scaleImageTo(Bitmap org, int newWidth, int newHeight) {
return scaleImage(org, (float) newWidth / org.getWidth(), (float) newHeight / org.getHeight());
}
/**
* scale image
*
* @param org
* @param scaleWidth sacle of width
* @param scaleHeight scale of height
* @return
*/
public static Bitmap scaleImage(Bitmap org, float scaleWidth, float scaleHeight) {
if (org == null) {
return null;
}
Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);
return Bitmap.createBitmap(org, 0, 0, org.getWidth(), org.getHeight(), matrix, true);
}
}
|
[
"317280902@qq.com"
] |
317280902@qq.com
|
0fec392dfcf2336ff834d91d70960cf52058e89c
|
a0e5858528a288b97aa32fb0f2170d6ed9226885
|
/emp-zn/micro/src/main/java/com/taiji/emp/zn/repository/DateStatRepository.java
|
5e0177dd62a00f79b209d5329653af79ea62697c
|
[] |
no_license
|
rauldoblem/nangang
|
f0a0f0c816c7de915c352cc467b2e6716c87a310
|
e48cadeaf5245c42b7e9a21f28903f4f4e8b6996
|
refs/heads/master
| 2020-08-11T04:01:12.891437
| 2019-06-25T13:42:57
| 2019-06-25T13:42:57
| 214,486,888
| 0
| 0
| null | 2019-10-11T16:51:17
| 2019-10-11T16:51:17
| null |
UTF-8
|
Java
| false
| false
| 5,740
|
java
|
package com.taiji.emp.zn.repository;
import com.taiji.base.common.utils.SqlFormat;
import com.taiji.emp.zn.vo.DateStatVo;
import com.taiji.emp.zn.vo.EventAndAlertDateStatVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.util.CollectionUtils;
import org.springframework.util.MultiValueMap;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Repository
public class DateStatRepository {
@Value("${spring.datasource.platform}")
private String platform;
@Autowired
SqlFormat sqlFormat;
@Autowired
private JdbcTemplate jdbcTemplate;
//按时间统计突发事件(事发时间--occurTime)总数和预警(创建时间--createTime)总数
public EventAndAlertDateStatVo statEventAndAlertDate(MultiValueMap<String, Object> params){
List<Object> statDate = params.get("statDate");
List<Object> alertStatus = params.get("alertStatus");
Map<String,Integer> eventStatMap = statEventDate(statDate);
Map<String,Integer> statAlertDate = statAlertDate(statDate,alertStatus);
return new EventAndAlertDateStatVo(eventStatMap,statAlertDate);
}
//事件信息统计
private Map<String,Integer> statEventDate(List<Object> statDate){
Map<String,Integer> map = new HashMap<>();
//拼接 in('2018-10','2018-11','2018-12',...)
String statDateStr = "";
if(!CollectionUtils.isEmpty(statDate)){
StringBuilder statDateBuilder = new StringBuilder();
statDateBuilder.append("(");
for(Object date : statDate){
statDateBuilder.append("'").append((String) date).append("'").append(",");
}
statDateStr = statDateBuilder.toString();
statDateStr = statDateStr.substring(0,statDateStr.length()-1);
statDateStr+=")";
}
String dateFormatStr = "";
if("mysql".equals(platform)){ //mysql环境
dateFormatStr = " date_format(t.OCCUR_TIME, '%Y-%m')";
}else{//oracle环境或postgre环境
dateFormatStr = " to_char(t.OCCUR_TIME, 'YYYY-MM')";
}
StringBuilder builder = new StringBuilder();
builder.append("select").append(dateFormatStr).append(" as date_str,count(t.OCCUR_TIME) as num")
.append(" from ec_event t");
if(!"".equals(statDateStr)){
builder.append(" where").append(dateFormatStr).append(" in ").append(statDateStr);
}
builder.append(" group by").append(dateFormatStr)
.append(" ORDER BY").append(dateFormatStr).append(" asc");
String sql = sqlFormat.sqlFormat(builder.toString());
List<DateStatVo> list = jdbcTemplate.query(sql ,new BeanPropertyRowMapper(DateStatVo.class));
map = list.stream().collect(Collectors.toMap(temp -> temp.getDateStr(), temp ->temp.getNum()));
return map;
}
//预警信息统计
private Map<String,Integer> statAlertDate(List<Object> statDate,List<Object> alertStatus){
Map<String,Integer> map = new HashMap<>();
//拼接 in('2018-10','2018-11','2018-12',...)
String statDateStr = "";
if(!CollectionUtils.isEmpty(statDate)){
StringBuilder statDateBuilder = new StringBuilder();
statDateBuilder.append("(");
for(Object date : statDate){
statDateBuilder.append("'").append((String) date).append("'").append(",");
}
statDateStr = statDateBuilder.toString();
statDateStr = statDateStr.substring(0,statDateStr.length()-1);
statDateStr+=")";
}
//拼接 in('2','3')
String alertStatusStr = "";
if(!CollectionUtils.isEmpty(alertStatus)){
StringBuilder alertStatusBuilder = new StringBuilder();
alertStatusBuilder.append("(");
for(Object status : alertStatus){
alertStatusBuilder.append("'").append((String) status).append("'").append(",");
}
alertStatusStr = alertStatusBuilder.toString();
alertStatusStr = alertStatusStr.substring(0,alertStatusStr.length()-1);
alertStatusStr+=")";
}
String dateFormatStr = "";
if("mysql".equals(platform)){ //mysql环境
dateFormatStr = " date_format(t.CREATE_TIME, '%Y-%m')";
}else{//oracle环境或postgre环境
dateFormatStr = " to_char(t.CREATE_TIME, 'YYYY-MM')";
}
StringBuilder builder = new StringBuilder();
builder.append("select").append(dateFormatStr).append(" as date_str,count(t.CREATE_TIME) as num")
.append(" from ma_alert t");
if(!"".equals(statDateStr)){
builder.append(" where").append(dateFormatStr).append(" in ").append(statDateStr);
}
if(!"".equals(statDateStr)){
builder.append(" and t.ALERT_STATUS in ").append(alertStatusStr);
}
builder.append(" group by").append(dateFormatStr)
.append(" ORDER BY").append(dateFormatStr).append(" asc");
String sql = sqlFormat.sqlFormat(builder.toString());
List<DateStatVo> list = jdbcTemplate.query(sql ,new BeanPropertyRowMapper(DateStatVo.class));
map = list.stream().collect(Collectors.toMap(temp -> temp.getDateStr(), temp ->temp.getNum()));
return map;
}
}
|
[
"18151950796@163.com"
] |
18151950796@163.com
|
eb3f061a2433e47d5f63c0b337d8783cd417c165
|
93f3578669fb0d0030a550316aebe0d7b4221631
|
/task-supplychain/src/main/java/glsx/com/cn/task/job/ProductSplitUpdatePriceJob.java
|
cd614815fa353868ba2371b9646e71bb5c16b977
|
[] |
no_license
|
shanghaif/supplychain
|
4d7de62809b6c88ac5080a85a77fc4bf3d856db8
|
c36c771b0304c5739de98bdfc322c0082a9e523d
|
refs/heads/master
| 2023-02-09T19:01:35.562699
| 2021-01-05T09:39:11
| 2021-01-05T09:39:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,130
|
java
|
package glsx.com.cn.task.job;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import glsx.com.cn.task.service.ProductSplitUpdatePriceService;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ElasticJobConf(
name = "ProductSplitUpdatePriceJob",
overwrite = true,
description = "供应链修改价格同步任务",
shardingItemParameters = "0=toutiao,1=cheyun",
misfire = false
)
public class ProductSplitUpdatePriceJob implements SimpleJob {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private ProductSplitUpdatePriceService productSplitUpdatePriceService;
@Override
public void execute(ShardingContext shardingContext) {
logger.info("供应链修改价格同步任务 开始");
productSplitUpdatePriceService.updateProductSplit();
logger.info("供应链修改价格同步任务 结束");
}
}
|
[
"3064741443@qq.com"
] |
3064741443@qq.com
|
59ded0c41aef1454e4d4414356ca068a23de0ac8
|
53c7e290ca14e9a53366dfb215870dcbf520e641
|
/src/fr/badblock/bungee/utils/time/TPS.java
|
349b9f9b16fb03b065a6d62a3a94c4d841e8c299
|
[] |
no_license
|
xMalware/BadBlock-BungeeCore
|
abd2fb2ab11d2ec7043dd5c5c4f36111dab790b0
|
f54689d06bf7f3cd65bd875f4f0667efd4bff212
|
refs/heads/master
| 2022-06-01T21:16:50.605498
| 2019-06-24T13:44:54
| 2019-06-24T13:44:54
| 207,396,964
| 0
| 1
| null | 2022-05-20T21:08:46
| 2019-09-09T20:19:14
|
Java
|
UTF-8
|
Java
| false
| false
| 3,323
|
java
|
package fr.badblock.bungee.utils.time;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Queue;
import java.util.concurrent.TimeUnit;
import com.google.common.collect.Queues;
import fr.badblock.bungee.BadBungee;
import lombok.Getter;
import lombok.Setter;
import net.md_5.bungee.BungeeCord;
/**
*
* TPS class
*
* @author xMalware
*
*/
public class TPS implements Runnable {
/**
* Queue
*
* @param Set
* the new queue
* @return Returns the current queue
*/
private static Queue<Double> queue = Queues.newLinkedBlockingDeque();
/**
* TPS
*
* @param Set
* the new TPS
* @return Returns the current TPS
*/
@Getter
@Setter
private static double tps = 0.0D;
/**
* Get lost milliseconds (lag factor)
*
* @return
*/
public static double getLostMilliseconds() {
// Returns the lost ms (with TPS)
return (20D - TPS.tps) * 50D;
}
/**
* Get lost milliseconds
*
* @param tps
* @return
*/
public static double getLostMilliseconds(double tps) {
// Returns the lost ms (with given TPS)
return (20D - tps) * 50D;
}
/**
* Round a number
*
* @param value
* @param places
* @return
*/
public static double round(double value, int places) {
// Problem with place number
if (places < 0) {
// Throw an exception
throw new IllegalArgumentException();
}
// Create a BigDecimal
BigDecimal bd = new BigDecimal(value);
// Scale & round half_up
bd = bd.setScale(places, RoundingMode.HALF_UP);
// Get double value
return bd.doubleValue();
}
/**
* NB
*
* @param Set
* the new nb
* @return Returns the current nb
*/
private int nb;
/**
* Sec
*
* @param Set
* the new sec
* @return Returns the current sec
*/
private long sec;
/**
* Time
*
* @param Set
* the new time
* @return Returns the current time
*/
private long time;
/*
* TPS Constructor
*/
public TPS() {
// Set the time
this.time = System.currentTimeMillis() + 1_000L;
// Set the time
this.sec = System.currentTimeMillis();
// Schedule the task
BungeeCord.getInstance().getScheduler().schedule(BadBungee.getInstance(), this, 0L, 50, TimeUnit.MILLISECONDS);
// Create a new thread
new Thread("TPS check") {
// On run
@Override
public void run() {
// While true
while (true) {
// If the time is over the last (expired)
if (System.currentTimeMillis() > time) {
// Set the new time (1s)
time = System.currentTimeMillis() + 1_000L;
// Get the lost TPS
double p = nb / 1_000D * 20D;
// Default nb
nb = 0;
// Get the current TPS
double d = 20.0D - p;
// Add TPS in queue
queue.add(d);
// Set TPS
setTps(d);
}
// Sleep 250ms
TimeUtils.sleep(250);
}
}
// Start
}.start();
}
/**
* Run
*/
@Override
public void run() {
// Get difference
double v = System.currentTimeMillis() - sec;
// 1 tick = 50ms
if (v > 50) {
// Set the diff
nb += v - 50;
}
// Set the sec
sec = System.currentTimeMillis();
}
}
|
[
"xmalware2@gmail.com"
] |
xmalware2@gmail.com
|
6ca04d5644f127c971b08d9904aba9bd59906165
|
ec6087bfcfba20306748b2ff5cd559cb32b35ff6
|
/leetcode/454.4sum-ii.311361940.ac.java
|
2fb5866b2cda5598a31155acb956fcfbc87c40bd
|
[
"BSD-3-Clause"
] |
permissive
|
lang010/acit
|
20bc1ea2956f83853551e398d86e3a14672e0aeb
|
5c43d6400e55992e9cf059d2bdf05536b776f71b
|
refs/heads/master
| 2021-01-20T09:45:24.832154
| 2020-12-16T04:05:10
| 2020-12-16T04:05:10
| 25,975,369
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,570
|
java
|
/*
* @lc app=leetcode id=454 lang=java
*
* [454] 4Sum II
*
* https://leetcode.com/problems/4sum-ii/description/
*
* algorithms
* Medium (53.83%)
* Total Accepted: 129.4K
* Total Submissions: 240.3K
* Testcase Example: '[1,2]\n[-2,-1]\n[-1,2]\n[0,2]'
*
* Given four lists A, B, C, D of integer values, compute how many tuples (i,
* j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero.
*
* To make problem a bit easier, all A, B, C, D have same length of N where 0 ≤
* N ≤ 500. All integers are in the range of -2^28 to 2^28 - 1 and the result
* is guaranteed to be at most 2^31 - 1.
*
* Example:
*
*
* Input:
* A = [ 1, 2]
* B = [-2,-1]
* C = [-1, 2]
* D = [ 0, 2]
*
* Output:
* 2
*
* Explanation:
* The two tuples are:
* 1. (0, 0, 0, 1) -> A[0] + B[0] + C[0] + D[1] = 1 + (-2) + (-1) + 2 = 0
* 2. (1, 1, 0, 0) -> A[1] + B[1] + C[0] + D[0] = 2 + (-1) + (-1) + 0 = 0
*
*
*
*
*/
class Solution {
public int fourSumCount(int[] A, int[] B, int[] C, int[] D) {
Map<Long, Integer> map = new HashMap<>();
int ans = 0;
Arrays.sort(D);
for (int i = 0; i < A.length; i++)
for (int j = 0; j < B.length; j++) {
long x= 0l + A[i] + B[j];
map.put(x, map.getOrDefault(x, 0) + 1);
}
for (int i = 0; i < C.length; i++)
for (int j = 0; j < D.length; j++) {
long x = 0l + C[i] + D[j];
ans += map.getOrDefault(-x, 0);
}
return ans;
}
}
|
[
"lianglee@amazon.com"
] |
lianglee@amazon.com
|
f950601fc3e2294cd3970f199d8990dadf11e551
|
7016cec54fb7140fd93ed805514b74201f721ccd
|
/src/java/com/echothree/control/user/chain/server/command/GetChainTypesCommand.java
|
a2dc0b6e13ec958800ac662701bcbf12755c69e8
|
[
"MIT",
"Apache-1.1",
"Apache-2.0"
] |
permissive
|
echothreellc/echothree
|
62fa6e88ef6449406d3035de7642ed92ffb2831b
|
bfe6152b1a40075ec65af0880dda135350a50eaf
|
refs/heads/master
| 2023-09-01T08:58:01.429249
| 2023-08-21T11:44:08
| 2023-08-21T11:44:08
| 154,900,256
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,963
|
java
|
// --------------------------------------------------------------------------------
// Copyright 2002-2023 Echo Three, 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 com.echothree.control.user.chain.server.command;
import com.echothree.control.user.chain.common.form.GetChainTypesForm;
import com.echothree.control.user.chain.common.result.ChainResultFactory;
import com.echothree.control.user.chain.common.result.GetChainTypesResult;
import com.echothree.model.control.chain.server.control.ChainControl;
import com.echothree.model.control.party.common.PartyTypes;
import com.echothree.model.control.security.common.SecurityRoleGroups;
import com.echothree.model.control.security.common.SecurityRoles;
import com.echothree.model.data.chain.server.entity.ChainKind;
import com.echothree.model.data.user.common.pk.UserVisitPK;
import com.echothree.util.common.message.ExecutionErrors;
import com.echothree.util.common.validation.FieldDefinition;
import com.echothree.util.common.validation.FieldType;
import com.echothree.util.common.command.BaseResult;
import com.echothree.util.server.control.BaseSimpleCommand;
import com.echothree.util.server.control.CommandSecurityDefinition;
import com.echothree.util.server.control.PartyTypeDefinition;
import com.echothree.util.server.control.SecurityRoleDefinition;
import com.echothree.util.server.persistence.Session;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class GetChainTypesCommand
extends BaseSimpleCommand<GetChainTypesForm> {
private final static CommandSecurityDefinition COMMAND_SECURITY_DEFINITION;
private final static List<FieldDefinition> FORM_FIELD_DEFINITIONS;
static {
COMMAND_SECURITY_DEFINITION = new CommandSecurityDefinition(Collections.unmodifiableList(Arrays.asList(
new PartyTypeDefinition(PartyTypes.UTILITY.name(), null),
new PartyTypeDefinition(PartyTypes.EMPLOYEE.name(), Collections.unmodifiableList(Arrays.asList(
new SecurityRoleDefinition(SecurityRoleGroups.ChainType.name(), SecurityRoles.List.name())
)))
)));
FORM_FIELD_DEFINITIONS = Collections.unmodifiableList(Arrays.asList(
new FieldDefinition("ChainKindName", FieldType.ENTITY_NAME, true, null, null)
));
}
/** Creates a new instance of GetChainTypesCommand */
public GetChainTypesCommand(UserVisitPK userVisitPK, GetChainTypesForm form) {
super(userVisitPK, form, COMMAND_SECURITY_DEFINITION, FORM_FIELD_DEFINITIONS, true);
}
@Override
protected BaseResult execute() {
var chainControl = Session.getModelController(ChainControl.class);
GetChainTypesResult result = ChainResultFactory.getGetChainTypesResult();
String chainKindName = form.getChainKindName();
ChainKind chainKind = chainControl.getChainKindByName(chainKindName);
if(chainKind != null) {
result.setChainKind(chainControl.getChainKindTransfer(getUserVisit(), chainKind));
result.setChainTypes(chainControl.getChainTypeTransfersByChainKind(getUserVisit(), chainKind));
} else {
addExecutionError(ExecutionErrors.UnknownChainKindName.name(), chainKindName);
}
return result;
}
}
|
[
"rich@echothree.com"
] |
rich@echothree.com
|
c59707547e77f3d1c128a25ce4e397de14b8087b
|
522370099e803b14d016abaa2db03490284f20eb
|
/src/main/java/com/tencentcloudapi/captcha/v20190722/models/DescribeCaptchaResultResponse.java
|
72530cd0c8d0723c000fb0dfb13eadb250c2443d
|
[
"Apache-2.0"
] |
permissive
|
diaolingzc/tencentcloud-sdk-java
|
65277f6631d9d50cfc361f3f8b9401b689e0fbeb
|
677fa638f037d69963751d48f055997911572c77
|
refs/heads/master
| 2020-09-03T09:42:09.778129
| 2019-11-05T11:42:29
| 2019-11-05T11:42:29
| 219,438,072
| 0
| 0
|
Apache-2.0
| 2019-11-04T07:04:16
| 2019-11-04T07:04:16
| null |
UTF-8
|
Java
| false
| false
| 8,824
|
java
|
/*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tencentcloudapi.captcha.v20190722.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class DescribeCaptchaResultResponse extends AbstractModel{
/**
* 1 OK 验证通过
6 user code len error 验证码长度不匹配
7 captcha no match 验证码答案不匹配/Randstr参数不匹配
8 verify timeout 验证码签名超时
9 Sequnce repeat 验证码签名重放
10 Sequnce invalid 验证码签名序列
11 Cookie invalid 验证码cooking信息不合法
12 sig len error 签名长度错误
13 verify ip no match ip不匹配
15 decrypt fail 验证码签名解密失败
16 appid no match 验证码强校验appid错误
17 cmd no much 验证码系统命令不匹配
18 uin no match 号码不匹配
19 seq redirect 重定向验证
20 opt no vcode 操作使用pt免验证码校验错误
21 diff 差别,验证错误
22 captcha type not match 验证码类型与拉取时不一致
23 verify type error 验证类型错误
24 invalid pkg 非法请求包
25 bad visitor 策略拦截
26 system busy 系统内部错误
100 param err appsecretkey 参数校验错误
*/
@SerializedName("CaptchaCode")
@Expose
private Long CaptchaCode;
/**
* 状态描述及验证错误信息
注意:此字段可能返回 null,表示取不到有效值。
*/
@SerializedName("CaptchaMsg")
@Expose
private String CaptchaMsg;
/**
* [0,100],恶意等级
注意:此字段可能返回 null,表示取不到有效值。
*/
@SerializedName("EvilLevel")
@Expose
private Long EvilLevel;
/**
* 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
@SerializedName("RequestId")
@Expose
private String RequestId;
/**
* 获取1 OK 验证通过
6 user code len error 验证码长度不匹配
7 captcha no match 验证码答案不匹配/Randstr参数不匹配
8 verify timeout 验证码签名超时
9 Sequnce repeat 验证码签名重放
10 Sequnce invalid 验证码签名序列
11 Cookie invalid 验证码cooking信息不合法
12 sig len error 签名长度错误
13 verify ip no match ip不匹配
15 decrypt fail 验证码签名解密失败
16 appid no match 验证码强校验appid错误
17 cmd no much 验证码系统命令不匹配
18 uin no match 号码不匹配
19 seq redirect 重定向验证
20 opt no vcode 操作使用pt免验证码校验错误
21 diff 差别,验证错误
22 captcha type not match 验证码类型与拉取时不一致
23 verify type error 验证类型错误
24 invalid pkg 非法请求包
25 bad visitor 策略拦截
26 system busy 系统内部错误
100 param err appsecretkey 参数校验错误
* @return CaptchaCode 1 OK 验证通过
6 user code len error 验证码长度不匹配
7 captcha no match 验证码答案不匹配/Randstr参数不匹配
8 verify timeout 验证码签名超时
9 Sequnce repeat 验证码签名重放
10 Sequnce invalid 验证码签名序列
11 Cookie invalid 验证码cooking信息不合法
12 sig len error 签名长度错误
13 verify ip no match ip不匹配
15 decrypt fail 验证码签名解密失败
16 appid no match 验证码强校验appid错误
17 cmd no much 验证码系统命令不匹配
18 uin no match 号码不匹配
19 seq redirect 重定向验证
20 opt no vcode 操作使用pt免验证码校验错误
21 diff 差别,验证错误
22 captcha type not match 验证码类型与拉取时不一致
23 verify type error 验证类型错误
24 invalid pkg 非法请求包
25 bad visitor 策略拦截
26 system busy 系统内部错误
100 param err appsecretkey 参数校验错误
*/
public Long getCaptchaCode() {
return this.CaptchaCode;
}
/**
* 设置1 OK 验证通过
6 user code len error 验证码长度不匹配
7 captcha no match 验证码答案不匹配/Randstr参数不匹配
8 verify timeout 验证码签名超时
9 Sequnce repeat 验证码签名重放
10 Sequnce invalid 验证码签名序列
11 Cookie invalid 验证码cooking信息不合法
12 sig len error 签名长度错误
13 verify ip no match ip不匹配
15 decrypt fail 验证码签名解密失败
16 appid no match 验证码强校验appid错误
17 cmd no much 验证码系统命令不匹配
18 uin no match 号码不匹配
19 seq redirect 重定向验证
20 opt no vcode 操作使用pt免验证码校验错误
21 diff 差别,验证错误
22 captcha type not match 验证码类型与拉取时不一致
23 verify type error 验证类型错误
24 invalid pkg 非法请求包
25 bad visitor 策略拦截
26 system busy 系统内部错误
100 param err appsecretkey 参数校验错误
* @param CaptchaCode 1 OK 验证通过
6 user code len error 验证码长度不匹配
7 captcha no match 验证码答案不匹配/Randstr参数不匹配
8 verify timeout 验证码签名超时
9 Sequnce repeat 验证码签名重放
10 Sequnce invalid 验证码签名序列
11 Cookie invalid 验证码cooking信息不合法
12 sig len error 签名长度错误
13 verify ip no match ip不匹配
15 decrypt fail 验证码签名解密失败
16 appid no match 验证码强校验appid错误
17 cmd no much 验证码系统命令不匹配
18 uin no match 号码不匹配
19 seq redirect 重定向验证
20 opt no vcode 操作使用pt免验证码校验错误
21 diff 差别,验证错误
22 captcha type not match 验证码类型与拉取时不一致
23 verify type error 验证类型错误
24 invalid pkg 非法请求包
25 bad visitor 策略拦截
26 system busy 系统内部错误
100 param err appsecretkey 参数校验错误
*/
public void setCaptchaCode(Long CaptchaCode) {
this.CaptchaCode = CaptchaCode;
}
/**
* 获取状态描述及验证错误信息
注意:此字段可能返回 null,表示取不到有效值。
* @return CaptchaMsg 状态描述及验证错误信息
注意:此字段可能返回 null,表示取不到有效值。
*/
public String getCaptchaMsg() {
return this.CaptchaMsg;
}
/**
* 设置状态描述及验证错误信息
注意:此字段可能返回 null,表示取不到有效值。
* @param CaptchaMsg 状态描述及验证错误信息
注意:此字段可能返回 null,表示取不到有效值。
*/
public void setCaptchaMsg(String CaptchaMsg) {
this.CaptchaMsg = CaptchaMsg;
}
/**
* 获取[0,100],恶意等级
注意:此字段可能返回 null,表示取不到有效值。
* @return EvilLevel [0,100],恶意等级
注意:此字段可能返回 null,表示取不到有效值。
*/
public Long getEvilLevel() {
return this.EvilLevel;
}
/**
* 设置[0,100],恶意等级
注意:此字段可能返回 null,表示取不到有效值。
* @param EvilLevel [0,100],恶意等级
注意:此字段可能返回 null,表示取不到有效值。
*/
public void setEvilLevel(Long EvilLevel) {
this.EvilLevel = EvilLevel;
}
/**
* 获取唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
* @return RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
public String getRequestId() {
return this.RequestId;
}
/**
* 设置唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
* @param RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
public void setRequestId(String RequestId) {
this.RequestId = RequestId;
}
/**
* 内部实现,用户禁止调用
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "CaptchaCode", this.CaptchaCode);
this.setParamSimple(map, prefix + "CaptchaMsg", this.CaptchaMsg);
this.setParamSimple(map, prefix + "EvilLevel", this.EvilLevel);
this.setParamSimple(map, prefix + "RequestId", this.RequestId);
}
}
|
[
"tencentcloudapi@tencent.com"
] |
tencentcloudapi@tencent.com
|
929451365610da79443ffa08a479ad3f46c5fbb7
|
dcb62e7d8c9e84791860c4ae5b6d4208a94c0325
|
/dice-server/framework/src/main/java/com/bihell/dice/framework/core/pagination/PageInfo.java
|
d5915a3948b5c77ad66953e588c7ed7008a9007a
|
[
"MIT"
] |
permissive
|
zhen-one/Dice
|
cf2ea160df641b17fb261c31fd2a04707eec7ed8
|
1f925ece7e20891cd2c2d90125f1ea25cd8071cf
|
refs/heads/master
| 2023-03-13T23:45:45.314292
| 2021-03-04T15:00:52
| 2021-03-04T15:00:52
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,771
|
java
|
package com.bihell.dice.framework.core.pagination;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.commons.collections4.CollectionUtils;
import java.util.Arrays;
import java.util.List;
/**
* 自定义分页参数 todo
**/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class PageInfo<T> extends Page<T> {
private static final long serialVersionUID = -2211095086394170578L;
/**
* 分页参数
*/
private BasePageParam pageParam;
/**
* 默认排序字段信息
*/
private OrderItem defaultOrderItem;
/**
* 排序字段映射
*/
private OrderMapping orderMapping;
public PageInfo() {
}
/**
* 传入分页参数
*
* @param pageParam
*/
public PageInfo(BasePageParam pageParam) {
this(pageParam, null, null);
}
/**
* 传入分页参数,默认排序
*
* @param basePageParam
* @param defaultOrderItem
*/
public PageInfo(BasePageParam basePageParam, OrderItem defaultOrderItem) {
this(basePageParam, defaultOrderItem, null);
}
/**
* 传入分页参数,排序字段映射
*
* @param pageParam
* @param orderMapping
*/
public PageInfo(BasePageParam pageParam, OrderMapping orderMapping) {
this(pageParam, null, orderMapping);
}
/**
* 传入分页参数,默认排序,排序字段映射
*
* @param pageParam
* @param defaultOrderItem
* @param orderMapping
*/
public PageInfo(BasePageParam pageParam, OrderItem defaultOrderItem, OrderMapping orderMapping) {
this.pageParam = pageParam;
this.defaultOrderItem = defaultOrderItem;
this.orderMapping = orderMapping;
this.handle();
}
/**
* 分页构造函数
*
* @param current 当前页
* @param size 每页显示条数
*/
public PageInfo(long current, long size) {
super(current, size, 0);
}
public PageInfo(long current, long size, long total) {
super(current, size, total, true);
}
public PageInfo(long current, long size, boolean isSearchCount) {
super(current, size, isSearchCount);
}
public PageInfo(long current, long size, long total, boolean isSearchCount) {
super(current, size, total, isSearchCount);
}
/**
* 如果是pageParam是OrderPageParam,并且不为空,则使用前端排序
* 否则使用默认排序
*/
private void handle() {
if (pageParam == null) {
return;
}
// 设置pageIndex/pageSize
super.setCurrent(pageParam.getPageIndex());
super.setSize(pageParam.getPageSize());
// 排序字段处理
BasePageOrderParam basePageOrderParam = (BasePageOrderParam) pageParam;
List<OrderItem> orderItems = basePageOrderParam.getPageSorts();
if (CollectionUtils.isEmpty(orderItems)) {
setDefaultOrder(defaultOrderItem);
return;
}
if (orderMapping == null) {
orderMapping = new OrderMapping(true);
}
orderMapping.filterOrderItems(orderItems);
super.setOrders(orderItems);
}
/**
* 设置默认排序
*
* @param defaultOrderItem
* @return
*/
public PageInfo<T> setDefaultOrder(OrderItem defaultOrderItem) {
if (defaultOrderItem != null) {
this.defaultOrderItem = defaultOrderItem;
super.setOrders(Arrays.asList(defaultOrderItem));
}
return this;
}
}
|
[
"tpxcer@outlook.com"
] |
tpxcer@outlook.com
|
869526115c154abaa0817b955efcc538beb7760d
|
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
|
/data_defect4j/preprossed_method_corpus/Math/69/org/apache/commons/math/linear/MatrixUtils_deserializeRealMatrix_918.java
|
a38e3818ab94ccbd7d190092563ad1859282c434
|
[] |
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
| 2,310
|
java
|
org apach common math linear
collect method oper matric
version revis date
matrix util matrixutil
deseri link real matrix realmatrix field
method intend call
code read object readobject code method call
code oi read object defaultreadobject code
link real matrix realmatrix field declar code code
handl deseri matrix link
real matrix realmatrix serializ method
deseri specif
param instanc instanc field set
param field fieldnam field
param oi stream real matrix read
except class found except classnotfoundexcept stream found
except except ioexcept object read stream
serial real matrix serializerealmatrix real matrix realmatrix object output stream objectoutputstream
deseri real matrix deserializerealmatrix object instanc
string field fieldnam
object input stream objectinputstream oi
class found except classnotfoundexcept except ioexcept
read matrix data
oi read int readint
oi read int readint
data
data datai data
data datai oi read doubl readdoubl
creat instanc
real matrix realmatrix matrix array2 row real matrix array2drowrealmatrix data
set field
java lang reflect field
instanc class getclass declar field getdeclaredfield field fieldnam
set access setaccess
set instanc matrix
field except nosuchfieldexcept nsfe
except ioexcept ioe except ioexcept
ioe init initcaus nsfe
ioe
illeg access except illegalaccessexcept iae
except ioexcept ioe except ioexcept
ioe init initcaus iae
ioe
|
[
"hvdthong@gmail.com"
] |
hvdthong@gmail.com
|
5e72cea73f28ae5fc48f692d7c7eb8d29685b363
|
a7807ae90a020e8d525bd008156df74267bfb6c6
|
/org.kybele.cevinedit.model.editor/src/org/cevinedit/editor/view/dialogs/EClassTransforms.java
|
13245e02e59f02ac975ae028fba7a8a85c2200d8
|
[] |
no_license
|
AngelMorenoMDE/cevinedit
|
15f52c5858483763c29b38a0be3701f6fd1c7192
|
8c672066d27ea32662baa2574b8ce8166ce668ea
|
refs/heads/master
| 2016-09-01T13:00:06.266466
| 2016-03-02T10:21:59
| 2016-03-02T10:21:59
| 52,945,766
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 224
|
java
|
package org.cevinedit.editor.view.dialogs;
public class EClassTransforms {
public static final int EClassToDiagram = 0;
public static final int EClassToNode = 1;
public static final int EClassToLink = 2;
}
|
[
"a.morenoper@gmail.com"
] |
a.morenoper@gmail.com
|
cb37d1bf88d8d173c557e5b1d1237951e0101955
|
3899cb8e37ff868d29053e97a36a4a843655edc0
|
/java1pcurs2/Exemplu26.java
|
222bbfe8c871c66720c6bb85e0175777e21a8c3c
|
[] |
no_license
|
laurentiuspilca/java1p_13_martie_2018
|
05df83bd3c7538bb3c91d683189b5ceb319dcdf2
|
4f7d2b95639bcaf8299df0d302db84609963da5e
|
refs/heads/master
| 2021-04-03T05:10:29.064419
| 2018-05-08T18:33:25
| 2018-05-08T18:33:25
| 125,103,926
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 372
|
java
|
import java.nio.file.*;
import java.util.*;
public class Exemplu26 {
public static void main(String [] args) {
Path p1 = Paths.get("Exemplu26.java");
try {
List<String> lines = Files.readAllLines(p1);
lines.forEach(p -> System.out.println(p));
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
[
"laur.spilca@gmail.com"
] |
laur.spilca@gmail.com
|
fb8318f8fb150a8e185036e2e335f99f07c19654
|
78c24aae9a1d334f85287cfbbc85dc6c36c148fb
|
/src/main/java/class933.java
|
fae7d9e542419422f7539724307f7c5ed2035fff
|
[] |
no_license
|
jjordantb/bliss
|
4cdfb563482df71df820c2cbdbbaaf772d8de658
|
72580e09bcbd897567405eac7a93333fce28f958
|
refs/heads/master
| 2020-04-10T18:56:44.939402
| 2018-12-14T18:15:54
| 2018-12-14T18:15:54
| 161,218,036
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,445
|
java
|
public class class933 {
public int field10324;
public int field10325;
public int field10326;
public int field10327;
public int field10328;
public class933 field10329;
public int field10330;
public int field10332;
public byte field10333;
public int field10334;
public int field10335;
public int field10336;
public int field10337;
public int field10338;
int field10331;
class933(int var1, int var2, int var3, int var4, byte var5) {
this.field10331 = var1;
this.field10326 = var2;
this.field10327 = var3;
this.field10328 = var4;
this.field10333 = var5;
}
public static class453 method6286(int var0) {
try {
if (class889.field9235 == null) {
throw new IllegalStateException("");
} else {
return class889.field9235;
}
} catch (RuntimeException var2) {
throw class158.method3445(var2, "dl.f(" + ')');
}
}
static final void method6287(class744 var0, byte var1) {
try {
var0.field3161[++var0.field3156 - 1] = var0.field3159.field4096;
} catch (RuntimeException var3) {
throw class158.method3445(var3, "dl.aow(" + ')');
}
}
static final void method6288(int var0) {
try {
class881.field10146 = -1L;
class881.field10183 = 0L;
class881.field10145 = -1;
} catch (RuntimeException var2) {
throw class158.method3445(var2, "dl.p(" + ')');
}
}
public static void method6289(int var0, int var1, byte var2) {
try {
class682 var3 = class370.method881(19, (long) var1 << 32 | (long) var0);
var3.method4336(-1669117818);
} catch (RuntimeException var4) {
throw class158.method3445(var4, "dl.ad(" + ')');
}
}
public class114 method6284(int var1) {
try {
return class980.method1912(this.field10331, 675004457);
} catch (RuntimeException var3) {
throw class158.method3445(var3, "dl.a(" + ')');
}
}
class933 method6285(int var1, int var2, int var3, int var4) {
try {
return new class933(this.field10331, var1, var2, var3, this.field10333);
} catch (RuntimeException var6) {
throw class158.method3445(var6, "dl.f(" + ')');
}
}
}
|
[
"jordan.florchinger@uleth.ca"
] |
jordan.florchinger@uleth.ca
|
6b2640be015165d1a773b2888147b75f50d126fc
|
799385037ae43ec5ba05544005e11d5b0fdddcba
|
/com/company/Collection/EnumSetMy.java
|
70a70a65a4db2265d3147b3851c67f9f1ee8ff69
|
[] |
no_license
|
AnatolSich/Java_Home
|
27b298217a851637589901c084c9e9b6ec1b5c5c
|
965e87996fb136110292f22c92b52677ffb362e2
|
refs/heads/master
| 2021-09-18T01:01:33.755962
| 2018-07-07T18:59:24
| 2018-07-07T18:59:24
| 106,386,857
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,402
|
java
|
package com.company.Collection;
/**
* Created by Toll on 14.06.2017.
*/
import java.util.EnumSet;
import java.util.Set;
/**
* Simple Java Program to demonstrate how to use EnumSet.
* It has some interesting use cases and it's specialized collection for
* Enumeration types. Using Enum with EnumSet will give you far better
* performance than using Enum with HashSet, or LinkedHashSet.
*
* @author Javin Paul
*/
public class EnumSetMy {
private enum Color {
RED(255, 0, 0), GREEN(0, 255, 0), BLUE(0, 0, 255);
private int r;
private int g;
private int b;
private Color(int r, int g, int b) {
this.r = r;
this.g = g;
this.b = b;
}
public int getR() {
return r;
}
public int getG() {
return g;
}
public int getB() {
return b;
}
}
private enum Color2 {
RED(0), GREEN(1), BLUE(2);
private int r;
Color2(int r) {
this.r = r;
}
}
public static void main(String args[]) {
for (Color color : Color.values()) {
System.out.println(color);
}
for (Color2 color : Color2.values()) {
System.out.println(color);
}
// this will draw line in yellow color
EnumSet<Color> yellow = EnumSet.of(Color.RED, Color.GREEN);
drawLine(yellow);
// RED + GREEN + BLUE = WHITE
EnumSet<Color> white = EnumSet.of(Color.RED, Color.GREEN, Color.BLUE);
drawLine(white);
// RED + BLUE = PINK
EnumSet<Color> pink = EnumSet.of(Color.RED, Color.BLUE);
drawLine(pink);
}
public static void drawLine(Set<Color> colors) {
System.out.println("Requested Colors to draw lines : " + colors);
for (Color c : colors) {
System.out.println("drawing line in color : " + c);
}
}
}
/*Output:
Requested Colors to draw lines : [RED, GREEN]
drawing line in color : RED
drawing line in color : GREEN
Requested Colors to draw lines : [RED, GREEN, BLUE]
drawing line in color : RED
drawing line in color : GREEN
drawing line in color : BLUE
Requested Colors to draw lines : [RED, BLUE]
drawing line in color : RED
drawing line in color : BLUE*/
|
[
"tip-77@ukr.net"
] |
tip-77@ukr.net
|
81ff7a47f17d03b26a35c3ae78ddcd6015b45496
|
66e2f35b7b56865552616cf400e3a8f5928d12a2
|
/src/main/java/com/alipay/api/domain/KbAdvertAdvSingleVoucherResponse.java
|
61912f01c4ba34dfb711dd233444b970d41899dc
|
[
"Apache-2.0"
] |
permissive
|
xiafaqi/alipay-sdk-java-all
|
18dc797400847c7ae9901566e910527f5495e497
|
606cdb8014faa3e9125de7f50cbb81b2db6ee6cc
|
refs/heads/master
| 2022-11-25T08:43:11.997961
| 2020-07-23T02:58:22
| 2020-07-23T02:58:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,493
|
java
|
package com.alipay.api.domain;
import java.util.List;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
/**
* 口碑广告系统推广详情(单张券)
*
* @author auto create
* @since 1.0, 2017-01-16 16:13:33
*/
public class KbAdvertAdvSingleVoucherResponse extends AlipayObject {
private static final long serialVersionUID = 6515774738197756779L;
/**
* 广告内容模型
*/
@ApiListField("adv_content_list")
@ApiField("kb_advert_adv_content_response")
private List<KbAdvertAdvContentResponse> advContentList;
/**
* 广告内容(广告内容请使用新的属性adv_content_list,此属性仍会保留)
*/
@ApiField("content")
private KbAdvertAdvContent content;
/**
* 券标的
*/
@ApiField("voucher")
private KbAdvertSubjectVoucherResponse voucher;
public List<KbAdvertAdvContentResponse> getAdvContentList() {
return this.advContentList;
}
public void setAdvContentList(List<KbAdvertAdvContentResponse> advContentList) {
this.advContentList = advContentList;
}
public KbAdvertAdvContent getContent() {
return this.content;
}
public void setContent(KbAdvertAdvContent content) {
this.content = content;
}
public KbAdvertSubjectVoucherResponse getVoucher() {
return this.voucher;
}
public void setVoucher(KbAdvertSubjectVoucherResponse voucher) {
this.voucher = voucher;
}
}
|
[
"ben.zy@antfin.com"
] |
ben.zy@antfin.com
|
4e71385961780b05b8098b7e4c51062ba0b7c54e
|
865880792752ebdc28293cbcd85f19a8c847d215
|
/BLM103_2017_2018_Guz/src/Ders12/Ornek1.java
|
54f8833e2e9ec9cc6cb7fb3b3b88cd2ac9eaecff
|
[] |
no_license
|
alinizam/FSM_BLM103_2017_2018Guz
|
6f879388fc480f76be4a9fb6d700335c83100689
|
8e5e8cf4eeabbbc23f96431e1a59ea5769e452da
|
refs/heads/master
| 2021-09-01T09:44:31.269967
| 2017-12-26T09:12:15
| 2017-12-26T09:12:15
| 104,714,609
| 14
| 5
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,041
|
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Ders12;
/**
*
* @author anizam
*/
public class Ornek1 extends javax.swing.JFrame {
/**
* Creates new form Ornek1
*/
public Ornek1() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
txtSonuc = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("Say?: ");
jButton1.setText("1");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("2");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton3.setText("3");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jButton4.setText("+");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtSonuc, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(98, 98, 98))
.addGroup(layout.createSequentialGroup()
.addGap(115, 115, 115)
.addComponent(jButton1)
.addGap(18, 18, 18)
.addComponent(jButton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton3)
.addGap(14, 14, 14)
.addComponent(jButton4)
.addContainerGap(85, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(76, 76, 76)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton2)
.addComponent(jButton3)
.addComponent(jButton4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 79, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtSonuc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addGap(102, 102, 102))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
txtSonuc.setText(txtSonuc.getText()+"1");
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
txtSonuc.setText(txtSonuc.getText()+"2");
}//GEN-LAST:event_jButton2ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
// TODO add your handling code here:
txtSonuc.setText(txtSonuc.getText()+"3");
}//GEN-LAST:event_jButton3ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Ornek1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Ornek1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Ornek1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Ornek1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Ornek1().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JLabel jLabel1;
private javax.swing.JTextField txtSonuc;
// End of variables declaration//GEN-END:variables
}
|
[
"alinizam99@gmail.com"
] |
alinizam99@gmail.com
|
0ceff7bbc41452645c25f2a4dbfac5f5f13e9b8c
|
1ce518b09521578e26e79a1beef350e7485ced8c
|
/source/app/src/main/java/com/flipkart/android/customwidget/FlippedStateWidget.java
|
c1c6db5102fa1e77750e186edc273a26b9a4f9a3
|
[] |
no_license
|
yash2710/AndroidStudioProjects
|
7180eb25e0f83d3f14db2713cd46cd89e927db20
|
e8ba4f5c00664f9084f6154f69f314c374551e51
|
refs/heads/master
| 2021-01-10T01:15:07.615329
| 2016-04-03T09:19:01
| 2016-04-03T09:19:01
| 55,338,306
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,577
|
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.flipkart.android.customwidget;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.android.volley.toolbox.ImageLoader;
import com.flipkart.android.response.component.data.WidgetItem;
import com.flipkart.android.response.component.data.customvalues.Action;
import com.flipkart.android.response.component.layout.LayoutDetails;
import com.flipkart.android.utils.ScreenMathUtils;
import java.util.ArrayList;
import java.util.Map;
public class FlippedStateWidget extends LinearLayout
{
public static final String WIDGET_COMMON_NAME = "ANNOUNCEMENT";
private android.view.View.OnClickListener clickListner;
private Context context;
private ImageLoader imageLoader;
private ArrayList items;
private LayoutDetails layoutDetails;
String requestId;
private int screenDpi;
private int screenWidth;
private long timeStamp;
private int widgetHeight;
public FlippedStateWidget(Context context1)
{
super(context1);
items = null;
widgetHeight = 0;
screenDpi = 320;
timeStamp = -1L;
imageLoader = null;
}
public FlippedStateWidget(Context context1, LayoutDetails layoutdetails, BaseWidget.WidgetTheme widgettheme, android.view.View.OnClickListener onclicklistener, WidgetItem widgetitem, ArrayList arraylist, ImageLoader imageloader)
{
super(context1);
items = null;
widgetHeight = 0;
screenDpi = 320;
timeStamp = -1L;
imageLoader = null;
context = context1;
items = arraylist;
clickListner = onclicklistener;
imageLoader = imageloader;
if (arraylist != null && arraylist.size() > 0)
{
screenWidth = getResources().getDisplayMetrics().widthPixels;
screenDpi = ScreenMathUtils.getScreenDpi(context1);
setOrientation(1);
addView(getWidgetView(arraylist));
}
}
private void addRequestIdToActionParamsExplicitly(Action action)
{
action.getParams().put("REQUEST_ID", requestId);
}
private android.widget.RelativeLayout.LayoutParams setCustomRelativeLayoutParams(int i, boolean flag)
{
android.widget.RelativeLayout.LayoutParams layoutparams = new android.widget.RelativeLayout.LayoutParams(-2, -2);
if (flag)
{
layoutparams.addRule(12);
layoutparams.addRule(14);
}
return layoutparams;
}
private void setHeading(Action action, int i)
{
if (action != null)
{
Map map = action.getParams();
if (map != null)
{
map.put("position", Integer.valueOf(i + 1));
}
action.setParams(map);
}
}
public long getTimeStamp()
{
return timeStamp;
}
public LinearLayout getWidgetView(ArrayList arraylist)
{
WidgetItem widgetitem = (WidgetItem)items.get(0);
if (widgetitem != null)
{
setHeading(widgetitem.getAction(), 0);
addRequestIdToActionParamsExplicitly(widgetitem.getAction());
LinearLayout linearlayout = (LinearLayout)((Activity)context).getLayoutInflater().inflate(0x7f030048, null);
((ImageView)linearlayout.findViewById(0x7f0a00ec)).setOnClickListener(clickListner);
((LinearLayout)linearlayout.findViewById(0x7f0a00ed)).setOnClickListener(clickListner);
((Button)linearlayout.findViewById(0x7f0a00ef)).setOnClickListener(clickListner);
((LinearLayout)linearlayout.findViewById(0x7f0a00f0)).setOnClickListener(clickListner);
return linearlayout;
} else
{
return null;
}
}
public void setTimeStamp(long l)
{
timeStamp = l;
}
public void updateView(ArrayList arraylist, LayoutDetails layoutdetails, android.view.View.OnClickListener onclicklistener, long l, ImageLoader imageloader, String s)
{
items = arraylist;
clickListner = onclicklistener;
timeStamp = l;
imageLoader = imageloader;
requestId = s;
layoutDetails = layoutdetails;
}
}
|
[
"13bce123@nirmauni.ac.in"
] |
13bce123@nirmauni.ac.in
|
b3b3bb91e297e58c98514c5e292766c734ce6e3c
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/single-large-project/src/test/java/org/gradle/test/performancenull_167/Testnull_16686.java
|
b36b973f38168f572f1ddf66eff9434f237f254d
|
[] |
no_license
|
gradle/performance-comparisons
|
b0d38db37c326e0ce271abebdb3c91769b860799
|
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
|
refs/heads/master
| 2023-08-14T19:24:39.164276
| 2022-11-24T05:18:33
| 2022-11-24T05:18:33
| 80,121,268
| 17
| 15
| null | 2022-09-30T08:04:35
| 2017-01-26T14:25:33
| null |
UTF-8
|
Java
| false
| false
| 308
|
java
|
package org.gradle.test.performancenull_167;
import static org.junit.Assert.*;
public class Testnull_16686 {
private final Productionnull_16686 production = new Productionnull_16686("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
}
|
[
"cedric.champeau@gmail.com"
] |
cedric.champeau@gmail.com
|
1008183f6cd5a93343a07de8ae71e11cf4f63b9a
|
37cbb9e3eb8b58734ebeb4a088dc63ddc224d6a1
|
/evaluation/fop-0.95/src/java/org/apache/fop/fo/expr/FunctionBase.java
|
504e07fc4023534a30ec5a39a1bfb4592c49f5ee
|
[
"Apache-2.0",
"BSD-3-Clause"
] |
permissive
|
lu-cs-sde/IntraJSCAM2021
|
d4713c4488e763b55c241f8a249f56a8d168f45d
|
088cb8fdfb59748febbd0ffc54c8fabadab5c662
|
refs/heads/main
| 2023-04-15T11:50:42.418534
| 2023-02-06T09:21:54
| 2023-02-06T09:21:54
| 392,981,505
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,390
|
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.
*/
/* $Id: FunctionBase.java 426576 2006-07-28 15:44:37Z jeremias $ */
package org.apache.fop.fo.expr;
import org.apache.fop.datatypes.PercentBase;
/**
* Abstract Base class for XSL-FO functions
*/
public abstract class FunctionBase implements Function {
/**
* @return null (by default, functions have no percent-based arguments)
*/
public PercentBase getPercentBase() {
return null;
}
/**
* @return false (by default don't pad arglist with property-name)
*/
public boolean padArgsWithPropertyName() {
return false;
}
}
|
[
"riouakidriss@hotmail.it"
] |
riouakidriss@hotmail.it
|
21c144ce7c0507fa8f1596baec7287fa66d098d8
|
a0caa255f3dbe524437715adaee2094ac8eff9df
|
/HOLD/sources/defpackage/dab.java
|
e5eb962166796547ebe2f2e7e244b412d2c98a2f
|
[] |
no_license
|
AndroidTVDeveloper/com.google.android.tvlauncher
|
16526208b5b48fd48931b09ed702fe606fe7d694
|
0f959c41bbb5a93e981145f371afdec2b3e207bc
|
refs/heads/master
| 2021-01-26T07:47:23.091351
| 2020-02-26T20:58:19
| 2020-02-26T20:58:19
| 243,363,961
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 649
|
java
|
package defpackage;
import android.view.View;
import android.view.accessibility.AccessibilityNodeInfo;
/* renamed from: dab reason: default package */
/* compiled from: PG */
final class dab extends View.AccessibilityDelegate {
private final /* synthetic */ dad a;
public dab(dad dad) {
this.a = dad;
}
public final void onInitializeAccessibilityNodeInfo(View view, AccessibilityNodeInfo accessibilityNodeInfo) {
super.onInitializeAccessibilityNodeInfo(view, accessibilityNodeInfo);
accessibilityNodeInfo.setCollectionInfo(AccessibilityNodeInfo.CollectionInfo.obtain(this.a.a.size(), 0, false));
}
}
|
[
"eliminater74@gmail.com"
] |
eliminater74@gmail.com
|
27ae6ac4373b39729d31d60e82531a62d4a8cdd6
|
b5e0754317630ea0c1cd00d336bdae09bf779b40
|
/spring-cloud-gateway/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingIntegrationTests.java
|
1627bc5a32e19bccbace9b012393f5798158e835
|
[
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] |
permissive
|
lhj502819/Spring-Cloud-Gateway-2.2.6.RELEASE
|
3ade0df08acc2dd02d692d259e0e0c13d7ed3f47
|
337d836e4cc34a7816e817d642ccd23b29800596
|
refs/heads/main
| 2023-08-18T13:06:50.223151
| 2021-10-15T08:49:14
| 2021-10-15T08:49:14
| 350,910,529
| 3
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,782
|
java
|
/*
* Copyright 2013-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://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.springframework.cloud.gateway.handler;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.cloud.gateway.test.BaseWebClientTests;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.util.SocketUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = RANDOM_PORT,
properties = "management.server.port=${test.port}")
@DirtiesContext
public class RoutePredicateHandlerMappingIntegrationTests extends BaseWebClientTests {
private static int managementPort;
@BeforeClass
public static void beforeClass() {
managementPort = SocketUtils.findAvailableTcpPort();
System.setProperty("test.port", String.valueOf(managementPort));
}
@AfterClass
public static void afterClass() {
System.clearProperty("test.port");
}
@Test
public void requestsToManagementPortReturn404() {
testClient.mutate().baseUrl("http://localhost:" + managementPort).build().get()
.uri("/get").exchange().expectStatus().isNotFound();
}
@Test
public void andNotWorksWithMissingParameter() {
testClient.get().uri("/andnotquery").exchange().expectBody(String.class)
.isEqualTo("notsupplied");
}
@Test
public void andNotWorksWithParameter() {
testClient.get().uri("/andnotquery?myquery=shouldnotsee").exchange()
.expectBody(String.class).isEqualTo("hasquery");
}
@EnableAutoConfiguration
@SpringBootConfiguration
@Import(DefaultTestConfig.class)
@RestController
public static class TestConfig {
@Value("${test.uri:http://httpbin.org:80}")
String uri;
@GetMapping("/httpbin/andnotquery")
String andnotquery(@RequestParam(name = "myquery",
defaultValue = "notsupplied") String myquery) {
return myquery;
}
@GetMapping("/httpbin/hasquery")
String hasquery() {
return "hasquery";
}
@Bean
RouteLocator testRouteLocator(RouteLocatorBuilder builder) {
return builder.routes()
.route("and_not_missing_myquery",
r -> r.path("/andnotquery").and().not(p -> p.query("myquery"))
.filters(f -> f.prefixPath("/httpbin")).uri(uri))
.route("and_not_has_myquery",
r -> r.path("/andnotquery").and().query("myquery")
.filters(f -> f.setPath("/httpbin/hasquery"))
.uri(uri))
.build();
}
}
}
|
[
"lhj502819@163.com"
] |
lhj502819@163.com
|
63ee59df793e190e16751c018ce004e98da2f68b
|
5c318927e52bced5b44b34c6ee9de0c12b839f22
|
/absir-lang/src/main/java/com/absir/core/base/Base.java
|
075a832c4703b2294381751ec032dbba06f62f28
|
[
"Apache-2.0"
] |
permissive
|
linving/absir
|
5433e6fa7b38a21c6c05b83f840662aecb43dd90
|
6093620eda2071ff06df7f07eac09eca756b70c9
|
refs/heads/master
| 2020-04-06T04:19:13.726210
| 2015-07-22T05:39:21
| 2015-07-22T05:39:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 741
|
java
|
/**
* Copyright 2014 ABSir's Studio
*
* All right reserved
*
* Create on 2014-1-15 下午4:58:40
*/
package com.absir.core.base;
import java.io.Serializable;
import com.absir.core.kernel.KernelObject;
/**
* @author absir
*
*/
@SuppressWarnings("rawtypes")
public abstract class Base<ID extends Serializable> implements IBase<ID> {
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return KernelObject.hashCode(getId());
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
return obj != null && obj.getClass() == getClass() && KernelObject.equals(getId(), ((IBase) obj).getId());
}
}
|
[
"absir@qq.com"
] |
absir@qq.com
|
225f996da56cfc3bc6d9f05db9ba8a0713c958f2
|
471cd06a249f543a14ef415445b176eb76714650
|
/mcp/temp/src/minecraft/net/minecraft/scoreboard/ScoreboardSaveData.java
|
706975e753e8636810c15a1c9a9fa2997d236d0f
|
[
"BSD-3-Clause"
] |
permissive
|
Fredster777/ExploreCraft
|
ec3102d0dd86b1e9683c30ee7b181e8d0d04e063
|
db163ca7b40b1fd834d180c17cb8476c551a5540
|
refs/heads/master
| 2020-06-06T12:22:18.903600
| 2014-03-29T14:48:38
| 2014-03-29T14:48:38
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,406
|
java
|
package net.minecraft.scoreboard;
import java.util.Collection;
import java.util.Iterator;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.scoreboard.Score;
import net.minecraft.scoreboard.ScoreObjective;
import net.minecraft.scoreboard.ScoreObjectiveCriteria;
import net.minecraft.scoreboard.ScorePlayerTeam;
import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.WorldSavedData;
public class ScoreboardSaveData extends WorldSavedData {
private Scoreboard field_96507_a;
private NBTTagCompound field_96506_b;
public ScoreboardSaveData() {
this("scoreboard");
}
public ScoreboardSaveData(String p_i2310_1_) {
super(p_i2310_1_);
}
public void func_96499_a(Scoreboard p_96499_1_) {
this.field_96507_a = p_96499_1_;
if(this.field_96506_b != null) {
this.func_76184_a(this.field_96506_b);
}
}
public void func_76184_a(NBTTagCompound p_76184_1_) {
if(this.field_96507_a == null) {
this.field_96506_b = p_76184_1_;
} else {
this.func_96501_b(p_76184_1_.func_74761_m("Objectives"));
this.func_96500_c(p_76184_1_.func_74761_m("PlayerScores"));
if(p_76184_1_.func_74764_b("DisplaySlots")) {
this.func_96504_c(p_76184_1_.func_74775_l("DisplaySlots"));
}
if(p_76184_1_.func_74764_b("Teams")) {
this.func_96498_a(p_76184_1_.func_74761_m("Teams"));
}
}
}
protected void func_96498_a(NBTTagList p_96498_1_) {
for(int var2 = 0; var2 < p_96498_1_.func_74745_c(); ++var2) {
NBTTagCompound var3 = (NBTTagCompound)p_96498_1_.func_74743_b(var2);
ScorePlayerTeam var4 = this.field_96507_a.func_96527_f(var3.func_74779_i("Name"));
var4.func_96664_a(var3.func_74779_i("DisplayName"));
var4.func_96666_b(var3.func_74779_i("Prefix"));
var4.func_96662_c(var3.func_74779_i("Suffix"));
if(var3.func_74764_b("AllowFriendlyFire")) {
var4.func_96660_a(var3.func_74767_n("AllowFriendlyFire"));
}
if(var3.func_74764_b("SeeFriendlyInvisibles")) {
var4.func_98300_b(var3.func_74767_n("SeeFriendlyInvisibles"));
}
this.func_96502_a(var4, var3.func_74761_m("Players"));
}
}
protected void func_96502_a(ScorePlayerTeam p_96502_1_, NBTTagList p_96502_2_) {
for(int var3 = 0; var3 < p_96502_2_.func_74745_c(); ++var3) {
this.field_96507_a.func_96521_a(((NBTTagString)p_96502_2_.func_74743_b(var3)).field_74751_a, p_96502_1_);
}
}
protected void func_96504_c(NBTTagCompound p_96504_1_) {
for(int var2 = 0; var2 < 3; ++var2) {
if(p_96504_1_.func_74764_b("slot_" + var2)) {
String var3 = p_96504_1_.func_74779_i("slot_" + var2);
ScoreObjective var4 = this.field_96507_a.func_96518_b(var3);
this.field_96507_a.func_96530_a(var2, var4);
}
}
}
protected void func_96501_b(NBTTagList p_96501_1_) {
for(int var2 = 0; var2 < p_96501_1_.func_74745_c(); ++var2) {
NBTTagCompound var3 = (NBTTagCompound)p_96501_1_.func_74743_b(var2);
ScoreObjectiveCriteria var4 = (ScoreObjectiveCriteria)ScoreObjectiveCriteria.field_96643_a.get(var3.func_74779_i("CriteriaName"));
ScoreObjective var5 = this.field_96507_a.func_96535_a(var3.func_74779_i("Name"), var4);
var5.func_96681_a(var3.func_74779_i("DisplayName"));
}
}
protected void func_96500_c(NBTTagList p_96500_1_) {
for(int var2 = 0; var2 < p_96500_1_.func_74745_c(); ++var2) {
NBTTagCompound var3 = (NBTTagCompound)p_96500_1_.func_74743_b(var2);
ScoreObjective var4 = this.field_96507_a.func_96518_b(var3.func_74779_i("Objective"));
Score var5 = this.field_96507_a.func_96529_a(var3.func_74779_i("Name"), var4);
var5.func_96647_c(var3.func_74762_e("Score"));
}
}
public void func_76187_b(NBTTagCompound p_76187_1_) {
if(this.field_96507_a == null) {
MinecraftServer.func_71276_C().func_98033_al().func_98236_b("Tried to save scoreboard without having a scoreboard...");
} else {
p_76187_1_.func_74782_a("Objectives", this.func_96505_b());
p_76187_1_.func_74782_a("PlayerScores", this.func_96503_e());
p_76187_1_.func_74782_a("Teams", this.func_96496_a());
this.func_96497_d(p_76187_1_);
}
}
protected NBTTagList func_96496_a() {
NBTTagList var1 = new NBTTagList();
Collection var2 = this.field_96507_a.func_96525_g();
Iterator var3 = var2.iterator();
while(var3.hasNext()) {
ScorePlayerTeam var4 = (ScorePlayerTeam)var3.next();
NBTTagCompound var5 = new NBTTagCompound();
var5.func_74778_a("Name", var4.func_96661_b());
var5.func_74778_a("DisplayName", var4.func_96669_c());
var5.func_74778_a("Prefix", var4.func_96668_e());
var5.func_74778_a("Suffix", var4.func_96663_f());
var5.func_74757_a("AllowFriendlyFire", var4.func_96665_g());
var5.func_74757_a("SeeFriendlyInvisibles", var4.func_98297_h());
NBTTagList var6 = new NBTTagList();
Iterator var7 = var4.func_96670_d().iterator();
while(var7.hasNext()) {
String var8 = (String)var7.next();
var6.func_74742_a(new NBTTagString("", var8));
}
var5.func_74782_a("Players", var6);
var1.func_74742_a(var5);
}
return var1;
}
protected void func_96497_d(NBTTagCompound p_96497_1_) {
NBTTagCompound var2 = new NBTTagCompound();
boolean var3 = false;
for(int var4 = 0; var4 < 3; ++var4) {
ScoreObjective var5 = this.field_96507_a.func_96539_a(var4);
if(var5 != null) {
var2.func_74778_a("slot_" + var4, var5.func_96679_b());
var3 = true;
}
}
if(var3) {
p_96497_1_.func_74766_a("DisplaySlots", var2);
}
}
protected NBTTagList func_96505_b() {
NBTTagList var1 = new NBTTagList();
Collection var2 = this.field_96507_a.func_96514_c();
Iterator var3 = var2.iterator();
while(var3.hasNext()) {
ScoreObjective var4 = (ScoreObjective)var3.next();
NBTTagCompound var5 = new NBTTagCompound();
var5.func_74778_a("Name", var4.func_96679_b());
var5.func_74778_a("CriteriaName", var4.func_96680_c().func_96636_a());
var5.func_74778_a("DisplayName", var4.func_96678_d());
var1.func_74742_a(var5);
}
return var1;
}
protected NBTTagList func_96503_e() {
NBTTagList var1 = new NBTTagList();
Collection var2 = this.field_96507_a.func_96528_e();
Iterator var3 = var2.iterator();
while(var3.hasNext()) {
Score var4 = (Score)var3.next();
NBTTagCompound var5 = new NBTTagCompound();
var5.func_74778_a("Name", var4.func_96653_e());
var5.func_74778_a("Objective", var4.func_96645_d().func_96679_b());
var5.func_74768_a("Score", var4.func_96652_c());
var1.func_74742_a(var5);
}
return var1;
}
}
|
[
"freddie.guthrie@googlemail.com"
] |
freddie.guthrie@googlemail.com
|
2d5d633ca04bffa7e13da39a346ddd9659e77c3b
|
c37d2a36312534a55c319b19b61060649c7c862c
|
/app/src/main/java/com/spongycastle/asn1/ASN1String.java
|
124336d5b815f60ffe049a66e0e035d9bbad6c26
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
trwinowiecki/AndroidTexting
|
f5626ad91a07ea7b3cd3ee75893abf8b1fe7154f
|
27e84a420b80054e676c390b898705856364b340
|
refs/heads/master
| 2020-12-30T23:10:17.542572
| 2017-02-01T01:46:13
| 2017-02-01T01:46:13
| 80,580,124
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 311
|
java
|
package com.spongycastle.asn1;
/**
* General interface implemented by ASN.1 STRING objects.
*/
public interface ASN1String
{
/**
* Return a Java String representation of this STRING type's content.
* @return a Java String representation of this STRING.
*/
public String getString();
}
|
[
"trw0511@gmail.com"
] |
trw0511@gmail.com
|
b147206f0edd27dd6ea85f9c69650ab680623b45
|
7e81f6d3046355a07549c1f46e89a8e8783f18d3
|
/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmNicFilterParameterResource.java
|
423be22111ef72f4c9e8ae6ccd076c46ce67a728
|
[
"Apache-2.0"
] |
permissive
|
hsl80/ovirt-engine
|
476368db20f4e5cd2039369361c0e57a08a13200
|
fde3486aa1c5a504cf57974fd9e65a75cb894517
|
refs/heads/master
| 2021-01-24T08:32:36.174024
| 2017-06-01T14:44:04
| 2017-06-05T06:36:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,487
|
java
|
/*
Copyright (c) 2015 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.ovirt.engine.api.restapi.resource;
import java.util.List;
import java.util.Objects;
import javax.ws.rs.core.Response;
import org.ovirt.engine.api.model.NetworkFilterParameter;
import org.ovirt.engine.api.model.Nic;
import org.ovirt.engine.api.model.Vm;
import org.ovirt.engine.api.resource.ActionResource;
import org.ovirt.engine.api.resource.NicNetworkFilterParameterResource;
import org.ovirt.engine.core.common.action.RemoveVmNicFilterParameterParameters;
import org.ovirt.engine.core.common.action.VdcActionParametersBase;
import org.ovirt.engine.core.common.action.VdcActionType;
import org.ovirt.engine.core.common.action.VmNicFilterParameterParameters;
import org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter;
import org.ovirt.engine.core.common.queries.IdQueryParameters;
import org.ovirt.engine.core.common.queries.VdcQueryType;
import org.ovirt.engine.core.compat.Guid;
public class BackendVmNicFilterParameterResource
extends AbstractBackendActionableResource<NetworkFilterParameter, VmNicFilterParameter>
implements NicNetworkFilterParameterResource {
private Guid nicId;
private Guid vmId;
public BackendVmNicFilterParameterResource(Guid vmId, Guid nicId, String vmNicFilterParameterId) {
super(vmNicFilterParameterId, NetworkFilterParameter.class, VmNicFilterParameter.class);
this.vmId = vmId;
this.nicId = nicId;
}
@Override
public NetworkFilterParameter get() {
VmNicFilterParameter parameter = lookupParameter(guid);
if (parameter != null) {
return addLinks(populate(map(parameter), parameter));
}
return notFound();
}
@Override
public NetworkFilterParameter addParents(NetworkFilterParameter parameter) {
Vm vm = new Vm();
vm.setId(vmId.toString());
Nic nic = new Nic();
nic.setId(nicId.toString());
nic.setVm(vm);
parameter.setNic(nic);
return parameter;
}
private VmNicFilterParameter lookupParameter(Guid parameterId) {
List<VmNicFilterParameter> parameters = getBackendCollection(
VmNicFilterParameter.class,
VdcQueryType.GetVmInterfaceFilterParameterById,
new IdQueryParameters(guid)
);
for (VmNicFilterParameter parameter : parameters) {
if (Objects.equals(parameter.getId(), parameterId)) {
return parameter;
}
}
return null;
}
@Override
public NetworkFilterParameter update(NetworkFilterParameter parameter) {
return performUpdate(
parameter,
new FilterParameterResolver(),
VdcActionType.UpdateVmNicFilterParameter,
new UpdateParametersProvider()
);
}
@Override
public Response remove() {
return performAction(
VdcActionType.RemoveVmNicFilterParameter,
new RemoveVmNicFilterParameterParameters(vmId, guid)
);
}
@Override
public ActionResource getActionResource(String action, String oid) {
return inject(new BackendActionResource(action, oid));
}
private class FilterParameterResolver extends EntityIdResolver<Guid> {
@Override
public VmNicFilterParameter lookupEntity(Guid paramId) throws BackendFailureException {
return lookupParameter(paramId);
}
}
private class UpdateParametersProvider
implements ParametersProvider<NetworkFilterParameter, VmNicFilterParameter> {
@Override
public VdcActionParametersBase getParameters(NetworkFilterParameter incoming, VmNicFilterParameter entity) {
VmNicFilterParameter parameter = map(incoming, entity);
parameter.setVmInterfaceId(nicId);
return new VmNicFilterParameterParameters(vmId, parameter);
}
}
}
|
[
"juan.hernandez@redhat.com"
] |
juan.hernandez@redhat.com
|
a4145fb86dec5567bfb34fd91cc6675587ede540
|
6f28ba66909fa293d9058eb033e1694b4ec97eb0
|
/smartenv-websocket/smartenv-websocket-service/src/main/java/com/ai/apac/smartenv/websocket/task/VehiclePositionTask.java
|
5aeae8ed17d8cb5a7e7926632e4d87981840824b
|
[] |
no_license
|
fangxunqing/smart-env
|
01870c01ceb8141787652585b7bf3738a3498641
|
99665cb17c8f7b96f1f6d29223d26a08b5b05d8a
|
refs/heads/main
| 2023-04-26T17:55:03.072112
| 2021-05-25T03:29:15
| 2021-05-25T03:29:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,270
|
java
|
package com.ai.apac.smartenv.websocket.task;
import com.ai.apac.smartenv.common.utils.BaiduMapUtils;
import com.ai.apac.smartenv.omnic.entity.OmnicVehicleInfo;
import com.ai.apac.smartenv.vehicle.entity.VehicleInfo;
import com.ai.apac.smartenv.websocket.module.task.dto.WebsocketTask;
import com.ai.apac.smartenv.websocket.module.vehicle.vo.VehicleMonitorInfoVO;
import com.ai.apac.smartenv.websocket.module.vehicle.vo.VehicleMonitorVO;
import io.micrometer.core.instrument.util.StringUtils;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.api.ResultCode;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Future;
import java.util.stream.Collectors;
/**
* @author qianlong
* @description 车辆实时位置跟踪
* @Date 2020/2/16 10:28 下午
**/
@Getter
@Setter
@Slf4j
public class VehiclePositionTask extends BaseTask implements Runnable {
public VehiclePositionTask(WebsocketTask websocketTask) {
super(websocketTask);
}
@Override
public void run() {
runTask();
}
/**
* 具体的执行方法,由子类实现
*/
@Override
public R<VehicleMonitorVO> execute() {
VehicleMonitorVO vehicleMonitorVO = new VehicleMonitorVO();
vehicleMonitorVO.setTopicName(getWebsocketTask().getTopic());
vehicleMonitorVO.setActionName(getWebsocketTask().getTaskType());
vehicleMonitorVO.setTaskId(String.valueOf(getWebsocketTask().getId()));
R<VehicleMonitorVO> result = null;
try {
// #region 以下代码移动到service中
Map<String, Object> params = validParams();
String vehicleIds = params.get("vehicleIds") == null ? null : (String) params.get("vehicleIds");
Integer status = params.get("status") == null ? null : (Integer) params.get("status");
String tenantIdStr = params.get("tenantId") == null ? null : (String) params.get("tenantId");
Boolean isBigScreen = params.get("isBigScreen") == null ? false : (boolean) params.get("isBigScreen");
Boolean isEasyV = params.get("isEasyV") == null ? false : (boolean) params.get("isEasyV");
String regionId = params.get("regionId") == null ? null : (String) params.get("regionId");
String categoryId = params.get("categoryId") == null ? null : (String) params.get("categoryId");
Integer coord = (Integer) params.get("coordsSystem");
BaiduMapUtils.CoordsSystem coordsSystem = coord == null ? BaiduMapUtils.CoordsSystem.BD09LL : BaiduMapUtils.CoordsSystem.getCoordsSystem(coord);
String message = null;
List<String> vehicleIdList = null;
if (StringUtils.isBlank(vehicleIds) && status == null && StringUtil.isEmpty(tenantIdStr) && regionId == null && categoryId == null) {
throw new ServiceException("The param should not be empty!");
} else if (StringUtils.isNotBlank(vehicleIds)) {//根据车辆ID查询
message = "查询车辆ID查询实时位置成功";
vehicleIdList = Func.toStrList(vehicleIds);
} else if (StringUtil.isNotBlank(tenantIdStr) && isBigScreen && isEasyV) {
message = "查询车辆ID查询实时位置成功";
List<String> tenantIds = Func.toStrList(tenantIdStr);
Future<List<String>> vehicleEasyVList = getVehicleService().getVehicleEasyVList(tenantIds);
if (vehicleEasyVList != null || vehicleEasyVList.get() != null) {
vehicleIdList = vehicleEasyVList.get();
}
} else if (StringUtil.isNotBlank(tenantIdStr) && isBigScreen) {
message = "查询车辆ID查询实时位置成功";
vehicleIdList = new ArrayList<>();
List<String> tenantIds = Func.toStrList(tenantIdStr);
for (String tenantId : tenantIds) {
Future<List<String>> personByWorkareaIdsAndStatus = getVehicleService().getVehicleByWorkareaIdsAndStatus(tenantId);
if (personByWorkareaIdsAndStatus.get() != null) {
vehicleIdList = personByWorkareaIdsAndStatus.get();
}
}
} else if (status != null) {//根据状态查询
Future<List<OmnicVehicleInfo>> dataResult = getVehicleService().getVehicleByStatus(status, getTenantId());
if (dataResult != null && dataResult.get() != null) {
List<OmnicVehicleInfo> vehicleInfoList = dataResult.get();
if (vehicleInfoList.size() > 0) {
vehicleIdList = new ArrayList<String>();
for (OmnicVehicleInfo vehicleInfo : vehicleInfoList) {
vehicleIdList.add(String.valueOf(vehicleInfo.getId()));
}
}
}
message = "查询车辆状态查询实时位置成功";
} else if (StringUtil.isNotBlank(regionId)) {
List<VehicleInfo> vehicleInfoList = getVehicleService().getVehicleInfoByRegionId(StringUtil.isNotBlank(regionId) ? Long.parseLong(regionId) : null);
if (CollectionUtil.isNotEmpty(vehicleInfoList)) {
vehicleIdList = vehicleInfoList.stream().map(vehicleInfo -> vehicleInfo.getId().toString()).collect(Collectors.toList());
}
}
//# region End
if (vehicleIdList == null || vehicleIdList.size() == 0) {
result = R.data(null, "没有符合条件的车辆");
return result;
}
List<Long> allIdList = vehicleIdList.stream().map(Long::parseLong).collect(Collectors.toList());
List<VehicleMonitorInfoVO> vehicleMonitorInfoVOList = getVehicleService().getVehicleMonitorInfo(allIdList, coordsSystem);
for (String vehicleId : vehicleIdList) {
getWebSocketTaskService().createEntityTask(this.getWebsocketTask(), vehicleId);
}
if (isEasyV) {
getWebSocketTaskService().createEasyVTask(getWebsocketTask());
}
if (vehicleMonitorInfoVOList.size() == 0) {
result = R.data(null, "没有符合条件的车辆");
return result;
}
log.debug("================推送车辆实时位置================");
vehicleMonitorVO.setVehicleList(vehicleMonitorInfoVOList);
result = R.data(vehicleMonitorVO);
result.setMsg(message);
} catch (Exception ex) {
result = R.data(null);
result.setCode(ResultCode.FAILURE.getCode());
result.setMsg(ResultCode.FAILURE.getMessage());
return result;
// throw new ServiceException(ResultCode.FAILURE, ex);
}
return result;
}
}
|
[
"15251810316@163.com"
] |
15251810316@163.com
|
b067bcf99d1d55f788db6dec15b5fcb9129e8b91
|
6ffc8b7027b5a18d3d367fc6a518c883a3da3d85
|
/src/weka/filters/unsupervised/attribute/NumericToNominalTest.java
|
a18b35514ed15013be802d5ef349f1962e49e215
|
[] |
no_license
|
icesky0125/DecisionTreeSmoothing
|
8aa20b96725a669d71ca9483a87dd58ba92e4e77
|
fdc2c71e31b0dccdf083bfbb5c07040aeb5b2a7b
|
refs/heads/master
| 2021-07-16T20:24:12.448519
| 2020-05-19T05:41:13
| 2020-05-19T05:41:13
| 158,150,516
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,170
|
java
|
/*
* This program 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/>.
*/
/*
* Copyright (C) 2006 University of Waikato, Hamilton, New Zealand
*/
package weka.filters.unsupervised.attribute;
import weka.core.Attribute;
import weka.core.Instances;
import weka.filters.AbstractFilterTest;
import weka.filters.Filter;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
* Tests NumericToNominal. Run from the command line with:<p>
* java weka.filters.unsupervised.attribute.NumericToNominalTest
*
* @author FracPete (fracpete at waikato dot ac dot nz)
* @version $Revision: 8034 $
*/
public class NumericToNominalTest extends AbstractFilterTest {
public NumericToNominalTest(String name) {
super(name);
}
/** Creates a default NumericToNominal */
@Override
public Filter getFilter() {
return new NumericToNominal();
}
public void testTypical() {
Instances result = useFilter();
// Number of attributes and instances shouldn't change
assertEquals(m_Instances.numAttributes(), result.numAttributes());
assertEquals(m_Instances.numInstances(), result.numInstances());
// no date and numeric attributes should remain
if (result.checkForAttributeType(Attribute.DATE))
fail("Date attribute(s) left over!");
if (result.checkForAttributeType(Attribute.NUMERIC))
fail("Numeric attribute(s) left over!");
}
public static Test suite() {
return new TestSuite(NumericToNominalTest.class);
}
public static void main(String[] args){
junit.textui.TestRunner.run(suite());
}
}
|
[
"he.penny.zhang@gmail.com"
] |
he.penny.zhang@gmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.