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
4e1f1b13a17519966d5d4d011d0fa84a98967d45
d57176af406c4acc60155baa5e141225113e172d
/src/java/com/tsp/sct/bo/SmsPaquetePrecioBO.java
dc6d7d92c0f81f3ff0bfe213a06c4e09d69f591b
[]
no_license
njmube/SGFENS_BAFAR
8aa2bcf5312355efa46b84ab8533169df23a8cc9
4141ee825294246ca4703f7a4441f5a1b06fe0cb
refs/heads/master
2021-01-11T11:58:48.354602
2016-07-28T02:39:23
2016-07-28T02:39:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,495
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.tsp.sct.bo; import com.tsp.sct.dao.dto.SmsPaquetePrecio; import com.tsp.sct.dao.jdbc.SmsPaquetePrecioDaoImpl; import com.tsp.sct.util.StringManage; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; /** * * @author ISCesar */ public class SmsPaquetePrecioBO { private SmsPaquetePrecio smsPaquetePrecio = null; public SmsPaquetePrecio getSmsPaquetePrecio() { return smsPaquetePrecio; } public void setSmsPaquetePrecio(SmsPaquetePrecio smsPaquetePrecio) { this.smsPaquetePrecio = smsPaquetePrecio; } private Connection conn = null; public Connection getConn() { return conn; } public void setConn(Connection conn) { this.conn = conn; } public SmsPaquetePrecioBO(Connection conn){ this.conn = conn; } public SmsPaquetePrecioBO(int idSmsPaquetePrecio, Connection conn){ this.conn = conn; try{ SmsPaquetePrecioDaoImpl SmsPaquetePrecioDaoImpl = new SmsPaquetePrecioDaoImpl(this.conn); this.smsPaquetePrecio = SmsPaquetePrecioDaoImpl.findByPrimaryKey(idSmsPaquetePrecio); }catch(Exception e){ e.printStackTrace(); } } public SmsPaquetePrecio findSmsPaquetePreciobyId(int idSmsPaquetePrecio) throws Exception{ SmsPaquetePrecio SmsPaquetePrecio = null; try{ SmsPaquetePrecioDaoImpl SmsPaquetePrecioDaoImpl = new SmsPaquetePrecioDaoImpl(this.conn); SmsPaquetePrecio = SmsPaquetePrecioDaoImpl.findByPrimaryKey(idSmsPaquetePrecio); if (SmsPaquetePrecio==null){ throw new Exception("No se encontro ningun SmsPaquetePrecio que corresponda con los parámetros específicados."); } if (SmsPaquetePrecio.getIdSmsPaquetePrecio()<=0){ throw new Exception("No se encontro ningun SmsPaquetePrecio que corresponda con los parámetros específicados."); } }catch(Exception e){ throw new Exception("Ocurrió un error inesperado mientras se intentaba recuperar la información del SmsPaquetePrecio del usuario. Error: " + e.getMessage()); } return SmsPaquetePrecio; } /** * Realiza una búsqueda por ID SmsPaquetePrecio en busca de * coincidencias * @param idSmsPaquetePrecio ID Del registro para filtrar, -1 para mostrar todos los registros * @param minLimit Limite inferior de la paginación (Desde) 0 en caso de no existir limite inferior * @param maxLimit Limite superior de la paginación (Hasta) 0 en caso de no existir limite superior * @param filtroBusqueda Cadena con un filtro de búsqueda personalizado * @return DTO Marca */ public SmsPaquetePrecio[] findSmsPaquetePrecios(int idSmsPaquetePrecio, int minLimit,int maxLimit, String filtroBusqueda) { SmsPaquetePrecio[] smsPaquetePrecioDto = new SmsPaquetePrecio[0]; SmsPaquetePrecioDaoImpl smsPaquetePrecioDao = new SmsPaquetePrecioDaoImpl(this.conn); try { String sqlFiltro; if (idSmsPaquetePrecio>0){ sqlFiltro ="id_sms_paquete_precio=" + idSmsPaquetePrecio + " "; }else{ sqlFiltro ="id_sms_paquete_precio>0 "; } if (!filtroBusqueda.trim().equals("")){ sqlFiltro += filtroBusqueda; } if (minLimit<0) minLimit=0; String sqlLimit=""; if ((minLimit>0 && maxLimit>0) || (minLimit==0 && maxLimit>0)) sqlLimit = " LIMIT " + minLimit + "," + maxLimit; smsPaquetePrecioDto = smsPaquetePrecioDao.findByDynamicWhere( sqlFiltro + " ORDER BY id_sms_paquete_precio asc" + sqlLimit , new Object[0]); } catch (Exception ex) { System.out.println("Error de consulta a Base de Datos: " + ex.toString()); ex.printStackTrace(); } return smsPaquetePrecioDto; } /** * Busca el numero de coincidencias por ID SmsPaquetePrecio y otros filtros * @param idSmsPaquetePrecio ID Del SmsPaquetePrecio para filtrar, -1 para mostrar todos los registros * @param minLimit Limite inferior de la paginación (Desde) 0 en caso de no existir limite inferior * @param maxLimit Limite superior de la paginación (Hasta) 0 en caso de no existir limite superior * @param filtroBusqueda Cadena con un filtro de búsqueda personalizado * @return DTO Marca */ public int findCantidadSmsPaquetePrecios(int idSmsPaquetePrecio, int minLimit,int maxLimit, String filtroBusqueda) { int cantidad = 0; SmsPaquetePrecioDaoImpl smsPaquetePrecioDao = new SmsPaquetePrecioDaoImpl(this.conn); try { String sqlFiltro; if (idSmsPaquetePrecio>0){ sqlFiltro ="id_sms_paquete_precio=" + idSmsPaquetePrecio + " "; }else{ sqlFiltro ="id_sms_paquete_precio>0 "; } if (!filtroBusqueda.trim().equals("")){ sqlFiltro += filtroBusqueda; } if (minLimit<0) minLimit=0; String sqlLimit=""; if ((minLimit>0 && maxLimit>0) || (minLimit==0 && maxLimit>0)) sqlLimit = " LIMIT " + minLimit + "," + maxLimit; Statement stmt = this.conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT COUNT(id_sms_paquete_precio) as cantidad FROM " + smsPaquetePrecioDao.getTableName() + " WHERE " + sqlFiltro + sqlLimit); if(rs.next()){ cantidad = rs.getInt("cantidad"); } } catch (Exception ex) { System.out.println("Error de consulta a Base de Datos: " + ex.toString()); ex.printStackTrace(); } return cantidad; } public String getSmsPaquetePreciosByIdHTMLCombo(int idSeleccionado ,int minLimit,int maxLimit, String filtroBusqueda){ String strHTMLCombo =""; try{ SmsPaquetePrecio[] smsPaquetePrecioesDto = findSmsPaquetePrecios(-1, minLimit, maxLimit, " AND ID_ESTATUS!=2 " + filtroBusqueda); for (SmsPaquetePrecio smsPaquetePrecio : smsPaquetePrecioesDto){ try{ String selectedStr=""; if (idSeleccionado == smsPaquetePrecio.getIdSmsPaquetePrecio()) selectedStr = " selected "; strHTMLCombo += "<option value='"+smsPaquetePrecio.getIdSmsPaquetePrecio()+"' " + selectedStr + "title='"+smsPaquetePrecio.getNombrePaquete()+"'>" + StringManage.getValidString(smsPaquetePrecio.getNombrePaquete()) +"</option>"; }catch(Exception ex){ ex.printStackTrace(); } } }catch(Exception e){ e.printStackTrace(); } return strHTMLCombo; } }
[ "nelly.gonzalez@vincoorbis.com" ]
nelly.gonzalez@vincoorbis.com
e4e27473c7d9b55a0c1e78f5b9ae4a596cd8ad10
7543eb6be4db4124084b6eac0b26131bcdfea563
/sources/android/support/v7/widget/ButtonBarLayout.java
f489d6e0282d2b274edd73a7f86cf082d6f55789
[]
no_license
n0misain/6-1_source_from_JADX
bea3bc861ba84c62c27231e7bcff6df49e2f21c9
e0e00915f0b376e7c1d0c162bf7d6697153ce7b1
refs/heads/master
2022-07-19T05:28:02.911308
2020-05-17T00:12:26
2020-05-17T00:12:26
264,563,027
0
0
null
null
null
null
UTF-8
Java
false
false
4,925
java
package android.support.v7.widget; import android.content.Context; import android.content.res.TypedArray; import android.os.Build.VERSION; import android.support.annotation.RestrictTo; import android.support.annotation.RestrictTo.Scope; import android.support.v4.content.res.ConfigurationHelper; import android.support.v4.view.ViewCompat; import android.support.v7.appcompat.C0302R; import android.util.AttributeSet; import android.view.View; import android.view.View.MeasureSpec; import android.widget.LinearLayout; import android.widget.LinearLayout.LayoutParams; @RestrictTo({Scope.LIBRARY_GROUP}) public class ButtonBarLayout extends LinearLayout { private static final int ALLOW_STACKING_MIN_HEIGHT_DP = 320; private static final int PEEK_BUTTON_DP = 16; private boolean mAllowStacking; private int mLastWidthSize = -1; public ButtonBarLayout(Context context, AttributeSet attrs) { super(context, attrs); boolean allowStackingDefault = ConfigurationHelper.getScreenHeightDp(getResources()) >= ALLOW_STACKING_MIN_HEIGHT_DP; TypedArray ta = context.obtainStyledAttributes(attrs, C0302R.styleable.ButtonBarLayout); this.mAllowStacking = ta.getBoolean(C0302R.styleable.ButtonBarLayout_allowStacking, allowStackingDefault); ta.recycle(); } public void setAllowStacking(boolean allowStacking) { if (this.mAllowStacking != allowStacking) { this.mAllowStacking = allowStacking; if (!this.mAllowStacking && getOrientation() == 1) { setStacked(false); } requestLayout(); } } protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int initialWidthMeasureSpec; int widthSize = MeasureSpec.getSize(widthMeasureSpec); if (this.mAllowStacking) { if (widthSize > this.mLastWidthSize && isStacked()) { setStacked(false); } this.mLastWidthSize = widthSize; } boolean needsRemeasure = false; if (isStacked() || MeasureSpec.getMode(widthMeasureSpec) != 1073741824) { initialWidthMeasureSpec = widthMeasureSpec; } else { initialWidthMeasureSpec = MeasureSpec.makeMeasureSpec(widthSize, Integer.MIN_VALUE); needsRemeasure = true; } super.onMeasure(initialWidthMeasureSpec, heightMeasureSpec); if (this.mAllowStacking && !isStacked()) { boolean stack; if (VERSION.SDK_INT < 11) { int childWidthTotal = 0; for (int i = 0; i < getChildCount(); i++) { childWidthTotal += getChildAt(i).getMeasuredWidth(); } stack = (getPaddingLeft() + childWidthTotal) + getPaddingRight() > widthSize; } else if ((ViewCompat.getMeasuredWidthAndState(this) & -16777216) == 16777216) { stack = true; } else { stack = false; } if (stack) { setStacked(true); needsRemeasure = true; } } if (needsRemeasure) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); } int minHeight = 0; int firstVisible = getNextVisibleChildIndex(0); if (firstVisible >= 0) { View firstButton = getChildAt(firstVisible); LayoutParams firstParams = (LayoutParams) firstButton.getLayoutParams(); minHeight = 0 + (((getPaddingTop() + firstButton.getMeasuredHeight()) + firstParams.topMargin) + firstParams.bottomMargin); if (isStacked()) { int secondVisible = getNextVisibleChildIndex(firstVisible + 1); if (secondVisible >= 0) { minHeight = (int) (((float) minHeight) + (((float) getChildAt(secondVisible).getPaddingTop()) + (16.0f * getResources().getDisplayMetrics().density))); } } else { minHeight += getPaddingBottom(); } } if (ViewCompat.getMinimumHeight(this) != minHeight) { setMinimumHeight(minHeight); } } private int getNextVisibleChildIndex(int index) { int count = getChildCount(); for (int i = index; i < count; i++) { if (getChildAt(i).getVisibility() == 0) { return i; } } return -1; } private void setStacked(boolean stacked) { setOrientation(stacked ? 1 : 0); setGravity(stacked ? 5 : 80); View spacer = findViewById(C0302R.id.spacer); if (spacer != null) { spacer.setVisibility(stacked ? 8 : 4); } for (int i = getChildCount() - 2; i >= 0; i--) { bringChildToFront(getChildAt(i)); } } private boolean isStacked() { return getOrientation() == 1; } }
[ "jaycrandell3@gmail.com" ]
jaycrandell3@gmail.com
6bf7d469467fc592f08405cdfccb47765462c670
7fa9c6b0fa1d0726ae1cda0199716c811a1ea01b
/Crawler/data/PrefServiceConfig.java
7a819c9a35d78c7ca12930f431011d491494a19f
[]
no_license
NayrozD/DD2476-Project
b0ca75799793d8ced8d4d3ba3c43c79bb84a72c0
94dfb3c0a470527b069e2e0fd9ee375787ee5532
refs/heads/master
2023-03-18T04:04:59.111664
2021-03-10T15:03:07
2021-03-10T15:03:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,823
java
10 https://raw.githubusercontent.com/NearbyShops/Nearby-Shops-Android-app/master/app/src/main/java/org/nearbyshops/enduserappnew/Preferences/PrefServiceConfig.java package org.nearbyshops.enduserappnew.Preferences; import android.content.Context; import android.content.SharedPreferences; import com.google.gson.Gson; import org.nearbyshops.enduserappnew.Model.ModelMarket.Market; import org.nearbyshops.enduserappnew.MyApplication; import org.nearbyshops.enduserappnew.R; import org.nearbyshops.enduserappnew.Utility.UtilityFunctions; import static android.content.Context.MODE_PRIVATE; /** * Created by sumeet on 20/4/17. */ public class PrefServiceConfig { // simple or advanced at service selection screen // role selected at login screen // constants public static final int SERVICE_SELECT_MODE_SIMPLE = 1; public static final int SERVICE_SELECT_MODE_ADVANCED = 2; public static final String SDS_URL_NEARBY_SHOPS = "http://sds.nearbyshops.org"; public static final String SDS_URL_LOCAL_HOTSPOT = "http://192.168.43.233:5125"; public static final String SERVICE_URL_SDS = MyApplication.getAppContext().getResources().getString( R.string.sds_url);; private static final String TAG_PREF_CONFIG = "configuration"; private static final String TAG_SDS_URL = "url_for_sds"; public static void saveServiceConfigLocal(Market configurationLocal, Context context) { context = MyApplication.getAppContext(); //Creating a shared preference if(context==null) { return; } SharedPreferences sharedPref = context.getSharedPreferences(context.getString(R.string.preference_file_name), MODE_PRIVATE); SharedPreferences.Editor prefsEditor = sharedPref.edit(); Gson gson = UtilityFunctions.provideGson(); String json = gson.toJson(configurationLocal); prefsEditor.putString(TAG_PREF_CONFIG, json); prefsEditor.apply(); } public static Market getServiceConfigLocal(Context context) { context = MyApplication.getAppContext(); if(context==null) { return null; } SharedPreferences sharedPref = context.getSharedPreferences(context.getString(R.string.preference_file_name), MODE_PRIVATE); Gson gson = UtilityFunctions.provideGson(); String json = sharedPref.getString(TAG_PREF_CONFIG, null); return gson.fromJson(json, Market.class); } public static String getServiceName(Context context) { context = MyApplication.getAppContext(); Market serviceConfigurationLocal = getServiceConfigLocal(context); if(serviceConfigurationLocal==null) { return null; } else { return serviceConfigurationLocal.getServiceName() + " | " + serviceConfigurationLocal.getCity(); } } public static String getServiceURL_SDS(Context context) { context = MyApplication.getAppContext(); SharedPreferences sharedPref = context.getSharedPreferences(context.getString(R.string.preference_file_name), MODE_PRIVATE); return sharedPref.getString(TAG_SDS_URL, SERVICE_URL_SDS); } public static void saveServiceURL_SDS(String service_url, Context context) { context = MyApplication.getAppContext(); // get a handle to shared Preference SharedPreferences sharedPref; sharedPref = context.getSharedPreferences( context.getString(R.string.preference_file_name), MODE_PRIVATE); // write to the shared preference SharedPreferences.Editor editor = sharedPref.edit(); editor.putString(TAG_SDS_URL, service_url); editor.apply(); } }
[ "veronika.cucorova@gmail.com" ]
veronika.cucorova@gmail.com
c9348027312a245910361b53c5ba3f0148c13883
c8e934b6f99222a10e067a3fab34f39f10f8ea7e
/com/flaviotps/swsd/viewmodel/SettingsViewModel.java
3c1b009dcce2ed4a2a1c1fed189060f268ae6ee1
[]
no_license
ZPERO/Secret-Dungeon-Finder-Tool
19efef8ebe044d48215cdaeaac6384cf44ee35b9
c3c97e320a81b9073dbb5b99f200e99d8f4b26cc
refs/heads/master
2020-12-19T08:54:26.313637
2020-01-22T23:00:08
2020-01-22T23:00:08
235,683,952
0
0
null
null
null
null
UTF-8
Java
false
false
2,193
java
package com.flaviotps.swsd.viewmodel; import androidx.lifecycle.ViewModel; import com.flaviotps.swsd.model.TokenModel; import com.flaviotps.swsd.repository.TokenRepository; import com.flaviotps.swsd.repository.TokenRepository.Companion; import kotlin.Lazy; import kotlin.LazyKt__LazyJVMKt; import kotlin.Metadata; import kotlin.jvm.functions.Function0; import kotlin.jvm.internal.Lambda; import kotlin.reflect.KProperty; @Metadata(bv={1, 0, 3}, d1={"\000*\n\002\030\002\n\002\030\002\n\002\b\002\n\002\030\002\n\002\b\005\n\002\020\002\n\000\n\002\020\016\n\002\b\002\n\002\020\013\n\002\b\003\030\0002\0020\001B\005?\006\002\020\002J3\020\t\032\0020\n2\b\020\013\032\004\030\0010\f2\b\020\r\032\004\030\0010\f2\b\020\016\032\004\030\0010\0172\b\020\020\032\004\030\0010\017?\006\002\020\021R\033\020\003\032\0020\0048BX??\002?\006\f\n\004\b\007\020\b\032\004\b\005\020\006?\006\022"}, d2={"Lcom/flaviotps/swsd/viewmodel/SettingsViewModel;", "Landroidx/lifecycle/ViewModel;", "()V", "tokenRepository", "Lcom/flaviotps/swsd/repository/TokenRepository;", "getTokenRepository", "()Lcom/flaviotps/swsd/repository/TokenRepository;", "tokenRepository$delegate", "Lkotlin/Lazy;", "setTokenStatus", "", "uid", "", "token", "enabled", "", "requestEnabled", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;)V", "app_release"}, k=1, mv={1, 1, 16}) public final class SettingsViewModel extends ViewModel { private final Lazy tokenRepository$delegate = LazyKt__LazyJVMKt.lazy((Function0)tokenRepository.2.INSTANCE); public SettingsViewModel() {} private final TokenRepository getTokenRepository() { Lazy localLazy = tokenRepository$delegate; KProperty localKProperty = $$delegatedProperties[0]; return (TokenRepository)localLazy.getValue(); } public final void setTokenStatus(String paramString1, String paramString2, Boolean paramBoolean1, Boolean paramBoolean2) { if ((paramString2 != null) && (paramBoolean1 != null) && (paramString1 != null) && (paramBoolean2 != null)) { getTokenRepository().setTokenStatus(paramString1, new TokenModel(paramString2, paramBoolean1.booleanValue(), paramBoolean2.booleanValue())); } } }
[ "el.luisito217@gmail.com" ]
el.luisito217@gmail.com
c85363be997db22d438c8383fa6bffc27b593270
46550e65c345d091087811629b3c100f5a855a0b
/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/writers/AuthorizationDataHtmlWriter.java
793b810c0daaba6cc6779406ee5dd12be3912c35
[]
no_license
LiZongZho/osee
041f843d6ac319322327411b864f955b52575d47
39c88c44190b5635e6f4806a5191f3b1bd6e7f71
refs/heads/master
2020-12-13T14:43:02.942558
2014-09-29T22:09:39
2014-09-29T22:09:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,319
java
/******************************************************************************* * Copyright (c) 2014 Boeing. * 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: * Boeing - initial API and implementation *******************************************************************************/ package org.eclipse.osee.jaxrs.server.internal.security.oauth2.provider.writers; import static org.apache.cxf.rs.security.oauth2.utils.OAuthConstants.AUTHORIZATION_DECISION_ALLOW; import static org.apache.cxf.rs.security.oauth2.utils.OAuthConstants.AUTHORIZATION_DECISION_DENY; import static org.apache.cxf.rs.security.oauth2.utils.OAuthConstants.AUTHORIZATION_DECISION_KEY; import static org.eclipse.osee.jaxrs.server.internal.JaxRsUtils.asTemplateValue; import static org.eclipse.osee.jaxrs.server.internal.JaxRsUtils.newSingleTemplateRegistry; import static org.eclipse.osee.jaxrs.server.internal.JaxRsUtils.newTemplate; import java.io.Writer; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.List; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.Provider; import org.apache.cxf.rs.security.oauth2.common.OAuthAuthorizationData; import org.apache.cxf.rs.security.oauth2.common.OAuthPermission; import org.apache.cxf.rs.security.oauth2.common.Permission; import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants; import org.eclipse.osee.framework.jdk.core.type.IResourceRegistry; import org.eclipse.osee.framework.jdk.core.type.ResourceToken; import org.eclipse.osee.jaxrs.server.internal.resources.AbstractHtmlWriter; import org.eclipse.osee.jaxrs.server.internal.security.util.HiddenFormFields; import org.eclipse.osee.jaxrs.server.internal.security.util.InputFields; import org.eclipse.osee.jaxrs.server.internal.security.util.InputFields.InputType; import org.eclipse.osee.template.engine.AppendableRule; import org.eclipse.osee.template.engine.PageCreator; import org.eclipse.osee.template.engine.PageFactory; /** * @author Roberto E. Escobar */ @Provider public class AuthorizationDataHtmlWriter extends AbstractHtmlWriter<OAuthAuthorizationData> { //@formatter:off private static final ResourceToken AUTHORIZE_PAGE__TEMPLATE = newTemplate("authorize_form.html", AuthorizationDataHtmlWriter.class); private static final String AUTHORIZE_PAGE__REPLY_TO_TAG = "replyTo"; private static final String AUTHORIZE_PAGE__DECISION_KEY_TAG = "authorizationDecisionKey"; private static final String AUTHORIZE_PAGE__DECISION_ALLOW_TAG = "authorizationDecisionAllow"; private static final String AUTHORIZE_PAGE__DECISION_DENY_TAG = "authorizationDecisionDeny"; private static final String AUTHORIZE_PAGE__APPLICATION_NAME_TAG = "applicationName"; private static final String AUTHORIZE_PAGE__APPLICATION_DESCRIPTION_TAG = "applicationDescription"; private static final String AUTHORIZE_PAGE__APPLICATION_LOGO_URI_TAG = "applicationLogoUri"; private static final String AUTHORIZE_PAGE__APPLICATION_WEB_URI_TAG = "applicationWebUri"; private static final String AUTHORIZE_PAGE__LOGGED_IN_AS_TAG = "loggedInAs"; private static final String AUTHORIZE_PAGE__HIDDEN_FIELDS_SECTION_TAG = "hiddenFieldsSection"; private static final String AUTHORIZE_PAGE__PERMISSIONS_SECTION_TAG = "permissionsSection"; private static final IResourceRegistry REGISTRY = newSingleTemplateRegistry(AUTHORIZE_PAGE__TEMPLATE); //@formatter:on @Override public Class<OAuthAuthorizationData> getSupportedClass() { return OAuthAuthorizationData.class; } @Override public void writeTo(OAuthAuthorizationData data, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, Writer writer) { PageCreator creator = PageFactory.newPageCreator(REGISTRY, // AUTHORIZE_PAGE__LOGGED_IN_AS_TAG, asTemplateValue(data.getEndUserName()), // AUTHORIZE_PAGE__REPLY_TO_TAG, asTemplateValue(data.getReplyTo()), // AUTHORIZE_PAGE__APPLICATION_NAME_TAG, asTemplateValue(data.getApplicationName()), // AUTHORIZE_PAGE__APPLICATION_DESCRIPTION_TAG, asTemplateValue(data.getApplicationDescription()), // AUTHORIZE_PAGE__APPLICATION_LOGO_URI_TAG, asTemplateValue(data.getApplicationLogoUri()), // AUTHORIZE_PAGE__APPLICATION_WEB_URI_TAG, asTemplateValue(data.getApplicationWebUri()), // AUTHORIZE_PAGE__DECISION_KEY_TAG, AUTHORIZATION_DECISION_KEY, // AUTHORIZE_PAGE__DECISION_ALLOW_TAG, AUTHORIZATION_DECISION_ALLOW, // AUTHORIZE_PAGE__DECISION_DENY_TAG, AUTHORIZATION_DECISION_DENY); AppendableRule<?> hidden = HiddenFormFields.newForm(AUTHORIZE_PAGE__HIDDEN_FIELDS_SECTION_TAG) // .add(OAuthConstants.CLIENT_AUDIENCE, data.getAudience()) // .add(OAuthConstants.SESSION_AUTHENTICITY_TOKEN, data.getAuthenticityToken())// .add(OAuthConstants.CLIENT_ID, data.getClientId()) // .add(OAuthConstants.SCOPE, data.getProposedScope())// .add(OAuthConstants.REDIRECT_URI, data.getRedirectUri()) // .add(OAuthConstants.STATE, data.getState()); // creator.addSubstitution(hidden); InputFields input = InputFields.newListGroupContainer(AUTHORIZE_PAGE__PERMISSIONS_SECTION_TAG); List<? extends Permission> permissions = data.getPermissions(); if (permissions.isEmpty()) { Permission permission = new OAuthPermission("Full Data Access", "Application is able to read/write all data."); permission.setDefault(true); addItem(input, permission); } else { for (Permission permission : permissions) { addItem(input, permission); } } creator.addSubstitution(input); creator.realizePage(AUTHORIZE_PAGE__TEMPLATE, writer); } private void addItem(InputFields input, Permission perm) { String permissionName = perm.getPermission(); String key = String.format("%s_status", permissionName); input.add(key, InputType.checkbox, permissionName, perm.getDescription(), "", "allow", perm.isDefault()); } }
[ "roberto.e.escobar@boeing.com" ]
roberto.e.escobar@boeing.com
6dd318993f115522d75f9dbadf6723abc107345d
85720de1b78e09c53d0b113e08d91e30b2ce0f0f
/omall/src/com/paySystem/ic/web/dto/base/LogisticsDTO.java
734ebc33a05be7ed01f45d792de17da984c36132
[]
no_license
supermanxkq/projects
4f2696708f15d82d6b8aa8e6d6025163e52d0f76
19925f26935f66bd196abe4831d40a47b92b4e6d
refs/heads/master
2020-06-18T23:48:07.576254
2016-11-28T08:44:15
2016-11-28T08:44:15
74,933,844
0
1
null
null
null
null
UTF-8
Java
false
false
1,661
java
package com.paySystem.ic.web.dto.base; import java.io.Serializable; import java.util.Date; import com.paySystem.ic.web.dto.BaseDTO; /** * @ClassName:PayParamDTO * @Description:物流公司信息DTO类 * @date: 2014-7-21下午05:36:24 * @author: 赵瑞群 * @version: V1.0 */ public class LogisticsDTO extends BaseDTO implements Serializable{ private static final long serialVersionUID = 1L; /**物流公司编号*/ private Integer logistId; /**物流公司名称*/ private String logistName; /**物流公司网址*/ private String url; /**使用状态*/ private Integer status; /**创建时间*/ private Date createTime; /**操作员id*/ private String OperatorId; /**修改时间*/ private Date updateTime; public Integer getLogistId() { return logistId; } public void setLogistId(Integer logistId) { this.logistId = logistId; } public String getLogistName() { return logistName; } public void setLogistName(String logistName) { this.logistName = logistName; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public String getOperatorId() { return OperatorId; } public void setOperatorId(String operatorId) { OperatorId = operatorId; } public Date getUpdateTime() { return updateTime; } public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } }
[ "994028591@qq.com" ]
994028591@qq.com
6c2a3359cfb9432c40a1a85e180dbc3d0a90455e
92485b21d670fc452b949e3eee8e8181c11ff9e6
/podescoin-core/src/test/java/ch/sourcepond/utils/podescoin/TestClassVisitorFactory.java
a5f82ac6445c8b4278dd4ca7504015df1b9a2a82
[ "Apache-2.0" ]
permissive
SourcePond/podescoin
96a402b3c153c342eeac481dda33a277406c941e
ddb4c630b783d78eb1947a0f6e4fb913dba58519
refs/heads/master
2021-05-02T16:00:28.274828
2016-12-19T12:44:00
2016-12-19T12:44:00
72,567,945
0
0
null
null
null
null
UTF-8
Java
false
false
159
java
package ch.sourcepond.utils.podescoin; import org.objectweb.asm.ClassVisitor; public interface TestClassVisitorFactory { ClassVisitor newClassVisitor(); }
[ "sourcepond@gmail.com" ]
sourcepond@gmail.com
8e4fb73c27362f953dc65cfe8a07470f5222f8d3
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_a77bd0abc41692335b9c01bbebbeaa2979d446ff/PentahoDatasourceManager/4_a77bd0abc41692335b9c01bbebbeaa2979d446ff_PentahoDatasourceManager_s.java
02ab6040ed85f0d5bcf5fb35a5642b414c3b5466
[]
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
6,474
java
/* * Copyright 2012 OSBI Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.saiku.plugin; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import mondrian.olap.MondrianProperties; import mondrian.olap.Util; import mondrian.rolap.RolapConnectionProperties; import mondrian.util.Pair; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.pentaho.platform.api.engine.IPentahoSession; import org.pentaho.platform.engine.core.system.PentahoSessionHolder; import org.pentaho.platform.engine.core.system.PentahoSystem; import org.pentaho.platform.plugin.action.mondrian.catalog.IMondrianCatalogService; import org.pentaho.platform.plugin.action.mondrian.catalog.MondrianCatalog; import org.pentaho.platform.util.messages.LocaleHelper; import org.saiku.datasources.connection.ISaikuConnection; import org.saiku.datasources.datasource.SaikuDatasource; import org.saiku.service.datasource.IDatasourceManager; public class PentahoDatasourceManager implements IDatasourceManager { private static final Log LOG = LogFactory.getLog(PentahoDatasourceManager.class); private Map<String,SaikuDatasource> datasources = Collections.synchronizedMap(new HashMap<String,SaikuDatasource>()); private String saikuDatasourceProcessor; private String saikuConnectionProcessor; private String dynamicSchemaProcessor; private IPentahoSession session; private IMondrianCatalogService catalogService; private String datasourceResolver; public void setDatasourceResolverClass(String datasourceResolverClass) { this.datasourceResolver = datasourceResolverClass; } public void setSaikuDatasourceProcessor(String datasourceProcessor) { this.saikuDatasourceProcessor = datasourceProcessor; } public void setSaikuConnectionProcessor(String connectionProcessor) { this.saikuConnectionProcessor = connectionProcessor; } public void setDynamicSchemaProcessor(String dynamicSchemaProcessor) { this.dynamicSchemaProcessor = dynamicSchemaProcessor; } public PentahoDatasourceManager() { } public void init() { load(); } public void load() { datasources.clear(); loadDatasources(); } private Map<String, SaikuDatasource> loadDatasources() { try { this.session = PentahoSessionHolder.getSession(); ClassLoader cl = this.getClass().getClassLoader(); ClassLoader cl2 = this.getClass().getClassLoader().getParent(); Thread.currentThread().setContextClassLoader(cl2); this.catalogService = PentahoSystem.get(IMondrianCatalogService.class, session); List<MondrianCatalog> catalogs = catalogService.listCatalogs(session, true); Thread.currentThread().setContextClassLoader(cl); MondrianProperties.instance().DataSourceResolverClass.setString(this.datasourceResolver); for (MondrianCatalog catalog : catalogs) { String name = catalog.getName(); Util.PropertyList parsedProperties = Util.parseConnectString(catalog .getDataSourceInfo()); String dynProcName = parsedProperties.get( RolapConnectionProperties.DynamicSchemaProcessor.name()); if (StringUtils.isNotBlank(dynamicSchemaProcessor) && StringUtils.isBlank(dynProcName)) { parsedProperties.put(RolapConnectionProperties.DynamicSchemaProcessor.name(), dynamicSchemaProcessor); } StringBuilder builder = new StringBuilder(); builder.append("jdbc:mondrian:"); builder.append("Catalog="); builder.append(catalog.getDefinition()); builder.append("; "); Iterator<Pair<String, String>> it = parsedProperties.iterator(); while (it.hasNext()) { Pair<String, String> pair = it.next(); builder.append(pair.getKey()); builder.append("="); builder.append(pair.getValue()); builder.append("; "); } // builder.append("PoolNeeded=false; "); builder.append("Locale="); if (session != null) { builder.append(session.getLocale().toString()); } else { builder.append(LocaleHelper.getLocale().toString()); } builder.append(";"); String url = builder.toString(); LOG.debug("NAME: " + catalog.getName() + " DSINFO: " + url + " ###CATALOG: " + catalog.getName()); Properties props = new Properties(); props.put("driver", "mondrian.olap4j.MondrianOlap4jDriver"); props.put("location",url); if (saikuDatasourceProcessor != null) { props.put(ISaikuConnection.DATASOURCE_PROCESSORS, saikuDatasourceProcessor); } if (saikuConnectionProcessor != null) { props.put(ISaikuConnection.CONNECTION_PROCESSORS, saikuConnectionProcessor); } props.list(System.out); SaikuDatasource sd = new SaikuDatasource(name, SaikuDatasource.Type.OLAP, props); datasources.put(name, sd); } return datasources; } catch(Exception e) { e.printStackTrace(); LOG.error(e); } return new HashMap<String, SaikuDatasource>(); } public SaikuDatasource addDatasource(SaikuDatasource datasource) { throw new UnsupportedOperationException(); } public SaikuDatasource setDatasource(SaikuDatasource datasource) { throw new UnsupportedOperationException(); } public List<SaikuDatasource> addDatasources(List<SaikuDatasource> datasources) { throw new UnsupportedOperationException(); } public boolean removeDatasource(String datasourceName) { throw new UnsupportedOperationException(); } public Map<String,SaikuDatasource> getDatasources() { return loadDatasources(); } public SaikuDatasource getDatasource(String datasourceName) { return loadDatasources().get(datasourceName); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
a7b9e8cd960a089b798a5c1bf90780ca54e220c5
49546d8dface7c6f55e2658d6c5286bbbbfb153a
/com/google/api/client/auth/oauth2/BearerToken$QueryParameterAccessMethod.java
78cdf1d172cec9ecc16d7d0db4d5992a54ae3ff1
[ "MIT" ]
permissive
XeonLyfe/Backdoored-1.7-Deobf-Source-Leak
257901da437959bbdb976025e1ff1057f98c49f1
942bb61216fbb47f7909372d5c733e13d103e0ed
refs/heads/master
2022-03-18T17:09:16.301479
2019-11-18T01:42:56
2019-11-18T01:42:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
package com.google.api.client.auth.oauth2; import com.google.api.client.http.HttpRequest; import java.io.IOException; final class BearerToken$QueryParameterAccessMethod implements Credential$AccessMethod { public void intercept(HttpRequest request, String accessToken) throws IOException { request.getUrl().set("access_token", accessToken); } public String getAccessTokenFromRequest(HttpRequest request) { Object param = request.getUrl().get("access_token"); return param == null ? null : param.toString(); } }
[ "57571957+RIPBackdoored@users.noreply.github.com" ]
57571957+RIPBackdoored@users.noreply.github.com
8b52bf337d17acd5f4818a799f6156ee183519be
cd7b41b215ba9fd47c943814de910e1e9438306f
/Projects/java-learn/part01/src/chapter06_objectoriented/PeopleConstructor.java
7c78aba4efd19524861df2645094aae8b78b0be2
[]
no_license
xuyichaoxyc/renotes
60af553fa2f5d6952335408e5f0c15c1e4356193
8dc5da128645ac593f706be66202a8e5d6bae883
refs/heads/main
2023-07-13T03:47:44.814266
2021-07-22T02:38:13
2021-07-22T02:38:13
371,267,923
0
2
null
2021-07-22T02:38:13
2021-05-27T06:21:40
Java
UTF-8
Java
false
false
761
java
package chapter06_objectoriented; /** * @author :xuyichao * @description: * @date :2021/6/17 15:31 */ public class PeopleConstructor { private String name; private String sex; private int age; public PeopleConstructor(){ } public String eat(String food){ // System.out.println("我在吃" + food); return "我在吃" + food; } public void tea(){ System.out.println("我在喝茶"); } public static void main(String[] args) { PeopleConstructor peoplec = new PeopleConstructor(); System.out.println("name 初始值:" + peoplec.name); System.out.println("sex 初始值:" + peoplec.sex); System.out.println("age 初始值:" + peoplec.age); } }
[ "1817854647@qq.com" ]
1817854647@qq.com
4c4125d8a2220c3e517a99ed88bb29a2bc1f9a09
c9b25eea3198e2d0a96b7ff959c01c738a2c4ec8
/src/com/davlanca/billmanager/filter/NoCacheFilter.java
e4ed7d64b7552bc29c391e3bd19095ee03a9ef1b
[]
no_license
dsaenztagarro/gae-jsf2-primefaces
0aef2894d7f56467cd5f714e5d45081986339d4e
78152c07219e3518146d0d0ab1923aeb3af4dda4
refs/heads/master
2016-09-05T21:01:35.229595
2013-05-23T19:52:54
2013-05-23T19:52:54
10,252,061
2
1
null
null
null
null
UTF-8
Java
false
false
1,367
java
package com.davlanca.billmanager.filter; import java.io.IOException; import javax.faces.application.ResourceHandler; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class NoCacheFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse res = (HttpServletResponse) response; //if (!req.getRequestURI().startsWith(req.getContextPath() + ResourceHandler.RESOURCE_IDENTIFIER)) { // Skip JSF resources (CSS/JS/Images/etc) res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1. res.setHeader("Pragma", "no-cache"); // HTTP 1.0. res.setDateHeader("Expires", 0); // Proxies. //} chain.doFilter(request, response); } @Override public void destroy() { // TODO Auto-generated method stub } @Override public void init(FilterConfig arg0) throws ServletException { // TODO Auto-generated method stub } }
[ "david.saenz.tagarro@gmail.com" ]
david.saenz.tagarro@gmail.com
be9eb4131d90f5d9ab7d3f4742a0265facca2513
cdf2e28fc4c9a78456cc93cb0c7ebe7ecf17709a
/src/main/java/com/kintiger/platform/ireport/util/ReportDataSource.java
8b81b622488194cde00c9f4ee6cac26324d93801
[]
no_license
xie-summer/basicPaltfrom
ce9f4fe19d0188f03b084640998224e4dd74f9f9
9425c75560356aa9397189affd6d2a9fd89caf02
refs/heads/master
2021-06-16T04:05:13.957519
2017-05-11T02:20:27
2017-05-11T02:23:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
942
java
package com.kintiger.platform.ireport.util; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import net.sf.jasperreports.engine.JRDataSource; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRField; import net.sf.jasperreports.engine.JasperReport; public class ReportDataSource implements JRDataSource { JasperReport jasperReport; private List datas; private Iterator iter ; Map map = new HashMap(); public ReportDataSource(JasperReport jasperReport) { this.jasperReport = jasperReport ; datas = DataSourceBaseFactory.createBeanCollection(jasperReport);//(String id); iter= datas.iterator(); } public boolean next() throws JRException { if(iter.hasNext()){ map = (Map) iter.next(); return true; } return false; } public Object getFieldValue(JRField arg0) throws JRException { return map.get(arg0.getName()); } }
[ "cxg1207@126.com" ]
cxg1207@126.com
2edfe2884d20505bd9fadedb360392c538b2c7b9
97d95ad49efb83a2e5be5df98534dc777a955154
/products/SNS/plugins/org.csstudio.scan.server/src/org/csstudio/scan/device/VTypeHelper.java
85cf6ff4d03dab76067a09623c02be0772b6cdfc
[]
no_license
bekumar123/cs-studio
61aa64d30bce53b22627a3d98237d40531cf7789
bc24a7e2d248522af6b2983588be3b72d250505f
refs/heads/master
2021-01-21T16:39:14.712040
2014-01-27T15:30:23
2014-01-27T15:30:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,773
java
/******************************************************************************* * Copyright (c) 2012 Oak Ridge National Laboratory. * 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 ******************************************************************************/ package org.csstudio.scan.device; import java.util.Date; import org.csstudio.scan.data.ScanSample; import org.csstudio.scan.data.ScanSampleFactory; import org.epics.util.array.ListNumber; import org.epics.vtype.VEnum; import org.epics.vtype.VNumber; import org.epics.vtype.VNumberArray; import org.epics.vtype.VString; import org.epics.vtype.VType; import org.epics.vtype.ValueUtil; /** Helper for handling {@link VType} data * @author Kay Kasemir */ @SuppressWarnings("nls") public class VTypeHelper { /** Format value as string * @param value {@link VType} * @return String representation */ final public static String toString(final VType value) { if (value instanceof VNumber) return ((VNumber)value).getValue().toString(); if (value instanceof VEnum) { try { return ((VEnum)value).getValue(); } catch (ArrayIndexOutOfBoundsException ex) { // PVManager doesn't handle enums that have no label return "<enum " + ((VEnum)value).getIndex() + ">"; } } if (value instanceof VString) return ((VString)value).getValue(); if (value == null) return "null"; return value.toString(); } /** Get VType as double or NaN if not possible * @param value {@link VType} * @return double or NaN */ final public static double toDouble(final VType value) { if (value instanceof VNumber) return ((VNumber)value).getValue().doubleValue(); if (value instanceof VEnum) return ((VEnum)value).getIndex(); return Double.NaN; } /** Get VType as double[]; empty array if not possible * @param value {@link VType} * @return double[] */ public static double[] toDoubles(final VType value) { final double[] array; if (value instanceof VNumberArray) { final ListNumber list = ((VNumberArray) value).getData(); array = new double[list.size()]; for (int i=0; i<array.length; ++i) array[i] = list.getDouble(i); } else array = new double[0]; return array; } /** Create ScanSample for control system value * @param serial Serial to identify when the sample was taken * @param value {@link VType} * @return {@link ScanSample} * @throws IllegalArgumentException if the value type is not handled */ public static ScanSample createSample(final long serial, final VType value) throws IllegalArgumentException { final Date date = getDate(value); // Log anything numeric as NumberSample if (value instanceof VNumber) return ScanSampleFactory.createSample(date, serial, ((VNumber) value).getValue()); else if (value instanceof VNumberArray) { final ListNumber list = ((VNumberArray) value).getData(); final Number[] numbers = new Number[list.size()]; for (int i=0; i<numbers.length; ++i) numbers[i] = list.getDouble(i); return ScanSampleFactory.createSample(date, serial, numbers); } else // String arrays are not really handled when this is written, but ... return ScanSampleFactory.createSample(date, serial, new String[] { toString(value) }); } /** @param value {@link VType} * @return {@link Date} */ private static Date getDate(final VType value) { return ValueUtil.timeOf(value).getTimestamp().toDate(); } }
[ "kasemirk@ornl.gov" ]
kasemirk@ornl.gov
681917ab860066ef8b9541222364abac811ca977
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/test/java/org/gradle/test/performancenull_177/Testnull_17636.java
690f28ecbd01546ea35aecf9b42c78ecb117971f
[]
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_177; import static org.junit.Assert.*; public class Testnull_17636 { private final Productionnull_17636 production = new Productionnull_17636("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
b009ac2840b1a92e7e93d86f48e843fed5effe6f
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.qqlite/classes.jar/adl.java
80dabbb8c43be9823295f43e94b31d2cd7a6ee5a
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
746
java
import com.tencent.mobileqq.activity.ChatHistory; public class adl implements Runnable { public adl(ChatHistory paramChatHistory, boolean paramBoolean) {} public void run() { ChatHistory localChatHistory1 = this.jdField_a_of_type_ComTencentMobileqqActivityChatHistory; ChatHistory localChatHistory2 = this.jdField_a_of_type_ComTencentMobileqqActivityChatHistory; if (this.jdField_a_of_type_Boolean == true) {} for (int i = 2131363130;; i = 2131363131) { localChatHistory1.b(localChatHistory2.getString(i)); return; } } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.qqlite\classes.jar * Qualified Name: adl * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
e8c4a857120e71b457265c357b99fbb71f93cc25
a54288cd8cba7906a8ae2e1449335795686a3e3d
/app/src/main/java/com/android/myframework/modulemode/architect_day12/ThreadPoolTestException.java
133869857df0fc928f7073e7803bcde9d44c3ac4
[]
no_license
freedomangelly/MyFramework
5962e4a34f082408e1128ca92cd4a5f93b938966
9133e70da5e6154707e76b143b897b86570543c2
refs/heads/master
2021-04-27T00:12:22.059628
2019-04-30T08:01:38
2019-04-30T08:01:51
123,764,769
0
0
null
null
null
null
UTF-8
Java
false
false
3,641
java
package com.android.myframework.modulemode.architect_day12; import android.support.annotation.NonNull; import java.util.concurrent.BlockingQueue; import java.util.concurrent.PriorityBlockingQueue; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * Created by hcDarren on 2017/10/1. */ public class ThreadPoolTestException { static ThreadPoolExecutor threadPoolExecutor; private static final BlockingQueue<Runnable> sPoolWorkQueue = new PriorityBlockingQueue<Runnable>(4); // Queue 的参数 // BlockingQueue: 先进先出的一个队列 FIFO // SynchronousQueue: 线程安全的队列,它里面是没有固定的缓存的(OKHttp所使用的) // PriorityBlockingQueue: 无序的可以根据优先级进行排序 ,指定的对象要实现 Comparable 作比较 // RejectedExecutionException 报错的原因,其实也是 AsyncTask 存在的一些隐患 ,比如 我要执行 200 Runnable就肯定会报错 // 线程队列是 4 , 核心线程数也是 4 ,最大线程数是 10 ,目前加入的Runnable有 20 个 // 20 个都要放到队列中 ,但是队列只有 4 还有 16 个是没法放,这个时候最大线程数 是 10 非核心线程是 6 , // 那么会拿 6 个出来执行,这个时候会 从新创建 6 个线程,目前线程池就到达 10 个线程, // 但是还有 10 个没办法放就只能抛异常了,意味着那 10 个Runnable 没办法执行就会跑异常 static { threadPoolExecutor = new ThreadPoolExecutor( 4,// 核心线程数,就是线程池里面的核心线程数量 10, // 最大线程数,线程池中的最大线程数 60,// 线程存活的时间,没事干的时候的空闲存活时间,超过这个时间线程就会被销毁 TimeUnit.SECONDS,// 线程存活时间的单位 sPoolWorkQueue,// 线程队列 new ThreadFactory() {// 线程创建工厂,如果线程池需要创建线程就会调用 newThread 来创建 @Override public Thread newThread(@NonNull Runnable r) { Thread thread = new Thread(r,"自己线程的名字"); thread.setDaemon(false); // 不是守护线程 return new Thread(r); } }); } public static void main(String[] args) { /*for (int i = 0; i < 100; i++) { new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("下载图片显示完毕"); } }); }*/ for (int i = 0; i < 20; i++) { /*Runnable runnable = new Runnable() { @Override public void run() { try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("下载图片显示完毕"+Thread.currentThread().getName()); } };*/ Request request = new Request(); // 加入线程队列,寻找合适的时机去执行 threadPoolExecutor.execute(request); } } }
[ "674919909@qq.com" ]
674919909@qq.com
9943abbe20af86b6f3fbb30f96b2fca9172a7714
50fe4f21b9ae2379903d44da8c3d9bfd81ec6514
/tg/META-INF/classes/nc/bs/tg/alter/plugin/ll/AoutSyncLLWYSFPaySettInfoTask.java
24b64cfb43581816e1f65a8ac85bc2cece3a171c
[]
no_license
tanzijian1/mytest
cda37bf2d54abfd2da45b13bfe79c7e5e02676c6
4465ba67a6f62a4eac3b8bc18e19645f04a56145
refs/heads/master
2023-02-15T05:34:52.101432
2021-01-15T06:37:55
2021-01-15T06:38:56
329,802,651
0
0
null
null
null
null
GB18030
Java
false
false
2,541
java
package nc.bs.tg.alter.plugin.ll; import java.util.ArrayList; import java.util.List; import java.util.Map; import nc.bs.os.outside.TGCallUtils; import nc.bs.pub.taskcenter.BgWorkingContext; import nc.bs.tg.alter.plugin.ll.message.AlertMessage; import nc.bs.tg.alter.plugin.ll.message.EBSAlterMessage; import nc.jdbc.framework.processor.MapListProcessor; import nc.vo.pub.BusinessException; import nc.vo.tg.outside.ResultVO; /** * 邻里-收费系统退押金付款结算单结算后回写信息给物业收费系统后台任务 * * @author 2020-09-25-谈子健 * */ public class AoutSyncLLWYSFPaySettInfoTask extends AoutLLAlterTask { @Override protected AlertMessage getAlterMessage() { return new EBSAlterMessage(); } @Override protected List<Object[]> getWorkResult(BgWorkingContext bgwc) throws BusinessException { AlertMessage message = getAlterMessage(); List<Object[]> msglist = new ArrayList<Object[]>(); List<Map<String, Object>> settlist = getWYSFPaySettInfo(); if (settlist != null && settlist.size() > 0) { for (Map<String, Object> info : settlist) { Object[] obj = new Object[message.getNames().length]; obj[0] = info.get("billcode"); try { ResultVO resultVO = TGCallUtils.getUtils() .onDesCallService(null, "wysf", "PushWYSFReturnDepositInfoImpl", info); obj[1] = "同步成功,反馈信息:" + resultVO.getData(); } catch (Exception e) { obj[1] = "同步失败,反馈信息:" + e.getMessage(); } msglist.add(obj); } } return msglist; } private List<Map<String, Object>> getWYSFPaySettInfo() throws BusinessException { StringBuffer query = new StringBuffer(); query.append("select l.pk_settlement, "); query.append(" paybill.def2 srcbillno, "); query.append(" l.orglocal amount, "); query.append(" l.billcode billcode, "); query.append(" l.settledate settledate "); query.append(" from cmp_settlement l "); query.append(" inner join cmp_paybill paybill "); query.append(" on paybill.pk_paybill = l.pk_busibill "); query.append(" where L.PK_TRADETYPE IN ('F5-Cxx-LL05') "); query.append(" and l.dr = 0 "); query.append(" and paybill.dr = 0 "); query.append(" and paybill.def2 <> '~' "); query.append(" and l.def1 <> 'Y' "); query.append(" and l.settlestatus = '5' "); List<Map<String, Object>> list = (List<Map<String, Object>>) getBaseDAO() .executeQuery(query.toString(), new MapListProcessor()); return list; } }
[ "tzj@hanzhisoft.com" ]
tzj@hanzhisoft.com
8c5cd97112f5483a270e5dbaba1c05cdd0a8bcdb
5a076617e29016fe75d6421d235f22cc79f8f157
/Android 沈阳公交源码/src/com/bus/shenyang/common/Commons.java
e0be80272bf53712f8b91eac9bb989df4a67184a
[]
no_license
dddddttttt/androidsourcecodes
516b8c79cae7f4fa71b97a2a470eab52844e1334
3d13ab72163bbeed2ef226a476e29ca79766ea0b
refs/heads/master
2020-08-17T01:38:54.095515
2018-04-08T15:17:24
2018-04-08T15:17:24
null
0
0
null
null
null
null
GB18030
Java
false
false
1,208
java
package com.bus.shenyang.common; import com.bus.shenyang.R; import com.bus.shenyang.activity.Internet; import com.bus.shenyang.activity.Line; import com.bus.shenyang.activity.More; import com.bus.shenyang.activity.Stop; import com.bus.shenyang.activity.Transfer; import com.bus.shenyang.net.NoSubway; import com.bus.shenyang.net.TimeFirst; import com.bus.shenyang.net.TransferFirst; import com.bus.shenyang.net.WalkFirst; public class Commons { public static String mTextviewArray[] = {"线路查询", "站点查询", "换乘查询", "网络查询", "关于更多" }; public static Class mTabClassArray[] = {Line.class,Stop.class,Transfer.class,Internet.class,More.class }; public static int mImageViewArray[] = { R.drawable.ic_launcher, R.drawable.ic_launcher, R.drawable.ic_launcher, R.drawable.ic_launcher, R.drawable.ic_launcher }; public static String TextviewArray[]={"最少时间", "最少换乘", "最少步行", "不坐地铁" }; public static Class TabClassArray[] ={TimeFirst.class,TransferFirst.class,WalkFirst.class,NoSubway.class }; public static int ImageViewArray[] = { R.drawable.ic_launcher, R.drawable.ic_launcher, R.drawable.ic_launcher, R.drawable.ic_launcher }; }
[ "harry.han@gmail.com" ]
harry.han@gmail.com
5f979245a8425a929e7dc6cf6df62daad763a0d9
e506171a9f6ba23692a200dac6c1782aac6fc96b
/src/main/java/leetcode/_1251__1300/_1279/Demo01.java
1f6b033baa5088f29d4c47d0b9a63ba8aaf868a9
[]
no_license
minatoyukina/java-note
03bfd337c9b871103553dc4c230ae68a98552e83
9cd34686651945df748144a9fd6d7917e2be097f
refs/heads/master
2023-08-18T03:18:26.235678
2023-08-15T06:02:21
2023-08-15T06:02:21
174,096,999
0
0
null
2023-06-14T22:29:27
2019-03-06T07:45:47
Java
UTF-8
Java
false
false
133
java
package leetcode._1251__1300._1279; import org.junit.Test; public class Demo01 { @Test public void test() { } }
[ "1096445518@qq.com" ]
1096445518@qq.com
d970b0fc28fb7c0e1ac336d2b2023a64fed9c8af
c48c3185d0b193c0ce29f9374760ce921e6388d4
/imro-classes/src/main/java/nl/b3p/imro/_2008/_11/AanduidingPropertyType.java
e89b788f7d403c16459d4153e0e3bb246dfbf0c9
[]
no_license
B3Partners/imro-harvester
171c3b938bea26b216de2c1015542ac0458a2609
8c8f2d417b4e7a97e330d1500508f2cbf63b8dc2
refs/heads/master
2022-12-04T03:39:34.638341
2022-02-02T14:14:31
2022-02-02T14:14:31
52,782,825
0
2
null
2022-11-20T05:03:17
2016-02-29T10:22:56
Java
UTF-8
Java
false
false
5,301
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // 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: 2016.07.01 at 03:04:51 PM CEST // package nl.b3p.imro._2008._11; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for AanduidingPropertyType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="AanduidingPropertyType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;attGroup ref="{http://www.opengis.net/gml}AssociationAttributeGroup"/> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AanduidingPropertyType") public class AanduidingPropertyType { @XmlAttribute(name = "type", namespace = "http://www.w3.org/1999/xlink") protected String type; @XmlAttribute(name = "href", namespace = "http://www.w3.org/1999/xlink") @XmlSchemaType(name = "anyURI") protected String href; @XmlAttribute(name = "role", namespace = "http://www.w3.org/1999/xlink") @XmlSchemaType(name = "anyURI") protected String role; @XmlAttribute(name = "arcrole", namespace = "http://www.w3.org/1999/xlink") @XmlSchemaType(name = "anyURI") protected String arcrole; @XmlAttribute(name = "title", namespace = "http://www.w3.org/1999/xlink") protected String title; @XmlAttribute(name = "show", namespace = "http://www.w3.org/1999/xlink") protected String show; @XmlAttribute(name = "actuate", namespace = "http://www.w3.org/1999/xlink") protected String actuate; /** * Gets the value of the type property. * * @return * possible object is * {@link String } * */ public String getType() { if (type == null) { return "simple"; } else { return type; } } /** * Sets the value of the type property. * * @param value * allowed object is * {@link String } * */ public void setType(String value) { this.type = value; } /** * Gets the value of the href property. * * @return * possible object is * {@link String } * */ public String getHref() { return href; } /** * Sets the value of the href property. * * @param value * allowed object is * {@link String } * */ public void setHref(String value) { this.href = value; } /** * Gets the value of the role property. * * @return * possible object is * {@link String } * */ public String getRole() { return role; } /** * Sets the value of the role property. * * @param value * allowed object is * {@link String } * */ public void setRole(String value) { this.role = value; } /** * Gets the value of the arcrole property. * * @return * possible object is * {@link String } * */ public String getArcrole() { return arcrole; } /** * Sets the value of the arcrole property. * * @param value * allowed object is * {@link String } * */ public void setArcrole(String value) { this.arcrole = value; } /** * Gets the value of the title property. * * @return * possible object is * {@link String } * */ public String getTitle() { return title; } /** * Sets the value of the title property. * * @param value * allowed object is * {@link String } * */ public void setTitle(String value) { this.title = value; } /** * Gets the value of the show property. * * @return * possible object is * {@link String } * */ public String getShow() { return show; } /** * Sets the value of the show property. * * @param value * allowed object is * {@link String } * */ public void setShow(String value) { this.show = value; } /** * Gets the value of the actuate property. * * @return * possible object is * {@link String } * */ public String getActuate() { return actuate; } /** * Sets the value of the actuate property. * * @param value * allowed object is * {@link String } * */ public void setActuate(String value) { this.actuate = value; } }
[ "toonen.meine@gmail.com" ]
toonen.meine@gmail.com
65cc22b6393255f3cb20ab4a49afb7911903e3e3
75c4712ae3f946db0c9196ee8307748231487e4b
/src/main/java/com/alipay/api/domain/AlipaySocialGiftOrderQueryModel.java
072528c8a5b6d01468601301ad603178cfaf2563
[ "Apache-2.0" ]
permissive
yuanbaoMarvin/alipay-sdk-java-all
70a72a969f464d79c79d09af8b6b01fa177ac1be
25f3003d820dbd0b73739d8e32a6093468d9ed92
refs/heads/master
2023-06-03T16:54:25.138471
2021-06-25T14:48:21
2021-06-25T14:48:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
953
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 查询订单接口 * * @author auto create * @since 1.0, 2018-10-11 21:12:59 */ public class AlipaySocialGiftOrderQueryModel extends AlipayObject { private static final long serialVersionUID = 1514151434562866217L; /** * 商户再送礼平台的唯一ID,用于标识具体的调用业务方,需要先在送礼平台进行业务类型的分配之后才看使用。 */ @ApiField("mid") private String mid; /** * 对应送礼平台的主订单ID,可根据此进行订单查询 */ @ApiField("order_id") private String orderId; public String getMid() { return this.mid; } public void setMid(String mid) { this.mid = mid; } public String getOrderId() { return this.orderId; } public void setOrderId(String orderId) { this.orderId = orderId; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
b0e218cf8acee41c478871fcf8df363dedf9b73b
435196c47097c51266e253c124a2da34a9442ee8
/retail-replenishment/src/main/java/com/wisrc/replenishment/webapp/vo/logisticsPlan/LogisticsPlanPageVo.java
b1c56948fe48f92cecfbfd819e822ff8f2ac4396
[]
no_license
hzwy23/wisrc
87b6bb034375ddbd0f342556c20440f52b87effe
94e3403ae4d2f693bf2b10616517491350c2d617
refs/heads/master
2022-12-28T03:12:09.254707
2020-10-11T13:19:05
2020-10-11T13:19:05
297,698,891
2
1
null
null
null
null
UTF-8
Java
false
false
981
java
package com.wisrc.replenishment.webapp.vo.logisticsPlan; import com.wisrc.replenishment.webapp.vo.PageVo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.sql.Date; @Data @ApiModel(description = "物流计划列表") public class LogisticsPlanPageVo extends PageVo { @ApiModelProperty(value = "计划截止开始日期", required = false) private Date salesLastStartTime; @ApiModelProperty(value = "计划截止结束日期", required = false) private Date salesLastEndTime; @ApiModelProperty(value = "所属店铺", required = false) private String shopId; @ApiModelProperty(value = "负责人", required = false) private String employeeId; @ApiModelProperty(value = "销售状态", required = false) private Integer salesStatusCd; @ApiModelProperty(value = "关键字(ASIN/MSKU/库存SKU/产品名称)", required = false) private String findKey; }
[ "hzwy23@hzwy23deMBP.lan" ]
hzwy23@hzwy23deMBP.lan
c57d5886e0f00c782c76630fa8a20da360e2f521
1043c01b7637098d046fbb9dba79b15eefbad509
/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/update/subview/nested/mutableonly/model/UpdatableResponsiblePersonView.java
d29c5c36f1f435cb730f1a27af8c4b2536104ed4
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
ares3/blaze-persistence
45c06a3ec25c98236a109ab55a3205fc766734ed
2258e9d9c44bb993d41c5295eccbc894f420f263
refs/heads/master
2020-10-01T16:13:01.380347
2019-12-06T01:24:34
2019-12-09T09:29:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,122
java
/* * Copyright 2014 - 2019 Blazebit. * * 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.blazebit.persistence.view.testsuite.update.subview.nested.mutableonly.model; import com.blazebit.persistence.view.CascadeType; import com.blazebit.persistence.view.UpdatableMapping; /** * * @author Christian Beikov * @since 1.2.0 */ public interface UpdatableResponsiblePersonView extends UpdatablePersonView { @UpdatableMapping(updatable = false, cascade = { CascadeType.UPDATE }) public UpdatableFriendPersonView getFriend(); public void setFriend(UpdatableFriendPersonView friend); }
[ "christian.beikov@gmail.com" ]
christian.beikov@gmail.com
95248876d9499bc8c5438f73a089c50239805e11
946ad911d74867d15878fc2eb522afb44b229c43
/app/src/main/java/com/nikvay/cnp_master/utils/QuotationUpdateNotifier.java
36bac7f3f0461fa6b86190b701e239ec864b5759
[]
no_license
nikvay/CNP_NJ
d24b60cdf3e45d6e0f1e038e8a7e81fa25420df9
ee0b91c34825b68863968b877569aa3dcd80a6ed
refs/heads/master
2020-06-13T16:33:54.175747
2019-07-31T11:45:02
2019-07-31T11:45:02
194,712,652
0
0
null
null
null
null
UTF-8
Java
false
false
196
java
package com.nikvay.cnp_master.utils; public interface QuotationUpdateNotifier { public void updateQuotation(int mPosition,String mQuantity); public void deleteQuotation(int mPosition); }
[ "socialnikvay@gmail.com" ]
socialnikvay@gmail.com
8edcf5c6c71255873e02b6c61157d5c6221f05f0
dd76d0b680549acb07278b2ecd387cb05ec84d64
/divestory-CFR/org/apache/http/util/CharArrayBuffer.java
f87c6f32ef695c8028742ed98f6b80f068e092b8
[]
no_license
ryangardner/excursion-decompiling
43c99a799ce75a417e636da85bddd5d1d9a9109c
4b6d11d6f118cdab31328c877c268f3d56b95c58
refs/heads/master
2023-07-02T13:32:30.872241
2021-08-09T19:33:37
2021-08-09T19:33:37
299,657,052
0
0
null
null
null
null
UTF-8
Java
false
false
7,657
java
/* * Decompiled with CFR <Could not determine version>. */ package org.apache.http.util; import java.io.Serializable; import org.apache.http.protocol.HTTP; import org.apache.http.util.ByteArrayBuffer; public final class CharArrayBuffer implements Serializable { private static final long serialVersionUID = -6208952725094867135L; private char[] buffer; private int len; public CharArrayBuffer(int n) { if (n < 0) throw new IllegalArgumentException("Buffer capacity may not be negative"); this.buffer = new char[n]; } private void expand(int n) { char[] arrc = new char[Math.max(this.buffer.length << 1, n)]; System.arraycopy(this.buffer, 0, arrc, 0, this.len); this.buffer = arrc; } public void append(char c) { int n = this.len + 1; if (n > this.buffer.length) { this.expand(n); } this.buffer[this.len] = c; this.len = n; } public void append(Object object) { this.append(String.valueOf(object)); } public void append(String string2) { int n; int n2; String string3 = string2; if (string2 == null) { string3 = "null"; } if ((n = this.len + (n2 = string3.length())) > this.buffer.length) { this.expand(n); } string3.getChars(0, n2, this.buffer, this.len); this.len = n; } public void append(ByteArrayBuffer byteArrayBuffer, int n, int n2) { if (byteArrayBuffer == null) { return; } this.append(byteArrayBuffer.buffer(), n, n2); } public void append(CharArrayBuffer charArrayBuffer) { if (charArrayBuffer == null) { return; } this.append(charArrayBuffer.buffer, 0, charArrayBuffer.len); } public void append(CharArrayBuffer charArrayBuffer, int n, int n2) { if (charArrayBuffer == null) { return; } this.append(charArrayBuffer.buffer, n, n2); } public void append(byte[] arrby, int n, int n2) { int n3; if (arrby == null) { return; } if (n >= 0 && n <= arrby.length && n2 >= 0 && (n3 = n + n2) >= 0 && n3 <= arrby.length) { if (n2 == 0) { return; } int n4 = this.len; int n5 = n2 + n4; n2 = n4; n3 = n; if (n5 > this.buffer.length) { this.expand(n5); n3 = n; n2 = n4; } do { if (n2 >= n5) { this.len = n5; return; } this.buffer[n2] = (char)(arrby[n3] & 255); ++n3; ++n2; } while (true); } StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("off: "); stringBuffer.append(n); stringBuffer.append(" len: "); stringBuffer.append(n2); stringBuffer.append(" b.length: "); stringBuffer.append(arrby.length); throw new IndexOutOfBoundsException(stringBuffer.toString()); } public void append(char[] arrc, int n, int n2) { int n3; if (arrc == null) { return; } if (n >= 0 && n <= arrc.length && n2 >= 0 && (n3 = n + n2) >= 0 && n3 <= arrc.length) { if (n2 == 0) { return; } n3 = this.len + n2; if (n3 > this.buffer.length) { this.expand(n3); } System.arraycopy(arrc, n, this.buffer, this.len, n2); this.len = n3; return; } StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("off: "); stringBuffer.append(n); stringBuffer.append(" len: "); stringBuffer.append(n2); stringBuffer.append(" b.length: "); stringBuffer.append(arrc.length); throw new IndexOutOfBoundsException(stringBuffer.toString()); } public char[] buffer() { return this.buffer; } public int capacity() { return this.buffer.length; } public char charAt(int n) { return this.buffer[n]; } public void clear() { this.len = 0; } public void ensureCapacity(int n) { if (n <= 0) { return; } int n2 = this.buffer.length; int n3 = this.len; if (n <= n2 - n3) return; this.expand(n3 + n); } public int indexOf(int n) { return this.indexOf(n, 0, this.len); } public int indexOf(int n, int n2, int n3) { int n4 = n2; if (n2 < 0) { n4 = 0; } int n5 = this.len; n2 = n3; if (n3 > n5) { n2 = n5; } n3 = n4; if (n4 > n2) { return -1; } while (n3 < n2) { if (this.buffer[n3] == n) { return n3; } ++n3; } return -1; } public boolean isEmpty() { if (this.len != 0) return false; return true; } public boolean isFull() { if (this.len != this.buffer.length) return false; return true; } public int length() { return this.len; } public void setLength(int n) { if (n >= 0 && n <= this.buffer.length) { this.len = n; return; } StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("len: "); stringBuffer.append(n); stringBuffer.append(" < 0 or > buffer len: "); stringBuffer.append(this.buffer.length); throw new IndexOutOfBoundsException(stringBuffer.toString()); } public String substring(int n, int n2) { return new String(this.buffer, n, n2 - n); } public String substringTrimmed(int n, int n2) { int n3; if (n < 0) { StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("Negative beginIndex: "); stringBuffer.append(n); throw new IndexOutOfBoundsException(stringBuffer.toString()); } if (n2 > this.len) { StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("endIndex: "); stringBuffer.append(n2); stringBuffer.append(" > length: "); stringBuffer.append(this.len); throw new IndexOutOfBoundsException(stringBuffer.toString()); } if (n > n2) { StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("beginIndex: "); stringBuffer.append(n); stringBuffer.append(" > endIndex: "); stringBuffer.append(n2); throw new IndexOutOfBoundsException(stringBuffer.toString()); } do { n3 = n2; if (n >= n2) break; n3 = n2; if (!HTTP.isWhitespace(this.buffer[n])) break; ++n; } while (true); while (n3 > n) { if (!HTTP.isWhitespace(this.buffer[n3 - 1])) return new String(this.buffer, n, n3 - n); --n3; } return new String(this.buffer, n, n3 - n); } public char[] toCharArray() { int n = this.len; char[] arrc = new char[n]; if (n <= 0) return arrc; System.arraycopy(this.buffer, 0, arrc, 0, n); return arrc; } public String toString() { return new String(this.buffer, 0, this.len); } }
[ "ryan.gardner@coxautoinc.com" ]
ryan.gardner@coxautoinc.com
63170d3e819c83bec5d3a037fd220249b5b942aa
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE78_OS_Command_Injection/CWE78_OS_Command_Injection__getCookies_Servlet_53b.java
cad92b6d8aab2b78e4010a79a22c5b5eea2c56e1
[]
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
1,330
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE78_OS_Command_Injection__getCookies_Servlet_53b.java Label Definition File: CWE78_OS_Command_Injection.label.xml Template File: sources-sink-53b.tmpl.java */ /* * @description * CWE: 78 OS Command Injection * BadSource: getCookies_Servlet Read data from the first cookie using getCookies() * GoodSource: A hardcoded string * Sinks: exec * BadSink : dynamic command execution with Runtime.getRuntime().exec() * Flow Variant: 53 Data flow: data passed as an argument from one method through two others to a fourth; all four functions are in different classes in the same package * * */ package testcases.CWE78_OS_Command_Injection; import testcasesupport.*; import javax.servlet.http.*; public class CWE78_OS_Command_Injection__getCookies_Servlet_53b { public void badSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable { (new CWE78_OS_Command_Injection__getCookies_Servlet_53c()).badSink(data , request, response); } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable { (new CWE78_OS_Command_Injection__getCookies_Servlet_53c()).goodG2BSink(data , request, response); } }
[ "you@example.com" ]
you@example.com
c15af33533c21123e67261a69c928a704f074c2d
594dbe9ad659263e560e2d84d02dae411e3ff2ca
/glaf-web/src/main/java/com/glaf/expr/poi/functions/STDEVA.java
555f9989b5b498f974d380a6baa9d687f5221464
[]
no_license
eosite/openyourarm
670b3739f9abb81b36a7d90846b6d2e68217b443
7098657ee60bf6749a13c0ea19d1ac1a42a684a0
refs/heads/master
2021-05-08T16:38:30.406098
2018-01-24T03:38:45
2018-01-24T03:38:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,577
java
package com.glaf.expr.poi.functions; import java.util.ArrayList; import java.util.List; import org.apache.poi.ss.formula.eval.ErrorEval; import org.apache.poi.ss.formula.eval.EvaluationException; import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.formula.functions.NumericFunction; import com.glaf.expr.poi.utils.EvaluateArgsUtil; public class STDEVA extends NumericFunction{ @Override protected double eval(ValueEval[] args, int srcCellRow, int srcCellCol) throws EvaluationException { // check params if (args.length < 1) { throw new EvaluationException(ErrorEval.VALUE_INVALID); } try { EvaluateArgsUtil util = new EvaluateArgsUtil(); List<Double> vals = new ArrayList<>(); try { List<Double> reList = null ; for (int i = 0; i < args.length; i++) { reList = util.evaluateArgs(args[i], srcCellRow, srcCellCol) ; if(reList!=null){ vals.addAll(reList); } } } catch (Exception e) { throw new EvaluationException(ErrorEval.VALUE_INVALID); } if(vals.size()==0){ throw new EvaluationException(ErrorEval.NUM_ERROR); } //average value double average = 0d ; double sum = 0d ; for (Double val : vals) { sum += val ; } average = sum / vals.size(); //stdev value double stdev = 0d; double stdevSum = 0d; for (Double double1 : vals) { stdevSum += Math.pow((double1-average), 2); } stdev = Math.sqrt(stdevSum/(vals.size()-1)); return stdev; } catch (EvaluationException e) { e.printStackTrace(); } return 0; } }
[ "weishang80@qq.com" ]
weishang80@qq.com
712784207f0f57663aedbeb7767a4bffd6a4541d
a23b277bd41edbf569437bdfedad22c2d7733dbe
/acm/P1049__Microprocessor_Simulation/Main.java
3855f10dfc9b71161969d0ad22809e83c6fe46cd
[]
no_license
alexandrofernando/java
155ed38df33ae8dae641d327be3c6c355b28082a
a783407eaba29a88123152dd5b2febe10eb7bf1d
refs/heads/master
2021-01-17T06:49:57.241130
2019-07-19T11:34:44
2019-07-19T11:34:44
52,783,678
1
0
null
2017-07-03T21:46:00
2016-02-29T10:38:28
Java
UTF-8
Java
false
false
3,126
java
package P1049__Microprocessor_Simulation; import java.util.Scanner; import java.io.File; /** * <p>Title: </p> * * <p>Description: </p> * * <p>Copyright: Copyright (c) 2005</p> * * <p>Company: </p> * * @author not attributable * @version 1.0 */ public class Main { public static void main(String[] args) throws Exception { Scanner cin = new Scanner(System.in); StringBuffer memory = new StringBuffer(cin.next()); while (memory.charAt(0) != '8') { int pos = 0; char A = '0'; char B = '0'; do { char code = memory.charAt(pos); if (code == '0') { A = memory.charAt(address(memory.charAt(pos + 1), memory.charAt(pos + 2))); pos += 3; } else if (code == '1') { memory.setCharAt(address(memory.charAt(pos + 1), memory.charAt(pos + 2)), A); pos += 3; } else if (code == '2') { char temp = A; A = B; B = temp; pos++; } else if (code == '3') { int sum = Integer.parseInt(A + "", 16) + Integer.parseInt(B + "", 16); A = Integer.toHexString(sum % 16).toUpperCase().charAt(0); B = Integer.toHexString(sum / 16).toUpperCase().charAt(0); pos++; } else if (code == '4') { if (A == 'F') { A = '0'; } else if (A == '9') { A = 'A'; } else { A++; } pos++; } else if (code == '5') { if (A == '0') { A = 'F'; } else if (A == 'A') { A = '9'; } else { A--; } pos++; } else if (code == '6') { if (A == '0') { pos = address(memory.charAt(pos + 1), memory.charAt(pos + 2)); } else { pos += 3; } } else if (code == '7') { pos = address(memory.charAt(pos + 1), memory.charAt(pos + 2)); } else if (code == '8') { break; } } while (true); System.out.println(memory); memory = new StringBuffer(cin.next()); } } static int address(char high, char low) { return Integer.parseInt(high + "" + low, 16); } }
[ "alexandrofernando@gmail.com" ]
alexandrofernando@gmail.com
466a9eabe543b2bf74345ccd6bad9b3465374c41
b214f96566446763ce5679dd2121ea3d277a9406
/modules/base/ide-impl/src/main/java/consulo/ide/impl/idea/formatting/FormatRangesStorage.java
323ba917e86d15b6884adcc39e6e3a877b5f5b75
[ "Apache-2.0", "LicenseRef-scancode-jgraph" ]
permissive
consulo/consulo
aa340d719d05ac6cbadd3f7d1226cdb678e6c84f
d784f1ef5824b944c1ee3a24a8714edfc5e2b400
refs/heads/master
2023-09-06T06:55:04.987216
2023-09-01T06:42:16
2023-09-01T06:42:16
10,116,915
680
54
Apache-2.0
2023-06-05T18:28:51
2013-05-17T05:48:18
Java
UTF-8
Java
false
false
1,754
java
/* * Copyright 2013-2017 consulo.io * * 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 consulo.ide.impl.idea.formatting; import consulo.document.util.TextRange; import consulo.ide.impl.idea.util.containers.ContainerUtil; import consulo.language.codeStyle.FormatTextRange; import java.util.ArrayList; import java.util.List; /** * @author VISTALL * @since 01-May-17 * <p> * from kotlin platform\lang-impl\src\com\intellij\formatting\FormatTextRanges.kt */ public class FormatRangesStorage { private List<FormatTextRange> rangesByStartOffset = new ArrayList<>(); public void add(TextRange range, boolean processHeadingWhitespace) { FormatTextRange formatRange = new FormatTextRange(range, processHeadingWhitespace); rangesByStartOffset.add(formatRange); } public boolean isWhiteSpaceReadOnly(TextRange range) { return ContainerUtil.find(rangesByStartOffset, it -> !it.isWhitespaceReadOnly(range)) == null; } public boolean isReadOnly(TextRange range) { return ContainerUtil.find(rangesByStartOffset, it -> !it.isReadOnly(range)) == null; } public List<FormatTextRange> getRanges() { return rangesByStartOffset; } public boolean isEmpty() { return rangesByStartOffset.isEmpty(); } }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
417b75f33171f8bf917c86efe21ff931991e6a2e
a5d01febfd8d45a61f815b6f5ed447e25fad4959
/Source Code/5.27.0/sources/com/iqoption/core/microservices/kyc/response/step/f.java
f2beee877b193f1c99a0c98f0432395ab650b110
[]
no_license
kkagill/Decompiler-IQ-Option
7fe5911f90ed2490687f5d216cb2940f07b57194
c2a9dbbe79a959aa1ab8bb7a89c735e8f9dbc5a6
refs/heads/master
2020-09-14T20:44:49.115289
2019-11-04T06:58:55
2019-11-04T06:58:55
223,236,327
1
0
null
2019-11-21T18:17:17
2019-11-21T18:17:16
null
UTF-8
Java
false
false
2,271
java
package com.iqoption.core.microservices.kyc.response.step; import java.util.Map; import kotlin.Pair; import kotlin.i; import kotlin.j; @i(bne = {1, 1, 15}, bnf = {"\u0000\u001e\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u0007\n\u0002\b\u0003\n\u0002\u0010$\n\u0002\u0018\u0002\n\u0002\b\u0005\u001a\u000e\u0010\r\u001a\u00020\u00012\u0006\u0010\u000e\u001a\u00020\u0005\"\u0011\u0010\u0000\u001a\u00020\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u0003\"\u000e\u0010\u0004\u001a\u00020\u0005X‚T¢\u0006\u0002\n\u0000\"\u0011\u0010\u0006\u001a\u00020\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\u0003\"\u001d\u0010\b\u001a\u000e\u0012\u0004\u0012\u00020\n\u0012\u0004\u0012\u00020\u00010\t¢\u0006\b\n\u0000\u001a\u0004\b\u000b\u0010\f¨\u0006\u000f"}, bng = {"KYC_QUESTIONS_WARNING_PERCENT", "", "getKYC_QUESTIONS_WARNING_PERCENT", "()I", "KYC_QUESTIONS_WARNING_WEIGHT", "", "KYC_STEP_ALL_WEIGHTS", "getKYC_STEP_ALL_WEIGHTS", "KYC_STEP_WEIGHTS", "", "Lcom/iqoption/core/microservices/kyc/response/step/KycStepType;", "getKYC_STEP_WEIGHTS", "()Ljava/util/Map;", "scaleProgressFromFloat", "floatValue", "core_release"}) /* compiled from: KycStepWeights.kt */ public final class f { private static final Map<KycStepType, Integer> bwe; private static final int bwf = N((float) u.aa(bwe.values())); private static final int bwg; public static final int N(float f) { return (int) (f * ((float) 1000)); } static { r0 = new Pair[6]; KycStepType kycStepType = KycStepType.PHONE; Integer valueOf = Integer.valueOf(2); r0[2] = j.x(kycStepType, valueOf); r0[3] = j.x(KycStepType.KYC_QUESTIONNAIRE, Integer.valueOf(15)); r0[4] = j.x(KycStepType.KYC_DOCUMENTS_POI, valueOf); r0[5] = j.x(KycStepType.KYC_DOCUMENTS_POA, valueOf); bwe = af.a(r0); Object obj = bwe.get(KycStepType.KYC_QUESTIONNAIRE); if (obj == null) { kotlin.jvm.internal.i.bnJ(); } bwg = (int) (75.0f / ((Number) obj).floatValue()); } public static final Map<KycStepType, Integer> afO() { return bwe; } public static final int afP() { return bwf; } public static final int afQ() { return bwg; } }
[ "yihsun1992@gmail.com" ]
yihsun1992@gmail.com
c4a641ba5ac727729f8c40de75295496bb2ea4b1
55f04ed07fe4aee95bd97a542984044c8279f48a
/app/src/main/java/com/zsl/bean/JobBean.java
a034c9778999c2d1367862f4346058797e374e95
[]
no_license
Win5201314/xiangqin
d95073d2b4e5c40b1b0b41585ebf121647e932cf
ba7c7896f503e0ae9fae5df9a0b978d6423890a7
refs/heads/master
2020-04-06T22:59:25.341538
2018-12-24T07:13:53
2018-12-24T07:13:53
157,854,112
0
0
null
null
null
null
UTF-8
Java
false
false
3,481
java
package com.zsl.bean; import java.io.Serializable; import cn.bmob.v3.BmobObject; public class JobBean extends BmobObject implements Serializable { //公司的名字 private String companyName; //技术类别 private int type; //技术要求 private String demand; //薪资待遇 private String salary; //办公地址 private String address; //是否外包性质 private boolean isOutsource; //联系方式 private String contact; //是否审核通过 private boolean isPass; //发布日期 private String date; //其他福利 private String other; //比目科技id private String ObjectId; public JobBean() {} public JobBean(String companyName, int type, String demand, String salary, String address, boolean isOutsource, String contact, boolean isPass, String date, String other, String ObjectId) { this.companyName = companyName; this.type = type; this.demand = demand; this.salary = salary; this.address = address; this.isOutsource = isOutsource; this.contact = contact; this.isPass = isPass; this.date = date; this.other = other; this.ObjectId = ObjectId; } public String getCompanyName() { return companyName; } public void setCompanyName(String companyName) { this.companyName = companyName; } public int getType() { return type; } public void setType(int type) { this.type = type; } public String getDemand() { return demand; } public void setDemand(String demand) { this.demand = demand; } public String getSalary() { return salary; } public void setSalary(String salary) { this.salary = salary; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public boolean isOutsource() { return isOutsource; } public void setOutsource(boolean outsource) { isOutsource = outsource; } public String getContact() { return contact; } public void setContact(String contact) { this.contact = contact; } public boolean isPass() { return isPass; } public void setPass(boolean pass) { isPass = pass; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } public String getOther() { return other; } public void setOther(String other) { this.other = other; } @Override public String getObjectId() { return ObjectId; } @Override public void setObjectId(String objectId) { ObjectId = objectId; } @Override public String toString() { return "JobBean{" + "companyName='" + companyName + '\'' + ", type=" + type + ", demand='" + demand + '\'' + ", salary='" + salary + '\'' + ", address='" + address + '\'' + ", isOutsource=" + isOutsource + ", contact='" + contact + '\'' + ", isPass=" + isPass + ", date='" + date + '\'' + ", other='" + other + '\'' + ", ObjectId='" + ObjectId + '\'' + '}'; } }
[ "zsl" ]
zsl
9d95af23d33da1d4dec37ad2418d313a558990ac
7ec0194c493e63b18ab17b33fe69a39ed6af6696
/masterlock/app_decompiled/sources/p009rx/internal/operators/DeferredScalarSubscriberSafe.java
eb6d2c424bdd7fc26cd435011e7fa7930e3a78ad
[]
no_license
rasaford/CS3235
5626a6e7e05a2a57e7641e525b576b0b492d9154
44d393fb3afb5d131ad9d6317458c5f8081b0c04
refs/heads/master
2020-07-24T16:00:57.203725
2019-11-05T13:00:09
2019-11-05T13:00:09
207,975,557
0
1
null
null
null
null
UTF-8
Java
false
false
742
java
package p009rx.internal.operators; import p009rx.Subscriber; import p009rx.plugins.RxJavaHooks; /* renamed from: rx.internal.operators.DeferredScalarSubscriberSafe */ public abstract class DeferredScalarSubscriberSafe<T, R> extends DeferredScalarSubscriber<T, R> { protected boolean done; public DeferredScalarSubscriberSafe(Subscriber<? super R> subscriber) { super(subscriber); } public void onError(Throwable th) { if (!this.done) { this.done = true; super.onError(th); return; } RxJavaHooks.onError(th); } public void onCompleted() { if (!this.done) { this.done = true; super.onCompleted(); } } }
[ "fruehaufmaximilian@gmail.com" ]
fruehaufmaximilian@gmail.com
f2e4ec1b8954961e947c3fc7dc5e1d24470e79ec
2bc2eadc9b0f70d6d1286ef474902466988a880f
/tags/mule-1.3/mule/transports/http/src/test/java/org/mule/providers/http/StatusCodeMappingsTestCase.java
5b15ecaac50c5881c24502ef9a40a9a7947a1ee6
[]
no_license
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
1,915
java
/* * $Id$ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the MuleSource MPL * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.providers.http; import org.mule.MuleException; import org.mule.config.ExceptionHelper; import org.mule.config.i18n.Message; import org.mule.tck.AbstractMuleTestCase; import org.mule.umo.routing.RoutingException; import org.mule.umo.security.UnauthorisedException; /** * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a> * @version $Revision$ */ public class StatusCodeMappingsTestCase extends AbstractMuleTestCase { public void testErrorMappings() { String code = ExceptionHelper.getErrorMapping("http", RoutingException.class); assertEquals("500", code); code = ExceptionHelper.getErrorMapping("HTTP", org.mule.umo.security.SecurityException.class); assertEquals("403", code); code = ExceptionHelper.getErrorMapping("http", UnauthorisedException.class); assertEquals("401", code); code = ExceptionHelper.getErrorMapping("blah", MuleException.class); assertEquals(String.valueOf(new MuleException(Message.createStaticMessage("test")) .getExceptionCode()), code); } public void testHttpsErrorMappings() { String code = ExceptionHelper.getErrorMapping("httpS", RoutingException.class); assertEquals("500", code); code = ExceptionHelper.getErrorMapping("HTTPS", org.mule.umo.security.SecurityException.class); assertEquals("403", code); code = ExceptionHelper.getErrorMapping("https", UnauthorisedException.class); assertEquals("401", code); } }
[ "tcarlson@bf997673-6b11-0410-b953-e057580c5b09" ]
tcarlson@bf997673-6b11-0410-b953-e057580c5b09
47c2869bb7d1b74bedd409f99868d7dbccf6bf9e
753c482b3145b94694ee902c0dcb8fc6f0a8d8b4
/util-lang/src/main/java/ao/util/math/stats/summary/SummaryStatisticTest.java
d5483dfad0f26e3d14b421da43182747c1a6bac9
[]
no_license
alexoooo/alexoutilities
26b2d68d47714a8b2efcef12046c5df2b10f8b74
1230aae07cab9fc3205bcc95c7878417dd902cce
refs/heads/master
2023-08-16T17:30:51.956598
2023-08-15T03:44:35
2023-08-15T03:44:35
166,334,226
0
0
null
null
null
null
UTF-8
Java
false
false
844
java
package ao.util.math.stats.summary; import ao.util.math.rand.Rand; /** * User: aostrovsky * Date: 8-Feb-2010 * Time: 10:35:34 AM */ public class SummaryStatisticTest { //-------------------------------------------------------------------- public static void main(String[] args) { SummaryStatistic statA = new PercentileSummary(); SummaryStatistic statB = new RadixSummary(0.01); for (int i = 0; i < 1000000; i++) { double value = Rand.nextDouble() * 10; statA.add( value ); statB.add( value ); } System.out.println( statA.csvHeader() ); System.out.println( statA.toCsv() ); System.out.println(); System.out.println( statB.csvHeader() ); System.out.println( statB.toCsv() ); } }
[ "ostrovsky.alex@gmail.com" ]
ostrovsky.alex@gmail.com
a992ceb23ea64dc3f3d41f96246a3b4757136a39
bc794d54ef1311d95d0c479962eb506180873375
/kerenrh/kerenrh-components/core-components/core-ifaces/src/main/java/com/keren/core/ifaces/discipline/DemandeExplicationManagerLocal.java
872c36325a1f86b9d4588633bd2d2789095cebbf
[]
no_license
Teratech2018/Teratech
d1abb0f71a797181630d581cf5600c50e40c9663
612f1baf9636034cfa5d33a91e44bbf3a3f0a0cb
refs/heads/master
2021-04-28T05:31:38.081955
2019-04-01T08:35:34
2019-04-01T08:35:34
122,177,253
0
0
null
null
null
null
UTF-8
Java
false
false
276
java
package com.keren.core.ifaces.discipline; import javax.ejb.Local; /** * Interface locale du manager * @since Thu Feb 15 16:33:29 GMT+01:00 2018 * */ @Local public interface DemandeExplicationManagerLocal extends DemandeExplicationManager { }
[ "bekondo_dieu@yahoo.fr" ]
bekondo_dieu@yahoo.fr
b462e2b7ea435c3a2017ac8af6ac1437aa209218
d381092dd5f26df756dc9d0a2474b253b9e97bfb
/impe3/impe3-pms-api/src/main/java/com/isotrol/impe3/pms/api/config/ChoiceItemDTO.java
fbf6eccee499c66d0ebcf674f7eb4d4999ede336
[]
no_license
isotrol-portal3/portal3
2d21cbe07a6f874fff65e85108dcfb0d56651aab
7bd4dede31efbaf659dd5aec72b193763bfc85fe
refs/heads/master
2016-09-15T13:32:35.878605
2016-03-07T09:50:45
2016-03-07T09:50:45
39,732,690
0
1
null
null
null
null
UTF-8
Java
false
false
1,524
java
/** * This file is part of Port@l * Port@l 3.0 - Portal Engine and Management System * Copyright (C) 2010 Isotrol, SA. http://www.isotrol.com * * Port@l 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. * * Port@l 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 Port@l. If not, see <http://www.gnu.org/licenses/>. */ package com.isotrol.impe3.pms.api.config; import com.isotrol.impe3.pms.api.AbstractDescribed; /** * DTO for a configuration choice item template. * @author Andres Rodriguez */ public final class ChoiceItemDTO extends AbstractDescribed { /** Serial UID. */ private static final long serialVersionUID = -344929315329715883L; /** Choice key. */ private String key; /** Default constructor. */ public ChoiceItemDTO() { } /** * Returns the choice item key. * @return The choice item key. */ public String getKey() { return key; } /** * Sets the choice item key. * @param key The choice item key. */ public void setKey(String key) { this.key = key; } }
[ "isotrol-portal@portal.isotrol.com" ]
isotrol-portal@portal.isotrol.com
aa3aaf081bac7631db74903e553e7a32029214f0
39f2dc7f250cf6d9e132cda8a328e62f1ebd61fd
/offer_book_reading/src/main/java/cn/offer2020/pbj/book_reading/cartoon_algorithm/chapter6/BitMap.java
4b6043dad35b5f971ecbf39671ed942077b2356b
[ "Apache-2.0" ]
permissive
peng4444/offer2020
0c51a93202383ef8063cc624d96ab0b26ddc8189
372f8d072698acbb03e1bb569a20e6cda957e1af
refs/heads/master
2021-05-17T07:33:28.950090
2020-11-17T13:21:14
2020-11-17T13:21:14
250,697,652
7
0
Apache-2.0
2021-03-31T21:57:55
2020-03-28T02:32:57
Java
UTF-8
Java
false
false
1,856
java
package cn.offer2020.pbj.book_reading.cartoon_algorithm.chapter6; /** * @ClassName: BitMap * @Author: pbj * @Date: 2020/3/19 15:47 * @Description: TODO BitMap 位运算存储用户画像信息 * 想要深入研究Bitmap算法的读者,可以看一下JDK中BitSet类的源码。同时,缓存数据库Redis中也有对Bitmap算法的支持。 */ public class BitMap { // 每一个word是一个long类型元素,对应一个64位二进制数据 private long[] words; //Bitmap的位数大小 private int size; public BitMap(int size) { this.size = size; this.words = new long[(getWordIndex(size - 1) + 1)]; } /*** 判断Bitmap某一位的状态* @param bitIndex 位图的第bitIndex位*/ public boolean getBit(int bitIndex) { if (bitIndex < 0 || bitIndex > size - 1) { throw new IndexOutOfBoundsException(" 超过Bitmap有效范围"); } int wordIndex = getWordIndex(bitIndex); return (words[wordIndex] & (1L << bitIndex)) != 0; } /*** 把Bitmap某一位设置为tru* @param bitIndex 位图的第bitIndex位*/ public void setBit(int bitIndex) { if (bitIndex < 0 || bitIndex > size - 1) { throw new IndexOutOfBoundsException(" 超过Bitmap有效范围"); } int wordIndex = getWordIndex(bitIndex); words[wordIndex] |= (1L << bitIndex); } /*** 定位Bitmap某一位所对应的word* @param bitIndex 位图的第bitIndex位*/ private int getWordIndex(int bitIndex) { //右移6位,相当于除以64 return bitIndex >> 6; } public static void main(String[] args) { BitMap bitMap = new BitMap(128); bitMap.setBit(126); bitMap.setBit(75); System.out.println(bitMap.getBit(126)); System.out.println(bitMap.getBit(78)); } }
[ "pbj@qq.com" ]
pbj@qq.com
b316f13b14c7d0c17d309b1f1d98ee53576ecca6
012f8b2d74d08e6c6124c8f3cae6801689b7bbcd
/as2-lib/src/main/java/com/helger/as2lib/processor/resender/ResendItem.java
c8823543134b1eee927e508b72d9551b5e85b489
[ "Apache-2.0", "BSD-2-Clause-Views" ]
permissive
jillukowicz/as2-lib
1d5982bee0426186e5e3193ae6001e46424926c2
d7f2e958a78648f8bfc54c956ecbcdab4c0c2888
refs/heads/master
2021-01-12T18:58:36.977553
2016-01-09T19:01:54
2016-01-09T19:01:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,697
java
/** * The FreeBSD Copyright * Copyright 1994-2008 The FreeBSD Project. All rights reserved. * Copyright (C) 2013-2015 Philip Helger philip[at]helger[dot]com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``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 FREEBSD PROJECT 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. * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as representing * official policies, either expressed or implied, of the FreeBSD Project. */ package com.helger.as2lib.processor.resender; import java.util.Date; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; import javax.annotation.concurrent.Immutable; import com.helger.as2lib.message.IMessage; import com.helger.commons.ValueEnforcer; import com.helger.commons.annotation.Nonempty; /** * This class represents a single in-memory item to be resend. * * @author Philip Helger * @since 2.2.0 */ @Immutable public class ResendItem { private final String m_sResendAction; private final int m_nRetries; private final IMessage m_aMsg; private final long m_nEarliestResendDateMS; public ResendItem (@Nonnull @Nonempty final String sResendAction, @Nonnegative final int nRetries, @Nonnull final IMessage aMsg, @Nonnegative final long nResendDelayMS) { m_sResendAction = ValueEnforcer.notEmpty (sResendAction, "ResendAction"); m_nRetries = ValueEnforcer.isGE0 (nRetries, "Retries"); m_aMsg = ValueEnforcer.notNull (aMsg, "Message"); ValueEnforcer.isGE0 (nResendDelayMS, "ResendDelayMS"); m_nEarliestResendDateMS = new Date ().getTime () + nResendDelayMS; } /** * @return The internal action to be taken. */ @Nonnull @Nonempty public String getResendAction () { return m_sResendAction; } /** * @return The number of retries already performed (does not include the * original try!) */ @Nonnegative public int getRetries () { return m_nRetries; } /** * @return The message to be resend */ @Nonnull public IMessage getMessage () { return m_aMsg; } /** * @return The date the resend must not happen before */ @Nonnull public Date getEarliestResendDate () { return new Date (m_nEarliestResendDateMS); } /** * @return <code>true</code> if this message can be resend now. */ public boolean isTimeToSend () { return m_nEarliestResendDateMS <= new Date ().getTime (); } }
[ "philip@helger.com" ]
philip@helger.com
ec35d4086b06b4f05e3257f900c72560a72ea501
45981f7c5487bc62cd08622498ec1baf180d54dd
/src/main/java/com/google/gson/internal/bind/MapTypeAdapterFactory.java
302cf2f0b6e526a1f1a0c337079e3a2621bc59b5
[]
no_license
TaintBench/fakedaum
51f38606a83edda1c39d988e498c090b972f852d
c957a216e1eb2a5372bca075f58f7eef2d8bb4a1
refs/heads/master
2021-07-22T03:23:13.759714
2021-07-16T11:38:24
2021-07-16T11:38:24
234,357,307
0
0
null
null
null
null
UTF-8
Java
false
false
6,767
java
package com.google.gson.internal.bind; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; import com.google.gson.JsonSyntaxException; import com.google.gson.internal.C$Gson$Types; import com.google.gson.internal.ConstructorConstructor; import com.google.gson.internal.ObjectConstructor; import com.google.gson.internal.Streams; import com.google.gson.internal.bind.TypeAdapter.Factory; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonToken; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Map.Entry; public final class MapTypeAdapterFactory implements Factory { /* access modifiers changed from: private|final */ public final boolean complexMapKeySerialization; private final ConstructorConstructor constructorConstructor; private final class Adapter<K, V> extends TypeAdapter<Map<K, V>> { private final ObjectConstructor<? extends Map<K, V>> constructor; private final TypeAdapter<K> keyTypeAdapter; private final TypeAdapter<V> valueTypeAdapter; public Adapter(MiniGson context, Type keyType, TypeAdapter<K> keyTypeAdapter, Type valueType, TypeAdapter<V> valueTypeAdapter, ObjectConstructor<? extends Map<K, V>> constructor) { this.keyTypeAdapter = new TypeAdapterRuntimeTypeWrapper(context, keyTypeAdapter, keyType); this.valueTypeAdapter = new TypeAdapterRuntimeTypeWrapper(context, valueTypeAdapter, valueType); this.constructor = constructor; } public Map<K, V> read(JsonReader reader) throws IOException { JsonToken peek = reader.peek(); if (peek == JsonToken.NULL) { reader.nextNull(); return null; } Map<K, V> map = (Map) this.constructor.construct(); K key; if (peek == JsonToken.BEGIN_ARRAY) { reader.beginArray(); while (reader.hasNext()) { reader.beginArray(); key = this.keyTypeAdapter.read(reader); if (map.put(key, this.valueTypeAdapter.read(reader)) != null) { throw new JsonSyntaxException("duplicate key: " + key); } reader.endArray(); } reader.endArray(); return map; } reader.beginObject(); while (reader.hasNext()) { key = this.keyTypeAdapter.fromJsonElement(new JsonPrimitive(reader.nextName())); if (map.put(key, this.valueTypeAdapter.read(reader)) != null) { throw new JsonSyntaxException("duplicate key: " + key); } } reader.endObject(); return map; } public void write(JsonWriter writer, Map<K, V> map) throws IOException { if (map == null) { writer.nullValue(); } else if (MapTypeAdapterFactory.this.complexMapKeySerialization) { boolean hasComplexKeys = false; List<JsonElement> keys = new ArrayList(map.size()); List<V> values = new ArrayList(map.size()); for (Entry<K, V> entry : map.entrySet()) { JsonElement keyElement = this.keyTypeAdapter.toJsonElement(entry.getKey()); keys.add(keyElement); values.add(entry.getValue()); int i = (keyElement.isJsonArray() || keyElement.isJsonObject()) ? 1 : 0; hasComplexKeys |= i; } int i2; if (hasComplexKeys) { writer.beginArray(); for (i2 = 0; i2 < keys.size(); i2++) { writer.beginArray(); Streams.write((JsonElement) keys.get(i2), writer); this.valueTypeAdapter.write(writer, values.get(i2)); writer.endArray(); } writer.endArray(); return; } writer.beginObject(); for (i2 = 0; i2 < keys.size(); i2++) { writer.name(keyToString((JsonElement) keys.get(i2))); this.valueTypeAdapter.write(writer, values.get(i2)); } writer.endObject(); } else { writer.beginObject(); for (Entry<K, V> entry2 : map.entrySet()) { writer.name(String.valueOf(entry2.getKey())); this.valueTypeAdapter.write(writer, entry2.getValue()); } writer.endObject(); } } private String keyToString(JsonElement keyElement) { if (keyElement.isJsonPrimitive()) { JsonPrimitive primitive = keyElement.getAsJsonPrimitive(); if (primitive.isNumber()) { return String.valueOf(primitive.getAsNumber()); } if (primitive.isBoolean()) { return Boolean.toString(primitive.getAsBoolean()); } if (primitive.isString()) { return primitive.getAsString(); } throw new AssertionError(); } else if (keyElement.isJsonNull()) { return "null"; } else { throw new AssertionError(); } } } public MapTypeAdapterFactory(ConstructorConstructor constructorConstructor, boolean complexMapKeySerialization) { this.constructorConstructor = constructorConstructor; this.complexMapKeySerialization = complexMapKeySerialization; } public <T> TypeAdapter<T> create(MiniGson context, TypeToken<T> typeToken) { Type type = typeToken.getType(); if (!Map.class.isAssignableFrom(typeToken.getRawType())) { return null; } Type[] keyAndValueTypes = C$Gson$Types.getMapKeyAndValueTypes(type, C$Gson$Types.getRawType(type)); return new Adapter(context, keyAndValueTypes[0], getKeyAdapter(context, keyAndValueTypes[0]), keyAndValueTypes[1], context.getAdapter(TypeToken.get(keyAndValueTypes[1])), this.constructorConstructor.getConstructor(typeToken)); } private TypeAdapter<?> getKeyAdapter(MiniGson context, Type keyType) { return (keyType == Boolean.TYPE || keyType == Boolean.class) ? TypeAdapters.BOOLEAN_AS_STRING : context.getAdapter(TypeToken.get(keyType)); } }
[ "malwareanalyst1@gmail.com" ]
malwareanalyst1@gmail.com
81c602c12358803482a910dea27232a82b27895f
b9a71bb2805d5f0d5ac98c59d984246463285d34
/testing/droolsjbpm-integration-master/kie-maven-plugin/src/test/java/org/kie/maven/plugin/AdditionalPropertiesIntegrationTest.java
e8a2806706ccc011be38d00d6e5ed4c4d7583e52
[ "MIT" ]
permissive
rokn/Count_Words_2015
486f3b292954adc76c9bcdbf9a37eb07421ddd2a
e07f6fc9dfceaf773afc0c3a614093e16a0cde16
refs/heads/master
2021-01-10T04:23:49.999237
2016-01-11T19:53:31
2016-01-11T19:53:31
48,538,207
1
1
null
null
null
null
UTF-8
Java
false
false
1,758
java
/* * Copyright 2015 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * 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.kie.maven.plugin; import io.takari.maven.testing.executor.MavenExecutionResult; import io.takari.maven.testing.executor.MavenRuntime; import org.junit.Test; import java.io.File; public class AdditionalPropertiesIntegrationTest extends KieMavenPluginBaseIntegrationTest { public AdditionalPropertiesIntegrationTest(MavenRuntime.MavenRuntimeBuilder builder) throws Exception { super(builder); } @Test public void testAdditionalPropertiesCorrectlySet() throws Exception { File basedir = resources.getBasedir("kjar-3-properties-only"); MavenExecutionResult result = mavenRuntime .forProject(basedir) .execute("clean", "install"); result.assertErrorFreeLog(); // additional properties are logged during debug (-X) build // following string is created directly inside the KIE Maven plugin execution (the property names and values // are logged multiple by maven itself as well, so we should check directly against that string) result.assertLogText("Additional system properties: {drools.dialect.java.compiler.lnglevel=1.6, my.property=some-value}"); } }
[ "marto_dimitrov@mail.bg" ]
marto_dimitrov@mail.bg
e186feb81f7649681ee95188ad3b591e81215ade
35639eaf326d315149905ad38c34211d3b88e76f
/src/Day46_JavaRecap/MorningWorkOut.java
53052133399f5a5fe701fd4d30dd5a18231471d4
[]
no_license
blackpars4x4/JavaProgramming2020_B21
3e761061d8182660b42d9d317fefd0c5ca5c0d25
eac69380e156abe0433358423ecd5937eba8d719
refs/heads/master
2023-03-03T22:33:50.436451
2021-02-10T16:36:25
2021-02-10T16:36:25
306,726,974
1
0
null
2020-11-20T05:22:51
2020-10-23T19:17:48
Java
UTF-8
Java
false
false
606
java
package Day46_JavaRecap; public class MorningWorkOut { public static void main(String[] args) { for(int i = 1; i <=30; i++) { System.out.println("Puch Up" + i); sleep(1.5); } System.out.println("==================================================="); for(int i = 1; i <=20; i++){ System.out.println("Pull Up " + i); sleep(2.5); } } public static void sleep(double seconds) { try { Thread.sleep((long) (seconds * 1000)); }catch(InterruptedException e) { } } }
[ "55367496+blackpars4x4@users.noreply.github.com" ]
55367496+blackpars4x4@users.noreply.github.com
185a9685aa81ec2f81303b8542707a5ed6e83edc
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/mpserverless-20190615/src/main/java/com/aliyun/mpserverless20190615/models/DescribeFCOpenStatusResponseBody.java
a4347d8d327d5f314e91dafc28a82c8e38b4f177
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
958
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.mpserverless20190615.models; import com.aliyun.tea.*; public class DescribeFCOpenStatusResponseBody extends TeaModel { @NameInMap("RequestId") public String requestId; @NameInMap("Status") public String status; public static DescribeFCOpenStatusResponseBody build(java.util.Map<String, ?> map) throws Exception { DescribeFCOpenStatusResponseBody self = new DescribeFCOpenStatusResponseBody(); return TeaModel.build(map, self); } public DescribeFCOpenStatusResponseBody setRequestId(String requestId) { this.requestId = requestId; return this; } public String getRequestId() { return this.requestId; } public DescribeFCOpenStatusResponseBody setStatus(String status) { this.status = status; return this; } public String getStatus() { return this.status; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
5d4d84be8917a59f5637c4fffffced0fe8d05b0f
0e06e096a9f95ab094b8078ea2cd310759af008b
/classes64-dex2jar/com/applovin/impl/adview/bj.java
2b8adfc98f98d345ba979d3738ccc564fab073fb
[]
no_license
Manifold0/adcom_decompile
4bc2907a057c73703cf141dc0749ed4c014ebe55
fce3d59b59480abe91f90ba05b0df4eaadd849f7
refs/heads/master
2020-05-21T02:01:59.787840
2019-05-10T00:36:27
2019-05-10T00:36:27
185,856,424
1
2
null
2019-05-10T00:36:28
2019-05-09T19:04:28
Java
UTF-8
Java
false
false
387
java
// // Decompiled by Procyon v0.5.34 // package com.applovin.impl.adview; import android.view.View; class bj implements Runnable { final /* synthetic */ cm a; final /* synthetic */ az b; bj(final az b, final cm a) { this.b = b; this.a = a; } @Override public void run() { this.b.a((View)this.b.G, false, this.a.h()); } }
[ "querky1231@gmail.com" ]
querky1231@gmail.com
cb30f59a7fe1c9911950e3b711f8eab711f68ac1
4a8f954b68f096d837b1fdd1912c0e1f80404497
/json/src/test/java/com/fasterxml/jackson/jakarta/rs/json/TestSerializeWithoutAutoflush.java
6a9d15c515639152bf23eaddfe61a58338c23f09
[ "Apache-2.0" ]
permissive
GedMarc/jackson-jakarta-rs-providers
b21095e7eb9a17658febfd1988fcc2472b347cc5
19a86dffacbf9c8aca05eb407d30b58f69f979da
refs/heads/master
2023-06-01T20:43:31.283622
2021-05-31T17:40:08
2021-05-31T17:40:08
377,587,349
0
0
Apache-2.0
2021-06-20T22:35:18
2021-06-16T18:09:51
null
UTF-8
Java
false
false
1,905
java
package com.fasterxml.jackson.jakarta.rs.json; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.List; import jakarta.ws.rs.core.MediaType; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.DefaultTyping; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.jakarta.rs.json.testutil.NoCheckSubTypeValidator; /** * Unit test to check that ProviderBase always writes its content, even if flush-after-write is off. */ public class TestSerializeWithoutAutoflush extends JakartaRSTestBase { static class Simple { protected List<String> list; public List<String> getList( ) { return list; } public void setList(List<String> l) { list = l; } } public void testCanSerialize() throws IOException { JsonMapper mapper = JsonMapper.builder() .disable(SerializationFeature.FLUSH_AFTER_WRITE_VALUE) .activateDefaultTyping(NoCheckSubTypeValidator.instance, DefaultTyping.NON_FINAL, JsonTypeInfo.As.WRAPPER_ARRAY) .build(); JacksonJsonProvider provider = new JacksonJsonProvider(mapper); // construct test object List<String> l = new ArrayList<String>(); l.add("foo"); l.add("bar"); Simple s = new Simple(); s.setList(l); ByteArrayOutputStream stream = new ByteArrayOutputStream(); provider.writeTo(s, Simple.class, Simple.class, new Annotation[0], MediaType.APPLICATION_JSON_TYPE, null, stream); Simple result = mapper.readValue(stream.toByteArray(), Simple.class); assertNotNull(result.list); assertEquals(2, result.list.size()); } }
[ "tatu.saloranta@iki.fi" ]
tatu.saloranta@iki.fi
1a56697b406837bae47dc481cfc06d95c59ba0a1
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE601_Open_Redirect/CWE601_Open_Redirect__Servlet_database_05.java
bc1201ae6d2a429ec66d6ab9f3a99090818d2666
[]
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
7,816
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE601_Open_Redirect__Servlet_database_05.java Label Definition File: CWE601_Open_Redirect__Servlet.label.xml Template File: sources-sink-05.tmpl.java */ /* * @description * CWE: 601 Open Redirect * BadSource: database Read data from a database * GoodSource: A hardcoded string * BadSink: place redirect string directly into redirect api call * Flow Variant: 05 Control flow: if(privateTrue) and if(privateFalse) * * */ package testcases.CWE601_Open_Redirect; import testcasesupport.*; import javax.servlet.http.*; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.logging.Level; import java.net.URI; import java.net.URISyntaxException; public class CWE601_Open_Redirect__Servlet_database_05 extends AbstractTestCaseServlet { /* The two variables below are not defined as "final", but are never * assigned any other value, so a tool should be able to identify that * reads of these will always return their initialized values. */ private boolean privateTrue = true; private boolean privateFalse = false; /* uses badsource and badsink */ public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data; if (privateTrue) { data = ""; /* Initialize data */ /* Read data from a database */ { Connection connection = null; PreparedStatement preparedStatement = null; ResultSet resultSet = null; try { /* setup the connection */ connection = IO.getDBConnection(); /* prepare and execute a (hardcoded) query */ preparedStatement = connection.prepareStatement("select name from users where id=0"); resultSet = preparedStatement.executeQuery(); /* POTENTIAL FLAW: Read data from a database query resultset */ data = resultSet.getString(1); } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error with SQL statement", exceptSql); } finally { /* Close database objects */ try { if (resultSet != null) { resultSet.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing ResultSet", exceptSql); } try { if (preparedStatement != null) { preparedStatement.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing PreparedStatement", exceptSql); } try { if (connection != null) { connection.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql); } } } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure data is inititialized before the Sink to avoid compiler errors */ data = null; } if (data != null) { /* This prevents \r\n (and other chars) and should prevent incidentals such * as HTTP Response Splitting and HTTP Header Injection. */ URI uri; try { uri = new URI(data); } catch (URISyntaxException exceptURISyntax) { response.getWriter().write("Invalid redirect URL"); return; } /* POTENTIAL FLAW: redirect is sent verbatim; escape the string to prevent ancillary issues like XSS, Response splitting etc */ response.sendRedirect(data); return; } } /* goodG2B1() - use goodsource and badsink by changing privateTrue to privateFalse */ private void goodG2B1(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data; if (privateFalse) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure data is inititialized before the Sink to avoid compiler errors */ data = null; } else { /* FIX: Use a hardcoded string */ data = "foo"; } if (data != null) { /* This prevents \r\n (and other chars) and should prevent incidentals such * as HTTP Response Splitting and HTTP Header Injection. */ URI uri; try { uri = new URI(data); } catch (URISyntaxException exceptURISyntax) { response.getWriter().write("Invalid redirect URL"); return; } /* POTENTIAL FLAW: redirect is sent verbatim; escape the string to prevent ancillary issues like XSS, Response splitting etc */ response.sendRedirect(data); return; } } /* goodG2B2() - use goodsource and badsink by reversing statements in if */ private void goodG2B2(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data; if (privateTrue) { /* FIX: Use a hardcoded string */ data = "foo"; } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure data is inititialized before the Sink to avoid compiler errors */ data = null; } if (data != null) { /* This prevents \r\n (and other chars) and should prevent incidentals such * as HTTP Response Splitting and HTTP Header Injection. */ URI uri; try { uri = new URI(data); } catch (URISyntaxException exceptURISyntax) { response.getWriter().write("Invalid redirect URL"); return; } /* POTENTIAL FLAW: redirect is sent verbatim; escape the string to prevent ancillary issues like XSS, Response splitting etc */ response.sendRedirect(data); return; } } public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable { goodG2B1(request, response); goodG2B2(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
93f98c3edaaa83175d580e478ba18c785c6fab01
8ecd7816544483fa7680966e70a3bb6fb7fb09d0
/CoreGame/src/main/java/com/game/core/room/ddz/DDzTable.java
c200fa01c7afb380cbb838428a893d29148d54c9
[]
no_license
billee1011/LGameQiPai
d99fc66bdab8fd9c60378b6b95a829a4c2679ef4
67c91f888ba7c0b9c636c608b8c0d7d3fb72f2eb
refs/heads/master
2021-04-09T17:03:55.541135
2017-07-24T01:49:27
2017-07-24T01:49:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,874
java
package com.game.core.room.ddz; import com.game.core.factory.TableProducer; import com.game.socket.module.UserVistor; import com.game.core.room.BaseChairInfo; import com.game.core.room.StepHistory; import com.game.core.room.BaseTableVo; import com.lsocket.message.Response; import com.module.net.NetGame; /** * Created by leroy:656515489@qq.com * 2017/4/19. */ public class DDzTable extends BaseTableVo<DdzStatus,BaseChairInfo> { private int guildUid; public DDzTable(int ownerId, int maxSize, int id, int gameId, TableProducer tableProducer) { super(ownerId,maxSize,id, DdzStatus.Idle,gameId,tableProducer); } @Override protected void initStatus() { this.setAllStatus(new DdzStatus[]{DdzStatus.Idle,DdzStatus.FaPai,DdzStatus.Score,DdzStatus.Game}); } @Override protected void initChair(int maxSize) { } @Override public void cleanTableCache() { } @Override protected void initCalculator() { } @Override public int getGameResponseCmd() { return 0; } @Override public int getGameResponseModule() { return 0; } @Override public NetGame.NetExtraData.Builder getTableExtrData(int roleId) { return null; } @Override protected NetGame.NetExtraData getOtherNetExtraData(BaseChairInfo baseChairInfo) { return null; } @Override protected NetGame.NetExtraData getSelfNetExtraData(BaseChairInfo baseChairInfo) { return null; } @Override protected Response getGameOverResult() { return Response.defaultResponse(0,0); } @Override public BaseChairInfo createChair(UserVistor visitor) { return null; } public int getGuildUid() { return guildUid; } public void setGuildUid(int guildUid) { this.guildUid = guildUid; } }
[ "wlvxiaohui@163.com" ]
wlvxiaohui@163.com
a405a8a707e02ce640c9cb2adaa7269b8473079b
eb9f655206c43c12b497c667ba56a0d358b6bc3a
/plugins/kotlin/idea/tests/testData/refactoring/safeDelete/deleteValueParameter/kotlinValueParameterWithJava/lambdaArgExt.java
df9bf8f2cd3ccae969993a8cca6d5aa941434e0d
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
JetBrains/intellij-community
2ed226e200ecc17c037dcddd4a006de56cd43941
05dbd4575d01a213f3f4d69aa4968473f2536142
refs/heads/master
2023-09-03T17:06:37.560889
2023-09-03T11:51:00
2023-09-03T12:12:27
2,489,216
16,288
6,635
Apache-2.0
2023-09-12T07:41:58
2011-09-30T13:33:05
null
UTF-8
Java
false
false
284
java
package test; class A { void bar() { LambdaArgExtKt.foo( "", 10, new Function1<Integer, Unit>() { public Unit invoke(Integer n) { System.out.println(n); } } ); } }
[ "intellij-monorepo-bot-no-reply@jetbrains.com" ]
intellij-monorepo-bot-no-reply@jetbrains.com
405dd7672636625ac08baa2d1fd343e04a75771b
fcfcfccc2db5cc08c2e634c0bdd055fe1fd2699c
/entity/pyx-entity-rdb/src/test/java/com/pyx4j/entity/rdb/mysql/DDLTest.java
e65a2401504f9fe9221ddeba9d1fcf54adf3ac8a
[]
no_license
michaellif/pyx4j
45ae006e8785e5a245a619ad9b43d5c9946a86d4
cc8699d5d70ba618ec812b963e338d4bbe39df20
refs/heads/master
2020-03-26T06:10:36.655951
2016-04-29T05:25:25
2016-04-29T05:25:25
144,593,106
0
1
null
null
null
null
UTF-8
Java
false
false
1,075
java
/* * Pyx4j framework * Copyright (C) 2008-2010 pyx4j.com. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. * * Created on Jul 12, 2010 * @author vlads */ package com.pyx4j.entity.rdb.mysql; import com.pyx4j.entity.rdb.DDLTestCase; import com.pyx4j.entity.rdb.PersistenceEnvironmentFactory; import com.pyx4j.entity.test.server.PersistenceEnvironment; public class DDLTest extends DDLTestCase { @Override protected PersistenceEnvironment getPersistenceEnvironment() { return PersistenceEnvironmentFactory.getMySQLPersistenceEnvironment(); } }
[ "vlads@propertyvista.com" ]
vlads@propertyvista.com
ab0a5b16d5f54a3e664466fa03d4e3c7c58e88ae
76e7b70479cf0d86e42316aaac96fd2cc1fd3085
/src/main/java/betterquesting/client/gui/GuiQuestLinesMain.java
742aa1bbf364782decb97bf6ee42b964310171dc
[]
no_license
legendblade/BetterQuesting
3d2282f8305dd4852a3d24a628646e6f5ffd9d1c
50485167af3356cf7d4998963c95261893d3bf88
refs/heads/1.9
2021-01-15T22:34:30.736717
2016-05-30T22:56:36
2016-05-30T22:56:36
60,042,989
0
0
null
2016-05-30T22:44:32
2016-05-30T22:44:32
null
UTF-8
Java
false
false
6,751
java
package betterquesting.client.gui; import java.io.IOException; import java.util.ArrayList; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.resources.I18n; import net.minecraft.util.math.MathHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.input.Mouse; import betterquesting.client.gui.editors.GuiQuestLineEditorA; import betterquesting.client.gui.misc.GuiButtonQuestInstance; import betterquesting.client.gui.misc.GuiButtonQuestLine; import betterquesting.client.gui.misc.GuiButtonQuesting; import betterquesting.client.gui.misc.GuiScrollingText; import betterquesting.client.themes.ThemeRegistry; import betterquesting.quests.QuestDatabase; import betterquesting.quests.QuestLine; @SideOnly(Side.CLIENT) public class GuiQuestLinesMain extends GuiQuesting { /** * Last opened quest screen from here */ public static GuiQuestInstance bookmarked; GuiButtonQuestLine selected; ArrayList<GuiButtonQuestLine> qlBtns = new ArrayList<GuiButtonQuestLine>(); int listScroll = 0; int maxRows = 0; GuiQuestLinesEmbedded qlGui; GuiScrollingText qlDesc; public GuiQuestLinesMain(GuiScreen parent) { super(parent, I18n.format("betterquesting.title.quest_lines")); } @Override public void initGui() { super.initGui(); bookmarked = null; qlBtns.clear(); listScroll = 0; maxRows = (sizeY - 64)/20; if(QuestDatabase.editMode) { ((GuiButton)this.buttonList.get(0)).xPosition = this.width/2 - 100; ((GuiButton)this.buttonList.get(0)).width = 100; } GuiButtonQuesting btnEdit = new GuiButtonQuesting(1, this.width/2, this.guiTop + this.sizeY - 16, 100, 20, I18n.format("betterquesting.btn.edit")); btnEdit.enabled = btnEdit.visible = QuestDatabase.editMode; this.buttonList.add(btnEdit); GuiQuestLinesEmbedded oldGui = qlGui; qlGui = new GuiQuestLinesEmbedded(this, guiLeft + 174, guiTop + 32, sizeX - (32 + 150 + 8), sizeY - 64 - 32); qlDesc = new GuiScrollingText(this, sizeX - (32 + 150 + 8), 48, guiTop + 32 + sizeY - 64 - 32, guiLeft + 174); boolean reset = true; int i = 0; for(int j = 0; j < QuestDatabase.questLines.size(); j++) { QuestLine line = QuestDatabase.questLines.get(j); GuiButtonQuestLine btnLine = new GuiButtonQuestLine(buttonList.size(), this.guiLeft + 16, this.guiTop + 32 + i, 142, 20, line); btnLine.enabled = line.questList.size() <= 0 || QuestDatabase.editMode; if(selected != null && selected.line.name.equals(line.name)) { reset = false; selected = btnLine; } if(!btnLine.enabled) { for(GuiButtonQuestInstance p : btnLine.buttonTree) { if((p.quest.isComplete(mc.thePlayer.getUniqueID()) || p.quest.isUnlocked(mc.thePlayer.getUniqueID())) && (selected == null || selected.line != line)) { btnLine.enabled = true; break; } } } buttonList.add(btnLine); qlBtns.add(btnLine); i += 20; } if(reset || selected == null) { selected = null; } else { qlDesc.SetText(selected.line.description); qlGui.setQuestLine(selected); } if(oldGui != null) // Preserve old settings { qlGui.zoom = oldGui.zoom; qlGui.scrollX = oldGui.scrollX; qlGui.scrollY = oldGui.scrollY; qlGui.toolType = oldGui.toolType; qlGui.dragSnap = oldGui.dragSnap; qlGui.refreshToolButtons(); } UpdateScroll(); } @Override public void drawScreen(int mx, int my, float partialTick) { super.drawScreen(mx, my, partialTick); if(QuestDatabase.updateUI) { QuestDatabase.updateUI = false; this.initGui(); } GlStateManager.color(1F, 1F, 1F, 1F); this.mc.renderEngine.bindTexture(ThemeRegistry.curTheme().guiTexture()); this.drawTexturedModalRect(this.guiLeft + 16 + 142, this.guiTop + 32, 248, 0, 8, 20); int i = 20; while(i < sizeY - 84) { this.drawTexturedModalRect(this.guiLeft + 16 + 142, this.guiTop + 32 + i, 248, 20, 8, 20); i += 20; } this.drawTexturedModalRect(this.guiLeft + 16 + 142, this.guiTop + 32 + i, 248, 40, 8, 20); this.drawTexturedModalRect(guiLeft + 16 + 142, this.guiTop + 32 + (int)Math.max(0, i * (float)listScroll/(float)(qlBtns.size() - maxRows)), 248, 60, 8, 20); if(qlGui != null && qlDesc != null) { GlStateManager.pushMatrix(); GlStateManager.color(1F, 1F, 1F, 1f); qlDesc.drawScreen(mx, my, partialTick); GlStateManager.popMatrix(); GlStateManager.pushMatrix(); GlStateManager.color(1F, 1F, 1F, 1f); GlStateManager.enableDepth(); qlGui.drawGui(mx, my, partialTick); GlStateManager.popMatrix(); } } @Override public void actionPerformed(GuiButton button) { super.actionPerformed(button); if(button.id == 1) { mc.displayGuiScreen(new GuiQuestLineEditorA(this)); // Quest line editor } else if(button instanceof GuiButtonQuestLine) { if(selected != null) { selected.enabled = true; } button.enabled = false; selected = (GuiButtonQuestLine)button; if(selected != null) { qlDesc.SetText(I18n.format(selected.line.description)); qlGui.setQuestLine(selected); } } } @Override protected void mouseClicked(int mx, int my, int type) throws IOException { super.mouseClicked(mx, my, type); if(qlGui != null && type == 0) { GuiButtonQuestInstance qBtn = qlGui.getClickedQuest(mx, my); if(qBtn != null) { qBtn.playPressSound(this.mc.getSoundHandler()); bookmarked = new GuiQuestInstance(this, qBtn.quest); mc.displayGuiScreen(bookmarked); } } } @Override public void handleMouseInput() throws IOException { super.handleMouseInput(); int mx = Mouse.getEventX() * this.width / this.mc.displayWidth; int my = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; int SDX = (int)-Math.signum(Mouse.getEventDWheel()); if(SDX != 0 && isWithin(mx, my, this.guiLeft, this.guiTop, 166, sizeY)) { listScroll = Math.max(0, MathHelper.clamp_int(listScroll + SDX, 0, qlBtns.size() - maxRows)); UpdateScroll(); } if(qlGui != null) { qlGui.handleMouse(); } } public void UpdateScroll() { // All buttons are required to be present due to the button trees // These are hidden and moved as necessary for(int i = 0; i < qlBtns.size(); i++) { GuiButtonQuestLine btn = qlBtns.get(i); int n = i - listScroll; if(n < 0 || n >= maxRows) { btn.visible = false; } else { btn.visible = true; btn.yPosition = this.guiTop + 32 + n*20; } } } }
[ "FunwayguyEmail@gmail.com" ]
FunwayguyEmail@gmail.com
1a8dd35fcf677fbb21555af3d2220d130f4c7c70
409bdfcaa53e73a69c816da3605001c6e0e7042d
/1.JavaSyntax/src/com/javarush/task/task07/task0715/Solution.java
cce0fd2ce907c9e2834c26d2da011e45cbb69d9b
[]
no_license
sebelousov/javarushtasks
2a4c8ebcdba94196276b61688bb73ccf2cad039e
2710a327278ba04b40637cd5918491ef70ced117
refs/heads/master
2023-03-25T09:41:19.840213
2021-03-24T13:56:49
2021-03-24T13:56:49
351,092,038
0
0
null
null
null
null
UTF-8
Java
false
false
747
java
package com.javarush.task.task07.task0715; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; /* Продолжаем мыть раму */ public class Solution { public static void main(String[] args) throws Exception { String[] strings = {"мама", "мыла", "раму"}; String wordImenno = "именно"; ArrayList<String> strings1 = new ArrayList<String>(); for (int i = 0; i < strings.length; i++){ strings1.add(strings[i]); strings1.add(wordImenno); } for (int j = 0; j < strings1.size(); j++){ System.out.println(strings1.get(j)); } //напишите тут ваш код } }
[ "bsn@list.ru" ]
bsn@list.ru
ede4a84472065f6303274269fb6fda7b6ed926bc
9d499167cf53db4ab0be4b6ca613cbadf80d99c4
/huaifang-platform/src/main/java/com/topie/huaifang/core/api/mobile/MoPartyController.java
a770a667ad688f0593ff5d3da4e7bae866da5a2e
[]
no_license
topie/huaifang-admin
f789834452c0fabd48e2541d04e77fbf8ecb5933
98c9865e6fd9786974a164e6ce251816e3aa9beb
refs/heads/master
2021-01-17T14:29:57.268401
2017-12-21T09:37:55
2017-12-21T09:37:55
94,725,663
0
1
null
null
null
null
UTF-8
Java
false
false
7,629
java
package com.topie.huaifang.core.api.mobile; import com.github.pagehelper.PageInfo; import com.topie.huaifang.common.utils.PageConvertUtil; import com.topie.huaifang.common.utils.ResponseUtil; import com.topie.huaifang.common.utils.Result; import com.topie.huaifang.core.service.*; import com.topie.huaifang.database.core.model.*; import com.topie.huaifang.security.utils.SecurityUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import java.util.ArrayList; import java.util.List; /** * Created by chenguojun on 2017/4/19. */ @Controller @RequestMapping("/api/m/party") public class MoPartyController { @Autowired private IPartyMembersActivityService iPartyMembersActivityService; @Autowired private IPartyMembersInfoService iPartyMembersInfoService; @Autowired private IPartyMembersBusinessService iPartyMembersBusinessService; @Autowired private IAppUserService iAppUserService; @Autowired private IPartyActivityJoinService iPartyActivityJoinService; @RequestMapping(value = "/activity/list", method = RequestMethod.GET) @ResponseBody public Result activityList(PartyMembersActivity partyMembersActivity, @RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", required = false, defaultValue = "15") int pageSize) { PageInfo<PartyMembersActivity> pageInfo = iPartyMembersActivityService .selectByFilterAndPage(partyMembersActivity, pageNum, pageSize); if(pageNum>pageInfo.getPages()){ return ResponseUtil.success(PageConvertUtil.grid(new ArrayList<>())); } for (PartyMembersActivity membersActivity : pageInfo.getList()) { PartyActivityJoin partyActivityJoin = new PartyActivityJoin(); partyActivityJoin.setActivityId(membersActivity.getId()); membersActivity.setTotal(iPartyActivityJoinService.selectByFilter(partyActivityJoin).size()); } return ResponseUtil.success(PageConvertUtil.grid(pageInfo)); } @RequestMapping(value = "/activity/detail", method = RequestMethod.GET) @ResponseBody public Result activityDetail(@RequestParam(value = "id") Integer id) { Integer userId = SecurityUtil.getCurrentUserId(); if (userId == null) return ResponseUtil.error(401, "未登录"); AppUser appUser = iAppUserService.selectByPlatformId(userId); if (appUser == null) return ResponseUtil.error("用户不存在"); PartyMembersActivity partyMembersActivity = iPartyMembersActivityService.selectByKey(id); PartyActivityJoin partyActivityJoin = new PartyActivityJoin(); partyActivityJoin.setActivityId(partyMembersActivity.getId()); partyMembersActivity.setTotal(iPartyActivityJoinService.selectByFilter(partyActivityJoin).size()); partyActivityJoin.setUserId(appUser.getId()); if (iPartyActivityJoinService.selectByFilter(partyActivityJoin).size() > 0) { partyMembersActivity.setHasJoin(true); } else { partyMembersActivity.setHasJoin(false); } return ResponseUtil.success(partyMembersActivity); } @RequestMapping(value = "/activity/post", method = RequestMethod.POST) @ResponseBody public Result activityPost(PartyMembersActivity partyMembersActivity) { Integer userId = SecurityUtil.getCurrentUserId(); if (userId == null) return ResponseUtil.error(401, "未登录"); AppUser appUser = iAppUserService.selectByPlatformId(userId); if (appUser == null) return ResponseUtil.error("用户不存在"); partyMembersActivity.setTotal(0); partyMembersActivity.setStatus(1); partyMembersActivity.setPublishUserId(appUser.getId()); partyMembersActivity.setPublishUser(appUser.getRealname()); iPartyMembersActivityService.saveNotNull(partyMembersActivity); return ResponseUtil.success(); } @RequestMapping(value = "/activity/join", method = RequestMethod.GET) @ResponseBody public Result activityJoin(@RequestParam(value = "id") Integer id) { Integer userId = SecurityUtil.getCurrentUserId(); if (userId == null) return ResponseUtil.error(401, "未登录"); AppUser appUser = iAppUserService.selectByPlatformId(userId); if (appUser == null) return ResponseUtil.error("用户不存在"); PartyActivityJoin partyActivityJoin = new PartyActivityJoin(); partyActivityJoin.setActivityId(id); partyActivityJoin.setUserId(appUser.getId()); if (iPartyActivityJoinService.selectByFilter(partyActivityJoin).size() > 0) { return ResponseUtil.success(); } iPartyActivityJoinService.saveNotNull(partyActivityJoin); return ResponseUtil.success(); } @RequestMapping(value = "/activity/cancelJoin", method = RequestMethod.GET) @ResponseBody public Result cancelJoin(@RequestParam(value = "id") Integer id) { Integer userId = SecurityUtil.getCurrentUserId(); if (userId == null) return ResponseUtil.error(401, "未登录"); AppUser appUser = iAppUserService.selectByPlatformId(userId); if (appUser == null) return ResponseUtil.error("用户不存在"); PartyActivityJoin partyActivityJoin = new PartyActivityJoin(); partyActivityJoin.setActivityId(id); partyActivityJoin.setUserId(appUser.getId()); List<PartyActivityJoin> list = iPartyActivityJoinService.selectByFilter(partyActivityJoin); if (list.size() > 0) { for (PartyActivityJoin activityJoin : list) { iPartyActivityJoinService.delete(activityJoin); } } return ResponseUtil.success(); } @RequestMapping(value = "/member/list", method = RequestMethod.GET) @ResponseBody public Result infoList(PartyMembersInfo partyMembersInfo) { List<PartyMembersInfo> list = iPartyMembersInfoService.selectByFilter(partyMembersInfo); return ResponseUtil.success(PageConvertUtil.grid(list)); } @RequestMapping(value = "/business/list", method = RequestMethod.GET) @ResponseBody public Result businessList(PartyMembersBusiness partyMembersBusiness, @RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", required = false, defaultValue = "15") int pageSize) { PageInfo<PartyMembersBusiness> pageInfo = iPartyMembersBusinessService .selectByFilterAndPage(partyMembersBusiness, pageNum, pageSize); for (PartyMembersBusiness membersBusiness : pageInfo.getList()) { membersBusiness.setContent(null); } return ResponseUtil.success(PageConvertUtil.grid(pageInfo)); } @RequestMapping(value = "/business/detail", method = RequestMethod.GET) @ResponseBody public Result load(@RequestParam(value = "id") Integer id) { PartyMembersBusiness partyMembersBusiness = iPartyMembersBusinessService.selectByKey(id); partyMembersBusiness.setReadCount(partyMembersBusiness.getReadCount() + 1); iPartyMembersBusinessService.updateNotNull(partyMembersBusiness); return ResponseUtil.success(partyMembersBusiness); } }
[ "597160667@qq.com" ]
597160667@qq.com
f3f4e56e1558c67611ad2ffd9c175bceb86fd848
02a108d2eeb1c0245a306ee1d766db7f03e020f0
/DECOUPLING_common/src/main/java/com/vodafone/global/er/decoupling/binding/request/ProvisionFullUpdateServiceStatusRequest.java
60e5a259607983df491a56e026969b2744469551
[]
no_license
raghera/er-common
fa30398ac6d3589ace42c3834c840879d4a81c99
38894e2d5cf765e5c97e8a2fc0e51943520a9a9a
refs/heads/master
2021-01-13T09:07:08.157301
2016-09-27T14:54:57
2016-09-27T14:54:57
69,253,161
0
0
null
null
null
null
UTF-8
Java
false
false
1,069
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.5-b16-fcs // 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: 2013.09.03 at 03:16:51 PM BST // package com.vodafone.global.er.decoupling.binding.request; /** * Java content class for provision-full-update-service-status-request element declaration. * <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/Users/matt/workspace/manifest-work/us/dev/er_core_batch_matt/working/DECOUPLING_common/schemas/request/request.xsd line 1143) * <p> * <pre> * &lt;element name="provision-full-update-service-status-request" type="{}provisionUpdateRequestType"/> * </pre> * */ public interface ProvisionFullUpdateServiceStatusRequest extends javax.xml.bind.Element, com.vodafone.global.er.decoupling.binding.request.ProvisionUpdateRequestType { }
[ "raghera@hotmail.com" ]
raghera@hotmail.com
9e715d6ee893b9f93c4a07bff0878e94c3c06ffa
53189efbfed5423821a84f631da404d07a80e404
/storage/app/Al-QuranIndonesia_com.andi.alquran.id_source_from_JADX/com/andi/alquran/p032j/C0940b.java
3524c1b5c0c6c6bc76a091a97a8e2e0b208cd120
[ "MIT" ]
permissive
dwijpr/islam
0c9b77028d34862b6d06858c5b0d6ffec91b5014
6077291a619ac2f5b30a77e284c0a7361e7c8ad4
refs/heads/master
2021-01-19T17:16:49.818251
2017-03-13T23:00:08
2017-03-13T23:00:08
82,430,213
0
0
null
null
null
null
UTF-8
Java
false
false
1,524
java
package com.andi.alquran.p032j; import android.support.v7.widget.helper.ItemTouchHelper.Callback; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; /* renamed from: com.andi.alquran.j.b */ public class C0940b { public String m3275a(String str) { try { HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection(); httpURLConnection.setRequestMethod("GET"); httpURLConnection.setRequestProperty("User-Agent", "Mozilla/5.0"); httpURLConnection.setUseCaches(true); if (httpURLConnection.getResponseCode() == Callback.DEFAULT_DRAG_ANIMATION_DURATION) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream())); StringBuffer stringBuffer = new StringBuffer(); while (true) { String readLine = bufferedReader.readLine(); if (readLine != null) { stringBuffer.append(readLine); } else { bufferedReader.close(); httpURLConnection.disconnect(); return stringBuffer.toString(); } } } httpURLConnection.disconnect(); return null; } catch (IOException e) { return null; } } }
[ "dwijpr@gmail.com" ]
dwijpr@gmail.com
dc56f6babcc4557b9090367dc8162560f3c7b0c8
f92727bed422f39a97c5e8772f0e34711f35cd56
/src/main/java/com/commercetools/dataimport/producttypes/ProductTypesDeleteJobConfiguration.java
18c930686eb09d518eed9075f17ed0c3c0f76d5f
[ "Apache-2.0" ]
permissive
sshibani/commercetools-sunrise-data
a371d8def1c7be80227ba88e4f1b453b5813dc94
57939f39f43f58edd72a597c56942d7a8655fb36
refs/heads/master
2021-05-04T17:51:05.281268
2018-01-25T12:16:45
2018-01-25T12:16:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,960
java
package com.commercetools.dataimport.producttypes; import com.commercetools.dataimport.commercetools.DefaultCommercetoolsJobConfiguration; import com.commercetools.sdk.jvm.spring.batch.item.ItemReaderFactory; import io.sphere.sdk.client.BlockingSphereClient; import io.sphere.sdk.producttypes.ProductType; import io.sphere.sdk.producttypes.commands.ProductTypeDeleteCommand; import io.sphere.sdk.producttypes.queries.ProductTypeQuery; import org.springframework.batch.core.Job; import org.springframework.batch.core.Step; import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; import org.springframework.batch.item.ItemWriter; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration @EnableBatchProcessing @EnableAutoConfiguration public class ProductTypesDeleteJobConfiguration extends DefaultCommercetoolsJobConfiguration { @Bean public Job productTypesDeleteJob(final Step deleteProductTypes) { return jobBuilderFactory.get("productTypeDeleteJob") .start(deleteProductTypes) .build(); } @Bean public Step deleteProductTypes(final ItemWriter<ProductType> productTypeDeleteItemWriter, final BlockingSphereClient sphereClient) { return stepBuilderFactory.get("deleteProductTypesInCommercetoolsPlatform") .<ProductType, ProductType>chunk(1) .reader(ItemReaderFactory.sortedByIdQueryReader(sphereClient, ProductTypeQuery.of())) .writer(productTypeDeleteItemWriter) .build(); } @Bean public ItemWriter<ProductType> productTypeDeleteItemWriter(final BlockingSphereClient sphereClient) { return items -> items.forEach(item -> sphereClient.executeBlocking(ProductTypeDeleteCommand.of(item))); } }
[ "michael.schleichardt@commercetools.de" ]
michael.schleichardt@commercetools.de
cf8350c128f0d27b54d2b4df86f2b297d0026302
a6e0faabade66696829427d16107551edaddf485
/algorithms-leetcode/src/main/java/com/brianway/learning/algorithms/leetcode/medium/EvaluateReversePolishNotation.java
6edc787c887d4f0ef41571d1157ba17269c20e41
[ "Apache-2.0" ]
permissive
brianway/algorithms-learning
ff979b84499c225d0429d01af67e0f325c9562f1
febc684107d80fda9fcfabc3336f40c1a9c3d42f
refs/heads/master
2022-12-22T02:45:40.046990
2022-12-11T13:46:58
2022-12-11T13:46:58
55,965,971
211
68
null
null
null
null
UTF-8
Java
false
false
1,858
java
package com.brianway.learning.algorithms.leetcode.medium; import java.util.Arrays; import java.util.List; import java.util.Stack; /** * LeetCode 150. Evaluate Reverse Polish Notation * Question: https://leetcode.com/problems/evaluate-reverse-polish-notation/ * 关键题设:无 * * @auther brian * @since 2022/8/16 22:02 */ public class EvaluateReversePolishNotation { public int evalRPN(String[] tokens) { return 0; } public class EvaluateReversePolishNotation0 extends EvaluateReversePolishNotation { @Override public int evalRPN(String[] tokens) { Stack<Integer> numbers = new Stack<>(); for (int i = 0; i < tokens.length; i++) { if (isOperator(tokens[i])) { // 是操作符 int right = numbers.pop(); int left = numbers.pop(); int result = calculate(left, right, tokens[i]); numbers.push(result); } else { // 是操作数 int number = Integer.parseInt(tokens[i]); numbers.push(number); } } return numbers.pop(); } private boolean isOperator(String op) { List<String> operators = Arrays.asList("+", "-", "*", "/"); return operators.contains(op); } private int calculate(Integer left, Integer right, String op) { switch (op) { case "+": return left + right; case "-": return left - right; case "*": return left * right; case "/": return left / right; default: return 0; } } } }
[ "250902678@qq.com" ]
250902678@qq.com
6a6a06842a84a09ae21b96aa00eaa11fe466dd8e
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Spring/Spring5066.java
a4e17d122ac83ba5a40eafc7efc9ed9960aa1111
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
434
java
@Test public void findMethodAnnotationWithAnnotationOnMethodInInterface() throws Exception { Method m = Leaf.class.getMethod("fromInterfaceImplementedByRoot"); // @Order is not @Inherited assertNull(m.getAnnotation(Order.class)); // getAnnotation() does not search on interfaces assertNull(getAnnotation(m, Order.class)); // findAnnotation() does search on interfaces assertNotNull(findAnnotation(m, Order.class)); }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
72e72c4f1aaef9bf7b4d821efc9dba9e72552b35
875351ca52a45e14c3b24ba59bebb875a122d0c3
/joy-plugins/src/main/java/com/kvc/joy/plugin/security/user/service/impl/UserLogoutLogService.java
17869c102679c5979343fd646c3294ee81c04a5e
[]
no_license
linuxlong/joy
ba9a121c69dd08d808b0b82f28a30b33056647d9
2a8e903aaf4ca9ada492442ddb9863ddbd85fb21
refs/heads/master
2020-12-25T12:41:47.427369
2014-05-30T07:00:06
2014-05-30T07:00:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,558
java
package com.kvc.joy.plugin.security.user.service.impl; import com.kvc.joy.commons.lang.DateTool; import com.kvc.joy.core.persistence.orm.jpa.JpaTool; import com.kvc.joy.plugin.security.erbac.support.utils.UserTool; import com.kvc.joy.plugin.security.user.model.po.TUserLoginLog; import com.kvc.joy.plugin.security.user.model.po.TUserLogoutLog; import com.kvc.joy.plugin.security.user.service.IUserLoginLogService; import com.kvc.joy.plugin.security.user.service.IUserLogoutLogService; import com.kvc.joy.plugin.security.user.support.enums.LogoutMethod; /** * * @since 1.0.0 * @author Kevice * @time 2013年10月15日 下午2:32:05 */ public class UserLogoutLogService implements IUserLogoutLogService { private IUserLoginLogService userLoginLogService; @Override public void logout(String loginLogId, LogoutMethod logoutMethod, String logoutTime) { TUserLogoutLog logoutLog = new TUserLogoutLog(); if (logoutTime == null) { logoutTime = DateTool.currentDate(DateTool.UNFMT_yyyyMMddHHmmss); } logoutLog.setLogoutTime(logoutTime); String userId = UserTool.getCurrentUser().getId(); logoutLog.setUserId(userId); if (loginLogId == null) { TUserLoginLog loginLog = userLoginLogService.onLogout(logoutTime); if (loginLog != null) { loginLogId = loginLog.getId(); } } logoutLog.setLoginLogId(loginLogId); logoutLog.setLogoutMethod(logoutMethod); JpaTool.persist(logoutLog); } public void setUserLoginLogService(IUserLoginLogService userLoginLogService) { this.userLoginLogService = userLoginLogService; } }
[ "kevice@qq.com" ]
kevice@qq.com
4ba050f43cbc723c3252bf0c530f0e8942fb3ce7
9bf1d5292ab10c2ee467ca7031d3645ba436b427
/loser-token-parser/src/main/java/com/loserico/tokenparser/utils/ParserUtils.java
bdbc237168560635c7872d89190e5a8c0496e151
[]
no_license
klaus-gu/awesome-loser
8ae58b3812c3898bd426e4810689c58824b1884c
309ff6958273c8a9aeb48bb5e76bbdc41390cf3a
refs/heads/master
2023-06-01T09:27:46.771346
2021-07-01T07:03:11
2021-07-01T07:03:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
878
java
package com.loserico.tokenparser.utils; import com.loserico.tokenparser.parsing.GenericTokenParser; import com.loserico.tokenparser.parsing.OgnlTokenHandler; import com.loserico.tokenparser.parsing.TokenHandler; /** * <p> * Copyright: (C), 2020-09-16 14:07 * <p> * <p> * Company: Sexy Uncle Inc. * * @author Rico Yu ricoyu520@gmail.com * @version 1.0 */ public final class ParserUtils { private static final String OPEN_TOKEN = "#{"; private static final String CLOSE_TOKEN = "}"; /** * 解析str中包含的OGNL表达式, 并返回解析后完整的str * @param str * @param root * @return String */ public static String parse(String str, Object root) { TokenHandler tokenHandler = new OgnlTokenHandler(root); GenericTokenParser tokenParser = new GenericTokenParser(OPEN_TOKEN, CLOSE_TOKEN, tokenHandler); return tokenParser.parse(str); } }
[ "ricoyu520@gmail.com" ]
ricoyu520@gmail.com
26fbb6bc3aae20de0f8dccf64da0f77538ab7079
5cd1183f2b795772ee76dabd08f8bf8ea3ee5823
/app-layout-ui-tests/app-layout-ui-test-top-large/src/main/java/com/github/appreciated/app/layout/test/top/large/view/View8.java
eb588705526a7370ff20302872abb7cf6a7e9309
[ "Apache-2.0", "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
blackbluegl/vaadin-app-layout
ea5cf986ccaf988e5c0f1aa3015573f977e59a37
15aaba2b98578f6312e4f9ff113959a226fd6ee5
refs/heads/master
2020-06-17T04:58:15.189430
2019-04-29T08:16:45
2019-04-29T08:16:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
496
java
package com.github.appreciated.app.layout.test.top.large.view; import com.github.appreciated.app.layout.test.top.large.TopLargeBehaviourView; import com.github.appreciated.app.layout.test.view.ExampleView; import com.vaadin.flow.router.Route; @Route(value = "view8", layout = TopLargeBehaviourView.class) // an empty view name will also be the default view public class View8 extends ExampleView { @Override protected String getViewName() { return getClass().getName(); } }
[ "GoebelJohannes@gmx.net" ]
GoebelJohannes@gmx.net
c5139a2d95a914909e0cf274ef284070b2acb30f
93b0beab85ffb1e6e4ebd4a2129aea3c72851567
/ppdai-sms/ac-sms-api/ac-sms-admin/src/main/java/com/ppdai/ac/sms/contract/utils/Log.java
13a7961a7d48b443a737f9ba747f27e4290a96a2
[]
no_license
qqbenst/sms
3d60a06d846bbe57fdae366513252c7ef2888fc2
6cda716eea98aae84ace153a8b1b82e886509fb4
refs/heads/master
2021-12-22T10:11:56.962033
2017-10-12T14:39:27
2017-10-12T14:39:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
459
java
package com.ppdai.ac.sms.contract.utils; import java.lang.annotation.*; /** * Created by wangxiaomei02 on 2017/6/27. */ @Target({ElementType.PARAMETER, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Log { /** 要执行的操作类型比如:add操作 **/ public String operationType() default ""; /** 要执行的具体操作比如:添加用户 **/ public String operationName() default ""; }
[ "442620332@qq.com" ]
442620332@qq.com
dd7da96ba6466d4bf34f7b3cb6c95a141a13dfc3
7683938be3d4e276106ee60b227a8bf9351ff906
/app/src/test/java/ketang/zige/com/vrdube_ketang/ExampleUnitTest.java
6bb661aa109d92cd2ec396356fa5c9ccbccf97f2
[]
no_license
PhoneSj/Robot
a42aad4c1c0b34607ed68d8ed777190e18dd2721
59a5978ef4ba8338edd7afa78c57fb0edae6b92e
refs/heads/master
2021-07-16T02:52:12.023042
2017-10-10T11:47:42
2017-10-10T11:47:42
106,408,173
0
0
null
null
null
null
UTF-8
Java
false
false
342
java
package ketang.zige.com.vrdube_ketang; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { public static void main(String[] a) throws Exception{ String i = "dddddddd/ddddddd/dddddd"; int j = i.lastIndexOf("/"); System.out.print("" + j); } }
[ "724430327@qq.com" ]
724430327@qq.com
fc70e83f759dd198a8134f6b4946c075f9446d5a
6f36e847fbacb814f7ba041fe060dab32fa1be74
/commons/common-utils/src/main/java/com/study/core/crypto/asymmetric/BaseAsymmetric.java
a8d48b4ea8d3e56363f4a945f8c33ca4b3bfaad0
[]
no_license
wcl19860926/springboot-demo
b3d31f2a03bb3edc3097abad55d356f0505a2d28
c71827acda26314ecd80dfd024e7858147f4c3b3
refs/heads/main
2023-03-09T15:31:28.805200
2021-02-28T11:34:05
2021-02-28T11:34:05
342,522,874
0
0
null
null
null
null
UTF-8
Java
false
false
6,234
java
package com.study.core.crypto.asymmetric; import java.security.Key; import java.security.KeyPair; import java.security.PrivateKey; import java.security.PublicKey; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import com.study.core.codec.Base64; import com.study.core.crypto.CryptoException; import com.study.core.crypto.SecureUtil; /** * 非对称基础,提供锁、私钥和公钥的持有 * * @author Looly * @since 3.3.0 */ public class BaseAsymmetric<T extends BaseAsymmetric<T>> { /** 算法 */ protected String algorithm; /** 公钥 */ protected PublicKey publicKey; /** 私钥 */ protected PrivateKey privateKey; /** 锁 */ protected Lock lock = new ReentrantLock(); // ------------------------------------------------------------------ Constructor start /** * 构造,创建新的私钥公钥对 * * @param algorithm 算法 */ public BaseAsymmetric(String algorithm) { this(algorithm, (byte[]) null, (byte[]) null); } /** * 构造 私钥和公钥同时为空时生成一对新的私钥和公钥<br> * 私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密或者解密 * * @param algorithm 非对称加密算法 * @param privateKey 私钥 * @param publicKey 公钥 * @since 3.1.1 */ public BaseAsymmetric(AsymmetricAlgorithm algorithm, PrivateKey privateKey, PublicKey publicKey) { this(algorithm.getValue(), privateKey, publicKey); } /** * 构造 私钥和公钥同时为空时生成一对新的私钥和公钥<br> * 私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密或者解密 * * @param algorithm 非对称加密算法 * @param privateKeyBase64 私钥Base64 * @param publicKeyBase64 公钥Base64 */ public BaseAsymmetric(String algorithm, String privateKeyBase64, String publicKeyBase64) { this(algorithm, Base64.decode(privateKeyBase64), Base64.decode(publicKeyBase64)); } /** * 构造 * * 私钥和公钥同时为空时生成一对新的私钥和公钥<br> * 私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密或者解密 * * @param algorithm 算法 * @param privateKey 私钥 * @param publicKey 公钥 */ public BaseAsymmetric(String algorithm, byte[] privateKey, byte[] publicKey) { init(algorithm, privateKey, publicKey); } /** * 构造 * * 私钥和公钥同时为空时生成一对新的私钥和公钥<br> * 私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密或者解密 * * @param algorithm 算法 * @param privateKey 私钥 * @param publicKey 公钥 * @since 3.1.1 */ public BaseAsymmetric(String algorithm, PrivateKey privateKey, PublicKey publicKey) { init(algorithm, privateKey, publicKey); } // ------------------------------------------------------------------ Constructor end /** * 初始化<br> * 私钥和公钥同时为空时生成一对新的私钥和公钥<br> * 私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密或者解密<br> * * @param algorithm 算法 * @param privateKey 私钥 * @param publicKey 公钥 * @return this */ public T init(String algorithm, byte[] privateKey, byte[] publicKey) { final PrivateKey privateKeyObj = (null == privateKey) ? null : SecureUtil.generatePrivateKey(algorithm, privateKey); final PublicKey publicKeyObj = (null == publicKey) ? null : SecureUtil.generatePublicKey(algorithm, publicKey); return init(algorithm, privateKeyObj, publicKeyObj); } /** * 初始化<br> * 私钥和公钥同时为空时生成一对新的私钥和公钥<br> * 私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密(签名)或者解密(校验) * * @param algorithm 算法 * @param privateKey 私钥 * @param publicKey 公钥 * @return this */ @SuppressWarnings("unchecked") public T init(String algorithm, PrivateKey privateKey, PublicKey publicKey) { this.algorithm = algorithm; if (null == privateKey && null == publicKey) { initKeys(); } else { if (null != privateKey) { this.privateKey = privateKey; } if (null != publicKey) { this.publicKey = publicKey; } } return (T) this; } /** * 生成公钥和私钥 * * @return this */ @SuppressWarnings("unchecked") public T initKeys() { KeyPair keyPair = SecureUtil.generateKeyPair(this.algorithm); this.publicKey = keyPair.getPublic(); this.privateKey = keyPair.getPrivate(); return (T) this; } // --------------------------------------------------------------------------------- Getters and Setters /** * 获得公钥 * * @return 获得公钥 */ public PublicKey getPublicKey() { return this.publicKey; } /** * 获得公钥 * * @return 获得公钥 */ public String getPublicKeyBase64() { return Base64.encode(getPublicKey().getEncoded()); } /** * 设置公钥 * * @param publicKey 公钥 * @return this */ @SuppressWarnings("unchecked") public T setPublicKey(PublicKey publicKey) { this.publicKey = publicKey; return (T) this; } /** * 获得私钥 * * @return 获得私钥 */ public PrivateKey getPrivateKey() { return this.privateKey; } /** * 获得私钥 * * @return 获得私钥 */ public String getPrivateKeyBase64() { return Base64.encode(getPrivateKey().getEncoded()); } /** * 设置私钥 * * @param privateKey 私钥 * @return this */ @SuppressWarnings("unchecked") public T setPrivateKey(PrivateKey privateKey) { this.privateKey = privateKey; return (T) this; } /** * 根据密钥类型获得相应密钥 * * @param type 类型 {@link KeyType} * @return {@link Key} */ protected Key getKeyByType(KeyType type) { switch (type) { case PrivateKey: if (null == this.privateKey) { throw new NullPointerException("Private key must not null when use it !"); } return this.privateKey; case PublicKey: if (null == this.publicKey) { throw new NullPointerException("Public key must not null when use it !"); } return this.publicKey; } throw new CryptoException("Uknown key type: " + type); } }
[ "694216530@qq.com" ]
694216530@qq.com
0270cd25e09953bf3f67aa58c5952c5d7ccbb281
10535e4ebeeac5bc2fb6e852aff1066d1dcfe0f3
/xcr-web/xcr-web-app/src/main/java/com/yatang/xc/xcr/enums/StateEnum.java
7131e649adadc626512c386fc30a065c1dad7736
[]
no_license
pocketbbaa/XCR
c6b3b08a432a7af2e5396f3551ad82133dc1af6b
03940b44cb6aa733657609f372ca3c4d5e81165a
refs/heads/master
2021-04-03T07:09:40.935591
2018-03-09T06:43:27
2018-03-09T06:43:27
124,474,053
2
3
null
null
null
null
UTF-8
Java
false
false
1,011
java
package com.yatang.xc.xcr.enums; /** * 因为这几种条件基本都是固定的,固化删选条件 * @author gaodawei * */ public enum StateEnum { STATE_0("M00","正常") ,STATE_1("M01","账号过期,请重新登录") ,STATE_2("M02","服务太忙了,请稍后再试") ,STATE_3("M03","") ,STATE_4("M04","无该商品") ,STATE_5("M05","你已被迫下线,请确认是否密码泄露") ,STATE_6("M06","") ,STATE_7("M07","") ,STATE_8("M08","") ,STATE_9("M09","") ,STATE_10("M10","") ,STATE_11("M11","验证码错误") ,STATE_12("M12","超出发送次数") ,STATE_13("M13","加盟超时"); private String state; private String desc; /** * @param state * @param desc */ private StateEnum(String state, String desc) { this.state = state; this.desc = desc; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } }
[ "541230721@qq.com" ]
541230721@qq.com
5eacf9b83926ee3842ee040c25acbda7e47f0281
8f9ade5cdd7798defee416bc46a0a04dea61d806
/src/main/java/find/first/palindromic/string/in/the/array/FindFirstPalindromicStringInTheArray.java
11e1f0cce9e2a3ecbe9fd1c83f7f370abf8be80a
[]
no_license
humwawe/leetcode
9859b8b14fd8f209b1f2e72550ae88b60a867b1d
5d9c3d338ca20641b8b3f90ba0cc0fe07fa9314e
refs/heads/master
2022-12-01T11:34:25.813852
2022-11-28T14:44:09
2022-11-28T14:44:09
181,721,913
4
0
null
null
null
null
UTF-8
Java
false
false
487
java
package find.first.palindromic.string.in.the.array; /** * @author hum */ public class FindFirstPalindromicStringInTheArray { public String firstPalindrome(String[] words) { f: for (String word : words) { for (int i = 0; i < word.length() / 2; i++) { if (word.charAt(i) != word.charAt(word.length() - 1 - i)) { continue f; } } return word; } return ""; } }
[ "wawe8963098@163.com" ]
wawe8963098@163.com
fa8d04adf9ea267751033961392ed848c97dc789
5011795af6079497fb17a1caf7705fde0a079231
/kdb/src/main/java/com/nahuo/kdb/adapter/GuideViewPagerAdapter.java
e3feb7b5a5ade8e5527e637a1b065f6635671e23
[]
no_license
JameChen/kdb
0bac9386e5d9d80392f618bc799dc11b8e916fd7
edf97f8b340118806a625f0b2ae6e00a2abcdd20
refs/heads/master
2020-07-13T09:34:02.164473
2019-08-29T02:12:17
2019-08-29T02:12:17
205,057,004
1
1
null
null
null
null
UTF-8
Java
false
false
1,075
java
package com.nahuo.kdb.adapter; import java.util.List; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.view.View; import android.view.ViewGroup; public class GuideViewPagerAdapter extends PagerAdapter { private List<View> pageViews; public GuideViewPagerAdapter(List<View> pageViews){ this.pageViews=pageViews; } @Override public int getCount() { return pageViews.size(); } @Override public boolean isViewFromObject(View arg0, Object arg1) { return arg0==arg1; } @Override public void destroyItem(View container, int position, Object object) { ((ViewPager)container).removeView(pageViews.get(position)); } @Override public int getItemPosition(Object object) { return super.getItemPosition(object); } @Override public Object instantiateItem(ViewGroup container, int position) { if(pageViews.size()>0){ View view=pageViews.get(position); container.addView(view); return view; } else { return null; } } }
[ "1210686304@qq.com" ]
1210686304@qq.com
4aa26736dab9cf4641d6f0689726241e44cff566
9da2a3149b5668c02841191640b8c60e2597a8cf
/common/pms-connect/src/test/java/com/cn/thinkx/pms/BizAppObjectProcessorTest.java
46563bf9fea67ea45e57f96996c0414d09fc4fdb
[]
no_license
wang-shun/wecard-maindir
e1ff253978d37a54ad2dcc68c7e720678dccc439
438070cfb10f8a466d016858ea62c340cf4b2a46
refs/heads/master
2022-07-17T07:37:11.638365
2019-05-04T07:48:05
2019-05-04T07:48:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
983
java
package com.cn.thinkx.pms; import org.junit.Test; public class BizAppObjectProcessorTest { @Test public void testMsg2obj() throws Exception { // BizAppObjectProcessor appObjectProcessor = new BizAppObjectProcessor(); // byte[] messageBytes = FileUtils.readFileToByteArray(new File("C:/2.txt")); // appObjectProcessor.msg2obj(messageBytes); } @Test public void testObj2msg() { /*CommMessage commMessage = new CommMessage(); BizMessageObj bizObj = new BizMessageObj(); bizObj.setPackageNo("54234bf9-aba3-4192-8b6e-603d18ac308b"); bizObj.setChannel("80000001"); bizObj.setTxnType("M240"); bizObj.setServiceName(""); commMessage.setDomanId("vCardBatInq"); commMessage.setMessageObject(bizObj); BizAppObjectProcessor appObjectProcessor = new BizAppObjectProcessor(); try { byte[] msgs = appObjectProcessor.obj2msg(commMessage); FileUtils.writeByteArrayToFile(new File("c:/2.txt"), msgs); } catch (Exception e) { e.printStackTrace(); }*/ } }
[ "zhu_qiuyou@ebeijia.com" ]
zhu_qiuyou@ebeijia.com
bf1946c6d1d38bd74b9b7246c6c9bc8a9b8b1a02
4f4790805c7d9bbaed5e22e64af663c7c8eb205c
/renren-api/src/main/java/io/renren/constants/SystemConstants.java
1fb0ad4f17f9d6201451e93375cbec1e98a45455
[ "Apache-2.0" ]
permissive
wanhao838088/vue-taobao
5323151f827afda8fc0289d0da41a7462b00af19
0fe92ac7af5dff1e8e7a59bad06359445c77e722
refs/heads/master
2020-04-25T02:38:53.118307
2019-04-25T07:32:23
2019-04-25T07:32:23
172,447,358
15
3
null
null
null
null
UTF-8
Java
false
false
563
java
package io.renren.constants; /** * Created by LiuLiHao on 2019/2/24 0024 下午 05:15 * @author : LiuLiHao * 描述:系统常量 */ public interface SystemConstants { /**手机号标识*/ String MOBILE = "mobile"; /**默认密码*/ String PASSWORD = "123456"; /** * 123456加密后密码 */ String SHA_PWD = "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"; /** * 登录时间过期 */ int LOGIN_OUT_DATE = 10086; /** * 缓存时间 */ int CACHE_TIME_MAIN = 24; }
[ "838088516@qq.com" ]
838088516@qq.com
a32dd797edc0c83a8e36f7876dfa6d8dbef2ab41
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/7/7_948a58c75bf2874919d719107745c2c13ed7e879/NativeCallOps/7_948a58c75bf2874919d719107745c2c13ed7e879_NativeCallOps_t.java
3d79fecc177921c30fd215649e96697a64499b6b
[]
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
8,098
java
package org.perl6.nqp.runtime; import com.sun.jna.NativeLibrary; import com.sun.jna.Pointer; import org.perl6.nqp.sixmodel.REPR; import org.perl6.nqp.sixmodel.REPRRegistry; import org.perl6.nqp.sixmodel.SixModelObject; import org.perl6.nqp.sixmodel.reprs.CPointerInstance; import org.perl6.nqp.sixmodel.reprs.NativeCallInstance; import org.perl6.nqp.sixmodel.reprs.NativeCallBody; import org.perl6.nqp.sixmodel.reprs.NativeCallBody.ArgType; public final class NativeCallOps { public static long init() { /* Nothing to do here. The REPRs are all registered over in * REPRRegistry.java. */ return 1L; } public static long build(SixModelObject target, String libname, String symbol, String convention, SixModelObject arguments, SixModelObject returns, ThreadContext tc) { NativeCallBody call = getNativeCallBody(tc, target); try { /* Load the library and locate the symbol. */ /* TODO: Error handling! */ NativeLibrary library = libname == null || libname.equals("") ? NativeLibrary.getProcess() : NativeLibrary.getInstance(libname); call.entry_point = library.getFunction(symbol); /* TODO: Set the calling convention. */ /* Set up the argument types. */ int n = (int) arguments.elems(tc); call.arg_types = new ArgType[n]; for (int i = 0; i < n; i++) { call.arg_types[i] = getArgType(tc, arguments.at_pos_boxed(tc, i), false); } call.ret_type = getArgType(tc, returns, true); return 1L; } catch (Throwable t) { throw ExceptionHandling.dieInternal(tc, t); } } public static SixModelObject call(SixModelObject returns, SixModelObject callObject, SixModelObject arguments, ThreadContext tc) { NativeCallBody call = getNativeCallBody(tc, callObject); try { /* Convert arguments into array of appropriate objects. */ int n = (int) arguments.elems(tc); /* TODO: Make sure n == call.arg_types.length? */ Object[] cArgs = new Object[n]; for (int i = 0; i < n; i++) { /* TODO: Converting sixmodel objects to appropriate JNA types. */ cArgs[i] = toJNAType(tc, arguments.at_pos_boxed(tc, i), call.arg_types[i]); } /* The actual foreign function call. */ Object returned = call.entry_point.invoke(javaType(tc, call.ret_type), cArgs); /* Wrap returned in the appropriate REPR type. */ return toNQPType(tc, call.ret_type, returns, returned); } catch (Throwable t) { throw ExceptionHandling.dieInternal(tc, t); } } public static long refresh(SixModelObject obj) { return 1L; } private static REPR ncrepr = REPRRegistry.getByName("NativeCall"); private static NativeCallBody getNativeCallBody(ThreadContext tc, SixModelObject target) { NativeCallBody call; if (target instanceof NativeCallInstance) { call = ((NativeCallInstance)target).body; } else { call = (NativeCallBody)target.get_boxing_of(tc, ncrepr.ID); if (call == null) { call = new NativeCallBody(); target.set_boxing_of(tc, ncrepr.ID, call); } } return call; } private static Class javaType(ThreadContext tc, ArgType target) { switch (target) { case VOID: return Void.class; case CHAR: return Byte.class; case SHORT: return Short.class; case INT: return Integer.class; case LONG: return Long.class; case FLOAT: return Float.class; case DOUBLE: return Double.class; case ASCIISTR: case UTF8STR: case UTF16STR: /* TODO: Handle encodings. */ return String.class; case CPOINTER: return Pointer.class; default: ExceptionHandling.dieInternal(tc, String.format("Don't know correct Java class for %s arguments yet", target)); } /* And a dummy return to placate the Java flow analysis. */ return null; } private static Object toJNAType(ThreadContext tc, SixModelObject o, ArgType target) { o = Ops.decont(o, tc); switch (target) { case CHAR: return new Byte((byte) o.get_int(tc)); case SHORT: return new Short((short) o.get_int(tc)); case INT: return new Integer((int) o.get_int(tc)); case LONG: return new Long((long) o.get_int(tc)); case FLOAT: return new Float((float) o.get_num(tc)); case DOUBLE: return new Double((double) o.get_num(tc)); case ASCIISTR: case UTF8STR: case UTF16STR: /* TODO: Handle encodings. */ return o.get_str(tc); case CPOINTER: return ((CPointerInstance) o).pointer; default: ExceptionHandling.dieInternal(tc, String.format("Don't know how to convert %s arguments to JNA yet", target)); } /* And a dummy return to placate the Java flow analysis. */ return null; } private static SixModelObject toNQPType(ThreadContext tc, ArgType target, SixModelObject type, Object o) { SixModelObject nqpobj = null; if (target != ArgType.VOID) nqpobj = type.st.REPR.allocate(tc, type.st); switch (target) { case VOID: return type; case CHAR: { byte val = ((Byte) o).byteValue(); nqpobj.set_int(tc, val); break; } case SHORT: { short val = ((Short) o).shortValue(); nqpobj.set_int(tc, val); break; } case INT: { int val = ((Integer) o).intValue(); nqpobj.set_int(tc, val); break; } case LONG: { long val = ((Long) o).longValue(); nqpobj.set_int(tc, val); break; } case FLOAT: { float val = ((Float) o).floatValue(); nqpobj.set_num(tc, val); break; } case DOUBLE: { double val = ((Double) o).floatValue(); nqpobj.set_num(tc, val); break; } case ASCIISTR: case UTF8STR: case UTF16STR: /* TODO: Handle encodings. */ if (o != null) { nqpobj.set_str(tc, (String) o); } else { nqpobj = type; } break; case CPOINTER: { CPointerInstance cpointer = (CPointerInstance) nqpobj; cpointer.pointer = (Pointer) o; break; } default: ExceptionHandling.dieInternal(tc, String.format("Don't know how to convert %s arguments to NQP yet", target)); } return nqpobj; } private static ArgType getArgType(ThreadContext tc, SixModelObject info, boolean isReturn) { String type_name = info.at_key_boxed(tc, "type").get_str(tc); ArgType type = ArgType.VOID; try { type = ArgType.valueOf(ArgType.class, type_name.toUpperCase()); } catch (IllegalArgumentException e) { ExceptionHandling.dieInternal(tc, String.format("Unknown type '%s' used for native call", type_name)); } if (!isReturn && type == ArgType.VOID) { ExceptionHandling.dieInternal(tc, "Can only use 'void' type on native call return values"); } return type; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
31a6bc26c13063daafa7d1b7f5b1f8aa61429f8b
5fb1d06955810131a329e9b23e14a69717eb3388
/src/main/java/com/tcf/controller/ClazzController.java
56faf5dcedbf5c97ce420bce289dce1d519182b0
[]
no_license
yunwei1237/StudentManager
d17f08c2b54b16c3646089871ebc558cbcb4dd01
833bfbd8e92231e0cd5f470cf9dd6e5acd2ef216
refs/heads/master
2021-05-06T15:09:58.293122
2017-12-08T06:20:12
2017-12-08T06:20:12
113,529,619
0
0
null
null
null
null
UTF-8
Java
false
false
1,434
java
package com.tcf.controller; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.tcf.basebean.Info; import com.tcf.entity.Clazz; import com.tcf.service.ClazzService; @Controller @RequestMapping("clazz") public class ClazzController { @Autowired private ClazzService cs; @RequestMapping("addClazz.do") public @ResponseBody Info addClazz(@RequestBody Clazz clazz){ return cs.addBean(clazz); } @RequestMapping("deleteClazz.do") public @ResponseBody Info deleteClazz(@RequestBody Clazz clazz){ return cs.delBean(clazz.getId()); } @RequestMapping("updateClazz.do") public @ResponseBody Info updateClazz(@RequestBody Clazz clazz){ return cs.updateBean(clazz); } @RequestMapping("getClazz.do") public @ResponseBody Info getClazz(@RequestBody Clazz clazz){ return cs.getBean(clazz.getId()); } @RequestMapping("searchClazzs.do") public @ResponseBody Info searchClazzs(@RequestBody Map<String, Object> models){ return cs.search(models); } @RequestMapping("getAllClazzs.do") public @ResponseBody Info getAllGrades(@RequestBody Map<String, Object> models){ return cs.getAllBeans(); } }
[ "yunwei1237@163.com" ]
yunwei1237@163.com
0792765ad269920a659a2118b0dd1d6ed5f5ab3e
32cd2626b1e869a8d4433b9eb084cc4665cf938a
/src/com/javarush/test/level04/lesson04/task07/Solution.java
d88e5ffafa175dd56a416d29d886b69c69916344
[]
no_license
AndreyB12/JavaRushHomeWork
b41f0d21258cf488f879dfd4b0e00b60495d8ec3
a5857a1c01063bfb9a50e073006be9e5a7ff00bf
refs/heads/master
2021-01-23T13:09:06.967421
2017-01-27T08:22:31
2017-01-27T08:22:31
58,111,229
0
0
null
null
null
null
UTF-8
Java
false
false
1,609
java
package com.javarush.test.level04.lesson04.task07; /* Количество дней в году Ввести с клавиатуры год, определить количество дней в году. Результат вывести на экран в следующем виде: "количество дней в году: x", где х - 366 для високосными года, х - 365 для обычного года. Подсказка: В високосном году - 366 дней, тогда как в обычном - 365. Високосным годом является каждый четвёртый год, за исключением столетий, которые не кратны 400. Так, годы 1700, 1800 и 1900 не являются високосными, так как они кратны 100 и не кратны 400. Годы 1600 и 2000 — високосные, так как они кратны 100 и кратны 400. Годы 2100, 2200 и 2300 — невисокосные. */ import java.io.BufferedReader; import java.io.InputStreamReader; public class Solution { public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int y = Integer.parseInt(reader.readLine()); if (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0)) { System.out.println("количество дней в году: 366"); } else { System.out.println("количество дней в году: 365"); } } }
[ "andrey.butko@gmail.com" ]
andrey.butko@gmail.com
a2c4f6aa4386a84bee174cc088a552c349848815
b4b62c5c77ec817db61820ccc2fee348d1d7acc5
/src/main/java/com/alipay/api/domain/VoucherModifyInfo.java
9d01f846a8465360f13895a015f7886d0eea1072
[ "Apache-2.0" ]
permissive
zhangpo/alipay-sdk-java-all
13f79e34d5f030ac2f4367a93e879e0e60f335f7
e69305d18fce0cc01d03ca52389f461527b25865
refs/heads/master
2022-11-04T20:47:21.777559
2020-06-15T08:31:02
2020-06-15T08:31:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,806
java
package com.alipay.api.domain; import java.util.List; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; /** * 券修改模型 * * @author auto create * @since 1.0, 2016-10-26 17:43:38 */ public class VoucherModifyInfo extends AlipayObject { private static final long serialVersionUID = 4875132698463865788L; /** * 追加的适用门店 */ @ApiListField("suitable_shops") @ApiField("string") private List<String> suitableShops; /** * 描述信息 */ @ApiField("voucher_desc") private String voucherDesc; /** * 券id */ @ApiField("voucher_id") private String voucherId; /** * 券名称 */ @ApiField("voucher_name") private String voucherName; /** * 使用须知 */ @ApiListField("voucher_terms") @ApiField("voucher_term_info") private List<VoucherTermInfo> voucherTerms; public List<String> getSuitableShops() { return this.suitableShops; } public void setSuitableShops(List<String> suitableShops) { this.suitableShops = suitableShops; } public String getVoucherDesc() { return this.voucherDesc; } public void setVoucherDesc(String voucherDesc) { this.voucherDesc = voucherDesc; } public String getVoucherId() { return this.voucherId; } public void setVoucherId(String voucherId) { this.voucherId = voucherId; } public String getVoucherName() { return this.voucherName; } public void setVoucherName(String voucherName) { this.voucherName = voucherName; } public List<VoucherTermInfo> getVoucherTerms() { return this.voucherTerms; } public void setVoucherTerms(List<VoucherTermInfo> voucherTerms) { this.voucherTerms = voucherTerms; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
b5b11241ead78e143f79ccc33d9beeca9a14435c
828b5327357d0fb4cb8f3b4472f392f3b8b10328
/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBOptions.java
f0f7ce5d1c6e3a83bac5780078042a20d66469e6
[ "CC-BY-3.0", "LicenseRef-scancode-unknown-license-reference", "Unlicense", "ISC", "MIT-0", "GPL-2.0-only", "BSD-2-Clause-Views", "OFL-1.1", "Apache-2.0", "LicenseRef-scancode-jdom", "GCC-exception-3.1", "MPL-2.0", "CC-PDDC", "AGPL-3.0-only", "MPL-2.0-no-copyleft-exception", "LicenseRef-scancode-public-domain", "LGPL-2.1-only", "BSD-2-Clause", "CDDL-1.1", "CDDL-1.0", "LicenseRef-scancode-other-permissive", "LicenseRef-scancode-proprietary-license", "BSD-3-Clause", "MIT", "EPL-1.0", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-free-unknown", "CC0-1.0", "Classpath-exception-2.0", "CC-BY-2.5" ]
permissive
Romance-Zhang/flink_tpc_ds_game
7e82d801ebd268d2c41c8e207a994700ed7d28c7
8202f33bed962b35c81c641a05de548cfef6025f
refs/heads/master
2022-11-06T13:24:44.451821
2019-09-27T09:22:29
2019-09-27T09:22:29
211,280,838
0
1
Apache-2.0
2022-10-06T07:11:45
2019-09-27T09:11:11
Java
UTF-8
Java
false
false
4,773
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.flink.contrib.streaming.state; import org.apache.flink.configuration.ConfigOption; import org.apache.flink.configuration.ConfigOptions; import static org.apache.flink.contrib.streaming.state.PredefinedOptions.DEFAULT; import static org.apache.flink.contrib.streaming.state.PredefinedOptions.FLASH_SSD_OPTIMIZED; import static org.apache.flink.contrib.streaming.state.PredefinedOptions.SPINNING_DISK_OPTIMIZED; import static org.apache.flink.contrib.streaming.state.PredefinedOptions.SPINNING_DISK_OPTIMIZED_HIGH_MEM; import static org.apache.flink.contrib.streaming.state.RocksDBStateBackend.PriorityQueueStateType.HEAP; import static org.apache.flink.contrib.streaming.state.RocksDBStateBackend.PriorityQueueStateType.ROCKSDB; /** * Configuration options for the RocksDB backend. */ public class RocksDBOptions { /** The local directory (on the TaskManager) where RocksDB puts its files. */ public static final ConfigOption<String> LOCAL_DIRECTORIES = ConfigOptions .key("state.backend.rocksdb.localdir") .noDefaultValue() .withDeprecatedKeys("state.backend.rocksdb.checkpointdir") .withDescription("The local directory (on the TaskManager) where RocksDB puts its files."); /** * Choice of timer service implementation. */ public static final ConfigOption<String> TIMER_SERVICE_FACTORY = ConfigOptions .key("state.backend.rocksdb.timer-service.factory") .defaultValue(HEAP.name()) .withDescription(String.format("This determines the factory for timer service state implementation. Options " + "are either %s (heap-based, default) or %s for an implementation based on RocksDB .", HEAP.name(), ROCKSDB.name())); /** * The number of threads used to transfer (download and upload) files in RocksDBStateBackend. */ public static final ConfigOption<Integer> CHECKPOINT_TRANSFER_THREAD_NUM = ConfigOptions .key("state.backend.rocksdb.checkpoint.transfer.thread.num") .defaultValue(1) .withDescription("The number of threads used to transfer (download and upload) files in RocksDBStateBackend."); /** This determines if compaction filter to cleanup state with TTL is enabled. */ public static final ConfigOption<Boolean> TTL_COMPACT_FILTER_ENABLED = ConfigOptions .key("state.backend.rocksdb.ttl.compaction.filter.enabled") .defaultValue(false) .withDescription("This determines if compaction filter to cleanup state with TTL is enabled for backend." + "Note: User can still decide in state TTL configuration in state descriptor " + "whether the filter is active for particular state or not."); /** * The predefined settings for RocksDB DBOptions and ColumnFamilyOptions by Flink community. */ public static final ConfigOption<String> PREDEFINED_OPTIONS = ConfigOptions .key("state.backend.rocksdb.predefined-options") .defaultValue(DEFAULT.name()) .withDescription(String.format("The predefined settings for RocksDB DBOptions and ColumnFamilyOptions by Flink community. " + "Current supported candidate predefined-options are %s, %s, %s or %s. Note that user customized options and options " + "from the OptionsFactory are applied on top of these predefined ones.", DEFAULT.name(), SPINNING_DISK_OPTIMIZED.name(), SPINNING_DISK_OPTIMIZED_HIGH_MEM.name(), FLASH_SSD_OPTIMIZED.name())); /** * The options factory class for RocksDB to create DBOptions and ColumnFamilyOptions. */ public static final ConfigOption<String> OPTIONS_FACTORY = ConfigOptions .key("state.backend.rocksdb.options-factory") .defaultValue(DefaultConfigurableOptionsFactory.class.getName()) .withDescription(String.format("The options factory class for RocksDB to create DBOptions and ColumnFamilyOptions. " + "The default options factory is %s, and it would read the configured options which provided in 'RocksDBConfigurableOptions'.", DefaultConfigurableOptionsFactory.class.getName())); }
[ "1003761104@qq.com" ]
1003761104@qq.com
7c79ede5557bbfa89705dcaba33ab4acd8e48733
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_135cf47b328edd897ae4a9667878bdddc8618011/UIFrame/16_135cf47b328edd897ae4a9667878bdddc8618011_UIFrame_t.java
3cf659bda876603c5d5a94ce22e59c1edead3c6d
[]
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,752
java
package dominoes; import javax.swing.*; import java.awt.*; import java.awt.event.*; // Frame which contains game UI implemented in UI class public class UIFrame extends JFrame {//} implements ActionListener { MenuBar menuBar; int windowWidth = 1400; int windowHeight = 800; private UI ui; public UIFrame() { super("Awesome Dominoes"); setSize(windowWidth, windowHeight); setPreferredSize(new Dimension(windowWidth, windowHeight)); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); super.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { exitOption(); } }); setupMenuBar(); this.validate(); this.setVisible(true); } //Creates menu bar for navigation private void setupMenuBar() { menuBar = new MenuBar(); this.setMenuBar(menuBar); Menu dom = new Menu("Dominoes"); menuBar.add(dom); Menu about = new Menu("About"); menuBar.add(about); MenuItem newGame = new MenuItem("New Game", new MenuShortcut(KeyEvent.VK_N)); MenuItem exitGame = new MenuItem("Exit Dominoes", new MenuShortcut(KeyEvent.VK_X)); MenuItem aboutItem = new MenuItem("About AD", new MenuShortcut(KeyEvent.VK_A)); newGame.setActionCommand("NewGame"); // set the command //newGame.addActionListener(ui.infoPanel); newGame.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { newOption(); } }); exitGame.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { exitOption(); } }); dom.add(newGame); dom.add(exitGame); aboutItem.setActionCommand("About"); aboutItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String aboutTxt = "Awesome Dominoes was written by:\nAbbie James\nNick Mackin\nTimothy Baldock"; JOptionPane.showMessageDialog(new JFrame(), aboutTxt, "About Awesome Dominoes", JOptionPane.INFORMATION_MESSAGE); } }); about.add(aboutItem); } private void newOption() { int x = JOptionPane.showOptionDialog(new JFrame(), "Leave this game?", "New Game", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE,null,null,null); if (x==0) { ui.displayRoundWinner(null); showNewGameDialog(); } } public void exitOption() { Object[] options = {"Yes, sorry", "No, whoops!"}; int x = JOptionPane.showOptionDialog(new JFrame(), "Are you sure you want to quit?", "Leaving so soon?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[1]); if (x == 1) { } else { this.setVisible(false); System.exit(0); } } public void showNewGameDialog() { NewGameDialog dialog = new NewGameDialog(this, this); dialog.setModal(true); dialog.setVisible(true); if (this.ui != null) { this.remove(this.ui); } // Collect results from dialog and use them to create game in new UI panel this.ui = new UI(dialog.player1Type, dialog.player1Name, dialog.player2Type, dialog.player2Name, dialog.targetScore); this.add(this.ui); this.validate(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
34adadcdbe38d01c2af707d3b996ade1f6e88e19
430bd23decf16dc572a587b7af9f5c8e7dea5e6b
/servers/jaxrs/src/gen/java/io/swagger/api/LeaderboardApi.java
0ebff81cffb2b3055340bc0e2e48e7e258323e02
[ "Apache-2.0" ]
permissive
jltrade/api-connectors
332d4df5e7e60bd27b6c5a43182df7d99a665972
fa2cf561b414e18e9d2e1b5d68e94cc710d315e5
refs/heads/master
2020-06-19T10:20:46.022967
2016-09-24T13:12:17
2016-09-24T13:12:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,047
java
package io.swagger.api; import io.swagger.model.*; import io.swagger.api.LeaderboardApiService; import io.swagger.api.factories.LeaderboardApiServiceFactory; import io.swagger.annotations.ApiParam; import io.swagger.model.Leaderboard; import java.util.List; import io.swagger.api.NotFoundException; import java.io.InputStream; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.FormDataParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; @Path("/leaderboard") @Consumes({ "application/json", "application/x-www-form-urlencoded" }) @Produces({ "application/json", "application/xml", "text/xml", "application/javascript", "text/javascript" }) @io.swagger.annotations.Api(description = "the leaderboard API") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2016-07-05T09:41:09.909-05:00") public class LeaderboardApi { private final LeaderboardApiService delegate = LeaderboardApiServiceFactory.getLeaderboardApi(); @GET @Consumes({ "application/json", "application/x-www-form-urlencoded" }) @Produces({ "application/json", "application/xml", "text/xml", "application/javascript", "text/javascript" }) @io.swagger.annotations.ApiOperation(value = "Get current leaderboard.", notes = "", response = Leaderboard.class, responseContainer = "List", tags={ "Leaderboard", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Request was successful", response = Leaderboard.class, responseContainer = "List") }) public Response leaderboardGet(@ApiParam(value = "Ranking type. Options: \"notional\", \"ROE\"", defaultValue="notional") @DefaultValue("notional") @QueryParam("method") String method,@Context SecurityContext securityContext) throws NotFoundException { return delegate.leaderboardGet(method,securityContext); } }
[ "samuel.trace.reed@gmail.com" ]
samuel.trace.reed@gmail.com
9f14d68930a8f17a3edd1bf40335d89c50a1a2e2
52a61700be74ae1a5fd1a7b4d2bdfe632015ecb8
/src/test/java/org/sarge/jove/control/ButtonTest.java
f3fbf20d154ab18458b69e81a06792b0392fa604
[]
no_license
stridecolossus/JOVE
60c248a09171827b049b599e8006a7e558f8b3ba
690f01a8a4464c967781c3d7a53a8866be00793b
refs/heads/master
2023-07-20T07:40:09.165408
2023-07-08T16:21:22
2023-07-08T16:21:22
17,083,829
1
0
null
2014-03-23T18:00:38
2014-02-22T11:51:16
Java
UTF-8
Java
false
false
709
java
package org.sarge.jove.control; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.*; import org.sarge.jove.control.Button.Action; public class ButtonTest { private Button<Action> button; @BeforeEach void before() { button = new Button<>("button", Action.PRESS); // TODO - modifiers } @Test void constructor() { assertEquals("button", button.id()); assertEquals(Action.PRESS, button.action()); // assertEquals(2, button.modifiers()); } @Test void equals() { assertEquals(button, button); assertEquals(button, new Button<>("button", Action.PRESS)); assertNotEquals(button, null); assertNotEquals(button, new Button<>("button", Action.RELEASE)); } }
[ "chris.sarge@gmail.com" ]
chris.sarge@gmail.com
974aac40342f6574453f9adc87da81f3580147a4
80403ec5838e300c53fcb96aeb84d409bdce1c0c
/server/test/src/org/labkey/test/pages/study/DeleteMultipleVisitsPage.java
8c8e10e82522ab5a5a304053955a5b09949f287e
[]
no_license
scchess/LabKey
7e073656ea494026b0020ad7f9d9179f03d87b41
ce5f7a903c78c0d480002f738bccdbef97d6aeb9
refs/heads/master
2021-09-17T10:49:48.147439
2018-03-22T13:01:41
2018-03-22T13:01:41
126,447,224
0
1
null
null
null
null
UTF-8
Java
false
false
4,092
java
/* * Copyright (c) 2017 LabKey Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.labkey.test.pages.study; import org.labkey.test.Locator; import org.labkey.test.WebDriverWrapper; import org.labkey.test.WebTestHelper; import org.labkey.test.pages.LabKeyPage; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; public class DeleteMultipleVisitsPage extends LabKeyPage<DeleteMultipleVisitsPage.ElementCache> { public DeleteMultipleVisitsPage(WebDriver driver) { super(driver); } public static DeleteMultipleVisitsPage beginAt(WebDriverWrapper driver) { return beginAt(driver, driver.getCurrentContainerPath()); } public static DeleteMultipleVisitsPage beginAt(WebDriverWrapper driver, String containerPath) { driver.beginAt(WebTestHelper.buildURL("study", containerPath, "bulkDeleteVisits")); return new DeleteMultipleVisitsPage(driver.getDriver()); } public void selectVisitForDeletion(String label) { click(elementCache().getVisitCheckbox(label)); } public ManageVisitPage clickDeleteSelected() { doAndWaitForPageToLoad(() -> { click(elementCache().deleteSelectedBtn); assertAlert("Are you sure you want to delete the selected visit and all related dataset/specimen data? This action cannot be undone."); }); return new ManageVisitPage(getDriver()); } public String getErrorMessage() { return elementCache().errorMsg.getText(); } public int getVisitDatasetRowCount(String visitLabel) { return Integer.parseInt(elementCache().getVisitDatasetCount(visitLabel).getText()); } public int getVisitSpecimenRowCount(String visitLabel) { return Integer.parseInt(elementCache().getVisitSpecimenCount(visitLabel).getText()); } public ManageVisitPage clickCancel() { clickAndWait(elementCache().cancelBtn); return new ManageVisitPage(getDriver()); } protected ElementCache newElementCache() { return new ElementCache(); } protected class ElementCache extends LabKeyPage.ElementCache { Locator.XPathLocator visitsTableLoc = Locator.tagWithClass("table", "labkey-data-region-legacy"); WebElement errorMsg = Locator.tagWithClass("div", "labkey-error").findWhenNeeded(this); WebElement deleteSelectedBtn = Locator.lkButton("Delete Selected").findWhenNeeded(this); WebElement cancelBtn = Locator.lkButton("Cancel").findWhenNeeded(this); WebElement getVisitCheckbox(String label) { Locator.XPathLocator loc = Locator.xpath("//tr[./td[@class = 'visit-label']/a[text() = '" + label + "']]/td/input[@type = 'checkbox']"); return visitsTableLoc.append(loc).findElement(this); } WebElement getVisitDatasetCount(String label) { Locator.XPathLocator loc = Locator.xpath("//tr[./td[@class = 'visit-label']/a[text() = '" + label + "']]/td[@class = 'visit-dataset-count']"); return visitsTableLoc.append(loc).findElement(this); } WebElement getVisitSpecimenCount(String label) { Locator.XPathLocator loc = Locator.xpath("//tr[./td[@class = 'visit-label']/a[text() = '" + label + "']]/td[@class = 'visit-specimen-count']"); return visitsTableLoc.append(loc).findElement(this); } } }
[ "klum@labkey.com" ]
klum@labkey.com
9a0acd7c950e52fa53760570d5de18202a0953c7
5fb9d5cd069f9df099aed99516092346ee3cf91a
/simba/src/main/java/com/simba/sqlengine/executor/queryplan/IQueryPlan.java
78f3bcf62a44a2a76b933f197061075f6294f6fe
[]
no_license
kylinsoong/teiid-test
862e238e055481dfb14fb84694b316ae74174467
ea5250fa372c7153ad6e9a0c344fdcfcf10800cc
refs/heads/master
2021-04-19T00:31:41.173819
2017-10-09T06:41:00
2017-10-09T06:41:00
35,716,627
0
0
null
null
null
null
UTF-8
Java
false
false
592
java
package com.simba.sqlengine.executor.queryplan; import com.simba.sqlengine.aeprocessor.aetree.relation.AERelationalExpr; import com.simba.sqlengine.aeprocessor.aetree.statement.IAEStatement; public abstract interface IQueryPlan { public abstract IAEStatement getAETree(); public abstract IMaterializationInfo getMaterializationInfo(AERelationalExpr paramAERelationalExpr); } /* Location: /home/kylin/work/couchbase/Driver/CouchbaseJDBC4.jar!/com/simba/sqlengine/executor/queryplan/IQueryPlan.class * Java compiler version: 5 (49.0) * JD-Core Version: 0.7.1 */
[ "kylinsoong.1214@gmail.com" ]
kylinsoong.1214@gmail.com
2c2dd74a8844178454fc7ba1002b3c34954240fb
fe36d6be35c8066419d6a6a8a2ca0ad4ee61a167
/jfire-mvc/src/main/java/com/jfireframework/mvc/binder/impl/FloatBinder.java
e2cd903930711870d4bf5c77373c66b65359b6da
[]
no_license
heianxing/jfireframework
5736376501a848ce53f35567f017f4cb345d729f
253be5165b92bd0e9e4a178e1de2bd95e914e2ff
refs/heads/master
2021-01-22T00:29:37.017220
2016-05-09T03:03:34
2016-05-09T03:03:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
859
java
package com.jfireframework.mvc.binder.impl; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.jfireframework.baseutil.StringUtil; import com.jfireframework.baseutil.verify.Verify; import com.jfireframework.mvc.binder.AbstractDataBinder; public class FloatBinder extends AbstractDataBinder { public FloatBinder(String paramName) { super(paramName); } @Override public Object binder(HttpServletRequest request, Map<String, String> map, HttpServletResponse response) { String value = map.get(paramName); Verify.True(StringUtil.isNotBlank(value), "参数为float基本类型,页面必须要有传参,请检查传参名字是否是{}", paramName); return Float.valueOf(value); } }
[ "eric@jfire.cn" ]
eric@jfire.cn
236a0afb1ee889b116e90b6931f6eba638efeb8c
678a3d58c110afd1e9ce195d2f20b2531d45a2e0
/sources/com/airbnb/android/registration/PhoneNumberRegistrationFragment$$Lambda$2.java
e636349df05771ab91a28ee6efd64282a5d9ec47
[]
no_license
jasonnth/AirCode
d1c37fb9ba3d8087efcdd9fa2103fb85d13735d5
d37db1baa493fca56f390c4205faf5c9bbe36604
refs/heads/master
2020-07-03T08:35:24.902940
2019-08-12T03:34:56
2019-08-12T03:34:56
201,842,970
0
2
null
null
null
null
UTF-8
Java
false
false
817
java
package com.airbnb.android.registration; import com.airbnb.airrequest.AirRequestNetworkException; import p032rx.functions.Action1; final /* synthetic */ class PhoneNumberRegistrationFragment$$Lambda$2 implements Action1 { private final PhoneNumberRegistrationFragment arg$1; private PhoneNumberRegistrationFragment$$Lambda$2(PhoneNumberRegistrationFragment phoneNumberRegistrationFragment) { this.arg$1 = phoneNumberRegistrationFragment; } public static Action1 lambdaFactory$(PhoneNumberRegistrationFragment phoneNumberRegistrationFragment) { return new PhoneNumberRegistrationFragment$$Lambda$2(phoneNumberRegistrationFragment); } public void call(Object obj) { PhoneNumberRegistrationFragment.lambda$new$1(this.arg$1, (AirRequestNetworkException) obj); } }
[ "thanhhuu2apc@gmail.com" ]
thanhhuu2apc@gmail.com
8a503ce461e9379a643818ae24eae0918f6dc1f1
96f9bac9891c89fe51b0a79de7ae7080f88f306e
/src/main/java/command/version5/MenuCommand.java
fc4c620ce5d4a9eacac1c437f7ded18a9ea7ceda
[]
no_license
xudesan33/grinding-design-pattern
dc510ef6686eea181a0c96ad9f32747e02481b6b
5689cce027a3fb1bd4f3469ba0ac5969b0e8beb2
refs/heads/master
2023-05-08T02:00:37.711044
2021-06-02T11:05:20
2021-06-02T11:05:20
373,138,212
0
0
null
null
null
null
UTF-8
Java
false
false
622
java
package command.version5; import java.util.ArrayList; import java.util.Collection; /** * 菜单对象,是个宏命令对象 */ public class MenuCommand implements Command { /** * 用来记录组合本菜单的多道菜品,也就是多个命令对象 */ private Collection<Command> col = new ArrayList<Command>(); /** * 点菜,把菜品加入到菜单中 * @param cmd 客户点的菜 */ public void addCommand(Command cmd){ col.add(cmd); } @Override public void execute() { // 执行菜单其实就是循环执行菜单里面的每个菜 for(Command cmd : col){ cmd.execute(); } } }
[ "sander-xu@zamplus.com" ]
sander-xu@zamplus.com
2c50c087f10e1787c476b490a89b6e5c3e923b61
7b73756ba240202ea92f8f0c5c51c8343c0efa5f
/classes2/ConfigPush/NetSegConf.java
59df9e7e3aca468584686c0ee621569060b63765
[]
no_license
meeidol-luo/qooq
588a4ca6d8ad579b28dec66ec8084399fb0991ef
e723920ac555e99d5325b1d4024552383713c28d
refs/heads/master
2020-03-27T03:16:06.616300
2016-10-08T07:33:58
2016-10-08T07:33:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,567
java
package ConfigPush; import com.qq.taf.jce.JceInputStream; import com.qq.taf.jce.JceOutputStream; import com.qq.taf.jce.JceStruct; import com.tencent.mobileqq.hotpatch.NotVerifyClass; public final class NetSegConf extends JceStruct { public long uint32_curconnnum; public long uint32_net_type; public long uint32_segnum; public long uint32_segsize; public NetSegConf() { boolean bool = NotVerifyClass.DO_VERIFY_CLASS; } public NetSegConf(long paramLong1, long paramLong2, long paramLong3, long paramLong4) { this.uint32_net_type = paramLong1; this.uint32_segsize = paramLong2; this.uint32_segnum = paramLong3; this.uint32_curconnnum = paramLong4; } public void readFrom(JceInputStream paramJceInputStream) { this.uint32_net_type = paramJceInputStream.read(this.uint32_net_type, 0, false); this.uint32_segsize = paramJceInputStream.read(this.uint32_segsize, 1, false); this.uint32_segnum = paramJceInputStream.read(this.uint32_segnum, 2, false); this.uint32_curconnnum = paramJceInputStream.read(this.uint32_curconnnum, 3, false); } public void writeTo(JceOutputStream paramJceOutputStream) { paramJceOutputStream.write(this.uint32_net_type, 0); paramJceOutputStream.write(this.uint32_segsize, 1); paramJceOutputStream.write(this.uint32_segnum, 2); paramJceOutputStream.write(this.uint32_curconnnum, 3); } } /* Location: E:\apk\QQ_91\classes2-dex2jar.jar!\ConfigPush\NetSegConf.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "1776098770@qq.com" ]
1776098770@qq.com
a2f860c9c58b0e602e5cec3506b312cc2ae93233
e977c424543422f49a25695665eb85bfc0700784
/benchmark/icse15/1436600/buggy-version/lucene/dev/branches/lucene4547/lucene/facet/src/test/org/apache/lucene/util/SlowRAMDirectory.java
9db5f6c0cabd7e7a3fa91713578a830fb8045c85
[]
no_license
amir9979/pattern-detector-experiment
17fcb8934cef379fb96002450d11fac62e002dd3
db67691e536e1550245e76d7d1c8dced181df496
refs/heads/master
2022-02-18T10:24:32.235975
2019-09-13T15:42:55
2019-09-13T15:42:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,738
java
package org.apache.lucene.util; /* * 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. */ import java.io.IOException; import java.util.Random; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.RAMDirectory; /** * Test utility - slow directory */ // TODO: move to test-framework and sometimes use in tests? public class SlowRAMDirectory extends RAMDirectory { private static final int IO_SLEEP_THRESHOLD = 50; private Random random; private int sleepMillis; public void setSleepMillis(int sleepMillis) { this.sleepMillis = sleepMillis; } public SlowRAMDirectory(int sleepMillis, Random random) { this.sleepMillis = sleepMillis; this.random = random; } @Override public IndexOutput createOutput(String name, IOContext context) throws IOException { if (sleepMillis != -1) { return new SlowIndexOutput(super.createOutput(name, context)); } return super.createOutput(name, context); } @Override public IndexInput openInput(String name, IOContext context) throws IOException { if (sleepMillis != -1) { return new SlowIndexInput(super.openInput(name, context)); } return super.openInput(name, context); } void doSleep(int length) { int sTime = length<10 ? sleepMillis : (int) (sleepMillis * Math.log(length)); if (random!=null) { sTime = random.nextInt(sTime); } try { Thread.sleep(sTime); } catch (InterruptedException e) { throw new ThreadInterruptedException(e); } } /** * Delegate class to wrap an IndexInput and delay reading bytes by some * specified time. */ private class SlowIndexInput extends IndexInput { private IndexInput ii; private int numRead = 0; public SlowIndexInput(IndexInput ii) { super("SlowIndexInput(" + ii + ")"); this.ii = ii; } @Override public byte readByte() throws IOException { if (numRead >= IO_SLEEP_THRESHOLD) { doSleep(0); numRead = 0; } ++numRead; return ii.readByte(); } @Override public void readBytes(byte[] b, int offset, int len) throws IOException { if (numRead >= IO_SLEEP_THRESHOLD) { doSleep(len); numRead = 0; } numRead += len; ii.readBytes(b, offset, len); } @Override public IndexInput clone() { return ii.clone(); } @Override public void close() throws IOException { ii.close(); } @Override public boolean equals(Object o) { return ii.equals(o); } @Override public long getFilePointer() { return ii.getFilePointer(); } @Override public int hashCode() { return ii.hashCode(); } @Override public long length() { return ii.length(); } @Override public void seek(long pos) throws IOException { ii.seek(pos); } } /** * Delegate class to wrap an IndexOutput and delay writing bytes by some * specified time. */ private class SlowIndexOutput extends IndexOutput { private IndexOutput io; private int numWrote; public SlowIndexOutput(IndexOutput io) { this.io = io; } @Override public void writeByte(byte b) throws IOException { if (numWrote >= IO_SLEEP_THRESHOLD) { doSleep(0); numWrote = 0; } ++numWrote; io.writeByte(b); } @Override public void writeBytes(byte[] b, int offset, int length) throws IOException { if (numWrote >= IO_SLEEP_THRESHOLD) { doSleep(length); numWrote = 0; } numWrote += length; io.writeBytes(b, offset, length); } @Override public void close() throws IOException { io.close(); } @Override public void flush() throws IOException { io.flush(); } @Override public long getFilePointer() { return io.getFilePointer(); } @Override public long length() throws IOException { return io.length(); } } }
[ "durieuxthomas@hotmail.com" ]
durieuxthomas@hotmail.com
818306f2d0edca7746a8136e46c80eb9c0a10f41
d5f09c7b0e954cd20dd613af600afd91b039c48a
/sources/com/bytedance/sdk/openadsdk/preload/geckox/statistic/model/b.java
6e7ee24d05e489c930f5a24e7f05b44b360c0146
[]
no_license
t0HiiBwn/CoolapkRelease
af5e00c701bf82c4e90b1033f5c5f9dc8526f4b3
a6a2b03e32cde0e5163016e0078391271a8d33ab
refs/heads/main
2022-07-29T23:28:35.867734
2021-03-26T11:41:18
2021-03-26T11:41:18
345,290,891
5
2
null
null
null
null
UTF-8
Java
false
false
863
java
package com.bytedance.sdk.openadsdk.preload.geckox.statistic.model; import android.text.TextUtils; import java.util.Map; /* compiled from: CheckUpdateData */ public class b { public String a; public String b; public String c; public String d; public String e; public String f; public int g; public static String a(Map<String, String> map) { if (map != null && !map.isEmpty()) { String str = map.get("x-tt-logid"); if (!TextUtils.isEmpty(str)) { return str; } String str2 = map.get("X-Tt-Logid"); if (!TextUtils.isEmpty(str2)) { return str2; } String str3 = map.get("X-TT-LOGID"); if (!TextUtils.isEmpty(str3)) { return str3; } } return ""; } }
[ "test@gmail.com" ]
test@gmail.com
4dbb4d24d41352c1c4e0c6d2fb1490824420b8f5
489390ba13ce6b1d4edcb401c87af42805b1a7a1
/mic-gateway/src/main/java/com/mic/gateway/auth/JsonAccessDeniedHandler.java
aaca0bd7e765e06076dc295f70dacca31a4f0370
[ "Apache-2.0" ]
permissive
pf-oss/mic-frame
f9a0be25f9212941103740bc7f1fc6357b2e5fac
235a73f0ac15f385bd1d4e103c76a439997d875b
refs/heads/main
2023-03-09T08:32:35.235670
2021-02-03T06:11:20
2021-02-03T06:11:20
328,859,413
4
0
null
null
null
null
UTF-8
Java
false
false
815
java
package com.mic.gateway.auth; import com.mic.gateway.util.WebfluxResponseUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.web.server.authorization.ServerAccessDeniedHandler; import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Mono; /** * @Description: 403拒绝访问异常处理,转换为JSON * @author: pf * @create: 2021/1/14 16:32 */ @Slf4j public class JsonAccessDeniedHandler implements ServerAccessDeniedHandler { @Override public Mono<Void> handle(ServerWebExchange exchange, AccessDeniedException e) { return WebfluxResponseUtil.responseFailed(exchange, HttpStatus.FORBIDDEN.value(), e.getMessage()); } }
[ "pengfei.yao@yunlsp.com" ]
pengfei.yao@yunlsp.com
811ffa8ec0d63c01d7aa124cab331dda708d504d
2e6ae6c6a948bfa7815e6bf526630f865846926a
/src/main/java/com/spring/pontointeligente/api/security/dto/TokenDto.java
95b84be2190457db4dcf85e0b1fd7730b831cf51
[ "MIT" ]
permissive
Norbertoooo/ponto-inteligente-api
4a55b4ea87a92e543af367a9f0381ee58efa81ac
9d7cf623bbb37b4a4c8159aae36f2eda5a532750
refs/heads/master
2021-05-23T13:20:45.289322
2020-04-13T04:03:38
2020-04-13T04:03:38
253,307,815
0
0
null
null
null
null
UTF-8
Java
false
false
346
java
package com.spring.pontointeligente.api.security.dto; public class TokenDto { private String token; public TokenDto() { } public TokenDto(String token) { this.token = token; } public String getToken() { return token; } public void setToken(String token) { this.token = token; } }
[ "vithor.norberto@gmail.com" ]
vithor.norberto@gmail.com
2e57f0e4f36a9ebdac9f729f6ec63f59785963ad
6437240eddd7c33372fccab081395d4c6d45aa92
/capitalExternoModulo/app/src/main/java/lojadigicom/com/br/capitalexternomodulo/app/BlankFragment.java
fee77635967365ba010fab252c4f8b72b3223e73
[]
no_license
paulofor/projeto-android-aplicacao
49a530533496ec4a11dcb0a86ed9e9b75f2f9a4a
2aa9c244a830f12cf120f45727d7474203619c59
refs/heads/master
2021-01-05T06:04:29.225920
2020-02-16T14:45:25
2020-02-16T14:45:25
240,908,240
0
0
null
null
null
null
UTF-8
Java
false
false
3,803
java
package lojadigicom.com.br.capitalexternomodulo.app; import android.content.Context; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import lojadigicom.com.br.capitalexternomodulo.R; /** * A simple {@link Fragment} subclass. * Activities that contain this fragment must implement the * {@link BlankFragment.OnFragmentInteractionListener} interface * to handle interaction events. * Use the {@link BlankFragment#newInstance} factory method to * create an instance of this fragment. */ public class BlankFragment extends Fragment { // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2"; // TODO: Rename and change types of parameters private String mParam1; private String mParam2; private OnFragmentInteractionListener mListener; public BlankFragment() { // Required empty public constructor } /** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @param param1 Parameter 1. * @param param2 Parameter 2. * @return A new instance of fragment BlankFragment. */ // TODO: Rename and change types and number of parameters public static BlankFragment newInstance(String param1, String param2) { BlankFragment fragment = new BlankFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_blank, container, false); } // TODO: Rename method, update argument and hook method into UI event public void onButtonPressed(Uri uri) { if (mListener != null) { mListener.onFragmentInteraction(uri); } } @Override public void onAttach(Context context) { super.onAttach(context); if (context instanceof OnFragmentInteractionListener) { mListener = (OnFragmentInteractionListener) context; } else { throw new RuntimeException(context.toString() + " must implement OnFragmentInteractionListener"); } } @Override public void onDetach() { super.onDetach(); mListener = null; } /** * This interface must be implemented by activities that contain this * fragment to allow an interaction in this fragment to be communicated * to the activity and potentially other fragments contained in that * activity. * <p> * See the Android Training lesson <a href= * "http://developer.android.com/training/basics/fragments/communicating.html" * >Communicating with Other Fragments</a> for more information. */ public interface OnFragmentInteractionListener { // TODO: Update argument type and name void onFragmentInteraction(Uri uri); } }
[ "paulofore@gmail.com" ]
paulofore@gmail.com
9c78120cdf5887341c8809d24658cf91c020ad4c
684732efc4909172df38ded729c0972349c58b67
/io-maven/src/main/java/org/jeesl/model/ejb/io/maven/dependency/IoMavenVersion.java
272e0aeb5f4343ee26c62e097537e6ffdc49acd7
[]
no_license
aht-group/jeesl
2c4683e8c1e9d9e9698d044c6a89a611b8dfe1e7
3f4bfca6cf33f60549cac23f3b90bf1218c9daf9
refs/heads/master
2023-08-13T20:06:38.593666
2023-08-12T06:59:51
2023-08-12T06:59:51
39,823,889
0
9
null
2022-12-13T18:35:24
2015-07-28T09:06:11
Java
UTF-8
Java
false
false
2,517
java
package org.jeesl.model.ejb.io.maven.dependency; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.validation.constraints.NotNull; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.jeesl.interfaces.model.io.maven.dependency.JeeslIoMavenVersion; import org.jeesl.interfaces.qualifier.er.EjbErNode; @Entity @Table(name="IoMavenVersion") @EjbErNode(name="Version",category="ioMaven",subset="ioMaven") public class IoMavenVersion implements JeeslIoMavenVersion<IoMavenArtifact,IoMavenOutdate,IoMavenMaintainer> { public static final long serialVersionUID=1; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private long id; @Override public long getId() {return id;} @Override public void setId(long id) {this.id = id;} @Override public String resolveParentAttribute() {return JeeslIoMavenVersion.Attributes.artifact.toString();} @ManyToOne @NotNull private IoMavenArtifact artifact; @Override public IoMavenArtifact getArtifact() {return artifact;} @Override public void setArtifact(IoMavenArtifact artifact) {this.artifact = artifact;} private int position; @Override public int getPosition() {return position;} @Override public void setPosition(int position) {this.position = position;} private String code; @Override public String getCode() {return code;} @Override public void setCode(String code) {this.code = code;} private String label; @Override public String getLabel() {return label;} @Override public void setLabel(String label) {this.label = label;} @ManyToOne @NotNull private IoMavenOutdate outdate; @Override public IoMavenOutdate getOutdate() {return outdate;} @Override public void setOutdate(IoMavenOutdate outdate) {this.outdate = outdate;} @ManyToOne private IoMavenMaintainer maintainer; @Override public IoMavenMaintainer getMaintainer() {return maintainer;} @Override public void setMaintainer(IoMavenMaintainer maintainer) {this.maintainer = maintainer;} @Override public boolean equals(Object object){return (object instanceof IoMavenVersion) ? id == ((IoMavenVersion) object).getId() : (object == this);} @Override public int hashCode() {return new HashCodeBuilder(17,53).append(id).toHashCode();} @Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append("[").append(id).append("]"); return sb.toString(); } }
[ "t.kisner@web.de" ]
t.kisner@web.de
1b78fb3f8dda7abaa186b32b3c83117a20ffdada
7f261a1e2bafd1cdd98d58f00a2937303c0dc942
/src/ANXCamera/sources/miui/view/animation/CubicEaseOutInterpolator.java
bceeca56f46bee75d5951b07eb23601de79a0f65
[]
no_license
xyzuan/ANXCamera
7614ddcb4bcacdf972d67c2ba17702a8e9795c95
b9805e5197258e7b980e76a97f7f16de3a4f951a
refs/heads/master
2022-04-23T16:58:09.592633
2019-05-31T17:18:34
2019-05-31T17:26:48
259,555,505
3
0
null
2020-04-28T06:49:57
2020-04-28T06:49:57
null
UTF-8
Java
false
false
259
java
package miui.view.animation; import android.view.animation.Interpolator; public class CubicEaseOutInterpolator implements Interpolator { public float getInterpolation(float f) { float f2 = f - 1.0f; return (f2 * f2 * f2) + 1.0f; } }
[ "sv.xeon@gmail.com" ]
sv.xeon@gmail.com
c7ab57265dfaf0a8d78369aeb6bb559f473b6b9e
ad0d6bace379d8f475baf0cd92e50fd0db48db03
/app/src/main/java/com/me/geekpracticedemo/model/http/response/WXHttpResponse.java
451fa98ce6caf75897123abecfa8eeb745681f54
[]
no_license
OrzzrO/TestDemo
64ac7711016e2584e19f7acd3eda7e35d215ec17
f990cbd779c8ce7997a7a0371440033a3fe8acb6
refs/heads/master
2021-01-01T15:47:18.804494
2017-07-29T10:31:14
2017-07-29T10:31:14
97,701,622
0
0
null
null
null
null
UTF-8
Java
false
false
595
java
package com.me.geekpracticedemo.model.http.response; /** * Created by codeest on 16/8/28. */ public class WXHttpResponse<T> { private int code; private String msg; private T newslist; public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public T getNewslist() { return newslist; } public void setNewslist(T newslist) { this.newslist = newslist; } }
[ "user" ]
user
1728892c34d3caeb7472182485ee3981eb04b393
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a018/A018209Test.java
dc7722d24d9e2e65ec03232195328a9db782d739
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a018; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A018209Test extends AbstractSequenceTest { }
[ "sairvin@gmail.com" ]
sairvin@gmail.com
cf48ef6ab3fbacb664323e0683867dfd8b83b6a5
d6d6d23bd7ee019324e3f669fd8d46fc0f600554
/schemacrawler-text/src/main/java/schemacrawler/tools/command/text/schema/options/TextOutputFormat.java
8e140bd7a5e7e2332f52dc232d41c45946790ad5
[]
no_license
MBGSSCops/SchemaCrawler
cd8e037d1e0dbff8af9321e9261b32a943a765cb
27e0a64cf0e06ddc852a1c47afb70dea1cc5deb6
refs/heads/master
2023-03-02T00:19:56.535805
2021-02-07T23:01:48
2021-02-07T23:01:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,503
java
/* ======================================================================== SchemaCrawler http://www.schemacrawler.com Copyright (c) 2000-2021, Sualeh Fatehi <sualeh@hotmail.com>. All rights reserved. ------------------------------------------------------------------------ SchemaCrawler 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. SchemaCrawler and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, GNU General Public License v3 or GNU Lesser General Public License v3. You may elect to redistribute this code under any of these licenses. The Eclipse Public License is available at: http://www.eclipse.org/legal/epl-v10.html The GNU General Public License v3 and the GNU Lesser General Public License v3 are available at: http://www.gnu.org/licenses/ ======================================================================== */ package schemacrawler.tools.command.text.schema.options; import static us.fatehi.utility.Utility.isBlank; import java.util.List; import java.util.logging.Level; import schemacrawler.SchemaCrawlerLogger; import schemacrawler.tools.options.OutputFormat; import schemacrawler.tools.options.OutputFormatState; import us.fatehi.utility.string.StringFormat; /** Enumeration for text format type. */ public enum TextOutputFormat implements OutputFormat { text("Plain text format", "txt"), html("HyperText Markup Language (HTML) format"), tsv("Tab-separated values (TSV) format"); private static final SchemaCrawlerLogger LOGGER = SchemaCrawlerLogger.getLogger(TextOutputFormat.class.getName()); /** * Gets the value from the format. * * @param format Text output format. * @return TextOutputFormat */ public static TextOutputFormat fromFormat(final String format) { final TextOutputFormat outputFormat = fromFormatOrNull(format); if (outputFormat == null) { LOGGER.log(Level.CONFIG, new StringFormat("Unknown format <%s>, using default", format)); return text; } else { return outputFormat; } } /** * Checks if the value of the format is supported. * * @return True if the format is a text output format */ public static boolean isSupportedFormat(final String format) { return fromFormatOrNull(format) != null; } private static TextOutputFormat fromFormatOrNull(final String format) { if (isBlank(format)) { return null; } for (final TextOutputFormat outputFormat : TextOutputFormat.values()) { if (outputFormat.outputFormatState.isSupportedFormat(format)) { return outputFormat; } } return null; } private final OutputFormatState outputFormatState; private TextOutputFormat(final String description) { outputFormatState = new OutputFormatState(name(), description); } private TextOutputFormat(final String description, final String... additionalFormatSpecifiers) { outputFormatState = new OutputFormatState(name(), description, additionalFormatSpecifiers); } @Override public String getDescription() { return outputFormatState.getDescription(); } @Override public String getFormat() { return outputFormatState.getFormat(); } @Override public List<String> getFormats() { return outputFormatState.getFormats(); } @Override public String toString() { return outputFormatState.toString(); } }
[ "sualeh@hotmail.com" ]
sualeh@hotmail.com
fa47eb653819a49597358afc085e5bbbf11aa93c
435cc8c38474bdd0276208b502f3ca91145141d9
/crm-ejb/src/main/java/br/com/questor/crm/data/OportunidadeContatoListProducer.java
3453e742852fcba85ee6f427ec1bd303ce0f82e9
[]
no_license
estevandiedrich/questorcrm
d677e467d4e88f924e4b32c74e845d2d14bff080
b2220f1052f9df981c0e9e7ed97992afd1cfd834
refs/heads/master
2021-01-10T22:28:19.018299
2016-05-04T04:16:25
2016-05-04T04:16:25
52,612,297
0
0
null
null
null
null
UTF-8
Java
false
false
2,213
java
package br.com.questor.crm.data; import java.util.List; import javax.annotation.PostConstruct; import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Observes; import javax.enterprise.event.Reception; import javax.enterprise.inject.Produces; import javax.inject.Inject; import javax.inject.Named; import javax.persistence.EntityManager; import br.com.questor.crm.model.Oportunidade; import br.com.questor.crm.model.OportunidadeContato; @RequestScoped public class OportunidadeContatoListProducer { @Inject private EntityManager em; private List<OportunidadeContato> oportunidadeContatos; @Produces @Named public List<OportunidadeContato> getOportunidadeContatos() { return oportunidadeContatos; } public void onOportunidadeContatoListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final OportunidadeContato oportunidade) { retrieveAllOportunidadeContatosOrderedByNome(); } @PostConstruct public void retrieveAllOportunidadeContatosOrderedByNome() { // CriteriaBuilder cb = em.getCriteriaBuilder(); // CriteriaQuery<OportunidadeContato> criteria = cb.createQuery(OportunidadeContato.class); // Root<OportunidadeContato> cliente = criteria.from(OportunidadeContato.class); // criteria.select(cliente).orderBy(cb.asc(cliente.get("nome"))); // oportunidadeContatos = em.createQuery(criteria).getResultList(); oportunidadeContatos = em.createNamedQuery("OportunidadeContato.findAll").getResultList(); } public List<OportunidadeContato> retrieveAllOportunidadeContatosByOportunidade(Oportunidade oportunidade) { // CriteriaBuilder cb = em.getCriteriaBuilder(); // CriteriaQuery<OportunidadeContato> criteria = cb.createQuery(OportunidadeContato.class); // Root<OportunidadeContato> cidade = criteria.from(OportunidadeContato.class); // criteria.select(cidade).where(cb.equal(cidade.get("uf"), uf)).orderBy(cb.asc(cidade.get("nome"))); // return em.createQuery(criteria).getResultList(); @SuppressWarnings(value = "unchecked") List<OportunidadeContato> oportunidadeContatos = em.createNamedQuery("OportunidadeContato.findByOportunidade").setParameter("oportunidade", oportunidade.getId()).getResultList(); return oportunidadeContatos; } }
[ "estevan.diedrich@gmail.com" ]
estevan.diedrich@gmail.com
b5019023066bc7d4416e8c351fba36df8432c266
056ff5f928aec62606f95a6f90c2865dc126bddc
/javashop/shop-core/src/main/java/com/enation/app/shop/component/payment/plugin/alipay/sdk34/api/request/AlipayZdatafrontDatatransferedSendRequest.java
76a64f7b7ffdcc2dce70c9cd1080886f13074d9f
[]
no_license
luobintianya/javashop
7846c7f1037652dbfdd57e24ae2c38237feb1104
ac15b14e8f6511afba93af60e8878ff44e380621
refs/heads/master
2022-11-17T11:12:39.060690
2019-09-04T08:57:58
2019-09-04T08:57:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,163
java
package com.enation.app.shop.component.payment.plugin.alipay.sdk34.api.request; import java.util.Map; import com.enation.app.shop.component.payment.plugin.alipay.sdk34.api.AlipayObject; import com.enation.app.shop.component.payment.plugin.alipay.sdk34.api.AlipayRequest; import com.enation.app.shop.component.payment.plugin.alipay.sdk34.api.internal.util.AlipayHashMap; import com.enation.app.shop.component.payment.plugin.alipay.sdk34.api.response.AlipayZdatafrontDatatransferedSendResponse; /** * ALIPAY API: alipay.zdatafront.datatransfered.send request * * @author auto create * @since 1.0, 2017-05-18 11:27:33 */ public class AlipayZdatafrontDatatransferedSendRequest implements AlipayRequest<AlipayZdatafrontDatatransferedSendResponse> { private AlipayHashMap udfParams; // add user-defined text parameters private String apiVersion="1.0"; /** * 数据字段,identity对应的其他数据字段。使用json格式组织,且仅支持字符串类型,其他类型请转为字符串。 */ private String data; /** * 合作伙伴的主键数据,同一合作伙伴要保证该字段唯一,若出现重复,后入数据会覆盖先入数据。使用json格式组织,且仅支持字符串类型,其他类型请转为字符串。 */ private String identity; /** * 合作伙伴标识字段,用来区分数据来源。建议使用公司域名或公司名。 */ private String typeId; public void setData(String data) { this.data = data; } public String getData() { return this.data; } public void setIdentity(String identity) { this.identity = identity; } public String getIdentity() { return this.identity; } public void setTypeId(String typeId) { this.typeId = typeId; } public String getTypeId() { return this.typeId; } private String terminalType; private String terminalInfo; private String prodCode; private String notifyUrl; private String returnUrl; private boolean needEncrypt=false; private AlipayObject bizModel=null; public String getNotifyUrl() { return this.notifyUrl; } public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; } public String getReturnUrl() { return this.returnUrl; } public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; } public String getApiVersion() { return this.apiVersion; } public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } public void setTerminalType(String terminalType){ this.terminalType=terminalType; } public String getTerminalType(){ return this.terminalType; } public void setTerminalInfo(String terminalInfo){ this.terminalInfo=terminalInfo; } public String getTerminalInfo(){ return this.terminalInfo; } public void setProdCode(String prodCode) { this.prodCode=prodCode; } public String getProdCode() { return this.prodCode; } public String getApiMethodName() { return "alipay.zdatafront.datatransfered.send"; } public Map<String, String> getTextParams() { AlipayHashMap txtParams = new AlipayHashMap(); txtParams.put("data", this.data); txtParams.put("identity", this.identity); txtParams.put("type_id", this.typeId); if(udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } public void putOtherTextParam(String key, String value) { if(this.udfParams == null) { this.udfParams = new AlipayHashMap(); } this.udfParams.put(key, value); } public Class<AlipayZdatafrontDatatransferedSendResponse> getResponseClass() { return AlipayZdatafrontDatatransferedSendResponse.class; } public boolean isNeedEncrypt() { return this.needEncrypt; } public void setNeedEncrypt(boolean needEncrypt) { this.needEncrypt=needEncrypt; } public AlipayObject getBizModel() { return this.bizModel; } public void setBizModel(AlipayObject bizModel) { this.bizModel=bizModel; } }
[ "sylow@javashop.cn" ]
sylow@javashop.cn
8b67c12ddc371ddcc3d3a42c531cd4ae0219beb0
a9349b7dd952a294103ffbc76bc51dde00ce65f8
/jingwei-task-monitor/src/main/java/org/sxdata/jingwei/entity/TaskUserRelationEntity.java
1b90c749a55658fa314e954b526748bffc0c8335
[ "Apache-2.0" ]
permissive
wolkai/webkettle
776ac9b0193288dcddc9aca685fce75b4f433e81
7b76dd845d5a5898cd26f6162cfc50d97ec60e62
refs/heads/master
2020-11-26T02:39:12.534704
2019-09-02T01:28:12
2019-09-02T01:28:12
228,940,145
2
5
Apache-2.0
2019-12-18T23:47:48
2019-12-18T23:47:47
null
UTF-8
Java
false
false
913
java
package org.sxdata.jingwei.entity; /** * Created by cRAZY on 2017/4/13. */ public class TaskUserRelationEntity { private Integer relationId; private String userGroupName; private String taskGroupName; private Integer type; public Integer getRelationId() { return relationId; } public void setRelationId(Integer relationId) { this.relationId = relationId; } public String getUserGroupName() { return userGroupName; } public void setUserGroupName(String userGroupName) { this.userGroupName = userGroupName; } public String getTaskGroupName() { return taskGroupName; } public void setTaskGroupName(String taskGroupName) { this.taskGroupName = taskGroupName; } public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } }
[ "2434387555@qq.com" ]
2434387555@qq.com
3bf0634fa5c7be03b0c7131e53901a6752d36162
e08ee36b9b4e5319b6a82e471f6e9aac7c248250
/playgrounds/agarwalamit/src/main/java/playground/agarwalamit/mixedTraffic/plots/AgentPositionWriter.java
94d97287a4c506e979d5b56ac26138c1c9175f6a
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
junliu1234/matsim
0486e932f435d6226c9291c19de907589dc42ae5
2efca75d58c8d896ff241ab089cd6718c00ac2b6
refs/heads/master
2021-01-22T11:21:04.973923
2015-12-28T23:08:26
2015-12-28T23:08:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,796
java
/* *********************************************************************** * * project: org.matsim.* * * * *********************************************************************** * * * * copyright : (C) 2015 by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot 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 2 of the License, or * * (at your option) any later version. * * See also COPYING, LICENSE and WARRANTY file * * * * *********************************************************************** */ package playground.agarwalamit.mixedTraffic.plots; import java.io.BufferedWriter; import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.events.PersonDepartureEvent; import org.matsim.api.core.v01.events.handler.PersonDepartureEventHandler; import org.matsim.api.core.v01.population.Person; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.config.groups.QSimConfigGroup.SnapshotStyle; import org.matsim.core.events.EventsUtils; import org.matsim.core.events.MatsimEventsReader; import org.matsim.core.utils.io.IOUtils; import org.matsim.core.utils.io.tabularFileParser.TabularFileHandler; import org.matsim.core.utils.io.tabularFileParser.TabularFileParser; import org.matsim.core.utils.io.tabularFileParser.TabularFileParserConfig; import org.matsim.run.Events2Snapshot; import org.matsim.vis.snapshotwriters.TransimsSnapshotWriter.Labels; import playground.agarwalamit.utils.LoadMyScenarios; /** * Create Transims snapshot file from events and * read it again to write data in simpler form for space time plotting. * <b>At the moment, this should be only used for race track experiment. The methodology can work for other scenarios. * But, some paraments many need to change and yet to be tested. * @author amit */ public class AgentPositionWriter { private final static double snapshotPeriod = 10; private final double trackLength = 3000; public static void main(String[] args) { final String dir = "../../../../repos/shared-svn/projects/mixedTraffic/triangularNetwork/run313/xtPlots/holes/car/"; final String networkFile = dir+"/network.xml"; final String configFile = dir+"/config.xml"; final String prefix = "events[400]"; final String eventsFile = dir+"/events/"+prefix+".xml"; Scenario sc = LoadMyScenarios.loadScenarioFromNetworkAndConfig(networkFile, configFile); //sc.getConfig().qsim().setSnapshotStyle(SnapshotStyle.withHoles);// not supported sc.getConfig().qsim().setSnapshotStyle(SnapshotStyle.queue); sc.getConfig().qsim().setSnapshotPeriod(snapshotPeriod); sc.getConfig().controler().setSnapshotFormat(Arrays.asList("transims")); AgentPositionWriter apw = new AgentPositionWriter(dir+"rDataPersonPosition_"+prefix+".txt", sc, eventsFile); apw.run(); } /** * Constructor opens writer, creates transims file and stores person 2 mode from events file. */ public AgentPositionWriter(String outFile, Scenario scenario, String eventsFile) { writer = IOUtils.getBufferedWriter(outFile); try { writer.write("personId \t legMode \t postionOnLink \t time \t speed \n"); } catch (Exception e) { throw new RuntimeException("Data is not written to the file. Reason :"+e); } createTransimSnapshotFile(scenario, eventsFile); storePerson2Modes(eventsFile); } private void createTransimSnapshotFile(Scenario sc, String eventsFile) { Events2Snapshot e2s = new Events2Snapshot(); File file = new File(eventsFile); e2s.run(file, sc.getConfig(), sc.getNetwork()); this.transimFile = file.getParent() + "/" +"T.veh"; } private void storePerson2Modes(String eventsFile) { EventsManager manager = EventsUtils.createEventsManager(); manager.addHandler(new PersonDepartureEventHandler() { @Override public void reset(int iteration) { person2mode.clear(); } @Override public void handleEvent(PersonDepartureEvent event) { person2mode.put(event.getPersonId(), event.getLegMode()); } }); new MatsimEventsReader(manager).readFile(eventsFile); } private String transimFile; private BufferedWriter writer ; private Map<Id<Person>,String> person2mode = new HashMap<>(); private Map<Id<Person>,Double> prevEasting = new HashMap<>(); private Map<Id<Person>,Double> prevNorthing = new HashMap<>(); private Map<Id<Person>,Double> prevPosition = new HashMap<>(); public void run() { TabularFileParserConfig config = new TabularFileParserConfig() ; config.setFileName( this.transimFile ); config.setDelimiterTags( new String []{"\t"} ); // --- TabularFileHandler handler = new TabularFileHandler(){ List<String> labels = new ArrayList<>() ; @Override public void startRow(String[] row) { List<String> strs = Arrays.asList( row ) ; if ( row[0].substring(0, 1).matches("[A-Za-z]") ) { for ( String str : strs ) { labels.add( str ) ; } } else { double time = Double.parseDouble( strs.get( labels.indexOf( Labels.TIME.toString() ) ) ) ; double easting = Double.parseDouble( strs.get( labels.indexOf( Labels.EASTING.toString() ) ) ) ; double northing = Double.parseDouble( strs.get( labels.indexOf( Labels.NORTHING.toString() ) ) ) ; // double velocity = Double.parseDouble( strs.get( labels.indexOf( Labels.VELOCITY.toString() ) ) ) ; Id<Person> agentId = Id.createPersonId( strs.get( labels.indexOf( Labels.VEHICLE.toString() ) ) ) ; if(agentId.toString().equals("268") && time == 2440.0) { System.out.println(strs); } try { if( prevEasting.containsKey(agentId) ){ double currentDist = Math.sqrt( (easting - prevEasting.get(agentId))*(easting - prevEasting.get(agentId)) + (northing- prevNorthing.get(agentId))*(northing- prevNorthing.get(agentId)) ); double velocity = currentDist / (snapshotPeriod); // denominator should be equal to snapshot period. double postion = prevPosition.get(agentId) + currentDist ; postion = postion >= trackLength ? postion-trackLength : postion; writer.write(agentId+"\t"+person2mode.get(agentId)+"\t"+postion+"\t"+time+"\t"+velocity+"\n"); prevPosition.put(agentId, postion); } else { double velocity = 16.67; writer.write(agentId+"\t"+person2mode.get(agentId)+"\t"+0.+"\t"+time+"\t"+velocity+"\n"); prevPosition.put(agentId, 0.); } prevEasting.put(agentId, easting); prevNorthing.put(agentId, northing); } catch (Exception e) { throw new RuntimeException("Data is not written to the file. Reason :"+e); } } } } ; TabularFileParser reader = new TabularFileParser() ; reader.parse(config, handler); try{ writer.close(); } catch (Exception e) { throw new RuntimeException("Data is not written to the file. Reason :"+e); } } }
[ "amit.agarwal@campus.tu-berlin.de" ]
amit.agarwal@campus.tu-berlin.de
a41b33a0bfbc5d796f7903182ca08a99fcfb1f9f
da90b73fc89fa5582855b13c76b7469de45dd53c
/lc_160_IntersectionTwoLinkedLists/src/LinkedListIntersection.java
102349fda49f2afd465a37c87401f75b0eaaf3b4
[]
no_license
mbhushan/algods-java
209b424ee73361768b5caabb81c346d41b40bf44
9db5e663e835b04820e2b47e0c4140ca68ea8708
refs/heads/master
2021-01-22T08:30:08.365548
2018-11-25T04:20:26
2018-11-25T04:20:26
81,907,012
0
0
null
null
null
null
UTF-8
Java
false
false
1,638
java
/** 160. Intersection of Two Linked Lists https://leetcode.com/problems/intersection-of-two-linked-lists/description/ Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: A: a1 → a2 ↘ c1 → c2 → c3 ↗ B: b1 → b2 → b3 */ public class LinkedListIntersection { public static void main(String[] args) { } public ListNode getIntersectionNode(ListNode headA, ListNode headB) { if (headA == null || headB == null) { return null; } int lenA = 0; ListNode curr = headA; while (curr != null) { curr = curr.next; ++lenA; } int lenB = 0; curr = headB; while (curr != null) { curr = curr.next; ++lenB; } int diff = Math.abs(lenA - lenB); if (lenA > lenB) { while (diff > 0) { headA = headA.next; --diff; } } else if (lenB > lenA) { while (diff > 0) { headB = headB.next; --diff; } } while (headA != null && headB != null) { if (headA.equals(headB)) { return headA; } headA = headA.next; headB = headB.next; } return null; } } class ListNode { int val; ListNode next; ListNode(int x) { val = x; next = null; } }
[ "manibhushan.cs@gmail.com" ]
manibhushan.cs@gmail.com
a0cef3116c40f6446251acfefd4411dffcb8fa6a
291cdabe65fc6015b2a4b5ebdb7caa9c0a22ffc6
/src/main/java/com/mitrol/authentication/web/rest/errors/ExceptionTranslator.java
341f684d90080d5c265ab65d5b6c5f5be64aaa46
[]
no_license
mitroldevemail/authentication
07ba73710b00fb3186902969114c7e0d3dd2d43a
137e3eec021f5297a52674e65b9de937eae0e628
refs/heads/master
2020-04-05T12:16:34.541202
2018-11-09T13:06:20
2018-11-09T13:06:20
156,863,189
0
0
null
null
null
null
UTF-8
Java
false
false
4,817
java
package com.mitrol.authentication.web.rest.errors; import com.mitrol.authentication.web.rest.util.HeaderUtil; import org.springframework.dao.ConcurrencyFailureException; import org.springframework.http.ResponseEntity; import org.springframework.validation.BindingResult; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.context.request.NativeWebRequest; import org.zalando.problem.DefaultProblem; import org.zalando.problem.Problem; import org.zalando.problem.ProblemBuilder; import org.zalando.problem.Status; import org.zalando.problem.spring.web.advice.ProblemHandling; import org.zalando.problem.violations.ConstraintViolationProblem; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.NoSuchElementException; import java.util.stream.Collectors; /** * Controller advice to translate the server side exceptions to client-friendly json structures. * The error response follows RFC7807 - Problem Details for HTTP APIs (https://tools.ietf.org/html/rfc7807) */ @ControllerAdvice public class ExceptionTranslator implements ProblemHandling { /** * Post-process the Problem payload to add the message key for the front-end if needed */ @Override public ResponseEntity<Problem> process(@Nullable ResponseEntity<Problem> entity, NativeWebRequest request) { if (entity == null) { return entity; } Problem problem = entity.getBody(); if (!(problem instanceof ConstraintViolationProblem || problem instanceof DefaultProblem)) { return entity; } ProblemBuilder builder = Problem.builder() .withType(Problem.DEFAULT_TYPE.equals(problem.getType()) ? ErrorConstants.DEFAULT_TYPE : problem.getType()) .withStatus(problem.getStatus()) .withTitle(problem.getTitle()) .with("path", request.getNativeRequest(HttpServletRequest.class).getRequestURI()); if (problem instanceof ConstraintViolationProblem) { builder .with("violations", ((ConstraintViolationProblem) problem).getViolations()) .with("message", ErrorConstants.ERR_VALIDATION); } else { builder .withCause(((DefaultProblem) problem).getCause()) .withDetail(problem.getDetail()) .withInstance(problem.getInstance()); problem.getParameters().forEach(builder::with); if (!problem.getParameters().containsKey("message") && problem.getStatus() != null) { builder.with("message", "error.http." + problem.getStatus().getStatusCode()); } } return new ResponseEntity<>(builder.build(), entity.getHeaders(), entity.getStatusCode()); } @Override public ResponseEntity<Problem> handleMethodArgumentNotValid(MethodArgumentNotValidException ex, @Nonnull NativeWebRequest request) { BindingResult result = ex.getBindingResult(); List<FieldErrorVM> fieldErrors = result.getFieldErrors().stream() .map(f -> new FieldErrorVM(f.getObjectName(), f.getField(), f.getCode())) .collect(Collectors.toList()); Problem problem = Problem.builder() .withType(ErrorConstants.CONSTRAINT_VIOLATION_TYPE) .withTitle("Method argument not valid") .withStatus(defaultConstraintViolationStatus()) .with("message", ErrorConstants.ERR_VALIDATION) .with("fieldErrors", fieldErrors) .build(); return create(ex, problem, request); } @ExceptionHandler public ResponseEntity<Problem> handleNoSuchElementException(NoSuchElementException ex, NativeWebRequest request) { Problem problem = Problem.builder() .withStatus(Status.NOT_FOUND) .with("message", ErrorConstants.ENTITY_NOT_FOUND_TYPE) .build(); return create(ex, problem, request); } @ExceptionHandler public ResponseEntity<Problem> handleBadRequestAlertException(BadRequestAlertException ex, NativeWebRequest request) { return create(ex, request, HeaderUtil.createFailureAlert(ex.getEntityName(), ex.getErrorKey(), ex.getMessage())); } @ExceptionHandler public ResponseEntity<Problem> handleConcurrencyFailure(ConcurrencyFailureException ex, NativeWebRequest request) { Problem problem = Problem.builder() .withStatus(Status.CONFLICT) .with("message", ErrorConstants.ERR_CONCURRENCY_FAILURE) .build(); return create(ex, problem, request); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
8abe887a53a26bccef33b0c7770c4e95bf3d6562
a3ffde9031d5f8676e31d8498dbcf55be2e6f0e1
/src/main/java/io/github/jhipster/travis/web/rest/TestServiceImplResource.java
51e47e3757eca9f83a53a12505864e47ec7baecf
[]
no_license
pascalgrimaud/jhipster-ng1-mysql
ca72208f5cff8fa5fd5a00ecf80cc1a23c63d0a0
45afb5b0ffdc4acbcfa26e1fce110160c1a66dde
refs/heads/master
2020-12-30T10:37:40.841332
2017-08-01T05:46:37
2017-08-01T05:46:37
98,852,938
0
0
null
null
null
null
UTF-8
Java
false
false
5,443
java
package io.github.jhipster.travis.web.rest; import com.codahale.metrics.annotation.Timed; import io.github.jhipster.travis.domain.TestServiceImpl; import io.github.jhipster.travis.service.TestServiceImplService; import io.github.jhipster.travis.web.rest.util.HeaderUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; import java.util.stream.StreamSupport; /** * REST controller for managing TestServiceImpl. */ @RestController @RequestMapping("/api") public class TestServiceImplResource { private final Logger log = LoggerFactory.getLogger(TestServiceImplResource.class); private static final String ENTITY_NAME = "testServiceImpl"; private final TestServiceImplService testServiceImplService; public TestServiceImplResource(TestServiceImplService testServiceImplService) { this.testServiceImplService = testServiceImplService; } /** * POST /test-service-impls : Create a new testServiceImpl. * * @param testServiceImpl the testServiceImpl to create * @return the ResponseEntity with status 201 (Created) and with body the new testServiceImpl, or with status 400 (Bad Request) if the testServiceImpl has already an ID * @throws URISyntaxException if the Location URI syntax is incorrect */ @PostMapping("/test-service-impls") @Timed public ResponseEntity<TestServiceImpl> createTestServiceImpl(@RequestBody TestServiceImpl testServiceImpl) throws URISyntaxException { log.debug("REST request to save TestServiceImpl : {}", testServiceImpl); if (testServiceImpl.getId() != null) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "idexists", "A new testServiceImpl cannot already have an ID")).body(null); } TestServiceImpl result = testServiceImplService.save(testServiceImpl); return ResponseEntity.created(new URI("/api/test-service-impls/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())) .body(result); } /** * PUT /test-service-impls : Updates an existing testServiceImpl. * * @param testServiceImpl the testServiceImpl to update * @return the ResponseEntity with status 200 (OK) and with body the updated testServiceImpl, * or with status 400 (Bad Request) if the testServiceImpl is not valid, * or with status 500 (Internal Server Error) if the testServiceImpl couldn't be updated * @throws URISyntaxException if the Location URI syntax is incorrect */ @PutMapping("/test-service-impls") @Timed public ResponseEntity<TestServiceImpl> updateTestServiceImpl(@RequestBody TestServiceImpl testServiceImpl) throws URISyntaxException { log.debug("REST request to update TestServiceImpl : {}", testServiceImpl); if (testServiceImpl.getId() == null) { return createTestServiceImpl(testServiceImpl); } TestServiceImpl result = testServiceImplService.save(testServiceImpl); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, testServiceImpl.getId().toString())) .body(result); } /** * GET /test-service-impls : get all the testServiceImpls. * * @param filter the filter of the request * @return the ResponseEntity with status 200 (OK) and the list of testServiceImpls in body */ @GetMapping("/test-service-impls") @Timed public List<TestServiceImpl> getAllTestServiceImpls(@RequestParam(required = false) String filter) { if ("testonetoone-is-null".equals(filter)) { log.debug("REST request to get all TestServiceImpls where testOneToOne is null"); return testServiceImplService.findAllWhereTestOneToOneIsNull(); } log.debug("REST request to get all TestServiceImpls"); return testServiceImplService.findAll(); } /** * GET /test-service-impls/:id : get the "id" testServiceImpl. * * @param id the id of the testServiceImpl to retrieve * @return the ResponseEntity with status 200 (OK) and with body the testServiceImpl, or with status 404 (Not Found) */ @GetMapping("/test-service-impls/{id}") @Timed public ResponseEntity<TestServiceImpl> getTestServiceImpl(@PathVariable Long id) { log.debug("REST request to get TestServiceImpl : {}", id); TestServiceImpl testServiceImpl = testServiceImplService.findOne(id); return ResponseUtil.wrapOrNotFound(Optional.ofNullable(testServiceImpl)); } /** * DELETE /test-service-impls/:id : delete the "id" testServiceImpl. * * @param id the id of the testServiceImpl to delete * @return the ResponseEntity with status 200 (OK) */ @DeleteMapping("/test-service-impls/{id}") @Timed public ResponseEntity<Void> deleteTestServiceImpl(@PathVariable Long id) { log.debug("REST request to delete TestServiceImpl : {}", id); testServiceImplService.delete(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build(); } }
[ "pascalgrimaud@gmail.com" ]
pascalgrimaud@gmail.com
ac1feafb9a2e1a41e6a0ca5d4ae01b86411f4e6a
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdas/applicationModule/src/test/java/applicationModulepackageJava1/Foo142Test.java
32f7e2972c98cd1ecac5583998f38a882b7f501b
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
481
java
package applicationModulepackageJava1; import org.junit.Test; public class Foo142Test { @Test public void testFoo0() { new Foo142().foo0(); } @Test public void testFoo1() { new Foo142().foo1(); } @Test public void testFoo2() { new Foo142().foo2(); } @Test public void testFoo3() { new Foo142().foo3(); } @Test public void testFoo4() { new Foo142().foo4(); } @Test public void testFoo5() { new Foo142().foo5(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
1fda3890aceca04ca04052bb7e76d3e328c95717
3ca53c13d2953805c00406476ceda9684887a8ad
/src/com/iwxxm/taf/CodeYesNoType.java
b428c868219e155cc2ff98326284d6b33d2f0653
[]
no_license
yw2017051032/tac2iwxxm
ae93c12b08b7316cd59de032d4ae2e8082bc6c0b
5a08cb9ecd0833fd4435bf6db81a2b8126380ec1
refs/heads/master
2020-03-17T03:03:06.671868
2018-06-05T16:55:59
2018-06-05T17:06:03
133,217,637
3
0
null
null
null
null
GB18030
Java
false
false
2,322
java
// // 此文件是由 JavaTM Architecture for XML Binding (JAXB) 引用实现 v2.2.8-b130911.1802 生成的 // 请访问 <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // 在重新编译源模式时, 对此文件的所有修改都将丢失。 // 生成时间: 2018.04.04 时间 07:08:22 PM CST // package com.iwxxm.taf; 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.XmlValue; /** * <p>CodeYesNoType complex type的 Java 类。 * * <p>以下模式片段指定包含在此类中的预期内容。 * * <pre> * &lt;complexType name="CodeYesNoType"> * &lt;simpleContent> * &lt;extension base="&lt;http://www.aixm.aero/schema/5.1.1>CodeYesNoBaseType"> * &lt;attribute name="nilReason" type="{http://www.opengis.net/gml/3.2}NilReasonEnumeration" /> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CodeYesNoType", namespace = "http://www.aixm.aero/schema/5.1.1", propOrder = { "value" }) public class CodeYesNoType { @XmlValue protected String value; @XmlAttribute(name = "nilReason") protected String nilReason; /** * 获取value属性的值。 * * @return * possible object is * {@link String } * */ public String getValue() { return value; } /** * 设置value属性的值。 * * @param value * allowed object is * {@link String } * */ public void setValue(String value) { this.value = value; } /** * 获取nilReason属性的值。 * * @return * possible object is * {@link String } * */ public String getNilReason() { return nilReason; } /** * 设置nilReason属性的值。 * * @param value * allowed object is * {@link String } * */ public void setNilReason(String value) { this.nilReason = value; } }
[ "852406820@qq.com" ]
852406820@qq.com