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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
977f3de9ffd3d2a3f6a2eae0c5454f8f4d121bd6 | f766baf255197dd4c1561ae6858a67ad23dcda68 | /app/src/main/java/com/tencent/mars/comm/WakerLock.java | 49c91a3e489f6bd4ede8fbe30ffd86a658688c41 | [] | no_license | jianghan200/wxsrc6.6.7 | d83f3fbbb77235c7f2c8bc945fa3f09d9bac3849 | eb6c56587cfca596f8c7095b0854cbbc78254178 | refs/heads/master | 2020-03-19T23:40:49.532494 | 2018-06-12T06:00:50 | 2018-06-12T06:00:50 | 137,015,278 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 6,071 | java | package com.tencent.mars.comm;
import android.content.Context;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import com.tencent.mm.jni.a.a;
import com.tencent.mm.sdk.platformtools.ad;
import com.tencent.mm.sdk.platformtools.ag;
import com.tencent.mm.sdk.platformtools.bi;
import com.tencent.mm.sdk.platformtools.l;
import com.tencent.mm.sdk.platformtools.x;
public class WakerLock
{
private static final String TAG = "MicroMsg.WakerLock";
private static long lastChecktime = 0L;
private static Boolean shouldLock = null;
private IAutoUnlockCallback autoUnlockCallback = null;
private Context context;
private String mCreatePosStackLine = null;
private ag mHandler = null;
private Runnable mReleaser = new Runnable()
{
public void run()
{
if (WakerLock.this.wakeLock.isHeld())
{
x.w("MicroMsg.WakerLock", "unlock by fucking handler! [%d,%d] @[%s]", new Object[] { Integer.valueOf(WakerLock.this.hashCode()), Integer.valueOf(WakerLock.this.wakeLock.hashCode()), WakerLock.this.mCreatePosStackLine });
WakerLock.this.unLock();
if (WakerLock.this.autoUnlockCallback != null) {
WakerLock.this.autoUnlockCallback.autoUnlockCallback();
}
}
}
};
private PowerManager.WakeLock wakeLock = null;
public WakerLock(Context paramContext, String paramString)
{
this.wakeLock = ((PowerManager)paramContext.getSystemService("power")).newWakeLock(1, paramString);
this.wakeLock.setReferenceCounted(false);
this.mHandler = new ag(paramContext.getMainLooper());
this.context = paramContext;
x.i("MicroMsg.WakerLock", "init [%d,%d] @[%s]", new Object[] { Integer.valueOf(hashCode()), Integer.valueOf(this.wakeLock.hashCode()), this.mCreatePosStackLine });
}
public WakerLock(Context paramContext, String paramString, IAutoUnlockCallback paramIAutoUnlockCallback)
{
this(paramContext, paramString);
this.autoUnlockCallback = paramIAutoUnlockCallback;
}
private static final boolean checkShouldLock()
{
boolean bool2;
boolean bool3;
if ((bi.bH(lastChecktime) > 10000L) || (shouldLock == null))
{
bool2 = l.fs(ad.getContext());
bool3 = l.ft(ad.getContext());
if ((bool2) || (bool3)) {
break label106;
}
}
label106:
for (boolean bool1 = true;; bool1 = false)
{
shouldLock = Boolean.valueOf(bool1);
x.i("MicroMsg.WakerLock", "checkShouldLock screen:%b chatging:%b res:%b checkTime:%d ", new Object[] { Boolean.valueOf(bool2), Boolean.valueOf(bool3), shouldLock, Long.valueOf(bi.bH(lastChecktime)) });
lastChecktime = bi.VF();
return shouldLock.booleanValue();
}
}
private String getCallerStack()
{
StackTraceElement[] arrayOfStackTraceElement = new Throwable().getStackTrace();
int j = arrayOfStackTraceElement.length;
int i = 0;
while (i < j)
{
StackTraceElement localStackTraceElement = arrayOfStackTraceElement[i];
if (!localStackTraceElement.getClassName().contains(WakerLock.class.getName())) {
return localStackTraceElement.toString();
}
i += 1;
}
return "<native>";
}
protected void finalize()
{
x.i("MicroMsg.WakerLock", "finalize unlock [%d,%d] @[%s]", new Object[] { Integer.valueOf(hashCode()), Integer.valueOf(this.wakeLock.hashCode()), this.mCreatePosStackLine });
unLock();
super.finalize();
}
public String getCreatePosStackLine()
{
return this.mCreatePosStackLine;
}
public int innerWakeLockHashCode()
{
return this.wakeLock.hashCode();
}
public boolean isLocking()
{
try
{
boolean bool = this.wakeLock.isHeld();
x.i("MicroMsg.WakerLock", "check is held [%d,%d] :%b caller:[%s] @[%s]", new Object[] { Integer.valueOf(hashCode()), Integer.valueOf(this.wakeLock.hashCode()), Boolean.valueOf(bool), getCallerStack(), getCreatePosStackLine() });
return bool;
}
catch (Exception localException)
{
x.printErrStackTrace("MicroMsg.WakerLock", localException, "", new Object[] { "" });
}
return false;
}
public void lock()
{
lock(getCallerStack());
}
public void lock(long paramLong)
{
lock(paramLong, getCallerStack());
}
public void lock(long paramLong, String paramString)
{
try
{
if (!checkShouldLock()) {
return;
}
if (this.wakeLock.isHeld()) {
unLock();
}
a.a(this, paramString);
x.i("MicroMsg.WakerLock", "lock [%d,%d] traceMsg:[%s] @[%s] limit time:%d", new Object[] { Integer.valueOf(hashCode()), Integer.valueOf(this.wakeLock.hashCode()), paramString, getCreatePosStackLine(), Long.valueOf(paramLong) });
this.wakeLock.acquire();
if (paramLong == -1L)
{
this.mHandler.removeCallbacks(this.mReleaser);
return;
}
}
catch (Exception paramString)
{
x.printErrStackTrace("MicroMsg.WakerLock", paramString, "", new Object[] { "" });
return;
}
this.mHandler.postDelayed(this.mReleaser, paramLong);
}
public void lock(String paramString)
{
lock(-1L, paramString);
}
public void unLock()
{
if (this.wakeLock.isHeld())
{
this.mHandler.removeCallbacks(this.mReleaser);
a.c(this);
x.i("MicroMsg.WakerLock", "unlock [%d,%d] caller:[%s] @[%s]", new Object[] { Integer.valueOf(hashCode()), Integer.valueOf(this.wakeLock.hashCode()), getCallerStack(), getCreatePosStackLine() });
}
try
{
this.wakeLock.release();
return;
}
catch (Exception localException)
{
x.printErrStackTrace("MicroMsg.WakerLock", localException, "", new Object[] { "" });
}
}
public static abstract interface IAutoUnlockCallback
{
public abstract void autoUnlockCallback();
}
}
/* Location: /Users/Han/Desktop/wxall/微信反编译/反编译 6.6.7/dex2jar-2.0/classes-dex2jar.jar!/com/tencent/mars/comm/WakerLock.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"526687570@qq.com"
] | 526687570@qq.com |
93b82c6b7226013069832c26a226539e636277d2 | d6ead9a0193d4b7a8b01562d05a02126f6b8efa3 | /Java8Lambdas/javase8_lambda_part2/lambda_fi_Predicate_refactoring_initial/src/main/java/mypackage/Person.java | ac3f46e32fd8bec3f34bf82fdcab24c983ac1e19 | [] | no_license | SasirekhaPV/JPassionHomework | 06271ad0c3f1bb99801fccc8825751b75cd6d946 | 82539522e7ccb60eda8f0c7a57837c7a2c223e8e | refs/heads/master | 2021-12-15T15:48:35.746276 | 2017-08-29T18:03:13 | 2017-08-29T18:03:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 472 | java | package mypackage;
public class Person {
private String name;
private int age;
public Person (String name, int age){
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
@Override
public String toString() {
return getName();
}
}
| [
"Henry.Fender@hennepin.us"
] | Henry.Fender@hennepin.us |
cfab669a50670ca61935352d117be52c64d94420 | d5decb236da7da2bb8d123311207766b6a8435cf | /src/com/taobao/api/response/SimbaRptAdgroupkeywordbaseGetResponse.java | 84fd065526e7d2f4b83398e2cb07cdb4e0f65213 | [] | no_license | tasfe/my-project-taobao-demo | 85fee9861361e1e9ef4810f56aa5bbb3290ea216 | f05a8141b6f3b23e88053bad4a12c8a138c2ef51 | refs/heads/master | 2021-01-13T01:30:17.440485 | 2013-02-16T08:38:02 | 2013-02-16T08:38:02 | 32,249,939 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 785 | java | package com.taobao.api.response;
import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.TaobaoResponse;
/**
* TOP API: taobao.simba.rpt.adgroupkeywordbase.get response.
*
* @author auto create
* @since 1.0, null
*/
public class SimbaRptAdgroupkeywordbaseGetResponse extends TaobaoResponse {
private static final long serialVersionUID = 1116218164128293412L;
/**
* 词基础数据返回结果
*/
@ApiField("rpt_adgroupkeyword_base_list")
private String rptAdgroupkeywordBaseList;
public void setRptAdgroupkeywordBaseList(String rptAdgroupkeywordBaseList) {
this.rptAdgroupkeywordBaseList = rptAdgroupkeywordBaseList;
}
public String getRptAdgroupkeywordBaseList( ) {
return this.rptAdgroupkeywordBaseList;
}
}
| [
"bingzhaoliu@gmail.com@28b099c3-0654-7635-3fca-eff556b9d3f2"
] | bingzhaoliu@gmail.com@28b099c3-0654-7635-3fca-eff556b9d3f2 |
61dbd4b537de52d341197a269426059ec95725fa | 47e4d2da9539eb7d205acb94d2e33ff0aa2b46b3 | /src/main/java/com/github/vaerys/tags/cctags/TagSpacer.java | df1606c1fd6253daaf9d31dd5187bf9c18023d20 | [] | no_license | Vaerys-Dawn/DiscordSailv2 | 46b93969e58bf810d118d5e1243e9c8a23f44841 | 0ce6a9e8865919e8a7ad830c5d92c71d172b8c33 | refs/heads/master | 2022-05-31T02:53:23.265370 | 2018-11-23T01:01:11 | 2018-11-23T01:01:11 | 66,695,839 | 28 | 11 | null | 2020-07-07T00:58:10 | 2016-08-27T04:27:02 | Java | UTF-8 | Java | false | false | 817 | java | package com.github.vaerys.tags.cctags;
import com.github.vaerys.masterobjects.CommandObject;
import com.github.vaerys.enums.TagType;
import com.github.vaerys.templates.TagObject;
public class TagSpacer extends TagObject {
public TagSpacer(int priority, TagType... types) {
super(priority, types);
}
@Override
public String execute(String from, CommandObject command, String args) {
return replaceAllTag(from, "\u200b");
}
@Override
public String tagName() {
return "<spacer>";
}
@Override
public int argsRequired() {
return 0;
}
@Override
public String usage() {
return null;
}
@Override
public String desc() {
return "Replaces itself with an invisible character that takes up no space.";
}
}
| [
"thelegotechhead@yahoo.com.au"
] | thelegotechhead@yahoo.com.au |
2d8aba7eaad81e350989cf0addab537d8c7ae3b7 | 8c085f12963e120be684f8a049175f07d0b8c4e5 | /castor/branches/branch_0_9_5/castor/src/tests/main/org/exolab/castor/tests/framework/testDescriptor/UnitTestCaseChoiceDescriptor.java | e4b22a3945f197acb4c3e848607a15ca275534be | [] | no_license | alam93mahboob/castor | 9963d4110126b8f4ef81d82adfe62bab8c5f5bce | 974f853be5680427a195a6b8ae3ce63a65a309b6 | refs/heads/master | 2020-05-17T08:03:26.321249 | 2014-01-01T20:48:45 | 2014-01-01T20:48:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,917 | java | /*
* This class was automatically generated with
* <a href="http://www.castor.org">Castor 0.9.5.2</a>, using an XML
* Schema.
* $Id$
*/
package org.exolab.castor.tests.framework.testDescriptor;
//---------------------------------/
//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.mapping.AccessMode;
import org.exolab.castor.xml.TypeValidator;
import org.exolab.castor.xml.XMLFieldDescriptor;
import org.exolab.castor.xml.validators.*;
/**
* Class UnitTestCaseChoiceDescriptor.
*
* @version $Revision$ $Date$
*/
public class UnitTestCaseChoiceDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
//--------------------------/
//- Class/Member Variables -/
//--------------------------/
/**
* Field nsPrefix
*/
private java.lang.String nsPrefix;
/**
* Field nsURI
*/
private java.lang.String nsURI;
/**
* Field xmlName
*/
private java.lang.String xmlName;
/**
* Field identity
*/
private org.exolab.castor.xml.XMLFieldDescriptor identity;
//----------------/
//- Constructors -/
//----------------/
public UnitTestCaseChoiceDescriptor() {
super();
nsPrefix = "test";
nsURI = "http://castor.exolab.org/Test";
//-- set grouping compositor
setCompositorAsChoice();
org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
org.exolab.castor.xml.XMLFieldHandler handler = null;
org.exolab.castor.xml.FieldValidator fieldValidator = null;
//-- initialize attribute descriptors
//-- initialize element descriptors
//-- _mapping_File
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_mapping_File", "Mapping_File", org.exolab.castor.xml.NodeType.Element);
desc.setImmutable(true);
handler = (new org.exolab.castor.xml.XMLFieldHandler() {
public java.lang.Object getValue( java.lang.Object object )
throws IllegalStateException
{
UnitTestCaseChoice target = (UnitTestCaseChoice) object;
return target.getMapping_File();
}
public void setValue( java.lang.Object object, java.lang.Object value)
throws IllegalStateException, IllegalArgumentException
{
try {
UnitTestCaseChoice target = (UnitTestCaseChoice) object;
target.setMapping_File( (java.lang.String) value);
}
catch (java.lang.Exception ex) {
throw new IllegalStateException(ex.toString());
}
}
public java.lang.Object newInstance( java.lang.Object parent ) {
return null;
}
} );
desc.setHandler(handler);
desc.setNameSpaceURI("http://castor.exolab.org/Test");
desc.setMultivalued(false);
addFieldDescriptor(desc);
//-- validation code for: _mapping_File
fieldValidator = new org.exolab.castor.xml.FieldValidator();
{ //-- local scope
StringValidator typeValidator = new StringValidator();
typeValidator.setWhiteSpace("preserve");
fieldValidator.setValidator(typeValidator);
}
desc.setValidator(fieldValidator);
//-- _schema
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_schema", "Schema", org.exolab.castor.xml.NodeType.Element);
desc.setImmutable(true);
handler = (new org.exolab.castor.xml.XMLFieldHandler() {
public java.lang.Object getValue( java.lang.Object object )
throws IllegalStateException
{
UnitTestCaseChoice target = (UnitTestCaseChoice) object;
return target.getSchema();
}
public void setValue( java.lang.Object object, java.lang.Object value)
throws IllegalStateException, IllegalArgumentException
{
try {
UnitTestCaseChoice target = (UnitTestCaseChoice) object;
target.setSchema( (java.lang.String) value);
}
catch (java.lang.Exception ex) {
throw new IllegalStateException(ex.toString());
}
}
public java.lang.Object newInstance( java.lang.Object parent ) {
return null;
}
} );
desc.setHandler(handler);
desc.setNameSpaceURI("http://castor.exolab.org/Test");
desc.setMultivalued(false);
addFieldDescriptor(desc);
//-- validation code for: _schema
fieldValidator = new org.exolab.castor.xml.FieldValidator();
{ //-- local scope
StringValidator typeValidator = new StringValidator();
typeValidator.setWhiteSpace("preserve");
fieldValidator.setValidator(typeValidator);
}
desc.setValidator(fieldValidator);
} //-- org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoiceDescriptor()
//-----------/
//- Methods -/
//-----------/
/**
* Method getAccessMode
*/
public org.exolab.castor.mapping.AccessMode getAccessMode()
{
return null;
} //-- org.exolab.castor.mapping.AccessMode getAccessMode()
/**
* Method getExtends
*/
public org.exolab.castor.mapping.ClassDescriptor getExtends()
{
return null;
} //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
/**
* Method getIdentity
*/
public org.exolab.castor.mapping.FieldDescriptor getIdentity()
{
return identity;
} //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
/**
* Method getJavaClass
*/
public java.lang.Class getJavaClass()
{
return org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoice.class;
} //-- java.lang.Class getJavaClass()
/**
* Method getNameSpacePrefix
*/
public java.lang.String getNameSpacePrefix()
{
return nsPrefix;
} //-- java.lang.String getNameSpacePrefix()
/**
* Method getNameSpaceURI
*/
public java.lang.String getNameSpaceURI()
{
return nsURI;
} //-- java.lang.String getNameSpaceURI()
/**
* Method getValidator
*/
public org.exolab.castor.xml.TypeValidator getValidator()
{
return this;
} //-- org.exolab.castor.xml.TypeValidator getValidator()
/**
* Method getXMLName
*/
public java.lang.String getXMLName()
{
return xmlName;
} //-- java.lang.String getXMLName()
}
| [
"nobody@b24b0d9a-6811-0410-802a-946fa971d308"
] | nobody@b24b0d9a-6811-0410-802a-946fa971d308 |
d06d68261e277793819005a9b47dc954968a7ec8 | 70f91957d10020fd61d1e05abe9bb2ee22e6b37a | /src/main/java/com/prb/erp/SHAPasswordEncoder.java | ca4e244da90cd5f9d03d6cacff8d9be18e329fe7 | [] | no_license | deepstudyDev/prb_erp_api | a4e00c93eaf69ebc2b8a36f47856270d729fac81 | 42895ef14382f1c693e0b667052fef5f3e7d396f | refs/heads/master | 2020-04-12T19:15:17.805284 | 2019-03-20T00:16:33 | 2019-03-20T00:16:33 | 161,093,008 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,040 | java | package com.prb.erp;
import org.springframework.security.authentication.encoding.ShaPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
public class SHAPasswordEncoder implements PasswordEncoder {
private ShaPasswordEncoder shaPasswordEncoder;
private Object salt = null;
public SHAPasswordEncoder() {
shaPasswordEncoder = new ShaPasswordEncoder();
}
public SHAPasswordEncoder(int sha) {
shaPasswordEncoder = new ShaPasswordEncoder(sha);
}
public void setEncodeHashAsBase64(boolean encodeHashAsBase64) {
shaPasswordEncoder.setEncodeHashAsBase64(encodeHashAsBase64);
}
public void setSalt(Object salt) {
this.salt = salt;
}
@Override
public String encode(CharSequence rawPassword) {
return shaPasswordEncoder.encodePassword(rawPassword.toString(), salt);
}
@Override
public boolean matches(CharSequence rawPassword, String encodedPassword) {
return shaPasswordEncoder.isPasswordValid(encodedPassword, rawPassword.toString(), salt);
}
}
| [
"admin@ideepstudy.com"
] | admin@ideepstudy.com |
c7dd84a701c81d1e58cad7ec4a1a7be8496afe92 | fa93c9be2923e697fb8a2066f8fb65c7718cdec7 | /sources/com/google/android/gms/common/internal/zzr.java | 1b66a3a633a13375e33194da760d3c7403ef650f | [] | no_license | Auch-Auch/avito_source | b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b | 76fdcc5b7e036c57ecc193e790b0582481768cdc | refs/heads/master | 2023-05-06T01:32:43.014668 | 2021-05-25T10:19:22 | 2021-05-25T10:19:22 | 370,650,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | package com.google.android.gms.common.internal;
import android.os.IInterface;
import android.os.RemoteException;
import com.google.android.gms.common.zzj;
import com.google.android.gms.dynamic.IObjectWrapper;
public interface zzr extends IInterface {
boolean zza(zzj zzj, IObjectWrapper iObjectWrapper) throws RemoteException;
}
| [
"auchhunter@gmail.com"
] | auchhunter@gmail.com |
45a02b240fa2fa0e8d73384f92082aa9704cbf13 | e32ca144084bad14d47b8477730472d9af7c77b0 | /sistemaConflictoHorario.web/src/main/java/co/edu/uniandes/csw/preGrupo8/seccion/service/SeccionService.java | 03176c5c4d741aa733d428565ed4dfd1a2f979ad | [] | no_license | JairoBm13/sistemaHorario | bdf1bf2b9b2160636fd93f7839fca0eafc24ed9e | 9f469d573610362278ec15ecd050370fa4fe45ee | refs/heads/master | 2020-04-08T06:18:32.768619 | 2014-08-27T07:03:50 | 2014-08-27T07:03:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,741 | java | /* ========================================================================
* Copyright 2014 preGrupo8
*
* Licensed under the MIT, The MIT License (MIT)
* Copyright (c) 2014 preGrupo8
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.
* ========================================================================
Source generated by CrudMaker version 1.0.0.201408112050
*/
package co.edu.uniandes.csw.preGrupo8.seccion.service;
import java.util.List;
import javax.ejb.Stateless;
import javax.ws.rs.Consumes;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@Path("/Seccion")
@Stateless
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class SeccionService extends _SeccionService {
} | [
"j.bautista.m13@outlook.com"
] | j.bautista.m13@outlook.com |
c8490e4c9ab2d4bb54889a0dbafcf381d9a5e4f7 | 7810ee083e1e73211535c49ce995a7d73a943a52 | /insurance-biz/src/main/java/com/born/insurance/biz/service/businessBill/BusinessBillProcessServiceImpl.java | 3106d862ccc198ce8bc62436b7a08a415f5a15c4 | [] | no_license | robben766/insuranceSystem | 702013b8ad83a596404c7718bff8097ac8a255fa | 852acf72136b560a4a3cdf890eae02a55d4e2995 | refs/heads/master | 2023-03-15T08:15:26.434405 | 2018-01-31T08:03:35 | 2018-01-31T08:03:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,372 | java | package com.born.insurance.biz.service.businessBill;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.born.insurance.biz.exception.ExceptionFactory;
import com.born.insurance.biz.service.base.BaseProcessService;
import com.born.insurance.biz.util.PinyinUtil;
import com.born.insurance.dal.daointerface.BusinessBillDAO;
import com.born.insurance.dal.dataobject.BusinessBillDO;
import com.born.insurance.integration.bpm.result.WorkflowResult;
import com.born.insurance.util.StringUtil;
import com.born.insurance.ws.enums.FormCodeEnum;
import com.born.insurance.ws.enums.SysDateSeqNameEnum;
import com.born.insurance.ws.enums.base.InsuranceResultEnum;
import com.born.insurance.ws.info.common.FormInfo;
import com.born.insurance.ws.order.bpm.FlowVarField;
import com.born.insurance.ws.order.bpm.enums.FlowVarTypeEnum;
import com.born.insurance.ws.order.chargeNotice.ChargeNoticeOrder;
import com.born.insurance.ws.order.common.SimpleFormOrder;
import com.born.insurance.ws.order.common.WorkFlowBeforeProcessOrder;
import com.born.insurance.ws.order.insuranceProduct.InsuranceProductOrder;
import com.born.insurance.ws.result.base.InsuranceBaseResult;
import com.born.insurance.ws.service.chargeNotice.ChargeNoticeService;
import com.born.insurance.ws.service.common.FormService;
import com.google.common.collect.Lists;
import com.yjf.common.lang.util.money.Money;
import rop.thirdparty.org.apache.commons.lang3.StringUtils;
/**
* Created by wqh on 2017-1-11.
*/
@Service("businessBillProcessService")
public class BusinessBillProcessServiceImpl extends BaseProcessService {
@Autowired
private ChargeNoticeService chargeNoticeService;
@Autowired
protected BusinessBillDAO businessBillDAO;
@Override
public List<FlowVarField> makeWorkFlowVar(FormInfo formInfo) {
List<FlowVarField> fields = Lists.newArrayList();
long formId = formInfo.getFormId();
BusinessBillDO businessBillDO = businessBillDAO.findByFormId(formId);
if (null != businessBillDO) {
FlowVarField field = new FlowVarField();
field.setVarName("Reservation");
field.setVarType(FlowVarTypeEnum.DOUBLE);
field.setVarVal(String.valueOf(businessBillDO.getGrossRate()));
fields.add(field);
}
return fields;
}
@Override
public InsuranceBaseResult doNextBeforeProcess(WorkFlowBeforeProcessOrder order) {
InsuranceBaseResult result = createResult();
Double brokerScale = 0.0 ;
Double commonScale = 0.0 ;
Map<String, Object> customizeMap = order.getCustomizeMap();
if (customizeMap.containsKey("brokerScale")) {
String broStr = (String)customizeMap.get("brokerScale");
String comStr = (String)customizeMap.get("commonScale");
if (!StringUtils.isBlank(broStr) && !StringUtils.isBlank(comStr)) {
brokerScale = Double.valueOf(broStr);
commonScale = Double.valueOf(comStr);
FormInfo formInfo = order.getFormInfo();
long formId = formInfo.getFormId();
BusinessBillDO businessBillDO = businessBillDAO.findByFormId(formId);
businessBillDO.setBrokerScale(brokerScale);
businessBillDO.setCommonScale(commonScale);
BigDecimal broker = new BigDecimal(brokerScale);
BigDecimal common = new BigDecimal(commonScale);
BigDecimal one = new BigDecimal(1);
//计算公式:公式:1-佣金比例/经纪费率,保留2位小数点
BigDecimal grossRate = (one.subtract(common.divide(broker,2,RoundingMode.HALF_UP)));
businessBillDO.setGrossRate(grossRate.doubleValue());
businessBillDAO.update(businessBillDO);
}
}
result.setSuccess(true);
return result;
}
@Override
public void endFlowProcess(FormInfo formInfo, WorkflowResult workflowResult) {
// 结束流程后业务处理(BASE)
long formId = formInfo.getFormId();
BusinessBillDO businessBillDO = businessBillDAO.findByFormId(formId);
if (null == businessBillDO) {
throw ExceptionFactory.newFcsException(InsuranceResultEnum.HAVE_NOT_DATA, "数据不存在");
}
//原保费
Money premiumAmount = businessBillDO.getPremiumAmount();
//经纪费率
double brokerScale = businessBillDO.getBrokerScale();
//佣金比例
double commonScale = businessBillDO.getCommonScale();
//预留比率
double grossRate = businessBillDO.getGrossRate();
Money brokerFee = premiumAmount.multiply(brokerScale).multiply(0.01);
Money commonFee = premiumAmount.multiply(commonScale).multiply(0.01);
Money grossProfit = premiumAmount.multiply(grossRate).multiply(0.01);
businessBillDO.setBrokerVal(brokerFee);
businessBillDO.setCommonVal(commonFee);
businessBillDO.setGrossProfit(grossProfit);
businessBillDAO.update(businessBillDO);
//添加保单结算通知单
ChargeNoticeOrder order = new ChargeNoticeOrder();
order.setBusinessBillId(businessBillDO.getBusinessBillId());
order.setDepart(businessBillDO.getInsuranceDepart());
order.setTeam(businessBillDO.getInsuranceTeam());
order.setNoticeDate(businessBillDO.getInsuranceDate());
order.setInsuranceNo(businessBillDO.getInsuranceNo());
order.setInsuranceTypeName(businessBillDO.getInsuranceTypeName());
order.setBillCustomerName(businessBillDO.getInsuranceCompanyName());
order.setPremiumAmount(premiumAmount);
order.setRecievableFee(businessBillDO.getBrokerVal());
order.setReservedScale(businessBillDO.getGrossRate());
order.setPayFee(businessBillDO.getCommonVal());
order.setBillNo(businessBillDO.getBillNo());
order.setNoticeNo(this.genNoticeNo(order));
order.setInsuranceBrokerNo(businessBillDO.getInsuranceBrokerNo());
order.setInsuranceBrokerName(businessBillDO.getInsuranceBrokerName());
order.setCheckIndex(0);
order.setCheckStatus(1);
order.setFormCode(FormCodeEnum.JSTZD);
chargeNoticeService.save(order);
}
/**
* 编号
* @return
*/
private synchronized String genNoticeNo(ChargeNoticeOrder order) {
int year = Calendar.getInstance().get(Calendar.YEAR);
String priceCode = PinyinUtil.getPinYinHeadChar(order.getInsuranceTypeName()) + year;
String seqName = SysDateSeqNameEnum.BUSINESS_BILL_NOTICE_NO.code() + "-" + year;
long seq = dateSeqService.getNextSeqNumberWithoutCache(seqName, false);
priceCode += StringUtil.leftPad(String.valueOf(seq), 4, "0");
return priceCode;
}
}
| [
"your@email.com"
] | your@email.com |
f9db86e726c3a4bf399ce6d6785d54a2f707291a | 5148293c98b0a27aa223ea157441ac7fa9b5e7a3 | /Method_Scraping/xml_scraping/NicadOutputFile_t1_beam/Nicad_t1_beam2259.java | e6ecba86b7cf015e217f5fbaea4be0add00ee89d | [] | no_license | ryosuke-ku/TestCodeSeacherPlus | cfd03a2858b67a05ecf17194213b7c02c5f2caff | d002a52251f5461598c7af73925b85a05cea85c6 | refs/heads/master | 2020-05-24T01:25:27.000821 | 2019-08-17T06:23:42 | 2019-08-17T06:23:42 | 187,005,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 461 | java | // clone pairs:7641:90%
// 11615:beam/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubClient.java
public class Nicad_t1_beam2259
{
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ProjectPath that = (ProjectPath) o;
return projectId.equals(that.projectId);
}
} | [
"naist1020@gmail.com"
] | naist1020@gmail.com |
3dce4728e9a745bf9d905b48ebec28a0ef4dd91e | 903be4f617a2db222ffe48498291fde8947ac1e3 | /com/sun/corba/se/spi/activation/EndpointInfoListHolder.java | 06d1ef8e872740fac433d4c5e5ba09615369a05c | [] | no_license | CrazyITBoy/jdk1_8_source | 28b33e029a3a972ee30fa3c0429d8f193373a5c3 | d01551b2df442d1912403127a1c56a06ac84f7bd | refs/heads/master | 2022-12-10T07:27:54.028455 | 2020-07-05T15:18:50 | 2020-07-05T15:18:50 | 273,000,289 | 0 | 1 | null | 2020-06-27T15:22:27 | 2020-06-17T14:45:23 | Java | UTF-8 | Java | false | false | 1,109 | java | package com.sun.corba.se.spi.activation;
/**
* com/sun/corba/se/spi/activation/EndpointInfoListHolder.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from /jenkins/workspace/8-2-build-macosx-x86_64/jdk8u251/737/corba/src/share/classes/com/sun/corba/se/spi/activation/activation.idl
* Thursday, March 12, 2020 2:38:16 AM PDT
*/
public final class EndpointInfoListHolder implements org.omg.CORBA.portable.Streamable
{
public com.sun.corba.se.spi.activation.EndPointInfo value[] = null;
public EndpointInfoListHolder ()
{
}
public EndpointInfoListHolder (com.sun.corba.se.spi.activation.EndPointInfo[] initialValue)
{
value = initialValue;
}
public void _read (org.omg.CORBA.portable.InputStream i)
{
value = com.sun.corba.se.spi.activation.EndpointInfoListHelper.read (i);
}
public void _write (org.omg.CORBA.portable.OutputStream o)
{
com.sun.corba.se.spi.activation.EndpointInfoListHelper.write (o, value);
}
public org.omg.CORBA.TypeCode _type ()
{
return com.sun.corba.se.spi.activation.EndpointInfoListHelper.type ();
}
}
| [
"1396757497@qq.com"
] | 1396757497@qq.com |
e47e6b029458f4d4545d04699db0113b68fe22e8 | f1faa2507240f9e501448ce5bada747dedf56e72 | /TestWork/src/main/java/com/newland/bi/bigdata/txt/StringTest1.java | 0154408e9d595eb6ea0deae881176243c78197ae | [] | no_license | sjl421/TestSelf | 707b59e9e874ecfbc7b1658ba27b520586256f96 | e2937d6924412747ed0eb160fe517e682c3d9892 | refs/heads/master | 2020-03-15T15:54:22.912369 | 2018-04-28T09:10:11 | 2018-04-28T09:10:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 270 | java | package com.newland.bi.bigdata.txt;
public class StringTest1 {
public static void main(String[] args) {
String dependence_time = "'$'";
System.out.println(dependence_time.length());
dependence_time = "'$-1'";
System.out.println(dependence_time.length());
}
}
| [
"13509323824@139.com"
] | 13509323824@139.com |
cf1d61dac0e7dbb8f82baf8bf53c5e1d82568e3d | 3963949fc1358e175851b9a75b47e0bb510d37e5 | /jme/src/com/jme/app/FixedLogicrateGame.java | 79e39247f7b97851b96ad719f735869583d40caa | [
"MIT"
] | permissive | j0rg3n/wrathofthetaboos | 246ef9c510ccfde79221ad8e31fce7e89207f495 | d5c8d64c3c44e28ed6a658943a3a9d56a754c8af | refs/heads/master | 2021-01-10T10:28:42.157519 | 2008-02-08T23:11:09 | 2008-02-08T23:11:09 | 45,484,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,426 | java | /*
* Copyright (c) 2003-2007 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.jme.app;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.jme.input.InputSystem;
import com.jme.util.Timer;
/**
* <code>FixedLogicrateGame</code> implements a main-loop designed to acheive
* frame rate independence. The goal is to keep a consistent gameplay speed
* regardless of the framerate acheived by the visuals. The game renders as fast
* as the hardware permits, while running the game logic at a fixed rate. The
* concept behind this is forcing every game logic tick to represent a fixed
* amount of real-time. For example, if the logic is updated at a rate of 15
* times per second, and we have a person moving at 30 pixels per second, each
* update the person should move 2 pixels. <br>
* To compensate for the non-constant frame rate, we smooth the visuals using
* interpolation. So, if the scene is rendered twice without the game logic
* being updated, we do not render the same thing twice. <br>
* Using a fixed-timestep model has a number of benefits. Game logic is
* simplified as there is no longer any need to add "*deltaTime" to acheive
* frame rate independence. There is also a gain in efficiency: the logic can be
* run at a lower frequency than the rendering, meaning that the logic may be
* updated only once every second game - a net save in time. In addition,
* because the exact same sequence of game logic code is executed every time,
* the game becomes deterministic (that is to say, it will run the exact same
* way every time). <br>
* Further extension of this class could be used to integrate both a fixed logic
* rate and a fixed frame rate.
*
* @author Eric Woroshow
* @version $Id: FixedLogicrateGame.java,v 1.6 2004/04/26 18:56:01 mojomonkey
* Exp $
*/
public abstract class FixedLogicrateGame extends AbstractGame {
private static final Logger logger = Logger
.getLogger(FixedLogicrateGame.class.getName());
private static final int MAX_LOOPS = 50;
//Logic-rate managing variables
private Timer timer;
private int logicTPS;
private long tickTime;
private long time0, time1;
private int loops;
/**
* <code>setLogicTicksPerSecond</code> sets the number of logic times per
* second the game should update the logic. This should not be called prior
* to the application being <code>start()</code> -ed.
*
* @param tps
* the desired logic rate in ticks per second
*/
public void setLogicTicksPerSecond(int tps) {
if (tps < 0) {
throw new IllegalArgumentException(
"Ticks per second cannot be less than zero.");
}
logicTPS = tps;
tickTime = timer.getResolution() / logicTPS;
}
/**
* Ticks logic at a fixed rate while rendering as fast as hardware permits.
*/
public final void start() {
logger.info("Application started.");
try {
getAttributes();
initSystem();
assertDisplayCreated();
timer = Timer.getTimer();
setLogicTicksPerSecond(60); //default to 60 tps
initGame();
//main loop
while (!finished && !display.isClosing()) {
time1 = timer.getTime();
loops = 0;
while ((time1 - time0) > tickTime && loops < MAX_LOOPS) {
//handle input events prior to updating the scene
// - some applications may want to put this into update of the game state
InputSystem.update();
//update game state, do not use interpolation parameter
update(-1.0f);
time0 += tickTime;
loops++;
}
//If the game logic takes far too long, discard the pending
// time
if ((time1 - time0) > tickTime) time0 = time1 - tickTime;
float percentWithinTick = Math.min(1.0f,
(float) (time1 - time0) / tickTime);
//render scene with interpolation value
render(percentWithinTick);
//swap buffers
display.getRenderer().displayBackBuffer();
Thread.yield();
}
} catch (Throwable t) {
logger.logp(Level.SEVERE, this.getClass().toString(), "start()", "Exception in game loop", t);
} finally {
cleanup();
}
logger.info("Application ending.");
display.reset();
quit();
}
/**
* Quits the program abruptly using <code>System.exit</code>.
*
* @see AbstractGame#quit()
*/
protected void quit() {
if (display != null) {
display.close();
}
System.exit(0);
}
/**
* @param interpolation
* unused in this implementation
* @see AbstractGame#update(float interpolation)
*/
protected abstract void update(float interpolation);
/**
* Renders the scene. Under no circumstances should the render method alter
* anything that could directly or indirectly modify the game logic.
*
* @param percentWithinTick
* decimal value representing the position between update ticks
* @see AbstractGame#render(float interpolation)
*/
protected abstract void render(float percentWithinTick);
/**
* @see AbstractGame#initSystem()
*/
protected abstract void initSystem();
/**
* @see AbstractGame#initGame()
*/
protected abstract void initGame();
/**
* @see AbstractGame#reinit()
*/
protected abstract void reinit();
/**
* @see AbstractGame#cleanup()
*/
protected abstract void cleanup();
} | [
"greisen@b760afd0-1f45-0410-b975-7103d5bbc06f"
] | greisen@b760afd0-1f45-0410-b975-7103d5bbc06f |
d99b69814c06a5b3dcf470226a698bdc1bf5df69 | b34404ddb2c04765eb099c58ad8ac614ab84adca | /src/com/cicro/analyzer/dic/Hit.java | e7a2e09bebc06521c943a90aa3b4ae2a09fcc55d | [] | no_license | 373974360/cicroCms | a69f46d0148f948a55c22f4a9b60792b958e5744 | 7cd9b157253811046ab9db6a3c2aa91be5eadc48 | refs/heads/master | 2020-12-30T07:42:35.825771 | 2020-02-07T09:52:20 | 2020-02-07T09:52:20 | 238,906,940 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,634 | java | /**
*
*/
package com.cicro.analyzer.dic;
/**
* IK Analyzer v3.2
* 表示词典检索的命中结果
* @author 林良益
*
*/
public class Hit {
//Hit不匹配
private static final int UNMATCH = 0x00000000;
//Hit完全匹配
private static final int MATCH = 0x00000001;
//Hit前缀匹配
private static final int PREFIX = 0x00000010;
//该HIT当前状态,默认未匹配
private int hitState = UNMATCH;
//记录词典匹配过程中,当前匹配到的词典分支节点
private DictSegment matchedDictSegment;
/*
* 词段开始位置
*/
private int begin;
/*
* 词段的结束位置
*/
private int end;
/**
* 判断是否完全匹配
*/
public boolean isMatch() {
return (this.hitState & MATCH) > 0;
}
/**
*
*/
public void setMatch() {
this.hitState = this.hitState | MATCH;
}
/**
* 判断是否是词的前缀
*/
public boolean isPrefix() {
return (this.hitState & PREFIX) > 0;
}
/**
*
*/
public void setPrefix() {
this.hitState = this.hitState | PREFIX;
}
/**
* 判断是否是不匹配
*/
public boolean isUnmatch() {
return this.hitState == UNMATCH ;
}
/**
*
*/
public void setUnmatch() {
this.hitState = UNMATCH;
}
public DictSegment getMatchedDictSegment() {
return matchedDictSegment;
}
public void setMatchedDictSegment(DictSegment matchedDictSegment) {
this.matchedDictSegment = matchedDictSegment;
}
public int getBegin() {
return begin;
}
public void setBegin(int begin) {
this.begin = begin;
}
public int getEnd() {
return end;
}
public void setEnd(int end) {
this.end = end;
}
}
| [
"373974360@qq.com"
] | 373974360@qq.com |
c0a01a80945cb75391cb0a2309bc2c40347a972c | 40d844c1c780cf3618979626282cf59be833907f | /src/testcases/CWE113_HTTP_Response_Splitting/s01/CWE113_HTTP_Response_Splitting__Environment_setHeaderServlet_54a.java | 6b142be55a6e841d3ba774092fbf4b4502ad8a1b | [] | no_license | rubengomez97/juliet | f9566de7be198921113658f904b521b6bca4d262 | 13debb7a1cc801977b9371b8cc1a313cd1de3a0e | refs/heads/master | 2023-06-02T00:37:24.532638 | 2021-06-23T17:22:22 | 2021-06-23T17:22:22 | 379,676,259 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,772 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE113_HTTP_Response_Splitting__Environment_setHeaderServlet_54a.java
Label Definition File: CWE113_HTTP_Response_Splitting.label.xml
Template File: sources-sinks-54a.tmpl.java
*/
/*
* @description
* CWE: 113 HTTP Response Splitting
* BadSource: Environment Read data from an environment variable
* GoodSource: A hardcoded string
* Sinks: setHeaderServlet
* GoodSink: URLEncode input
* BadSink : querystring to setHeader()
* Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package
*
* */
package testcases.CWE113_HTTP_Response_Splitting.s01;
import testcasesupport.*;
import javax.servlet.http.*;
public class CWE113_HTTP_Response_Splitting__Environment_setHeaderServlet_54a extends AbstractTestCaseServlet
{
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* get environment variable ADD */
/* POTENTIAL FLAW: Read data from an environment variable */
data = System.getenv("ADD");
(new CWE113_HTTP_Response_Splitting__Environment_setHeaderServlet_54b()).badSink(data , request, response);
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B(request, response);
goodB2G(request, response);
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* FIX: Use a hardcoded string */
data = "foo";
(new CWE113_HTTP_Response_Splitting__Environment_setHeaderServlet_54b()).goodG2BSink(data , request, response);
}
/* goodB2G() - use badsource and goodsink */
private void goodB2G(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* get environment variable ADD */
/* POTENTIAL FLAW: Read data from an environment variable */
data = System.getenv("ADD");
(new CWE113_HTTP_Response_Splitting__Environment_setHeaderServlet_54b()).goodB2GSink(data , request, response);
}
/* 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);
}
}
| [
"you@example.com"
] | you@example.com |
48816493350b2b42f6ba0eac05847d40f328ad69 | a840a5e110b71b728da5801f1f3e591f6128f30e | /src/main/java/com/google/security/zynamics/binnavi/models/Bookmarks/memory/IBookmarkListener.java | c255d52a24c183167406cda01591a9a69459ac2d | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | tpltnt/binnavi | 0a25d2fde2c6029aeef4fcfec8eead5c8e51f4b4 | 598c361d618b2ca964d8eb319a686846ecc43314 | refs/heads/master | 2022-10-20T19:38:30.080808 | 2022-07-20T13:01:37 | 2022-07-20T13:01:37 | 107,143,332 | 0 | 0 | Apache-2.0 | 2023-08-20T11:22:53 | 2017-10-16T15:02:35 | Java | UTF-8 | Java | false | false | 1,082 | java | /*
Copyright 2011-2016 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.google.security.zynamics.binnavi.models.Bookmarks.memory;
/**
* This interface must be implemented by all classes that want to be notified about changes in
* memory bookmarks.
*/
public interface IBookmarkListener {
/**
* Invoked after the description of a bookmark changed.
*
* @param bookmark The bookmark whose description changed.
* @param description The new description of the bookmark.
*/
void changedDescription(CBookmark bookmark, String description);
}
| [
"cblichmann@google.com"
] | cblichmann@google.com |
b3268fbbf4491faba90836a8df06f0494b3b9c00 | 89fbd82dcf18d560e8cb9276b7ea72fe5e04c45c | /presto-main/src/main/java/com/facebook/presto/sql/planner/iterative/rule/RemoveUnreferencedScalarApplyNodes.java | 557d37e17d703f1b4b1690ae9f61738e899b39c6 | [
"Apache-2.0"
] | permissive | isthari/presto | fa21abd5a88f78d72a95946a04f3162ea07b350e | 04966f1edfd1a55f6f649778b337af5752084a01 | refs/heads/master | 2021-08-30T03:51:00.289446 | 2017-12-15T22:10:11 | 2017-12-15T22:10:11 | 114,416,418 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,393 | java | /*
* 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.facebook.presto.sql.planner.iterative.rule;
import com.facebook.presto.matching.Pattern;
import com.facebook.presto.sql.planner.iterative.Rule;
import com.facebook.presto.sql.planner.plan.ApplyNode;
import com.facebook.presto.sql.planner.plan.PlanNode;
import java.util.Optional;
public class RemoveUnreferencedScalarApplyNodes
implements Rule
{
private static final Pattern PATTERN = Pattern.typeOf(ApplyNode.class);
@Override
public Pattern getPattern()
{
return PATTERN;
}
@Override
public Optional<PlanNode> apply(PlanNode node, Context context)
{
ApplyNode applyNode = (ApplyNode) node;
if (applyNode.getSubqueryAssignments().isEmpty()) {
return Optional.of(applyNode.getInput());
}
return Optional.empty();
}
}
| [
"g.kokosinski@gmail.com"
] | g.kokosinski@gmail.com |
07cf8beb018408c81b12932742d26041199cffba | 1e9c9f2a9639db7cdb032aae69cb4d99aef1d3a5 | /codeChef/src/medium/unsolved/Cylinder.java | bb30ed96120b77091928d1f087d876833d471e90 | [
"MIT"
] | permissive | sagarnikam123/learnNPractice | f0da3f8acf653e56c591353ab342765a6831698c | 1b3b0cb2cff2f478006626a4c37a99102acbb628 | refs/heads/master | 2023-02-04T11:21:18.211654 | 2023-01-24T14:47:52 | 2023-01-24T14:47:52 | 61,184,927 | 2 | 1 | MIT | 2022-03-06T11:07:18 | 2016-06-15T06:57:19 | Python | UTF-8 | Java | false | false | 2,540 | java | /**
Cylinder
Chef wants to make a steel container. The container should be of cylindrical form and should have as
large volume as possible. He has a rectangular steel sheet of the size W × H for this. His plan is the following:
At first he cuts the sheet into two rectangular sheets by horizontal or vertical cut.
Then he takes one of the obtained sheets and cuts out two equal non-overlapping circles from it.
Let the radius of each circle be R.Finally he cuts out the rectangular sheet of the size 2πR × A for
maximal possible A from the second sheet, with sizes parallel to the sides of the second sheet.
He will use it as a lateral surface of the container. Namely, he rolls up the obtained sheet
along the side 2πR to obtain the lateral surface of cylinder.
Thus, Chef obtains the cylindrical container of height A and radius R, having bottom and top made from steel.
Chef is aware of your advanced math abilities and asks you for help to find the optimal container.
Output the maximum volume of the container that could be achieved by the above scheme.
Input
The first line of the input contains an integer T denoting the number of test cases.
The description of T test cases follows. The only line of each test case contains two space-separated integers W and H.
Output
For each test case, output a single line containing the maximum volume of the container.
Your answer will be considered as correct if it has a relative error less than 10−11.
More formally, if the correct output is A and your output is B,
your output will be considered as correct if and only if |A − B| ≤ 10−11 * A.
Constrains
1 ≤ T ≤ 400000 (4 * 105)
1 ≤ W ≤ 999999 (106 − 1)
1 ≤ H ≤ 999999 (106 − 1)
***********************************************************************************************************************
Example
Input:
3
4 4
2 3
1 6
Output:
3.471819240663
0.824190535860
0.785398163397
Explanation
In all examples blue circles are top and bottom of container. Yellow rectangle is used to create lateral surface.
Namely, we roll up it along the direction of blue arrow to match green borders.
Example case 1:
R ≅ 0.63662, A ≅ 2.72676.
Example case 2:
R ≅ 0.36218, A = 2.
Example case 3:
R = 0.5, A = 1.
**********************************************************************************************************************/
package medium.unsolved;
public class Cylinder {
public static void main(String[] args) {
}
}
| [
"sagarnikam123@gmail.com"
] | sagarnikam123@gmail.com |
bc89a8d80322289f8ea56c67a0d38ffd08eb9eb1 | 49b57339d939ea3f498249d3aacca1dec543163b | /jadx-snap-new/sources/com/snap/stickers/ui/views/infosticker/AutoScaleInfoStickerView.java | 7975ea15a4ae581de2f42377af0cd19d07c04ce7 | [] | no_license | 8secz-johndpope/snapchat-re | 1655036c41518c3a2aaa0c2543dc49f4acb93eaf | 04f5c5bb627d21f620088525fffcf5c99abd7ce5 | refs/heads/master | 2020-08-24T09:14:38.209745 | 2019-06-14T05:13:44 | 2019-06-14T05:13:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,148 | java | package com.snap.stickers.ui.views.infosticker;
import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.MeasureSpec;
import android.widget.FrameLayout;
import defpackage.akcr;
public final class AutoScaleInfoStickerView extends FrameLayout {
private float a;
public AutoScaleInfoStickerView(Context context, AttributeSet attributeSet) {
this(context, attributeSet, (byte) 0);
}
private AutoScaleInfoStickerView(Context context, AttributeSet attributeSet, char c) {
akcr.b(context, "context");
super(context, attributeSet, 0);
this.a = 1.0f;
setClipChildren(false);
setWillNotDraw(false);
}
/* Access modifiers changed, original: protected|final */
public final boolean drawChild(Canvas canvas, View view, long j) {
if (this.a == 1.0f) {
return super.drawChild(canvas, view, j);
}
if (view == null || canvas == null) {
return false;
}
canvas.save();
float measuredWidth = (float) view.getMeasuredWidth();
float measuredWidth2 = (float) view.getMeasuredWidth();
float f = this.a;
measuredWidth = (measuredWidth - (measuredWidth2 * f)) / 2.0f;
canvas.scale(f, f);
canvas.translate(measuredWidth, measuredWidth);
boolean drawChild = super.drawChild(canvas, view, j);
canvas.restore();
return drawChild;
}
/* Access modifiers changed, original: protected|final */
public final void onMeasure(int i, int i2) {
super.onMeasure(i, i2);
if (getChildCount() == 1) {
i2 = MeasureSpec.getMode(0);
int size = MeasureSpec.getSize(0);
Object childAt = getChildAt(0);
childAt.measure(i2, size);
akcr.a(childAt, "child");
float measuredWidth = (float) childAt.getMeasuredWidth();
float measuredWidth2 = (float) getMeasuredWidth();
this.a = measuredWidth > measuredWidth2 ? measuredWidth2 / measuredWidth : 1.0f;
}
}
}
| [
"blevy@protonmail.com"
] | blevy@protonmail.com |
6740d02c194cc06846aacb671f52c0e4fac034ab | 18237bc643deab327a4b49b16b49ed4154f5f99b | /ambit2-apps/ambit2-www/src/main/java/ambit2/rest/routers/misc/BookmarksRouter.java | e1f9f0f4fb158d82484ced3b3a8d19088b808088 | [] | no_license | ideaconsult/ambit-mirror | 14ce076cd286ca4f5dc3465ed4105b03967c7cf0 | 21655a99791ef2f538786367f6dc779d3bff0200 | refs/heads/master | 2023-08-22T20:26:43.554464 | 2023-07-15T10:35:41 | 2023-07-15T10:35:41 | 133,390,762 | 5 | 3 | null | 2022-05-16T18:53:27 | 2018-05-14T16:28:03 | Java | UTF-8 | Java | false | false | 829 | java | package ambit2.rest.routers.misc;
import org.restlet.Context;
import ambit2.rest.bookmark.BookmarkResource;
import ambit2.rest.bookmark.BookmarkTopicsResource;
import ambit2.rest.routers.MyRouter;
/**
* Resource /bookmark
*/
public class BookmarksRouter extends MyRouter {
public BookmarksRouter(Context context) {
super(context);
init();
}
protected void init() {
attach(String.format("/{%s}",BookmarkResource.creator),BookmarkResource.class);
attach(String.format("/{%s}/topics",
BookmarkResource.creator),BookmarkTopicsResource.class);
attach(String.format("/{%s}/entries",BookmarkResource.creator),BookmarkResource.class);
attach(String.format("/{%s}/entries/{%s}",
BookmarkResource.creator,
BookmarkResource.idbookmark),BookmarkResource.class);
}
}
| [
"jeliazkova.nina@gmail.com"
] | jeliazkova.nina@gmail.com |
93d8826d9cccc6f002f50865141cb1413ba3e551 | 14b86c1810dd2f93e681ed2cd81222b920cb936a | /src/main/java/zh/learn/javafx/ch20effects/ReflectionTest.java | 03f6409525252c04e95c99749786c8f6cf19d070 | [] | no_license | dzheleznyakov/LearningJavaFx | 26b7fa8940c8670233c60ebb2ff5704635c9683c | d5feaf5ed716aee9308c9d481e10403e63a84982 | refs/heads/master | 2021-07-08T05:42:23.347341 | 2019-12-18T17:36:49 | 2019-12-18T17:36:49 | 200,179,208 | 0 | 0 | null | 2020-10-13T15:27:52 | 2019-08-02T06:34:10 | Java | UTF-8 | Java | false | false | 3,078 | java | package zh.learn.javafx.ch20effects;
import javafx.application.Application;
import javafx.beans.property.DoubleProperty;
import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.control.Slider;
import javafx.scene.control.TextField;
import javafx.scene.effect.Reflection;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import zh.learn.javafx.Aux;
public class ReflectionTest extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) {
Text t = new Text("Reflection");
t.setFont(Font.font(null, FontWeight.BOLD, 24));
Reflection reflection = new Reflection(2.0, 0.9, 1.0, 1.0);
t.setEffect(reflection);
GridPane sliders = getSliders(reflection);
BorderPane root = new BorderPane();
root.setCenter(t);
BorderPane.setAlignment(t, Pos.TOP_CENTER);
root.setBottom(sliders);
Aux.style(root);
Aux.showStage(stage, root, 600, 300, "Using the Reflection Effect");
}
private GridPane getSliders(Reflection reflection) {
Slider topOffsetSlider = Aux.getSlider(0, 100, 5, reflection.topOffsetProperty());
TextField topOffsetTf = new TextField();
bind(topOffsetTf, topOffsetSlider);
Slider fractionSlider = Aux.getSlider(0, 1, 0.1, reflection.fractionProperty());
TextField fractionTf = new TextField();
bind(fractionTf, fractionSlider);
Slider topOpacitySlider = Aux.getSlider(0, 1, 0.1, reflection.topOpacityProperty());
TextField topOpacityTf = new TextField();
bind(topOpacityTf, topOpacitySlider);
Slider bottomOpacitySlider = Aux.getSlider(0, 1, 0.1, reflection.bottomOpacityProperty());
TextField bottomOpacityTf = new TextField();
bind(bottomOpacityTf, bottomOpacitySlider);
GridPane grid = new GridPane();
grid.setVgap(5);
grid.setHgap(10);
grid.addRow(0, new Label("Top Offset:"), topOffsetSlider, topOffsetTf);
grid.addRow(1, new Label("Fraction:"), fractionSlider, fractionTf);
grid.addRow(2, new Label("Top Opacity:"), topOpacitySlider, topOpacityTf);
grid.addRow(3, new Label("Bottom Opacity:"), bottomOpacitySlider, bottomOpacityTf);
return grid;
}
private void bind(TextField tf, Slider slider) {
tf.setPrefColumnCount(3);
tf.setText(String.valueOf(slider.getValue()));
tf.textProperty().addListener((observable, oldValue, newValue) -> {
try {
double value = Double.parseDouble(newValue);
slider.setValue(value);
} catch (Exception e) {
e.printStackTrace();
}
});
slider.valueProperty().addListener(((observable, oldValue, newValue) -> {
tf.setText(String.valueOf(newValue));
}));
}
}
| [
"zheleznyakov.dmitry@gmail.com"
] | zheleznyakov.dmitry@gmail.com |
2673fb8d6506e236f6be3b219011dfc801cb50e9 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/6/6_d7ffdc7e77671ecd844b43b83c0e1785ceea02df/DatabaseClusterFactory/6_d7ffdc7e77671ecd844b43b83c0e1785ceea02df_DatabaseClusterFactory_t.java | dd4d546577f695acd466360289f0319fb2bf9987 | [] | 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 | 5,545 | java | /*
* HA-JDBC: High-Availability JDBC
* Copyright (C) 2004 Paul Ferraro
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: ferraro@users.sourceforge.net
*/
package net.sf.hajdbc;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.management.ObjectName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jibx.runtime.BindingDirectory;
import org.jibx.runtime.IBindingFactory;
import org.jibx.runtime.IUnmarshallingContext;
/**
* @author Paul Ferraro
* @version $Revision$
* @since 1.0
*/
public final class DatabaseClusterFactory
{
private static final String SYSTEM_PROPERTY = "ha-jdbc.configuration";
private static final String DEFAULT_RESOURCE = "ha-jdbc.xml";
private static Log log = LogFactory.getLog(DatabaseClusterFactory.class);
private static DatabaseClusterFactory instance = null;
public static synchronized DatabaseClusterFactory getInstance() throws java.sql.SQLException
{
if (instance == null)
{
instance = new DatabaseClusterFactory();
}
return instance;
}
private Map databaseClusterMap;
private DatabaseClusterFactory() throws java.sql.SQLException
{
String resourceName = System.getProperty(SYSTEM_PROPERTY, DEFAULT_RESOURCE);
URL resourceURL = getResourceURL(resourceName);
if (resourceURL == null)
{
throw new SQLException("Failed to locate database cluster configuration file: " + resourceName);
}
InputStream inputStream = null;
MBeanServer server = null;
try
{
inputStream = resourceURL.openStream();
IBindingFactory factory = BindingDirectory.getFactory(Configuration.class);
IUnmarshallingContext context = factory.createUnmarshallingContext();
Configuration configuration = (Configuration) context.unmarshalDocument(new InputStreamReader(inputStream));
List serverList = MBeanServerFactory.findMBeanServer(null);
if (serverList.isEmpty())
{
server = MBeanServerFactory.createMBeanServer();
}
else
{
server = (MBeanServer) serverList.get(0);
}
List descriptorList = configuration.getDescriptorList();
this.databaseClusterMap = new HashMap(descriptorList.size());
Iterator descriptors = descriptorList.iterator();
while (descriptors.hasNext())
{
DatabaseClusterDescriptor descriptor = (DatabaseClusterDescriptor) descriptors.next();
DatabaseCluster databaseCluster = descriptor.createDatabaseCluster();
DatabaseClusterDecoratorDescriptor decoratorDescriptor = configuration.getDecoratorDescriptor();
if (decoratorDescriptor != null)
{
databaseCluster = decoratorDescriptor.decorate(databaseCluster);
}
ObjectName name = ObjectName.getInstance("net.sf.hajdbc", "cluster", ObjectName.quote(databaseCluster.getId()));
if (!server.isRegistered(name))
{
server.registerMBean(databaseCluster, name);
}
this.databaseClusterMap.put(descriptor.getId(), databaseCluster);
}
}
catch (Exception e)
{
SQLException exception = new SQLException("Failed to configure HA-JDBC using " + resourceURL, e);
log.warn(exception.getMessage(), e);
throw exception;
}
finally
{
if (inputStream != null)
{
try
{
inputStream.close();
}
catch (IOException e)
{
log.warn("Failed to close " + resourceURL, e);
}
}
}
}
public DatabaseCluster getDatabaseCluster(String name)
{
return (DatabaseCluster) this.databaseClusterMap.get(name);
}
private static URL getResourceURL(String resourceName)
{
try
{
return new URL(resourceName);
}
catch (MalformedURLException e)
{
URL url = Thread.currentThread().getContextClassLoader().getResource(resourceName);
if (url == null)
{
url = DatabaseClusterFactory.class.getClassLoader().getResource(resourceName);
}
if (url == null)
{
url = ClassLoader.getSystemResource(resourceName);
}
return url;
}
}
private static class Configuration
{
private DatabaseClusterDecoratorDescriptor decoratorDescriptor = null;
private List descriptorList = new LinkedList();
public DatabaseClusterDecoratorDescriptor getDecoratorDescriptor()
{
return this.decoratorDescriptor;
}
public List getDescriptorList()
{
return this.descriptorList;
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
d797a0f6f68742ff0e6ef5ac91e9e9a15af6f4f2 | a280aa9ac69d3834dc00219e9a4ba07996dfb4dd | /regularexpress/home/weilaidb/work/java/je-6.4.25/src/com/sleepycat/je/rep/impl/networkRestore/LogFileFeeder.java | abe652b9501a5e2a617d242c65a4df3ead936eee | [] | no_license | weilaidb/PythonExample | b2cc6c514816a0e1bfb7c0cbd5045cf87bd28466 | 798bf1bdfdf7594f528788c4df02f79f0f7827ce | refs/heads/master | 2021-01-12T13:56:19.346041 | 2017-07-22T16:30:33 | 2017-07-22T16:30:33 | 68,925,741 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,491 | java | package com.sleepycat.je.rep.impl.networkRestore;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedByInterruptException;
import java.nio.channels.FileChannel;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.logging.Logger;
import com.sleepycat.je.DatabaseException;
import com.sleepycat.je.EnvironmentFailureException;
import com.sleepycat.je.dbi.EnvironmentFailureReason;
import com.sleepycat.je.log.FileManager;
import com.sleepycat.je.rep.impl.RepImpl;
import com.sleepycat.je.rep.impl.networkRestore.Protocol.FeederInfoReq;
import com.sleepycat.je.rep.impl.networkRestore.Protocol.FileInfoReq;
import com.sleepycat.je.rep.impl.networkRestore.Protocol.FileInfoResp;
import com.sleepycat.je.rep.impl.networkRestore.Protocol.FileReq;
import com.sleepycat.je.rep.net.DataChannel;
import com.sleepycat.je.rep.utilint.BinaryProtocol.ClientVersion;
import com.sleepycat.je.rep.utilint.BinaryProtocol.ProtocolException;
import com.sleepycat.je.rep.utilint.NamedChannel;
import com.sleepycat.je.rep.utilint.RepUtils;
import com.sleepycat.je.rep.vlsn.VLSNRange;
import com.sleepycat.je.util.DbBackup;
import com.sleepycat.je.utilint.LogVerifier;
import com.sleepycat.je.utilint.LoggerUtils;
import com.sleepycat.je.utilint.StoppableThread;
import com.sleepycat.je.utilint.VLSN;
public class LogFileFeeder extends StoppableThread
| [
"weilaidb@localhost.localdomain"
] | weilaidb@localhost.localdomain |
fbd3aed3a88c28fcfea70b1325d3774947c684f5 | 4cc98406de4a60e1d07c06886a73d9763477d096 | /java/src/ngat/tcm/TelescopeAlignmentAdjuster.java | b6d11204184b3da6a4c88ea4852f97bce4182891 | [] | no_license | LivTel/telescope-control-monitoring | ce230a463522706d5c039ee353edb3e7303df79d | e78d5aea12c0fd3b0cad9d335baedb331ce62a86 | refs/heads/master | 2021-05-25T11:55:42.136205 | 2020-08-27T14:35:28 | 2020-08-27T14:35:28 | 23,384,080 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 903 | java | package ngat.tcm;
import ngat.phase2.IMosaicOffset;
import java.rmi.*;
public interface TelescopeAlignmentAdjuster extends Remote {
public void startAdjustments(String info) throws RemoteException;
public void stopAdjustments() throws RemoteException;
/** Make a single adjustment for the supplied rotator position.*/
public void makeAdjustment(double rot) throws RemoteException;
public void enableAdjustmentsInterval(long interval) throws RemoteException;
public void enableAdjustmentsTrigger() throws RemoteException;
public void enableAdjustmentsSingle() throws RemoteException;
public void disableAdjustments() throws RemoteException;
public boolean adjustmentsEnabled() throws RemoteException;
/** @return the position (tweak) offsets for a specified rotator position.*/
public IMosaicOffset getOffsets(double rot) throws RemoteException;
} | [
"snf@astro.livjm.ac.uk"
] | snf@astro.livjm.ac.uk |
d9162dc6a861e574677c814bbab20355fb4a40d0 | 96f7f6322c3e3a5f009dad9bce1e231b5a57a5e8 | /ProjectDesignPartners/src/main/java/Pack20DesignPatterns/ArchitecturalStandards/flux/view/ContentView.java | c4de426b336e7277bd6d1e5bad0d8577e4282ba3 | [] | no_license | weder96/javaaula21 | 09cb63a2e6f3fe7ac34f166315ae3024113a4dd3 | 8f4245a922eea74747644ad2f4a0f2b3396c319e | refs/heads/main | 2023-08-23T10:47:43.216438 | 2021-10-27T21:46:45 | 2021-10-27T21:46:45 | 421,982,565 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 664 | java | package Pack20DesignPatterns.ArchitecturalStandards.flux.view;
import Pack20DesignPatterns.ArchitecturalStandards.flux.action.Content;
import Pack20DesignPatterns.ArchitecturalStandards.flux.store.ContentStore;
import Pack20DesignPatterns.ArchitecturalStandards.flux.store.Store;
/**
*
* ContentView is a concrete view.
*
*/
public class ContentView implements View {
private Content content = Content.PRODUCTS;
@Override
public void storeChanged(Store store) {
ContentStore contentStore = (ContentStore) store;
content = contentStore.getContent();
render();
}
@Override
public void render() {
System.out.println(content.toString());
}
}
| [
"weder96@gmail.com"
] | weder96@gmail.com |
4e750f44e386db5f2be2f3cd039fee38e0a85a18 | 4ef431684e518b07288e8b8bdebbcfbe35f364e4 | /ceapm/cics/default/src/main/java/com/ca/apm/powerpack/sysview/cics/dflt/callprog/Visualization.java | c74a781186bee6278815b18ddc887b6337d6eb39 | [] | no_license | Sarojkswain/APMAutomation | a37c59aade283b079284cb0a8d3cbbf79f3480e3 | 15659ce9a0030c2e9e5b992040e05311fff713be | refs/heads/master | 2020-03-30T00:43:23.925740 | 2018-09-27T23:42:04 | 2018-09-27T23:42:04 | 150,540,177 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,634 | java | /*
* Copyright (c) 2016 CA. All rights reserved.
*
* This software and all information contained therein is confidential and
* proprietary and shall not be duplicated, used, disclosed or disseminated in
* any way except as authorized by the applicable license agreement, without
* the express written permission of CA. All authorized reproductions must be
* marked with this language.
*
* EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO THE EXTENT
* PERMITTED BY APPLICABLE LAW, CA PROVIDES THIS SOFTWARE WITHOUT WARRANTY OF
* ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL CA BE
* LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR
* INDIRECT, FROM THE USE OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, LOST
* PROFITS, BUSINESS INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF CA IS
* EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE.
*/
package com.ca.apm.powerpack.sysview.cics.dflt.callprog;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Simple class that can be used to generate visualizations of an actions tree.
*/
public class Visualization {
public static final String INIT_LABEL = "INIT";
private Map<String, String> nodes = new LinkedHashMap<>();
private Map<String, List<String>> edges = new LinkedHashMap<>();
public Visualization(List<Action> actions) {
String initId = getVertexId(actions, 0);
addVertex(initId, INIT_LABEL);
addActions(initId, actions);
}
public String getDotGraph() {
StringBuilder dotGraph = new StringBuilder();
dotGraph.append("digraph actions {").append(System.lineSeparator());
dotGraph.append(" node [fontname=Courier,fontsize=10,shape=box,style=filled,"
+ "fillcolor=lightblue];").append(System.lineSeparator());
dotGraph.append(" edge [arrowsize=0.5, weight=2];").append(System.lineSeparator());
for (Map.Entry<String, String> node : nodes.entrySet()) {
dotGraph.append(" \"").append(node.getKey()).append("\"[label=\"")
.append(node.getValue()).append("\"");
if (node.getValue().startsWith("Delay")) {
dotGraph.append(",fillcolor=yellowgreen,shape=octagon");
} else if (node.getValue().startsWith("Abend")) {
dotGraph.append(",fillcolor=orangered,shape=ellipse");
} else if (node.getValue().equals(INIT_LABEL)) {
dotGraph.append(",fillcolor=dodgerblue,shape=diamond");
}
dotGraph.append("];").append(System.lineSeparator());
}
for (String from : edges.keySet()) {
String targets = edges.get(from).stream()
.map(id -> "\"" + id + "\"")
.collect(Collectors.joining(","));
dotGraph.append(" \"").append(from).append("\" -> {").append(targets).append("};")
.append(System.lineSeparator());
dotGraph.append(" {rank=same;").append(targets).append("};")
.append(System.lineSeparator());
}
dotGraph.append("}");
return dotGraph.toString();
}
private void addActions(String parentId, List<Action> actions) {
assert parentId != null;
assert actions != null;
for (Action action : actions) {
for (int i = 0; i < action.getCount(); ++i) {
String id = getVertexId(action, i);
addVertex(id, action.toString());
addEdge(parentId, id);
if (action.getProgram() != null && action.getSubActions() != null) {
final List<Action> subActions = action.getSubActions();
addActions(id, subActions);
}
}
}
}
private static String getVertexId(Object action, int sequence) {
assert action != null;
return Integer.toHexString(action.hashCode()) + "_" + sequence;
}
private void addVertex(String id, String label) {
assert id != null;
assert label != null;
assert !nodes.containsKey(id);
nodes.put(id, label);
}
private void addEdge(String fromId, String toId) {
assert fromId != null;
assert toId != null;
if (!edges.containsKey(fromId)) {
edges.put(fromId, new ArrayList<>());
}
assert !edges.get(fromId).contains(toId);
edges.get(fromId).add(toId);
}
}
| [
"sarojkswain@gmail.com"
] | sarojkswain@gmail.com |
fc970703c722efa139799762cd4b2fae10d44528 | 9fc6f1d415c8cb341e848863af535dae5b22a48b | /Eclipse_Workspace_Core Java/collection/src/com/collection/Collection.java | 7c4904d3aff3dc1f9d4cfa2102424424a007deb9 | [] | no_license | MahanteshAmbali/eclipse_workspaces | f7a063f7dd8c247d610f78f0105f9f632348b187 | 1f6d3a7eb0264b500877a718011bf6b842161fa1 | refs/heads/master | 2020-04-17T04:50:33.167337 | 2019-01-17T15:53:13 | 2019-01-17T15:53:13 | 166,226,211 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,034 | java | package com.collection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
public class Collection extends ArrayList{
/**
*
*/
private static final long serialVersionUID = 1L;
public static void main(String[] args) {
ArrayList list = new ArrayList();
list.add(0,new Integer(10));
list.add(1,new Integer(20));
list.add(2,new Integer(30));
list.add(3,new Integer(40));
list.add(4,new Integer(50));
list.add(5,new Integer(60));
list.add(6,new Integer(70));
Collection collection = new Collection();
collection.add(new Integer(10));
collection.add(new Integer(50));
collection.add(new Integer(60));
collection.add(new Integer(40));
collection.add(new Integer(20));
collection.add(new Integer(30));
collection.add(new Integer(70));
collection.add(new String("ab"));
Collections.sort(list);
System.out.println(list);
Comparator comparator = Collections.reverseOrder();
Collections.sort(list, comparator);
System.out.println(list);
}
}
| [
"mahantesh378@gmail.com"
] | mahantesh378@gmail.com |
fca7907ba0aa4100b2428b28dee62692060697a6 | 19490fcc6f396eeb35a9234da31e7b615abf6d04 | /JDownloader/src/jd/plugins/decrypter/PurevolumeComDecrypter.java | e1ccc46978f6e2bf7e23df851ee8097e4cf70539 | [] | no_license | amicom/my-project | ef72026bb91694e74bc2dafd209a1efea9deb285 | 951c67622713fd89448ffe6e0983fe3f934a7faa | refs/heads/master | 2021-01-02T09:15:45.828528 | 2015-09-06T15:57:01 | 2015-09-06T15:57:01 | 41,953,961 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,943 | java | //jDownloader - Downloadmanager
//Copyright (C) 2012 JD-Team support@jdownloader.org
//
//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/>.
package jd.plugins.decrypter;
import java.util.ArrayList;
import jd.PluginWrapper;
import jd.controlling.ProgressController;
import jd.nutils.encoding.Encoding;
import jd.plugins.CryptedLink;
import jd.plugins.DecrypterPlugin;
import jd.plugins.DownloadLink;
import jd.plugins.FilePackage;
import jd.plugins.PluginForDecrypt;
@DecrypterPlugin(revision = "$Revision: 30019 $", interfaceVersion = 2, names = { "purevolume.com" }, urls = { "http://(www\\.)?purevolume\\.com/(new/)?\\w+(/albums/[\\w\\+\\-]+)?" }, flags = { 0 })
public class PurevolumeComDecrypter extends PluginForDecrypt {
public PurevolumeComDecrypter(final PluginWrapper wrapper) {
super(wrapper);
}
private static final String INVALIDLINKS = "http://(www\\.)?purevolume\\.com/(search|signup|faq|artist_promotion|labels|news|festivals|events|advertise|past_features|login|charts|support|top_songs|about_us|browse|people|pure_promos_about|link_to_purevolume|terms_of_use|top_downloads|albums)";
public ArrayList<DownloadLink> decryptIt(final CryptedLink param, final ProgressController progress) throws Exception {
final ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
String parameter = param.toString();
br.setFollowRedirects(true);
br.getPage(parameter);
if (br.containsHTML("id=\"page_not_found\"") || br.getHttpConnection().getResponseCode() == 403 || br.getHttpConnection().getResponseCode() == 404) {
logger.info("Link offline: " + parameter);
decryptedLinks.add(this.createOfflinelink(parameter));
return decryptedLinks;
}
if (br.getURL().contains("purevolume.com/login") || parameter.matches(INVALIDLINKS)) {
logger.info("Invalid link: " + parameter);
decryptedLinks.add(this.createOfflinelink(parameter));
return decryptedLinks;
}
String type = "Artist";
String songId = br.getRegex("\'Artist\'\\s?,\\s?\'(\\d+)\'").getMatch(0);
if (songId == null) {
songId = br.getRegex("\'Album\'\\s?,\\s?\'(\\d+)\'").getMatch(0);
type = "Album";
}
if (songId == null) {
logger.warning("Decrypter out of date for link: " + parameter);
return null;
}
FilePackage fp = FilePackage.getInstance();
br.getPage("/_controller/playlist.php?userType=" + type + "&userId=" + songId + "&type=" + type + "Playlist&offset=0&moduleId=player_container&action=getMoreTracks");
String playListItems = br.getRegex("<playlist_items>(.*?)</playlist_items>").getMatch(0);
if (playListItems == null) {
logger.warning("Decrypter out of date for link: " + parameter);
return null;
}
br.getRequest().setHtmlCode(Encoding.htmlDecode(playListItems));
String artist = br.getRegex("\'album_name\'\\s?:\\s?\'([^\']+)'").getMatch(0);
String album = br.getRegex("\'artist_name\'\\s?:\\s?\'([^\']+)'").getMatch(0);
if (artist == null) {
artist = "Unknown";
}
if (album == null) {
album = "Unknown";
}
fp.setName(Encoding.htmlDecode(album.trim() + "@" + artist.trim()).replaceAll("\\\\", ""));
parameter = parameter.replace("http://", "decrypted://");
for (String item[] : br.getRegex("alias=\"([^\"]+)\">([^<]+)</a>").getMatches()) {
DownloadLink link = createDownloadlink(parameter + "&songId=" + item[0]);
link.setProperty("SONGID", item[0]);
link.setFinalFileName(Encoding.htmlDecode(item[1].trim()) + ".mp3");
if (!getPluginConfig().getBooleanProperty("FILESIZECHECK", false)) {
link.setAvailable(true);
}
link.setContentUrl(br.getURL());
fp.add(link);
try {
distribute(link);
} catch (final Throwable e) {
/* does not exist in 09581 */
}
decryptedLinks.add(link);
}
return decryptedLinks;
}
/* NO OVERRIDE!! */
public boolean hasCaptcha(CryptedLink link, jd.plugins.Account acc) {
return false;
}
} | [
"amicom.pro@gmail.com"
] | amicom.pro@gmail.com |
89d491e861483b6194d2b3a971fe95d080df81df | 40665051fadf3fb75e5a8f655362126c1a2a3af6 | /eiswind-jackrabbit-orient/fa3328661034a3092cab1abbfac93130b4f17373/180/AbstractQueryLevel2Test.java | d91bd14abbcba3a0682e52e307b370297b505d49 | [] | no_license | fermadeiral/StyleErrors | 6f44379207e8490ba618365c54bdfef554fc4fde | d1a6149d9526eb757cf053bc971dbd92b2bfcdf1 | refs/heads/master | 2020-07-15T12:55:10.564494 | 2019-10-24T02:30:45 | 2019-10-24T02:30:45 | 205,546,543 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,144 | 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.jackrabbit.test.api.query;
import org.apache.jackrabbit.test.NotExecutableException;
import javax.jcr.nodetype.NodeType;
import javax.jcr.query.RowIterator;
import javax.jcr.query.Row;
import javax.jcr.Value;
import javax.jcr.RepositoryException;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
/**
* Implements common setup methods for level 2 queries.
*/
public abstract class AbstractQueryLevel2Test extends AbstractQueryTest {
/**
* Creates two nodes with name {@link #nodeName1} and {@link #nodeName2}
* with nodetype {@link #testNodeType}. The node type must allow a String
* property with name {@link #propertyName1} which is fulltext indexed.
*/
protected void setUpFullTextTest() throws RepositoryException {
Node node = testRootNode.addNode(nodeName1, testNodeType);
node.setProperty(propertyName1, "The quick brown fox jumps over the lazy dog.");
node = testRootNode.addNode(nodeName2, testNodeType);
node.setProperty(propertyName1, "The quick brown cat jumps over the lazy dog.");
testRootNode.save();
}
/**
* Creates three nodes with names: {@link #nodeName1}, {@link #nodeName2}
* and {@link #nodeName3}. All nodes are of node type {@link #testNodeType}.
* the node type must allow a String property with name {@link
* #propertyName1}.
*/
protected void setUpRangeTest() throws RepositoryException {
Node node = testRootNode.addNode(nodeName1, testNodeType);
node.setProperty(propertyName1, "a");
node = testRootNode.addNode(nodeName2, testNodeType);
node.setProperty(propertyName1, "b");
Node cNode = node.addNode(nodeName3, testNodeType);
cNode.setProperty(propertyName1, "c");
testRootNode.save();
}
/**
* Creates three nodes with names: {@link #nodeName1}, {@link #nodeName2}
* and {@link #nodeName3}. All nodes are of node type {@link #testNodeType}.
* the node type must allow a String property with name {@link
* #propertyName1} and a multi valued String property with name {@link
* #propertyName2}.
* <p>
* If the node type does not support multi values for {@link #propertyName2}
* a {@link org.apache.jackrabbit.test.NotExecutableException} is thrown.
*/
protected void setUpMultiValueTest() throws RepositoryException, NotExecutableException {
// check if NodeType supports mvp
NodeType nt = superuser.getWorkspace().getNodeTypeManager().getNodeType(testNodeType);
Value[] testValue = new Value[]{superuser.getValueFactory().createValue("one"), superuser.getValueFactory().createValue("two"), superuser.getValueFactory().createValue("three")};
if (!nt.canSetProperty(propertyName2, testValue)) {
throw new NotExecutableException("Property " + propertyName2 + " of NodeType " + testNodeType + " does not allow multi values");
}
Node node = testRootNode.addNode(nodeName1, testNodeType);
node.setProperty(propertyName1, "existence");
node.setProperty(propertyName2, testValue);
node = testRootNode.addNode(nodeName2, testNodeType);
node.setProperty(propertyName1, "nonexistence");
node.setProperty(propertyName2, new String[]{"one", "three"});
Node cNode = node.addNode(nodeName3, testNodeType);
cNode.setProperty(propertyName1, "existence");
testRootNode.save();
}
/**
* Tests if all results contain only the searched value is contained in the
* selected property
*
* @param itr rows of the query result.
* @param propertyName selected property, that should contain the value.
* @param expectedValue the value that is expected to be found
*/
protected void checkValue(RowIterator itr,
String propertyName,
String expectedValue) throws RepositoryException {
while (itr.hasNext()) {
Row row = itr.nextRow();
// check fullText
Value value = row.getValue(propertyName);
if (value == null) {
fail("Search Test: fails result does not contain value for selected property");
}
assertEquals("Value in query result row does not match expected value",
expectedValue, value.getString());
}
}
/**
* Checks if all nodes in <code>itr</code> have a property with name
* <code>propertyName</code> and have the <code>expectedValue</code>.
*
* @param itr the nodes to check.
* @param propertyName the name of the property.
* @param expectedValue the exected value of the property.
* @throws javax.jcr.RepositoryException if an error occurs.
*/
protected void checkValue(NodeIterator itr,
String propertyName,
String expectedValue) throws RepositoryException {
while (itr.hasNext()) {
Node node = itr.nextNode();
// check fullText
Value value = node.getProperty(propertyName).getValue();
assertEquals("Value in query result row does not match expected value",
expectedValue, value.getString());
}
}
}
| [
"fer.madeiral@gmail.com"
] | fer.madeiral@gmail.com |
e77cfee481e36746a5c2f2cc587de5f52d189ac5 | 258de8e8d556901959831bbdc3878af2d8933997 | /utopia-service/utopia-newexam/utopia-newexam-api/src/main/java/com/voxlearning/utopia/service/newexam/api/constant/NewExamConstants.java | cf47083889c42b37af9a8292ed9fa1e4b22d224b | [] | no_license | Explorer1092/vox | d40168b44ccd523748647742ec376fdc2b22160f | 701160b0417e5a3f1b942269b0e7e2fd768f4b8e | refs/heads/master | 2020-05-14T20:13:02.531549 | 2019-04-17T06:54:06 | 2019-04-17T06:54:06 | 181,923,482 | 0 | 4 | null | 2019-04-17T15:53:25 | 2019-04-17T15:53:25 | null | UTF-8 | Java | false | false | 756 | java | package com.voxlearning.utopia.service.newexam.api.constant;
import com.voxlearning.alps.calendar.DateUtils;
import java.util.Date;
/**
* @Description: 考试常量
* @author: Mr_VanGogh
* @date: 2019/3/26 下午2:58
*/
public class NewExamConstants {
//单元测试 按照时间过滤
public static final Date UNIT_TEST_DUE_DATE = DateUtils.stringToDate("2019-03-20 00:00:00");
// 单元测
public static final String UNIT_TEST_PAPER_IDS_TEST_URL = "http://10.7.7.41:9528/unit_test/v1/paper_pids";
public static final String UNIT_TEST_PAPER_IDS_STAGING_URL = "http://10.7.7.41:9530/unit_test/v1/paper_pids";
public static final String UNIT_TEST_PAPER_IDS_PRODUCT_URL = "http://yqc.17zuoye.net/unit_test/v1/paper_pids";
}
| [
"wangahai@300.cn"
] | wangahai@300.cn |
60717e737d71c0f6544b9fe6fed3a6fb952ab097 | 13f6652c77abd41d4bc944887e4b94d8dff40dde | /archstudio/src/archstudio/comp/tron/tools/schematron/SchematronTestFileParseException.java | fcd719fb976a927d2c43088feb4091e26ba7ec45 | [] | no_license | isr-uci-edu/ArchStudio3 | 5bed3be243981d944577787f3a47c7a94c8adbd3 | b8aeb7286ea00d4b6c6a229c83b0ee0d1c9b2960 | refs/heads/master | 2021-01-10T21:01:43.330204 | 2014-05-31T16:15:53 | 2014-05-31T16:15:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package archstudio.comp.tron.tools.schematron;
public class SchematronTestFileParseException extends Exception implements java.io.Serializable{
public SchematronTestFileParseException(String message){
super(message);
}
public SchematronTestFileParseException(String message, Throwable t){
super(message, t);
}
}
| [
"sahendrickson@gmail.com"
] | sahendrickson@gmail.com |
cc0548dae2e183e76bc11f1f292660dee07f6233 | 5b8337c39cea735e3817ee6f6e6e4a0115c7487c | /sources/p043io/reactivex/internal/subscribers/LambdaSubscriber.java | 026268ce469f39072217f7631cd00573e6d36bcd | [] | no_license | karthik990/G_Farm_Application | 0a096d334b33800e7d8b4b4c850c45b8b005ccb1 | 53d1cc82199f23517af599f5329aa4289067f4aa | refs/heads/master | 2022-12-05T06:48:10.513509 | 2020-08-10T14:46:48 | 2020-08-10T14:46:48 | 286,496,946 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,061 | java | package p043io.reactivex.internal.subscribers;
import java.util.concurrent.atomic.AtomicReference;
import org.reactivestreams.Subscription;
import p043io.reactivex.FlowableSubscriber;
import p043io.reactivex.disposables.Disposable;
import p043io.reactivex.exceptions.CompositeException;
import p043io.reactivex.exceptions.Exceptions;
import p043io.reactivex.functions.Action;
import p043io.reactivex.functions.Consumer;
import p043io.reactivex.internal.subscriptions.SubscriptionHelper;
import p043io.reactivex.plugins.RxJavaPlugins;
/* renamed from: io.reactivex.internal.subscribers.LambdaSubscriber */
public final class LambdaSubscriber<T> extends AtomicReference<Subscription> implements FlowableSubscriber<T>, Subscription, Disposable {
private static final long serialVersionUID = -7251123623727029452L;
final Action onComplete;
final Consumer<? super Throwable> onError;
final Consumer<? super T> onNext;
final Consumer<? super Subscription> onSubscribe;
public LambdaSubscriber(Consumer<? super T> consumer, Consumer<? super Throwable> consumer2, Action action, Consumer<? super Subscription> consumer3) {
this.onNext = consumer;
this.onError = consumer2;
this.onComplete = action;
this.onSubscribe = consumer3;
}
public void onSubscribe(Subscription subscription) {
if (SubscriptionHelper.setOnce(this, subscription)) {
try {
this.onSubscribe.accept(this);
} catch (Throwable th) {
Exceptions.throwIfFatal(th);
subscription.cancel();
onError(th);
}
}
}
public void onNext(T t) {
if (!isDisposed()) {
try {
this.onNext.accept(t);
} catch (Throwable th) {
Exceptions.throwIfFatal(th);
((Subscription) get()).cancel();
onError(th);
}
}
}
public void onError(Throwable th) {
if (get() != SubscriptionHelper.CANCELLED) {
lazySet(SubscriptionHelper.CANCELLED);
try {
this.onError.accept(th);
} catch (Throwable th2) {
Exceptions.throwIfFatal(th2);
RxJavaPlugins.onError(new CompositeException(th, th2));
}
} else {
RxJavaPlugins.onError(th);
}
}
public void onComplete() {
if (get() != SubscriptionHelper.CANCELLED) {
lazySet(SubscriptionHelper.CANCELLED);
try {
this.onComplete.run();
} catch (Throwable th) {
Exceptions.throwIfFatal(th);
RxJavaPlugins.onError(th);
}
}
}
public void dispose() {
cancel();
}
public boolean isDisposed() {
return get() == SubscriptionHelper.CANCELLED;
}
public void request(long j) {
((Subscription) get()).request(j);
}
public void cancel() {
SubscriptionHelper.cancel(this);
}
}
| [
"knag88@gmail.com"
] | knag88@gmail.com |
cadc4d999c2a579388e92e91f13a4c97c06adf0a | aa16fbdb35227576bdc3e177c578d001c19428a5 | /src/test/java/org/durcframework/autocode/generator/FileContextGeneratorTest.java | 252827ec1fc63574b27815d3e8ac158de0077aab | [] | no_license | AndyYHL/autoCode | ee11a7e84cfae3962d880f754367de9b812acaba | a3c21de042aa5687e69e4fa8364b93e8c9c42ba7 | refs/heads/master | 2023-04-27T08:02:13.693929 | 2023-04-20T02:26:48 | 2023-04-20T02:26:48 | 124,502,502 | 3 | 0 | null | 2022-06-20T23:01:57 | 2018-03-09T07:12:24 | JavaScript | UTF-8 | Java | false | false | 3,932 | java | package org.durcframework.autocode.generator;
import java.io.StringReader;
import java.io.StringWriter;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;
import org.durcframework.autocode.TestBase;
import org.durcframework.autocode.entity.DataSourceConfig;
/**
<pre>
模板:
package ${context.packageName}.entity;
import org.durcframework.entity.BaseEntity;
publc class ${context.javaBeanName} extends BaseEntity {
#foreach($column in $columns)
private ${column.javaType} ${column.javaFieldName};
#end
#foreach($column in $columns)
public void set${column.javaFieldNameUpperFirstLetter}(${column.javaType} ${column.javaFieldName}){
this.$column.javaFieldName = $column.javaFieldName;
}
public ${column.javaType} get${column.javaFieldNameUpperFirstLetter}(){
return this.${column.javaFieldName};
}
#end}
转换后:
publc class DatasourceConfig extends BaseEntity {
private int dcId;
private String name;
private String driverClass;
private String jdbcUrl;
private String username;
private String password;
private String backUser;
public void setDcId(int dcId){
this.dcId = dcId;
}
public int getDcId(){
return this.dcId;
}
public void setName(String name){
this.name = name;
}
public String getName(){
return this.name;
}
public void setDriverClass(String driverClass){
this.driverClass = driverClass;
}
public String getDriverClass(){
return this.driverClass;
}
public void setJdbcUrl(String jdbcUrl){
this.jdbcUrl = jdbcUrl;
}
public String getJdbcUrl(){
return this.jdbcUrl;
}
public void setUsername(String username){
this.username = username;
}
public String getUsername(){
return this.username;
}
public void setPassword(String password){
this.password = password;
}
public String getPassword(){
return this.password;
}
public void setBackUser(String backUser){
this.backUser = backUser;
}
public String getBackUser(){
return this.backUser;
}
}</pre>
*/
public class FileContextGeneratorTest extends TestBase {
// 模板
static String template =
"package ${context.packageName}.entity;\r\n\r\n" +
"import org.durcframework.entity.BaseEntity;\r\n\r\n" +
"publc class ${context.javaBeanName} extends BaseEntity {\r\n" +
// 属性
"#foreach($column in $columns) \r\n" +
"\tprivate ${column.javaType} ${column.javaFieldName};\r\n" +
"#end" +
"\r\n"+
// get/set
"#foreach($column in $columns) \r\n" +
"\tpublic void set${column.javaFieldNameUpperFirstLetter}(${column.javaType} ${column.javaFieldName}){\r\n" +
"\t\tthis.$column.javaFieldName = $column.javaFieldName;\r\n"+
"\t}\r\n" +
"\r\n"+
"\tpublic ${column.javaType} get${column.javaFieldNameUpperFirstLetter}(){\r\n" +
"\t\treturn this.${column.javaFieldName};\r\n"+
"\t}\r\n"+
"\r\n"+
"#end"+
"}\r\n";
static String template2 = "publc class ${context.javaBeanName} extends BaseEntity {" +
"\r\n packageName:${context.packageName},tableName:${table.tableName} " +
"#foreach($column in $columns) $column.javaFieldName #end" +
"}";
// 数据源
static DataSourceConfig dataSourceConfig = new DataSourceConfig();
static {
dataSourceConfig.setDriverClass("com.mysql.jdbc.Driver");
//dataSourceConfig.setJdbcUrl("jdbc:mysql://localhost:3306/auto_code");
dataSourceConfig.setUsername("root");
dataSourceConfig.setPassword("root");
}
private void doGenerator(SQLContext sqlContext){
Velocity.init();
VelocityContext context = new VelocityContext();
context.put("context", sqlContext);
context.put("table", sqlContext.getTableDefinition());
context.put("columns", sqlContext.getTableDefinition().getColumnDefinitions());
StringWriter writer = new StringWriter();
StringReader reader = new StringReader(template);
// 不用vm文件
Velocity.evaluate(context, writer, "mystring", reader);
System.out.println("模板:\r\n"+template);
System.out.println(writer.toString());
}
}
| [
"love90yhl@hotmail.com"
] | love90yhl@hotmail.com |
8b3c2752e80c7fa9f76fad91d622fb6862726b66 | c6fd73d0dfd7c380f603096a30fd42d5bcb891fc | /src/com/qpidnetwork/request/item/TicketContentItem.java | fdb25141f1ecdb95076e9c87ace7778672bbc8b9 | [] | no_license | pangpangcc/Dating4Man | 1eff69100fd6e63654c3b575a8a3d1acaaa07a08 | 74a22d0a713231290dbf82a766b8abcfa07a656e | refs/heads/master | 2021-01-12T06:51:28.073268 | 2016-11-30T03:54:21 | 2016-11-30T03:54:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 975 | java | package com.qpidnetwork.request.item;
/**
* Ticket详情的内容item
* @author Samson Fan
*
*/
public class TicketContentItem {
/**
* 信件类型定义
* @author Samson Fan
*
*/
public enum MethodType {
/**
* 发送
*/
Send,
/**
* 回复
*/
Receive,
}
public TicketContentItem()
{
}
public TicketContentItem(
int method,
String fromName,
String toName,
int sendDate,
String message,
String[] fileList
)
{
this.method = MethodType.values()[method];
this.fromName = fromName;
this.toName = toName;
this.sendDate = sendDate;
this.message = message;
this.fileList = fileList;
}
/**
* 信件类型
*/
public MethodType method;
/**
* 发送人名称
*/
public String fromName;
/**
* 接收人名称
*/
public String toName;
/**
* 发送时间
*/
public int sendDate;
/**
* 内容
*/
public String message;
/**
* 附件URL列表
*/
public String[] fileList;
}
| [
"Kingsleyyau@gmail.com"
] | Kingsleyyau@gmail.com |
8c08b3cdaad4443015683d09c86f87d3aafe183e | 935175d06b461cb7f1943e4a154b2735f9c88d52 | /javatests/jsinterop/generator/closure/TestUtil.java | a49ceeef735b406034452bff7844d101ee4e5a1e | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | google/jsinterop-generator | 6a2224296d5932f82cec5510ec8078e28d686232 | 6066f4ed7fbc9fc86460a45151cc03ad3a733325 | refs/heads/master | 2023-09-02T23:34:56.138118 | 2023-07-25T18:49:34 | 2023-07-25T18:50:34 | 91,136,737 | 81 | 31 | Apache-2.0 | 2020-07-30T19:30:57 | 2017-05-12T23:30:16 | Java | UTF-8 | Java | false | false | 1,668 | java | /*
* Copyright 2019 Google 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
*
* 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 jsinterop.generator.closure;
import com.google.common.collect.ImmutableList;
import com.google.javascript.jscomp.SourceFile;
/** Helper class for creating closure JsInterop Generator options. */
public final class TestUtil {
private TestUtil() {}
private static Options createOptions(SourceFile sourceFile) {
return Options.builder()
.sources(ImmutableList.of(sourceFile))
.outputJarFile("unused")
.outputDependencyFile("unused")
.globalScopeClassName("unused")
.extensionTypePrefix("unused")
.debugEnabled(false)
.strict(true)
.dependencyMappingFiles(ImmutableList.of())
.dependencies(ImmutableList.of())
.nameMappingFiles(ImmutableList.of())
.integerEntitiesFiles(ImmutableList.of())
.wildcardTypesFiles(ImmutableList.of())
.customPreprocessingPasses(ImmutableList.of())
.build();
}
public static void runClosureJsInteropGenerator(SourceFile sourceFile) {
new ClosureJsInteropGenerator(createOptions(sourceFile)).convert();
}
}
| [
"copybara-worker@google.com"
] | copybara-worker@google.com |
da3ab836d151a690ad0a5b0b6db24832f93f78a4 | e487964c0bc146f544ec4dbe810950691a65e752 | /src/de/dimm/vsm/fsengine/FSEMapEntryHandler.java | 5a1258200cee906b3d127f71d0d38e38ca636386 | [
"Apache-2.0"
] | permissive | markymarkmk2/VSMServer | 0ad0327ba980e0df43f4d17908dca60314e52458 | d743235092e87221bdb8c1c2a0b55449def73ffe | refs/heads/master | 2020-06-11T02:54:10.756681 | 2017-01-03T12:26:18 | 2017-01-03T12:26:18 | 76,019,782 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,955 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package de.dimm.vsm.fsengine;
import de.dimm.vsm.Exceptions.PathResolveException;
import de.dimm.vsm.GeneralPreferences;
import de.dimm.vsm.Main;
import de.dimm.vsm.log.Log;
import de.dimm.vsm.net.interfaces.FileHandle;
import de.dimm.vsm.records.FileSystemElemAttributes;
import de.dimm.vsm.records.FileSystemElemNode;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.sql.SQLException;
import java.util.HashMap;
/**
*
* @author Administrator
*/
class FSEMapEntry
{
FileSystemElemNode node;
FileHandle fh;
public FSEMapEntry( FileSystemElemNode node, FileHandle fh )
{
this.node = node;
this.fh = fh;
}
@Override
public String toString()
{
return node.toString() + ": " + fh.toString();
}
}
public class FSEMapEntryHandler
{
StoragePoolHandler poolHandler;
// MAYBE THIS HAS TO BE PUT TO SOMEWHERE CENTRAL, INCLUDING LOCKING ETC
final HashMap<Long,FSEMapEntry> openFileHandleMap = new HashMap<>();
public FSEMapEntryHandler( StoragePoolHandler poolHandler )
{
this.poolHandler = poolHandler;
}
// THIS IS THE MAIN FH INDEX
long newFilehandleIdx = 1;
public long open_fh( FileSystemElemNode node, boolean create ) throws IOException, PathResolveException, SQLException
{
long newFileNo = newFilehandleIdx++;
synchronized(openFileHandleMap)
{
FileHandle fh = poolHandler.open_file_handle(node, create);
if (fh != null)
{
openFileHandleMap.put(newFileNo, new FSEMapEntry(node, fh) );
//Log.debug( "open_fh: opening " + node.getName() + " -> " + newFileNo );
return newFileNo;
}
}
Log.err( "open_fh: open failed " + node.getName() );
return -1;
}
public long open_versioned_fh( FileSystemElemNode node, FileSystemElemAttributes attrs ) throws IOException, PathResolveException, SQLException
{
long newFileNo = newFilehandleIdx++;
synchronized(openFileHandleMap)
{
FileHandle fh = poolHandler.open_versioned_file_handle(node, attrs);
if (fh != null)
{
openFileHandleMap.put(newFileNo, new FSEMapEntry(node, fh) );
//Log.debug( "open_fh: opening " + node.getName() + " -> " + newFileNo );
return newFileNo;
}
}
Log.err( "open_fh: open failed " + node.getName() );
return -1;
}
public long open_stream( FileSystemElemNode node, int streamInfo, boolean create ) throws IOException, PathResolveException, UnsupportedEncodingException, SQLException
{
long newFileNo = newFilehandleIdx++;
synchronized(openFileHandleMap)
{
FileHandle fh = poolHandler.open_xa_handle(node, streamInfo, create);
openFileHandleMap.put(newFileNo, new FSEMapEntry(node, fh) );
}
//Log.debug( "open_fh: opening " + node.getName() + " -> " + newFileNo );
return newFileNo;
}
public void close_fh( long fileNo ) throws IOException
{
FileHandle fh = getFhByFileNo( fileNo );
FileSystemElemNode node = getNodeByFileNo( fileNo );
if (fh != null)
{
//Log.debug( "close_fh: " + fileNo );
fh.close();
removeByFileNo( fileNo );
// If we clear then we loose our stored Object in FileResolver
// if (!Main.get_bool_prop(GeneralPreferences.CACHE_ON_WRITE_FS, false) && node != null && node.getParent() != null)
// {
// node.getParent().getChildren().unRealize();
// //node.getParent().getChildren().getList(poolHandler.getEm());
// }
}
else
Log.err( "close_fh: Cannot resolve fh " + fileNo );
}
public FileHandle getFhByFileNo( long idx )
{
if (idx == -1)
return null;
FSEMapEntry entry = openFileHandleMap.get(idx);
if (entry != null)
{
return entry.fh;
}
Log.err( "getFhByFileIdx: Cannot resolve fh " + idx );
return null;
}
public FileSystemElemNode getNodeByFileNo( long idx )
{
if (idx == -1)
return null;
FSEMapEntry entry = openFileHandleMap.get(idx);
if (entry != null)
return entry.node;
Log.err( "getNodeByFileIdx: Cannot resolve fh " + idx );
return null;
}
public void removeByFileNo( long idx )
{
FSEMapEntry entry = openFileHandleMap.remove(idx);
if (entry == null)
Log.err( "removeByFileIdx: Cannot resolve fh " + idx );
//Log.debug("handleMap entries: " + openFileHandleMap.size());
}
}
| [
"mark@dimm.de"
] | mark@dimm.de |
52f4c4e75ef8bfec40840c9eabbb5641bd6c9ec8 | 7fbfbfb59286504b0aa4cb0214b3241b8ba0364d | /src/main/java/chapter06/_05_introduce_explaining_variable/example2/Example2.java | d8ea74175dc2993c54ea70cdf8765c5be13f307e | [] | no_license | SANGCO/refactoring-example | e06ac07dc004ab2947d907c7359b315f7c7a606a | 5e1c1ba0b7e8122d42b5f698290cf38377b28577 | refs/heads/master | 2020-12-01T23:03:11.076656 | 2019-12-30T13:24:38 | 2019-12-30T13:24:38 | 230,803,667 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 761 | java | package chapter06._05_introduce_explaining_variable.example2;
/**
* Created by wayne on 2017. 9. 1..
*
* Introduce Explaining Variable (직관적 임시 변수 사용)
*
* 사용된 수식이 복잡할 땐
* - 수식의 결과나 수식의 일부분을 용도에 부합하는 직관적 이름의 임시변수에 대입하자.
*
*/
public class Example2 {
private double _quantity;
private double _itemPrice;
double price() {
// 결재액(price) = 총 구매액(base price) -
// 대량 구매 할인(quantity discount) + 배송비(shipping)
return _quantity * _itemPrice -
Math.max(0, _quantity - 500) * _itemPrice * 0.05 +
Math.min(_quantity * _itemPrice * 0.1, 100.0);
}
}
| [
"june0313@gmail.com"
] | june0313@gmail.com |
b750cf8f0bb88cc1377e972cfa0b331fdadab4b4 | f7a66a51d12a562e01006415310e47a395a64307 | /java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pag/TsImages.java | 59b1e1e6bd6d32a275db9aa4dd22a1c2050ba7bb | [] | no_license | jabogithub/r-causal | 4b550701fec57b666eea2db2a610b024ad50ff68 | 8d2b1783945998aa9d470a90d2d9442465682037 | refs/heads/master | 2020-07-08T09:37:51.907947 | 2019-03-14T15:38:02 | 2019-03-14T15:38:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,752 | java | package edu.cmu.tetrad.algcomparison.algorithm.oracle.pag;
import edu.cmu.tetrad.algcomparison.algorithm.Algorithm;
import edu.cmu.tetrad.algcomparison.algorithm.MultiDataSetAlgorithm;
import edu.cmu.tetrad.algcomparison.score.BdeuScore;
import edu.cmu.tetrad.algcomparison.score.ScoreWrapper;
import edu.cmu.tetrad.algcomparison.score.SemBicScore;
import edu.cmu.tetrad.algcomparison.utils.HasKnowledge;
import edu.cmu.tetrad.algcomparison.utils.UsesScoreWrapper;
import edu.cmu.tetrad.annotation.AlgType;
import edu.cmu.tetrad.data.DataModel;
import edu.cmu.tetrad.data.DataSet;
import edu.cmu.tetrad.data.DataType;
import edu.cmu.tetrad.data.IKnowledge;
import edu.cmu.tetrad.graph.EdgeListGraph;
import edu.cmu.tetrad.graph.Graph;
import edu.cmu.tetrad.search.BdeuScoreImages;
import edu.cmu.tetrad.search.IndTestScore;
import edu.cmu.tetrad.search.IndependenceTest;
import edu.cmu.tetrad.search.Score;
import edu.cmu.tetrad.search.SemBicScoreImages;
import edu.cmu.tetrad.search.TsDagToPag;
import edu.cmu.tetrad.search.TsGFci;
import edu.cmu.tetrad.util.Parameters;
import edu.pitt.dbmi.algo.resampling.GeneralResamplingTest;
import edu.pitt.dbmi.algo.resampling.ResamplingEdgeEnsemble;
import java.util.ArrayList;
import java.util.List;
/**
* tsIMaGES.
*
* @author jdramsey
* @author Daniel Malinsky
*/
@edu.cmu.tetrad.annotation.Algorithm(
name = "TsIMaGES",
command = "ts-imgs",
algoType = AlgType.forbid_latent_common_causes
)
public class TsImages implements Algorithm, HasKnowledge, MultiDataSetAlgorithm, UsesScoreWrapper {
static final long serialVersionUID = 23L;
private ScoreWrapper score;
private Algorithm initialGraph = null;
private IKnowledge knowledge = null;
public TsImages() {
}
public TsImages(ScoreWrapper score) {
if (!(score instanceof SemBicScore || score instanceof BdeuScore)) {
throw new IllegalArgumentException("Only SEM BIC score or BDeu score can be used with this, sorry.");
}
this.score = score;
}
@Override
public Graph search(DataModel dataModel, Parameters parameters) {
if (parameters.getInt("numberSubSampling") < 1) {
DataSet dataSet = (DataSet) dataModel;
TsGFci search;
if(knowledge != null) {
dataSet.setKnowledge(knowledge);
}
Score score1 = score.getScore(dataSet, parameters);
IndependenceTest test = new IndTestScore(score1);
search = new TsGFci(test, score1);
search.setKnowledge(dataSet.getKnowledge());
search.setVerbose(parameters.getBoolean("verbose"));
return search.search();
} else {
TsImages algorithm = new TsImages(score);
DataSet data = (DataSet) dataModel;
GeneralResamplingTest search = new GeneralResamplingTest(data, algorithm, parameters.getInt("numberSubSampling"));
search.setKnowledge(knowledge);
search.setPercentResampleSize(parameters.getDouble("percentResampleSize"));
search.setResamplingWithReplacement(parameters.getBoolean("subSamplingWithReplacement"));
ResamplingEdgeEnsemble edgeEnsemble = ResamplingEdgeEnsemble.Highest;
switch (parameters.getInt("subSamplingEnsemble", 1)) {
case 0:
edgeEnsemble = ResamplingEdgeEnsemble.Preserved;
break;
case 1:
edgeEnsemble = ResamplingEdgeEnsemble.Highest;
break;
case 2:
edgeEnsemble = ResamplingEdgeEnsemble.Majority;
}
search.setEdgeEnsemble(edgeEnsemble);
search.setAddOriginalDataset(parameters.getBoolean("addOriginalDataset"));
search.setParameters(parameters);
search.setVerbose(parameters.getBoolean("verbose"));
return search.search();
}
}
@Override
public Graph getComparisonGraph(Graph graph) {
return new TsDagToPag(new EdgeListGraph(graph)).convert();
}
public String getDescription() {
return "tsFCI (Time Series Fast Causal Inference) using " + score.getDescription()
+ (initialGraph != null ? " with initial graph from "
+ initialGraph.getDescription() : "");
}
@Override
public DataType getDataType() {
return score.getDataType();
}
@Override
public List<String> getParameters() {
List<String> parameters = score.getParameters();
parameters.add("numRuns");
parameters.add("randomSelectionSize");
// Subsampling
parameters.add("numberResampling");
parameters.add("percentResampleSize");
parameters.add("resamplingWithReplacement");
parameters.add("resamplingEnsemble");
parameters.add("addOriginalDataset");
parameters.add("verbose");
return parameters;
}
@Override
public IKnowledge getKnowledge() {
return this.knowledge;
}
@Override
public void setKnowledge(IKnowledge knowledge) {
this.knowledge = knowledge;
}
@Override
public Graph search(List<DataModel> dataSets, Parameters parameters) {
List<DataModel> dataModels = new ArrayList<>();
for (DataModel dataSet : dataSets) {
dataModels.add(dataSet);
}
TsGFci search;
if (score instanceof SemBicScore) {
SemBicScoreImages gesScore = new SemBicScoreImages(dataModels);
gesScore.setPenaltyDiscount(parameters.getDouble("penaltyDiscount"));
IndependenceTest test = new IndTestScore(gesScore);
search = new TsGFci(test, gesScore);
} else if (score instanceof BdeuScore) {
double samplePrior = parameters.getDouble("samplePrior", 1);
double structurePrior = parameters.getDouble("structurePrior", 1);
BdeuScoreImages score = new BdeuScoreImages(dataModels);
score.setSamplePrior(samplePrior);
score.setStructurePrior(structurePrior);
IndependenceTest test = new IndTestScore(score);
search = new TsGFci(test, score);
} else {
throw new IllegalStateException("Sorry, data must either be all continuous or all discrete.");
}
IKnowledge knowledge = dataModels.get(0).getKnowledge();
search.setKnowledge(knowledge);
return search.search();
}
@Override
public void setScoreWrapper(ScoreWrapper score) {
this.score = score;
}
@Override
public ScoreWrapper getScoreWarpper() {
return score;
}
}
| [
"chirayu.kong@gmail.com"
] | chirayu.kong@gmail.com |
233fa459e6f0c681de5b362f8efa601e873ac931 | 468901ca7035d3bfc93d5c868707756351c76f8e | /src/main/java/com/learning/ds/geeksforgeeks/linkedlist/NthNodeFromTheEnd.java | 36d223f94b37f5dbd3b5b4c2dc63f57d93137d40 | [] | no_license | nickahujaaol/DataStructures | 63fd88325ba0dc8a75b96e87f2813c02ff87320c | d6b2bf6694bcc6f955d895789c5fca700b6133da | refs/heads/master | 2023-03-11T23:34:39.766078 | 2021-02-25T06:27:21 | 2021-02-25T06:27:21 | 266,102,280 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 160 | java | package com.learning.ds.geeksforgeeks.linkedlist;
// https://www.geeksforgeeks.org/nth-node-from-the-end-of-a-linked-list/
public class NthNodeFromTheEnd {
}
| [
"you@example.com"
] | you@example.com |
6772102bfdcc7e0241a4e916fa0e7ed37f0b8e2e | 394ae5d9dbce6a1e8b63cf74084591879fde98cd | /src/main/java/com/mashibing/service/TblSendLogService.java | 7ee711077e88e1b5077195807bf8335fcaedafdc | [] | no_license | zhaoyayun199087/hejiayun | 591a8a19f725c61d51bb900435dad0bc320197da | 74e216dab60bb986fd8ed4c0be61ee448c4e39af | refs/heads/master | 2023-01-07T23:55:29.477605 | 2020-11-06T10:30:29 | 2020-11-06T10:30:29 | 310,270,973 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 292 | java | package com.mashibing.service;
import com.mashibing.bean.TblSendLog;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 发送日志表 服务类
* </p>
*
* @author lian
* @since 2020-11-05
*/
public interface TblSendLogService extends IService<TblSendLog> {
}
| [
"li.min@intellif.com"
] | li.min@intellif.com |
321b5c9aba42ecafb52374133ed3eaeb6ae25e84 | b118a9cb23ae903bc5c7646b262012fb79cca2f2 | /src/com/baidu/mobstat/t.java | fa6ee6bf4e76041a09f83ede230af0449379c74c | [] | no_license | secpersu/com.estrongs.android.pop | 22186c2ea9616b1a7169c18f34687479ddfbb6f7 | 53f99eb4c5b099d7ed22d70486ebe179e58f47e0 | refs/heads/master | 2020-07-10T09:16:59.232715 | 2015-07-05T03:24:29 | 2015-07-05T03:24:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package com.baidu.mobstat;
class t
{
public static final String a = Build.a;
public static final int b = Build.b;
static final boolean c = Build.c;
static final String[] d = { "h9YLQoINGWyOBYYk", "30212102dicudiab" };
static final String e = d[(b - 1)];
}
/* Location:
* Qualified Name: com.baidu.mobstat.t
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
df93a308f2f8ca98b4a132f00f9d807693218a1a | c05791e9d230d12c2c163e23751c017a8e683d26 | /JSF2.2_my04/src/at/irian/jsfatwork/gui/jsf/ParameterPhaseListener.java | 91407bf519d3615909a0a05fdc80eb88d68439fb | [] | no_license | a0248327/JSF2.2_MYs | f50d64ece960bdafd3e28f5de95c8190e8affe3b | f3e1cad46cdee0f105ac530b12ecaa783a11115b | refs/heads/master | 2020-05-31T16:47:30.344083 | 2015-03-16T21:48:02 | 2015-03-16T21:48:02 | 30,710,238 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,191 | java | package at.irian.jsfatwork.gui.jsf;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* PhaseListener that logs request parameters before restore view phase.
*
* @author Michael Kurz
*/
public class ParameterPhaseListener implements PhaseListener {
private static final long serialVersionUID = -7280164859565844793L;
private static Log log = LogFactory.getLog(ParameterPhaseListener.class);
public void afterPhase(PhaseEvent event) {
}
public void beforePhase(PhaseEvent event) {
FacesContext fc = FacesContext.getCurrentInstance();
Map<String, String> map = fc.getExternalContext().getRequestParameterMap();
for (String key : map.keySet()) {
StringBuilder param = new StringBuilder();
param.append("Parameter: ");
param.append(key);
param.append(" = ");
param.append(map.get(key));
log.debug(param.toString());
}
}
public PhaseId getPhaseId() {
return PhaseId.APPLY_REQUEST_VALUES;
}
}
| [
"muxin_email@hotmail.com"
] | muxin_email@hotmail.com |
e204fabc0f168d99fbe19cfceede1ed2d90a8074 | 36d7ac13d205b9a5b8c3308a27c4605a1cd7ee56 | /others/AndEngine-GLES2-AnchorCenter/src/org/andengine/input/touch/controller/BaseTouchController.java | 87308e9dedee01dde9eb328000e13c087798efbc | [
"Apache-2.0"
] | permissive | renanlr/billyadventures | 92103d6208f2e80644fca38c2c8a4ad6f2b5a7ce | f35384d6355dbbdbc5708b370731d1be1e652f39 | refs/heads/master | 2021-01-20T03:39:09.059791 | 2014-12-09T05:03:33 | 2014-12-09T05:03:33 | 23,578,058 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,846 | java | package org.andengine.input.touch.controller;
import org.andengine.input.touch.TouchEvent;
import org.andengine.util.adt.pool.RunnablePoolItem;
import org.andengine.util.adt.pool.RunnablePoolUpdateHandler;
import android.view.MotionEvent;
/**
* (c) 2010 Nicolas Gramlich
* (c) 2011 Zynga Inc.
*
* @author Nicolas Gramlich
* @since 21:06:40 - 13.07.2010
*/
public abstract class BaseTouchController implements ITouchController {
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
private ITouchEventCallback mTouchEventCallback;
private final RunnablePoolUpdateHandler<TouchEventRunnablePoolItem> mTouchEventRunnablePoolUpdateHandler = new RunnablePoolUpdateHandler<TouchEventRunnablePoolItem>() {
@Override
protected TouchEventRunnablePoolItem onAllocatePoolItem() {
return new TouchEventRunnablePoolItem();
}
};
// ===========================================================
// Constructors
// ===========================================================
public BaseTouchController() {
}
// ===========================================================
// Getter & Setter
// ===========================================================
@Override
public void setTouchEventCallback(final ITouchEventCallback pTouchEventCallback) {
this.mTouchEventCallback = pTouchEventCallback;
}
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
@Override
public void reset() {
this.mTouchEventRunnablePoolUpdateHandler.reset();
}
@Override
public void onUpdate(final float pSecondsElapsed) {
this.mTouchEventRunnablePoolUpdateHandler.onUpdate(pSecondsElapsed);
}
protected void fireTouchEvent(final float pX, final float pY, final int pAction, final int pPointerID, final MotionEvent pMotionEvent) {
final TouchEvent touchEvent = TouchEvent.obtain(pX, pY, pAction, pPointerID, MotionEvent.obtain(pMotionEvent));
final TouchEventRunnablePoolItem touchEventRunnablePoolItem = this.mTouchEventRunnablePoolUpdateHandler.obtainPoolItem();
touchEventRunnablePoolItem.set(touchEvent);
this.mTouchEventRunnablePoolUpdateHandler.postPoolItem(touchEventRunnablePoolItem);
}
// ===========================================================
// Methods
// ===========================================================
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
class TouchEventRunnablePoolItem extends RunnablePoolItem {
// ===========================================================
// Fields
// ===========================================================
private TouchEvent mTouchEvent;
// ===========================================================
// Getter & Setter
// ===========================================================
public void set(final TouchEvent pTouchEvent) {
this.mTouchEvent = pTouchEvent;
}
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
@Override
public void run() {
BaseTouchController.this.mTouchEventCallback.onTouchEvent(this.mTouchEvent);
}
@Override
protected void onRecycle() {
super.onRecycle();
final TouchEvent touchEvent = this.mTouchEvent;
touchEvent.getMotionEvent().recycle();
touchEvent.recycle();
}
}
}
| [
"renan.lobato.rheinboldt@gmail.com"
] | renan.lobato.rheinboldt@gmail.com |
29d331a1c086d27d76b6c22f0573a19c34e168c8 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-13372-1-5-MOEAD-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/objects/BaseProperty_ESTest.java | 38e5c188b6ab64c9a0b51959bbb1511ca0ac831a | [] | 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 | 552 | java | /*
* This file was automatically generated by EvoSuite
* Wed Apr 08 06:09:35 UTC 2020
*/
package com.xpn.xwiki.objects;
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 BaseProperty_ESTest extends BaseProperty_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
abc366ef6af5b98d2409f3d43ad93f16e296d570 | 0d504a0088c38775544dd885a818ff9ea2a42748 | /app/src/main/java/com/musicbase/adapter/AddressListAdapter.java | 7a53efe7519309323beeac75a01d0d2b9012a59f | [] | no_license | wzyxzy/MusicBase2 | c3ac4881579bedd01a97812194616ba328d89c7d | fd981715fbb60ee60432b10cc0ac57d4f9019bc0 | refs/heads/master | 2022-06-14T12:15:33.443401 | 2020-05-09T11:37:22 | 2020-05-09T11:37:22 | 262,557,400 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,082 | java | package com.musicbase.adapter;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.musicbase.R;
import java.util.List;
import static com.musicbase.entity.AddressBean.*;
public class AddressListAdapter extends BaseQuickAdapter<DataBean, BaseViewHolder> {
public AddressListAdapter(int layoutResId, @Nullable List<DataBean> data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, DataBean item) {
helper.setText(R.id.address_name, item.getUserName())
.setText(R.id.address_phone, item.getTelphone())
.addOnClickListener(R.id.address_edit)
.setText(R.id.address_text, item.getAreaName() + item.getAddress());
if (item.getIsDefault().equalsIgnoreCase("1")) {
helper.setVisible(R.id.address_default, true);
} else {
helper.setVisible(R.id.address_default, false);
}
}
}
| [
"xzywzy@gmail.com"
] | xzywzy@gmail.com |
022a140f3102d4b77b19a196f26ef57182d53805 | 5e4c6e116d426bca2b77d4e56d6acf5fcfd1cce1 | /H05/7.Release/QuangCao/BackEnd/QuangCaoService-Service/QuangCaoService-Service-service/src/main/java/com/web/ecoit/portal/quangcao/service/persistence/impl/QuangCaoFinderImpl.java | bd96b624f6f3af42158241ecf3825a1308a07ca3 | [] | no_license | tayduivn/Ecoit-code | 736a1cad571e4100e34ee87832176fc21fb7470f | 641ac4d0b249d2f4b20316331a1a2d55d31a6635 | refs/heads/master | 2023-01-10T16:08:22.646887 | 2020-11-16T12:02:30 | 2020-11-16T12:02:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,466 | java | package com.web.ecoit.portal.quangcao.service.persistence.impl;
import com.liferay.portal.kernel.dao.orm.QueryPos;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.SQLQuery;
import com.liferay.portal.kernel.dao.orm.Session;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl;
import com.web.ecoit.portal.quangcao.model.QuangCao;
import com.web.ecoit.portal.quangcao.model.impl.QuangCaoImpl;
import com.web.ecoit.portal.quangcao.service.persistence.QuangCaoFinder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.osgi.service.component.annotations.Component;
@Component(
service = QuangCaoFinder.class
)
public class QuangCaoFinderImpl extends QuangCaoFinderBaseImpl implements QuangCaoFinder{
public List<QuangCao> getQuangCaoBySql(String sql, int start, int end) throws SystemException{
List<QuangCao> listQuangCao = new ArrayList<QuangCao>();
Session session = null;
try {
session = openSession();
SQLQuery query = session.createSQLQuery(sql);
query.setCacheable(true);
query.addEntity("QuangCao",QuangCaoImpl.class);
QueryPos qPos = QueryPos.getInstance(query);
listQuangCao = (List<QuangCao>)QueryUtil.list(query, getDialect(),start, end);
}catch(Exception e){
throw new SystemException(e);
}finally {
if(session!=null)closeSession(session);
}
return listQuangCao;
}
public int getCountByQuangCao(String sql){
Long count = 0L;
Session session = null;
try{
session = openSession();
SQLQuery q = session.createSQLQuery(sql);
Iterator<java.math.BigInteger> itr = q.list().iterator();
if (itr.hasNext()) {
count = itr.next().longValue();
}
} catch (Exception e) {
count = 0L;
}finally {
if (count == null) {
count = Long.valueOf(0);
}
if(session!=null)closeSession(session);
}
return count.intValue();
}
public List<Object> getDuLieuTheoSql(String sql,int start,int end)
{
List<Object> listArt = null;
Session session = null;
try {
session = openSession();
SQLQuery query = session.createSQLQuery(sql);
query.setCacheable(false);
listArt = (List<Object>) QueryUtil.list(query, getDialect(),
start, end);
} catch (Exception e) {
listArt = null;
//throw new SystemException(e);
} finally {
closeSession(session);
}
return listArt;
}
}
| [
"ln8070389@gmail.com"
] | ln8070389@gmail.com |
25245a39e15b7facccbb7cc53c34e7304d3249ea | 17eec5a820d0299bcd4879745109ea943d490eab | /ubk_Spider_50/src/com/unbank/robotspider/filter/content/CngoldContentFilter.java | 4b43fe084e0216bd378b4acaee503c8c19897be7 | [] | no_license | un-knower/ubk_Spider_50 | 5dcf1ed21088788b692a437e95a99f8ac3ff8283 | 675693c9e51542d8435630cd6c9f6b9f95e50def | refs/heads/master | 2020-03-17T22:52:53.663468 | 2017-06-08T09:24:39 | 2017-06-08T09:24:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,853 | java | package com.unbank.robotspider.filter.content;
import org.apache.log4j.Logger;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.springframework.stereotype.Service;
@Service
public class CngoldContentFilter extends ContentBaseFilter {
public Logger logger = Logger.getLogger(CngoldContentFilter.class);
private String[] domain = new String[] { "ag.cngold.org ",
"jiage.cngold.org ", "insurance.cngold.org ",
"finance.cngold.org ", "trader.cngold.org ", "ds.cngold.org ",
"bank.cngold.org ", "energy.cngold.org ", "usstock.cngold.org ",
"passport.cngold.org ", "forex.cngold.org ", "stock.cngold.org ",
"feedback.cngold.org ", "www.cngold.org ", "cang.cngold.org ",
"jjh.cngold.org ", "my.cngold.org ", "zhubao.cngold.org ",
"mingjia.cngold.org ", "3g.cngold.org ", "mall.cngold.org ",
"jigou.cngold.org ", "loan.cngold.org ", "hao.cngold.org ",
"lux.cngold.org ", "futures.cngold.org ", "kp.cngold.org ",
"credit.cngold.org ", "dasai.cngold.org" };
public CngoldContentFilter() {
for (int i = 0; i < domain.length; i++) {
ContentFilterLocator.getInstance().register(domain[i], this);
}
}
public Element getContentNode(Document document) {
Element element = assignPossibleElement(document, "#zoom");
if (element == null) {
return null;
}
return element;
}
public void removeNoNeedElementsByText(Element contentElement) {
// String textQuerys[] = new String[] { "" };
// for (String textQuery : textQuerys) {
// removeNoNeedTextElement(contentElement, textQuery);
// }
}
public void removeNoNeedElementsByCssQuery(Element contentElement) {
String cssQuerys[] = new String[] { ".in_content_left_advs" };
for (String cssQuery : cssQuerys) {
removeNoNeedElement(contentElement, cssQuery);
}
}
}
| [
"1378022176@qq.com"
] | 1378022176@qq.com |
f2b1148bafeaf8b50d685569cabc81b7ca79e63a | 1df1dddc838e70bf12d8eec194cd8076429e0339 | /userService/src/main/java/com/itemsSharing/jwt/JwtTokenAuthenticationFilter.java | 49c2d9132e960755ce8c4d794de30dd8f75e2b62 | [] | no_license | lakith/distributed-project-manegment-system | 841400a096a1857694b0f0f2723b4eed77d317a0 | ce848cd8d9dadc82dc197378c249ca9d9be620c4 | refs/heads/master | 2020-05-09T10:55:23.370053 | 2019-04-22T05:37:03 | 2019-04-22T05:37:03 | 181,062,400 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,737 | java | package com.itemsSharing.jwt;
import java.io.IOException;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.core.annotation.Order;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.filter.OncePerRequestFilter;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
@Order(1)
public class JwtTokenAuthenticationFilter extends OncePerRequestFilter {
private final JwtTokenAuthenticationConfig config;
public JwtTokenAuthenticationFilter(JwtTokenAuthenticationConfig config) {
this.config = config;
}
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
String token = request.getHeader(config.getHeader());
//System.out.println(token);
if(token != null && token.startsWith(config.getPrefix() + " ")) {
token = token.replace(config.getPrefix() + " ", "");
try {
Claims claims = Jwts.parser().setSigningKey(config.getSecret().getBytes()).parseClaimsJws(token).getBody();
String name = claims.getSubject();
//System.out.println(name);
String username = claims.get("ud", String.class);
// System.out.println(username);
String type = claims.get("type", String.class);
//System.out.println(type);
if ("REFRESH".equals(type)) {
SecurityContextHolder.clearContext();
} else {
@SuppressWarnings("unchecked")
List<String> authorities = claims.get("authorities", List.class);
System.out.println(authorities);
if (username != null) {
UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(username, null,
authorities.stream().map(SimpleGrantedAuthority::new).collect(Collectors.toList()));
SecurityContextHolder.getContext().setAuthentication(auth);
}
}
}catch (Exception ignore) {
SecurityContextHolder.clearContext();
}
}
filterChain.doFilter(request, response);
}
} | [
"lakith1995@gmail.com"
] | lakith1995@gmail.com |
a78520d00cb674385223229c79caedfa05173982 | 8d8776f923e7cc844196f4c70c21a337e5f5552e | /server/src/main/java/se/spaced/server/persistence/migrator/ExportServerContent.java | 210228bbb7e14f11c90e615988e6e659de35ef39 | [] | no_license | FearlessGames/spaced | 7853599f11258daf62a72ba4c8f40ef8c88beb85 | 27690cd19867c5b9b64186a1e9a26bd813497c87 | refs/heads/master | 2020-04-25T04:28:54.189030 | 2017-09-08T21:10:58 | 2017-09-08T21:10:58 | 172,511,474 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,208 | java | package se.spaced.server.persistence.migrator;
import com.google.inject.Singleton;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.ConverterLookup;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.core.ReferenceByXPathMarshaller;
import com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy;
import com.thoughtworks.xstream.core.TreeMarshaller;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.mapper.Mapper;
import org.hibernate.collection.internal.PersistentBag;
import org.hibernate.collection.internal.PersistentList;
import org.hibernate.collection.internal.PersistentMap;
import org.hibernate.collection.internal.PersistentSet;
import org.hibernate.collection.internal.PersistentSortedMap;
import org.hibernate.collection.internal.PersistentSortedSet;
import org.hibernate.collection.spi.PersistentCollection;
import org.hibernate.proxy.HibernateProxy;
import se.spaced.server.persistence.dao.interfaces.AuraDao;
import se.spaced.server.persistence.dao.interfaces.BrainTemplateDao;
import se.spaced.server.persistence.dao.interfaces.CooldownTemplateDao;
import se.spaced.server.persistence.dao.interfaces.CreatureTypeDao;
import se.spaced.server.persistence.dao.interfaces.CurrencyDao;
import se.spaced.server.persistence.dao.interfaces.FactionDao;
import se.spaced.server.persistence.dao.interfaces.GraveyardTemplateDao;
import se.spaced.server.persistence.dao.interfaces.ItemTemplateDao;
import se.spaced.server.persistence.dao.interfaces.LootTemplateDao;
import se.spaced.server.persistence.dao.interfaces.MobTemplateDao;
import se.spaced.server.persistence.dao.interfaces.SpawnPatternTemplateDao;
import se.spaced.server.persistence.dao.interfaces.SpellDao;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
@Singleton
public final class ExportServerContent extends SpacedXStreamBase {
@Inject
public ExportServerContent(
SpellDao spellDao,
ItemTemplateDao itemTemplateDao,
LootTemplateDao lootTemplateDao,
CreatureTypeDao creatureTypeDao,
MobTemplateDao mobTemplateDao,
FactionDao factionDao,
BrainTemplateDao brainTemplateDao,
SpawnPatternTemplateDao spawnPatternTemplateDao,
CooldownTemplateDao cooldownTemplateDao,
GraveyardTemplateDao graveyardTemplateDao, CurrencyDao currencyDao, AuraDao auraDao) {
super(
spellDao,
itemTemplateDao,
lootTemplateDao,
creatureTypeDao,
mobTemplateDao,
factionDao,
brainTemplateDao,
spawnPatternTemplateDao,
cooldownTemplateDao, graveyardTemplateDao, currencyDao, auraDao);
}
@Override
protected void setupXStream() {
xStream.setMarshallingStrategy(new XStreamMarshallingStrategy(XStreamMarshallingStrategy.ABSOLUTE));
xStream.registerConverter(new HibernateCollectionConverter(xStream.getConverterLookup()));
xStream.addDefaultImplementation(PersistentBag.class, List.class);
xStream.addDefaultImplementation(PersistentList.class, List.class);
xStream.addDefaultImplementation(PersistentMap.class, Map.class);
xStream.addDefaultImplementation(PersistentSet.class, Set.class);
xStream.addDefaultImplementation(PersistentSortedMap.class, TreeMap.class);
xStream.addDefaultImplementation(PersistentSortedSet.class, TreeSet.class);
xStream.setMode(XStream.NO_REFERENCES);
}
public String genereateXmlFor(List<?> items) {
return xStream.toXML(items);
}
public static class XStreamMarshallingStrategy extends ReferenceByXPathMarshallingStrategy {
public XStreamMarshallingStrategy(int mode) {
super(mode);
}
@Override
protected TreeMarshaller createMarshallingContext(
HierarchicalStreamWriter writer, ConverterLookup converterLookup, Mapper mapper) {
return new HibernateProxyXPathMarshaller(writer, converterLookup, mapper, RELATIVE);
}
}
public static class HibernateProxyXPathMarshaller extends ReferenceByXPathMarshaller {
public HibernateProxyXPathMarshaller(
HierarchicalStreamWriter writer, ConverterLookup converterLookup, Mapper mapper, int mode) {
super(writer, converterLookup, mapper, mode);
}
@Override
public void convertAnother(Object item, Converter converter) {
Object toConvert;
if (HibernateProxy.class.isAssignableFrom(item.getClass())) {
toConvert = ((HibernateProxy) item).getHibernateLazyInitializer().getImplementation();
} else {
toConvert = item;
}
super.convertAnother(toConvert, converter);
}
}
public static class HibernateCollectionConverter implements Converter {
private final Converter listSetConverter;
private final Converter mapConverter;
private final Converter treeMapConverter;
private final Converter treeSetConverter;
private final Converter defaultConverter;
public HibernateCollectionConverter(ConverterLookup converterLookup) {
listSetConverter = converterLookup.lookupConverterForType(ArrayList.class);
mapConverter = converterLookup.lookupConverterForType(HashMap.class);
treeMapConverter = converterLookup.lookupConverterForType(TreeMap.class);
treeSetConverter = converterLookup.lookupConverterForType(TreeSet.class);
defaultConverter = converterLookup.lookupConverterForType(Object.class);
}
@Override
public boolean canConvert(Class type) {
return PersistentCollection.class.isAssignableFrom(type);
}
@Override
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
Object collection = source;
if (source instanceof PersistentCollection) {
PersistentCollection col = (PersistentCollection) source;
col.forceInitialization();
collection = col.getStoredSnapshot();
}
// the set is returned as a map by Hibernate (unclear why exactly)
if (source instanceof PersistentSet) {
collection = new HashSet(((HashMap) collection).values());
}
// delegate the collection to the approapriate converter
if (listSetConverter.canConvert(collection.getClass())) {
listSetConverter.marshal(collection, writer, context);
return;
}
if (mapConverter.canConvert(collection.getClass())) {
mapConverter.marshal(collection, writer, context);
return;
}
if (treeMapConverter.canConvert(collection.getClass())) {
treeMapConverter.marshal(collection, writer, context);
return;
}
if (treeSetConverter.canConvert(collection.getClass())) {
treeSetConverter.marshal(collection, writer, context);
return;
}
defaultConverter.marshal(collection, writer, context);
}
@Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
return null;
}
}
}
| [
"per.malmen@gmail.com"
] | per.malmen@gmail.com |
51300dca3ebdd8d49a5ff1992e770694a87cd882 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/23/23_0e992381467f569457a30caf3ac192ab2339af45/LightHarvestFunc/23_0e992381467f569457a30caf3ac192ab2339af45_LightHarvestFunc_s.java | c9d3f2953f353d581e5ea63a384d0cd33bd35b01 | [] | 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,247 | java |
/*
*
*This file is part of opensearch.
*Copyright © 2009, Dansk Bibliotekscenter a/s,
*Tempovej 7-11, DK-2750 Ballerup, Denmark. CVR: 15149043
*
*opensearch 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.
*
*opensearch 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 opensearch. If not, see <http://www.gnu.org/licenses/>.
*/
package dk.dbc.opensearch.components.harvest;
import java.util.ArrayList;
import java.util.Iterator;
/**
*
*/
public class LightHarvestFunc {
static FileHarvestLight harvester;
private static int counter = 0;
public static void main( String[] args )
{
runTests();
}
static void runTests()
{
startHarvestTest();
getJobsNDataTest();
}
private static void startHarvestTest()
{
try
{
harvester = new FileHarvestLight();
}
catch( Exception e )
{
e.printStackTrace();
}
harvester.start();
}
private static void getJobsNDataTest()
{
byte[] data = null;
// esh = new ESHarvest();
// esh.start();
//startESHarvestTest();
ArrayList<IJob> jobL = (ArrayList<IJob>)harvester.getJobs( 30 );
System.out.println( String.format( " the joblist contained %s jobs", jobL.size() ) );
Iterator iter = jobL.iterator();
System.out.println( "got jobs:" );
while( iter.hasNext() )
{
System.out.println("");
IJob theJob = (IJob)iter.next();
System.out.println( String.format( "job: %s", theJob.toString() ) );
try
{
data = harvester.getData( theJob.getIdentifier() );
System.out.println( String.format( "data gotten: %s", data.toString() ) );
}
catch( UnknownIdentifierException uie )
{
uie.printStackTrace();
}
setStatusTest( theJob.getIdentifier() );
}
}
/**
* testing the updating of jobs stetting the status to SUCCESS and then to FAILURE
*/
private static void setStatusTest( IIdentifier id )
{
try{
if ( counter % 2 == 0 ) {
harvester.setStatus( id, JobStatus.SUCCESS );
} else {
harvester.setStatus( id, JobStatus.FAILURE );
}
++counter;
}catch( UnknownIdentifierException uie )
{
uie.printStackTrace();
}
catch( InvalidStatusChangeException isce )
{
System.out.println(isce.getMsg() );
isce.printStackTrace();
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
c5218ed852518c97465e3ce090151d009dd3b1ce | e82c1473b49df5114f0332c14781d677f88f363f | /MED-CLOUD/med-service/src/main/java/nta/med/service/ihis/handler/nuro/NuroRES0102U00InsertRES01032Handler.java | 39a04d8bd4d3196475382945e5a78ee843d3e874 | [] | 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,713 | java | package nta.med.service.ihis.handler.nuro;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.transaction.annotation.Transactional;
import nta.med.core.domain.res.Res0103;
import nta.med.core.utils.DateUtil;
import nta.med.data.dao.medi.res.Res0103Repository;
import nta.med.core.infrastructure.socket.handler.ScreenHandler;
import nta.med.service.ihis.proto.NuroServiceProto;
import nta.med.service.ihis.proto.SystemServiceProto;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.vertx.java.core.Vertx;
@Service
@Scope("prototype")
@Transactional
public class NuroRES0102U00InsertRES01032Handler extends ScreenHandler<NuroServiceProto.NuroRES0102U00InsertRES0103Req2Request, SystemServiceProto.UpdateResponse>{
private static final Log logger = LogFactory.getLog(NuroRES0102U00InsertRES01032Handler.class);
@Resource
private Res0103Repository res0103Repository;
@Override
public boolean isValid(NuroServiceProto.NuroRES0102U00InsertRES0103Req2Request request, Vertx vertx, String clientId, String sessionId) {
if (!StringUtils.isEmpty(request.getJinryoPreDate()) && DateUtil.toDate(request.getJinryoPreDate(), DateUtil.PATTERN_YYMMDD) == null) {
return false;
}
return true;
}
@Override
public SystemServiceProto.UpdateResponse handle(Vertx vertx, String clientId,
String sessionId, long contextId,
NuroServiceProto.NuroRES0102U00InsertRES0103Req2Request request) throws Exception {
SystemServiceProto.UpdateResponse.Builder response = SystemServiceProto.UpdateResponse.newBuilder();
boolean result = insertRES0103(request, getHospitalCode(vertx, sessionId));
response.setResult(result);
return response.build();
}
private boolean insertRES0103(NuroServiceProto.NuroRES0102U00InsertRES0103Req2Request request, String hospCode) {
Res0103 res0103 = new Res0103();
res0103.setSysDate(new Date());
res0103.setSysId(request.getUserId());
res0103.setUpdDate(new Date());
res0103.setUpdId(request.getUserId());
res0103.setDoctor(request.getDoctor());
res0103.setJinryoPreDate(DateUtil.toDate(request.getJinryoPreDate(), DateUtil.PATTERN_YYMMDD));
res0103.setResAmStartHhmm(request.getResAmStartHhmm());
res0103.setResAmEndHhmm(request.getResAmEndHhmm());
res0103.setResPmStartHhmm(request.getResPmStartHhmm());
res0103.setResPmEndHhmm(request.getResPmEndHhmm());
res0103.setRemark(request.getRemark());
res0103.setHospCode(hospCode);
res0103Repository.save(res0103);
return true;
}
}
| [
"duc_nt@nittsusystem-vn.com"
] | duc_nt@nittsusystem-vn.com |
126f9a031409ed91b0de398d55f3139e3a48f15c | 781f1608d6c2381f9b5eeecfbcb2e2e6e9702fee | /intermediate-package/writing-end-to-end-tests/spring-boot/src/main/java/com/testwithspring/intermediate/example/ExampleController.java | 18a1a0fc55992f8b7e472ea90b436ca2beb21ff9 | [
"Apache-2.0"
] | permissive | pkainulainen/test-with-spring | 30033cbd4e50c6cdb0802d617d148d64777d0717 | 34ff510322734bb1c2ac13b732591a2bc88644d0 | refs/heads/master | 2022-12-07T04:16:28.523592 | 2021-01-13T17:29:27 | 2021-01-13T17:29:27 | 56,919,961 | 63 | 79 | NOASSERTION | 2022-11-24T07:39:04 | 2016-04-23T13:14:17 | Java | UTF-8 | Java | false | false | 405 | java | package com.testwithspring.intermediate.example;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class ExampleController {
@RequestMapping(value = "/", method = RequestMethod.GET)
public String renderExampleView() {
return "index";
}
}
| [
"petri.kainulainen@gmail.com"
] | petri.kainulainen@gmail.com |
2d07c159157f859839bfd3b8c1a555aafcaa39dd | 15d038d7904d0859bd6fe884cd02276a7bf6aab5 | /2016/10.Singleton/src/com/alg/dp/singleton/Driver.java | f169d340b490fb3eac3ffa5c5330ca91aa67aebd | [] | no_license | DharmendraPrajapati/design-patterns | e9246b672d56d73fa915e7d5e35a4deed50760cc | 3e2bc6b7ad5ac46884d40b7938c09484be2ee12f | refs/heads/master | 2022-02-15T21:17:36.971028 | 2019-09-15T03:57:38 | 2019-09-15T03:57:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 202 | java | package com.alg.dp.singleton;
public class Driver {
public static void main(String[] args) {
Clipboard cb = Clipboard.getInstance();
cb.setData("abc");
System.out.println(cb.getData());
}
}
| [
"info@algorithmica.co.in"
] | info@algorithmica.co.in |
2b27420366331b05e77c9dee0307b2d642a57a1e | b4f298b92fb5b7b1d9fd153320bd91dbcc4e660a | /app/src/main/java/com/hollysmart/utils/taskpool/OnNetRequestListener.java | 5a150a9a9459fac9c5400a5660c75793e8260dcc | [] | no_license | MaTengFei1990/HuanWei | 8d93c91f0c491d42c663a42bf3e5dc0db3a981b5 | cdf84768a89c1ea7b0591e99d6a53001f199fb40 | refs/heads/master | 2020-05-04T15:01:24.692918 | 2019-04-03T06:04:58 | 2019-04-03T06:04:58 | 179,220,567 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 226 | java | package com.hollysmart.utils.taskpool;
/**
* Created by cai on 16/6/6.
*/
public interface OnNetRequestListener {
void onSuccess();
void OnNext(int taskTag, Object data, int total);
void onFailed(String msg);
}
| [
"1124061609@qq.com"
] | 1124061609@qq.com |
e09591e8b1b863c73915ddc25758d12b71591ac1 | 62cdd7de9dccfda3d99736b65a05c450c2c7f77b | /efs-core/efs-core-mongo/src/main/java/com/efs/core/mongo/service/ExistMongoService.java | 48e381de324d9df327a5539dfa9a8362fefdca91 | [] | no_license | lordmarkm/exist-flexible-cms | 9e8fbca3ba9b31ebbe342ec829639f3fbda85dcf | 073ce63ad415656f2cfc9cfca17822bc8190e8f4 | refs/heads/master | 2020-03-11T00:20:25.448561 | 2018-06-14T01:55:08 | 2018-06-14T01:55:08 | 129,661,396 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 346 | java | package com.efs.core.mongo.service;
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.efs.core.mongo.model.BaseMongoEntity;
@NoRepositoryBean
public interface ExistMongoService<E extends BaseMongoEntity> extends MongoRepository<E, String> {
}
| [
"mbmartinez@exist.com"
] | mbmartinez@exist.com |
9f6c29620b58ecf9f2b8b23df4dc20ac011425a5 | 564c5643da489dd3806026a3041dc249732bb6b4 | /src/main/java/com/redhat/cajun/navy/responder/listener/ResponderCommandMessageListener.java | 93092ffd9a93faa577f86b6fc053e9f387376e88 | [] | no_license | gpte-emergency-response-demo/responder-service | 8439f550b15e079c5b156ecc05f2c752d79ab48f | 1cca056e6c0ac0ccdff5774cb9008195983994a5 | refs/heads/master | 2022-02-21T16:29:06.542612 | 2019-06-02T08:07:09 | 2019-06-02T08:07:09 | 198,524,294 | 0 | 0 | null | 2022-02-10T02:12:56 | 2019-07-23T23:45:19 | Java | UTF-8 | Java | false | false | 4,940 | java | package com.redhat.cajun.navy.responder.listener;
import java.util.Arrays;
import java.util.Optional;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jayway.jsonpath.JsonPath;
import com.redhat.cajun.navy.responder.message.Message;
import com.redhat.cajun.navy.responder.message.ResponderUpdatedEvent;
import com.redhat.cajun.navy.responder.message.UpdateResponderCommand;
import com.redhat.cajun.navy.responder.model.Responder;
import com.redhat.cajun.navy.responder.service.ResponderService;
import org.apache.commons.lang3.tuple.Triple;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.kafka.support.KafkaHeaders;
import org.springframework.kafka.support.SendResult;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;
import org.springframework.util.concurrent.ListenableFuture;
@Component
public class ResponderCommandMessageListener {
private final static Logger log = LoggerFactory.getLogger(ResponderCommandMessageListener.class);
private static final String UPDATE_RESPONDER_COMMAND = "UpdateResponderCommand";
private static final String[] ACCEPTED_MESSAGE_TYPES = {UPDATE_RESPONDER_COMMAND};
@Autowired
private ResponderService responderService;
@Autowired
private KafkaTemplate<String, Message<?>> kafkaTemplate;
@Value("${sender.destination.reporter-updated-event}")
private String destination;
@KafkaListener(topics = "${listener.destination.update-responder-command}")
public void processMessage(@Payload String messageAsJson,
@Header(KafkaHeaders.RECEIVED_TOPIC) String topic,
@Header(KafkaHeaders.RECEIVED_PARTITION_ID) int partition, Acknowledgment ack) {
acceptMessageType(messageAsJson, ack).ifPresent(m -> processUpdateResponderCommand(messageAsJson, topic, partition, ack));
}
private void processUpdateResponderCommand(String messageAsJson, String topic, int partition, Acknowledgment ack) {
Message<UpdateResponderCommand> message;
try {
message = new ObjectMapper().readValue(messageAsJson, new TypeReference<Message<UpdateResponderCommand>>() {});
Responder responder = message.getBody().getResponder();
log.debug("Processing '" + UPDATE_RESPONDER_COMMAND + "' message for responder '" + responder.getId()
+ "' from topic:partition " + topic + ":" + partition);
Triple<Boolean, String, Responder> result = responderService.updateResponder(responder);
// Only send a responder updated event message if there is a 'incidentId' header in the incoming message
if (message.getHeaderValue("incidentId") != null) {
String status = (result.getLeft() ? "success" : "error");
ResponderUpdatedEvent event = new ResponderUpdatedEvent.Builder(status, result.getRight())
.statusMessage(result.getMiddle()).build();
Message eventMessage = new Message.Builder<>("ResponderUpdatedEvent",
"ResponderService", event)
.header("incidentId", message.getHeaderValue("incidentId"))
.build();
ListenableFuture<SendResult<String, Message<?>>> future = kafkaTemplate.send(destination, responder.getId(), eventMessage);
future.addCallback(
res -> log.debug("Sent 'ResponderUpdatedEvent' message for responder " + responder.getId()),
ex -> log.error("Error sending 'IncidentReportedEvent' message for incident " + responder.getId(), ex));
}
ack.acknowledge();
} catch (Exception e) {
log.error("Error processing msg " + messageAsJson, e);
throw new IllegalStateException(e.getMessage(), e);
}
}
private Optional<String> acceptMessageType(String messageAsJson, Acknowledgment ack) {
try {
String messageType = JsonPath.read(messageAsJson, "$.messageType");
if (Arrays.asList(ACCEPTED_MESSAGE_TYPES).contains(messageType)) {
return Optional.of(messageType);
}
log.debug("Message with type '" + messageType + "' is ignored");
} catch (Exception e) {
log.warn("Unexpected message without 'messageType' field.");
}
ack.acknowledge();
return Optional.empty();
}
}
| [
"bernard.tison@gmail.com"
] | bernard.tison@gmail.com |
6c6e850f977de846df020c3ce6cd94e1b5fa21c2 | 7ce60ae831a4afcefe30b149ad5aa2a01c61280d | /Test Data/Comp401F17/Assignment7/Correct, Stub(stubs)/Submission attachment(s)/Assignment7Stubs/Assignment7Stubs/src/grail/graphics/Image.java | aae632e132bb4c3e5180e69c1c3673e06f90dea7 | [] | no_license | pdewan/Comp401AllChecks | ed967cb535f1bf8c6d7777b7ca53bd6e810e5ba1 | 86d995defcdde2766329a6db37fdb7a54c70da4a | refs/heads/master | 2023-06-26T13:01:27.009697 | 2023-06-12T06:05:01 | 2023-06-12T06:05:01 | 66,742,312 | 0 | 0 | null | 2022-06-30T14:43:42 | 2016-08-28T00:49:37 | Java | UTF-8 | Java | false | false | 766 | java | package grail.graphics;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import grail.interfaces.ImageInterface;
import util.annotations.EditablePropertyNames;
import util.annotations.PropertyNames;
import util.annotations.StructurePattern;
import util.annotations.StructurePatternNames;
@StructurePattern(StructurePatternNames.IMAGE_PATTERN)
@PropertyNames({"X", "Y", "Width", "Height", "ImageFileName"})
@EditablePropertyNames({"X", "Y", "Width", "Height", "ImageFileName"})
public class Image extends Rectangle implements ImageInterface {
@Override
public void setImageFileName(String imageFileName) {
// TODO Auto-generated method stub
}
@Override
public String getImageFileName() {
// TODO Auto-generated method stub
return null;
}
}
| [
"avitkus7@gmail.com"
] | avitkus7@gmail.com |
d8bd728c27be72436e460ecefa28368d5951a707 | e6db3632750fc9a8078df761fab4a13ac5f61de9 | /src/main/java/com/example/ioccontainer/OrderService.java | 51a4daae62a3889daa3221a596eb5308c07e5a90 | [] | no_license | jinrunheng/simple-ioc-container | abb817932d6b63a677c701190fb7bc639438034d | 50a25927e5e5c465327e54b0d864390c1ccd96bb | refs/heads/main | 2023-08-28T01:31:30.090956 | 2021-10-22T15:11:18 | 2021-10-22T15:11:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 325 | java | package com.example.ioccontainer;
import org.springframework.beans.factory.annotation.Autowired;
public class OrderService {
@Autowired
private OrderDao orderDao;
@Autowired
private UserService userService;
public void createOrder(){
orderDao.createOrder(userService.getUserById(1));
}
}
| [
"1175088275@qq.com"
] | 1175088275@qq.com |
e8922c39bbf97a02e63a6e5ac5737239ab90d63d | 08a00c89da5bd91d3c7bd3760af1de5dd1becdf2 | /app/src/main/java/com/example/script972/taxitz/OrderAdapter.java | a125a6be68b5ff7459f416be73491b2c6921e236 | [] | no_license | script972/TaxiTZ | 696dae1e9f22be3d2343f5658dcece316d0d047c | 3d170d1ac2eaf23c06cf22fdb3c0907c2fa96ab1 | refs/heads/master | 2021-01-19T22:16:44.559774 | 2017-04-23T20:56:48 | 2017-04-23T20:56:48 | 88,783,056 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,822 | java | package com.example.script972.taxitz;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.script972.taxitz.model.Order;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
/**
* Created by script972 on 20.04.2017.
*/
public class OrderAdapter extends BaseAdapter {
Context ctx;
LayoutInflater layoutInflater;
ArrayList<Order> orders;
public OrderAdapter(Context ctx, ArrayList<Order> orders) {
this.ctx = ctx;
this.orders = orders;
layoutInflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return orders.size();
}
@Override
public Object getItem(int position) {
return orders.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
if (view == null) {
view = layoutInflater.inflate(R.layout.item, parent, false);
}
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd H:M");
Order o = getOrder(position);
((TextView) view.findViewById(R.id.price)).setText(String.valueOf(o.getPrice()));
((TextView) view.findViewById(R.id.pointadres)).setText(o.getPoint1());
((TextView) view.findViewById(R.id.pointtime)).setText(format.format(o.getDate()));
((TextView) view.findViewById(R.id.describe)).setText(o.getDescription());
return view;
}
Order getOrder(int position) {
return (Order) getItem(position);
}
}
| [
"script972@gmail.com"
] | script972@gmail.com |
5b558218fbe11be55747e63efd3eef18662f38b6 | 951a2cebfb3b742a0b9da0dee787f4610505292c | /toq/Misc/JavaSrc/org/apache/log4j/chainsaw/DetailPanel.java | 6715ab463b89a80099738add7b3cb3fe15905e41 | [] | no_license | marciallus/mytoqmanager | eca30683508878b712e9c1c6642f39f34c2e257b | 65fe1d54e8593900262d5b263d75feb646c015e6 | refs/heads/master | 2020-05-17T01:03:44.121469 | 2014-12-10T07:22:14 | 2014-12-10T07:22:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,739 | java | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) fieldsfirst noctor space
package org.apache.log4j.chainsaw;
import java.awt.BorderLayout;
import java.text.MessageFormat;
import java.util.Date;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import org.apache.log4j.Logger;
// Referenced classes of package org.apache.log4j.chainsaw:
// EventDetails, MyTableModel
class DetailPanel extends JPanel
implements ListSelectionListener
{
private static final MessageFormat FORMATTER = new MessageFormat("<b>Time:</b> <code>{0,time,medium}</code> <b>Priority:</b> <code>{1}</code> <b>Thread:</b> <code>{2}</code> <b>NDC:</b> <code>{3}</code><br><b>Logger:</b> <code>{4}</code><br><b>Location:</b> <code>{5}</code><br><b>Message:</b><pre>{6}</pre><b>Throwable:</b><pre>{7}</pre>");
private static final Logger LOG;
static Class class$org$apache$log4j$chainsaw$DetailPanel;
private final JEditorPane mDetails = new JEditorPane();
private final MyTableModel mModel;
DetailPanel(JTable jtable, MyTableModel mytablemodel)
{
mModel = mytablemodel;
setLayout(new BorderLayout());
setBorder(BorderFactory.createTitledBorder("Details: "));
mDetails.setEditable(false);
mDetails.setContentType("text/html");
add(new JScrollPane(mDetails), "Center");
jtable.getSelectionModel().addListSelectionListener(this);
}
static Class _mthclass$(String s)
{
Class class1;
try
{
class1 = Class.forName(s);
}
catch (ClassNotFoundException classnotfoundexception)
{
throw (new NoClassDefFoundError()).initCause(classnotfoundexception);
}
return class1;
}
private String escape(String s)
{
if (s == null)
return null;
StringBuffer stringbuffer = new StringBuffer();
for (int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
switch (c)
{
case 38: // '&'
stringbuffer.append("&");
break;
case 34: // '"'
stringbuffer.append(""");
break;
case 62: // '>'
stringbuffer.append(">");
break;
case 60: // '<'
stringbuffer.append("<");
break;
default:
stringbuffer.append(c);
break;
}
}
return stringbuffer.toString();
}
private static String getThrowableStrRep(EventDetails eventdetails)
{
String as[] = eventdetails.getThrowableStrRep();
if (as == null)
return null;
StringBuffer stringbuffer = new StringBuffer();
for (int i = 0; i < as.length; i++)
stringbuffer.append(as[i]).append("\n");
return stringbuffer.toString();
}
public void valueChanged(ListSelectionEvent listselectionevent)
{
if (listselectionevent.getValueIsAdjusting())
return;
ListSelectionModel listselectionmodel = (ListSelectionModel)listselectionevent.getSource();
if (listselectionmodel.isSelectionEmpty())
{
mDetails.setText("Nothing selected");
return;
} else
{
int i = listselectionmodel.getMinSelectionIndex();
EventDetails eventdetails = mModel.getEventDetails(i);
Object aobj[] = new Object[8];
aobj[0] = new Date(eventdetails.getTimeStamp());
aobj[1] = eventdetails.getPriority();
aobj[2] = escape(eventdetails.getThreadName());
aobj[3] = escape(eventdetails.getNDC());
aobj[4] = escape(eventdetails.getCategoryName());
aobj[5] = escape(eventdetails.getLocationDetails());
aobj[6] = escape(eventdetails.getMessage());
aobj[7] = escape(getThrowableStrRep(eventdetails));
mDetails.setText(FORMATTER.format(((Object) (aobj))));
mDetails.setCaretPosition(0);
return;
}
}
static
{
Class class1;
if (class$org$apache$log4j$chainsaw$DetailPanel == null)
{
class1 = _mthclass$("org.apache.log4j.chainsaw.DetailPanel");
class$org$apache$log4j$chainsaw$DetailPanel = class1;
} else
{
class1 = class$org$apache$log4j$chainsaw$DetailPanel;
}
LOG = Logger.getLogger(class1);
}
}
| [
"marc.lanouiller@gmail.com"
] | marc.lanouiller@gmail.com |
5a3756886a3039843cb01fe16bbb713c3533f6cb | 88a67adc69f3205c110347bcbfdbc56a4787010a | /src/TestClass2.java | 70cd108f2563f76bfaa8db1e2364e0dd56f2ce2d | [] | no_license | Faraday314/Testing | 25a47a5de3e063fe6aae0f8de24053e35e839e03 | 7ad29f5860de22f58b237ab235cbdfe68c92be07 | refs/heads/master | 2022-07-19T01:01:35.700176 | 2020-05-27T19:35:52 | 2020-05-27T19:35:52 | 267,409,694 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 159 | java | public class TestClass2 {
private Test a;
public TestClass2(Test a) {
this.a = a;
}
public Test getText() {
return a;
}
}
| [
"colesavage02@gmail.com"
] | colesavage02@gmail.com |
bbde16a7d59687effc8bacb6cbbab205e7bcc5ae | 06528582583f7e0e17c2e0564bb4c9dd01829eeb | /src/main/java/ls/es/samples/util/Aggregations.java | c06c9d854fe238573b96da1e8d274ce73760853d | [] | no_license | lishuai2016/ls-elasticsearch | 105e5e8af077a44c6219a74cad6c332cb38abb99 | 94cf9ea2b973919a58359d182ae5138a16459cb4 | refs/heads/master | 2021-05-04T22:56:56.513090 | 2018-02-07T13:18:26 | 2018-02-07T13:18:26 | 120,076,592 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,741 | java | package ls.es.samples.util;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval;
import org.elasticsearch.search.aggregations.metrics.MetricsAggregationBuilder;
import org.elasticsearch.search.aggregations.metrics.avg.AvgBuilder;
import org.elasticsearch.search.aggregations.metrics.max.MaxBuilder;
import org.elasticsearch.search.aggregations.metrics.min.MinBuilder;
import org.elasticsearch.search.aggregations.metrics.percentiles.PercentileRanksBuilder;
import org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesBuilder;
import org.elasticsearch.search.aggregations.metrics.stats.extended.ExtendedStatsBuilder;
public class Aggregations {
private static String index_alias = "index_alias_company";
private static String type_name = "type_company";
public static void execute(){
avgQuery();
minQuery();
maxQuery();
extendedStatsQuery();
valueCountQuery();
percentileQuery();
percentileRankQuery();
rangeQuery();
histogramQuery();
dateHistogramQuery();
}
public static void avgQuery() {
System.out.println("avgQuery......");
TransportClient client = ESUtils.getTransportClient();
AvgBuilder agg = AggregationBuilders.avg("avg_num").field("LastClose");
SearchResponse res = client.prepareSearch(index_alias)
.setTypes(type_name)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.addAggregation(agg)
.setFrom(0)
.setSize(10)
.execute().actionGet();
System.out.println(res);
client.close();
}
public static void minQuery() {
System.out.println("minQuery......");
TransportClient client = ESUtils.getTransportClient();
MinBuilder agg = AggregationBuilders.min("min_num").field("LastClose");
SearchResponse res = client.prepareSearch(index_alias)
.setTypes(type_name)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.addAggregation(agg)
.setFrom(0)
.setSize(10)
.execute().actionGet();
System.out.println(res);
client.close();
}
public static void maxQuery() {
System.out.println("maxQuery......");
TransportClient client = ESUtils.getTransportClient();
MaxBuilder agg = AggregationBuilders.max("max_num").field("LastClose");
SearchResponse res = client.prepareSearch(index_alias)
.setTypes(type_name)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.addAggregation(agg)
.setFrom(0)
.setSize(10)
.execute().actionGet();
System.out.println(res);
client.close();
}
public static void extendedStatsQuery() {
System.out.println("extendedStatsQuery......");
TransportClient client = ESUtils.getTransportClient();
ExtendedStatsBuilder agg = AggregationBuilders.extendedStats("extended_stats_num").field("LastClose");
SearchResponse res = client.prepareSearch(index_alias)
.setTypes(type_name)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.addAggregation(agg)
.setFrom(0)
.setSize(10)
.execute().actionGet();
System.out.println(res);
client.close();
}
@SuppressWarnings("rawtypes")
public static void valueCountQuery() {
System.out.println("valueCountQuery......");
TransportClient client = ESUtils.getTransportClient();
MetricsAggregationBuilder agg = AggregationBuilders.count("value_count").field("LastClose");
SearchResponse res = client.prepareSearch(index_alias)
.setTypes(type_name)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.addAggregation(agg)
.setFrom(0)
.setSize(10)
.execute().actionGet();
System.out.println(res);
client.close();
}
public static void percentileQuery() {
System.out.println("percentileQuery......");
TransportClient client = ESUtils.getTransportClient();
PercentilesBuilder agg = AggregationBuilders.percentiles("percentile_num").field("LastClose").percentiles(95,99,99.9);
SearchResponse res = client.prepareSearch(index_alias)
.setTypes(type_name)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.addAggregation(agg)
.setFrom(0)
.setSize(10)
.execute().actionGet();
System.out.println(res);
client.close();
}
public static void percentileRankQuery() {
System.out.println("percentileRankQuery......");
TransportClient client = ESUtils.getTransportClient();
PercentileRanksBuilder agg = AggregationBuilders.percentileRanks("percentile_rank_num").field("LastClose").percentiles(3,5);
SearchResponse res = client.prepareSearch(index_alias)
.setTypes(type_name)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.addAggregation(agg)
.setFrom(0)
.setSize(10)
.execute().actionGet();
System.out.println(res);
client.close();
}
@SuppressWarnings("rawtypes")
public static void rangeQuery() {
System.out.println("rangeQuery......");
TransportClient client = ESUtils.getTransportClient();
AggregationBuilder agg = AggregationBuilders.range("agg").field("LastClose").addUnboundedTo(3).addRange(3, 5).addUnboundedFrom(5);
SearchResponse res = client.prepareSearch(index_alias)
.setTypes(type_name)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.addAggregation(agg)
.setFrom(0)
.setSize(0)
.execute().actionGet();
System.out.println(res);
client.close();
}
@SuppressWarnings("rawtypes")
public static void histogramQuery() {
System.out.println("histogramQuery......");
TransportClient client = ESUtils.getTransportClient();
AggregationBuilder agg = AggregationBuilders.histogram("agg").field("LastClose").interval(2);
SearchResponse res = client.prepareSearch(index_alias)
.setTypes(type_name)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.addAggregation(agg)
.setFrom(0)
.setSize(0)
.execute().actionGet();
System.out.println(res);
client.close();
}
@SuppressWarnings("rawtypes")
public static void dateHistogramQuery() {
System.out.println("dateHistogramQuery......");
TransportClient client = ESUtils.getTransportClient();
AggregationBuilder agg = AggregationBuilders.dateHistogram("agg").field("ListedDate").interval(DateHistogramInterval.YEAR).minDocCount(1);
SearchResponse res = client.prepareSearch(index_alias)
.setTypes(type_name)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.addAggregation(agg)
.setFrom(0)
.setSize(0)
.execute().actionGet();
System.out.println(res);
client.close();
}
public static void main(String[] args){
execute();
}
}
| [
"1830473670@qq.com"
] | 1830473670@qq.com |
1982749399d98342090d35ab971cfe712be23866 | de0fd3a72463c76a6980fdc3708566a6ebae793b | /src/test/java/io/proleap/cobol/asg/data/workingstorage/DataDescriptionPictureTest.java | 4683a5d79733c305ca9e9542a81a9baa75b14af9 | [
"MIT"
] | permissive | jasmoran/proleap-cobol-parser | 2d43460ee306e0c64729ed464f1969e37eeaa7ac | 61ca74678f998b1a4c9dfbf6dd76dca552ca6a11 | refs/heads/master | 2023-08-17T06:41:12.035842 | 2021-10-05T07:47:38 | 2021-10-05T09:37:39 | 411,218,262 | 1 | 0 | MIT | 2021-09-28T09:32:08 | 2021-09-28T09:32:06 | null | UTF-8 | Java | false | false | 1,710 | java | package io.proleap.cobol.asg.data.workingstorage;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.io.File;
import org.junit.Test;
import io.proleap.cobol.CobolTestBase;
import io.proleap.cobol.asg.metamodel.CompilationUnit;
import io.proleap.cobol.asg.metamodel.Program;
import io.proleap.cobol.asg.metamodel.ProgramUnit;
import io.proleap.cobol.asg.metamodel.data.DataDivision;
import io.proleap.cobol.asg.metamodel.data.datadescription.DataDescriptionEntryGroup;
import io.proleap.cobol.asg.metamodel.data.workingstorage.WorkingStorageSection;
import io.proleap.cobol.asg.runner.impl.CobolParserRunnerImpl;
import io.proleap.cobol.preprocessor.CobolPreprocessor.CobolSourceFormatEnum;
public class DataDescriptionPictureTest extends CobolTestBase {
@Test
public void test() throws Exception {
final File inputFile = new File(
"src/test/resources/io/proleap/cobol/asg/data/workingstorage/DataDescriptionPicture.cbl");
final Program program = new CobolParserRunnerImpl().analyzeFile(inputFile, CobolSourceFormatEnum.TANDEM);
final CompilationUnit compilationUnit = program.getCompilationUnit("DataDescriptionPicture");
final ProgramUnit programUnit = compilationUnit.getProgramUnit();
final DataDivision dataDivision = programUnit.getDataDivision();
final WorkingStorageSection workingStorageSection = dataDivision.getWorkingStorageSection();
final DataDescriptionEntryGroup dataDescriptionEntryItem = (DataDescriptionEntryGroup) workingStorageSection
.getDataDescriptionEntry("ITEM");
assertNotNull(dataDescriptionEntryItem);
assertEquals("X(10)", dataDescriptionEntryItem.getPictureClause().getPictureString());
}
}
| [
"u.wol@wwu.de"
] | u.wol@wwu.de |
5c9479491d839683e3013b0af554681095f1e5d8 | 4ce12b1648cb5eb1359acadc3d4c625126c69f61 | /src/main/java/com/example/demo/service/impl/JapanServiceImpl.java | df72b3fd6e977691b1a226aecf0f5809d7648491 | [] | no_license | ghdud3045/bdi-sb | 57872d494771fef0d97f36a5392199ae008b7c2f | 946099df729938f5e02eaab25ba30362b22ce81c | refs/heads/master | 2020-04-08T15:46:39.418184 | 2018-11-28T11:21:52 | 2018-11-28T11:21:52 | 159,488,388 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 838 | java | package com.example.demo.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.demo.dao.JapanDAO;
import com.example.demo.service.JapanService;
import com.example.demo.vo.JapanVO;
@Service
public class JapanServiceImpl implements JapanService {
@Autowired
JapanDAO jdao;
@Override
public List<JapanVO> selectJapanList() {
return jdao.selectJapanList();
}
@Override
public JapanVO selectJapan(int jpnum) {
return jdao.selectJapan(jpnum);
}
@Override
public Integer insertJapan(JapanVO jp) {
return jdao.insertJapan(jp);
}
@Override
public Integer updateJapan(JapanVO jp) {
return jdao.updateJapan(jp);
}
@Override
public Integer deleteJapan(int jpnum) {
return jdao.deleteJapan(jpnum);
}
}
| [
"KOITT@KOITT-PC"
] | KOITT@KOITT-PC |
d248f731a1a9ce6d0b16205bf18dccab6cb1167e | 631fbbb8b7654fc3097beae36598ac625f488624 | /hadoop-2.0.0/src/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestFSMainOperationsWebHdfs.java | 28808e049ef18d9f43bc87222595625d0a82ac4f | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | edquist/hadoop-osg | 462a0dda97fb89ad3cd8000b8d614ed467d2becd | 923c7fbe69e21fe44e175b55917b744e6984e113 | refs/heads/master | 2021-05-06T13:16:36.922758 | 2016-02-17T01:18:59 | 2016-02-17T03:33:17 | 113,215,423 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,681 | 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.hadoop.hdfs.web;
import static org.apache.hadoop.fs.FileSystemTestHelper.exists;
import static org.apache.hadoop.fs.FileSystemTestHelper.getTestRootPath;
import java.io.IOException;
import java.net.URI;
import java.security.PrivilegedExceptionAction;
import org.apache.commons.logging.impl.Log4JLogger;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSMainOperationsBaseTest;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.hdfs.DFSConfigKeys;
import org.apache.hadoop.hdfs.DFSTestUtil;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.hadoop.hdfs.server.datanode.web.resources.DatanodeWebHdfsMethods;
import org.apache.hadoop.hdfs.web.resources.ExceptionHandler;
import org.apache.hadoop.security.AccessControlException;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.log4j.Level;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
public class TestFSMainOperationsWebHdfs extends FSMainOperationsBaseTest {
{
((Log4JLogger)ExceptionHandler.LOG).getLogger().setLevel(Level.ALL);
((Log4JLogger)DatanodeWebHdfsMethods.LOG).getLogger().setLevel(Level.ALL);
}
private static MiniDFSCluster cluster = null;
private static Path defaultWorkingDirectory;
@BeforeClass
public static void setupCluster() {
final Configuration conf = new Configuration();
conf.setBoolean(DFSConfigKeys.DFS_WEBHDFS_ENABLED_KEY, true);
conf.setLong(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, 1024);
try {
cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
cluster.waitActive();
//change root permission to 777
cluster.getFileSystem().setPermission(
new Path("/"), new FsPermission((short)0777));
final String uri = WebHdfsFileSystem.SCHEME + "://"
+ conf.get(DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY);
//get file system as a non-superuser
final UserGroupInformation current = UserGroupInformation.getCurrentUser();
final UserGroupInformation ugi = UserGroupInformation.createUserForTesting(
current.getShortUserName() + "x", new String[]{"user"});
fSys = ugi.doAs(new PrivilegedExceptionAction<FileSystem>() {
@Override
public FileSystem run() throws Exception {
return FileSystem.get(new URI(uri), conf);
}
});
defaultWorkingDirectory = fSys.getWorkingDirectory();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@AfterClass
public static void shutdownCluster() {
if (cluster != null) {
cluster.shutdown();
cluster = null;
}
}
@Override
protected Path getDefaultWorkingDirectory() {
return defaultWorkingDirectory;
}
@Test
public void testConcat() throws Exception {
Path[] paths = {new Path("/test/hadoop/file1"),
new Path("/test/hadoop/file2"),
new Path("/test/hadoop/file3")};
DFSTestUtil.createFile(fSys, paths[0], 1024, (short) 3, 0);
DFSTestUtil.createFile(fSys, paths[1], 1024, (short) 3, 0);
DFSTestUtil.createFile(fSys, paths[2], 1024, (short) 3, 0);
Path catPath = new Path("/test/hadoop/catFile");
DFSTestUtil.createFile(fSys, catPath, 1024, (short) 3, 0);
Assert.assertTrue(exists(fSys, catPath));
fSys.concat(catPath, paths);
Assert.assertFalse(exists(fSys, paths[0]));
Assert.assertFalse(exists(fSys, paths[1]));
Assert.assertFalse(exists(fSys, paths[2]));
FileStatus fileStatus = fSys.getFileStatus(catPath);
Assert.assertEquals(1024*4, fileStatus.getLen());
}
@Override
@Test
public void testMkdirsFailsForSubdirectoryOfExistingFile() throws Exception {
Path testDir = getTestRootPath(fSys, "test/hadoop");
Assert.assertFalse(exists(fSys, testDir));
fSys.mkdirs(testDir);
Assert.assertTrue(exists(fSys, testDir));
createFile(getTestRootPath(fSys, "test/hadoop/file"));
Path testSubDir = getTestRootPath(fSys, "test/hadoop/file/subdir");
try {
fSys.mkdirs(testSubDir);
Assert.fail("Should throw IOException.");
} catch (IOException e) {
// expected
}
try {
Assert.assertFalse(exists(fSys, testSubDir));
} catch(AccessControlException e) {
// also okay for HDFS.
}
Path testDeepSubDir = getTestRootPath(fSys, "test/hadoop/file/deep/sub/dir");
try {
fSys.mkdirs(testDeepSubDir);
Assert.fail("Should throw IOException.");
} catch (IOException e) {
// expected
}
try {
Assert.assertFalse(exists(fSys, testDeepSubDir));
} catch(AccessControlException e) {
// also okay for HDFS.
}
}
} | [
"edquist@cs.wisc.edu"
] | edquist@cs.wisc.edu |
628b5f5931a1905f61e876fe1936ed30bf872111 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_00a9aa665ddd194afbb82e0f5ff68afa3ca1deb1/BlogReferer/5_00a9aa665ddd194afbb82e0f5ff68afa3ca1deb1_BlogReferer_s.java | 9e0dcffdfde9b42c2d1b65cd3c261aeefa83e4b7 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,474 | java | /**
* Copyright (c) 2003, David A. Czarnecki
* All rights reserved.
*
* Portions Copyright (c) 2003 by Mark Lussier
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the "David A. Czarnecki" and "blojsom" nor the names of
* its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Products derived from this software may not be called "blojsom",
* nor may "blojsom" appear in their name, without prior written permission of
* David A. Czarnecki.
*
* 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
* 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 org.ignition.blojsom.plugin.referer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.ignition.blojsom.util.BlojsomUtils;
import java.util.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;
import sun.util.calendar.Gregorian;
/**
* BlogReferer
*
* @author Mark Lussier
* @version $Id: BlogReferer.java,v 1.2 2003-03-28 21:20:23 intabulas Exp $
*/
public class BlogReferer {
private String _url;
private String _flavor;
private Date _lastreferal;
private int _count;
/**
*
*/
private boolean _istoday = false;
/**
*
*/
private Log _logger = LogFactory.getLog(BlogReferer.class);
/**
*
* @param flavor
* @param url
* @param date
* @param count
*/
public BlogReferer(String flavor, String url, Date date, int count) {
_url = url;
_lastreferal = date;
_count = count;
_flavor = flavor;
_istoday = determineToday();
}
/**
*
* @return
*/
public String getFlavor() {
return _flavor;
}
/**
*
* @param flavor
*/
public void setFlavor(String flavor) {
_flavor = flavor;
}
/**
*
* @return
*/
public String getUrl() {
return _url;
}
/**
*
* @param url
*/
public void setUrl(String url) {
_url = url;
}
/**
*
* @return
*/
public Date getLastReferal() {
return _lastreferal;
}
/**
*
* @return
*/
public boolean isToday() {
return _istoday;
}
/**
*
* @param lastreferal
*/
public void setLastReferal(Date lastreferal) {
if (_lastreferal.compareTo(lastreferal) > 0) {
_lastreferal = lastreferal;
_istoday = determineToday();
}
}
/**
*
* @return
*/
public int getRefererCount() {
return _count;
}
/**
*
*/
public void increment() {
_count += 1;
}
/**
*
* @param count
*/
public void setCount(int count) {
_count = count;
}
/**
* Determines if this referer has been seen TODAY
* @return a boolean indicating if it was seend today
*/
private boolean determineToday() {
return (RefererLogPlugin.getRefererDate(new Date()).equals(RefererLogPlugin.getRefererDate(_lastreferal)));
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
3b8c214d53a18854c58c64a20396a27994cb9861 | 1098359647d5d1a7427cc0d9f89cf340cc2b0541 | /kalturaScheduler/src/main/java/com/kaltura/client/enums/KalturaAuditTrailFileSyncType.java | a0313931b5b992b87b93eedba9fa48ed97678008 | [] | no_license | edcgamer/KalturaScheduler2.0 | e799b107ec79755bca28f67b8692b44a40188810 | 15dec08a4c4b0ac640d8cfc29ae93d7f39a4c700 | refs/heads/master | 2021-01-01T18:23:25.938375 | 2014-10-01T17:07:53 | 2014-10-01T17:07:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,109 | java | // ===================================================================================================
// _ __ _ _
// | |/ /__ _| | |_ _ _ _ _ __ _
// | ' </ _` | | _| || | '_/ _` |
// |_|\_\__,_|_|\__|\_,_|_| \__,_|
//
// This file is part of the Kaltura Collaborative Media Suite which allows users
// to do with audio, video, and animation what Wiki platfroms allow them to do with
// text.
//
// Copyright (C) 2006-2011 Kaltura Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// @ignore
// ===================================================================================================
package com.kaltura.client.enums;
/**
* This class was generated using generate.php
* against an XML schema provided by Kaltura.
* @date Tue, 20 Aug 13 03:11:34 -0400
*
* MANUAL CHANGES TO THIS CLASS WILL BE OVERWRITTEN.
*/
public enum KalturaAuditTrailFileSyncType implements KalturaEnumAsInt {
FILE (1),
LINK (2),
URL (3);
public int hashCode;
KalturaAuditTrailFileSyncType(int hashCode) {
this.hashCode = hashCode;
}
public int getHashCode() {
return this.hashCode;
}
public static KalturaAuditTrailFileSyncType get(int hashCode) {
switch(hashCode) {
case 1: return FILE;
case 2: return LINK;
case 3: return URL;
default: return FILE;
}
}
}
| [
"edcgamer@hotmail.com"
] | edcgamer@hotmail.com |
8f0dad263ad79c42765e82b10fa5e61f0b37feb9 | 4d6f449339b36b8d4c25d8772212bf6cd339f087 | /netreflected/src/Framework/System,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089/system/configuration/SettingAttribute.java | c34ec1081c72a96af10a3546903b6f7b73b2b2db | [
"MIT"
] | permissive | lvyitian/JCOReflector | 299a64550394db3e663567efc6e1996754f6946e | 7e420dca504090b817c2fe208e4649804df1c3e1 | refs/heads/master | 2022-12-07T21:13:06.208025 | 2020-08-28T09:49:29 | 2020-08-28T09:49:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,286 | java | /*
* MIT License
*
* Copyright (c) 2020 MASES s.r.l.
*
* 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.
*/
/**************************************************************************************
* <auto-generated>
* This code was generated from a template using JCOReflector
*
* Manual changes to this file may cause unexpected behavior in your application.
* Manual changes to this file will be overwritten if the code is regenerated.
* </auto-generated>
*************************************************************************************/
package system.configuration;
import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;
// Import section
import system.Attribute;
/**
* The base .NET class managing System.Configuration.SettingAttribute, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. Extends {@link NetObject}.
* <p>
*
* See: <a href="https://docs.microsoft.com/en-us/dotnet/api/System.Configuration.SettingAttribute" target="_top">https://docs.microsoft.com/en-us/dotnet/api/System.Configuration.SettingAttribute</a>
*/
public class SettingAttribute extends Attribute {
/**
* Fully assembly qualified name: System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
*/
public static final String assemblyFullName = "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
/**
* Assembly name: System
*/
public static final String assemblyShortName = "System";
/**
* Qualified class name: System.Configuration.SettingAttribute
*/
public static final String className = "System.Configuration.SettingAttribute";
static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName);
/**
* The type managed from JCOBridge. See {@link JCType}
*/
public static JCType classType = createType();
static JCEnum enumInstance = null;
JCObject classInstance = null;
static JCType createType() {
try {
return bridge.GetType(className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName));
} catch (JCException e) {
return null;
}
}
void addReference(String ref) throws Throwable {
try {
bridge.AddReference(ref);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SettingAttribute(Object instance) throws Throwable {
super(instance);
if (instance instanceof JCObject) {
classInstance = (JCObject) instance;
} else
throw new Exception("Cannot manage object, it is not a JCObject");
}
public String getJCOAssemblyName() {
return assemblyFullName;
}
public String getJCOClassName() {
return className;
}
public String getJCOObjectName() {
return className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
}
public Object getJCOInstance() {
return classInstance;
}
public void setJCOInstance(JCObject instance) {
classInstance = instance;
super.setJCOInstance(classInstance);
}
public JCType getJCOType() {
return classType;
}
/**
* Try to cast the {@link IJCOBridgeReflected} instance into {@link SettingAttribute}, a cast assert is made to check if types are compatible.
*/
public static SettingAttribute cast(IJCOBridgeReflected from) throws Throwable {
NetType.AssertCast(classType, from);
return new SettingAttribute(from.getJCOInstance());
}
// Constructors section
public SettingAttribute() throws Throwable {
try {
// add reference to assemblyName.dll file
addReference(JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Methods section
// Properties section
// Instance Events section
} | [
"mario.mastrodicasa@masesgroup.com"
] | mario.mastrodicasa@masesgroup.com |
9b5d5a9bf9c5650dc2766aa00ca0de73d3389442 | 86505462601eae6007bef6c9f0f4eeb9fcdd1e7b | /bin/modules/web-content-management-system/cmsfacades/testsrc/de/hybris/platform/cmsfacades/util/models/CMSTimeRestrictionModelMother.java | 89981007bb802f1d23548a9f7cb05d3a28bf2e7c | [] | no_license | jp-developer0/hybrisTrail | 82165c5b91352332a3d471b3414faee47bdb6cee | a0208ffee7fee5b7f83dd982e372276492ae83d4 | refs/heads/master | 2020-12-03T19:53:58.652431 | 2020-01-02T18:02:34 | 2020-01-02T18:02:34 | 231,430,332 | 0 | 4 | null | 2020-08-05T22:46:23 | 2020-01-02T17:39:15 | null | UTF-8 | Java | false | false | 4,605 | java | /*
* Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
*/
package de.hybris.platform.cmsfacades.util.models;
import de.hybris.platform.catalog.model.CatalogVersionModel;
import de.hybris.platform.cms2.model.contents.components.AbstractCMSComponentModel;
import de.hybris.platform.cms2.model.pages.AbstractPageModel;
import de.hybris.platform.cms2.model.restrictions.CMSTimeRestrictionModel;
import de.hybris.platform.cms2.servicelayer.daos.CMSRestrictionDao;
import de.hybris.platform.cmsfacades.util.builder.CMSTimeRestrictionModelBuilder;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.GregorianCalendar;
import org.apache.commons.lang.time.DateUtils;
public class CMSTimeRestrictionModelMother extends AbstractModelMother<CMSTimeRestrictionModel>
{
public static final String UID_TOMORROW = "uid-tomorrow";
public static final String NAME_TOMORROW = "name-tomorrow";
public static final String UID_TODAY = "uid-today";
public static final String NAME_TODAY = "name-today";
public static final String UID_NEXT_WEEK = "uid-next-week";
public static final String NAME_NEXT_WEEK = "name-next-week";
private CMSRestrictionDao restrictionDao;
public CMSTimeRestrictionModel today(final CatalogVersionModel catalogVersion)
{
return createTodayRestrictionAndAssignToPages(catalogVersion);
}
@SuppressWarnings(
{ "unchecked", "rawtypes" })
public CMSTimeRestrictionModel createTodayRestrictionAndAssignToPages(final CatalogVersionModel catalogVersion, final AbstractPageModel... pages)
{
return getFromCollectionOrSaveAndReturn( //
() -> (Collection) getRestrictionDao().findRestrictionsById(UID_TODAY, catalogVersion), //
() -> CMSTimeRestrictionModelBuilder.aModel() //
.withUid(UID_TODAY) //
.withCatalogVersion(catalogVersion) //
.withName(NAME_TODAY) //
.withActiveFrom(DateUtils.truncate(new Date(), Calendar.DATE)) //
.withActiveUntil(DateUtils.addMilliseconds(DateUtils.ceiling(new Date(), Calendar.DATE), -1)) //
.withPages(pages) //
.build());
}
@SuppressWarnings(
{ "unchecked", "rawtypes" })
public CMSTimeRestrictionModel createTodayRestrictionAndAssignToComponents(final CatalogVersionModel catalogVersion, final AbstractCMSComponentModel... components)
{
return getFromCollectionOrSaveAndReturn( //
() -> (Collection) getRestrictionDao().findRestrictionsById(UID_TODAY, catalogVersion), //
() -> CMSTimeRestrictionModelBuilder.aModel() //
.withUid(UID_TODAY) //
.withCatalogVersion(catalogVersion) //
.withName(NAME_TODAY) //
.withActiveFrom(DateUtils.truncate(new Date(), Calendar.DATE)) //
.withActiveUntil(DateUtils.addMilliseconds(DateUtils.ceiling(new Date(), Calendar.DATE), -1)) //
.withComponents(components) //
.build());
}
@SuppressWarnings(
{ "unchecked", "rawtypes" })
public CMSTimeRestrictionModel tomorrow(final CatalogVersionModel catalogVersion, final AbstractPageModel... pages)
{
final Calendar cal = new GregorianCalendar();
cal.add(Calendar.DAY_OF_YEAR, 1);
return getFromCollectionOrSaveAndReturn( //
() -> (Collection) getRestrictionDao().findRestrictionsById(UID_TOMORROW, catalogVersion), //
() -> CMSTimeRestrictionModelBuilder.aModel() //
.withUid(UID_TOMORROW) //
.withCatalogVersion(catalogVersion) //
.withName(NAME_TOMORROW) //
.withActiveFrom(DateUtils.truncate(cal.getTime(), Calendar.DATE)) //
.withActiveUntil(DateUtils.addMilliseconds(DateUtils.ceiling(cal.getTime(), Calendar.DATE), -1)) //
.withPages(pages) //
.build());
}
@SuppressWarnings(
{ "unchecked", "rawtypes" })
public CMSTimeRestrictionModel nextWeek(final CatalogVersionModel catalogVersion, final AbstractPageModel... pages)
{
final Calendar cal = new GregorianCalendar();
cal.add(Calendar.DAY_OF_YEAR, 7);
return getFromCollectionOrSaveAndReturn( //
() -> (Collection) getRestrictionDao().findRestrictionsById(UID_NEXT_WEEK, catalogVersion), //
() -> CMSTimeRestrictionModelBuilder.aModel() //
.withUid(UID_NEXT_WEEK) //
.withCatalogVersion(catalogVersion) //
.withName(NAME_NEXT_WEEK) //
.withActiveFrom(DateUtils.truncate(cal.getTime(), Calendar.DATE)) //
.withActiveUntil(DateUtils.addMilliseconds(DateUtils.ceiling(cal.getTime(), Calendar.DATE), -1)) //
.withPages(pages) //
.build());
}
public CMSRestrictionDao getRestrictionDao()
{
return restrictionDao;
}
public void setRestrictionDao(final CMSRestrictionDao restrictionDao)
{
this.restrictionDao = restrictionDao;
}
}
| [
"juan.gonzalez.working@gmail.com"
] | juan.gonzalez.working@gmail.com |
8491686dc54e0bff3ac36f5a1189c9dd14bdbc59 | 95dd78aef258ddcdc7e4dde4ac8d91b0cf217b92 | /exerciserapplication/src/main/java/com/ry_050/exerciserapplication/ui/dashboard/DashboardFragment.java | 777ed343578dbde81718736298ed30304667e416 | [] | no_license | renyi1204/android | 2210be785e3f25a14c51a17986560cd5f3a0ce79 | b3118c3a69dea4ef6f64f3ff4b7e4a19aabd0748 | refs/heads/master | 2023-04-06T04:13:46.281138 | 2021-04-23T01:24:43 | 2021-04-23T01:24:43 | 360,391,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,216 | java | package com.ry_050.exerciserapplication.ui.dashboard;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import com.ry_050.exerciserapplication.R;
public class DashboardFragment extends Fragment {
private DashboardViewModel dashboardViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
dashboardViewModel =
new ViewModelProvider(this).get(DashboardViewModel.class);
View root = inflater.inflate(R.layout.fragment_dashboard, container, false);
final TextView textView = root.findViewById(R.id.text_dashboard);
dashboardViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
}
});
return root;
}
} | [
"you@example.com"
] | you@example.com |
146acbe1b498d73503ad7fcfa1db37bcca07826b | b4e306eaa86db3aa11132433ee6ad7fa6464db7b | /project-test/src26/main/java/bitcamp/java106/pms/dao/TaskDao.java | 589c3d6d69dc8983c8c283bbcf96b23ac905863c | [] | no_license | donhee/test | b00279dde77ff5e7482e7a018efe91ff54d4f677 | 897f301a557325932afc0e4cd19e33f103d74dae | refs/heads/master | 2021-07-01T00:13:06.085468 | 2020-09-10T13:26:18 | 2020-09-10T13:26:18 | 154,077,010 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,583 | java | package bitcamp.java106.pms.dao;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.sql.Date;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Scanner;
import bitcamp.java106.pms.annotation.Component;
import bitcamp.java106.pms.domain.Member;
import bitcamp.java106.pms.domain.Task;
import bitcamp.java106.pms.domain.Team;
@Component
public class TaskDao extends AbstractDao<Task> {
public TaskDao() throws Exception {
load();
}
public void load() throws Exception {
Scanner in = new Scanner(new FileReader("data/task.data"));
while (true) {
try {
String[] arr = in.nextLine().split(",");
Task task = new Task(null);
task.setNo(Integer.parseInt(arr[0]));
task.setTitle(arr[1]);
task.setStartDate(Date.valueOf(arr[2]));
task.setEndDate(Date.valueOf(arr[3]));
task.setState(Integer.parseInt(arr[4]));
task.setTeam(new Team(arr[5]));
task.setWorker(new Member(arr[6]));
this.insert(task);
} catch (Exception e) { // 데이터를 모두 읽었거나 파일 형식에 문제가 있다면,
//e.printStackTrace();
break; // 반복문을 나간다.
}
}
in.close();
}
public void save() throws Exception {
PrintWriter out = new PrintWriter(new FileWriter("data/task.data"));
Iterator<Task> tasks = this.list();
while (tasks.hasNext()) {
Task task = tasks.next();
out.printf("%d,%s,%s,%s,%d,%s,%s\n", task.getNo(), task.getTitle(),
task.getStartDate(), task.getEndDate(),
task.getState(), task.getTeam().getName(),
task.getWorker().getId());
}
out.close();
}
public Iterator<Task> list(String teamName) {
ArrayList<Task> tasks = new ArrayList<>();
for (Task task : collection) {
if (task.getTeam().getName().equalsIgnoreCase(teamName)) {
tasks.add(task);
}
}
return tasks.iterator();
}
@Override
public int indexOf(Object key) {
int taskNo = (Integer) key;
for (int i = 0; i < collection.size(); i++) {
Task task = collection.get(i);
if (task.getNo() == taskNo) {
return i;
}
}
return -1;
}
} | [
"231313do@gmail.com"
] | 231313do@gmail.com |
ec0407ba4a4edba9224a4108a5186f5c12feee85 | 034416becb36f4a9922053daf5f1175349a2843f | /mmall-itemcenter/mmall-itemcenter-provider/src/main/java/com/xyl/mmall/itemcenter/dao/model/ItemModelDao.java | e890e6e2fcdedb7c75831eb944e202f5d6d337aa | [] | no_license | timgle/utilcode | 40ee8d05e96ac324f452fccb412e07b4465e5345 | a8c81c90ec1965d45589dd7be8d2c8b0991a6b6a | refs/heads/master | 2021-05-09T22:39:11.417003 | 2016-03-20T14:30:52 | 2016-03-20T14:30:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,708 | java | /**
* 网新新云联技术有限公司
*/
package com.xyl.mmall.itemcenter.dao.model;
import java.util.List;
import com.netease.print.daojar.dao.AbstractDao;
import com.xyl.mmall.framework.vo.BasePageParamVO;
import com.xyl.mmall.itemcenter.meta.ItemModel;
/**
* ItemModelDao.java created by yydx811 at 2015年5月5日 上午10:10:37
* 商品模型dao
*
* @author yydx811
*/
public interface ItemModelDao extends AbstractDao<ItemModel> {
/**
* 获取全部商品模型
* @param searchValue
* @param startTime
* @param endTime
* @return List<ItemModel>
*/
public List<ItemModel> getItemModelList(String searchValue, String startTime, String endTime);
/**
* 分页获取商品模型
* @param pageParamVO
* @param searchValue
* @param startTime
* @param endTime
* @return List<ItemModel>
*/
public List<ItemModel> getItemModelList(BasePageParamVO<?> pageParamVO, String searchValue,
String startTime, String endTime);
/**
* 按条件获取数量
* @param searchValue
* @param startTime
* @param endTime
* @return int
*/
public int getItemModelCount(String searchValue, String startTime, String endTime);
/**
* 按条件获取商品模型
* @param itemModel
* @return ItemModel
*/
public ItemModel getItemModel(ItemModel itemModel);
/**
* 添加商品模型
* @param model
* @return long
*/
public long addItemModel(ItemModel model);
/**
* 更新商品模型
* @param model
* @return int
*/
public int updateItemModel(ItemModel model);
/**
* 删除商品模型
* @param id
* @return
*/
public int deleteItemModel(long id);
}
| [
"jack_lhp@163.com"
] | jack_lhp@163.com |
f49927bd2e4018a2df4772a3c1cb9ba8dbe4b7a3 | b54947d96abde377550e35ef21708c82dd2c50bd | /app/src/main/java/com/zhizhong/feishou/module/home/activity/WebActivity.java | 5b43df4d92f0808ef8dbf93523cd350482514fb0 | [] | no_license | 20180910/FeiShou | adc0ba97a91ece1811df18f88d6a1bcc5119b866 | f8b362f00d252b8cc6415e7c18609ee55f5590fb | refs/heads/master | 2020-03-28T10:20:52.284488 | 2017-10-31T05:56:56 | 2017-10-31T05:56:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,110 | java | package com.zhizhong.feishou.module.home.activity;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.zhizhong.feishou.base.BaseActivity;
import com.zhizhong.feishou.module.home.Constant;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
/**
* Created by Administrator on 2017/7/17.
*/
public class WebActivity extends BaseActivity {
// @BindView(R.id.wv_home_web)
WebView webview;
private String url;
@Override
protected int getContentView() {
String title = getIntent().getStringExtra(Constant.title);
setAppTitle(title);
//R.layout.act_home_web{"id":16,"content":""}
return 0;
}
@Override
protected void initView() {
url = getIntent().getStringExtra(Constant.url);
WebSettings webSettings = webview.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setAllowFileAccess(true);
webSettings.setTextSize(WebSettings.TextSize.NORMAL);
//自适应屏幕
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
webSettings.setLoadWithOverviewMode(true);
webview.getSettings().setDefaultTextEncodingName("UTF -8");//设置默认为utf-8
//设置Web视图
webview.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
// initWebTopView();
}
});
// webview.loadDataWithBaseURL(null, getNewContent(url), "text/html", "utf-8",null);
webview.loadUrl(url);
// 设置WevView要显示的网页
// webview.loadDataWithBaseURL(null, content, "text/html", "utf-8",null);
webview.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
webview.getSettings().setJavaScriptEnabled(true); //设置支持Javascript
webview.requestFocus(); //触摸焦点起作用.如果不设置,则在点击网页文本输入框时,不能弹出软键盘及不响应其他的一些事件。
webview.setWebViewClient(new WebViewClient()
{
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
view.loadUrl(url);
return true;
}
});
}
@Override
protected void initData() {
}
public static String getNewContent(String htmltext){
try {
Document doc= Jsoup.parse(htmltext);
Elements elements=doc.getElementsByTag("img");
for (Element element : elements) {
element.attr("width","100%").attr("height","auto");
}
return doc.toString();
} catch (Exception e) {
return htmltext;
}
}
@Override
protected void onViewClick(View v) {
}
@Override
public void again() {
}
}
| [
"2380253499@qq.com"
] | 2380253499@qq.com |
81851c54d2d59f73673dcd6b43f155dc2e9c2677 | 9ff153875921311054a27dd48ec46695e5a1893a | /net/optifine/http/HttpPipeline.java | cef5f15197c1314a57fb837d97cac52ce55025ce | [] | no_license | Nitrofyyy/SeaClientSourcev2.1 | 4d8f3151cdefcf49f10ddc6a4e861feff2e1df91 | be0940967447fc3b9192e886a2b04dbb8636c03a | refs/heads/main | 2023-08-31T13:01:54.044693 | 2021-10-22T08:23:35 | 2021-10-22T08:23:35 | 420,016,521 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,469 | java | //
// Decompiled by Procyon v0.5.36
//
package net.optifine.http;
import java.util.Iterator;
import java.io.InterruptedIOException;
import java.io.InputStream;
import net.minecraft.src.Config;
import java.util.LinkedHashMap;
import java.net.URL;
import java.io.IOException;
import java.net.Proxy;
import java.util.HashMap;
import java.util.Map;
public class HttpPipeline
{
private static Map mapConnections;
public static final String HEADER_USER_AGENT = "User-Agent";
public static final String HEADER_HOST = "Host";
public static final String HEADER_ACCEPT = "Accept";
public static final String HEADER_LOCATION = "Location";
public static final String HEADER_KEEP_ALIVE = "Keep-Alive";
public static final String HEADER_CONNECTION = "Connection";
public static final String HEADER_VALUE_KEEP_ALIVE = "keep-alive";
public static final String HEADER_TRANSFER_ENCODING = "Transfer-Encoding";
public static final String HEADER_VALUE_CHUNKED = "chunked";
static {
HttpPipeline.mapConnections = new HashMap();
}
public static void addRequest(final String urlStr, final HttpListener listener) throws IOException {
addRequest(urlStr, listener, Proxy.NO_PROXY);
}
public static void addRequest(final String urlStr, final HttpListener listener, final Proxy proxy) throws IOException {
final HttpRequest httprequest = makeRequest(urlStr, proxy);
final HttpPipelineRequest httppipelinerequest = new HttpPipelineRequest(httprequest, listener);
addRequest(httppipelinerequest);
}
public static HttpRequest makeRequest(final String urlStr, final Proxy proxy) throws IOException {
final URL url = new URL(urlStr);
if (!url.getProtocol().equals("http")) {
throw new IOException("Only protocol http is supported: " + url);
}
final String s = url.getFile();
final String s2 = url.getHost();
int i = url.getPort();
if (i <= 0) {
i = 80;
}
final String s3 = "GET";
final String s4 = "HTTP/1.1";
final Map<String, String> map = new LinkedHashMap<String, String>();
map.put("User-Agent", "Java/" + System.getProperty("java.version"));
map.put("Host", s2);
map.put("Accept", "text/html, image/gif, image/png");
map.put("Connection", "keep-alive");
final byte[] abyte = new byte[0];
final HttpRequest httprequest = new HttpRequest(s2, i, proxy, s3, s, s4, map, abyte);
return httprequest;
}
public static void addRequest(final HttpPipelineRequest pr) {
final HttpRequest httprequest = pr.getHttpRequest();
for (HttpPipelineConnection httppipelineconnection = getConnection(httprequest.getHost(), httprequest.getPort(), httprequest.getProxy()); !httppipelineconnection.addRequest(pr); httppipelineconnection = getConnection(httprequest.getHost(), httprequest.getPort(), httprequest.getProxy())) {
removeConnection(httprequest.getHost(), httprequest.getPort(), httprequest.getProxy(), httppipelineconnection);
}
}
private static synchronized HttpPipelineConnection getConnection(final String host, final int port, final Proxy proxy) {
final String s = makeConnectionKey(host, port, proxy);
HttpPipelineConnection httppipelineconnection = HttpPipeline.mapConnections.get(s);
if (httppipelineconnection == null) {
httppipelineconnection = new HttpPipelineConnection(host, port, proxy);
HttpPipeline.mapConnections.put(s, httppipelineconnection);
}
return httppipelineconnection;
}
private static synchronized void removeConnection(final String host, final int port, final Proxy proxy, final HttpPipelineConnection hpc) {
final String s = makeConnectionKey(host, port, proxy);
final HttpPipelineConnection httppipelineconnection = HttpPipeline.mapConnections.get(s);
if (httppipelineconnection == hpc) {
HttpPipeline.mapConnections.remove(s);
}
}
private static String makeConnectionKey(final String host, final int port, final Proxy proxy) {
final String s = String.valueOf(host) + ":" + port + "-" + proxy;
return s;
}
public static byte[] get(final String urlStr) throws IOException {
return get(urlStr, Proxy.NO_PROXY);
}
public static byte[] get(final String urlStr, final Proxy proxy) throws IOException {
if (urlStr.startsWith("file:")) {
final URL url = new URL(urlStr);
final InputStream inputstream = url.openStream();
final byte[] abyte = Config.readAll(inputstream);
return abyte;
}
final HttpRequest httprequest = makeRequest(urlStr, proxy);
final HttpResponse httpresponse = executeRequest(httprequest);
if (httpresponse.getStatus() / 100 != 2) {
throw new IOException("HTTP response: " + httpresponse.getStatus());
}
return httpresponse.getBody();
}
public static HttpResponse executeRequest(final HttpRequest req) throws IOException {
final Map<String, Object> map = new HashMap<String, Object>();
final String s = "Response";
final String s2 = "Exception";
final HttpListener httplistener = new HttpListener() {
@Override
public void finished(final HttpRequest req, final HttpResponse resp) {
synchronized (map) {
map.put("Response", resp);
map.notifyAll();
}
// monitorexit(this.val$map)
}
@Override
public void failed(final HttpRequest req, final Exception e) {
synchronized (map) {
map.put("Exception", e);
map.notifyAll();
}
// monitorexit(this.val$map)
}
};
synchronized (map) {
final HttpPipelineRequest httppipelinerequest = new HttpPipelineRequest(req, httplistener);
addRequest(httppipelinerequest);
try {
map.wait();
}
catch (InterruptedException var10) {
throw new InterruptedIOException("Interrupted");
}
final Exception exception = map.get("Exception");
if (exception != null) {
if (exception instanceof IOException) {
throw (IOException)exception;
}
if (exception instanceof RuntimeException) {
throw (RuntimeException)exception;
}
throw new RuntimeException(exception.getMessage(), exception);
}
else {
final HttpResponse httpresponse = map.get("Response");
if (httpresponse == null) {
throw new IOException("Response is null");
}
// monitorexit(map)
return httpresponse;
}
}
}
public static boolean hasActiveRequests() {
for (final HttpPipelineConnection httppipelineconnection : HttpPipeline.mapConnections.values()) {
if (httppipelineconnection.hasActiveRequests()) {
return true;
}
}
return false;
}
}
| [
"84819367+Nitrofyyy@users.noreply.github.com"
] | 84819367+Nitrofyyy@users.noreply.github.com |
01a6fae474d8b609ef3342d84c2af6925a02bc9f | 5b898bd90b97dbf8a08414eecda685bf39a8db68 | /im-easemob-bll/src/main/java/com/maoding/im/module/imAccount/dto/ImAccountSyncDTO.java | f59d506c251d27fa8058fefce69c628df945fece | [] | no_license | wang-shun/maoding-bundle | 3c0c9c8276d746d3c35a1f9e1e38351e64c368a5 | a4878c509487da937ded7960d04aab2d4295f318 | refs/heads/master | 2020-03-29T22:51:31.166525 | 2018-09-25T03:37:46 | 2018-09-25T03:37:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,258 | java | package com.maoding.im.module.imAccount.dto;
public class ImAccountSyncDTO {
private String accountId;
private String accountName;
private Integer accountStatus;
private String imAccountId;//此处为im的账号 = accountId,为了同步im,用于查询是否为null如果为null,则没有创建im
private String upVersion;
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public Integer getAccountStatus() {
return accountStatus;
}
public void setAccountStatus(Integer accountStatus) {
this.accountStatus = accountStatus;
}
public String getImAccountId() {
return imAccountId;
}
public void setImAccountId(String imAccountId) {
this.imAccountId = imAccountId;
}
public String getUpVersion() {
return upVersion;
}
public void setUpVersion(String upVersion) {
this.upVersion = upVersion;
}
}
| [
"zhangchengliang@imaoding.com"
] | zhangchengliang@imaoding.com |
18836ffbbaf7965bf475717600ecb7267e67f2d6 | c98b0a23c628cbad2d73044d6c99de08cbedec1a | /servlets/src/main/java/myservlet/ImageCreater.java | e1b9984c7bcb41bedfd0ea9729c70144b7bf764b | [] | no_license | MichailIsaev/netcracker | 79104ed0c22e184346f6ea783e2b4a9ce0ba5586 | faece01adcd6f8f7b5a71bcbb5e9332a6f7d7af8 | refs/heads/master | 2021-07-23T19:48:48.204092 | 2017-11-03T14:35:12 | 2017-11-03T14:35:12 | 106,457,425 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 682 | java | package myservlet;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.nio.Buffer;
import java.util.Random;
public class ImageCreater {
protected static BufferedImage getBufferedImage() throws IOException {
BufferedImage bufferedImage = new BufferedImage(640, 120, BufferedImage.TYPE_INT_RGB);
Graphics graphics = bufferedImage.getGraphics();
Color color = new Color(new Random().nextInt());
graphics.setFont(new Font("Arial", Font.BOLD, 72));
graphics.setColor(color);
graphics.drawString("Hello world!", 100, 100);
graphics.dispose();
return bufferedImage;
}
}
| [
"="
] | = |
76e4c59277b798d5a2b5123876454df3fc7eaea3 | bb13907de0911a1c03f1a32a7ea16740234abf1c | /src/main/java/com/emc/fapi/jaxws/v4_3_1/RemoveExternalHost.java | 2950468368ab0e73f60f6c8617fba80242b1bb17 | [] | no_license | noamda/fal431 | 9287e95fa2bacdace92e65b16ec6985ce2ded29c | dad30667424970fba049df3ba2c2023b82b9276e | refs/heads/master | 2021-01-21T14:25:10.211169 | 2016-06-20T08:55:43 | 2016-06-20T08:58:33 | 58,481,483 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,290 | java | package com.emc.fapi.jaxws.v4_3_1;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "removeExternalHost", propOrder = {"externalHost"})
public class RemoveExternalHost {
protected ExternalHostUID externalHost;
public RemoveExternalHost() {
}
public RemoveExternalHost(ExternalHostUID externalHost) {
this.externalHost = externalHost;
}
public ExternalHostUID getExternalHost() {
return this.externalHost;
}
public void setExternalHost(ExternalHostUID value) {
this.externalHost = value;
}
public boolean equals(Object obj) {
if (!(obj instanceof RemoveExternalHost)) {
return false;
}
RemoveExternalHost otherObj = (RemoveExternalHost) obj;
return this.externalHost == otherObj.externalHost ? true : this.externalHost != null ? this.externalHost.equals(otherObj.externalHost) : false;
}
public int hashCode() {
return this.externalHost != null ? this.externalHost.hashCode() : 0;
}
public String toString() {
return "RemoveExternalHost [externalHost=" + this.externalHost + "]";
}
}
| [
"style.daniel@gmail.com"
] | style.daniel@gmail.com |
5230c8040c5facdf1956e3e36be1e82b2ee84e6a | 1788afb3076bb5803bc1aef846172b4c23df2536 | /src/main/java/com/adms/kpireport/service/impl/CampaignServiceImpl.java | fd2a0267c9100ce6384a9a01e9af390f0c146fa0 | [
"Apache-2.0"
] | permissive | AEGONTH/kpi-report-service | 3572324c19a8c4a3168496f7ab47e45344d3817d | a28b3590ad2a713c708a3f1e1c479d044b994e5a | refs/heads/master | 2021-01-19T13:33:17.309475 | 2015-08-21T02:42:09 | 2015-08-21T02:42:09 | 38,294,401 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,649 | java | package com.adms.kpireport.service.impl;
import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.adms.entity.Campaign;
import com.adms.kpireport.dao.CampaignDao;
import com.adms.kpireport.service.CampaignService;
@Service("campaignService")
@Transactional
public class CampaignServiceImpl implements CampaignService {
@Autowired
private CampaignDao campaignDao;
public CampaignServiceImpl() {
}
public void setCampaignDao(CampaignDao campaignDao) {
this.campaignDao = campaignDao;
}
@Override
public List<Campaign> findAll() throws Exception {
return campaignDao.findAll();
}
@Override
public Campaign add(Campaign example, String userLogin) throws Exception {
return campaignDao.save(example);
}
@Override
public Campaign update(Campaign example, String userLogin) throws Exception {
return campaignDao.save(example);
}
@Override
public List<Campaign> find(Campaign example) throws Exception {
return campaignDao.find(example);
}
@Override
public List<Campaign> findByHql(String hql, Object...vals) throws Exception {
return campaignDao.findByHQL(hql, vals);
}
@Override
public List<Campaign> findByNamedQuery(String namedQuery, Object...vals) throws Exception {
return campaignDao.findByNamedQuery(namedQuery, vals);
}
@Override
public List<Campaign> findByCriteria(DetachedCriteria detachedCriteria) throws Exception {
return campaignDao.findByCriteria(detachedCriteria);
}
}
| [
"moth.pc@gmail.com"
] | moth.pc@gmail.com |
ca94d9698fe13e77e6c17d3b589cea9c7440f4c2 | 363e955fd5235a23460852f03c3d27a540f4feed | /src/main/java/net/sf/jstring/builder/BundleKeyBuilder.java | 42d0b1f73958cf8b1e7be47ba483650e42b96c65 | [] | no_license | dcoraboeuf/jstring | bb493870aafa8ebdb27a8f46539f3df5358c4caf | 492e406a6ed3ed12d1ed96f79bb4f7d79cfcfbaa | refs/heads/master | 2016-09-06T18:38:23.722426 | 2013-09-24T15:23:16 | 2013-09-24T15:23:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,185 | java | package net.sf.jstring.builder;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import net.sf.jstring.model.BundleKey;
import net.sf.jstring.model.BundleValue;
import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;
public class BundleKeyBuilder extends AbstractBuilderCommented<BundleKey, BundleKeyBuilder> {
public static final Function<? super BundleKeyBuilder, BundleKey> buildFn = new Function<BundleKeyBuilder, BundleKey>() {
@Override
public BundleKey apply(BundleKeyBuilder bundleKeyBuilder) {
return bundleKeyBuilder.build();
}
};
public static BundleKeyBuilder create(String name) {
return new BundleKeyBuilder(name);
}
private final String name;
private final Map<Locale, BundleValueBuilder> values = new LinkedHashMap<Locale, BundleValueBuilder>();
private BundleKeyBuilder(String name) {
this.name = name;
}
public String getName() {
return name;
}
public BundleKeyBuilder addValue (Locale locale, String text) {
BundleValueBuilder valueBuilder = values.get(locale);
if (valueBuilder != null) {
valueBuilder.value(text);
return this;
} else {
return value (locale, BundleValueBuilder.text(text));
}
}
public BundleKeyBuilder addComment (Locale locale, String comment) {
BundleValueBuilder valueBuilder = values.get(locale);
if (valueBuilder != null) {
valueBuilder.comment(comment);
return this;
} else {
return value (locale, BundleValueBuilder.create().comment(comment));
}
}
public BundleKeyBuilder value(Locale language, BundleValueBuilder value) {
values.put(language, value);
return this;
}
@Override
public BundleKey build() {
return new BundleKey(
name,
ImmutableList.copyOf(getComments()),
ImmutableMap.copyOf(
Maps.transformValues(
values,
BundleValueBuilder.buildFn
)
));
}
@Override
public void merge(BundleKey source, BundleValueMergeMode mode) {
super.merge(source, mode);
ImmutableMap<Locale,BundleValue> sourceValues = source.getValues();
for (Map.Entry<Locale,BundleValue> sourceEntry: sourceValues.entrySet()) {
Locale locale = sourceEntry.getKey();
BundleValue sourceBundleValue = sourceEntry.getValue();
BundleValueBuilder valueBuilder = values.get(locale);
if (valueBuilder != null) {
valueBuilder.merge(sourceBundleValue, mode);
} else {
valueBuilder = BundleValueBuilder.create();
valueBuilder.merge(sourceBundleValue, mode);
value(locale, valueBuilder);
}
}
}
@Override
public String toString() {
return "BundleKeyBuilder{" +
"name='" + name + '\'' +
", values=" + values +
'}';
}
}
| [
"damien.coraboeuf@gmail.com"
] | damien.coraboeuf@gmail.com |
ac081ba9f1605f5fa034863d0be6872939f81efc | 575c19e81594666f51cceb55cb1ab094b218f66b | /octopusconsortium/src/main/java/OctopusConsortium/Models/PDS/MO.java | 70cea4d52dfb4de4ead8c636994072316904b192 | [
"Apache-2.0"
] | permissive | uk-gov-mirror/111online.ITK-MessagingEngine | 62b702653ea716786e2684e3d368898533e77534 | 011e8cbe0bcb982eedc2204318d94e2bb5d4adb2 | refs/heads/master | 2023-01-22T17:47:54.631879 | 2020-12-01T14:18:05 | 2020-12-01T14:18:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,827 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-257
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.09.07 at 10:56:02 AM BST
//
package OctopusConsortium.Models.PDS;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
*
* A monetary amount is a quantity expressing the amount of money in some
* currency. Currencies are the units in which monetary amounts are
* denominated in different economic regions. While the monetary amount
* is a single kind of quantity (money) the exchange rates between the
* different units are variable. This is the principle difference
* between physical quantity and monetary amounts, and the reason why
* currency units are not physical units.
*
*
* <p>Java class for MO complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="MO">
* <complexContent>
* <extension base="{urn:hl7-org:v3}QTY">
* <attribute name="value" type="{urn:hl7-org:v3}real" />
* <attribute name="currency" type="{urn:hl7-org:v3}cs" />
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MO")
public class MO
extends QTY
{
@XmlAttribute
protected String value;
@XmlAttribute
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String currency;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
/**
* Gets the value of the currency property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCurrency() {
return currency;
}
/**
* Sets the value of the currency property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCurrency(String value) {
this.currency = value;
}
}
| [
"tom.axworthy@nhs.net"
] | tom.axworthy@nhs.net |
489eb28918056ed5d3866a0e3f13897a0b083a96 | 5ad7463f3d63c0e81f9270c0cc26a718f28b6dc4 | /java-practice/javasebase/src/main/java/com/lofxve/base/thread/synchronizedtest/old/impl/RunnableImpl.java | bd41d876320959c189a05ae11c79dd36264a8f23 | [] | no_license | lofxve/practice | bc7fa993e3ee496696f58f33f092a1c35d9250db | f3f49aa7b0939723776fb776f5aaa13b591efd5e | refs/heads/master | 2023-04-07T10:20:08.493390 | 2021-04-15T08:44:41 | 2021-04-15T08:44:41 | 342,749,261 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 603 | java | package com.lofxve.base.thread.synchronizedtest.old.impl;
public class RunnableImpl implements Runnable{
public static int ticket = 100;
@Override
public void run() {
while (true){
if (ticket>0){
try {
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println(Thread.currentThread().getName()+"正在卖第"+ticket+"章票!");
ticket--;
}else{
break;
}
}
}
}
| [
"875567313@qq.com"
] | 875567313@qq.com |
1b42a7ce1b23863427cb0c2601194e728a770779 | 071a9fa7cfee0d1bf784f6591cd8d07c6b2a2495 | /corpus/class/eclipse.jdt.debug/455.java | a4bbca5327c67389fa3781bb3a60f46c925edd3a | [
"MIT"
] | permissive | masud-technope/ACER-Replication-Package-ASE2017 | 41a7603117f01382e7e16f2f6ae899e6ff3ad6bb | cb7318a729eb1403004d451a164c851af2d81f7a | refs/heads/master | 2021-06-21T02:19:43.602864 | 2021-02-13T20:44:09 | 2021-02-13T20:44:09 | 187,748,164 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,561 | java | /*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Ivan Popov - Bug 184211: JDI connectors throw NullPointerException if used separately
* from Eclipse
*******************************************************************************/
package org.eclipse.jdi.internal.connect;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.jdi.internal.VirtualMachineManagerImpl;
import com.sun.jdi.VirtualMachine;
import com.sun.jdi.connect.Connector;
import com.sun.jdi.connect.IllegalConnectorArgumentsException;
import com.sun.jdi.connect.ListeningConnector;
public class SocketListeningConnectorImpl extends ConnectorImpl implements ListeningConnector {
/** Port to which is attached. */
private int fPort;
/** Timeout before accept returns. */
private int fTimeout;
/**
* Creates new SocketAttachingConnectorImpl.
*/
public SocketListeningConnectorImpl(VirtualMachineManagerImpl virtualMachineManager) {
super(virtualMachineManager);
// Create communication protocol specific transport.
SocketTransportImpl transport = new SocketTransportImpl();
setTransport(transport);
}
/**
* @return Returns the default arguments.
*/
@Override
public Map<String, Connector.Argument> defaultArguments() {
HashMap<String, Connector.Argument> arguments = new HashMap<String, Connector.Argument>(1);
// Port
IntegerArgumentImpl intArg = new IntegerArgumentImpl("port", ConnectMessages.SocketListeningConnectorImpl_Port_number_at_which_to_listen_for_VM_connections_1, ConnectMessages.SocketListeningConnectorImpl_Port_2, true, SocketTransportImpl.MIN_PORTNR, //$NON-NLS-1$
SocketTransportImpl.MAX_PORTNR);
arguments.put(intArg.name(), intArg);
// Timeout
intArg = new IntegerArgumentImpl("timeout", ConnectMessages.SocketListeningConnectorImpl_Timeout_before_accept_returns_3, ConnectMessages.SocketListeningConnectorImpl_Timeout_4, false, 0, //$NON-NLS-1$
Integer.MAX_VALUE);
arguments.put(intArg.name(), intArg);
return arguments;
}
/**
* @return Returns a short identifier for the connector.
*/
@Override
public String name() {
//$NON-NLS-1$
return "com.sun.jdi.SocketListen";
}
/**
* @return Returns a human-readable description of this connector and its
* purpose.
*/
@Override
public String description() {
return ConnectMessages.SocketListeningConnectorImpl_Accepts_socket_connections_initiated_by_other_VMs_5;
}
/**
* Retrieves connection arguments.
*/
private void getConnectionArguments(Map<String, ? extends Connector.Argument> connectionArgs) throws IllegalConnectorArgumentsException {
//$NON-NLS-1$
String attribute = "port";
try {
// If listening port is not specified, use port 0
IntegerArgument argument = (IntegerArgument) connectionArgs.get(attribute);
if (argument != null && argument.value() != null) {
fPort = argument.intValue();
} else {
fPort = 0;
}
// Note that timeout is not used in SUN's ListeningConnector, but is
// used by our
// LaunchingConnector.
//$NON-NLS-1$
attribute = "timeout";
argument = (IntegerArgument) connectionArgs.get(attribute);
if (argument != null && argument.value() != null) {
fTimeout = argument.intValue();
} else {
fTimeout = 0;
}
} catch (ClassCastException e) {
throw new IllegalConnectorArgumentsException(ConnectMessages.SocketListeningConnectorImpl_Connection_argument_is_not_of_the_right_type_6, attribute);
} catch (NullPointerException e) {
throw new IllegalConnectorArgumentsException(ConnectMessages.SocketListeningConnectorImpl_Necessary_connection_argument_is_null_7, attribute);
} catch (NumberFormatException e) {
throw new IllegalConnectorArgumentsException(ConnectMessages.SocketListeningConnectorImpl_Connection_argument_is_not_a_number_8, attribute);
}
}
/**
* Listens for one or more connections initiated by target VMs.
*
* @return Returns the address at which the connector is listening for a
* connection.
*/
@Override
public String startListening(Map<String, ? extends Connector.Argument> connectionArgs) throws IOException, IllegalConnectorArgumentsException {
getConnectionArguments(connectionArgs);
String result = null;
try {
result = ((SocketTransportImpl) fTransport).startListening(fPort);
} catch (IllegalArgumentException e) {
throw new IllegalConnectorArgumentsException(ConnectMessages.SocketListeningConnectorImpl_ListeningConnector_Socket_Port, "port");
}
return result;
}
/* (non-Javadoc)
* @see com.sun.jdi.connect.ListeningConnector#stopListening(java.util.Map)
*/
@Override
public void stopListening(Map<String, ? extends Connector.Argument> connectionArgs) throws IOException {
((SocketTransportImpl) fTransport).stopListening();
}
/**
* Waits for a target VM to attach to this connector.
*
* @return Returns a connected Virtual Machine.
*/
@Override
public VirtualMachine accept(Map<String, ? extends Connector.Argument> connectionArgs) throws IOException, IllegalConnectorArgumentsException {
getConnectionArguments(connectionArgs);
SocketConnection connection = (SocketConnection) ((SocketTransportImpl) fTransport).accept(fTimeout, 0);
return establishedConnection(connection);
}
/**
* @return Returns whether this listening connector supports multiple
* connections for a single argument map.
*/
@Override
public boolean supportsMultipleConnections() {
return true;
}
/**
* @return Returns port number that is listened to.
*/
public int listeningPort() {
return fPort;
}
}
| [
"masudcseku@gmail.com"
] | masudcseku@gmail.com |
ad5007f0676475ccd411521aab199e3c9f7d5141 | edd83fe036eb4b47fff7b8df74edb339f625d7dd | /src/core/utils/xml-utils/src/main/java/com/manhpd/dto/purchase_order/Address.java | e63486fe58e46ad3a67bfbc3aee7235ab692422b | [] | no_license | DucManhPhan/J2EE | 1a7cb661f739bf577a4271f86e3af3baad196c3c | 2e3636d126b5e82971627b49696beb93726d8472 | refs/heads/master | 2023-04-15T00:15:02.218224 | 2023-04-10T16:10:15 | 2023-04-10T16:10:15 | 171,880,152 | 3 | 5 | null | 2022-11-24T05:51:47 | 2019-02-21T13:49:34 | Java | UTF-8 | Java | false | false | 314 | java | package com.manhpd.dto.purchase_order;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Address {
private String street;
private String city;
private String postalCode;
private String country;
} | [
"ducmanhphan93@gmail.com"
] | ducmanhphan93@gmail.com |
45cb1ba2318847711937cbc76288f47174832c7f | b406aacdf46066a3016c88d755964c0d566539ea | /src/main/java/dynamicprogramming/CoinChange.java | be46859c8bb279a8718a3a2ec6d4db73f530950b | [] | no_license | andreaiacono/DataStructuresAndAlgorithms | f0a508ec37e95928bb01ff9e8a65c0e5abee8b47 | 752c4534126d7d61dccddc008d110b7b9902d0ee | refs/heads/master | 2021-07-25T06:28:48.836438 | 2021-01-20T09:24:07 | 2021-01-20T09:24:07 | 21,306,821 | 7 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,864 | java | package dynamicprogramming;
import org.junit.Test;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class CoinChange {
@Test
public void test() {
int[] den = new int[]{1, 3, 5};
assertEquals(3, coinChange(11, den));
den = new int[]{1, 7, 13, 19};
assertEquals(14, coinChange(206, den));
den = new int[]{1, 7, 13, 19};
int[] expected = new int[]{7, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19};
assertTrue(Arrays.equals(expected, coinChangeWithResult(216, den)));
int[] coins = new int[]{10, 50, 100, 500};
int[] qty = new int[]{5, 3, 2, 2};
Set<Long> result = new HashSet<Long>() {{
add(0L);
add(1280L);
add(770L);
add(260L);
add(1030L);
add(520L);
add(10L);
add(1290L);
add(780L);
add(270L);
add(1040L);
add(530L);
add(20L);
add(1300L);
add(790L);
add(280L);
add(1050L);
add(540L);
add(30L);
add(1310L);
add(800L);
add(290L);
add(1060L);
add(550L);
add(40L);
add(1320L);
add(810L);
add(300L);
add(1070L);
add(560L);
add(50L);
add(1330L);
add(820L);
add(310L);
add(1080L);
add(570L);
add(60L);
add(1340L);
add(830L);
add(320L);
add(1090L);
add(580L);
add(70L);
add(1350L);
add(840L);
add(330L);
add(1100L);
add(590L);
add(80L);
add(1360L);
add(850L);
add(340L);
add(1110L);
add(600L);
add(90L);
add(1370L);
add(860L);
add(350L);
add(1120L);
add(610L);
add(100L);
add(1380L);
add(870L);
add(360L);
add(1130L);
add(620L);
add(110L);
add(1390L);
add(880L);
add(370L);
add(1140L);
add(630L);
add(120L);
add(1400L);
add(890L);
add(380L);
add(1150L);
add(640L);
add(130L);
add(900L);
add(390L);
add(1160L);
add(650L);
add(140L);
add(400L);
add(1170L);
add(660L);
add(150L);
add(1180L);
add(670L);
add(160L);
add(1190L);
add(680L);
add(170L);
add(1200L);
add(690L);
add(180L);
add(1210L);
add(700L);
add(190L);
add(1220L);
add(710L);
add(200L);
add(1230L);
add(720L);
add(210L);
add(1240L);
add(730L);
add(220L);
add(1250L);
add(740L);
add(230L);
add(1000L);
add(1260L);
add(750L);
add(240L);
add(1010L);
add(500L);
add(1270L);
add(760L);
add(250L);
add(1020L);
add(510L);
}};
assertEquals(result, allCoinChanges(coins, qty));
}
/**
* returns the minimum number of coins for reaching the sum
*
* @param sum
* @param v
* @return
*/
public int coinChange(int sum, int[] v) {
int[] min = new int[sum + 1];
Arrays.fill(min, Integer.MAX_VALUE);
min[0] = 0;
for (int i = 1; i <= sum; i++) {
for (int j = 0; j < v.length; j++) {
if (v[j] <= i && min[i - v[j]] + 1 < min[i]) {
min[i] = min[i - v[j]] + 1;
}
}
}
return min[sum];
}
public int[] coinChangeWithResult(int value, int[] coins) {
int[][] results = new int[value + 1][value];
Arrays.fill(results, new int[]{Integer.MAX_VALUE});
results[0] = new int[]{};
for (int j = 1; j <= value; j++) {
for (int c = 0; c < coins.length; c++) {
if (coins[c] <= j && sum(results[j - coins[c]]) + 1 < sum(results[j])) {
int[] subResult = results[j - coins[c]];
int[] newResult = new int[subResult.length + 1];
System.arraycopy(subResult, 0, newResult, 0, subResult.length);
newResult[subResult.length] = coins[c];
results[j] = newResult;
}
}
}
return results[value];
}
private int sum(int[] a) {
return Arrays.stream(a).sum();
}
static Set<Long> allCoinChanges(int[] coins, int[] qty) {
int n = Arrays.stream(qty).sum();
int[] flattedCoins = new int[n + 1];
int index = 0;
for (int i = 0; i < qty.length; i++) {
for (int j = 0; j < qty[i]; j++) {
flattedCoins[index++] = coins[i];
}
}
Set<Long> result = new HashSet<>();
for (int i = 0; i < (1 << n); i++) {
long sum = 0;
for (int j = 0; j < n; j++) {
if ((i & (1 << j)) > 0) {
sum += flattedCoins[j];
}
}
result.add(sum);
}
return result;
}
}
| [
"andrea.iacono.nl@gmail.com"
] | andrea.iacono.nl@gmail.com |
0edfd9ba02ea0c1a61bedb434c58f9d29525e0f9 | f715b1253b42bc618670f0a84ef6d116583d9eaa | /badugi-game-logic/src/main/java/com/badugi/game/logic/model/entity/GenRoundid.java | 9bef447cb680673cc59d6342ce2c44222a719572 | [
"MIT"
] | permissive | cietwwl/BadugiPokerServer | acf282544a2811be436f27abb52a1ace22712051 | 0b494f80d846fcb2e9db26721bd09add7d674783 | refs/heads/master | 2020-03-17T18:29:08.353095 | 2016-01-18T02:46:46 | 2016-01-18T02:46:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,189 | java | package com.badugi.game.logic.model.entity;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* GenRoundid entity. @author MyEclipse Persistence Tools
*/
@Entity
@Table(name = "gen_roundid")
public class GenRoundid extends BaseEntity implements java.io.Serializable {
// Fields
private Long roundId;
private Timestamp createTime;
// Constructors
/** default constructor */
public GenRoundid() {
}
/** full constructor */
public GenRoundid(Timestamp createTime) {
this.createTime = createTime;
}
// Property accessors
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "RoundID", unique = true, nullable = false)
public Long getRoundId() {
return this.roundId;
}
public void setRoundId(Long roundId) {
this.roundId = roundId;
}
@Column(name = "CreateTime", nullable = false, length = 19)
public Timestamp getCreateTime() {
return this.createTime;
}
public void setCreateTime(Timestamp createTime) {
this.createTime = createTime;
}
} | [
"wtuickqmq@163.com"
] | wtuickqmq@163.com |
c835e3713e8736ffe3a45d860b20ffff9191c9ba | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_5e8d5ee3aa4cb63ab2b58260288c3fd9f5d2f981/LiveDescriptionCommand/2_5e8d5ee3aa4cb63ab2b58260288c3fd9f5d2f981_LiveDescriptionCommand_t.java | 997a79f949684737e5711248774111eb5ae26aab | [] | 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,666 | java | package de.ptb.epics.eve.ecp1.intern;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import de.ptb.epics.eve.ecp1.intern.exceptions.AbstractRestoreECP1CommandException;
import de.ptb.epics.eve.ecp1.intern.exceptions.WrongStartTagException;
import de.ptb.epics.eve.ecp1.intern.exceptions.WrongTypeIdException;
import de.ptb.epics.eve.ecp1.intern.exceptions.WrongVersionException;
public class LiveDescriptionCommand implements IECP1Command {
public static final char COMMAND_TYPE_ID = 0x0012;
private String liveDescription;
public LiveDescriptionCommand() {
this.liveDescription = "";
}
public LiveDescriptionCommand( final String liveDescription ) {
if( liveDescription == null ) {
throw new IllegalArgumentException( "The parameter 'liveDescription' must not be null!" );
}
this.liveDescription = liveDescription;
}
public LiveDescriptionCommand( final byte[] byteArray ) throws IOException, AbstractRestoreECP1CommandException {
if( byteArray == null ) {
throw new IllegalArgumentException( "The parameter 'byteArray' must not be null!" );
}
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( byteArray );
final DataInputStream dataInputStream = new DataInputStream( byteArrayInputStream );
final int startTag = dataInputStream.readInt();
if( startTag != IECP1Command.START_TAG ) {
throw new WrongStartTagException( byteArray, startTag );
}
final char version = dataInputStream.readChar();
if( version != IECP1Command.VERSION ) {
throw new WrongVersionException( byteArray, version );
}
final char commandTypeID = dataInputStream.readChar();
if( commandTypeID != LiveDescriptionCommand.COMMAND_TYPE_ID ) {
throw new WrongTypeIdException( byteArray, commandTypeID, LiveDescriptionCommand.COMMAND_TYPE_ID );
}
final int length = dataInputStream.readInt();
final int lenghtOfText = dataInputStream.readInt();
if( lenghtOfText == 0xffffffff ) {
this.liveDescription = "";
} else {
final byte[] liveDescriptionStringBuffer = new byte[ lenghtOfText * 2 ];
dataInputStream.readFully( liveDescriptionStringBuffer );
this.liveDescription = new String( liveDescriptionStringBuffer, IECP1Command.STRING_ENCODING );
}
}
public byte[] getByteArray() throws IOException {
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
final DataOutputStream dataOutputStream = new DataOutputStream( byteArrayOutputStream );
dataOutputStream.writeInt( IECP1Command.START_TAG );
dataOutputStream.writeChar( IECP1Command.VERSION );;
dataOutputStream.writeChar( LiveDescriptionCommand.COMMAND_TYPE_ID );
if( this.liveDescription.length() == 0 ) {
dataOutputStream.writeInt( 4 );
dataOutputStream.writeInt( 0xffffffff );
} else {
final byte[] stringByte = this.liveDescription.getBytes( IECP1Command.STRING_ENCODING );
dataOutputStream.writeInt( 4 + stringByte.length );
dataOutputStream.writeInt( stringByte.length );
dataOutputStream.write( stringByte );
}
dataOutputStream.close();
return byteArrayOutputStream.toByteArray();
}
public String getLiveDescription() {
return this.liveDescription;
}
public void setLiveDescription( final String liveDescription ) {
if( liveDescription == null ) {
throw new IllegalArgumentException( "The parameter 'liveDescription' must not be null!" );
}
this.liveDescription = liveDescription;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
c777b2da0b7a7119615e1b506054f8920f0762f9 | c4623aa95fb8cdd0ee1bc68962711c33af44604e | /src/com/yelp/android/serializable/_ReservationSearchAction.java | c9cbf6975db1f377e444ee992382743e505ebb45 | [] | no_license | reverseengineeringer/com.yelp.android | 48f7f2c830a3a1714112649a6a0a3110f7bdc2b1 | b0ac8d4f6cd5fc5543f0d8de399b6d7b3a2184c8 | refs/heads/master | 2021-01-19T02:07:25.997811 | 2016-07-19T16:37:24 | 2016-07-19T16:37:24 | 38,555,675 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,661 | java | package com.yelp.android.serializable;
import android.os.Parcel;
import android.os.Parcelable;
import com.yelp.android.dc.b;
import com.yelp.android.dc.c;
import com.yelp.parcelgen.JsonUtil;
import java.util.Date;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
abstract class _ReservationSearchAction
implements Parcelable
{
protected Date a;
protected String b;
protected String c;
protected String d;
protected boolean e;
protected int f;
protected int[] g;
protected int[] h;
protected int[] i;
protected int[] j;
protected int[] k;
protected int[] l;
public void a(Parcel paramParcel)
{
long l1 = paramParcel.readLong();
if (l1 != -2147483648L) {
a = new Date(l1);
}
b = ((String)paramParcel.readValue(String.class.getClassLoader()));
c = ((String)paramParcel.readValue(String.class.getClassLoader()));
d = ((String)paramParcel.readValue(String.class.getClassLoader()));
e = paramParcel.createBooleanArray()[0];
f = paramParcel.readInt();
g = paramParcel.createIntArray();
h = paramParcel.createIntArray();
i = paramParcel.createIntArray();
j = paramParcel.createIntArray();
k = paramParcel.createIntArray();
l = paramParcel.createIntArray();
}
public void a(JSONObject paramJSONObject)
throws JSONException
{
int n = 0;
if (!paramJSONObject.isNull("time")) {
a = JsonUtil.parseTimestamp(paramJSONObject, "time");
}
if (!paramJSONObject.isNull("type")) {
b = paramJSONObject.optString("type");
}
if (!paramJSONObject.isNull("text")) {
c = paramJSONObject.optString("text");
}
if (!paramJSONObject.isNull("biz_action_text")) {
d = paramJSONObject.optString("biz_action_text");
}
e = paramJSONObject.optBoolean("is_disabled");
f = paramJSONObject.optInt("party_size");
JSONArray localJSONArray;
int i1;
int m;
if (!paramJSONObject.isNull("text_color"))
{
localJSONArray = paramJSONObject.getJSONArray("text_color");
i1 = localJSONArray.length();
g = new int[i1];
m = 0;
while (m < i1)
{
g[m] = localJSONArray.getInt(m);
m += 1;
}
}
if (!paramJSONObject.isNull("default_color_top"))
{
localJSONArray = paramJSONObject.getJSONArray("default_color_top");
i1 = localJSONArray.length();
h = new int[i1];
m = 0;
while (m < i1)
{
h[m] = localJSONArray.getInt(m);
m += 1;
}
}
if (!paramJSONObject.isNull("default_color_bottom"))
{
localJSONArray = paramJSONObject.getJSONArray("default_color_bottom");
i1 = localJSONArray.length();
i = new int[i1];
m = 0;
while (m < i1)
{
i[m] = localJSONArray.getInt(m);
m += 1;
}
}
if (!paramJSONObject.isNull("selected_color_top"))
{
localJSONArray = paramJSONObject.getJSONArray("selected_color_top");
i1 = localJSONArray.length();
j = new int[i1];
m = 0;
while (m < i1)
{
j[m] = localJSONArray.getInt(m);
m += 1;
}
}
if (!paramJSONObject.isNull("selected_color_bottom"))
{
localJSONArray = paramJSONObject.getJSONArray("selected_color_bottom");
i1 = localJSONArray.length();
k = new int[i1];
m = 0;
while (m < i1)
{
k[m] = localJSONArray.getInt(m);
m += 1;
}
}
if (!paramJSONObject.isNull("border_color"))
{
paramJSONObject = paramJSONObject.getJSONArray("border_color");
i1 = paramJSONObject.length();
l = new int[i1];
m = n;
while (m < i1)
{
l[m] = paramJSONObject.getInt(m);
m += 1;
}
}
}
public boolean b()
{
return e;
}
public String c()
{
return d;
}
public int describeContents()
{
return 0;
}
public int[] e()
{
return l;
}
public boolean equals(Object paramObject)
{
if (paramObject == null) {}
do
{
return false;
if (paramObject == this) {
return true;
}
} while (paramObject.getClass() != getClass());
paramObject = (_ReservationSearchAction)paramObject;
return new b().a(a, a).a(b, b).a(c, c).a(d, d).a(e, e).a(f, f).a(g, g).a(h, h).a(i, i).a(j, j).a(k, k).a(l, l).a();
}
public int[] f()
{
return k;
}
public int[] g()
{
return j;
}
public int[] h()
{
return i;
}
public int hashCode()
{
return new c().a(a).a(b).a(c).a(d).a(e).a(f).a(g).a(h).a(i).a(j).a(k).a(l).a();
}
public int[] i()
{
return h;
}
public int[] j()
{
return g;
}
public int k()
{
return f;
}
public String l()
{
return c;
}
public String m()
{
return b;
}
public Date o()
{
return a;
}
public void writeToParcel(Parcel paramParcel, int paramInt)
{
if (a == null) {}
for (long l1 = -2147483648L;; l1 = a.getTime())
{
paramParcel.writeLong(l1);
paramParcel.writeValue(b);
paramParcel.writeValue(c);
paramParcel.writeValue(d);
paramParcel.writeBooleanArray(new boolean[] { e });
paramParcel.writeInt(f);
paramParcel.writeIntArray(g);
paramParcel.writeIntArray(h);
paramParcel.writeIntArray(i);
paramParcel.writeIntArray(j);
paramParcel.writeIntArray(k);
paramParcel.writeIntArray(l);
return;
}
}
}
/* Location:
* Qualified Name: com.yelp.android.serializable._ReservationSearchAction
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
9c2a89b056ba46150d9744641763d9e3c0085a01 | 7ae6e5ffbe3e90256f205637c97af760e2801969 | /pico/gems/src/test/org/picocontainer/gems/behaviors/HotSwappingTestCase.java | c106fdde4bfb57221d813d6fabb293345d13bf31 | [] | no_license | sl4mmy/picocontainer | 6e6d7dbf7071850930a7adf2a7ab02410925bd69 | e0aafd8b4e293d69d33640a271ebf8226cbcd7c5 | refs/heads/master | 2021-01-20T11:31:32.391774 | 2010-02-27T09:02:55 | 2010-02-27T09:02:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,871 | java | /*****************************************************************************
* Copyright (C) 2003-2010 PicoContainer Committers. All rights reserved. *
* ------------------------------------------------------------------------- *
* The software in this package is published under the terms of the BSD *
* style license a copy of which has been included with this distribution in *
* the LICENSE.txt file. *
* *
*****************************************************************************/
package org.picocontainer.gems.behaviors;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import org.picocontainer.ComponentFactory;
import org.picocontainer.DefaultPicoContainer;
import org.picocontainer.MutablePicoContainer;
import org.picocontainer.PicoBuilder;
import org.picocontainer.gems.GemsCharacteristics;
import org.picocontainer.gems.PicoGemsBuilder;
import org.picocontainer.injectors.AdaptingInjection;
import org.picocontainer.injectors.ConstructorInjection;
import org.picocontainer.injectors.ConstructorInjector;
import org.picocontainer.lifecycle.NullLifecycleStrategy;
import org.picocontainer.monitors.NullComponentMonitor;
import org.picocontainer.tck.AbstractComponentFactoryTest;
public final class HotSwappingTestCase extends AbstractComponentFactoryTest {
private final ComponentFactory implementationHidingComponentFactory = new HotSwapping().wrap(new AdaptingInjection());
// START SNIPPET: man
public static interface Man {
Woman getWoman();
void kiss();
boolean wasKissed();
}
// END SNIPPET: man
// START SNIPPET: woman
public static interface Woman {
Man getMan();
}
// END SNIPPET: woman
public static class Wife implements Woman {
public final Man partner;
public Wife(final Man partner) {
this.partner = partner;
}
public Man getMan() {
return partner;
}
}
@Test
public void testHotSwappingNaturaelyCaches() {
DefaultPicoContainer pico = new DefaultPicoContainer(new HotSwapping().wrap(new ConstructorInjection()));
pico.addComponent(Map.class, HashMap.class);
Map firstMap = pico.getComponent(Map.class);
Map secondMap = pico.getComponent(Map.class);
assertSame(firstMap, secondMap);
}
@Test
public void testHotSwappingNaturaelyCaches2() {
DefaultPicoContainer pico = new DefaultPicoContainer(new HotSwapping());
pico.addComponent(Map.class, HashMap.class);
Map firstMap = pico.getComponent(Map.class);
firstMap.put("foo", "bar");
HotSwappable hsca = (HotSwappable) pico.getComponentAdapter(Map.class);
hsca.getSwappable().swap(new HashMap());
Map secondMap = pico.getComponent(Map.class);
secondMap.put("apple", "orange");
assertSame(firstMap, secondMap);
assertNull(firstMap.get("foo"));
assertNotNull(firstMap.get("apple"));
}
@Test
public void testSwappingViaSwappableInterface() {
MutablePicoContainer pico = new DefaultPicoContainer();
ConstructorInjector constructorInjector = new ConstructorInjector("l", ArrayList.class, null, new NullComponentMonitor(), false);
HotSwappable hsca = (HotSwappable) pico.addAdapter(new HotSwappable(constructorInjector)).getComponentAdapter(constructorInjector.getComponentKey());
List l = (List)pico.getComponent("l");
l.add("Hello");
final ArrayList newList = new ArrayList();
ArrayList oldSubject = (ArrayList) hsca.swapRealInstance(newList);
assertEquals("Hello", oldSubject.get(0));
assertTrue(l.isEmpty());
l.add("World");
assertEquals("World", l.get(0));
}
@Test
public void testHotswapTurnOnTurnOfWithPicoContainer() {
MutablePicoContainer pico = new PicoBuilder().withBehaviors(PicoGemsBuilder.HOT_SWAPPING()).build();
pico.as(GemsCharacteristics.NO_HOT_SWAP).addComponent("firstMap", HashMap.class);
pico.as(GemsCharacteristics.HOT_SWAP).addComponent("hotswapMap", HashMap.class);
assertNull(pico.getComponentAdapter("firstMap").findAdapterOfType(HotSwappable.class));
assertNotNull(pico.getComponentAdapter("hotswapMap").findAdapterOfType(HotSwappable.class));
}
@Override
protected ComponentFactory createComponentFactory() {
return implementationHidingComponentFactory;
}
}
| [
"paul@hammant.org"
] | paul@hammant.org |
508a6f8168ea167c998573c83b507c77b76472cd | addbc404a75281f8ad0d42889ffe507b72a2471e | /Study/src/ArrayListTest.java | 1991e3caca5dd0efe57067f416c93e08bec2ff2a | [] | no_license | yongje93/bitcamp | 81df3b0d954e57752243ecc339ccb92447d71561 | 16f105c4cd6baa5b876291b2504338b6acfb2938 | refs/heads/master | 2020-06-07T17:57:26.427322 | 2019-10-05T12:27:31 | 2019-10-05T12:27:31 | 193,066,923 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 872 | java | import java.util.ArrayList;
class PersonDTO {
private String name;
private int age;
public PersonDTO(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
}
public class ArrayListTest {
public ArrayList<PersonDTO> init() {
PersonDTO aa = new PersonDTO("코난", 13);
PersonDTO bb = new PersonDTO("또치", 30);
PersonDTO cc = new PersonDTO("길동", 25);
ArrayList<PersonDTO> arr = new ArrayList<PersonDTO>();
arr.add(aa);
arr.add(bb);
arr.add(cc);
return arr;
}
public static void main(String[] args) {
ArrayListTest pm = new ArrayListTest();
ArrayList<PersonDTO> array = pm.init();
for(int i = 0; i < array.size(); i++) {
System.out.println("이름 = " +array.get(i).getName() + " 나이 = " +array.get(i).getAge() );
}
}
}
| [
"48149636+yongje93@users.noreply.github.com"
] | 48149636+yongje93@users.noreply.github.com |
f4c1c3ff4e0452e3fe10641fff62b9a20cf77250 | 4c43a87c7ec2eb1842361162d7337a74ddd09b59 | /gudu/src/main/java/com/ucas/ir/project/repository/OtherDictionaryDao.java | 65add079d7776aca624e4a67bb7c4141be604467 | [] | no_license | qiang2010/IR_project_my | c1d5ee57c4fcdd4c388714ef5d5038dd43d8985f | 61ad39aa6baa145db344a008475468014186f55a | refs/heads/master | 2020-03-25T12:41:19.024108 | 2014-12-26T11:15:59 | 2014-12-26T11:15:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 904 | java | /*******************************************************************************
* Copyright (c) 2005, 2014 springside.github.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
*******************************************************************************/
package com.ucas.ir.project.repository;
import java.sql.Blob;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import com.ucas.ir.project.entity.Dictionary;
public interface OtherDictionaryDao extends PagingAndSortingRepository<Dictionary, Long>, JpaSpecificationExecutor<Dictionary> {
@Query("select dict.tIndex from OtherDictionary dict where dict.term= (:term)")
Blob getBlob(@Param("term")String term);
}
| [
"qiangji1991@gmail.com"
] | qiangji1991@gmail.com |
f2eb520976febc73945780e3b587fd7294026160 | b1f51f8ba05ad83ecfbd80e6e7f140e70850bf01 | /ACE_ERP/src/transfer/hdasan_login.java | 2ef102e777f4db3328fb853a69aea980fb39fd49 | [] | no_license | hyundaimovex-asanwas/asanwas-homepage | 27e0ba1ed7b41313069e732f3dc9df20053caddd | 75e30546f11258d8b70159cfbe8ee36b18371bd0 | refs/heads/master | 2023-06-07T03:41:10.170367 | 2021-07-01T10:23:54 | 2021-07-01T10:23:54 | 376,739,168 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,985 | java | package transfer;
import com.gauce.*;
import com.gauce.io.*;
import com.gauce.common.*;
import com.gauce.log.*;
import com.gauce.db.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class hdasan_login extends HttpServlet {
public void doGet(HttpServletRequest req,HttpServletResponse res) {
res.setContentType("text/html;charset=ksc5601");
ServiceLoader loader = new ServiceLoader(req, res);
GauceService service = null;
GauceContext context = null;
Logger logger = null;
GauceDBConnection conn = null;
GauceStatement stmt =null;
GauceDataSet dSet = null;
String query = "";
try {
service = loader.newService();
context = service.getContext();
logger = context.getLogger();
GauceRequest GauceReq = service.getGauceRequest();
GauceResponse GauceRes = service.getGauceResponse();
try {
conn = service.getDBConnection();
dSet = new GauceDataSet();
String str1 = req.getParameter("gstr1");
String str2 = req.getParameter("gstr2");
String str3 = req.getRemoteAddr();
String str4 = str1.substring(0,1);
//logger.dbg.println(this,"str4"+str4);
GauceRes.enableFirstRow(dSet);
dSet.addDataColumn(new GauceDataColumn("userid", GauceDataColumn.TB_STRING, 10));
dSet.addDataColumn(new GauceDataColumn("password", GauceDataColumn.TB_STRING, 10));
dSet.addDataColumn(new GauceDataColumn("username", GauceDataColumn.TB_STRING, 30));
dSet.addDataColumn(new GauceDataColumn("autlevel", GauceDataColumn.TB_STRING, 10));
dSet.addDataColumn(new GauceDataColumn("ipaddr", GauceDataColumn.TB_STRING, 15));
dSet.addDataColumn(new GauceDataColumn("strsys", GauceDataColumn.TB_STRING, 3));
dSet.addDataColumn(new GauceDataColumn("strdate", GauceDataColumn.TB_STRING, 8));
dSet.addDataColumn(new GauceDataColumn("enddate", GauceDataColumn.TB_STRING, 8));
dSet.addDataColumn(new GauceDataColumn("regman", GauceDataColumn.TB_STRING, 10));
dSet.addDataColumn(new GauceDataColumn("regdate", GauceDataColumn.TB_STRING, 8));
dSet.addDataColumn(new GauceDataColumn("modman", GauceDataColumn.TB_STRING, 10));
dSet.addDataColumn(new GauceDataColumn("moddate", GauceDataColumn.TB_STRING, 8));
dSet.addDataColumn(new GauceDataColumn("pcipadr", GauceDataColumn.TB_STRING, 15));
dSet.addDataColumn(new GauceDataColumn("curdate", GauceDataColumn.TB_STRING, 10));
dSet.addDataColumn(new GauceDataColumn("DEPTCD", GauceDataColumn.TB_STRING, 4));
dSet.addDataColumn(new GauceDataColumn("DEPTNM", GauceDataColumn.TB_STRING, 70));
dSet.addDataColumn(new GauceDataColumn("FDCODE", GauceDataColumn.TB_STRING, 2));
dSet.addDataColumn(new GauceDataColumn("FDNAME", GauceDataColumn.TB_STRING, 20));
dSet.addDataColumn(new GauceDataColumn("COCODE", GauceDataColumn.TB_STRING, 2));
dSet.addDataColumn(new GauceDataColumn("CONAME", GauceDataColumn.TB_STRING, 20));
if (!GauceReq.isBuilderRequest()) {
if(str4.equals("1")||str4.equals("2")){
/*query = " SELECT userid, password, username, autlevel, ipaddr, strsys, strdate, "
+ " enddate, regman, regdate, modman, moddate,'" + str3 + "' as PCIPADR, current date curdate"
+ " FROM common.userfile "
+ " WHERE userid = '" + str1 + "'"
+ " AND password = '" + str2 + "'";
*/
query = " SELECT A.USERID, A.PASSWORD, A.USERNAME, A.AUTLEVEL, A.IPADDR, A.STRSYS, A.STRDATE, "
+ " A.ENDDATE, A.REGMAN, A.REGDATE, A.MODMAN, A.MODDATE,'' AS PCIPADR, CURRENT DATE CURDATE,"
+ " B.DEPTCD, RTRIM(C.DEPTNM)DEPTNM, C.FDCODE, RTRIM(D.FDNAME)FDNAME, C.COCODE, RTRIM(E.CONAME)CONAME"
+ " FROM COMMON.USERFILE A "
+ " LEFT JOIN PAYROLL.HIPERSON B ON A.USERID = B.EMPNO"
+ " LEFT JOIN PAYROLL.HCDEPT C ON B.DEPTCD = C.DEPTCD AND C.CHGYM = (SELECT MAX(CHGYM) FROM PAYROLL.HCDEPT)"
+ " LEFT JOIN ACCOUNT.FIELDCODE D ON C.FDCODE = D.FDCODE"
+ " LEFT JOIN ACCOUNT.COMPANY E ON C.COCODE = E.COCODE"
+ " WHERE A.USERID = '" + str1 + "'"
+ " AND A.PASSWORD = '" + str2 + "'";
}else{
query = " SELECT A.USERID, A.PASSWORD, A.USERNAME, A.AUTLEVEL, A.IPADDR, A.STRSYS, A.STRDATE, "
+ " A.ENDDATE, A.REGMAN, A.REGDATE, A.MODMAN, A.MODDATE,'' AS PCIPADR, CURRENT DATE CURDATE,"
+ " B.DEPTCD, RTRIM(C.DEPTNM)DEPTNM, C.FDCODE, RTRIM(D.FDNAME)FDNAME, C.COCODE, RTRIM(E.CONAME)CONAME"
+ " FROM COMMON.USERFILE A "
+ " LEFT JOIN PAYROLL.T_HIPERSON B ON A.USERID = B.EMPNO "
+ " LEFT JOIN PAYROLL.HCDEPT C ON B.DEPTCD = C.DEPTCD AND C.CHGYM = (SELECT MAX(CHGYM) FROM PAYROLL.HCDEPT)"
+ " LEFT JOIN ACCOUNT.FIELDCODE D ON C.FDCODE = D.FDCODE"
+ " LEFT JOIN ACCOUNT.COMPANY E ON C.COCODE = E.COCODE"
+ " WHERE A.USERID = '" + str1 + "'"
+ " AND A.PASSWORD = '" + str2 + "'";
}
/*
Statement stmt1 = null;
ResultSet rs = null;
stmt1 = conn.createStatement();
rs = stmt1.executeQuery(query);
GauceDataRow row = null;
while(rs.next()) {
row = dSet.newDataRow();
for (int k=1 ;k<21 ;k++ ) {
row.addColumnValue(rs.getString(k));
logger.dbg.println(this,k+" : "+rs.getString(k));
}
dSet.addDataRow(row);
}
stmt1 = null;
rs = null;
*/
// logger.dbg.println(this,query);
stmt = conn.getGauceStatement(query);
stmt.executeQuery(dSet);
}
} catch(Exception e) {
logger.err.println(this,e);
} finally {
if (stmt != null) try { stmt.close(); } catch (Exception e) {}
if (conn != null) try {conn.close();} catch (Exception e) {}
}
dSet.flush();
GauceRes.commit(query);
GauceRes.close();
} catch (Exception e) {
logger.err.println(this, e);
} finally {
loader.restoreService(service);
}
}
} | [
"86274611+evnmoon@users.noreply.github.com"
] | 86274611+evnmoon@users.noreply.github.com |
3ca7ad341055ca4f5a5b0e9ec81e2cbd4423f484 | e85d1673086227f7d1ad970aff6cab6fe1945937 | /src/lesson22/hw1/Demo.java | a6ff4cb307a611cce22e5979109c99b49c24bbc8 | [] | no_license | ollleg111/java-core-grom | 4319070c2b14270872bea5f4ad9a94895c72fb24 | 717ee5c52246f7c95651516a1fee4c3fe9b4580f | refs/heads/master | 2020-04-23T02:36:51.775986 | 2019-07-08T16:01:46 | 2019-07-08T16:01:46 | 159,645,233 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 474 | java | package lesson22.hw1;
import lesson22.hw1.ArrayUtils;
import java.util.Arrays;
public class Demo {
public static void main(String[] args) {
int[] array = {10, 4, 6, 9, 5, 4};
System.out.println(ArrayUtils.nCount(array, 4));
System.out.println(ArrayUtils.maxElement(array));
System.out.println(Arrays.toString(ArrayUtils.sortAscending(array)));
System.out.println(Arrays.toString(ArrayUtils.sortDescending(array)));
}
}
| [
"q2301299266"
] | q2301299266 |
b3db2800def02d2b74b30399e81b9ab60a1e517e | eb468714aa733e5d2c1f7245245d661561176785 | /src/main/java/io/swagger/model/viewobjects/Body.java | 8afc40d297e563333865c9d93e5b6d0e5d8cb39a | [] | no_license | NajeebArif/Manning-liveProj-401_2_1 | a8a2aae178b6401429bbcaad9efecb20e87a8c8a | 83e8561f7c69267e261c66bc13ea0c4fe04ffa1a | refs/heads/main | 2023-04-12T15:21:51.847427 | 2021-04-24T19:17:52 | 2021-04-24T19:17:52 | 361,245,457 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,245 | java | package io.swagger.model.viewobjects;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.*;
/**
* Body
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2021-04-23T14:46:36.951Z[GMT]")
public class Body {
@JsonProperty("email")
private String email = null;
@JsonProperty("password")
private String password = null;
public Body email(String email) {
this.email = email;
return this;
}
/**
* Get email
* @return email
**/
@Schema(required = true, description = "")
@NotNull
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Body password(String password) {
this.password = password;
return this;
}
/**
* Get password
* @return password
**/
@Schema(required = true, description = "")
@NotNull
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Body body = (Body) o;
return Objects.equals(this.email, body.email) &&
Objects.equals(this.password, body.password);
}
@Override
public int hashCode() {
return Objects.hash(email, password);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Body {\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).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 ");
}
}
| [
"NajeebArif786@outlook.com"
] | NajeebArif786@outlook.com |
c2acd2554d0bab6b258ad19efd1f52934d663136 | 7016cec54fb7140fd93ed805514b74201f721ccd | /src/java/com/echothree/control/user/comment/common/form/SetCommentStatusForm.java | 55c82fbcf8edef903f6410f881f8c4d6bcf81eb8 | [
"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 | 1,069 | 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.comment.common.form;
import com.echothree.control.user.comment.common.spec.CommentSpec;
public interface SetCommentStatusForm
extends CommentSpec {
String getCommentStatusChoice();
void setCommentStatusChoice(String commentStatusChoice);
}
| [
"rich@echothree.com"
] | rich@echothree.com |
6d2daf4d5143b4af1ddba8ed7641afbd3b4a070b | 63e36d35f51bea83017ec712179302a62608333e | /framework/android/annotation/IdRes.java | f829509af3c568f4f037e42a5864347be8609b30 | [] | no_license | hiepgaf/oneplus_blobs_decompiled | 672aa002fa670bdcba8fdf34113bc4b8e85f8294 | e1ab1f2dd111f905ff1eee18b6a072606c01c518 | refs/heads/master | 2021-06-26T11:24:21.954070 | 2017-08-26T12:45:56 | 2017-08-26T12:45:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 628 | java | package android.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD})
public @interface IdRes {}
/* Location: /Users/joshua/Desktop/system_framework/classes-dex2jar.jar!/android/annotation/IdRes.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"joshuous@gmail.com"
] | joshuous@gmail.com |
5278eb48b56e5a54e2994eacebe42a91396ba30b | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/spoon/learning/5789/EmptyModelChangeListener.java | be2beff8f0326bffe19a81684fcb46f3d0030bda | [] | no_license | ASSERT-KTH/synthetic-checkstyle-error-dataset | 40e8d1e0a7ebe7f7711def96a390891a6922f7bd | 40c057e1669584bfc6fecf789b5b2854660222f3 | refs/heads/master | 2023-03-18T12:50:55.410343 | 2019-01-25T09:54:39 | 2019-01-25T09:54:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,395 | java | /**
* Copyright (C) 2006-2018 INRIA and contributors
* Spoon - http://spoon.gforge.inria.fr/
*
* This software is governed by the CeCILL-C License under French law and
* abiding by the rules of distribution of free software. You can use, modify
* and/or redistribute the software under the terms of the CeCILL-C license as
* circulated by CEA, CNRS and INRIA at http://www.cecill.info.
*
* 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 CeCILL-C License for more details.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C license and that you accept its terms.
*/
package spoon.support.modelobs;
import spoon.reflect.declaration.CtElement;
import spoon.reflect.declaration.ModifierKind;
import spoon.reflect.path.CtRole ;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* is the listener that creates the action on the model. This default listener does nothing.
*/
public class EmptyModelChangeListener implements FineModelChangeListener {
@Override
public void onObjectUpdate(CtElement currentElement, CtRole role,
CtElement newValue, CtElement oldValue) {
}
@Override
public void onObjectUpdate(CtElement currentElement, CtRole role,
Object newValue, Object oldValue) {
}
@Override
public void onObjectDelete(CtElement currentElement, CtRole role,
CtElement oldValue) {
}
@Override
public void onListAdd(CtElement currentElement, CtRole role, List field,
CtElement newValue) {
}
@Override
public void onListAdd(CtElement currentElement, CtRole role, List field,
int index, CtElement newValue) {
}
@Override
public void onListDelete(CtElement currentElement, CtRole role, List field,
Collection<? extends CtElement> oldValue) {
for (CtElement ctElement : oldValue) {
onListDelete(currentElement, role, field, field.indexOf(ctElement), ctElement);
}
}
@Override
public void onListDelete(CtElement currentElement, CtRole role, List field,
int index, CtElement oldValue) {
}
@Override
public void onListDeleteAll(CtElement currentElement, CtRole role,
List field, List oldValue) {
}
@Override
public <K, V> void onMapAdd(CtElement currentElement, CtRole role,
Map<K, V> field, K key, CtElement newValue) {
}
@Override
public <K, V> void onMapDeleteAll(CtElement currentElement, CtRole role,
Map<K, V> field, Map<K, V> oldValue) {
}
@Override
public void onSetAdd(CtElement currentElement, CtRole role, Set field,
CtElement newValue) {
}
@Override
public <T extends Enum> void onSetAdd(CtElement currentElement, CtRole role, Set field,
T newValue) {
}
@Override
public void onSetDelete(CtElement currentElement, CtRole role, Set field,
CtElement oldValue) {
}
@Override
public void onSetDelete(CtElement currentElement, CtRole role, Set field, Collection<ModifierKind> oldValue) {
for (ModifierKind modifierKind : oldValue) {
onSetDelete(currentElement, role, field, modifierKind);
}
}
@Override
public void onSetDelete(CtElement currentElement, CtRole role, Set field,
ModifierKind oldValue) {
}
@Override
public void onSetDeleteAll(CtElement currentElement, CtRole role, Set field,
Set oldValue) {
}
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
7dc5a9dfec4b2ed8f199805c65e643fdb3216ce3 | 7016cec54fb7140fd93ed805514b74201f721ccd | /ui/web/main/src/java/com/echothree/ui/web/main/action/purchasing/itempurchasingcategory/DescriptionAddActionForm.java | 0c0ee87d59145ae767bbad2e72ee10f15c2833ba | [
"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 | 1,895 | 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.ui.web.main.action.purchasing.itempurchasingcategory;
import com.echothree.view.client.web.struts.BaseLanguageActionForm;
import com.echothree.view.client.web.struts.sprout.annotation.SproutForm;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionMapping;
@SproutForm(name="ItemPurchasingCategoryDescriptionAdd")
public class DescriptionAddActionForm
extends BaseLanguageActionForm {
private String itemPurchasingCategoryName;
private String description;
public void setItemPurchasingCategoryName(String itemPurchasingCategoryName) {
this.itemPurchasingCategoryName = itemPurchasingCategoryName;
}
public String getItemPurchasingCategoryName() {
return itemPurchasingCategoryName;
}
public void setDescription(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
@Override
public void reset(ActionMapping mapping, HttpServletRequest request) {
super.reset(mapping, request);
}
}
| [
"rich@echothree.com"
] | rich@echothree.com |
7086f072bc939a18e6ea03e01486902402ab7c33 | fa93c9be2923e697fb8a2066f8fb65c7718cdec7 | /sources/com/avito/android/di/module/ProfileApiModule.java | 143b77c9d6a7219fae7f88600e67e9cc3863a8be | [] | no_license | Auch-Auch/avito_source | b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b | 76fdcc5b7e036c57ecc193e790b0582481768cdc | refs/heads/master | 2023-05-06T01:32:43.014668 | 2021-05-25T10:19:22 | 2021-05-25T10:19:22 | 370,650,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,442 | java | package com.avito.android.di.module;
import com.avito.android.remote.ProfileApi;
import com.avito.android.remote.RetrofitFactory;
import dagger.Module;
import dagger.Provides;
import dagger.Reusable;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\bÇ\u0002\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0007\u0010\bJ\u0017\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0007¢\u0006\u0004\b\u0005\u0010\u0006¨\u0006\t"}, d2 = {"Lcom/avito/android/di/module/ProfileApiModule;", "", "Lcom/avito/android/remote/RetrofitFactory;", "retrofit", "Lcom/avito/android/remote/ProfileApi;", "provideProfileApi", "(Lcom/avito/android/remote/RetrofitFactory;)Lcom/avito/android/remote/ProfileApi;", "<init>", "()V", "profile_release"}, k = 1, mv = {1, 4, 2})
@Module(includes = {ProfileJsonModule.class})
public final class ProfileApiModule {
@NotNull
public static final ProfileApiModule INSTANCE = new ProfileApiModule();
@Provides
@Reusable
@NotNull
public final ProfileApi provideProfileApi(@NotNull RetrofitFactory retrofitFactory) {
Intrinsics.checkNotNullParameter(retrofitFactory, "retrofit");
return (ProfileApi) retrofitFactory.create(ProfileApi.class);
}
}
| [
"auchhunter@gmail.com"
] | auchhunter@gmail.com |
0f326197a152079b04349ee17ab7b99a34a63634 | 43c9f6bfd410e2e6d0fa6d23cf31c51afe7bb10d | /src/main/java/com/ms/music/api/file/controller/FileInfoController.java | a91077812aa29cb60d8722f017b6f726e1e1e531 | [] | no_license | ms-music/ms-music-api | 6b89072ff6d3deb1150acb363ebc43b67a21a0a1 | bd4f8675452be58ad9022b187a76b5662a971366 | refs/heads/master | 2022-12-09T17:57:45.797423 | 2020-09-30T15:27:50 | 2020-09-30T15:27:50 | 299,961,883 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 776 | java | package com.ms.music.api.file.controller;
import com.alibaba.fastjson.JSONObject;
import com.ms.music.api.file.service.FileInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class FileInfoController {
private final FileInfoService fileInfoService;
@Autowired
public FileInfoController(FileInfoService fileInfoService) {
this.fileInfoService = fileInfoService;
}
@GetMapping("/getVideoUrl/{id}")
public JSONObject getVideoUrl(@PathVariable String id) {
return fileInfoService.getFileInfo(id);
}
}
| [
"you@example.com"
] | you@example.com |
89e2d51da3b57f231b6944030676f3f56a4d7c4f | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_488/Testnull_48757.java | dbd37ca7f5115891f5c74eaf823b2a67c3f8bb0a | [] | 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_488;
import static org.junit.Assert.*;
public class Testnull_48757 {
private final Productionnull_48757 production = new Productionnull_48757("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.