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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
916ccaa59a36f0cf55c7de128a051e4731c8aee7
|
4699df8f9a56ec0b09e36d6089761a6d8c8ae147
|
/framework/bundles/org.jboss.tools.rsp.server.spi/src/main/java/org/jboss/tools/rsp/server/spi/servertype/IServer.java
|
0786498caeba0d9338114573a655ca1fb34e83d4
|
[] |
no_license
|
adietish/rsp-server
|
7286e042490100b5fad8accc4962b67f44332e96
|
38eb5fb0c445b96ae2468041b12eac6079bddc2c
|
refs/heads/master
| 2020-03-27T08:34:51.490734
| 2018-12-14T12:20:36
| 2018-12-14T12:20:36
| 146,269,085
| 0
| 0
| null | 2019-05-14T15:27:42
| 2018-08-27T08:27:43
|
Java
|
UTF-8
|
Java
| false
| false
| 1,116
|
java
|
/*******************************************************************************
* Copyright (c) 2018 Red Hat, Inc. Distributed under license by Red Hat, Inc.
* All rights reserved. This program is 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: Red Hat, Inc.
******************************************************************************/
package org.jboss.tools.rsp.server.spi.servertype;
import org.jboss.tools.rsp.eclipse.core.runtime.CoreException;
import org.jboss.tools.rsp.eclipse.core.runtime.IProgressMonitor;
import org.jboss.tools.rsp.server.spi.model.IServerManagementModel;
public interface IServer extends IServerAttributes {
String getId();
String getTypeId();
IServerType getServerType();
IServerDelegate getDelegate();
void save(IProgressMonitor monitor) throws CoreException;
void load(IProgressMonitor monitor) throws CoreException;
void delete() throws CoreException;
IServerManagementModel getServerManagementModel();
}
|
[
"rob@oxbeef.net"
] |
rob@oxbeef.net
|
0e0b60f354bc933d31e9234c77a1d9c8373326ce
|
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
|
/methods/Method_45903.java
|
af6c19f937d2a1b296e033c410b1e60c18c6d222
|
[] |
no_license
|
P79N6A/icse_20_user_study
|
5b9c42c6384502fdc9588430899f257761f1f506
|
8a3676bc96059ea2c4f6d209016f5088a5628f3c
|
refs/heads/master
| 2020-06-24T08:25:22.606717
| 2019-07-25T15:31:16
| 2019-07-25T15:31:16
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 381
|
java
|
private void copyApplication(ConsumerConfig<T> consumerConfig,ReferenceConfig<T> referenceConfig){
ApplicationConfig applicationConfig=consumerConfig.getApplication();
com.alibaba.dubbo.config.ApplicationConfig dubboConfig=new com.alibaba.dubbo.config.ApplicationConfig();
dubboConfig.setName(applicationConfig.getAppName());
referenceConfig.setApplication(dubboConfig);
}
|
[
"sonnguyen@utdallas.edu"
] |
sonnguyen@utdallas.edu
|
1f610eb51992ef3f9d618164ff702b2b173580bd
|
23fc557f3f53a84d75a43d253cf0783f0f680af1
|
/emergency-service-model/src/main/java/com/wordpress/salaboy/model/EmergencyEntityBuilding.java
|
95c31b3a767247b9ca8f6c10bd64c1be14c5776f
|
[] |
no_license
|
technoSpino/emergency-service-drools-app
|
9cca8fcbca4965be3888fd2dc98b3b05d39330a6
|
6afccd187ee1baab200d06d056007cfad0f5e9bc
|
refs/heads/master
| 2021-01-16T00:04:04.500722
| 2011-06-23T16:04:30
| 2011-06-23T16:04:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 288
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.wordpress.salaboy.model;
/**
*
* @author salaboy
*/
public interface EmergencyEntityBuilding {
public int getX();
public int getY();
public String getName();
}
|
[
"salaboy@gmail.com"
] |
salaboy@gmail.com
|
820bfd528d97bb997042af5e3a592903fc0e765c
|
a2df6764e9f4350e0d9184efadb6c92c40d40212
|
/aliyun-java-sdk-sofa/src/main/java/com/aliyuncs/sofa/model/v20190815/QueryLinkeLinktLinkeiterationsResponse.java
|
583920b87b7711abbf55151d366965f5acf396f8
|
[
"Apache-2.0"
] |
permissive
|
warriorsZXX/aliyun-openapi-java-sdk
|
567840c4bdd438d43be6bd21edde86585cd6274a
|
f8fd2b81a5f2cd46b1e31974ff6a7afed111a245
|
refs/heads/master
| 2022-12-06T15:45:20.418475
| 2020-08-20T08:37:31
| 2020-08-26T06:17:49
| 290,450,773
| 1
| 0
|
NOASSERTION
| 2020-08-26T09:15:48
| 2020-08-26T09:15:47
| null |
UTF-8
|
Java
| false
| false
| 3,207
|
java
|
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.sofa.model.v20190815;
import java.util.List;
import com.aliyuncs.AcsResponse;
import com.aliyuncs.sofa.transform.v20190815.QueryLinkeLinktLinkeiterationsResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;
/**
* @author auto create
* @version
*/
public class QueryLinkeLinktLinkeiterationsResponse extends AcsResponse {
private String requestId;
private String resultCode;
private String resultMessage;
private Long errorCode;
private String errorMessage;
private Long responseStatusCode;
private Boolean success;
private List<DataItem> data;
public String getRequestId() {
return this.requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public String getResultCode() {
return this.resultCode;
}
public void setResultCode(String resultCode) {
this.resultCode = resultCode;
}
public String getResultMessage() {
return this.resultMessage;
}
public void setResultMessage(String resultMessage) {
this.resultMessage = resultMessage;
}
public Long getErrorCode() {
return this.errorCode;
}
public void setErrorCode(Long errorCode) {
this.errorCode = errorCode;
}
public String getErrorMessage() {
return this.errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public Long getResponseStatusCode() {
return this.responseStatusCode;
}
public void setResponseStatusCode(Long responseStatusCode) {
this.responseStatusCode = responseStatusCode;
}
public Boolean getSuccess() {
return this.success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public List<DataItem> getData() {
return this.data;
}
public void setData(List<DataItem> data) {
this.data = data;
}
public static class DataItem {
private String key;
private String label;
private String url;
public String getKey() {
return this.key;
}
public void setKey(String key) {
this.key = key;
}
public String getLabel() {
return this.label;
}
public void setLabel(String label) {
this.label = label;
}
public String getUrl() {
return this.url;
}
public void setUrl(String url) {
this.url = url;
}
}
@Override
public QueryLinkeLinktLinkeiterationsResponse getInstance(UnmarshallerContext context) {
return QueryLinkeLinktLinkeiterationsResponseUnmarshaller.unmarshall(this, context);
}
@Override
public boolean checkShowJsonItemName() {
return false;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
21172e43c02a260103015c882415d6d1e0d70090
|
d988416113114b32c3281178ccef34359b35f3f0
|
/app/src/main/java/th/co/thiensurat/toss_installer/utils/Constance.java
|
7349a66b4629fae069d97481c2b830e8ce38db09
|
[] |
no_license
|
tsrmobile/Toss_Installer
|
722a62512ad83994bbc2f508e782d3f672b8caec
|
e9bc0212dc330121b80744393e7d9848eb5563a0
|
refs/heads/master
| 2021-09-15T10:14:07.607379
| 2018-05-30T09:52:01
| 2018-05-30T09:52:03
| 111,386,906
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,760
|
java
|
package th.co.thiensurat.toss_installer.utils;
import android.Manifest;
/**
* Created by teerayut.k on 10/16/2017.
*/
public class Constance {
public static String DBNAME = "toss_installer.sqlite";
public static String TABLE_JOB = "job";
public static String TABLE_ADDRESS = "Address";
public static String TABLE_IMAGE = "image";
public static String TABLE_PRODUCT = "product";
public static String TABLE_INSTALL_ITEM = "install_item";
public static String TABLE_PROVINCE = "Province";
public static String TABLE_DISTRICT = "Amphur";
public static String TABLE_SUB_DISTRICT = "District";
public static String TABLE_STEP = "step";
public static String TABLE_PAYMENT = "payment";
public static String TABLE_DEPOSIT = "deposit";
public static int DB_CURRENT_VERSION = 38;
public static final String STEP_1 = "step_1";
public static final String STEP_2 = "step_2";
public static final String STEP_3 = "step_3";
public static final String STEP_4 = "step_4";
public static final String STEP_5 = "step_5";
public static final String STEP_6 = "step_6";
public static final String STEP_7 = "step_7";
public static final String printContactStatus = "productPrintContact";
public static final String printInstallStatus = "productPrintInstall";
public static String PRODUCT_STATUS_WAIT = "รอการติดตั้ง";
public static String PRODUCT_STATUS_READY = "พร้อมติดตั้ง";
public static String PRODUCT_STATUS_INSTALLED = "ติดตั้งแล้ว";
public static String IMAGE_TYPE_INSTALL = "install";
public static String IMAGE_TYPE_CARD = "card";
public static String IMAGE_TYPE_HOME = "home";
public static String IMAGE_TYPE_CHECKIN = "checkin";
public static int REQUEST_SETTINGS = 1;
public static int REQUEST_CALL_PHONE = 2;
public static int REQUEST_JOB_DETAIL = 3;
public static int REQUEST_BLUETOOTH = 4;
public static int REQUEST_SCAN = 5;
public static int REQUEST_TAKE_PICTURE = 6;
public static int REQUEST_CAMERA = 7;
public static int REQUEST_GALLERY = 8;
public static int REQUEST_CROP_IMAGE = 9;
public static int REQUEST_INSTALLATION = 10;
public static int REQUEST_TAKE_IDCARD = 11;
public static int REQUEST_TAKE_HOME = 12;
public static int REQUEST_EXTERNAL_STORAGE = 13;
public static int REQUEST_CHECKIN_RESULT = 14;
public static int REQUEST_PRINT_CONTRACT = 15;
public static int REQUEST_BLUETOOTH_SETTINGS = 16;
public static int REQUEST_SIGNATURE = 18;
public static int REQUEST_EDIT_DETAIL = 19;
public static int REQUEST_LOCATION = 20;
public static int REQUEST_STEPVIEW= 21;
public static int REQUEST_TIMELINE = 22;
public static int REQUEST_BACKUP = 23;
public static int REQUEST_APP_SETTINGS = 24;
public static int REQUEST_JOB = 25;
public static int REQUEST_IMPORT_ITEM = 26;
public static int REQUEST_ITEM_BALANCE = 27;
public static int REQUEST_PAYMENT = 28;
public static int REQUEST_PAYMENT_PAGE = 29;
public static int REQUEST_PAYMENT_DETAIL = 30;
public static int REQUEST_PAYMENT_ITEM_LIST = 31;
public static int REQUEST_DEPOSTI_CHANNEL = 32;
public static int REQUEST_DEPOSTI = 33;
public static int REQUEST_NEW_DETAIL = 34;
public static int REQUEST_CHOICE_INSTALL = 35;
public static int REQUEST_OLD_INSTALL = 36;
public static int REQUEST_NEW_INSTALL = 37;
public static int REQUEST_DELIVERY = 38;
public static final int REQUEST_PERMISSIONS = 99;
public static final String UUID = "00001101-0000-1000-8000-00805F9B34FB";
public static final String DATEPICKER_TAG = "datepicker";
public static final String KEY_EMPID = "EMPID";
public static final String KEY_TITLE = "TITLE";
public static final String KEY_FIRSTNAME = "FIRSTNAME";
public static final String KEY_LASTNAME = "LASTNAME";
public static final String KEY_POSITION = "POSITION";
public static final String KEY_DEPARTMENT = "DEPARTMENT";
public static final String KEY_EMPLOYEE_TYPE = "EMPLOYEETYPE";
public static final String KEY_SESSION = "SESSION";
public static final String KEY_SERIAL = "SERIAL";
public static final String KEY_PRODUCT_CODE = "PRODUCT_CODE";
public static final String KEY_SORT_ID = "KEY_SORT_ID";
public static final String KEY_SORT_PAYMENT_ID = "KEY_SORT_PAYMENT_ID";
public static final String KEY_CONTNO = "KEY_CONTNO";
public static final String KEY_SERIAL_ITEM = "KEY_SERIAL_ITEM";
//public static final String KEY_PRODUCT_CODE = "KEY_PRODUCT_CODE";
public static final String KEY_CUSTOMER_SIGN_PATH = "KEY_CUSTOMER_SIGN_PATH";
public static final String KEY_ORDER_ID = "KEY_ORDER_ID";
public static final String KEY_JOB_ITEM = "KEY_JOB_ITEM";
public static final String KEY_JOB_ADDR = "KEY_JOB_ADDR";
public static final String KEY_JOB_PRODUCT = "KEY_JOB_PRODUCT";
public static final String KEY_PRODUCT_PAYTYPE = "KEY_PRODUCT_PAYTYPE";
public static final String KEY_PRODUCT_RECEIVE = "KEY_PRODUCT_RECEIVE";
public static final String KEY_CHANNEL = "KEY_CHANNEL";
public static final String KEY_CHANNEL_NAME = "KEY_CHANNEL_NAME";
public static final String KEY_RECEIVER = "KEY_RECEIVER";
public static final String KEY_REF = "KEY_REF";
public static final String KEY_LAT = "KEY_LAT";
public static final String KEY_LON = "KEY_LON";
public static String[] PERMISSIONS_STORAGE = {
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
};
public static final String[] PERMISSIONS_LOCATION = {
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION
};
public static final int BANK_LIMIT = 50000;
public static final int HEAD_OFFICE_LIMIT = 50000;
public static final int COUNTER_SERVICE_LIMIT = 50000;
public static final String[] arrBranch = { "กรุณาเลือกสาขา"
, "สำนักงานใหญ่"
, "สาขานครราชสีมา"
, "สาขาเชียงใหม่"
, "สาขาพิษณุโลก"
, "สาขาชลบุรี"
, "สาขาเพชรบุรี"
, "สาขาระยอง"
, "สาขาราชบุรี"
, "สาขาปราจีนบุรี"
, "สาขาขอนแก่น"
, "สาขานครสวรรค์"
, "สาขาจันทบุรี"
, "สาขานครศรีธรรมราช"
, "สาขาอุบลราชธานี"
, "สาขาอุดรธานี"
, "ศูนย์ร้อยเอ็ด"
, "สาขาสงขลา"
, "สาขาฉะเชิงเทรา"
, "สาขาลพบุรี"
, "สาขานครปฐม"
, "สาขาสมุทรปราการ"
, "สาขาภูเก็ต"
, "สาขาปทุมธานี"
, "สาขาสุราษฎร์"
, "สาขามุกดาหาร"
, "สาขาบุรีรัมย์"
, "สาขาหาดใหญ่"
, "สาขาลำปาง"
, "สาขาเชียงราย"
, "สาขาเพชรบุรณ์"
, "สาขาตรัง"
};
}
|
[
"teerayut.k@thiensurat.co.th"
] |
teerayut.k@thiensurat.co.th
|
c43b1c13da033c4024e8b82cae6213a42fa1e8b1
|
ac3520396149c69d05d16b870886e9c88d1df5fa
|
/math/src/test/java/io/smallrye/mutiny/math/MedianOperatorTest.java
|
fd3c55254770b3df497e82673890898e90e67824
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
smallrye/smallrye-mutiny
|
fd610001996d6a7d63e5f482aa713724adc982ce
|
5724074347b968891af26465389094b57b1ebb83
|
refs/heads/main
| 2023-08-18T07:38:22.133027
| 2023-08-17T11:00:18
| 2023-08-17T11:00:18
| 198,222,234
| 703
| 130
|
Apache-2.0
| 2023-09-13T10:23:39
| 2019-07-22T12:48:27
|
Java
|
UTF-8
|
Java
| false
| false
| 4,451
|
java
|
package io.smallrye.mutiny.math;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.helpers.test.AssertSubscriber;
import io.smallrye.mutiny.infrastructure.Infrastructure;
public class MedianOperatorTest {
@Test
public void testWithEmpty() {
AssertSubscriber<Double> subscriber = Multi.createFrom().<Integer> empty()
.plug(Math.median())
.subscribe().withSubscriber(AssertSubscriber.create(10));
subscriber
.awaitCompletion()
.assertHasNotReceivedAnyItem();
}
@Test
public void testWithNever() {
AssertSubscriber<Double> subscriber = Multi.createFrom().<Long> nothing()
.plug(Math.median())
.subscribe().withSubscriber(AssertSubscriber.create(10));
subscriber.cancel();
subscriber.assertNotTerminated();
Assertions.assertEquals(0, subscriber.getItems().size());
}
@Test
public void testWithIntegerItems() {
AssertSubscriber<Double> subscriber = Multi.createFrom().items(1, 2, 3, 4, 5, 6)
.runSubscriptionOn(Infrastructure.getDefaultExecutor())
.plug(Math.median())
.subscribe().withSubscriber(AssertSubscriber.create(3));
subscriber.awaitItems(3)
.assertItems(1.0, 1.5, 2.0)
.request(10)
.awaitCompletion()
.assertItems(1.0, 1.5, 2.0, 2.5, 3.0, 3.5);
}
@Test
public void testWithIntegerItemsShuffled() {
AssertSubscriber<Double> subscriber = Multi.createFrom().items(6, 1, 2, 5, 3, 1)
.runSubscriptionOn(Infrastructure.getDefaultExecutor())
.plug(Math.median())
.subscribe().withSubscriber(AssertSubscriber.create(3));
subscriber.awaitItems(3)
.assertItems(6.0, 3.5, 2.0)
.request(10)
.awaitCompletion()
.assertItems(6.0, 3.5, 2.0, 3.5, 3.0, 2.5);
}
@Test
public void testLatest() {
List<Integer> list = Arrays.asList(3, 4, 1, 2, 6, 7, 9, 2, 4, 5, 2, 7, 9, 10, 2, 5, 3, 4, 3, 8, 4, 7, 9);
Collections.shuffle(list);
double median = Multi.createFrom().iterable(list)
.runSubscriptionOn(Infrastructure.getDefaultExecutor())
.plug(Math.median())
.collect().last()
.await().indefinitely();
Assertions.assertEquals(4.0, median);
}
@Test
public void testWithLongItems() {
AssertSubscriber<Double> subscriber = Multi.createFrom().items(6L, 1L, 2L, 5L, 3L, 1L)
.runSubscriptionOn(Infrastructure.getDefaultExecutor())
.plug(Math.median())
.subscribe().withSubscriber(AssertSubscriber.create(3));
subscriber.awaitItems(3)
.assertItems(6.0, 3.5, 2.0)
.request(10)
.awaitCompletion()
.assertItems(6.0, 3.5, 2.0, 3.5, 3.0, 2.5);
}
@Test
public void testWithDoubleItems() {
AssertSubscriber<Double> subscriber = Multi.createFrom().items(6.0, 1.0, 2.0, 5.0, 3.0, 1.0)
.runSubscriptionOn(Infrastructure.getDefaultExecutor())
.plug(Math.median())
.subscribe().withSubscriber(AssertSubscriber.create(3));
subscriber.awaitItems(3)
.assertItems(6.0, 3.5, 2.0)
.request(10)
.awaitCompletion()
.assertItems(6.0, 3.5, 2.0, 3.5, 3.0, 2.5);
}
@RepeatedTest(1000)
public void testWithItemsAndFailure() {
AssertSubscriber<Double> subscriber = Multi.createBy().concatenating().streams(
Multi.createFrom().items(6, 1, 2, 5, 3, 1),
Multi.createFrom().failure(new Exception("boom")))
.runSubscriptionOn(Infrastructure.getDefaultExecutor())
.plug(Math.median())
.subscribe().withSubscriber(AssertSubscriber.create(3));
subscriber.awaitItems(3)
.assertItems(6.0, 3.5, 2.0)
.request(10)
.awaitFailure()
.assertItems(6.0, 3.5, 2.0, 3.5, 3.0, 2.5);
}
}
|
[
"clement.escoffier@gmail.com"
] |
clement.escoffier@gmail.com
|
fad61cf1f82e6fe723b4f1e6a072d7f626010fe0
|
2d53d6f8d3e0e389bba361813e963514fdef3950
|
/Open_redirect/CWE601_Open_Redirect__Servlet_getParameter_Servlet_52a.java
|
1b8fdd66c01df9ac5727b9f789d68514858f1f6c
|
[] |
no_license
|
apobletts/ml-testing
|
6a1b95b995fdfbdd68f87da5f98bd969b0457234
|
ee6bb9fe49d9ec074543b7ff715e910110bea939
|
refs/heads/master
| 2021-05-10T22:55:57.250937
| 2018-01-26T20:50:15
| 2018-01-26T20:50:15
| 118,268,553
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,221
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE601_Open_Redirect__Servlet_getParameter_Servlet_52a.java
Label Definition File: CWE601_Open_Redirect__Servlet.label.xml
Template File: sources-sink-52a.tmpl.java
*/
/*
* @description
* CWE: 601 Open Redirect
* BadSource: getParameter_Servlet Read data from a querystring using getParameter()
* GoodSource: A hardcoded string
* Sinks:
* BadSink : place redirect string directly into redirect api call
* Flow Variant: 52 Data flow: data passed as an argument from one method to another to another in three different classes in the same package
*
* */
package testcases.CWE601_Open_Redirect;
import testcasesupport.*;
import javax.servlet.http.*;
public class CWE601_Open_Redirect__Servlet_getParameter_Servlet_52a extends AbstractTestCaseServlet
{
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* PRAETORIAN: Read data from a querystring using getParameter */
data = request.getParameter("name");
(new CWE601_Open_Redirect__Servlet_getParameter_Servlet_52b()).badSink(data , request, response);
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B(request, response);
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* FIX: Use a hardcoded string */
data = "foo";
(new CWE601_Open_Redirect__Servlet_getParameter_Servlet_52b()).goodG2BSink(data , request, response);
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"anna.pobletts@praetorian.com"
] |
anna.pobletts@praetorian.com
|
4e2659218407ae92b2d6fe637a0c6238e9317399
|
252890500ea914c50e46ca2e658fe8e2ea227cfd
|
/后端示例/cloudPayAdmin/src/main/java/cloudPayAdmin/util/ParamHelper.java
|
a736833e53e6fcf0f62e372da7474fd3b0d854d4
|
[] |
no_license
|
cjl26/luchong
|
29bfc1459f682cd38816681c37bb811f1a2407b0
|
18cfdb3e8c06838d8dfec822263323ba6a53199b
|
refs/heads/master
| 2021-05-01T21:10:43.381844
| 2018-02-19T05:02:06
| 2018-02-19T05:02:06
| 120,972,227
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,516
|
java
|
package cloudPayAdmin.util;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ParamHelper {
protected final static Logger logger = LoggerFactory.getLogger(ParamHelper.class);
/**
* 获取一个对象的所有字段及其值,放到map对象中
* @param obj
* @param params
* @return
*/
public static boolean getFiledValues(Object obj, SortedMap<String, String> params){
if(obj==null)return false;
Class claz = obj.getClass();
while(!claz.getName().endsWith(".Object")){
Field [] fields = claz.getDeclaredFields();
for(Field fd : fields){
try{
getFieldValues(fd, claz, obj, params);
}catch(Exception ex){
}
}
claz = claz.getSuperclass();
}
return true;
}
private static void getFieldValues(Field fd, Class claz, Object obj, SortedMap<String, String> params) throws Exception {
String fdName = fd.getName();
String firstLetter = fdName.substring(0,1).toUpperCase();
String getMethodName = "get" + firstLetter + fdName.substring(1);
Method getMethod = claz.getMethod(getMethodName, new Class[]{});
Object value = getMethod.invoke(obj,new Object[]{});
params.put(fdName, value.toString());
}
/**
* 计算参数签名值
* @param signParams 参数列表
* @param paramSignKey 签名密钥
* @param charsetname 字符编码
* @return 签名值
*/
public static String genMd5Sign(SortedMap<String, String> signParams, String paramSignKey, String charsetname)
{
StringBuffer sb = new StringBuffer();
Set es = signParams.entrySet();
Iterator it = es.iterator();
while (it.hasNext())
{
Map.Entry entry = (Map.Entry) it.next();
String k = (String) entry.getKey();
String v = (String) entry.getValue();
if (null != v && !"".equals(v) && !"sign".equals(k) && !"key".equals(k))
{
sb.append(k + "=" + v + "&");
}
}
sb.append("key=" + paramSignKey);
String toSignString = sb.toString();
String sign = MD5Util.MD5Encode(toSignString, charsetname).toUpperCase();
logger.info("toSignString: " + toSignString);
logger.info("sign output: " + sign);
return sign;
}
/**
* 计算参数签名值
* @param obj 对象
* @param paramSignKey 签名密钥
* @param charsetname 字符编码
* @return 签名值
*/
public static String genMd5Sign(Object obj, String paramSignKey, String charset){
SortedMap<String, String> params = new TreeMap<String, String>();
if(ParamHelper.getFiledValues(obj, params)){
String sign = genMd5Sign(params, paramSignKey, charset);
return sign;
}
return "";
}
public static String getNonceStr() {
Random random = new Random();
return MD5Util.MD5Encode(String.valueOf(random.nextInt(10000)), "UTF-8");
}
/**
* 取出一个指定长度大小的随机正整数.
*
* @param length
* int 设定所取出随机数的长度。length小于11
* @return int 返回生成的随机数。
*/
public static int buildRandom(int length) {
int num = 1;
double random = Math.random();
if (random < 0.1) {
random = random + 0.1;
}
for (int i = 0; i < length; i++) {
num = num * 10;
}
return (int) ((random * num));
}
}
|
[
"Jinlong"
] |
Jinlong
|
f163c426e19269e444066dd669b22e90c1e79d4b
|
c94f888541c0c430331110818ed7f3d6b27b788a
|
/commonrcsmart/java/src/main/java/com/antgroup/antchain/openapi/commonrcsmart/models/RcSmartResponse.java
|
20d1e2b4fed5debae9e36c3dabb74f5e1de283e1
|
[
"MIT",
"Apache-2.0"
] |
permissive
|
alipay/antchain-openapi-prod-sdk
|
48534eb78878bd708a0c05f2fe280ba9c41d09ad
|
5269b1f55f1fc19cf0584dc3ceea821d3f8f8632
|
refs/heads/master
| 2023-09-03T07:12:04.166131
| 2023-09-01T08:56:15
| 2023-09-01T08:56:15
| 275,521,177
| 9
| 10
|
MIT
| 2021-03-25T02:35:20
| 2020-06-28T06:22:14
|
PHP
|
UTF-8
|
Java
| false
| false
| 1,683
|
java
|
// This file is auto-generated, don't edit it. Thanks.
package com.antgroup.antchain.openapi.commonrcsmart.models;
import com.aliyun.tea.*;
public class RcSmartResponse extends TeaModel {
// 结果码
@NameInMap("code")
@Validation(required = true)
public String code;
// 返回码描述
@NameInMap("msg")
@Validation(required = true)
public String msg;
// 业务处理结果码
@NameInMap("sub_code")
public String subCode;
// 返回的提示信息
@NameInMap("sub_msg")
public String subMsg;
// 可否重试
@NameInMap("retry")
public Boolean retry;
public static RcSmartResponse build(java.util.Map<String, ?> map) throws Exception {
RcSmartResponse self = new RcSmartResponse();
return TeaModel.build(map, self);
}
public RcSmartResponse setCode(String code) {
this.code = code;
return this;
}
public String getCode() {
return this.code;
}
public RcSmartResponse setMsg(String msg) {
this.msg = msg;
return this;
}
public String getMsg() {
return this.msg;
}
public RcSmartResponse setSubCode(String subCode) {
this.subCode = subCode;
return this;
}
public String getSubCode() {
return this.subCode;
}
public RcSmartResponse setSubMsg(String subMsg) {
this.subMsg = subMsg;
return this;
}
public String getSubMsg() {
return this.subMsg;
}
public RcSmartResponse setRetry(Boolean retry) {
this.retry = retry;
return this;
}
public Boolean getRetry() {
return this.retry;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
5e70c561668ac3b9c67be80c268e3934b2066cd7
|
c885ef92397be9d54b87741f01557f61d3f794f3
|
/results/JacksonDatabind-111/com.fasterxml.jackson.databind.deser.impl.FieldProperty/BBC-F0-opt-40/tests/18/com/fasterxml/jackson/databind/deser/impl/FieldProperty_ESTest.java
|
49d918e3e4359af614de606325356ccfd93c0918
|
[
"CC-BY-4.0",
"MIT"
] |
permissive
|
pderakhshanfar/EMSE-BBC-experiment
|
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
|
fea1a92c2e7ba7080b8529e2052259c9b697bbda
|
refs/heads/main
| 2022-11-25T00:39:58.983828
| 2022-04-12T16:04:26
| 2022-04-12T16:04:26
| 309,335,889
| 0
| 1
| null | 2021-11-05T11:18:43
| 2020-11-02T10:30:38
| null |
UTF-8
|
Java
| false
| false
| 1,176
|
java
|
/*
* This file was automatically generated by EvoSuite
* Thu Oct 21 11:36:34 GMT 2021
*/
package com.fasterxml.jackson.databind.deser.impl;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import com.fasterxml.jackson.databind.deser.impl.FieldProperty;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class FieldProperty_ESTest extends FieldProperty_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
FieldProperty fieldProperty0 = null;
try {
fieldProperty0 = new FieldProperty((FieldProperty) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase", e);
}
}
}
|
[
"pderakhshanfar@serg2.ewi.tudelft.nl"
] |
pderakhshanfar@serg2.ewi.tudelft.nl
|
6eb4c8dc1b55d6b6cd88cebc23f3b5d68e4a8ef1
|
19490fcc6f396eeb35a9234da31e7b615abf6d04
|
/JDownloader/src/jd/plugins/decrypter/MxiLnkCom.java
|
77be0bc60ee94e3935c358649d3076a815de9c04
|
[] |
no_license
|
amicom/my-project
|
ef72026bb91694e74bc2dafd209a1efea9deb285
|
951c67622713fd89448ffe6e0983fe3f934a7faa
|
refs/heads/master
| 2021-01-02T09:15:45.828528
| 2015-09-06T15:57:01
| 2015-09-06T15:57:01
| 41,953,961
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,147
|
java
|
//jDownloader - Downloadmanager
//Copyright (C) 2009 JD-Team support@jdownloader.org
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.decrypter;
import java.util.ArrayList;
import jd.PluginWrapper;
import jd.controlling.ProgressController;
import jd.plugins.CryptedLink;
import jd.plugins.DecrypterException;
import jd.plugins.DecrypterPlugin;
import jd.plugins.DownloadLink;
import jd.plugins.PluginForDecrypt;
@DecrypterPlugin(revision = "$Revision: 20698 $", interfaceVersion = 2, names = { "maxi-link.com" }, urls = { "http://[\\w\\.]*?maxi-link\\.com/[a-z0-9]+/.*?\\.html" }, flags = { 0 })
public class MxiLnkCom extends PluginForDecrypt {
public MxiLnkCom(PluginWrapper wrapper) {
super(wrapper);
}
private static final String CAPTCHATEXT = "/c/";
public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress) throws Exception {
ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
String parameter = param.toString();
br.getPage(parameter);
if (br.containsHTML("class=\"size\">0 o</span><br")) {
logger.info("Link offline: " + parameter);
return decryptedLinks;
}
if (!br.containsHTML(CAPTCHATEXT)) {
logger.warning("Couldn't find the captchatext, stopping...");
return null;
}
for (int i = 0; i <= 3; i++) {
String captchaurl = br.getRegex("Please enter code :<br />[\t\n\r ]+<img src=\"(/.*?)\"").getMatch(0);
if (captchaurl == null) captchaurl = br.getRegex("\"(/c/\\d+\\.png)\"").getMatch(0);
if (captchaurl == null) return null;
captchaurl = "http://en.maxi-link.com" + captchaurl;
br.postPage(parameter, "open=Open&c=" + getCaptchaCode(captchaurl, param));
if (br.containsHTML(CAPTCHATEXT)) continue;
break;
}
if (br.containsHTML(CAPTCHATEXT)) throw new DecrypterException(DecrypterException.CAPTCHA);
String finallink = br.getRegex(">Download : <a href=\"(.*?)\"").getMatch(0);
if (finallink == null) finallink = br.getRegex("class=\"u\">(.*?)</a>").getMatch(0);
if (finallink == null) {
logger.warning("finallink could not be found...");
return null;
}
decryptedLinks.add(createDownloadlink(finallink));
return decryptedLinks;
}
/* NO OVERRIDE!! */
public boolean hasCaptcha(CryptedLink link, jd.plugins.Account acc) {
return true;
}
}
|
[
"amicom.pro@gmail.com"
] |
amicom.pro@gmail.com
|
d95bff4fda3760fc8c933f7c90ceb594932d6f1f
|
35348f6624d46a1941ea7e286af37bb794bee5b7
|
/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/properties/UnsupportedMapDB.java
|
384a33b3bb5acf564018dc93a6e1c2f9f69ba0e2
|
[
"Apache-2.0",
"GPL-1.0-or-later",
"GPL-3.0-only",
"LicenseRef-scancode-public-domain",
"LGPL-2.1-only",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
StarCrossPortal/ghidracraft
|
7af6257c63a2bb7684e4c2ad763a6ada23297fa3
|
a960e81ff6144ec8834e187f5097dfcf64758e18
|
refs/heads/master
| 2023-08-23T20:17:26.250961
| 2021-10-22T00:53:49
| 2021-10-22T00:53:49
| 359,644,138
| 80
| 19
|
Apache-2.0
| 2021-10-20T03:59:55
| 2021-04-20T01:14:29
|
Java
|
UTF-8
|
Java
| false
| false
| 2,414
|
java
|
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* 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 ghidra.program.database.properties;
import java.io.IOException;
import ghidra.program.database.map.AddressMap;
import ghidra.program.model.address.Address;
import ghidra.program.util.ChangeManager;
import ghidra.util.exception.*;
import ghidra.util.prop.PropertyVisitor;
import ghidra.util.task.TaskMonitor;
import db.DBHandle;
import db.util.ErrorHandler;
/**
* This class provides a dummy map for an unsupported map.
*/
public class UnsupportedMapDB extends PropertyMapDB {
/**
* Construct a dummy property map.
* @param dbHandle database handle.
* @param openMode the mode that the program was openned in.
* @param errHandler database error handler.
* @param changeMgr change manager for event notification
* @param addrMap address map.
* @param name property name.
* @param monitor progress monitor that is only used when upgrading
* @throws VersionException if the database version is not the expected version.
* @throws CancelledException if the user cancels the upgrade operation.
* @throws IOException if a database io error occurs.
*/
UnsupportedMapDB(DBHandle dbHandle, int openMode, ErrorHandler errHandler,
ChangeManager changeMgr, AddressMap addrMap, String name, TaskMonitor monitor)
throws VersionException, CancelledException, IOException {
super(dbHandle, errHandler, changeMgr, addrMap, name);
checkMapVersion(openMode, monitor);
}
/**
* @see ghidra.program.model.util.PropertyMap#applyValue(ghidra.util.prop.PropertyVisitor, ghidra.program.model.address.Address)
*/
public void applyValue(PropertyVisitor visitor, Address addr) {
throw new AssertException();
}
/**
* @see ghidra.program.model.util.PropertyMap#getObject(ghidra.program.model.address.Address)
*/
public Object getObject(Address addr) {
return null;
}
}
|
[
"46821332+nsadeveloper789@users.noreply.github.com"
] |
46821332+nsadeveloper789@users.noreply.github.com
|
d0503541819ef1eaa7c2c0d09fb073e9f25407ab
|
78f284cd59ae5795f0717173f50e0ebe96228e96
|
/factura-negocio/src/cl/stotomas/factura/negocio/ia_9/copy2/copy2/TestingHab.java
|
dc77b977eb3bace59c9d9e1705013ce59b151e50
|
[] |
no_license
|
Pattricio/Factura
|
ebb394e525dfebc97ee2225ffc5fca10962ff477
|
eae66593ac653f85d05071b6ccb97fb1e058502d
|
refs/heads/master
| 2020-03-16T03:08:45.822070
| 2018-05-07T15:29:25
| 2018-05-07T15:29:25
| 132,481,305
| 0
| 0
| null | null | null | null |
ISO-8859-1
|
Java
| false
| false
| 2,150
|
java
|
package cl.stotomas.factura.negocio.ia_9.copy2.copy2;
import java.util.*;
public class TestingHab {
private int id;
private String nombre;
private String apellido;
private int edad;
/**
* Constructor vacío
*/
public TestingHab()
{
id = 1;
nombre = "Edward";
apellido = "Dammus";
edad = 22;
}
/**
* Constructor con parametros
*/
public TestingHab(int id, String nombre, String apellido, int edad)
{
this.id = id;
this.nombre = nombre;
this.apellido = apellido;
setEdad(edad);
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getApellido() {
return apellido;
}
public void setApellido(String apellido) {
this.apellido = apellido;
}
public int getEdad() {
return edad;
}
public void setEdad(int edad) {
this.edad = edad;
}
/**
* Método que acepte que la edad debe ser mayor a 15
*/
public void edadMayor(int edad)
{
if(edad > 15)
{
System.out.println("Admitido");
}
else
{
System.out.println("Edad debe ser mayor a 15");
}
}
/**
* Método que me valide el segundo nombre
*/
public void validarNombre(String nombre)
{
StringTokenizer token = new StringTokenizer(nombre);
if(token.countTokens() == 2)
{
System.out.println("Ingresaste 2 nombres");
}else
{
System.out.println("Error");
}
}
/**
* Método que me pregunte por la edad y por el nombre
*/
public void NombreEdad(String nombre, int edad)
{
System.out.println("Cual es tu nombre y tu edad");
if(nombre.equals(nombre))
{
System.out.println("Su nombre es: " +getNombre());
}else if(edad == 13)
{
this.edad = 100; // cambia la edad a 100
System.out.println("Su edad es:" +getEdad());
}
}
/**
* Instanciar una persona
*/
public void Persona(Object o)
{
if(o.getClass() == TestingHab.class)
{
System.out.println(o);
}
}
}
|
[
"Adriana Molano@DESKTOP-GQ96FK8"
] |
Adriana Molano@DESKTOP-GQ96FK8
|
030a61f8d5fde93dd4f36ffb83a264676025abe6
|
f03fb9b2ae12857d351a3eab581b297d95ac05f2
|
/ardor3d-ui/src/main/java/com/ardor3d/extension/ui/UIPieMenuItem.java
|
db9036ed720b2c588ee26e130b98c6f776637a96
|
[
"Zlib"
] |
permissive
|
Renanse/Ardor3D
|
8db6cc198196bd682bb94ff8158b07f66a2c80f4
|
7df2f1d0ccae867663ef9b511a443dee029112b0
|
refs/heads/master
| 2023-07-09T03:46:14.553764
| 2023-07-04T16:42:46
| 2023-07-04T16:42:46
| 6,205,252
| 182
| 72
|
NOASSERTION
| 2023-06-01T15:20:56
| 2012-10-13T17:03:04
|
Java
|
UTF-8
|
Java
| false
| false
| 2,353
|
java
|
/**
* Copyright (c) 2008-2021 Bird Dog Games, Inc.
*
* This file is part of Ardor3D.
*
* Ardor3D is free software: you can redistribute it and/or modify it
* under the terms of its license which may be found in the accompanying
* LICENSE file or at <https://git.io/fjRmv>.
*/
package com.ardor3d.extension.ui;
import com.ardor3d.extension.ui.event.ActionListener;
import com.ardor3d.extension.ui.util.SubTex;
import com.ardor3d.math.Vector3;
import com.ardor3d.math.util.MathUtils;
/**
*
*/
public class UIPieMenuItem extends UIMenuItem {
protected int _subMenuSize = 0;
public UIPieMenuItem(final String text) {
this(text, null);
}
public UIPieMenuItem(final String text, final SubTex icon) {
this(text, icon, true, null);
}
public UIPieMenuItem(final String text, final SubTex icon, final boolean closeMenuOnSelect,
final ActionListener listener) {
super(text, icon, closeMenuOnSelect, listener);
}
public UIPieMenuItem(final String text, final SubTex icon, final UIPieMenu subMenu, final int size) {
super(text, icon, false, null);
_subMenu = subMenu;
_subMenuSize = size;
addActionListener(event -> showSubMenu());
}
@Override
protected void showSubMenu() {
final UIHud hud = getHud();
if (hud == null) {
return;
}
boolean setup = false;
final Vector3 showAt = new Vector3(getWorldTranslation());
final UIPieMenu subMenu = (UIPieMenu) _subMenu;
if (getParent() instanceof UIPieMenu) {
final UIPieMenu pie = (UIPieMenu) getParent();
if (pie.getCenterItem() != this) {
subMenu.setOuterRadius(pie.getOuterRadius() + _subMenuSize);
subMenu.setInnerRadius(pie.getOuterRadius());
subMenu.setTotalArcLength(pie.getSliceRadians());
subMenu.setStartAngle(pie.getSliceIndex(this) * pie.getSliceRadians() + pie.getStartAngle());
showAt.set(pie.getWorldTranslation());
hud.closePopupMenusAfter(pie);
setup = true;
}
}
if (!setup) {
subMenu.setOuterRadius(_subMenuSize);
subMenu.setInnerRadius(0);
subMenu.setTotalArcLength(MathUtils.TWO_PI);
subMenu.setStartAngle(0);
}
subMenu.updateMinimumSizeFromContents();
subMenu.layout();
hud.showSubPopupMenu(subMenu);
subMenu.showAt((int) showAt.getX(), (int) showAt.getY());
}
}
|
[
"renanse@gmail.com"
] |
renanse@gmail.com
|
a1f77c46ab7e6e00fccc5b7d897a51881fa8f1bf
|
1eb9b656ec1f79c8691b746644bccc6b80bb735b
|
/modules/junit4/junit4-core/src/test/java/org/testifyproject/junit4/ComplexCollaboratorProviderTest.java
|
e1e8ae984fefa21ec5464dcbcea41b1c8b7cc976
|
[
"Apache-2.0"
] |
permissive
|
testify-project/testify
|
caf1dc3648c9f2e4b368f0e8e48614ec5c521e9b
|
31588b3574d0b3194edf653825113885e83cb8e7
|
refs/heads/develop
| 2023-07-07T04:05:37.880031
| 2018-08-21T22:24:05
| 2018-08-21T22:24:05
| 78,854,439
| 10
| 1
|
Apache-2.0
| 2023-06-27T14:19:09
| 2017-01-13T14:05:35
|
Java
|
UTF-8
|
Java
| false
| false
| 1,392
|
java
|
/*
* Copyright 2016-2017 Testify Project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.testifyproject.junit4;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.testifyproject.annotation.CollaboratorProvider;
import org.testifyproject.annotation.Sut;
import org.testifyproject.junit4.fixture.collaborator.ComplexCollaboratorProvider;
import org.testifyproject.junit4.fixture.collaborator.ComplexCollaboratorType;
/**
*
* @author saden
*/
@CollaboratorProvider(ComplexCollaboratorProvider.class)
@RunWith(UnitTest.class)
public class ComplexCollaboratorProviderTest {
@Sut(factoryMethod = "builder")
ComplexCollaboratorType sut;
@Test
public void verifyInjections() {
assertThat(sut).isNotNull();
assertThat(sut.getMessage()).isNotEmpty();
}
}
|
[
"sharmarke.aden@gmail.com"
] |
sharmarke.aden@gmail.com
|
4352ed496c7c0bf1250717fa82a4161ad53c0f6b
|
69c1256baec48b66365b5ec8faec5d6318b0eb21
|
/Mage.Sets/src/mage/sets/lorwyn/WeedStrangle.java
|
1e154253f45fc11da315f5dc72393c62f659c84e
|
[] |
no_license
|
gbraad/mage
|
3b84eefe4845258f6250a7ff692e1f2939864355
|
18ce6a0305db6ebc0d34054af03fdb0ba88b5a3b
|
refs/heads/master
| 2022-09-28T17:31:38.653921
| 2015-04-04T22:28:22
| 2015-04-04T22:28:22
| 33,435,029
| 1
| 0
| null | 2022-09-01T23:39:50
| 2015-04-05T08:25:58
|
Java
|
UTF-8
|
Java
| false
| false
| 3,976
|
java
|
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* 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 BetaSteward_at_googlemail.com ``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 BetaSteward_at_googlemail.com 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 BetaSteward_at_googlemail.com.
*/
package mage.sets.lorwyn;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ClashEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class WeedStrangle extends CardImpl {
public WeedStrangle(UUID ownerId) {
super(ownerId, 147, "Weed Strangle", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{B}{B}");
this.expansionSetCode = "LRW";
this.color.setBlack(true);
// Destroy target creature. Clash with an opponent. If you win, you gain life equal to that creature's toughness.
this.getSpellAbility().addEffect(new WeedStrangleEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
public WeedStrangle(final WeedStrangle card) {
super(card);
}
@Override
public WeedStrangle copy() {
return new WeedStrangle(this);
}
}
class WeedStrangleEffect extends OneShotEffect {
public WeedStrangleEffect() {
super(Outcome.DestroyPermanent);
this.staticText = "Destroy target creature. Clash with an opponent. If you win, you gain life equal to that creature's toughness";
}
public WeedStrangleEffect(final WeedStrangleEffect effect) {
super(effect);
}
@Override
public WeedStrangleEffect copy() {
return new WeedStrangleEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (controller != null && creature != null) {
creature.destroy(source.getSourceId(), game, false);
if (ClashEffect.getInstance().apply(game, source)) {
controller.gainLife(creature.getToughness().getValue(), game);
}
return true;
}
return false;
}
}
|
[
"ludwig.hirth@online.de"
] |
ludwig.hirth@online.de
|
5efb07936c5e61d8d2d3ab3456da968415938a00
|
e87f985fdd9177e92966f8b2e85b6e57662e7cf6
|
/jOOQ-test/src/org/jooq/test/postgres/generatedclasses/tables/pojos/TBooleans.java
|
8ccfe8f6dd1e9a7481501c67003767086987cdc9
|
[
"BSD-3-Clause",
"Apache-2.0"
] |
permissive
|
ben-manes/jOOQ
|
5ef43f8ea8c5c942dc0b2e0669cc927dca6f2ff7
|
9f160d5e869de1a9d66408d90718148f76c5e000
|
refs/heads/master
| 2023-09-05T03:27:56.109520
| 2013-08-26T09:48:14
| 2013-08-26T10:05:05
| 12,375,424
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,942
|
java
|
/**
* This class is generated by jOOQ
*/
package org.jooq.test.postgres.generatedclasses.tables.pojos;
/**
* This class is generated by jOOQ.
*/
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TBooleans implements java.io.Serializable {
private static final long serialVersionUID = -1859819346;
private final java.lang.Integer id;
private final org.jooq.test._.converters.Boolean_10 oneZero;
private final org.jooq.test._.converters.Boolean_TF_LC trueFalseLc;
private final org.jooq.test._.converters.Boolean_TF_UC trueFalseUc;
private final org.jooq.test._.converters.Boolean_YES_NO_LC yesNoLc;
private final org.jooq.test._.converters.Boolean_YES_NO_UC yesNoUc;
private final org.jooq.test._.converters.Boolean_YN_LC yNLc;
private final org.jooq.test._.converters.Boolean_YN_UC yNUc;
private final java.lang.Boolean vcBoolean;
private final java.lang.Boolean cBoolean;
private final java.lang.Boolean nBoolean;
public TBooleans(
java.lang.Integer id,
org.jooq.test._.converters.Boolean_10 oneZero,
org.jooq.test._.converters.Boolean_TF_LC trueFalseLc,
org.jooq.test._.converters.Boolean_TF_UC trueFalseUc,
org.jooq.test._.converters.Boolean_YES_NO_LC yesNoLc,
org.jooq.test._.converters.Boolean_YES_NO_UC yesNoUc,
org.jooq.test._.converters.Boolean_YN_LC yNLc,
org.jooq.test._.converters.Boolean_YN_UC yNUc,
java.lang.Boolean vcBoolean,
java.lang.Boolean cBoolean,
java.lang.Boolean nBoolean
) {
this.id = id;
this.oneZero = oneZero;
this.trueFalseLc = trueFalseLc;
this.trueFalseUc = trueFalseUc;
this.yesNoLc = yesNoLc;
this.yesNoUc = yesNoUc;
this.yNLc = yNLc;
this.yNUc = yNUc;
this.vcBoolean = vcBoolean;
this.cBoolean = cBoolean;
this.nBoolean = nBoolean;
}
public java.lang.Integer getId() {
return this.id;
}
public org.jooq.test._.converters.Boolean_10 getOneZero() {
return this.oneZero;
}
public org.jooq.test._.converters.Boolean_TF_LC getTrueFalseLc() {
return this.trueFalseLc;
}
public org.jooq.test._.converters.Boolean_TF_UC getTrueFalseUc() {
return this.trueFalseUc;
}
public org.jooq.test._.converters.Boolean_YES_NO_LC getYesNoLc() {
return this.yesNoLc;
}
public org.jooq.test._.converters.Boolean_YES_NO_UC getYesNoUc() {
return this.yesNoUc;
}
public org.jooq.test._.converters.Boolean_YN_LC getYNLc() {
return this.yNLc;
}
public org.jooq.test._.converters.Boolean_YN_UC getYNUc() {
return this.yNUc;
}
public java.lang.Boolean getVcBoolean() {
return this.vcBoolean;
}
public java.lang.Boolean getCBoolean() {
return this.cBoolean;
}
public java.lang.Boolean getNBoolean() {
return this.nBoolean;
}
}
|
[
"lukas.eder@gmail.com"
] |
lukas.eder@gmail.com
|
789b4794cf9f4c0ac1240c8e0953f88ec337025a
|
447520f40e82a060368a0802a391697bc00be96f
|
/apks/playstore_apps/com_ubercab/source/asy.java
|
ae11571b158bd62815f659b595f8f4445f84cd61
|
[
"Apache-2.0",
"GPL-1.0-or-later"
] |
permissive
|
iantal/AndroidPermissions
|
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
|
d623b732734243590b5f004d167e542e2e2ae249
|
refs/heads/master
| 2023-07-19T01:29:26.689186
| 2019-09-30T19:01:42
| 2019-09-30T19:01:42
| 107,239,248
| 0
| 0
|
Apache-2.0
| 2023-07-16T07:41:38
| 2017-10-17T08:22:57
| null |
UTF-8
|
Java
| false
| false
| 1,962
|
java
|
import android.content.Context;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class asy
{
private boolean a;
private String b;
private String c;
private String d;
private String[] e;
public asy() {}
public static asy a(JSONObject paramJSONObject)
{
Object localObject = paramJSONObject;
if (paramJSONObject == null) {
localObject = new JSONObject();
}
paramJSONObject = new asy();
int i = 0;
paramJSONObject.a = ((JSONObject)localObject).optBoolean("enabled", false);
paramJSONObject.b = aqp.a((JSONObject)localObject, "googleAuthorizationFingerprint", null);
paramJSONObject.c = aqp.a((JSONObject)localObject, "environment", null);
paramJSONObject.d = aqp.a((JSONObject)localObject, "displayName", "");
localObject = ((JSONObject)localObject).optJSONArray("supportedNetworks");
if (localObject != null) {
paramJSONObject.e = new String[((JSONArray)localObject).length()];
}
for (;;)
{
if (i < ((JSONArray)localObject).length()) {}
try
{
paramJSONObject.e[i] = ((JSONArray)localObject).getString(i);
i += 1;
continue;
paramJSONObject.e = new String[0];
return paramJSONObject;
}
catch (JSONException localJSONException)
{
for (;;) {}
}
}
}
public String a()
{
return this.b;
}
public boolean a(Context paramContext)
{
boolean bool2 = false;
try
{
Class.forName(gcq.class.getName());
boolean bool1 = bool2;
if (this.a)
{
int i = czh.a().a(paramContext);
bool1 = bool2;
if (i == 0) {
bool1 = true;
}
}
return bool1;
}
catch (ClassNotFoundException|NoClassDefFoundError paramContext) {}
return false;
}
public String b()
{
return this.c;
}
public String[] c()
{
return this.e;
}
}
|
[
"antal.micky@yahoo.com"
] |
antal.micky@yahoo.com
|
a62dc35f3f1e87f85751f7ac9bff546a02da94c7
|
35029f02d7573415d6fc558cfeeb19c7bfa1e3cc
|
/gs-accessing-data-jpa-complete/src/main/java/hello/model/Customer1085.java
|
8cdf22816e9fb9f0b2bbfdd0c4eb64cb9553bb8e
|
[] |
no_license
|
MirekSz/spring-boot-slow-startup
|
e06fe9d4f3831ee1e79cf3735f6ceb8c50340cbe
|
3b1e9e4ebd4a95218b142b7eb397d0eaa309e771
|
refs/heads/master
| 2021-06-25T22:50:21.329236
| 2017-02-19T19:08:24
| 2017-02-19T19:08:24
| 59,591,530
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 711
|
java
|
package hello.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Customer1085 {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long id;
private String firstName;
private String lastName;
protected Customer1085() {}
public Customer1085(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
@Override
public String toString() {
return String.format(
"Customer1085[id=%d, firstName='%s', lastName='%s']",
id, firstName, lastName);
}
}
|
[
"miro1994"
] |
miro1994
|
b82713519833ae4db1346fd0b7fa778f3942d78d
|
3ee1c41f1fc133d77ac2681842bc9eefebad38ae
|
/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceTemplateConvertor.java
|
a767246f128a4ee9d7b745bd5e734b8cc40a3f08
|
[
"Apache-2.0"
] |
permissive
|
onapdemo/sdc
|
b225395934e07b36f96ba46ab04be533d755c521
|
3f1fee2ca76332b48e6f36662b32f2b5096c25e7
|
refs/heads/master
| 2020-03-17T21:17:00.804170
| 2018-05-21T06:47:17
| 2018-05-21T06:47:17
| 133,952,212
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,765
|
java
|
package org.openecomp.core.migration.convertors;
import com.amdocs.zusammen.datatypes.item.ElementContext;
import com.amdocs.zusammen.datatypes.item.Info;
import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement;
import org.openecomp.core.migration.store.ElementHandler;
import org.openecomp.core.model.types.ServiceTemplate;
import org.openecomp.core.utilities.file.FileUtils;
import org.openecomp.sdc.model.impl.zusammen.ElementType;
import org.openecomp.sdc.model.impl.zusammen.StructureElement;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* @author katyr
* @since April 23, 2017
*/
public class VspServiceTemplateConvertor
{
private static Set<String> serviceTemplatesLoaded = new HashSet<>();
public static CollaborationElement[] convertServiceTemplateToElement(ServiceTemplate serviceTemplate) {
CollaborationElement[] serviceTemplateElements;
List<String> serviceTemplateNamespace = getServiceTemplateNamespace();
int index = 0;
String serviceTemplatesEntityId = StructureElement.Templates.name();
String uniqueId = serviceTemplate.getVspId()+"_"+serviceTemplate.getVersion().toString();
if (serviceTemplatesLoaded.contains(uniqueId)) {
serviceTemplateElements = new CollaborationElement[1];
} else {
serviceTemplatesLoaded.add(uniqueId);
String vspServiceModelEntityId = StructureElement.ServiceModel.name();
serviceTemplateElements = new CollaborationElement[3];
serviceTemplateElements[index] = ElementHandler.getElementEntity(
serviceTemplate.getVspId(),
serviceTemplate.getVersion().toString(),
vspServiceModelEntityId,
serviceTemplateNamespace,
ElementHandler.getServiceModelElementInfo(vspServiceModelEntityId,serviceTemplate),
null,
null,
null);
index++;
serviceTemplateNamespace.add(vspServiceModelEntityId);
serviceTemplateElements[index] = ElementHandler.getElementEntity(
serviceTemplate.getVspId(), serviceTemplate.getVersion().toString(), serviceTemplatesEntityId,
serviceTemplateNamespace,
ElementHandler.getStructuralElementInfo(StructureElement.Templates.name()),
null,
null,
null);
index++;
}
serviceTemplateNamespace.add(serviceTemplatesEntityId);
String elementId = serviceTemplate.getVspId()+"_"+serviceTemplate.getVersion().toString()
+"_"+serviceTemplate.getName();
serviceTemplateElements[index] = ElementHandler.getElementEntity(
serviceTemplate.getVspId(), serviceTemplate.getVersion().toString(), elementId,
serviceTemplateNamespace,
getServiceTemplateInfo(serviceTemplate),
null,
null,
FileUtils.toByteArray(serviceTemplate.getContent()));
return serviceTemplateElements;
}
private static Info getServiceTemplateInfo(ServiceTemplate serviceTemplateEntity) {
Info info = new Info();
info.setName(serviceTemplateEntity.getName());
info.addProperty("type", ElementType.Servicetemplate.name());
info.addProperty("base", serviceTemplateEntity.getBaseName());
return info;
}
private static List<String> getServiceTemplateNamespace() {
return ElementHandler.getElementPath();
}
public static ElementEntityContext convertServiceTemplateToElementContext(ServiceTemplate
serviceTemplateEntity) {
return new ElementEntityContext("GLOBAL_USER", new
ElementContext(serviceTemplateEntity.getVspId(), serviceTemplateEntity.getVersion().toString()));
}
}
|
[
"Sudhakar.reddy@amdocs.com"
] |
Sudhakar.reddy@amdocs.com
|
8329ca6738cb97fc2dcbe0e53779e03ff46c4d80
|
acff813f2fdc0af9a7c068e8ab6c3737a5ef0739
|
/1ºTRIMESTRE/Actividades/Ficheros/Ficheros/src/Ejercicio008Serializable/Ejercicio008Serializado.java
|
2dc07191116f24117189a46dd6ebd1599b43a045
|
[] |
no_license
|
lauriiShii/ACCESO-A-DATOS
|
d8bd1457371920459d047c06d3823c10cb84611a
|
49a14449700d84d445533e2c230680cd32715311
|
refs/heads/master
| 2020-03-21T13:38:21.794693
| 2018-07-03T22:01:11
| 2018-07-03T22:01:11
| 138,616,528
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,645
|
java
|
package Ejercicio008Serializable;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
/**
Queremos hacer una agenda telefónica con los siguientes datos:
• Nombre del contacto
• Teléfono
• Dirección
• Código postal (número entero)
• Fecha de nacimiento
• Si le debo dinero (booleano)
• Cuánto le debo(número decimal)
Realiza un programa que almacene los datos en un fichero binario. A continuación, lee el fichero y
muestra el contenido por consola. Hacer dos versiones:
• Sin serialización de objeto*
• Con serialización de objeto
**/
public class Ejercicio008Serializado {
public static void main(String[] args) {
Contacto p1 = new Contacto("Manue", "4578", "SanPedro", 11300, false, 0f);
Contacto p2 = new Contacto("Rosa", "4578", "SanPedro", 11300, false, 0f);
ObjectInputStream leerOb;
ObjectOutput escribirOb;
try {
escribirOb = new ObjectOutputStream(new FileOutputStream("binarioSerializable.dat"));
leerOb = new ObjectInputStream(new FileInputStream("binarioSerializable.dat"));
escribirOb.writeObject(p1);
escribirOb.writeObject(p2);
escribirOb.close();
try {
while (true)
System.out.println(leerOb.readObject().toString());
} catch (EOFException e){
} catch (ClassNotFoundException e){
}
leerOb.close();
} catch (FileNotFoundException e) {
} catch (IOException e) {
}
}
}
|
[
"lauracalventedominguez@gmail.com"
] |
lauracalventedominguez@gmail.com
|
349b60cbed51d05308f3baa37624cc1923a22841
|
26fbaaf4414d9df7739f3c5e92cce4a2e90c6143
|
/src/fitnesse/responders/testHistory/TableListComparer.java
|
c8db4db7498bd3eeca0bff46e83a604beb4584b7
|
[] |
no_license
|
TotoroFitnesse/FitNesse-CloudTest
|
1da587e775ed13d11c097ae3131aa54a15a277ef
|
419df513eb1b860fbf918aee1ba3cde458e72143
|
refs/heads/master
| 2020-05-17T12:38:59.586765
| 2015-09-19T12:38:34
| 2015-09-19T12:38:34
| 42,380,286
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,029
|
java
|
package fitnesse.responders.testHistory;
import fitnesse.testsystems.slim.HtmlTableScanner;
import fitnesse.testsystems.slim.Table;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import static fitnesse.responders.testHistory.HistoryComparer.MatchedPair;
public class TableListComparer {
private HtmlTableScanner leftHandScanner;
private HtmlTableScanner rightHandScanner;
protected ArrayList<MatchedPair> tableMatches;
public TableListComparer(HtmlTableScanner leftHandScanner, HtmlTableScanner rightHandScanner) {
this.leftHandScanner = leftHandScanner;
this.rightHandScanner = rightHandScanner;
tableMatches = new ArrayList<MatchedPair>();
}
public void compareAllTables() {
for (int leftTableIndex = 0; leftTableIndex < leftHandScanner.getTableCount(); leftTableIndex++) {
for (int rightTableIndex = 0; rightTableIndex < rightHandScanner.getTableCount(); rightTableIndex++) {
double score = compareTables(leftTableIndex, rightTableIndex);
saveMatch(leftTableIndex, rightTableIndex, score);
}
}
sortMatchesByScore();
saveOnlyTheBestMatches();
sortMatchesByTableIndex();
}
private double compareTables(int leftTableIndex, int rightTableIndex) {
Table table1 = leftHandScanner.getTable(leftTableIndex);
Table table2 = rightHandScanner.getTable(rightTableIndex);
return compareTables(table1, table2);
}
double compareTables(Table table1, Table table2) {
return new TableComparer(table1, table2).compareRowsOfTables();
}
public boolean theTablesMatch(double score) {
return score >= HistoryComparer.MIN_MATCH_SCORE;
}
public void saveMatch(int leftTableIndex, int rightTableIndex, double score) {
if (!theTablesMatch(score))
return;
tableMatches.add(new MatchedPair(leftTableIndex, rightTableIndex, score));
}
public void saveOnlyTheBestMatches() {
for (int matchIndex = 0; matchIndex < tableMatches.size(); matchIndex++) {
for (int secondMatchIndex = matchIndex + 1; secondMatchIndex < tableMatches.size(); secondMatchIndex++) {
if (tableMatches.get(matchIndex).first == tableMatches.get(secondMatchIndex).first) {
tableMatches.remove(secondMatchIndex);
secondMatchIndex--;
} else if (tableMatches.get(matchIndex).second == tableMatches.get(secondMatchIndex).second) {
tableMatches.remove(secondMatchIndex);
secondMatchIndex--;
}
}
}
}
public void sortMatchesByScore() {
Collections.sort(tableMatches, new Comparator<MatchedPair>() {
public int compare(MatchedPair match1, MatchedPair match2) {
if (match1.matchScore > match2.matchScore)
return -1;
else if (match1.matchScore < match2.matchScore)
return 1;
else
return 0;
}
});
}
public void sortMatchesByTableIndex() {
Collections.sort(tableMatches, new Comparator<MatchedPair>() {
public int compare(MatchedPair match1, MatchedPair match2) {
if (match1.first > match2.first)
return 1;
else if (match1.first < match2.first)
return -1;
else
return 0;
}
});
}
static class TableComparer {
private Table table1;
private Table table2;
private int table1rows;
private int table2rows;
public TableComparer(Table table1, Table table2) {
this.table1 = table1;
this.table2 = table2;
table1rows = table1.getRowCount();
table2rows = table2.getRowCount();
}
public double compareRowsOfTables() {
if (table1rows != table2rows)
return 0;
return scoreRowContent() + scoreRowTopology() + scoreTableTopology();
}
private double scoreTableTopology() {
int cellCountForTable1 = 0;
int cellCountForTable2 = 0;
for (int row = 0; row < table1rows; row++) {
if (!isCalledScenario(table1, row)) {
cellCountForTable1 += table1.getColumnCountInRow(row);
}
if (!isCalledScenario(table2, row)) {
cellCountForTable2 += table2.getColumnCountInRow(row);
}
}
if (cellCountForTable1 == cellCountForTable2)
return .1;
else
return 0.0;
}
private double scoreRowContent() {
double colScore = 0.0;
int rowCount = 0;
for (int row = 0; row < table1rows; row++) {
if (!isCalledScenario(table1, row) || !isCalledScenario(table2, row)) {
colScore += compareCellsInRow(row);
rowCount++;
}
}
return (colScore) / rowCount;
}
private double scoreRowTopology() {
double score = 0.0;
for (int row = 0; row < table1rows; row++) {
int table1Cols = isCalledScenario(table1, row) ? 0 : table1.getColumnCountInRow(row);
int table2Cols = isCalledScenario(table2, row) ? 0 : table2.getColumnCountInRow(row);
if (table1Cols == table2Cols)
score += .1 * (2.0 / (table1rows + table2rows));
}
return score;
}
private double compareCellsInRow(int row) {
double score = 0;
int table1Cols = table1.getColumnCountInRow(row);
int table2Cols = table2.getColumnCountInRow(row);
int minNumberOfCols = Math.min(table1Cols, table2Cols);
for (int col = 0; col < minNumberOfCols; col++)
score += calculateScoreForCell(row, col);
score = score / (table1Cols + table2Cols);
return score;
}
private double calculateScoreForCell(int row, int col) {
return scoreCellPassFailResult(row, col) + scoreCellContent(row, col);
}
private double scoreCellContent(int row, int col) {
String content1 = table1.getCellContents(col, row);
String content2 = table2.getCellContents(col, row);
if (contentMatches(content1, content2))
return 1;
else
return 0;
}
private boolean contentMatches(String content1, String content2) {
return areEqualAndNotScenarioCalls(content1, content2) || bothAreScenarioCalls(content1, content2);
}
private boolean bothAreScenarioCalls(String content1, String content2) {
return isCalledScenario(content1) && isCalledScenario(content2);
}
private boolean areEqualAndNotScenarioCalls(String content1, String content2) {
return !isCalledScenario(content1) && !isCalledScenario(content2) && content1.equals(content2);
}
private double scoreCellPassFailResult(int row, int col) {
String content1 = table1.getCellContents(col, row);
String content2 = table2.getCellContents(col, row);
return content1.equals(content2) ? 1 : 0;
}
private boolean isCalledScenario(Table table, int row) {
if (table.getColumnCountInRow(row) == 1) {
String content = table.getCellContents(0, row);
return content.contains("<table>");
}
return false;
}
private boolean isCalledScenario(String content1) {
return content1.contains("<table>");
}
}
}
|
[
"1016907824@qq.com"
] |
1016907824@qq.com
|
57cf21b0a1c4ccef5d01e5933add5c206ce5b93c
|
e8e48a96f2aba9040f4f55ab61efaab1a9eb6a23
|
/interviewbit/Graph/SortedListToBST.java
|
7ba15b4b0b5b326f123994ff8d915ed99d52188c
|
[] |
no_license
|
arnabs542/algorithmic-problems
|
67342172c2035d9ffb2ee2bf0f1901e651dcce12
|
5d19d2e9cddc20e8a6949ac38fe6fb73dfc81bf4
|
refs/heads/master
| 2021-12-14T05:41:50.177195
| 2017-04-15T07:42:41
| 2017-04-15T07:42:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,296
|
java
|
/*Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
A height balanced BST : a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.
Example :
Given A : 1 -> 2 -> 3
A height balanced BST :
2
/ \
1 3
*/
/**
* Definition for singly-linked list.
* class ListNode {
* public int val;
* public ListNode next;
* ListNode(int x) { val = x; next = null; }
* }
*/
public class Solution {
ListNode node;
int getLength(ListNode node){
int len = 0;
while(node != null){
len++;
node = node.next;
}
return len;
}
public TreeNode sortedListToBST(ListNode head) {
if(head == null)
return null;
int n = getLength(head);
this.node = head;
return inorder(0, n-1);
}
public TreeNode inorder(int start, int end){
if(end < start)
return null;
int mid = (start + end)/2;
TreeNode left = inorder(start, mid-1);
TreeNode root = new TreeNode(node.val);
root.left = left;
node = node.next;
root.right = inorder(mid+1, end);
return root;
}
}
|
[
"masruba@gmail.com"
] |
masruba@gmail.com
|
e158312e76eacad90beac9435b10dd5be1d94bbd
|
d4061b0169186b36adb13a19a5ce72aa2e2c7572
|
/cloudhystrix/eureka-consumer-ribbon-hystrix/src/main/java/com/cloud/spring/eurekaconsumerribbonhystrix/ConsumerService.java
|
4946c94c943622d0c23d9f0e0a111ba6f48fd41c
|
[] |
no_license
|
chaochaoGT/cloud-hystrix
|
56a7aa8e40a8c136d5a16cba5580bde98634bf8a
|
bb09b1e303751319e434dcffed9fa0f80b48f4bf
|
refs/heads/master
| 2020-03-27T19:30:54.586727
| 2018-09-01T11:32:35
| 2018-09-01T11:32:35
| 146,994,056
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 673
|
java
|
package com.cloud.spring.eurekaconsumerribbonhystrix;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
@Service
public class ConsumerService {
@Autowired
RestTemplate restTemplate;
@HystrixCommand(fallbackMethod = "fallback")
public String consumer() {
return restTemplate.getForObject("http://eureka-clientA/dc", String.class);
}
public String fallback() {
return restTemplate.getForObject("http://eureka-clientB/dc1", String.class);
}
}
|
[
"952904879@qq.com"
] |
952904879@qq.com
|
457526532bc6e10bb60b5106c173d421f3a4cfbb
|
f47cc9a62fd1adc63147fac81fcea02c40efb189
|
/source/jaxme-jm/src/main/java/org/apache/ws/jaxme/impl/JMSAXMixedElementParser.java
|
447af98a3cad5f15a99da9f82e7360865f166110
|
[
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] |
permissive
|
sisbell/jaxme
|
d0ac8959776372ec3e604fd19c6c05ef2fd11a41
|
2429182048ae672cbadc734ac8983fdd99bbeb76
|
refs/heads/master
| 2021-01-19T15:30:09.964605
| 2012-07-10T09:09:36
| 2012-07-10T09:09:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,219
|
java
|
/*
* Copyright 2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ws.jaxme.impl;
import java.util.List;
/** A subclass of {@link org.apache.ws.jaxme.impl.JMSAXElementParser}
* for parsing complex elements.
*/
public abstract class JMSAXMixedElementParser extends JMSAXElementParser {
protected abstract List getContentList();
protected void normalize() {
List list = getContentList();
boolean previousIsString = false;
for (int i = list.size()-1; i >= 0; i--) {
Object o = list.get(i);
if (o instanceof StringBuffer) {
if (previousIsString) {
StringBuffer sb = (StringBuffer) o;
sb.append((String) list.remove(i+1));
}
list.set(i, o.toString());
previousIsString = true;
} else if (o instanceof String) {
if (previousIsString) {
list.set(i, (String) o + (String) list.remove(i+1));
}
previousIsString = true;
} else {
previousIsString = false;
}
}
}
public void addText(char[] pBuffer, int pOffset, int pLength) {
java.util.List list = getContentList();
StringBuffer sb = null;
if (list.size() > 0) {
java.lang.Object _3 = list.get(list.size()-1);
if (_3 instanceof StringBuffer) {
sb = (StringBuffer) _3;
}
}
if (sb == null) {
sb = new StringBuffer();
list.add(sb);
}
sb.append(pBuffer, pOffset, pLength);
}
}
|
[
"jochen.wiedmann@softwareag.com"
] |
jochen.wiedmann@softwareag.com
|
a5698c63586d688360bef11ee4eb540324f72168
|
1c0df66bdc53d84aea6f7aa1f0183cf6f8392ab1
|
/temp/src/minecraft/net/minecraft/client/gui/GuiDisconnected.java
|
0970f1de6bb4be03eb5dfb9a93b6583fff16a3b8
|
[] |
no_license
|
yuwenyong/Minecraft-1.9-MCP
|
9b7be179db0d7edeb74865b1a78d5203a5f75d08
|
bc89baf1fd0b5d422478619e7aba01c0b23bd405
|
refs/heads/master
| 2022-05-23T00:52:00.345068
| 2016-03-11T21:47:32
| 2016-03-11T21:47:32
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,253
|
java
|
package net.minecraft.client.gui;
import java.io.IOException;
import java.util.List;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.text.ITextComponent;
public class GuiDisconnected extends GuiScreen {
private String field_146306_a;
private ITextComponent field_146304_f;
private List<String> field_146305_g;
private final GuiScreen field_146307_h;
private int field_175353_i;
public GuiDisconnected(GuiScreen p_i45020_1_, String p_i45020_2_, ITextComponent p_i45020_3_) {
this.field_146307_h = p_i45020_1_;
this.field_146306_a = I18n.func_135052_a(p_i45020_2_, new Object[0]);
this.field_146304_f = p_i45020_3_;
}
protected void func_73869_a(char p_73869_1_, int p_73869_2_) throws IOException {
}
public void func_73866_w_() {
this.field_146292_n.clear();
this.field_146305_g = this.field_146289_q.func_78271_c(this.field_146304_f.func_150254_d(), this.field_146294_l - 50);
this.field_175353_i = this.field_146305_g.size() * this.field_146289_q.field_78288_b;
this.field_146292_n.add(new GuiButton(0, this.field_146294_l / 2 - 100, this.field_146295_m / 2 + this.field_175353_i / 2 + this.field_146289_q.field_78288_b, I18n.func_135052_a("gui.toMenu", new Object[0])));
}
protected void func_146284_a(GuiButton p_146284_1_) throws IOException {
if(p_146284_1_.field_146127_k == 0) {
this.field_146297_k.func_147108_a(this.field_146307_h);
}
}
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) {
this.func_146276_q_();
this.func_73732_a(this.field_146289_q, this.field_146306_a, this.field_146294_l / 2, this.field_146295_m / 2 - this.field_175353_i / 2 - this.field_146289_q.field_78288_b * 2, 11184810);
int i = this.field_146295_m / 2 - this.field_175353_i / 2;
if(this.field_146305_g != null) {
for(String s : this.field_146305_g) {
this.func_73732_a(this.field_146289_q, s, this.field_146294_l / 2, i, 16777215);
i += this.field_146289_q.field_78288_b;
}
}
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
}
}
|
[
"jholley373@yahoo.com"
] |
jholley373@yahoo.com
|
f0cf97995650dfe586c75626441900a2bdef3acb
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/JetBrains--kotlin/087eec45211fa3ba37cb6c49eb35589517e849ba/before/KotlinGotoTestGenerated.java
|
e6dd38063e09b602b65269712d7af51d9271121b
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,158
|
java
|
/*
* Copyright 2010-2014 JetBrains s.r.o.
*
* 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.jetbrains.jet.plugin.navigation;
import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestSuite;
import java.io.File;
import java.util.regex.Pattern;
import org.jetbrains.jet.JetTestUtils;
import org.jetbrains.jet.test.InnerTestClasses;
import org.jetbrains.jet.test.TestMetadata;
import org.jetbrains.jet.plugin.navigation.AbstractKotlinGotoTest;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@InnerTestClasses({KotlinGotoTestGenerated.GotoClass.class, KotlinGotoTestGenerated.GotoSymbol.class})
public class KotlinGotoTestGenerated extends AbstractKotlinGotoTest {
@TestMetadata("idea/testData/navigation/gotoClass")
public static class GotoClass extends AbstractKotlinGotoTest {
public void testAllFilesPresentInGotoClass() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/navigation/gotoClass"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("enumEntries.kt")
public void testEnumEntries() throws Exception {
doClassTest("idea/testData/navigation/gotoClass/enumEntries.kt");
}
@TestMetadata("inClassObject.kt")
public void testInClassObject() throws Exception {
doClassTest("idea/testData/navigation/gotoClass/inClassObject.kt");
}
@TestMetadata("innerClass.kt")
public void testInnerClass() throws Exception {
doClassTest("idea/testData/navigation/gotoClass/innerClass.kt");
}
@TestMetadata("localDeclarations.kt")
public void testLocalDeclarations() throws Exception {
doClassTest("idea/testData/navigation/gotoClass/localDeclarations.kt");
}
@TestMetadata("noImplementationTrait.kt")
public void testNoImplementationTrait() throws Exception {
doClassTest("idea/testData/navigation/gotoClass/noImplementationTrait.kt");
}
@TestMetadata("simpleClass.kt")
public void testSimpleClass() throws Exception {
doClassTest("idea/testData/navigation/gotoClass/simpleClass.kt");
}
@TestMetadata("simpleObject.kt")
public void testSimpleObject() throws Exception {
doClassTest("idea/testData/navigation/gotoClass/simpleObject.kt");
}
@TestMetadata("traitWithFunImplement.kt")
public void testTraitWithFunImplement() throws Exception {
doClassTest("idea/testData/navigation/gotoClass/traitWithFunImplement.kt");
}
}
@TestMetadata("idea/testData/navigation/gotoSymbol")
public static class GotoSymbol extends AbstractKotlinGotoTest {
public void testAllFilesPresentInGotoSymbol() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/navigation/gotoSymbol"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("functions.kt")
public void testFunctions() throws Exception {
doSymbolTest("idea/testData/navigation/gotoSymbol/functions.kt");
}
@TestMetadata("javaMethods.kt")
public void testJavaMethods() throws Exception {
doSymbolTest("idea/testData/navigation/gotoSymbol/javaMethods.kt");
}
@TestMetadata("properties.kt")
public void testProperties() throws Exception {
doSymbolTest("idea/testData/navigation/gotoSymbol/properties.kt");
}
@TestMetadata("stdLibArrayListOf.kt")
public void testStdLibArrayListOf() throws Exception {
doSymbolTest("idea/testData/navigation/gotoSymbol/stdLibArrayListOf.kt");
}
@TestMetadata("stdLibArrayListOfNoSources.kt")
public void testStdLibArrayListOfNoSources() throws Exception {
doSymbolTest("idea/testData/navigation/gotoSymbol/stdLibArrayListOfNoSources.kt");
}
@TestMetadata("stdLibJoinToString.kt")
public void testStdLibJoinToString() throws Exception {
doSymbolTest("idea/testData/navigation/gotoSymbol/stdLibJoinToString.kt");
}
}
public static Test suite() {
TestSuite suite = new TestSuite("KotlinGotoTestGenerated");
suite.addTestSuite(GotoClass.class);
suite.addTestSuite(GotoSymbol.class);
return suite;
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
44279fde0db50052cecccde4bc7da9b93ddde3cb
|
b4c47b649e6e8b5fc48eed12fbfebeead32abc08
|
/android/util/SparseArray.java
|
94ded90a74a79bcc8154d91e34358813e46df1db
|
[] |
no_license
|
neetavarkala/miui_framework_clover
|
300a2b435330b928ac96714ca9efab507ef01533
|
2670fd5d0ddb62f5e537f3e89648d86d946bd6bc
|
refs/heads/master
| 2022-01-16T09:24:02.202222
| 2018-09-01T13:39:50
| 2018-09-01T13:39:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,061
|
java
|
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
package android.util;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.GrowingArrayUtils;
import libcore.util.EmptyArray;
// Referenced classes of package android.util:
// ContainerHelpers
public class SparseArray
implements Cloneable
{
public SparseArray()
{
this(10);
}
public SparseArray(int i)
{
mGarbage = false;
if(i == 0)
{
mKeys = EmptyArray.INT;
mValues = EmptyArray.OBJECT;
} else
{
mValues = ArrayUtils.newUnpaddedObjectArray(i);
mKeys = new int[mValues.length];
}
mSize = 0;
}
private void gc()
{
int i = mSize;
int j = 0;
int ai[] = mKeys;
Object aobj[] = mValues;
for(int k = 0; k < i;)
{
Object obj = aobj[k];
int l = j;
if(obj != DELETED)
{
if(k != j)
{
ai[j] = ai[k];
aobj[j] = obj;
aobj[k] = null;
}
l = j + 1;
}
k++;
j = l;
}
mGarbage = false;
mSize = j;
}
public void append(int i, Object obj)
{
if(mSize != 0 && i <= mKeys[mSize - 1])
{
put(i, obj);
return;
}
if(mGarbage && mSize >= mKeys.length)
gc();
mKeys = GrowingArrayUtils.append(mKeys, mSize, i);
mValues = GrowingArrayUtils.append(mValues, mSize, obj);
mSize = mSize + 1;
}
public void clear()
{
int i = mSize;
Object aobj[] = mValues;
for(int j = 0; j < i; j++)
aobj[j] = null;
mSize = 0;
mGarbage = false;
}
public SparseArray clone()
{
SparseArray sparsearray = null;
SparseArray sparsearray1 = (SparseArray)super.clone();
sparsearray = sparsearray1;
sparsearray1.mKeys = (int[])mKeys.clone();
sparsearray = sparsearray1;
sparsearray1.mValues = (Object[])mValues.clone();
sparsearray = sparsearray1;
_L2:
return sparsearray;
CloneNotSupportedException clonenotsupportedexception;
clonenotsupportedexception;
if(true) goto _L2; else goto _L1
_L1:
}
public volatile Object clone()
throws CloneNotSupportedException
{
return clone();
}
public void delete(int i)
{
i = ContainerHelpers.binarySearch(mKeys, mSize, i);
if(i >= 0 && mValues[i] != DELETED)
{
mValues[i] = DELETED;
mGarbage = true;
}
}
public Object get(int i)
{
return get(i, null);
}
public Object get(int i, Object obj)
{
i = ContainerHelpers.binarySearch(mKeys, mSize, i);
if(i < 0 || mValues[i] == DELETED)
return obj;
else
return mValues[i];
}
public int indexOfKey(int i)
{
if(mGarbage)
gc();
return ContainerHelpers.binarySearch(mKeys, mSize, i);
}
public int indexOfValue(Object obj)
{
if(mGarbage)
gc();
for(int i = 0; i < mSize; i++)
if(mValues[i] == obj)
return i;
return -1;
}
public int indexOfValueByValue(Object obj)
{
if(mGarbage)
gc();
for(int i = 0; i < mSize; i++)
{
if(obj == null)
{
if(mValues[i] == null)
return i;
continue;
}
if(obj.equals(mValues[i]))
return i;
}
return -1;
}
public int keyAt(int i)
{
if(mGarbage)
gc();
return mKeys[i];
}
public void put(int i, Object obj)
{
int j = ContainerHelpers.binarySearch(mKeys, mSize, i);
if(j >= 0)
{
mValues[j] = obj;
} else
{
int k = j;
if(k < mSize && mValues[k] == DELETED)
{
mKeys[k] = i;
mValues[k] = obj;
return;
}
j = k;
if(mGarbage)
{
j = k;
if(mSize >= mKeys.length)
{
gc();
j = ContainerHelpers.binarySearch(mKeys, mSize, i);
}
}
mKeys = GrowingArrayUtils.insert(mKeys, mSize, j, i);
mValues = GrowingArrayUtils.insert(mValues, mSize, j, obj);
mSize = mSize + 1;
}
}
public void remove(int i)
{
delete(i);
}
public void removeAt(int i)
{
if(mValues[i] != DELETED)
{
mValues[i] = DELETED;
mGarbage = true;
}
}
public void removeAtRange(int i, int j)
{
for(j = Math.min(mSize, i + j); i < j; i++)
removeAt(i);
}
public Object removeReturnOld(int i)
{
i = ContainerHelpers.binarySearch(mKeys, mSize, i);
if(i >= 0 && mValues[i] != DELETED)
{
Object obj = mValues[i];
mValues[i] = DELETED;
mGarbage = true;
return obj;
} else
{
return null;
}
}
public void setValueAt(int i, Object obj)
{
if(mGarbage)
gc();
mValues[i] = obj;
}
public int size()
{
if(mGarbage)
gc();
return mSize;
}
public String toString()
{
if(size() <= 0)
return "{}";
StringBuilder stringbuilder = new StringBuilder(mSize * 28);
stringbuilder.append('{');
int i = 0;
while(i < mSize)
{
if(i > 0)
stringbuilder.append(", ");
stringbuilder.append(keyAt(i));
stringbuilder.append('=');
Object obj = valueAt(i);
if(obj != this)
stringbuilder.append(obj);
else
stringbuilder.append("(this Map)");
i++;
}
stringbuilder.append('}');
return stringbuilder.toString();
}
public Object valueAt(int i)
{
if(mGarbage)
gc();
return mValues[i];
}
private static final Object DELETED = new Object();
private boolean mGarbage;
private int mKeys[];
private int mSize;
private Object mValues[];
}
|
[
"hosigumayuugi@gmail.com"
] |
hosigumayuugi@gmail.com
|
fc25342ed61b5a7c07017884fe0fb91f3f760a17
|
b77a4d5bd23a3f69e90e5e01508fbc3687a432f5
|
/weblogger-business/src/main/java/org/apache/roller/weblogger/business/search/IndexManager.java
|
d7df4445ed11033e44f234a145c1f83708b0ae0d
|
[
"Apache-2.0",
"LicenseRef-scancode-jdom",
"BSD-3-Clause"
] |
permissive
|
JavaQualitasCorpus/roller-5.0.1
|
59abb7cbd8389c47b27e0a341a3746dacfd2df88
|
08e7be2b36b148a2e293948e3664177953b83124
|
refs/heads/master
| 2023-08-13T19:29:24.333161
| 2020-05-29T15:53:22
| 2020-05-29T15:53:22
| 167,005,068
| 0
| 1
|
NOASSERTION
| 2022-07-08T19:05:18
| 2019-01-22T14:09:12
|
HTML
|
UTF-8
|
Java
| false
| false
| 2,793
|
java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. 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. For additional information regarding
* copyright in this work, please see the NOTICE file in the top level
* directory of this distribution.
*/
package org.apache.roller.weblogger.business.search;
import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.InitializationException;
import org.apache.roller.weblogger.business.search.operations.IndexOperation;
import org.apache.roller.weblogger.pojos.WeblogEntry;
import org.apache.roller.weblogger.pojos.Weblog;
/**
* Interface to Roller's Lucene-based search facility.
* @author Dave Johnson
*/
public interface IndexManager
{
/** Does index need to be rebuild */
public abstract boolean isInconsistentAtStartup();
/** Remove user from index, returns immediately and operates in background */
public void removeWebsiteIndex(Weblog website) throws WebloggerException;
/** Remove entry from index, returns immediately and operates in background */
public void removeEntryIndexOperation(WeblogEntry entry) throws WebloggerException;
/** Add entry to index, returns immediately and operates in background */
public void addEntryIndexOperation(WeblogEntry entry) throws WebloggerException;
/** R-index entry, returns immediately and operates in background */
public void addEntryReIndexOperation(WeblogEntry entry) throws WebloggerException;
/** Execute operation immediately */
public abstract void executeIndexOperationNow(final IndexOperation op);
/**
* Release all resources associated with Roller session.
*/
public abstract void release();
/**
* Initialize the search system.
*
* @throws InitializationException If there is a problem during initialization.
*/
public void initialize() throws InitializationException;
/** Shutdown to be called on application shutdown */
public abstract void shutdown();
public abstract void rebuildWebsiteIndex(Weblog website) throws WebloggerException;
public abstract void rebuildWebsiteIndex() throws WebloggerException;
}
|
[
"taibi@sonar-scheduler.rd.tut.fi"
] |
taibi@sonar-scheduler.rd.tut.fi
|
12ca4350d41f9e2a4873015ee9d810e8151f31fe
|
ef830bb18e1f432122e1c9523d4c807c9ef077a5
|
/src/main/java/com/taobao/api/request/QimenItemsTagQueryRequest.java
|
c925581a155dee010c01768016cfa62a91f7757c
|
[] |
no_license
|
daiyuok/TopSecuritySdk
|
bb424c5808bd103079cbbbfcb56689a73259a24d
|
8ac8eb48b88158a741c820a940564fd0b876e9db
|
refs/heads/master
| 2021-01-22T06:49:05.025064
| 2017-03-01T06:19:42
| 2017-03-01T06:19:42
| 81,789,925
| 2
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,339
|
java
|
package com.taobao.api.request;
import com.taobao.api.internal.util.RequestCheckUtils;
import java.util.Map;
import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.QimenItemsTagQueryResponse;
/**
* TOP API: taobao.qimen.items.tag.query request
*
* @author top auto create
* @since 1.0, 2016.07.04
*/
public class QimenItemsTagQueryRequest extends BaseTaobaoRequest<QimenItemsTagQueryResponse> {
/**
* 线上淘宝商品ID,long,必填
*/
private String itemIds;
public void setItemIds(String itemIds) {
this.itemIds = itemIds;
}
public String getItemIds() {
return this.itemIds;
}
public String getApiMethodName() {
return "taobao.qimen.items.tag.query";
}
public Map<String, String> getTextParams() {
TaobaoHashMap txtParams = new TaobaoHashMap();
txtParams.put("item_ids", this.itemIds);
if(this.udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public Class<QimenItemsTagQueryResponse> getResponseClass() {
return QimenItemsTagQueryResponse.class;
}
public void check() throws ApiRuleException {
RequestCheckUtils.checkNotEmpty(itemIds, "itemIds");
RequestCheckUtils.checkMaxListSize(itemIds, 20, "itemIds");
}
}
|
[
"daixinyu@shopex.cn"
] |
daixinyu@shopex.cn
|
e28a6b2da1752227df6d9bc465135268b2e27bbf
|
1eebb2025068fe1c51ed3cc5bf1deb0e5e49e5f6
|
/march-concurrent/src/main/java/com/abin/lee/march/svr/concurrent/lru/LruShootCache.java
|
84d93aac36eb6edc19c0c558021481e6856b78ee
|
[
"MIT"
] |
permissive
|
zondahuman/march-svr
|
7febd6a0884d57ea2d08bb2d56fec394659353fe
|
9e12d6549fd8ad122cbc2e02390ad1af57c42f70
|
refs/heads/master
| 2021-01-01T16:47:01.154468
| 2018-05-18T08:48:53
| 2018-05-18T08:48:53
| 97,918,739
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,104
|
java
|
package com.abin.lee.march.svr.concurrent.lru;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
/**
* Created by abin on 2018/1/18 23:19.
* march-svr
* com.abin.lee.march.svr.concurrent.lru
* https://www.cnblogs.com/liuyang0/p/6664586.html
*/
public class LruShootCache<K, V> {
private final int MAX_CACHE_SIZE;
private final float DEFAULT_LOAD_FACTORY = 0.75f;
LinkedHashMap<K, V> map;
public LruShootCache(int cacheSize) {
MAX_CACHE_SIZE = cacheSize;
int capacity = (int)Math.ceil(MAX_CACHE_SIZE / DEFAULT_LOAD_FACTORY) + 1;
/*
* 第三个参数设置为true,代表linkedlist按访问顺序排序,可作为LRU缓存
* 第三个参数设置为false,代表按插入顺序排序,可作为FIFO缓存
*/
map = new LinkedHashMap<K, V>(capacity, DEFAULT_LOAD_FACTORY, true) {
@Override
protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
return size() > MAX_CACHE_SIZE;
}
};
}
public synchronized void put(K key, V value) {
map.put(key, value);
}
public synchronized V get(K key) {
return map.get(key);
}
public synchronized void remove(K key) {
map.remove(key);
}
public synchronized Set<Map.Entry<K, V>> getAll() {
return map.entrySet();
}
@Override
public String toString() {
StringBuilder stringBuilder = new StringBuilder();
for (Map.Entry<K, V> entry : map.entrySet()) {
stringBuilder.append(String.format("%s: %s ", entry.getKey(), entry.getValue()));
}
return stringBuilder.toString();
}
public static void main(String[] args) {
LruShootCache<Integer, Integer> lru1 = new LruShootCache<>(5);
lru1.put(1, 1);
lru1.put(2, 2);
lru1.put(3, 3);
System.out.println(lru1);
lru1.get(1);
System.out.println(lru1);
lru1.put(4, 4);
lru1.put(5, 5);
lru1.put(6, 6);
System.out.println(lru1);
}
}
|
[
"zondahuman@gmail.com"
] |
zondahuman@gmail.com
|
4b3ed85f87c8586ff76b952fda02ed1fce3b3f18
|
229a97e1b53dcb845d8891540bf467299b4d4f0f
|
/FAQ/src/main/java/peri/fun/service/IUserMemberService.java
|
03a04d179278c55d6f88517577f79134c061f7fa
|
[] |
no_license
|
helloBosom/FAQ_Version1.0
|
3811a9aad1d9828d30572ec4a23cc548257eaae6
|
d9167d3e081ebbd26d2825dda9c0620e4790f0de
|
refs/heads/master
| 2021-04-26T21:48:26.932153
| 2018-04-11T10:20:05
| 2018-04-11T10:20:05
| 124,161,111
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 367
|
java
|
package peri.fun.service;
import peri.fun.model.User;
import peri.fun.model.UserMember;
import java.util.List;
public interface IUserMemberService {
public boolean addUser(UserMember user);
public List<UserMember> query();
public boolean lock(String USERID);
public boolean deblock(String USERID);
public boolean validateUser(User user);
}
|
[
"13572186526@163.com"
] |
13572186526@163.com
|
f4a9dac416300c912e9bae369080f1a1897ad06a
|
7d5b4d687057fd689d4d53eb559fae1f45d91ab0
|
/yiran-admin/src/main/java/com/yiran/web/controller/member/MemberTrBankAccountController.java
|
2b4186499dd53c9e30e5ad606689df86e9161456
|
[
"Apache-2.0"
] |
permissive
|
jackCode1991/myStore
|
7d805a75a520c7111319db76073ecddbf60c318a
|
01bd39233b8da8838905b509484162f35cf4bef2
|
refs/heads/master
| 2022-11-21T16:28:29.140184
| 2020-01-17T07:21:31
| 2020-01-17T07:21:31
| 234,493,429
| 1
| 1
|
Apache-2.0
| 2022-11-16T07:36:31
| 2020-01-17T07:18:19
|
Java
|
UTF-8
|
Java
| false
| false
| 4,307
|
java
|
package com.yiran.web.controller.member;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yiran.common.annotation.Log;
import com.yiran.common.enums.BusinessType;
import com.yiran.member.domain.MemberTrBankAccount;
import com.yiran.member.service.IMemberTrBankAccountService;
import com.yiran.framework.web.base.BaseController;
import com.yiran.common.page.TableDataInfo;
import com.yiran.common.base.AjaxResult;
import com.yiran.common.config.Global;
import com.yiran.common.utils.poi.ExcelUtil;
/**
* 个人银行卡 信息操作处理
*
* @author yiran
* @date 2019-03-30
*/
@Controller
@RequestMapping("/member/memberTrBankAccount")
public class MemberTrBankAccountController extends BaseController
{
private String prefix = "member/memberTrBankAccount";
@Autowired
private IMemberTrBankAccountService memberTrBankAccountService;
@RequiresPermissions("member:memberTrBankAccount:view")
@GetMapping()
public String memberTrBankAccount()
{
return prefix + "/memberTrBankAccount";
}
/**
* 查询个人银行卡列表
*/
@RequiresPermissions("member:memberTrBankAccount:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(MemberTrBankAccount memberTrBankAccount)
{
startPage();
List<MemberTrBankAccount> list = memberTrBankAccountService.selectMemberTrBankAccountList(memberTrBankAccount);
return getDataTable(list);
}
/**
* 导出个人银行卡列表
*/
@RequiresPermissions("member:memberTrBankAccount:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(MemberTrBankAccount memberTrBankAccount)
{
List<MemberTrBankAccount> list = memberTrBankAccountService.selectMemberTrBankAccountList(memberTrBankAccount);
ExcelUtil<MemberTrBankAccount> util = new ExcelUtil<MemberTrBankAccount>(MemberTrBankAccount.class);
return util.exportExcel(list, "memberTrBankAccount");
}
/**
* 新增个人银行卡
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存个人银行卡
*/
@RequiresPermissions("member:memberTrBankAccount:add")
@Log(title = "个人银行卡", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(MemberTrBankAccount memberTrBankAccount)
{
if(DEMOENABLED.equals(Global.isDemoEnabled())){
return error("当前模式是演示模式不能修改数据");
}
return toAjax(memberTrBankAccountService.insertMemberTrBankAccount(memberTrBankAccount));
}
/**
* 修改个人银行卡
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Integer id, ModelMap mmap)
{
MemberTrBankAccount memberTrBankAccount = memberTrBankAccountService.selectMemberTrBankAccountById(id);
mmap.put("memberTrBankAccount", memberTrBankAccount);
return prefix + "/edit";
}
/**
* 修改保存个人银行卡
*/
@RequiresPermissions("member:memberTrBankAccount:edit")
@Log(title = "个人银行卡", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(MemberTrBankAccount memberTrBankAccount)
{
if(DEMOENABLED.equals(Global.isDemoEnabled())){
return error("当前模式是演示模式不能修改数据");
}
return toAjax(memberTrBankAccountService.updateMemberTrBankAccount(memberTrBankAccount));
}
/**
* 删除个人银行卡
*/
@RequiresPermissions("member:memberTrBankAccount:remove")
@Log(title = "个人银行卡", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
if(DEMOENABLED.equals(Global.isDemoEnabled())){
return error("当前模式是演示模式不能修改数据");
}
return toAjax(memberTrBankAccountService.deleteMemberTrBankAccountByIds(ids));
}
}
|
[
"80002510@sf-express.com"
] |
80002510@sf-express.com
|
d49bbeeab9cf1e083c076f098887562f0c2e82ad
|
ceeea83e2553c0ffef73bb8d3dc784477e066531
|
/e-Finance/src/com/svs/finance/dao/impl/C_VoucherPurchasesDAOImpl.java
|
649719281827c28b860a87146060172da111f1ae
|
[
"Apache-2.0"
] |
permissive
|
anupammaiti/ERP
|
99bf67f9335a2fea96e525a82866810875bc8695
|
8c124deb41c4945c7cd55cc331b021eae4100c62
|
refs/heads/master
| 2020-08-13T19:30:59.922232
| 2019-10-09T17:04:58
| 2019-10-09T17:04:58
| 215,025,440
| 1
| 0
|
Apache-2.0
| 2019-10-14T11:26:11
| 2019-10-14T11:26:10
| null |
UTF-8
|
Java
| false
| false
| 1,084
|
java
|
package com.svs.finance.dao.impl;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import com.svs.finance.bean.VocherPurchaseBean;
import com.svs.finance.dao.IN_VoucherPurchasesDAO;
public class C_VoucherPurchasesDAOImpl implements IN_VoucherPurchasesDAO {
private HibernateTemplate ht;
private List grouplist;
private boolean insertorupdate=false;
private Session session;
@Autowired
public void setSessionFactory(SessionFactory sessionfactory){
ht=new HibernateTemplate(sessionfactory);
session=sessionfactory.openSession();
}
@Override
public boolean generateVoucherPurchases(VocherPurchaseBean voucherpurchases) {
// TODO Auto-generated method stub
try{
long id=(long)ht.save(voucherpurchases);
if(id!=0){
insertorupdate=true;
}else{
insertorupdate=false;
}
}catch(Exception ex){
ex.printStackTrace();
}
return insertorupdate;
}
}
|
[
"rrkravikiranrrk@gmail.com"
] |
rrkravikiranrrk@gmail.com
|
a133ed7fd7d9cac24d021a2dab614880e9008ce2
|
e5d729b0668345ff13e8fee9a0024b848e356897
|
/src/test/java/com/fxpt/FxptApplicationTests.java
|
29c40e19952dd6c1510a7685c191b4945ce8a1e1
|
[] |
no_license
|
zhaoyuzhong1/fxpt
|
1d3d56734abca4a8ca7925c716b226ded846cdf3
|
e447d52557d284e4d07e80123a639285b6fe8d5c
|
refs/heads/master
| 2020-04-14T17:16:07.771115
| 2019-03-27T01:49:45
| 2019-03-27T01:49:45
| 163,974,545
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 324
|
java
|
package com.fxpt;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class FxptApplicationTests {
@Test
public void contextLoads() {
}
}
|
[
"d"
] |
d
|
6a6e3e9a108b895a7905246af235a04134f109b7
|
18b20a45faa4cf43242077e9554c0d7d42667fc2
|
/HelicoBacterMod/build/tmp/expandedArchives/forge-1.14.4-28.1.0_mapped_snapshot_20190719-1.14.3-sources.jar_db075387fe30fb93ccdc311746149f9d/net/minecraft/world/gen/feature/EndGatewayFeature.java
|
82a6c1d71deffa85800b039e65d2d1dce1086a75
|
[] |
no_license
|
qrhlhplhp/HelicoBacterMod
|
2cbe1f0c055fd5fdf97dad484393bf8be32204ae
|
0452eb9610cd70f942162d5b23141b6bf524b285
|
refs/heads/master
| 2022-07-28T16:06:03.183484
| 2021-03-20T11:01:38
| 2021-03-20T11:01:38
| 347,618,857
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,348
|
java
|
package net.minecraft.world.gen.feature;
import com.mojang.datafixers.Dynamic;
import java.util.Random;
import java.util.function.Function;
import net.minecraft.block.Blocks;
import net.minecraft.tileentity.EndGatewayTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.GenerationSettings;
public class EndGatewayFeature extends Feature<EndGatewayConfig> {
public EndGatewayFeature(Function<Dynamic<?>, ? extends EndGatewayConfig> p_i49881_1_) {
super(p_i49881_1_);
}
public boolean place(IWorld worldIn, ChunkGenerator<? extends GenerationSettings> generator, Random rand, BlockPos pos, EndGatewayConfig config) {
for(BlockPos blockpos : BlockPos.getAllInBoxMutable(pos.add(-1, -2, -1), pos.add(1, 2, 1))) {
boolean flag = blockpos.getX() == pos.getX();
boolean flag1 = blockpos.getY() == pos.getY();
boolean flag2 = blockpos.getZ() == pos.getZ();
boolean flag3 = Math.abs(blockpos.getY() - pos.getY()) == 2;
if (flag && flag1 && flag2) {
BlockPos blockpos1 = blockpos.toImmutable();
this.setBlockState(worldIn, blockpos1, Blocks.END_GATEWAY.getDefaultState());
config.func_214700_b().ifPresent((p_214624_3_) -> {
TileEntity tileentity = worldIn.getTileEntity(blockpos1);
if (tileentity instanceof EndGatewayTileEntity) {
EndGatewayTileEntity endgatewaytileentity = (EndGatewayTileEntity)tileentity;
endgatewaytileentity.setExitPortal(p_214624_3_, config.func_214701_c());
tileentity.markDirty();
}
});
} else if (flag1) {
this.setBlockState(worldIn, blockpos, Blocks.AIR.getDefaultState());
} else if (flag3 && flag && flag2) {
this.setBlockState(worldIn, blockpos, Blocks.BEDROCK.getDefaultState());
} else if ((flag || flag2) && !flag3) {
this.setBlockState(worldIn, blockpos, Blocks.BEDROCK.getDefaultState());
} else {
this.setBlockState(worldIn, blockpos, Blocks.AIR.getDefaultState());
}
}
return true;
}
}
|
[
"rubickraft169@gmail.com"
] |
rubickraft169@gmail.com
|
1dbeecee48fa06fea98a1e6174e117441c94553d
|
b5c485493f675bcc19dcadfecf9e775b7bb700ed
|
/jee-utility-__kernel__/src/test/java/org/cyk/utility/__kernel__/instance/InstanceGetterUnitTest.java
|
9ae0d6c41836b32a4644129731d3135e45c981b3
|
[] |
no_license
|
devlopper/org.cyk.utility
|
148a1aafccfc4af23a941585cae61229630b96ec
|
14ec3ba5cfe0fa14f0e2b1439ef0f728c52ec775
|
refs/heads/master
| 2023-03-05T23:45:40.165701
| 2021-04-03T16:34:06
| 2021-04-03T16:34:06
| 16,252,993
| 1
| 0
| null | 2022-10-12T20:09:48
| 2014-01-26T12:52:24
|
Java
|
UTF-8
|
Java
| false
| false
| 5,013
|
java
|
package org.cyk.utility.__kernel__.instance;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Collection;
import java.util.List;
import org.cyk.utility.__kernel__.configuration.ConfigurationHelper;
import org.cyk.utility.test.weld.AbstractWeldUnitTest;
import org.cyk.utility.__kernel__.variable.VariableHelper;
import org.junit.jupiter.api.Test;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
public class InstanceGetterUnitTest extends AbstractWeldUnitTest {
private static final long serialVersionUID = 1L;
@Override
protected void __listenBefore__() {
super.__listenBefore__();
InstanceGetterImpl.clear();
ConfigurationHelper.clear();
}
@Test
public void getBySystemIdentifier_(){
InstanceGetterImpl.add(new Klass().setIdentifier("123").setCode("abc"));
Klass instance = InstanceGetter.getInstance().getBySystemIdentifier(Klass.class, "123");
assertThat(instance.getIdentifier()).isEqualTo("123");
assertThat(instance.getCode()).isEqualTo("abc");
}
@Test
public void getByBusinessIdentifier_(){
InstanceGetterImpl.add(new Klass().setIdentifier("123").setCode("abc"));
Klass instance = InstanceGetter.getInstance().getByBusinessIdentifier(Klass.class, "abc");
assertThat(instance.getIdentifier()).isEqualTo("123");
assertThat(instance.getCode()).isEqualTo("abc");
}
@Test
public void getFromUniformResourceIdentifier(){
VariableHelper.writeClassUniformResourceIdentifier(Person.class, getClass().getResource("person.json"));
Collection<Person> persons = InstanceGetter.getInstance().getFromUniformResourceIdentifier(Person.class, "identifier","name","identifier");
assertThat(persons).isNotNull();
assertThat(persons.stream().map(Person::getIdentifier)).containsExactly("1","2");
}
@Test
public void getFromUniformResourceIdentifier_1(){
VariableHelper.writeClassUniformResourceIdentifier(Person.class, getClass().getResource("person_1.json"));
Collection<Person> persons = InstanceGetter.getInstance().getFromUniformResourceIdentifier(Person.class, "identifier","name","identifier");
assertThat(persons).isNotNull();
assertThat(persons.stream().map(Person::getIdentifier)).containsExactly("1","2");
}
@Test
public void getFromUniformResourceIdentifier_2(){
VariableHelper.writeClassUniformResourceIdentifier(Person.class, getClass().getResource("person_2.json"));
Collection<Person> persons = InstanceGetter.getInstance().getFromUniformResourceIdentifier(Person.class, "identifier","name","identifier");
assertThat(persons).isNotNull();
assertThat(persons.stream().map(Person::getIdentifier)).containsExactly("A","B");
}
@Test
public void getFromUniformResourceIdentifier_1_2_classifier_1(){
VariableHelper.writeClassUniformResourceIdentifier(Person.class,"1", getClass().getResource("person_1.json"));
VariableHelper.writeClassUniformResourceIdentifier(Person.class,"2", getClass().getResource("person_2.json"));
Collection<Person> persons = InstanceGetter.getInstance().getFromUniformResourceIdentifier(Person.class,"1", List.of("identifier","name","identifier"));
assertThat(persons).isNotNull();
assertThat(persons.stream().map(Person::getIdentifier)).containsExactly("1","2");
}
@Test
public void getFromUniformResourceIdentifier_1_2_classifier_2(){
VariableHelper.writeClassUniformResourceIdentifier(Person.class,"1", getClass().getResource("person_1.json"));
VariableHelper.writeClassUniformResourceIdentifier(Person.class,"2", getClass().getResource("person_2.json"));
Collection<Person> persons = InstanceGetter.getInstance().getFromUniformResourceIdentifier(Person.class,2, "identifier","name","identifier");
assertThat(persons).isNotNull();
assertThat(persons.stream().map(Person::getIdentifier)).containsExactly("A","B");
}
@Test
public void getFromUniformResourceIdentifier_1_2(){
VariableHelper.writeClassUniformResourceIdentifier(Person.class,"1", getClass().getResource("person_1.json"));
VariableHelper.writeClassUniformResourceIdentifier(Person.class,"2", getClass().getResource("person_2.json"));
Collection<Person> persons = InstanceGetter.getInstance().getFromUniformResourceIdentifiers(Person.class, List.of("1","2"), "identifier","name","identifier");
assertThat(persons).isNotNull();
assertThat(persons.stream().map(Person::getIdentifier)).containsExactly("1","2","A","B");
}
/**/
/* Persistence */
@Getter @Setter @Accessors(chain=true)
public static class Klass {
private String identifier,code;
}
@Getter @Setter @Accessors(chain=true)
@EqualsAndHashCode(of = {"identifier"}) @ToString
@NoArgsConstructor @AllArgsConstructor
public static class Person {
private String identifier;
private String name;
private Integer age;
}
}
|
[
"kycdev@gmail.com"
] |
kycdev@gmail.com
|
98e973498564853c455ce91ba76fcaea1e7fdb92
|
995f73d30450a6dce6bc7145d89344b4ad6e0622
|
/Mate20-9.0/src/main/java/com/android/server/wm/IHwAppWindowContainerController.java
|
b3dc9a6e7d3edd47abb5893eaa3ece1448a3bf03
|
[] |
no_license
|
morningblu/HWFramework
|
0ceb02cbe42585d0169d9b6c4964a41b436039f5
|
672bb34094b8780806a10ba9b1d21036fd808b8e
|
refs/heads/master
| 2023-07-29T05:26:14.603817
| 2021-09-03T05:23:34
| 2021-09-03T05:23:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 643
|
java
|
package com.android.server.wm;
import android.content.pm.ApplicationInfo;
import android.os.IBinder;
import android.view.IApplicationToken;
import com.android.server.AttributeCache;
public interface IHwAppWindowContainerController {
int continueHwStartWindow(String str, AttributeCache.Entry entry, ApplicationInfo applicationInfo, boolean z, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7, IBinder iBinder, IApplicationToken iApplicationToken, RootWindowContainer rootWindowContainer, boolean z8);
IBinder getTransferFrom(ApplicationInfo applicationInfo);
boolean isHwStartWindowEnabled(String str);
}
|
[
"dstmath@163.com"
] |
dstmath@163.com
|
96d42c6dee6a8ad357b83c5816c77e9c8dd4aeb6
|
867edbfdaa5bb7fb550a89acbbef37913111a901
|
/src/main/java/com/jin10/spidermanage/entity/Link.java
|
0d44707aaf0eefb42d029b22d511f4160dc33466
|
[] |
no_license
|
Raofy/spider-manage
|
f224bb0be3f7a50282fc5a12a7de84902dfb987c
|
e0923a834853239edf0a9220e5fe10ee51655491
|
refs/heads/master
| 2023-03-09T10:49:29.459129
| 2021-03-01T01:28:44
| 2021-03-01T01:28:44
| 304,601,762
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 861
|
java
|
package com.jin10.spidermanage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.jin10.spidermanage.bean.label.InsertBody;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import static com.baomidou.mybatisplus.annotation.IdType.AUTO;
@Data
@EqualsAndHashCode()
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class Link implements Serializable {
@TableId(type = AUTO)
private Integer id;
/**
* 链接
*/
private String link;
/**
* 标签ID
*/
private Integer labelId;
public Link(int add, String link) {
this.labelId = add;
this.link = link;
}
}
|
[
"1312170600@qq.com"
] |
1312170600@qq.com
|
dec8c1d0086013ff345933dc6d0939cee66d9c13
|
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
|
/SQuirrel_SQL/rev4007-4212/right-trunk-4212/test/src/net/sourceforge/squirrel_sql/fw/dialects/SybaseDialectTest.java
|
981aaa1451b93024c40f24c213a48f162d49f641
|
[] |
no_license
|
joliebig/featurehouse_fstmerge_examples
|
af1b963537839d13e834f829cf51f8ad5e6ffe76
|
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
|
refs/heads/master
| 2016-09-05T10:24:50.974902
| 2013-03-28T16:28:47
| 2013-03-28T16:28:47
| 9,080,611
| 3
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 380
|
java
|
package net.sourceforge.squirrel_sql.fw.dialects;
public class SybaseDialectTest extends DialectTestCase {
private SybaseDialectExt dialect = null;
@Override
public void setUp() throws Exception {
super.setUp();
dialect = new SybaseDialectExt();
}
public void testGetTypeNameInt() {
testAllTypes(dialect);
}
}
|
[
"joliebig@fim.uni-passau.de"
] |
joliebig@fim.uni-passau.de
|
f1ed13a9ed2c28018f4ed948f721d219280117a9
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/9/9_3ac1002a13233c5fe3c05bc41377822862a52e46/Crawler/9_3ac1002a13233c5fe3c05bc41377822862a52e46_Crawler_s.java
|
9b12b6238af1c9e32d5478f85a673f31c6b11ac3
|
[] |
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
| 2,706
|
java
|
package model.http.crawler;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashSet;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.LinkedBlockingQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import model.http.HttpGet;
import model.http.crawler.extractorjoint.Extractor;
import model.http.crawler.extractorjoint.ExtractorJoint;
import model.http.crawler.persistentbuffer.PersistentBuffer;
public class Crawler implements ICrawler {
private static final Logger log = (Logger) LoggerFactory
.getLogger(Crawler.class);
private String crawlNamespace;
private String dataNamespace;
private Queue<URL> dataBuffer = new LinkedBlockingQueue<URL>();
private HttpGet httpCon;
private PersistentBuffer crawlBuffer;
private ExtractorJoint factory;
public Crawler(PersistentBuffer model, ExtractorJoint factory2,
String crawlNamespace, String dataNamespace) {
init(factory2, model, httpCon, crawlNamespace, dataNamespace);
}
private void init(ExtractorJoint factory2, PersistentBuffer model,
HttpGet httpCon, String crawlNamespace, String dataNamespace) {
this.factory = factory2;
this.httpCon = httpCon;
this.crawlNamespace = crawlNamespace;
this.dataNamespace = dataNamespace;
this.crawlBuffer = model;
}
public String getDataNamespace() {
return dataNamespace;
}
public String getCrawlNamespace() {
return crawlNamespace;
}
/* (non-Javadoc)
* @see model.http.crawler.ICrawler#getNext(int)
*/
public Set<URL> getNext(int count) {
while (this.dataBuffer.size() < count && !this.crawlBuffer.isEmpty())
try {
crawlNextURL();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Set<URL> urls = new HashSet<URL>();
while (urls.size() < count && !this.crawlBuffer.isEmpty())
urls.add(this.dataBuffer.poll());
return urls;
}
private void crawlNextURL() throws MalformedURLException {
URL next = this.crawlBuffer.poll();
if(next != null) {
log.debug("Crawling: " + next.toExternalForm());
Extractor<URL> extract = factory.create(next);
Set<URL> links = extract.get();
for (URL link : links) {
if (link.toExternalForm().matches(this.dataNamespace)) {
log.debug("Found new data: " + link.toExternalForm());
this.dataBuffer.add(link);
} else if (link.toExternalForm().matches(this.crawlNamespace)) {
log.debug("Found new url to crawl: " + link.toExternalForm());
this.crawlBuffer.add(link);
}
}
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
47139ee3617119a1f6041626f8dbf738a949b33c
|
d00af6c547e629983ff777abe35fc9c36b3b2371
|
/jboss-all/testsuite/src/main/org/jboss/test/exception/ExceptionTesterLocal.java
|
df52d5323e4de64718a5554cf7011ad75799d7fd
|
[] |
no_license
|
aosm/JBoss
|
e4afad3e0d6a50685a55a45209e99e7a92f974ea
|
75a042bd25dd995392f3dbc05ddf4bbf9bdc8cd7
|
refs/heads/master
| 2023-07-08T21:50:23.795023
| 2013-03-20T07:43:51
| 2013-03-20T07:43:51
| 8,898,416
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 729
|
java
|
package org.jboss.test.exception;
import javax.ejb.EJBLocalObject;
import javax.ejb.FinderException;
public interface ExceptionTesterLocal extends EJBLocalObject
{
public void applicationExceptionInTx() throws ApplicationException;
public void applicationErrorInTx();
public void ejbExceptionInTx();
public void runtimeExceptionInTx();
public void applicationExceptionNewTx() throws ApplicationException;
public void applicationErrorNewTx();
public void ejbExceptionNewTx();
public void runtimeExceptionNewTx();
public void applicationExceptionNoTx() throws ApplicationException;
public void applicationErrorNoTx();
public void ejbExceptionNoTx();
public void runtimeExceptionNoTx();
}
|
[
"rasmus@dll.nu"
] |
rasmus@dll.nu
|
914e2b6584c535ff37bd9f33800f0f473de6e790
|
74e8c7369e980925e4054b536bef3b1d89cb5b09
|
/src/test/java/com/harcyah/kata/codingbat/recursion1/countX/CountXTest.java
|
aa70762e13c905d7cdab942483110aa483996073
|
[] |
no_license
|
ninaParis/code-kata-java
|
c649aebb5c6b80a564ee2d196ec7d7eaa890ea90
|
9db16627818a03554dee99cd2158d1dc9c7c2bc6
|
refs/heads/master
| 2023-08-24T02:22:26.123973
| 2021-10-14T17:53:41
| 2021-10-14T17:53:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 816
|
java
|
package com.harcyah.kata.codingbat.recursion1.countX;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class CountXTest {
@Test
public void testCountX() {
CountX countX = new CountX();
assertThat(countX.countX("xxhixx"))
.isEqualTo(4);
assertThat(countX.countX("xhixhix"))
.isEqualTo(3);
assertThat(countX.countX("hi"))
.isEqualTo(0);
assertThat(countX.countX("h"))
.isEqualTo(0);
assertThat(countX.countX("x"))
.isEqualTo(1);
assertThat(countX.countX(""))
.isEqualTo(0);
assertThat(countX.countX("hihi"))
.isEqualTo(0);
assertThat(countX.countX("hiAAhi12hi"))
.isEqualTo(0);
}
}
|
[
"harcyah@gmail.com"
] |
harcyah@gmail.com
|
fe233a57d74b74df0ad7d4e6c790041353d07c97
|
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
|
/com.tencent.minihd.qq/assets/exlibs.1.jar/classes.jar/mbq.java
|
a4eec41bf25bd6ee0ca08b11613a170786094d03
|
[] |
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
| 4,834
|
java
|
import android.database.Cursor;
import android.os.Parcel;
import com.tencent.qphone.base.util.QLog;
import cooperation.qzone.model.CoverCacheData;
import cooperation.qzone.model.CoverCacheData.GameCoverInfo;
import cooperation.qzone.model.CoverCacheData.PackageInfo;
import cooperation.qzone.model.DbCacheData.DbCreator;
import cooperation.qzone.model.DbCacheData.Structure;
public final class mbq
implements DbCacheData.DbCreator
{
public int a()
{
return 9;
}
public CoverCacheData a(Cursor paramCursor)
{
CoverCacheData localCoverCacheData = new CoverCacheData();
localCoverCacheData.uin = paramCursor.getLong(paramCursor.getColumnIndex("uin"));
localCoverCacheData.coverId = paramCursor.getString(paramCursor.getColumnIndex("coverId"));
localCoverCacheData.type = paramCursor.getString(paramCursor.getColumnIndex("type"));
localCoverCacheData.local_url = paramCursor.getString(paramCursor.getColumnIndex("local_url"));
localCoverCacheData.isJigsawOpen = paramCursor.getInt(paramCursor.getColumnIndex("jigsaw"));
Object localObject = paramCursor.getBlob(paramCursor.getColumnIndex("urls"));
try
{
localParcel = Parcel.obtain();
localParcel.unmarshall((byte[])localObject, 0, localObject.length);
localParcel.setDataPosition(0);
localCoverCacheData.urls = localParcel.readHashMap(getClass().getClassLoader());
localParcel.recycle();
localObject = paramCursor.getBlob(paramCursor.getColumnIndex("package_info"));
}
catch (Exception localException3)
{
try
{
localParcel = Parcel.obtain();
localParcel.unmarshall((byte[])localObject, 0, localObject.length);
localParcel.setDataPosition(0);
localCoverCacheData.packageInfo = ((CoverCacheData.PackageInfo)localParcel.readParcelable(getClass().getClassLoader()));
localParcel.recycle();
localObject = paramCursor.getBlob(paramCursor.getColumnIndex("game_cover_info"));
}
catch (Exception localException3)
{
try
{
Parcel localParcel = Parcel.obtain();
localParcel.unmarshall((byte[])localObject, 0, localObject.length);
localParcel.setDataPosition(0);
localCoverCacheData.gameCoverInfo = ((CoverCacheData.GameCoverInfo)localParcel.readParcelable(getClass().getClassLoader()));
localParcel.recycle();
paramCursor = paramCursor.getBlob(paramCursor.getColumnIndex("photo_wall"));
}
catch (Exception localException3)
{
try
{
do
{
for (;;)
{
localObject = Parcel.obtain();
((Parcel)localObject).unmarshall(paramCursor, 0, paramCursor.length);
((Parcel)localObject).setDataPosition(0);
localCoverCacheData.photoWall = ((Parcel)localObject).readArrayList(getClass().getClassLoader());
((Parcel)localObject).recycle();
return localCoverCacheData;
localException1 = localException1;
if (QLog.isColorLevel())
{
QLog.e("CoverCacheData", 2, "failed to read cover.urls:", localException1);
continue;
localException2 = localException2;
if (QLog.isColorLevel()) {
QLog.e("CoverCacheData", 2, "failed to read cover.packageInfo:", localException2);
}
}
}
localException3 = localException3;
} while (!QLog.isColorLevel());
QLog.e("CoverCacheData", 2, "failed to read cover.gameCoverInfo:", localException3);
}
catch (Exception paramCursor)
{
while (!QLog.isColorLevel()) {}
QLog.e("CoverCacheData", 2, "failed to read cover.photoWall:", paramCursor);
}
}
}
}
return localCoverCacheData;
}
public String a()
{
return null;
}
public DbCacheData.Structure[] a()
{
return new DbCacheData.Structure[] { new DbCacheData.Structure("uin", "INTEGER"), new DbCacheData.Structure("coverId", "TEXT"), new DbCacheData.Structure("type", "TEXT"), new DbCacheData.Structure("local_url", "TEXT"), new DbCacheData.Structure("urls", "BLOB"), new DbCacheData.Structure("package_info", "BLOB"), new DbCacheData.Structure("game_cover_info", "BLOB"), new DbCacheData.Structure("photo_wall", "BLOB"), new DbCacheData.Structure("jigsaw", "INTEGER") };
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.1.jar\classes.jar
* Qualified Name: mbq
* JD-Core Version: 0.7.0.1
*/
|
[
"98632993+tsuzcx@users.noreply.github.com"
] |
98632993+tsuzcx@users.noreply.github.com
|
220abccade6a10e38b26defc9ab11361e8919d90
|
b1eee7989acdad29096ef323a7609b5af2828792
|
/AppDyC/DaoDyC/src/main/java/mx/gob/sat/siat/dyc/util/excepcion/DycDaoExcepcion.java
|
f30241cd85ac96452b3b8b8158fa3649248a0671
|
[] |
no_license
|
xtaticzero/AppDyC
|
2185e5d25840ddbb73d0de6c6c0d61a497a6cdfa
|
1562a358558323ef6adb84fb0e70ba7560200bda
|
refs/heads/master
| 2021-09-09T21:50:41.930101
| 2018-03-19T21:38:45
| 2018-03-19T21:38:45
| 73,757,634
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,536
|
java
|
/*
* Todos los Derechos Reservados 2016 SAT.
* Servicio de Administracion Tributaria (SAT).
*
* Este software contiene informacion propiedad exclusiva del SAT considerada
* Confidencial. Queda totalmente prohibido su uso o divulgacion en forma.
*/
package mx.gob.sat.siat.dyc.util.excepcion;
import java.util.List;
import mx.gob.sat.siat.dyc.util.constante.IDycCodigoError;
import mx.gob.sat.siat.dyc.util.recurso.DycLogUtil;
import mx.gob.sat.siat.dyc.vo.DycLogEstadoVariable;
/**
*
* @author GAER8674
*/
public class DycDaoExcepcion extends DycBaseExcepcion{
public DycDaoExcepcion(IDycCodigoError codigoError, List<DycLogEstadoVariable> estadoVariables) {
super(codigoError.getDescripcion()+DycLogUtil.generarMsgEstadoVariables(estadoVariables));
this.setCodigoError(codigoError);
this.setEstadoVariables(estadoVariables);
}
public DycDaoExcepcion(IDycCodigoError codigoError, List<DycLogEstadoVariable> estadoVariables, Throwable cause) {
super(codigoError.getDescripcion()+DycLogUtil.generarMsgEstadoVariables(estadoVariables), cause);
this.setCodigoError(codigoError);
this.setEstadoVariables(estadoVariables);
}
public DycDaoExcepcion(IDycCodigoError codigoError, List<DycLogEstadoVariable> estadoVariables, DycBaseExcepcion cause) {
super(codigoError.getDescripcion()+DycLogUtil.generarMsgEstadoVariables(estadoVariables), cause);
this.setCodigoError(codigoError);
this.setEstadoVariables(estadoVariables);
}
}
|
[
"emmanuel.estrada@stksat.com"
] |
emmanuel.estrada@stksat.com
|
975e6bad86ecd43d3c05089bd357d765f7d5db09
|
a5d94a908094e30ba50caaabbc6dfa683d0da7c2
|
/src/main/java/com/kubernetes/k8sHelloWorld/K8sHelloWorldApplication.java
|
171e862fcec8ea1a48e1f38de6681e326cad4442
|
[] |
no_license
|
nitinkc/K8SHelloWorld
|
0c883ef7bf4a8acaed07799fec2a26a606d43962
|
349b156b39b3059722185280d47efede55bb2bac
|
refs/heads/master
| 2022-09-15T07:28:38.212608
| 2020-06-01T16:42:17
| 2020-06-01T16:42:17
| 267,462,602
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 335
|
java
|
package com.kubernetes.k8sHelloWorld;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class K8sHelloWorldApplication {
public static void main(String[] args) {
SpringApplication.run(K8sHelloWorldApplication.class, args);
}
}
|
[
"gs.nitin@gmail.com"
] |
gs.nitin@gmail.com
|
5633083d3bfb32618f3d15b868a76831a216425e
|
688d8c056a37c097b4561d305dac6b428c80791d
|
/core/src/main/java/cn/leancloud/callback/RequestMobileCodeCallback.java
|
6cd839f80060726a47416e87534ed285954536c2
|
[
"Apache-2.0"
] |
permissive
|
weakish/java-unified-sdk
|
6c1ff0fa016ec5f0307eded5fe4335c7128a8f7f
|
a76885e2072a24d5286890b8abfc6700c79e7812
|
refs/heads/master
| 2020-06-19T00:46:21.657059
| 2019-07-09T10:16:14
| 2019-07-09T10:16:14
| 196,508,822
| 0
| 0
|
Apache-2.0
| 2019-07-12T04:30:27
| 2019-07-12T04:30:27
| null |
UTF-8
|
Java
| false
| false
| 342
|
java
|
package cn.leancloud.callback;
import cn.leancloud.AVException;
import cn.leancloud.types.AVNull;
public abstract class RequestMobileCodeCallback extends AVCallback<AVNull> {
public abstract void done(AVException e);
@Override
protected final void internalDone0(AVNull t, AVException avException) {
this.done(avException);
}
}
|
[
"jwfing@gmail.com"
] |
jwfing@gmail.com
|
ad0c920646c24638c5bef21ca2958bdecd3604bb
|
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
|
/aliyun-java-sdk-live/src/main/java/com/aliyuncs/live/Endpoint.java
|
584459994eb45713367ee51a9a1828aa879344bb
|
[
"Apache-2.0"
] |
permissive
|
aliyun/aliyun-openapi-java-sdk
|
a263fa08e261f12d45586d1b3ad8a6609bba0e91
|
e19239808ad2298d32dda77db29a6d809e4f7add
|
refs/heads/master
| 2023-09-03T12:28:09.765286
| 2023-09-01T09:03:00
| 2023-09-01T09:03:00
| 39,555,898
| 1,542
| 1,317
|
NOASSERTION
| 2023-09-14T07:27:05
| 2015-07-23T08:41:13
|
Java
|
UTF-8
|
Java
| false
| false
| 4,129
|
java
|
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.live;
import java.util.HashMap;
public class Endpoint {
public static HashMap<String, String> endpointMap = new HashMap<String, String>() {
{
put("cn-shanghai-internal-test-1", "live.aliyuncs.com");
put("cn-shenzhen-su18-b01", "live.aliyuncs.com");
put("cn-beijing", "live.aliyuncs.com");
put("cn-shanghai-inner", "live.aliyuncs.com");
put("cn-hangzhou-internal-prod-1", "live.aliyuncs.com");
put("cn-north-2-gov-1", "live.aliyuncs.com");
put("cn-yushanfang", "live.aliyuncs.com");
put("cn-qingdao-nebula", "live.aliyuncs.com");
put("cn-beijing-finance-pop", "live.aliyuncs.com");
put("cn-wuhan", "live.aliyuncs.com");
put("cn-zhangjiakou", "live.aliyuncs.com");
put("us-west-1", "live.aliyuncs.com");
put("cn-zhangbei", "live.aliyuncs.com");
put("rus-west-1-pop", "live.aliyuncs.com");
put("cn-shanghai-et15-b01", "live.aliyuncs.com");
put("cn-hangzhou-bj-b01", "live.aliyuncs.com");
put("cn-zhangbei-na61-b01", "live.aliyuncs.com");
put("ap-northeast-1", "live.aliyuncs.com");
put("cn-huhehaote-nebula-1", "live.aliyuncs.com");
put("cn-shanghai-et2-b01", "live.aliyuncs.com");
put("ap-southeast-1", "live.aliyuncs.com");
put("ap-southeast-2", "live.aliyuncs.com");
put("ap-southeast-3", "live.aliyuncs.com");
put("ap-southeast-5", "live.aliyuncs.com");
put("us-east-1", "live.aliyuncs.com");
put("cn-shenzhen-inner", "live.aliyuncs.com");
put("cn-zhangjiakou-na62-a01", "live.aliyuncs.com");
put("cn-beijing-gov-1", "live.aliyuncs.com");
put("cn-wulanchabu", "live.aliyuncs.com");
put("ap-south-1", "live.aliyuncs.com");
put("cn-shenzhen-st4-d01", "live.aliyuncs.com");
put("cn-haidian-cm12-c01", "live.aliyuncs.com");
put("cn-qingdao", "live.aliyuncs.com");
put("cn-hongkong-finance-pop", "live.aliyuncs.com");
put("cn-shanghai", "live.aliyuncs.com");
put("cn-shanghai-finance-1", "live.aliyuncs.com");
put("cn-hongkong", "live.aliyuncs.com");
put("eu-central-1", "live.aliyuncs.com");
put("cn-shenzhen", "live.aliyuncs.com");
put("cn-zhengzhou-nebula-1", "live.aliyuncs.com");
put("eu-west-1", "live.aliyuncs.com");
put("cn-hangzhou-internal-test-1", "live.aliyuncs.com");
put("eu-west-1-oxs", "live.aliyuncs.com");
put("cn-beijing-finance-1", "live.aliyuncs.com");
put("cn-hangzhou-internal-test-3", "live.aliyuncs.com");
put("cn-hangzhou-internal-test-2", "live.aliyuncs.com");
put("cn-shenzhen-finance-1", "live.aliyuncs.com");
put("me-east-1", "live.aliyuncs.com");
put("cn-chengdu", "live.aliyuncs.com");
put("cn-hangzhou-test-306", "live.aliyuncs.com");
put("cn-hangzhou-finance", "live.aliyuncs.com");
put("cn-beijing-nu16-b01", "live.aliyuncs.com");
put("cn-edge-1", "live.aliyuncs.com");
put("cn-huhehaote", "live.aliyuncs.com");
put("cn-fujian", "live.aliyuncs.com");
put("ap-northeast-2-pop", "live.aliyuncs.com");
put("cn-hangzhou", "live.aliyuncs.com");
}
};
public static String endpointRegionalType = "regional";
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
8ba500adee5b1a4df3d3ead3485bcb39aeb9c227
|
7559bead0c8a6ad16f016094ea821a62df31348a
|
/src/com/vmware/vim25/InvalidDeviceOperation.java
|
690cd34743cd41b1ac41000d521fca6789f1f2d5
|
[] |
no_license
|
ZhaoxuepengS/VsphereTest
|
09ba2af6f0a02d673feb9579daf14e82b7317c36
|
59ddb972ce666534bf58d84322d8547ad3493b6e
|
refs/heads/master
| 2021-07-21T13:03:32.346381
| 2017-11-01T12:30:18
| 2017-11-01T12:30:18
| 109,128,993
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,285
|
java
|
package com.vmware.vim25;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for InvalidDeviceOperation complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="InvalidDeviceOperation">
* <complexContent>
* <extension base="{urn:vim25}InvalidDeviceSpec">
* <sequence>
* <element name="badOp" type="{urn:vim25}VirtualDeviceConfigSpecOperation" minOccurs="0"/>
* <element name="badFileOp" type="{urn:vim25}VirtualDeviceConfigSpecFileOperation" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "InvalidDeviceOperation", propOrder = {
"badOp",
"badFileOp"
})
public class InvalidDeviceOperation
extends InvalidDeviceSpec
{
protected VirtualDeviceConfigSpecOperation badOp;
protected VirtualDeviceConfigSpecFileOperation badFileOp;
/**
* Gets the value of the badOp property.
*
* @return
* possible object is
* {@link VirtualDeviceConfigSpecOperation }
*
*/
public VirtualDeviceConfigSpecOperation getBadOp() {
return badOp;
}
/**
* Sets the value of the badOp property.
*
* @param value
* allowed object is
* {@link VirtualDeviceConfigSpecOperation }
*
*/
public void setBadOp(VirtualDeviceConfigSpecOperation value) {
this.badOp = value;
}
/**
* Gets the value of the badFileOp property.
*
* @return
* possible object is
* {@link VirtualDeviceConfigSpecFileOperation }
*
*/
public VirtualDeviceConfigSpecFileOperation getBadFileOp() {
return badFileOp;
}
/**
* Sets the value of the badFileOp property.
*
* @param value
* allowed object is
* {@link VirtualDeviceConfigSpecFileOperation }
*
*/
public void setBadFileOp(VirtualDeviceConfigSpecFileOperation value) {
this.badFileOp = value;
}
}
|
[
"495149700@qq.com"
] |
495149700@qq.com
|
d54819cd4759d7a44ccae904e8d0a5f79c879313
|
278e621bf03f51a58e96694461dc2284dd4625ab
|
/src/main/java/com/jaaaelu/gzw/design/patterns/versionByHeadFirst/commandPattern/demo/StereoOffCommand.java
|
179346472d536b19a24d3a413e25e28092db9348
|
[] |
no_license
|
GzwJaaaelu/DesignPatterns
|
e7f33214e1c236410764ba8c6a9b8e50fe84e9ce
|
e56442b62c200e2a5e8863f3f64abd86cb44e352
|
refs/heads/master
| 2020-03-07T03:01:56.806201
| 2018-06-29T09:11:09
| 2018-06-29T09:11:09
| 127,224,085
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 435
|
java
|
package com.jaaaelu.gzw.design.patterns.versionByHeadFirst.commandPattern.demo;
public class StereoOffCommand implements Command {
private Stereo stereo;
public StereoOffCommand(Stereo stereo) {
this.stereo = stereo;
}
@Override
public void execute() {
stereo.off();
}
@Override
public void undo() {
stereo.on();
stereo.setCD();
stereo.setVolume(11);
}
}
|
[
"gzw102030@outlook.com"
] |
gzw102030@outlook.com
|
ffc18c6abc99300c4b7d6860369fdfd5bc355eee
|
09c0498d9ab6534c705e23a3876cd9dc7f4bf291
|
/src/day18/WebtableTesting2.java
|
0931db8b261e57a87b0608333d248634d26277fa
|
[] |
no_license
|
SaiKrishna12/May25Batch
|
3d8b5c1d3eb9bb4b7e35c5ed330452f94edb354c
|
0dac1f36ae8bf0446375e02616383ff5e9fb577f
|
refs/heads/master
| 2020-06-06T14:27:20.340585
| 2015-07-10T14:37:19
| 2015-07-10T14:37:19
| 39,013,168
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 960
|
java
|
package day18;
import org.openqa.selenium.By;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class WebtableTesting2 {
FirefoxDriver driver;
@BeforeMethod
public void setUp()
{
ProfilesIni pr=new ProfilesIni();
FirefoxProfile fp=pr.getProfile("SeleniumUser");
driver=new FirefoxDriver(fp);
driver.get("http://www.timeanddate.com/worldclock/");
}
@Test
public void webtableTest()
{
String part1="html/body/div[1]/div[7]/section[2]/div[1]/table/tbody/tr[";
String part2="]/td[";
String part3="]";
for(int i=1;i<=37;i++)
{
for(int j=1;j<=8;j++)
{
String x=driver.findElement(By.xpath
(part1+i+part2+j+part3)).getText();
System.out.print(x+" ");
}
System.out.println();
}
}
}
|
[
"saikrishna_gandham@yahoo.co.in"
] |
saikrishna_gandham@yahoo.co.in
|
daf58c538d58b35db408915ad6ab774c145e6a1c
|
e8e48a96f2aba9040f4f55ab61efaab1a9eb6a23
|
/Leetcode/439-ternary-expression-parser/Solution.java
|
4af0d0e1be059bf8bc281f12f4c81c1c3fe799b4
|
[] |
no_license
|
arnabs542/algorithmic-problems
|
67342172c2035d9ffb2ee2bf0f1901e651dcce12
|
5d19d2e9cddc20e8a6949ac38fe6fb73dfc81bf4
|
refs/heads/master
| 2021-12-14T05:41:50.177195
| 2017-04-15T07:42:41
| 2017-04-15T07:42:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,299
|
java
|
/*
Given a string representing arbitrarily nested ternary expressions, calculate the
result of the expression. You can always assume that the given expression is valid
and only consists of digits 0-9, ?, :, T and F (T and F represent True and False respectively).
Note:
The length of the given string is ≤ 10000.
Each number will contain only one digit.
The conditional expressions group right-to-left (as usual in most languages).
The condition will always be either T or F. That is, the condition will never be a digit.
The result of the expression will always evaluate to either a digit 0-9, T or F.
Example 1:
Input: "T?2:3"
Output: "2"
Explanation: If true, then result is 2; otherwise result is 3.
Example 2:
Input: "F?1:T?4:5"
Output: "4"
Explanation: The conditional expressions group right-to-left. Using parenthesis,
it is read/evaluated as:
"(F ? 1 : (T ? 4 : 5))" "(F ? 1 : (T ? 4 : 5))"
-> "(F ? 1 : 4)" or -> "(T ? 4 : 5)"
-> "4" -> "4"
Example 3:
Input: "T?T?F:5:3"
Output: "F"
Explanation: The conditional expressions group right-to-left. Using parenthesis,
it is read/evaluated as:
"(T ? (T ? F : 5) : 3)" "(T ? (T ? F : 5) : 3)"
-> "(T ? F : 3)" or -> "(T ? F : 5)"
-> "F" -> "F"
*/
// Recursive
public class Solution {
int start;
int n;
public String parse(String expression) {
if(start + 1 < n && expression.charAt(start + 1) == '?'){
// T or F
char c = expression.charAt(start);
// skip the T/F and ?
start += 2;
String trueResult = parse(expression);
// skip :
start++;
String falseResult = parse(expression);
return c == 'T' ? trueResult : falseResult;
}
else{
start += 1;
// return the 1 char letter
return expression.substring(start-1, start);
}
}
public String parseTernary(String expression) {
n = expression.length();
start = 0;
return parse(expression);
}
}
// Stack
class Solution2 {
public String parseTernary(String expression) {
Deque<Character> stk = new LinkedList<>();
for(int i=expression.length()-1; i>=0; i--){
char c = expression.charAt(i);
// If this character is either T or F
// evaluate
if(!stk.isEmpty() && stk.peekFirst() == '?'){
// pop ?
stk.pop();
// true value
char a = stk.pop();
// pop :
stk.pop();
// false value
char b = stk.pop();
if(c == 'T')
stk.push(a);
else
stk.push(b);
}
else{
stk.push(c);
}
}
return String.valueOf(stk.pop());
}
}
class Solution3 {
public String parseTernary(String expression) {
Deque<String> stk = new LinkedList<>();
int n = expression.length();
int i = n-1;
StringBuilder str = new StringBuilder();
while(i >= 0){
char c = expression.charAt(i);
if(c == ':'){
if(str.length() > 0){
stk.addFirst(str.toString());
}
str.setLength(0);
}
else if(c == '?'){
if(str.length() > 0){
stk.addFirst(str.toString());
str.setLength(0);
}
i--;
c = expression.charAt(i);
String a = stk.removeFirst();
String b = stk.removeFirst();
if(c == 'T'){
stk.addFirst(a);
}
else{
stk.addFirst(b);
}
}
else{
str.setLength(0);
str.append(c);
}
i--;
}
return stk.removeFirst();
}
}
|
[
"masruba@gmail.com"
] |
masruba@gmail.com
|
0843dde50471a1449ae0d3ca3a5c2d460e932e58
|
d9d96ef1880ab53366430e20de97dafe87fa30c8
|
/小贷平台反编译/cashloan-base/cashloan-cl/src/main/java/com/cashloan/cl/mapper/SmsTplMapper.java
|
6b39a448d11707bb944f801867cd0fb81f1d6392
|
[] |
no_license
|
zxxroot/ymzl
|
22dbf6042bba091fd6978776aef7f3481c00759c
|
8b6174c65803db7892c091a35b36d9a3d958bbe3
|
refs/heads/master
| 2020-05-15T11:52:25.487428
| 2019-04-19T10:35:37
| 2019-04-19T10:35:37
| 182,246,163
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 277
|
java
|
package com.cashloan.cl.mapper;
import com.cashloan.cl.domain.SmsTpl;
import com.rongdu.cashloan.core.common.mapper.BaseMapper;
import com.rongdu.cashloan.core.common.mapper.RDBatisDao;
@RDBatisDao
public abstract interface SmsTplMapper
extends BaseMapper<SmsTpl, Long>
{}
|
[
"924385220@qq.com"
] |
924385220@qq.com
|
f14504426e45193a83c8d99a4df0821d574957c1
|
1fcb62696ec7413cc6a2e5c8c67d430d51a665c7
|
/src/iso-tc211-xml/src/generated/java/org/isotc211/iso19139/gmd/MDIdentifierType.java
|
fd2c289cc5ba57b84bb51cdda07a780f3a67e37d
|
[
"BSD-2-Clause",
"BSD-3-Clause"
] |
permissive
|
florianesser/excel-adapter
|
cd1836dad969e6b481396997a3f4abd4e38029e9
|
16b98486da3702ee958c5c0155a77520a0722906
|
refs/heads/master
| 2021-01-08T08:11:40.938728
| 2019-05-24T10:02:34
| 2019-05-24T10:02:34
| 241,966,970
| 0
| 0
|
NOASSERTION
| 2020-02-20T19:06:34
| 2020-02-20T19:06:34
| null |
UTF-8
|
Java
| false
| false
| 2,866
|
java
|
/**
*/
package org.isotc211.iso19139.gmd;
import org.isotc211.iso19139.gco.AbstractObjectType;
import org.isotc211.iso19139.gco.CharacterStringPropertyType;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>MD Identifier Type</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.isotc211.iso19139.gmd.MDIdentifierType#getAuthority <em>Authority</em>}</li>
* <li>{@link org.isotc211.iso19139.gmd.MDIdentifierType#getCode <em>Code</em>}</li>
* </ul>
*
* @see org.isotc211.iso19139.gmd.GMDPackage#getMDIdentifierType()
* @model extendedMetaData="name='MD_Identifier_Type' kind='elementOnly'"
* @generated
*/
public interface MDIdentifierType extends AbstractObjectType
{
/**
* Returns the value of the '<em><b>Authority</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Authority</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Authority</em>' containment reference.
* @see #setAuthority(CICitationPropertyType)
* @see org.isotc211.iso19139.gmd.GMDPackage#getMDIdentifierType_Authority()
* @model containment="true"
* extendedMetaData="kind='element' name='authority' namespace='##targetNamespace'"
* @generated
*/
CICitationPropertyType getAuthority();
/**
* Sets the value of the '{@link org.isotc211.iso19139.gmd.MDIdentifierType#getAuthority <em>Authority</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Authority</em>' containment reference.
* @see #getAuthority()
* @generated
*/
void setAuthority(CICitationPropertyType value);
/**
* Returns the value of the '<em><b>Code</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Code</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Code</em>' containment reference.
* @see #setCode(CharacterStringPropertyType)
* @see org.isotc211.iso19139.gmd.GMDPackage#getMDIdentifierType_Code()
* @model containment="true" required="true"
* extendedMetaData="kind='element' name='code' namespace='##targetNamespace'"
* @generated
*/
CharacterStringPropertyType getCode();
/**
* Sets the value of the '{@link org.isotc211.iso19139.gmd.MDIdentifierType#getCode <em>Code</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Code</em>' containment reference.
* @see #getCode()
* @generated
*/
void setCode(CharacterStringPropertyType value);
} // MDIdentifierType
|
[
"fe@bespire.de"
] |
fe@bespire.de
|
ac07daeedfa6b4f379a1079ba6b85e83cadb9516
|
8b9b454cffd5f60776ae9743f8fdd0e8663628bc
|
/quill/src/main/java/com/aaaaahhhhhhh/bananapuncher714/quill/resourcepack/ZipWrapper.java
|
e8e1b793598a764907c8c361c854967d12915fec
|
[
"MIT"
] |
permissive
|
MineInAbyss/Quill
|
68c69a7d625b4150d1f8f45f0dafb04117635595
|
d9940025453c099d818427368c1f1b3cd47388f4
|
refs/heads/master
| 2023-06-27T19:57:02.131946
| 2021-07-22T23:39:29
| 2021-07-22T23:39:29
| 343,574,836
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,655
|
java
|
package com.aaaaahhhhhhh.bananapuncher714.quill.resourcepack;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.CopyOption;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipException;
import java.util.zip.ZipOutputStream;
import javax.imageio.ImageIO;
public class ZipWrapper {
protected final Path zipFile;
protected FileSystem zipfs;
public ZipWrapper( Path resource ) throws IOException {
zipFile = resource;
Files.createDirectories( resource.getParent() );
if ( !Files.exists( resource ) ) {
ZipOutputStream out = new ZipOutputStream( Files.newOutputStream( resource ) );
out.close();
}
}
public Path getFile() {
return zipFile;
}
public boolean contains( String path ) throws ZipException, IOException {
FileSystem zipfs = getZipfs();
Path internal = zipfs.getPath( path );
return Files.exists( internal );
}
public void addImage( String path, BufferedImage image, OpenOption... options ) throws IOException {
FileSystem zipfs = getZipfs();
Path internal = zipfs.getPath( path );
if ( internal.getParent() != null ) {
Files.createDirectories( internal.getParent() );
}
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write( image, "png", os );
Files.write( internal, os.toByteArray(), options );
}
public void addElement( String path, byte[] write, OpenOption... options ) throws IOException {
FileSystem zipfs = getZipfs();
Path internal = zipfs.getPath( path );
if ( internal.getParent() != null ) {
Files.createDirectories( internal.getParent() );
}
Files.write( internal, write, options );
}
public void addElement( String path, File file, CopyOption... options ) throws IOException {
FileSystem zipfs = getZipfs();
Path external = Paths.get( file.getAbsolutePath() );
Path internal = zipfs.getPath( path );
if ( internal.getParent() != null ) {
Files.createDirectories( internal.getParent() );
}
Files.copy( external, internal, options );
}
public void addElement( String path, Path file, CopyOption... options ) throws IOException {
FileSystem zipfs = getZipfs();
Path internal = zipfs.getPath( path );
if ( internal.getParent() != null ) {
Files.createDirectories( internal.getParent() );
}
Files.copy( file, internal, options );
}
public InputStream readElement( String path, OpenOption... options ) throws IOException {
FileSystem zipfs = getZipfs();
Path internal = zipfs.getPath( path );
if ( internal != null ) {
if ( Files.exists( internal ) ) {
return Files.newInputStream( internal, options );
}
}
return null;
}
public void removeElement( String path, File callback, CopyOption... options ) throws IOException {
FileSystem zipfs = getZipfs();
Path internal = zipfs.getPath( path );
if ( internal != null ) {
if ( !Files.exists( internal ) ) {
return;
}
if ( callback != null ) {
callback.getParentFile().mkdirs();
Files.move( internal, Paths.get( callback.getAbsolutePath() ), options );
} else {
Files.delete( internal );
}
}
}
public List< String > listElements( String path ) throws IOException {
FileSystem zipfs = getZipfs();
Path internal = zipfs.getPath( path );
if ( internal != null ) {
if ( !Files.exists( internal ) ) {
return null;
}
List< String > files = new ArrayList< String >();
for ( Path file: Files.newDirectoryStream( internal ) ) {
files.add( file.getFileName().toString() );
}
return files;
}
return null;
}
public List< String > walkElements( String path ) throws IOException {
FileSystem zipfs = getZipfs();
Path internal = zipfs.getPath( path );
if ( internal != null ) {
if ( !Files.exists( internal ) ) {
return null;
}
List< String > files = new ArrayList< String >();
Files.walk( internal ).forEach( file -> {
files.add( internal.relativize( file ).toString() );
} );
return files;
}
return null;
}
private FileSystem getZipfs() throws IOException {
if ( zipfs == null ) {
zipfs = FileSystems.newFileSystem( zipFile, ( ClassLoader ) null );
}
return zipfs;
}
public boolean close() throws IOException {
if ( zipfs != null && zipfs.isOpen() ) {
zipfs.close();
zipfs = null;
return true;
}
zipfs = null;
return false;
}
}
|
[
"banana@aaaaahhhhhhh.com"
] |
banana@aaaaahhhhhhh.com
|
70150e3f0a04824101826ed89722c3472b102117
|
27b052c54bcf922e1a85cad89c4a43adfca831ba
|
/src/wS.java
|
026df6434861ec7683764aa39d843fed5631f588
|
[] |
no_license
|
dreadiscool/YikYak-Decompiled
|
7169fd91f589f917b994487045916c56a261a3e8
|
ebd9e9dd8dba0e657613c2c3b7036f7ecc3fc95d
|
refs/heads/master
| 2020-04-01T10:30:36.903680
| 2015-04-14T15:40:09
| 2015-04-14T15:40:09
| 33,902,809
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,712
|
java
|
import java.util.concurrent.Semaphore;
import org.json.JSONException;
import org.json.JSONObject;
public class wS
implements Runnable
{
private String b = null;
private String c = null;
private JSONObject d = null;
private boolean e = false;
protected wS(wR paramwR, String paramString1, String paramString2, JSONObject paramJSONObject, boolean paramBoolean)
{
this.b = paramString1;
this.c = paramString2;
this.d = paramJSONObject;
this.e = paramBoolean;
}
public void run()
{
for (;;)
{
try
{
wR.a(this.a).acquire();
localJSONObject = new JSONObject();
}
catch (InterruptedException localInterruptedException)
{
JSONObject localJSONObject;
int i;
String str;
localInterruptedException.printStackTrace();
wR.a(this.a).release();
continue;
}
finally
{
wR.a(this.a).release();
}
try
{
localJSONObject.put("link", this.b);
localJSONObject.put("data", this.c);
localJSONObject.put("post_body", this.d);
localJSONObject.put("first_session", this.e);
i = 1 + this.a.a();
this.a.a(i);
str = Integer.toString(i);
this.a.a(localJSONObject, str);
wR.a(this.a).release();
return;
}
catch (JSONException localJSONException)
{
localJSONException.printStackTrace();
wR.a(this.a).release();
}
}
}
}
/* Location: C:\Users\dreadiscool\Desktop\tools\classes-dex2jar.jar
* Qualified Name: wS
* JD-Core Version: 0.7.0.1
*/
|
[
"paras@protrafsolutions.com"
] |
paras@protrafsolutions.com
|
c6f97a9d91c6f48005d90f704f49c055e40ec912
|
4ffc3d969399d251589379adf33cce5cec14dd89
|
/src/com/mrcrayfish/app/activities/ModListActivity.java
|
2fde6dc9477734795ace1c31b92ff062a2b124ab
|
[] |
no_license
|
MrCrayfish/TheMrCrayfishApp
|
40c00e06285e2858222132893d4585735fda7ed9
|
f8880c1521a23cf0b2bfb1847bbca266412b1883
|
refs/heads/master
| 2023-03-24T07:01:08.287187
| 2015-06-04T16:05:58
| 2015-06-04T16:05:58
| 30,744,002
| 5
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,841
|
java
|
package com.mrcrayfish.app.activities;
import java.util.ArrayList;
import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.mrcrayfish.app.R;
import com.mrcrayfish.app.adapters.MenuAdapter;
import com.mrcrayfish.app.interfaces.IMenu;
import com.mrcrayfish.app.objects.MenuItem;
public class ModListActivity extends Activity implements IMenu
{
private MenuAdapter adapater;
public RelativeLayout loadingContainer;
private TextView loadingText;
private ListView modList;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
setContentView(R.layout.activity_mod_menu);
overridePendingTransition(R.anim.animation_slide_left_1, R.anim.animation_slide_left_2);
setupActionBar();
modList = (ListView) findViewById(R.id.menuList);
modList.setDivider(null);
modList.setDividerHeight(0);
loadingContainer = (RelativeLayout) findViewById(R.id.loadingContainer);
loadingText = (TextView) findViewById(R.id.loadingText);
adapater = new MenuAdapter(this, getItems());
modList.setAdapter(adapater);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public boolean onOptionsItemSelected(android.view.MenuItem item)
{
int id = item.getItemId();
if (id == android.R.id.home)
{
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onBackPressed()
{
super.onBackPressed();
overridePendingTransition(R.anim.animation_slide_right_1, R.anim.animation_slide_right_2);
}
@SuppressLint("InflateParams")
public void setupActionBar()
{
ActionBar ab = getActionBar();
ab.setDisplayShowHomeEnabled(false);
ab.setDisplayShowTitleEnabled(false);
LayoutInflater inflator = LayoutInflater.from(this);
View v = inflator.inflate(R.layout.app_bar, null);
Typeface type = Typeface.createFromAsset(getAssets(), "fonts/bebas_neue.otf");
TextView title = (TextView) v.findViewById(R.id.barTitle);
title.setTypeface(type);
title.setText("Mod List");
ab.setCustomView(v);
ab.setDisplayShowCustomEnabled(true);
}
public ArrayAdapter<MenuItem> getMenuAdapter()
{
return adapater;
}
public ArrayList<MenuItem> getItems()
{
ArrayList<MenuItem> mods = new ArrayList<MenuItem>();
Intent furnitureIntent = new Intent(this, ModActivity.class);
setModInfo(furnitureIntent, "cfm", "Furniture Mod");
mods.add(new MenuItem("Furniture Mod", "Chairs, Tables, and more!", R.drawable.chair, furnitureIntent));
Intent skateboardIntent = new Intent(this, ModActivity.class);
setModInfo(skateboardIntent, "csm", "Skateboard Mod");
mods.add(new MenuItem("Skateboarding Mod", "Tricks, Flips, Grinds!", R.drawable.ic_skateboard, skateboardIntent));
Intent constructionIntent = new Intent(this, ModActivity.class);
setModInfo(constructionIntent, "ccm", "Construction Mod");
mods.add(new MenuItem("Construction Mod", "Create buildings without skill!", R.drawable.ic_hammer, constructionIntent));
Intent tokensIntent = new Intent(this, ModActivity.class);
setModInfo(tokensIntent, "ct", "CrayTokens");
mods.add(new MenuItem("CrayTokens", "A simple currency!", R.drawable.ic_token, tokensIntent));
return mods;
}
public void setModInfo(Intent modInfo, String modId, String mod_name)
{
modInfo.putExtra("modid", modId);
modInfo.putExtra("modname", mod_name);
}
public TextView getLoadingText()
{
return loadingText;
}
}
|
[
"mrcrayfish@hotmail.com"
] |
mrcrayfish@hotmail.com
|
1c66f11695aa964f64c4ea3bf4d7480af9ca9566
|
ca030864a3a1c24be6b9d1802c2353da4ca0d441
|
/classes8.dex_source_from_JADX/com/facebook/reviews/feed/ReviewsFeedInlineReviewController.java
|
60d3b1e6fe06ce1ff73a8edbd7b57a3abe8037d9
|
[] |
no_license
|
pxson001/facebook-app
|
87aa51e29195eeaae69adeb30219547f83a5b7b1
|
640630f078980f9818049625ebc42569c67c69f7
|
refs/heads/master
| 2020-04-07T20:36:45.758523
| 2018-03-07T09:04:57
| 2018-03-07T09:04:57
| 124,208,458
| 4
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,024
|
java
|
package com.facebook.reviews.feed;
import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import com.facebook.analytics.CurationMechanism;
import com.facebook.loom.logger.LogEntry.EntryType;
import com.facebook.loom.logger.Logger;
import com.facebook.reviews.analytics.ReviewsLogger;
import com.facebook.user.model.User;
import javax.inject.Inject;
import javax.inject.Provider;
/* compiled from: Trying to replace a story without id */
public class ReviewsFeedInlineReviewController {
public final Provider<User> f21554a;
public final ReviewsFeedComposerLauncherAndHandler f21555b;
public final ReviewsLogger f21556c;
/* compiled from: Trying to replace a story without id */
public class C23051 implements OnClickListener {
final /* synthetic */ String f21550a;
final /* synthetic */ Activity f21551b;
final /* synthetic */ String f21552c;
final /* synthetic */ ReviewsFeedInlineReviewController f21553d;
public C23051(ReviewsFeedInlineReviewController reviewsFeedInlineReviewController, String str, Activity activity, String str2) {
this.f21553d = reviewsFeedInlineReviewController;
this.f21550a = str;
this.f21551b = activity;
this.f21552c = str2;
}
public void onClick(View view) {
int a = Logger.a(2, EntryType.UI_INPUT_START, 479566455);
this.f21553d.f21556c.b("reviews_feed", this.f21550a);
this.f21553d.f21555b.m25113a(this.f21551b, CurationMechanism.INLINE_REVIEW, this.f21550a, this.f21552c);
Logger.a(2, EntryType.UI_INPUT_END, -2124251837, a);
}
}
@Inject
public ReviewsFeedInlineReviewController(Provider<User> provider, ReviewsFeedComposerLauncherAndHandler reviewsFeedComposerLauncherAndHandler, ReviewsLogger reviewsLogger) {
this.f21554a = provider;
this.f21555b = reviewsFeedComposerLauncherAndHandler;
this.f21556c = reviewsLogger;
}
}
|
[
"son.pham@jmango360.com"
] |
son.pham@jmango360.com
|
dfc6921617005c9562b5b3c8294d46b70cbee8fc
|
e8f63d7e068b7351e99872c447731dc06c010add
|
/src/main/java/com/feng/springfox/web/rest/vm/LoginVM.java
|
9632c99841ce965f256cab9004a585d841fbfa61
|
[] |
no_license
|
yao00jun/jhipster-springfox-application
|
41322e100a6e38d79b3672729c113e3abf8f2cf8
|
a716258d16678e1cdd0342b4f0ff5ef403fd705b
|
refs/heads/master
| 2020-04-19T12:02:20.606597
| 2019-01-29T16:01:26
| 2019-01-29T16:01:26
| 168,180,529
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,117
|
java
|
package com.feng.springfox.web.rest.vm;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* View Model object for storing a user's credentials.
*/
public class LoginVM {
@NotNull
@Size(min = 1, max = 50)
private String username;
@NotNull
@Size(min = ManagedUserVM.PASSWORD_MIN_LENGTH, max = ManagedUserVM.PASSWORD_MAX_LENGTH)
private String password;
private Boolean rememberMe;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Boolean isRememberMe() {
return rememberMe;
}
public void setRememberMe(Boolean rememberMe) {
this.rememberMe = rememberMe;
}
@Override
public String toString() {
return "LoginVM{" +
"username='" + username + '\'' +
", rememberMe=" + rememberMe +
'}';
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
d9bbeeb40d5cfe9b83a23b71148cbaee99191fee
|
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
|
/benchmark/training/com/crossoverjie/cim/common/data/construct/SortArrayMapTest.java
|
1a06ef4059bfd5da9a8fdb84c2255fa991c5de2e
|
[] |
no_license
|
STAMP-project/dspot-experiments
|
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
|
121487e65cdce6988081b67f21bbc6731354a47f
|
refs/heads/master
| 2023-02-07T14:40:12.919811
| 2019-11-06T07:17:09
| 2019-11-06T07:17:09
| 75,710,758
| 14
| 19
| null | 2023-01-26T23:57:41
| 2016-12-06T08:27:42
| null |
UTF-8
|
Java
| false
| false
| 5,020
|
java
|
package com.crossoverjie.cim.common.data.construct;
import java.util.SortedMap;
import java.util.TreeMap;
import org.junit.Test;
public class SortArrayMapTest {
@Test
public void ad() {
SortArrayMap map = new SortArrayMap();
for (int i = 0; i < 9; i++) {
map.add(Long.valueOf(i), ("127.0.0." + i));
}
map.print();
System.out.println(map.size());
}
@Test
public void add() {
SortArrayMap map = new SortArrayMap();
for (int i = 0; i < 10; i++) {
map.add(Long.valueOf(i), ("127.0.0." + i));
}
map.print();
System.out.println(map.size());
}
@Test
public void add2() {
SortArrayMap map = new SortArrayMap();
for (int i = 0; i < 20; i++) {
map.add(Long.valueOf(i), ("127.0.0." + i));
}
map.sort();
map.print();
System.out.println(map.size());
}
@Test
public void add3() {
SortArrayMap map = new SortArrayMap();
map.add(100L, "127.0.0.100");
map.add(10L, "127.0.0.10");
map.add(8L, "127.0.0.8");
map.add(1000L, "127.0.0.1000");
map.print();
System.out.println(map.size());
}
@Test
public void firstNode() {
SortArrayMap map = new SortArrayMap();
map.add(100L, "127.0.0.100");
map.add(10L, "127.0.0.10");
map.add(8L, "127.0.0.8");
map.add(1000L, "127.0.0.1000");
map.sort();
map.print();
String value = map.firstNodeValue(101);
System.out.println(value);
}
@Test
public void firstNode2() {
SortArrayMap map = new SortArrayMap();
map.add(100L, "127.0.0.100");
map.add(10L, "127.0.0.10");
map.add(8L, "127.0.0.8");
map.add(1000L, "127.0.0.1000");
map.sort();
map.print();
String value = map.firstNodeValue(1);
System.out.println(value);
}
@Test
public void firstNode3() {
SortArrayMap map = new SortArrayMap();
map.add(100L, "127.0.0.100");
map.add(10L, "127.0.0.10");
map.add(8L, "127.0.0.8");
map.add(1000L, "127.0.0.1000");
map.sort();
map.print();
String value = map.firstNodeValue(1001);
System.out.println(value);
}
@Test
public void firstNode4() {
SortArrayMap map = new SortArrayMap();
map.add(100L, "127.0.0.100");
map.add(10L, "127.0.0.10");
map.add(8L, "127.0.0.8");
map.add(1000L, "127.0.0.1000");
map.sort();
map.print();
String value = map.firstNodeValue(9);
System.out.println(value);
}
@Test
public void add4() {
SortArrayMap map = new SortArrayMap();
map.add(100L, "127.0.0.100");
map.add(10L, "127.0.0.10");
map.add(8L, "127.0.0.8");
map.add(1000L, "127.0.0.1000");
map.sort();
map.print();
System.out.println(map.size());
}
int count = 1000000;
@Test
public void add5() {
SortArrayMap map = new SortArrayMap();
long star = System.currentTimeMillis();
for (int i = 0; i < (count); i++) {
double d = Math.random();
int ran = ((int) (d * 100));
map.add(Long.valueOf((i + ran)), ("127.0.0." + i));
}
map.sort();
long end = System.currentTimeMillis();
System.out.println(("???? " + (end - star)));
System.out.println(map.size());
}
@Test
public void add6() {
SortArrayMap map = new SortArrayMap();
long star = System.currentTimeMillis();
for (int i = 0; i < (count); i++) {
double d = Math.random();
int ran = ((int) (d * 100));
map.add(Long.valueOf((i + ran)), ("127.0.0." + i));
}
long end = System.currentTimeMillis();
System.out.println(("???? " + (end - star)));
System.out.println(map.size());
}
@Test
public void add7() {
TreeMap<Long, String> treeMap = new TreeMap<Long, String>();
long star = System.currentTimeMillis();
for (int i = 0; i < (count); i++) {
double d = Math.random();
int ran = ((int) (d * 100));
treeMap.put(Long.valueOf((i + ran)), ("127.0.0." + i));
}
long end = System.currentTimeMillis();
System.out.println(("?? " + (end - star)));
System.out.println(treeMap.size());
}
@Test
public void add8() {
TreeMap<Long, String> map = new TreeMap<Long, String>();
map.put(100L, "127.0.0.100");
map.put(10L, "127.0.0.10");
map.put(8L, "127.0.0.8");
map.put(1000L, "127.0.0.1000");
SortedMap<Long, String> last = map.tailMap(101L);
if (!(last.isEmpty())) {
System.out.println(last.get(last.firstKey()));
} else {
System.out.println(map.firstEntry().getValue());
}
}
}
|
[
"benjamin.danglot@inria.fr"
] |
benjamin.danglot@inria.fr
|
4379b22f149aab9f14a3f2b66f5cf48fd1768d46
|
d228e94c6215d2e4eafee7718e984250b7304ca7
|
/core/src/main/java/software/amazon/awssdk/internal/config/HostRegexToRegionMappingJsonHelper.java
|
a98f17dc495f452dd55e16e9d314c6901f9ff5bc
|
[
"Apache-2.0"
] |
permissive
|
eliaslevy/aws-sdk-java-v2
|
2269ac24c53e846f4b710c74fbb14492c0d13ed9
|
0f83fa15ead8890f4f7137551868892d90a0744d
|
refs/heads/master
| 2021-01-23T18:24:19.083969
| 2017-09-06T17:01:38
| 2017-09-06T22:08:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,438
|
java
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.internal.config;
/**
* Builder class for HostRegexToRegionMapping which exposes its property
* setters.
*/
public class HostRegexToRegionMappingJsonHelper implements Builder<HostRegexToRegionMapping> {
private String hostNameRegex;
private String regionName;
public HostRegexToRegionMappingJsonHelper() {
}
public String getHostNameRegex() {
return hostNameRegex;
}
public void setHostNameRegex(String hostNameRegex) {
this.hostNameRegex = hostNameRegex;
}
public String getRegionName() {
return regionName;
}
public void setRegionName(String regionName) {
this.regionName = regionName;
}
@Override
public HostRegexToRegionMapping build() {
return new HostRegexToRegionMapping(hostNameRegex, regionName);
}
}
|
[
"millem@amazon.com"
] |
millem@amazon.com
|
6737cb4441cb491180ce14ce517ead6cf6220196
|
78d540ab94081574eaae208c522358341114f856
|
/pdfdocumentlibrary/src/main/java/com/titan/pdfdocumentlibrary/util/PdfUtil.java
|
04a9fe60fc8f82e32d4c0665347f8c84da9070cc
|
[] |
no_license
|
ArtemisSoftware/Pdf-document
|
1fc321693e816a9dfce640c0064133b40b040a62
|
1030114d166d22f482f1c89c3cb2b879f2be0db4
|
refs/heads/master
| 2021-09-10T04:51:55.403653
| 2021-08-30T09:35:19
| 2021-08-30T09:35:19
| 223,045,838
| 0
| 0
| null | 2019-11-21T22:35:28
| 2019-11-20T23:20:10
|
Java
|
UTF-8
|
Java
| false
| false
| 6,186
|
java
|
package com.titan.pdfdocumentlibrary.util;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Environment;
import com.itextpdf.text.BadElementException;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Document;
import com.itextpdf.text.Element;
import com.itextpdf.text.Image;
import com.titan.pdfdocumentlibrary.R;
import com.titan.pdfdocumentlibrary.bundle.Template;
import com.titan.pdfdocumentlibrary.elements.CellConfiguration;
import com.titan.pdfdocumentlibrary.elements.Table;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class PdfUtil {
/**
* Method that generates a pdf file<br>
* If a file already exists it will delete it first
* @param template the class that is generating the file
* @param directory the directory where the file will be created
* @param name the name of the file
* @return an empty file
*/
public static File getFile(Template template, File directory, String name) {
name = template.getClass().getSimpleName() + "__" + name + PdfConstants.PDF_EXTENSION;
deleteFile(directory, name);
return new File(directory, name);
}
/**
* Method that creates an error table with an exception
* @param exception the exception to present on the table
* @return an error table
*/
public static Table getErrorTable(Exception exception){
CellConfiguration cellConfigurationTitle = new CellConfiguration();
cellConfigurationTitle.horizontalAlign = Element.ALIGN_LEFT;
cellConfigurationTitle.backgroundColor = BaseColor.RED;
Table table = new Table();
table.addCell("ERROR", cellConfigurationTitle);
table.addCell(exception.getMessage());
/*
table.addCell(MetodosLog.formatarExcecao(excepcao));
*/
table.setBorderColor(BaseColor.RED);
return table;
}
/**
* Method to add metadata to the document
* @param context the app context
* @param document the document
* @param template the class that is generating the file
*/
public static void addMetaData(Context context, Document document, Template template) {
Date currentTime = Calendar.getInstance().getTime();
SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy");
String formattedDate = df.format(currentTime);
ApplicationInfo applicationInfo = context.getApplicationInfo();
int stringId = applicationInfo.labelRes;
String appName = stringId == 0 ? applicationInfo.nonLocalizedLabel.toString() : context.getString(stringId);
document.addTitle(template.getClass().getSimpleName());
document.addSubject("Date: "+ formattedDate);
document.addCreator(appName);
}
/**
* Method to delete all pdf files from a directory
* @param directory the directory where the files are located
*/
public static void deleteAllFiles(File directory){
File[] Files = directory.listFiles();
if(Files != null) {
int j;
for(j = 0; j < Files.length; j++) {
if(Files[j].getAbsolutePath().contains(PdfConstants.PDF_EXTENSION) == true){
Files[j].delete();
}
}
}
}
/**
* Method to delete a specific pdf file from a directory
* @param directory the directory where the file is located
* @param fileName the name of the file
*/
public static void deleteFile(File directory, String fileName){
File[] Files = directory.listFiles();
if(Files != null) {
int j;
for(j = 0; j < Files.length; j++) {
if(Files[j].getAbsolutePath().contains(PdfConstants.PDF_EXTENSION) == true && Files[j].getAbsolutePath().contains(fileName) == true){
Files[j].delete();
}
}
}
}
/**
* Method to create a pdf image
* @param resources the app resources
* @param imageResource the image resource
* @return a pdf image
*/
public static Image createPdfImage(Resources resources, int imageResource) {
Image imagem = null;
ByteArrayOutputStream stream = new ByteArrayOutputStream();
Bitmap bitmap = BitmapFactory.decodeResource(resources, imageResource);
if(bitmap == null){
bitmap = BitmapFactory.decodeResource(resources, R.drawable.no_image_found);
}
try{
bitmap.compress(Bitmap.CompressFormat.PNG, 100 , stream);
}
catch(Exception e){
bitmap.compress(Bitmap.CompressFormat.JPEG, 100 , stream);
}
try {
imagem = Image.getInstance(stream.toByteArray());
imagem.setAlignment(Image.MIDDLE);
imagem.scaleToFit(250, 150);
}
catch (BadElementException | IOException e) {
e.printStackTrace();
}
return imagem;
}
/**
* Method to create a pdf image
* @param resources the app resources
* @param bitmap the image resource
* @return a pdf image
*/
public static Image createPdfImage(Resources resources, Bitmap bitmap) {
Image imagem = null;
ByteArrayOutputStream stream = new ByteArrayOutputStream();
if(bitmap == null){
bitmap = BitmapFactory.decodeResource(resources, R.drawable.no_image_found);
}
bitmap.compress(Bitmap.CompressFormat.JPEG, 100 , stream);
try {
imagem = Image.getInstance(stream.toByteArray());
imagem.setAlignment(Image.MIDDLE);
imagem.scaleToFit(250, 150);
}
catch (BadElementException | IOException e) {
e.printStackTrace();
}
return imagem;
}
}
|
[
"gustavo.maia@b2b.com.pt"
] |
gustavo.maia@b2b.com.pt
|
e2860d05bb070c6b919693b05935d5158ecbbe64
|
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
|
/program_data/JavaProgramData/86/30.java
|
45808d841fc8a7584ac9073ac6422ef677778e42
|
[
"MIT"
] |
permissive
|
qiuchili/ggnn_graph_classification
|
c2090fefe11f8bf650e734442eb96996a54dc112
|
291ff02404555511b94a4f477c6974ebd62dcf44
|
refs/heads/master
| 2021-10-18T14:54:26.154367
| 2018-10-21T23:34:14
| 2018-10-21T23:34:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,304
|
java
|
public class jumps
{
public int error;
public int[] c = new int[100];
public int sum;
public int xia;
}
package <missing>;
public class GlobalMembers
{
public static int Main()
{
jumps[] jump = tangible.Arrays.initializeWithDefaultjumpsInstances(100);
int n;
int i;
int j;
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
n = Integer.parseInt(tempVar);
}
for (i = 0;i < n;i++)
{
String tempVar2 = ConsoleInput.scanfRead();
if (tempVar2 != null)
{
jump[i].error = Integer.parseInt(tempVar2);
}
for (j = 0;j < jump[i].error;j++)
{
String tempVar3 = ConsoleInput.scanfRead();
if (tempVar3 != null)
{
jump[i].c[j] = Integer.parseInt(tempVar3);
}
}
}
for (i = 0;i < n;i++)
{
if (jump[i].c[jump[i].error - 1] + jump[i].error * 3 < 60)
{
jump[i].xia = 60 - jump[i].error * 3;
}
else
{
for (j = 0;j < jump[i].error;j++)
{
if (jump[i].c[j] >= 47 && jump[i].c[j] <= 49)
{
jump[i].xia = jump[i].c[j];
break;
}
else if (jump[i].c[j] + (j + 1) * 3 > 60 && jump[i].c[j - 1] + (j) * 3 < 60)
{
jump[i].xia = 60 - (j) * 3;
break;
}
}
}
}
for (i = 0;i < n;i++)
{
System.out.printf("%d\n",jump[i].xia);
}
return 0;
}
}
|
[
"y.yu@open.ac.uk"
] |
y.yu@open.ac.uk
|
665a253cb8870a2a5857109d653656f9a26fc1d2
|
521a130e155a7579da1775883d0694be36347896
|
/maven_demo/src/main/java/cn/itcast/Demo.java
|
1d0e6dc3e1e67a35db2be33c5597977193c2c316
|
[] |
no_license
|
yuanshaohao/javaee326_1
|
4f7b826a622e1ad21e790e5198936177a7cf5a80
|
0ed6184c6338ee171b2dc8525a64352b20d86d42
|
refs/heads/master
| 2020-04-08T03:53:52.645597
| 2018-11-25T03:46:53
| 2018-11-25T03:46:53
| 158,994,198
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 272
|
java
|
package cn.itcast;
public class Demo {
public static void main(String[] args) {
System.out.println("aaaaaa");
System.out.println("bbbb");
System.out.println("ccccc");
System.out.println("idea");
System.out.println("xiaowugui");
}
}
|
[
"123@163.com"
] |
123@163.com
|
3e448dac756fdb3e4f130278c4cc97b67dca0bd6
|
633f9b4f288975ed75fdf680cfe781f978f44efc
|
/lib/src/test/java/com/auth0/jwt/impl/ClaimsHolderTest.java
|
87cc9800e69fbd5608ee655ee2eed593e603d6e4
|
[
"MIT"
] |
permissive
|
SummersRemote/java-jwt
|
334632d85e2bd1809e91b3d9283ea2ff53252d52
|
79ed2431f0f3b35bff1e1a461ba1a240ca4aa8f2
|
refs/heads/master
| 2022-08-03T15:07:21.264756
| 2020-04-24T19:24:56
| 2020-04-24T19:24:56
| 271,160,468
| 1
| 0
|
MIT
| 2020-06-10T02:44:29
| 2020-06-10T02:44:28
| null |
UTF-8
|
Java
| false
| false
| 1,101
|
java
|
package com.auth0.jwt.impl;
import org.hamcrest.collection.IsMapContaining;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
public class ClaimsHolderTest {
@SuppressWarnings("RedundantCast")
@Test
public void shouldGetClaims() throws Exception {
HashMap<String, Object> claims = new HashMap<>();
claims.put("iss", "auth0");
ClaimsHolder holder = new ClaimsHolder(claims);
assertThat(holder, is(notNullValue()));
assertThat(holder.getClaims(), is(notNullValue()));
assertThat(holder.getClaims(), is(instanceOf(Map.class)));
assertThat(holder.getClaims(), is(IsMapContaining.hasEntry("iss", (Object) "auth0")));
}
@Test
public void shouldGetNotNullClaims() throws Exception {
ClaimsHolder holder = new ClaimsHolder(null);
assertThat(holder, is(notNullValue()));
assertThat(holder.getClaims(), is(notNullValue()));
assertThat(holder.getClaims(), is(instanceOf(Map.class)));
}
}
|
[
"balmacedaluciano@gmail.com"
] |
balmacedaluciano@gmail.com
|
ec3fab399c8c154aacacaf6c25509aa1c239ecc1
|
f3c35ce8ca93ad644f523ca19171478dd0ec95da
|
/ib-engine/src/main/java/com/dwidasa/engine/dao/mapper/ActivityCustomerMapper.java
|
c6e2a01866f1107c947df350c9a197d046133116
|
[] |
no_license
|
depot-air/internet-banking
|
da049da2f6288a388bd9f2d33a9e8e57f5954269
|
25a5e0038c446536eca748e18f35b7a6a8224604
|
refs/heads/master
| 2022-12-21T03:54:50.227565
| 2020-01-16T11:15:31
| 2020-01-16T11:15:31
| 234,302,680
| 0
| 1
| null | 2022-12-09T22:33:28
| 2020-01-16T11:12:17
|
Java
|
UTF-8
|
Java
| false
| false
| 1,372
|
java
|
package com.dwidasa.engine.dao.mapper;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.stereotype.Component;
import com.dwidasa.engine.model.ActivityCustomer;
@Component("activityCustomerMapper")
public class ActivityCustomerMapper extends ChainedRowMapper<ActivityCustomer> implements ParameterizedRowMapper<ActivityCustomer> {
public ActivityCustomerMapper() {
}
public ActivityCustomer chainRow(ResultSet rs, int index) throws SQLException {
ActivityCustomer activityCustomer = new ActivityCustomer();
activityCustomer.setId(rs.getLong(++index));
activityCustomer.setCustomerId(rs.getLong(++index));
activityCustomer.setActivityType(rs.getString(++index));
activityCustomer.setActivityData(rs.getString(++index));
activityCustomer.setReferenceNumber(rs.getString(++index));
activityCustomer.setDeliveryChannel(rs.getString(++index));
activityCustomer.setDeliveryChannelId(rs.getString(++index));
activityCustomer.setCreated(rs.getTimestamp(++index));
activityCustomer.setCreatedby(rs.getLong(++index));
activityCustomer.setUpdated(rs.getTimestamp(++index));
activityCustomer.setUpdatedby(rs.getLong(++index));
return activityCustomer;
}
}
|
[
"gunungloli@gmail.com"
] |
gunungloli@gmail.com
|
0f9281e9deb31e24659c4cabc42e6e7ed1f0f673
|
ab08af99137a68c6d97f515fdc3338c65f8675c7
|
/tutorials/interphone/app/src/main/java/com/itaccess/interphone/utils/ThreadUtils.java
|
9a5eb554bad741f8cd4df3e1d114301ce4431b1f
|
[] |
no_license
|
xuemingqin/projects
|
99bbf868f790f3a0a67beaa8eaae980289f836e1
|
6fccaeb321d28f71a32d485c4cdd4764767667f5
|
refs/heads/master
| 2022-02-20T23:37:49.425608
| 2019-09-03T12:05:41
| 2019-09-03T12:05:41
| 198,058,275
| 0
| 0
| null | 2019-08-18T06:28:41
| 2019-07-21T13:15:43
|
Java
|
UTF-8
|
Java
| false
| false
| 687
|
java
|
package com.itaccess.interphone.utils;
import android.os.Handler;
import android.os.Looper;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
/**
* Created by linxi on 2019/01/17.
*/
public class ThreadUtils {
public static final String TAG = "ThreadUtils";
private static Executor sExecutor = Executors.newSingleThreadExecutor();
private static Handler sHandler = new Handler(Looper.getMainLooper());
public static void runOnUiThread(Runnable runnable) {
sHandler.post(runnable);
}
public static void runOnBackgroundThread(Runnable runnable) {
sExecutor.execute(runnable);
}
}
|
[
"1208280008@qq.com"
] |
1208280008@qq.com
|
8dbfa61c5247fa60e30057172c6cf68613d283dd
|
16119ac8f8e6dd644446b2e1a526cb5b54711c65
|
/cms-web/src/test/java/com/xzjie/gypt/system/ResourceServiceTest.java
|
a24bb88c1b0e9066d865399024d6cf36503235e4
|
[] |
no_license
|
fenglove/cms
|
74ee332b8f077f916a04ca0ddb54a6504409fa5a
|
09cab9521da9a325000079793fe22d28e9911870
|
refs/heads/master
| 2021-01-23T12:20:56.350671
| 2016-11-21T09:37:47
| 2016-11-21T09:37:47
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,210
|
java
|
/**
* radp-cms
* @Title: ResourceServiceTest.java
* @Package com.xzjie.gypt.system
* @Description: TODO(添加描述)
* @Copyright: Copyright (c) 2016
* @Company:
* @author 作者 E-mail: 513961835@qq.com
* @date 2016年7月2日
*/
package com.xzjie.gypt.system;
import java.util.List;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import com.alibaba.fastjson.JSON;
import com.xzjie.gypt.BaseTest;
import com.xzjie.gypt.system.model.Resource;
import com.xzjie.gypt.system.service.ResourceService;
/**
* @className ResourceServiceTest.java
* @description TODO(添加描述)
* @author xzjie
* @create 2016年7月2日 下午12:25:27
* @version V0.0.1
*/
public class ResourceServiceTest extends BaseTest{
@Autowired
private ResourceService resourceService;
@Test
public void getResourceTree(){
List<Resource> list= resourceService.getResourceTree(0L);
logger.info("==> resource tree:"+JSON.toJSONString(list));
}
@Test
public void getResourceUser(){
List<Resource> list= resourceService.getResourceUser(1L);
logger.info("==> resource user:"+JSON.toJSONString(list));
}
}
|
[
"513961835@qq.com"
] |
513961835@qq.com
|
80b3ecaa67728c20a8feda0f51fa71e5067c33a2
|
928bdfb9b0f4b6db0043526e095fe1aa822b8e64
|
/src/main/java/com/taobao/api/request/FenxiaoDealerRequisitionorderCreateRequest.java
|
503ef9be397228cce6d574d23bbd674c87bf7e5a
|
[] |
no_license
|
yu199195/jsb
|
de4f4874fb516d3e51eb3badb48d89be822e00f7
|
591ad717121dd8da547348aeac551fc71da1b8bd
|
refs/heads/master
| 2021-09-07T22:25:09.457212
| 2018-03-02T04:54:18
| 2018-03-02T04:54:18
| 102,316,111
| 4
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,103
|
java
|
package com.taobao.api.request;
import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.internal.util.RequestCheckUtils;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.FenxiaoDealerRequisitionorderCreateResponse;
import java.util.Map;
public class FenxiaoDealerRequisitionorderCreateRequest
extends BaseTaobaoRequest<FenxiaoDealerRequisitionorderCreateResponse> {
private String address;
private String buyerName;
private String city;
private String district;
private String idCardNumber;
private String logisticsType;
private String mobile;
private String orderDetail;
private String phone;
private String postCode;
private String province;
public void setAddress(String address) {
this.address = address;
}
public String getAddress() {
return this.address;
}
public void setBuyerName(String buyerName) {
this.buyerName = buyerName;
}
public String getBuyerName() {
return this.buyerName;
}
public void setCity(String city) {
this.city = city;
}
public String getCity() {
return this.city;
}
public void setDistrict(String district) {
this.district = district;
}
public String getDistrict() {
return this.district;
}
public void setIdCardNumber(String idCardNumber) {
this.idCardNumber = idCardNumber;
}
public String getIdCardNumber() {
return this.idCardNumber;
}
public void setLogisticsType(String logisticsType) {
this.logisticsType = logisticsType;
}
public String getLogisticsType() {
return this.logisticsType;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getMobile() {
return this.mobile;
}
public void setOrderDetail(String orderDetail) {
this.orderDetail = orderDetail;
}
public String getOrderDetail() {
return this.orderDetail;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPhone() {
return this.phone;
}
public void setPostCode(String postCode) {
this.postCode = postCode;
}
public String getPostCode() {
return this.postCode;
}
public void setProvince(String province) {
this.province = province;
}
public String getProvince() {
return this.province;
}
public String getApiMethodName() {
return "taobao.fenxiao.dealer.requisitionorder.create";
}
public Map<String, String> getTextParams() {
TaobaoHashMap txtParams = new TaobaoHashMap();
txtParams.put("address", this.address);
txtParams.put("buyer_name", this.buyerName);
txtParams.put("city", this.city);
txtParams.put("district", this.district);
txtParams.put("id_card_number", this.idCardNumber);
txtParams.put("logistics_type", this.logisticsType);
txtParams.put("mobile", this.mobile);
txtParams.put("order_detail", this.orderDetail);
txtParams.put("phone", this.phone);
txtParams.put("post_code", this.postCode);
txtParams.put("province", this.province);
if (this.udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public Class<FenxiaoDealerRequisitionorderCreateResponse> getResponseClass() {
return FenxiaoDealerRequisitionorderCreateResponse.class;
}
public void check() throws ApiRuleException {
RequestCheckUtils.checkNotEmpty(this.address, "address");
RequestCheckUtils.checkNotEmpty(this.buyerName, "buyerName");
RequestCheckUtils.checkNotEmpty(this.logisticsType, "logisticsType");
RequestCheckUtils.checkNotEmpty(this.orderDetail, "orderDetail");
RequestCheckUtils.checkMaxListSize(this.orderDetail, 50, "orderDetail");
RequestCheckUtils.checkNotEmpty(this.province, "province");
}
}
|
[
"yu.xiao@happylifeplat.com"
] |
yu.xiao@happylifeplat.com
|
0c35aae543a16fab518fd629096f8e6b1532adb5
|
63990ae44ac4932f17801d051b2e6cec4abb8ad8
|
/bus-image/src/main/java/org/aoju/bus/image/metric/internal/xdsi/ValueListType.java
|
5269d9468adb38b0ffea0bdf7ee3351f1011f605
|
[
"MIT"
] |
permissive
|
xeon-ye/bus
|
2cca99406a540cf23153afee8c924433170b8ba5
|
6e927146074fe2d23f9c9f23433faad5f9e40347
|
refs/heads/master
| 2023-03-16T17:47:35.172996
| 2021-02-22T10:31:48
| 2021-02-22T10:31:48
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,778
|
java
|
/*********************************************************************************
* *
* The MIT License (MIT) *
* *
* Copyright (c) 2015-2021 aoju.org and other contributors. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy *
* of this software and associated documentation files (the "Software"), to deal *
* in the Software without restriction, including without limitation the rights *
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN *
* THE SOFTWARE. *
* *
********************************************************************************/
package org.aoju.bus.image.metric.internal.xdsi;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;
/**
* @author Kimi Liu
* @version 6.2.0
* @since JDK 1.8+
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ValueListType", propOrder = {"value"})
public class ValueListType {
@XmlElement(name = "Value")
protected List<String> value;
public List<String> getValue() {
if (this.value == null) {
this.value = new ArrayList();
}
return this.value;
}
}
|
[
"839536@qq.com"
] |
839536@qq.com
|
aca279217a00877f18d97f12da172e43e6359a7f
|
59c4077b97d90098eb0d19948982276ac8f87658
|
/day10/常用类2/src/cn/imcore/prac/Test.java
|
34753d2974ec56ff41122a0976a087392ecc4270
|
[] |
no_license
|
sonyi/java
|
4b267e9cb554bb51f3770149f070ec812388cb8b
|
fbe2c2f7ae36bbbb4333bd567fb063daf507c8fc
|
refs/heads/master
| 2021-01-01T16:30:36.907998
| 2014-05-25T15:13:11
| 2014-05-25T15:13:11
| 19,110,091
| 2
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 666
|
java
|
package cn.imcore.prac;
public class Test {
public static void main(String[] args) {
String s = "1,2;3,4,5;6,7,8";
String[] rows = s.split(";");
double[][] d = new double[rows.length][];
//打印每行内容
for(int m=0; m<rows.length; m++) {
// System.out.println("====打印每行内容====" + m);
// System.out.println("rows["+m+"]=" + rows[m]);
//拆分列
String[] cols = rows[m].split(",");
d[m] = new double[cols.length];
for(int n=0; n<cols.length; n++) {
d[m][n] = Double.parseDouble(cols[n]);
System.out.print(d[m][n] + " ");
}
// System.out.println("\n====进入下一行====");
System.out.println();
}
}
}
|
[
"wxy15105957760"
] |
wxy15105957760
|
8fa4d4d6545b3449ca1467d5a24c47b0355d09ed
|
fe9d395063da6ce21bb3b989c59118244e698634
|
/src/main/java/com/gl365/payment/enums/mq/SystemType.java
|
42ffbc80dfd3a8b2e7209e58a05434bf41814b13
|
[] |
no_license
|
pengjianbo3478/payment
|
51f2e3b94fcf8c9943471c43686421ccf5b760bd
|
75b75fc7197610eb871cc30e063a29ec33ea1bf3
|
refs/heads/master
| 2020-03-07T20:41:00.939441
| 2018-04-02T04:50:03
| 2018-04-02T04:50:03
| 127,703,842
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 632
|
java
|
package com.gl365.payment.enums.mq;
/**
* MQ 系统级类别
* @author duanxz
*2017年5月13日
*/
public enum SystemType {
PAYMENT_SETTLE("payment_settle", "payment to settle"),
PAYMENT_MERCHANT("payment_merchant", "payment to merchant"),
PAYMENT_APP("payment_app", "payment to app"),
PAYMENT_JPUSH("payment_app", "payment to jpush");
private final String code;
private final String desc;
private SystemType(String key, String value) {
this.code = key;
this.desc = value;
}
public String getCode() {
return code;
}
public String getDesc() {
return desc;
}
}
|
[
"DEKK@DESKTOP-D6KV7VG"
] |
DEKK@DESKTOP-D6KV7VG
|
0513f2122a433a99ce8c3b12760981dfea12fa32
|
dfd7e70936b123ee98e8a2d34ef41e4260ec3ade
|
/analysis/reverse-engineering/decompile-fitts-with-gradle-20191031-2200/src/main/java/com/google/android/gms/internal/firebase_remote_config/zzge.java
|
93ddcc77dce4af5cbb1804ee1969a64a43f6d15f
|
[
"Apache-2.0"
] |
permissive
|
skkuse-adv/2019Fall_team2
|
2d4f75bc793368faac4ca8a2916b081ad49b7283
|
3ea84c6be39855f54634a7f9b1093e80893886eb
|
refs/heads/master
| 2020-08-07T03:41:11.447376
| 2019-12-21T04:06:34
| 2019-12-21T04:06:34
| 213,271,174
| 5
| 5
|
Apache-2.0
| 2019-12-12T09:15:32
| 2019-10-07T01:18:59
|
Java
|
UTF-8
|
Java
| false
| false
| 1,280
|
java
|
package com.google.android.gms.internal.firebase_remote_config;
final class zzge extends zzgh {
private final int zzoz;
private final int zzpa;
zzge(byte[] bArr, int i, int i2) {
super(bArr);
zzfx.zzb(i, i + i2, bArr.length);
this.zzoz = i;
this.zzpa = i2;
}
public final byte zzv(int i) {
int size = size();
if (((size - (i + 1)) | i) >= 0) {
return this.zzpc[this.zzoz + i];
}
if (i < 0) {
StringBuilder sb = new StringBuilder(22);
sb.append("Index < 0: ");
sb.append(i);
throw new ArrayIndexOutOfBoundsException(sb.toString());
}
StringBuilder sb2 = new StringBuilder(40);
sb2.append("Index > length: ");
sb2.append(i);
sb2.append(", ");
sb2.append(size);
throw new ArrayIndexOutOfBoundsException(sb2.toString());
}
/* access modifiers changed from: 0000 */
public final byte zzw(int i) {
return this.zzpc[this.zzoz + i];
}
public final int size() {
return this.zzpa;
}
/* access modifiers changed from: protected */
public final int zzey() {
return this.zzoz;
}
}
|
[
"33246398+ajid951125@users.noreply.github.com"
] |
33246398+ajid951125@users.noreply.github.com
|
4cd74bbe226db5e9dee12a40f396dc0b1e5a0656
|
8e3808e0570cce407027e4bb05a77ecf0c1d05e6
|
/cj.ultimate/src/cj/ultimate/net/sf/cglib/core/CollectionUtils.java
|
3421eb755c199901d79b7ffc432584b212f57547
|
[] |
no_license
|
carocean/cj.studio.ecm
|
22bdfa9dc339f76ffc635dcd8d8d7fb49017f0c3
|
b1e4594b51e738cf70ed2e91195b76e070ddc719
|
refs/heads/master
| 2021-07-06T12:03:48.715469
| 2020-07-26T05:57:18
| 2020-07-26T05:57:18
| 151,696,042
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,520
|
java
|
/*
* Copyright 2003,2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cj.ultimate.net.sf.cglib.core;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* @author Chris Nokleberg
* @version $Id: CollectionUtils.java,v 1.7 2004/06/24 21:15:21 herbyderby Exp $
*/
public class CollectionUtils {
private CollectionUtils() { }
public static Map bucket(Collection c, Transformer t) {
Map buckets = new HashMap();
for (Iterator it = c.iterator(); it.hasNext();) {
Object value = (Object)it.next();
Object key = t.transform(value);
List bucket = (List)buckets.get(key);
if (bucket == null) {
buckets.put(key, bucket = new LinkedList());
}
bucket.add(value);
}
return buckets;
}
public static void reverse(Map source, Map target) {
for (Iterator it = source.keySet().iterator(); it.hasNext();) {
Object key = it.next();
target.put(source.get(key), key);
}
}
public static Collection filter(Collection c, Predicate p) {
Iterator it = c.iterator();
while (it.hasNext()) {
if (!p.evaluate(it.next())) {
it.remove();
}
}
return c;
}
public static List transform(Collection c, Transformer t) {
List result = new ArrayList(c.size());
for (Iterator it = c.iterator(); it.hasNext();) {
result.add(t.transform(it.next()));
}
return result;
}
public static Map getIndexMap(List list) {
Map indexes = new HashMap();
int index = 0;
for (Iterator it = list.iterator(); it.hasNext();) {
indexes.put(it.next(), new Integer(index++));
}
return indexes;
}
}
|
[
"carocean.jofers@icloud.com"
] |
carocean.jofers@icloud.com
|
2d3f415e7c3599479d53164a30336b8dc710834d
|
20ac23b0f310f7a9427c89a2b9f7c36bbe1240d1
|
/RpcItemParent/netty-demo/src/main/java/cn/itcast/message/ChatRequestMessage.java
|
1bfe03af5ae4ce54ba0e3451250bdc36674f6348
|
[] |
no_license
|
zyz610650/NettyPractice
|
ca8808f57f535c43398f7525601df7cf7076530c
|
20d7df86889f0f117eeddc6a6842e7401a9599bf
|
refs/heads/master
| 2023-08-24T09:44:54.332597
| 2021-09-19T11:37:31
| 2021-09-19T11:37:31
| 404,937,466
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 525
|
java
|
package cn.itcast.message;
import lombok.Data;
import lombok.ToString;
@Data
@ToString(callSuper = true)
public class ChatRequestMessage extends Message {
private String content;
private String to;
private String from;
public ChatRequestMessage() {
}
public ChatRequestMessage(String from, String to, String content) {
this.from = from;
this.to = to;
this.content = content;
}
@Override
public int getMessageType() {
return ChatRequestMessage;
}
}
|
[
"zhangyuze724@163.com"
] |
zhangyuze724@163.com
|
7b46876cf7b821de586ea6c2c1d9866a9d7bd718
|
933cad9b42d64e43c8c619e172090be7d27e0b4f
|
/kurumi_java/src/com/iteye/weimingtom/kurumi/model/ArrayRef.java
|
432f0431d01b83d8a61bde15be4b5d974be87a12
|
[] |
no_license
|
weimingtom/kurumi
|
6eff9aa42a0898deb710dd1e5157a612c4c1fda0
|
b3b893c5948f572b48fb0da88cbbe05cf5054beb
|
refs/heads/master
| 2020-05-23T07:55:26.331237
| 2018-04-07T11:41:46
| 2018-04-07T11:41:46
| 80,464,580
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,503
|
java
|
package com.iteye.weimingtom.kurumi.model;
import com.iteye.weimingtom.kurumi.port.ClassType;
import com.iteye.weimingtom.kurumi.proto.ArrayElement;
import com.iteye.weimingtom.kurumi.proto.GCObjectRef;
//
// ** $Id: lstate.c,v 2.36.1.2 2008/01/03 15:20:39 roberto Exp $
// ** Global State
// ** See Copyright Notice in lua.h
//
public class ArrayRef implements GCObjectRef, ArrayElement {
// ArrayRef is used to reference GCObject objects in an array, the next two members
// point to that array and the index of the GCObject element we are referencing
private GCObject[] array_elements;
private int array_index;
// ArrayRef is itself stored in an array and derived from ArrayElement, the next
// two members refer to itself i.e. the array and index of it's own instance.
private ArrayRef[] vals;
private int index;
public ArrayRef() {
this.array_elements = null;
this.array_index = 0;
this.vals = null;
this.index = 0;
}
public ArrayRef(GCObject[] array_elements, int array_index) {
this.array_elements = array_elements;
this.array_index = array_index;
this.vals = null;
this.index = 0;
}
public final void set(GCObject value) {
array_elements[array_index] = value;
}
public final GCObject get() {
return array_elements[array_index];
}
public final void set_index(int index) {
this.index = index;
}
public final void set_array(Object vals) {
// don't actually need this
this.vals = (ArrayRef[])vals;
ClassType.Assert(this.vals != null);
}
}
|
[
"weimingtom@qq.com"
] |
weimingtom@qq.com
|
2b0ac3b385363b1bf898b7f4eb3c2b8c046cb7f5
|
6392035b0421990479baf09a3bc4ca6bcc431e6e
|
/projects/spring-data-neo4j-071588a4/prev/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/integration/movies/domain/TempMovie.java
|
74fa0a8ea2728b590954333bc7abf23f469c5512
|
[] |
no_license
|
ameyaKetkar/RMinerEvaluationTools
|
4975130072bf1d4940f9aeb6583eba07d5fedd0a
|
6102a69d1b78ae44c59d71168fc7569ac1ccb768
|
refs/heads/master
| 2020-09-26T00:18:38.389310
| 2020-05-28T17:34:39
| 2020-05-28T17:34:39
| 226,119,387
| 3
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,356
|
java
|
/*
* Copyright (c) [2011-2015] "Pivotal Software, Inc." / "Neo Technology" / "Graph Aware Ltd."
*
* This product is licensed to you under the Apache License, Version 2.0 (the "License").
* You may not use this product except in compliance with the License.
*
* This product may include a number of subcomponents with
* separate copyright notices and license terms. Your use of the source
* code for these subcomponents is subject to the terms and
* conditions of the subcomponent's license, as noted in the LICENSE file.
*/
package org.springframework.data.neo4j.integration.movies.domain;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;
import java.util.HashSet;
import java.util.Set;
/**
* @author Michal Bachman
*/
//todo merge with movie when tests fixed
@NodeEntity(label = "Movie")
public class TempMovie extends AbstractEntity {
private String title;
@Relationship(type = "RATED", direction = Relationship.INCOMING)
private Set<Rating> ratings = new HashSet<>();
public TempMovie() {
}
public TempMovie(String title) {
this.title = title;
}
public String getTitle() {
return title;
}
public void addRating(Rating rating) {
ratings.add(rating);
}
public Set<Rating> getRatings() {
return ratings;
}
}
|
[
"ask1604@gmail.com"
] |
ask1604@gmail.com
|
77d841a2676c9df3197c88d81001c11eceb87f1a
|
d98de110431e5124ec7cc70d15906dac05cfa61a
|
/public/source/ors/src/test/java/org/marketcetera/ors/history/EquityReportsHistoryTest.java
|
b0c6f3ee89375fd89d741bec0220a998efb64756
|
[] |
no_license
|
dhliu3/marketcetera
|
367f6df815b09f366eb308481f4f53f928de4c49
|
4a81e931a044ba19d8f35bdadd4ab081edd02f5f
|
refs/heads/master
| 2020-04-06T04:39:55.389513
| 2012-01-30T06:49:25
| 2012-01-30T06:49:25
| 29,947,427
| 0
| 1
| null | 2015-01-28T02:54:39
| 2015-01-28T02:54:39
| null |
UTF-8
|
Java
| false
| false
| 2,796
|
java
|
package org.marketcetera.ors.history;
import org.marketcetera.util.misc.ClassVersion;
import org.marketcetera.trade.*;
import org.marketcetera.ors.security.SimpleUser;
import org.marketcetera.core.position.PositionKey;
import org.marketcetera.module.ExpectedFailure;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;
/* $License$ */
/**
* Tests {@link ReportHistoryServices} behavior for Equity and unhandled
* instruments.
*
* @author anshul@marketcetera.com
* @version $Id: EquityReportsHistoryTest.java 10885 2009-11-17 19:22:56Z klim $
* @since 2.0.0
*/
@ClassVersion("$Id: EquityReportsHistoryTest.java 10885 2009-11-17 19:22:56Z klim $")
public class EquityReportsHistoryTest extends ReportHistoryTestBase<Equity> {
/**
* Verifies the behavior when instrument cannot be extracted from the report.
*
* @throws Exception if there were unexpected errors.
*/
@Test
public void unhandledInstrument() throws Exception {
final ExecutionReport report = createExecReport("ord1", null,
new Equity("green"), Side.Buy, OrderStatus.Filled,
BigDecimal.TEN, BigDecimal.TEN, BigDecimal.TEN, BigDecimal.TEN);
//Change the security type so that the instrument is not retrievable anymore.
((FIXMessageSupport) report).getMessage().setField(
new quickfix.field.SecurityType(quickfix.field.SecurityType.BANK_NOTES));
Date before = new Date();
sleepForSignificantTime();
new ExpectedFailure<IllegalArgumentException>() {
@Override
protected void run() throws Exception {
sServices.save(report);
}
};
//verify that no reports were saved.
assertEquals(0, sServices.getReportsSince(sViewer, before).length);
}
@Override
protected Equity getInstrument() {
return new Equity("ubm");
}
@Override
protected BigDecimal getInstrumentPosition(Date inDate, Equity inInstrument) throws Exception {
return getPosition(inDate, inInstrument);
}
@Override
protected BigDecimal getInstrumentPosition(Date inDate, Equity inInstrument, SimpleUser inUser) throws Exception {
return getPosition(inDate, inInstrument, inUser);
}
@Override
protected Map<PositionKey<Equity>, BigDecimal> getInstrumentPositions(Date inDate) throws Exception {
return getPositions(inDate);
}
@Override
protected Map<PositionKey<Equity>, BigDecimal> getInstrumentPositions(Date inDate, SimpleUser inUser) throws Exception {
return getPositions(inDate, inUser);
}
}
|
[
"stevenshack@stevenshack.com"
] |
stevenshack@stevenshack.com
|
ad87e39f217ae01c72e2c0a703d75aea0a446bfc
|
d5e336a49c4fa55906d7be2f406a787d759b3ec6
|
/src/排序专题/Shell排序_shellSort/ShellSort.java
|
866529c44367e11cca01febb6359c63cfe083984
|
[] |
no_license
|
chenxy1996/leetcode
|
68853a77425041b9ec702f72630fac68e9835031
|
5204bd426a9e42bf8450704c42cd9179348bc676
|
refs/heads/master
| 2021-07-02T09:11:33.201710
| 2020-10-14T09:02:36
| 2020-10-14T09:02:36
| 179,980,417
| 4
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,359
|
java
|
package 排序专题.Shell排序_shellSort;
import 排序专题.SortTest;
import 排序专题.View;
import java.util.Arrays;
import java.util.stream.IntStream;
public class ShellSort {
public static void sort(int[] nums) {
if (nums == null || nums.length == 1) {
return;
}
sort(nums, 0, nums.length - 1);
}
private static void sort(int[] nums, int left, int right) {
int step = nums.length / 2;
step = step > 0 ? step : 1;
while (step > 0) {
for (int i = 0; i < step; i++) {
shellSort(nums, i, step);
// 可视化
// ------------------------------------------
int start = i;
int finalStep = step;
IntStream stream = IntStream.iterate(start, num -> num < nums.length, num -> num + finalStep);
View.viewArray(nums, stream.toArray());
// ------------------------------------------
}
step = step >> 1;
}
}
private static void shellSort(int[] nums, int start, int step) {
for (int i = start; i < nums.length; i += step) {
int target = nums[i];
int pos = findPos(nums, start, i - step, step, target);
pos = pos >= 0 ? pos : i;
insert(nums, pos, step, i - step, target);
}
}
private static int findPos(int[] nums, int start, int end, int step, int target) {
int l = 0;
int r = (end - start) / step;
end = r;
while (l <= r) {
int m = l + (r - l) / 2;
int m1 = m * step + start;
int valM = nums[m1];
if (valM <= target) {
l = m + 1;
} else {
r = m - 1;
}
}
return l <= end ? l * step + start : -1;
}
private static void insert(int[] nums, int pos, int step, int end, int target) {
for (int i = end; i >= pos; i -= step) {
nums[i + step] = nums[i];
}
nums[pos] = target;
}
public static void main(String[] args) {
int[] nums = {7, 1, 3, 2, 1, 12, 0, 7, 8, 3, 2, 2, 4, 9, 5, 5, 6, 12};
sort(nums);
System.out.println(Arrays.toString(nums));
System.out.println(SortTest.test(ShellSort::sort));
}
}
|
[
"chenxy19960202@gmail.com"
] |
chenxy19960202@gmail.com
|
5d1cfaedfc8df91796fcc13b3bf9b3959696e3c4
|
a12a0f98b7a768c02d8d8329d1c52e2610fc7c51
|
/app/src/main/java/in/vinkrish/quickwash/ReplaceFragment.java
|
d14fc70b6c13c62af150a17314772044c1c01c22
|
[] |
no_license
|
emppas/QuickWash
|
1bff50439f20f1089c4dd3bafa10616c9d5277c3
|
24cc2e04b61a06590927aeaeb848e26608f465f8
|
refs/heads/master
| 2021-08-30T07:16:57.983949
| 2017-12-16T17:16:54
| 2017-12-16T17:16:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 365
|
java
|
package in.vinkrish.quickwash;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
/**
* Created by vinkrish.
*/
class ReplaceFragment {
static void replace(Fragment f, FragmentManager fm) {
fm
.beginTransaction()
.replace(R.id.content_frame, f)
.commit();
}
}
|
[
"vinaykrishna1989@gmail.com"
] |
vinaykrishna1989@gmail.com
|
519a6f74186e3cf9d2c601b7bbcadf4e8f384223
|
828b5327357d0fb4cb8f3b4472f392f3b8b10328
|
/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendStopWithSavepointTest.java
|
d8a40676cee13bc91c4ba0fda6d3f4ad15091170
|
[
"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
| 7,232
|
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.client.cli;
import org.apache.flink.api.common.JobID;
import org.apache.flink.client.cli.util.MockedCliFrontend;
import org.apache.flink.client.program.ClusterClient;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.util.ExceptionUtils;
import org.apache.flink.util.FlinkException;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mockito;
import javax.annotation.Nullable;
import java.util.Collections;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.powermock.api.mockito.PowerMockito.doThrow;
/**
* Tests for the STOP command.
*/
public class CliFrontendStopWithSavepointTest extends CliFrontendTestBase {
@BeforeClass
public static void setup() {
CliFrontendTestUtils.pipeSystemOutToNull();
}
@AfterClass
public static void shutdown() {
CliFrontendTestUtils.restoreSystemOut();
}
@Test
public void testStopWithOnlyJobId() throws Exception {
// test stop properly
JobID jid = new JobID();
String jidString = jid.toString();
String[] parameters = { jidString };
final ClusterClient<String> clusterClient = createClusterClient(null);
MockedCliFrontend testFrontend = new MockedCliFrontend(clusterClient);
testFrontend.stop(parameters);
Mockito.verify(clusterClient, times(1))
.stopWithSavepoint(eq(jid), eq(false), isNull());
}
@Test
public void testStopWithDefaultSavepointDir() throws Exception {
JobID jid = new JobID();
String[] parameters = {jid.toString() };
final ClusterClient<String> clusterClient = createClusterClient(null);
MockedCliFrontend testFrontend = new MockedCliFrontend(clusterClient);
testFrontend.stop(parameters);
Mockito.verify(clusterClient, times(1))
.stopWithSavepoint(eq(jid), eq(false), isNull());
}
@Test
public void testStopWithExplicitSavepointDir() throws Exception {
JobID jid = new JobID();
String[] parameters = { "-p", "test-target-dir", jid.toString() };
final ClusterClient<String> clusterClient = createClusterClient(null);
MockedCliFrontend testFrontend = new MockedCliFrontend(clusterClient);
testFrontend.stop(parameters);
Mockito.verify(clusterClient, times(1))
.stopWithSavepoint(eq(jid), eq(false), eq("test-target-dir"));
}
@Test
public void testStopOnlyWithMaxWM() throws Exception {
JobID jid = new JobID();
String[] parameters = { "-d", jid.toString() };
final ClusterClient<String> clusterClient = createClusterClient(null);
MockedCliFrontend testFrontend = new MockedCliFrontend(clusterClient);
testFrontend.stop(parameters);
Mockito.verify(clusterClient, times(1))
.stopWithSavepoint(eq(jid), eq(true), isNull());
}
@Test
public void testStopWithMaxWMAndDefaultSavepointDir() throws Exception {
JobID jid = new JobID();
String[] parameters = { "-p", "-d", jid.toString() };
final ClusterClient<String> clusterClient = createClusterClient(null);
MockedCliFrontend testFrontend = new MockedCliFrontend(clusterClient);
testFrontend.stop(parameters);
Mockito.verify(clusterClient, times(1))
.stopWithSavepoint(eq(jid), eq(true), isNull());
}
@Test
public void testStopWithMaxWMAndExplicitSavepointDir() throws Exception {
JobID jid = new JobID();
String[] parameters = { "-d", "-p", "test-target-dir", jid.toString() };
final ClusterClient<String> clusterClient = createClusterClient(null);
MockedCliFrontend testFrontend = new MockedCliFrontend(clusterClient);
testFrontend.stop(parameters);
Mockito.verify(clusterClient, times(1))
.stopWithSavepoint(eq(jid), eq(true), eq("test-target-dir"));
}
@Test(expected = CliArgsException.class)
public void testUnrecognizedOption() throws Exception {
// test unrecognized option
String[] parameters = { "-v", "-l" };
Configuration configuration = getConfiguration();
CliFrontend testFrontend = new CliFrontend(
configuration,
Collections.singletonList(getCli(configuration)));
testFrontend.stop(parameters);
}
@Test(expected = CliArgsException.class)
public void testMissingJobId() throws Exception {
// test missing job id
String[] parameters = {};
Configuration configuration = getConfiguration();
CliFrontend testFrontend = new CliFrontend(
configuration,
Collections.singletonList(getCli(configuration)));
testFrontend.stop(parameters);
}
@Test(expected = CliArgsException.class)
public void testWrongSavepointDirOrder() throws Exception {
JobID jid = new JobID();
String[] parameters = { "-s", "-d", "test-target-dir", jid.toString() };
final ClusterClient<String> clusterClient = createClusterClient(null);
MockedCliFrontend testFrontend = new MockedCliFrontend(clusterClient);
testFrontend.stop(parameters);
Mockito.verify(clusterClient, times(1))
.stopWithSavepoint(eq(jid), eq(false), eq("test-target-dir"));
}
@Test
public void testUnknownJobId() throws Exception {
// test unknown job Id
JobID jid = new JobID();
String[] parameters = { "-p", "test-target-dir", jid.toString() };
String expectedMessage = "Test exception";
FlinkException testException = new FlinkException(expectedMessage);
final ClusterClient<String> clusterClient = createClusterClient(testException);
MockedCliFrontend testFrontend = new MockedCliFrontend(clusterClient);
try {
testFrontend.stop(parameters);
fail("Should have failed.");
} catch (FlinkException e) {
assertTrue(ExceptionUtils.findThrowableWithMessage(e, expectedMessage).isPresent());
}
}
private static ClusterClient<String> createClusterClient(@Nullable Exception exception) throws Exception {
final ClusterClient<String> clusterClient = mock(ClusterClient.class);
if (exception != null) {
doThrow(exception).when(clusterClient).stopWithSavepoint(any(JobID.class), anyBoolean(), anyString());
}
return clusterClient;
}
}
|
[
"1003761104@qq.com"
] |
1003761104@qq.com
|
e4136d8c66e80eb91355d26fe8ebd1a7a149b541
|
8740b13932b1f19d213ad6a99be5d907e1f12bc5
|
/src/com/mraof/minestuck/inventory/captchalouge/SetModus.java
|
039a24eab116116434d36b4d711f3558e97f24c9
|
[] |
no_license
|
Padamariuse/Minestuck
|
eb89e55a94989b7cb50f9f03d8f24525d8f2c314
|
bc74f85bd766881e8151fc7f196599de0a0afeb7
|
refs/heads/1.12
| 2021-06-26T12:59:41.390650
| 2019-06-22T21:13:25
| 2019-06-22T21:13:25
| 151,946,739
| 3
| 0
| null | 2019-04-18T07:25:18
| 2018-10-07T13:54:02
|
Java
|
UTF-8
|
Java
| false
| false
| 4,137
|
java
|
package com.mraof.minestuck.inventory.captchalouge;
import com.mraof.minestuck.MinestuckConfig;
import com.mraof.minestuck.client.gui.captchalouge.SetGuiHandler;
import com.mraof.minestuck.client.gui.captchalouge.SylladexGuiHandler;
import com.mraof.minestuck.item.MinestuckItems;
import com.mraof.minestuck.alchemy.AlchemyRecipes;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.Iterator;
public class SetModus extends Modus
{
protected int size;
protected NonNullList<ItemStack> list;
@SideOnly(Side.CLIENT)
protected boolean changed;
@SideOnly(Side.CLIENT)
protected NonNullList<ItemStack> items;
@SideOnly(Side.CLIENT)
protected SylladexGuiHandler gui;
@Override
public void initModus(NonNullList<ItemStack> prev, int size)
{
this.size = size;
list = NonNullList.<ItemStack>create();
/*if(prev != null)
{
for(ItemStack stack : prev)
if(stack != null)
list.add(stack);
}*/
if(player.world.isRemote)
{
items = NonNullList.<ItemStack>create();
changed = true;
}
}
@Override
public void readFromNBT(NBTTagCompound nbt)
{
size = nbt.getInteger("size");
list = NonNullList.<ItemStack>create();
for(int i = 0; i < size; i++)
if(nbt.hasKey("item"+i))
list.add(new ItemStack(nbt.getCompoundTag("item"+i)));
else break;
if(side.isClient())
{
if(items == null)
items = NonNullList.create();
changed = true;
}
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
{
nbt.setInteger("size", size);
Iterator<ItemStack> iter = list.iterator();
for(int i = 0; i < list.size(); i++)
{
ItemStack stack = iter.next();
nbt.setTag("item"+i, stack.writeToNBT(new NBTTagCompound()));
}
return nbt;
}
@Override
public boolean putItemStack(ItemStack item)
{
if(size <= list.size() || item.isEmpty())
return false;
for(ItemStack stack : list)
if(stack.getItem() == item.getItem() && (!stack.getHasSubtypes() || stack.getMetadata() == item.getMetadata()))
{
CaptchaDeckHandler.launchItem(player, item);
return true;
}
if(item.getCount() > 1)
{
ItemStack stack = item.copy();
stack.shrink(1);
item.setCount(1);
CaptchaDeckHandler.launchItem(player, stack);
}
list.add(item);
return true;
}
@Override
public NonNullList<ItemStack> getItems()
{
if(side.isServer()) //Used only when replacing the modus
{
NonNullList<ItemStack> items = NonNullList.<ItemStack>create();
fillList(items);
return items;
}
if(changed)
{
fillList(items);
}
return items;
}
protected void fillList(NonNullList<ItemStack> items)
{
items.clear();
Iterator<ItemStack> iter = list.iterator();
for(int i = 0; i < size; i++)
if(iter.hasNext())
items.add(iter.next());
else items.add(ItemStack.EMPTY);
}
@Override
public boolean increaseSize()
{
if(MinestuckConfig.modusMaxSize > 0 && size >= MinestuckConfig.modusMaxSize)
return false;
size++;
return true;
}
@Override
public ItemStack getItem(int id, boolean asCard)
{
if(id == CaptchaDeckHandler.EMPTY_CARD)
{
if(list.size() < size)
{
size--;
return new ItemStack(MinestuckItems.captchaCard);
} else return ItemStack.EMPTY;
}
if(list.isEmpty())
return ItemStack.EMPTY;
if(id == CaptchaDeckHandler.EMPTY_SYLLADEX)
{
for(ItemStack item : list)
CaptchaDeckHandler.launchAnyItem(player, item);
list.clear();
return ItemStack.EMPTY;
}
if(id < 0 || id >= list.size())
return ItemStack.EMPTY;
ItemStack item = list.remove(id);
if(asCard)
{
size--;
item = AlchemyRecipes.createCard(item, false);
}
return item;
}
@Override
public boolean canSwitchFrom(Modus modus)
{
return false;
}
@Override
public int getSize()
{
return size;
}
@Override
@SideOnly(Side.CLIENT)
public SylladexGuiHandler getGuiHandler()
{
if(gui == null)
gui = new SetGuiHandler(this);
return gui;
}
}
|
[
"kirderf4@gmail.com"
] |
kirderf4@gmail.com
|
bcb89fa7103addf083f6f1244eabeea0812a6fcb
|
a47333cea615e44b8f1254bde905bb10de160cca
|
/T/t-dal/src/main/java/com/zillionfortune/t/dal/dao/ScoreDao.java
|
1c1d585b5fb0023a54f78e92af8c1d858ea62300
|
[] |
no_license
|
zb-ty-system/qiyelicai
|
ce942faa27a84b7b12ed3e206da8fcaf14bf743d
|
765be984c988d17c03d59fba2a7702ba8b80e2da
|
refs/heads/master
| 2020-05-02T02:13:23.129269
| 2019-03-26T02:28:08
| 2019-03-26T02:28:08
| 177,699,797
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 549
|
java
|
package com.zillionfortune.t.dal.dao;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.zillionfortune.t.dal.entity.Score;
@Repository
public interface ScoreDao {
int deleteByPrimaryKey(Long id);
int insert(Score record);
int insertSelective(Score record);
Score selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(Score record);
int updateByPrimaryKey(Score record);
List<Score> selectByCriteria(Score record);
int updateByMemberIdSelective(Score record);
}
|
[
"kaiyun@zillionfortune.com"
] |
kaiyun@zillionfortune.com
|
ab8a11def825ffcbb1eaab1c84cb7d74dc7fb75d
|
4783239122c9958696655f7e446f2e74b9846f71
|
/src/main/java/ru/betterend/util/BonemealUtil.java
|
c604aaa40b410613e3b740c057c23a20375eff4e
|
[
"MIT"
] |
permissive
|
burned-salmon/BetterEnd
|
4ea80d53e987a9bb99426181bad719407b48bfa8
|
f7421bc055858af74a9693f20b0bf8e6b8f75b61
|
refs/heads/master
| 2023-07-06T11:09:28.541256
| 2021-01-18T17:09:13
| 2021-01-18T17:09:13
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,759
|
java
|
package ru.betterend.util;
import java.util.List;
import java.util.Map;
import java.util.Random;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import net.minecraft.block.Block;
import ru.betterend.registry.EndBlocks;
public class BonemealUtil {
private static final Map<Block, GrassList> GRASS_TYPES = Maps.newHashMap();
public static void init() {
addBonemealGrass(EndBlocks.END_MOSS, EndBlocks.CREEPING_MOSS);
addBonemealGrass(EndBlocks.END_MOSS, EndBlocks.UMBRELLA_MOSS);
addBonemealGrass(EndBlocks.END_MYCELIUM, EndBlocks.CREEPING_MOSS);
addBonemealGrass(EndBlocks.END_MYCELIUM, EndBlocks.UMBRELLA_MOSS);
addBonemealGrass(EndBlocks.CAVE_MOSS, EndBlocks.CAVE_GRASS);
addBonemealGrass(EndBlocks.CHORUS_NYLIUM, EndBlocks.CHORUS_GRASS);
addBonemealGrass(EndBlocks.CRYSTAL_MOSS, EndBlocks.CRYSTAL_GRASS);
addBonemealGrass(EndBlocks.SHADOW_GRASS, EndBlocks.SHADOW_PLANT);
addBonemealGrass(EndBlocks.PINK_MOSS, EndBlocks.BUSHY_GRASS);
addBonemealGrass(EndBlocks.AMBER_MOSS, EndBlocks.AMBER_GRASS);
addBonemealGrass(EndBlocks.JUNGLE_MOSS, EndBlocks.JUNGLE_GRASS);
addBonemealGrass(EndBlocks.JUNGLE_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS);
addBonemealGrass(EndBlocks.JUNGLE_MOSS, EndBlocks.SMALL_JELLYSHROOM, 0.1F);
}
public static void addBonemealGrass(Block terrain, Block plant) {
addBonemealGrass(terrain, plant, 1F);
}
public static void addBonemealGrass(Block terrain, Block plant, float chance) {
GrassList list = GRASS_TYPES.get(terrain);
if (list == null) {
list = new GrassList();
GRASS_TYPES.put(terrain, list);
}
list.addGrass(plant, chance);
}
public static Block getGrass(Block terrain, Random random) {
GrassList list = GRASS_TYPES.get(terrain);
return list == null ? null : list.getGrass(random);
}
private static final class GrassInfo {
final Block grass;
float chance;
public GrassInfo(Block grass, float chance) {
this.grass = grass;
this.chance = chance;
}
public float addChance(float chance) {
this.chance += chance;
return this.chance;
}
}
private static final class GrassList {
final List<GrassInfo> list = Lists.newArrayList();
float maxChance = 0;
public void addGrass(Block grass, float chance) {
GrassInfo info = new GrassInfo(grass, chance);
maxChance = info.addChance(maxChance);
list.add(info);
}
public Block getGrass(Random random) {
if (maxChance == 0 || list.isEmpty()) {
return null;
}
float chance = random.nextFloat() * maxChance;
for (GrassInfo info: list) {
if (chance <= info.chance) {
return info.grass;
}
}
return null;
}
}
}
|
[
"paulevs@yandex.ru"
] |
paulevs@yandex.ru
|
fe33f62d09a6dd34ad41edc09ebe0fd0fb56073b
|
236553b7cd6ad1a79a41d53cd41bd3f470ced6c6
|
/src/main/java/org/apache/ibatis/executor/resultset/ResultSetWrapper.java
|
92dbd5f04eb499250334d73396f2c65eb50698c5
|
[
"Apache-2.0",
"BSD-3-Clause"
] |
permissive
|
kongq1983/mybatis352
|
0d75815c551f1755b728a4c742313f5108d938d9
|
16ee87ad86963b2d8f5ac92b5b00bf089c11de20
|
refs/heads/master
| 2023-04-21T02:11:27.532051
| 2020-12-14T02:50:24
| 2020-12-14T02:50:24
| 297,322,471
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,472
|
java
|
/**
* Copyright 2009-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.ibatis.executor.resultset;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.mapping.ResultMap;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.ObjectTypeHandler;
import org.apache.ibatis.type.TypeHandler;
import org.apache.ibatis.type.TypeHandlerRegistry;
import org.apache.ibatis.type.UnknownTypeHandler;
/**
* @author Iwao AVE!
*/
public class ResultSetWrapper {
private final ResultSet resultSet;
private final TypeHandlerRegistry typeHandlerRegistry;
private final List<String> columnNames = new ArrayList<>();
private final List<String> classNames = new ArrayList<>();
private final List<JdbcType> jdbcTypes = new ArrayList<>();
private final Map<String, Map<Class<?>, TypeHandler<?>>> typeHandlerMap = new HashMap<>();
private final Map<String, List<String>> mappedColumnNamesMap = new HashMap<>();
private final Map<String, List<String>> unMappedColumnNamesMap = new HashMap<>();
public ResultSetWrapper(ResultSet rs, Configuration configuration) throws SQLException {
super();
this.typeHandlerRegistry = configuration.getTypeHandlerRegistry();
this.resultSet = rs;
final ResultSetMetaData metaData = rs.getMetaData();
final int columnCount = metaData.getColumnCount();
for (int i = 1; i <= columnCount; i++) {
columnNames.add(configuration.isUseColumnLabel() ? metaData.getColumnLabel(i) : metaData.getColumnName(i)); //获得sql语句的列名
jdbcTypes.add(JdbcType.forCode(metaData.getColumnType(i))); // 获得jdbc类型
classNames.add(metaData.getColumnClassName(i)); // 获得该字段的java类型
}
}
public ResultSet getResultSet() {
return resultSet;
}
public List<String> getColumnNames() {
return this.columnNames;
}
public List<String> getClassNames() {
return Collections.unmodifiableList(classNames);
}
public List<JdbcType> getJdbcTypes() {
return jdbcTypes;
}
public JdbcType getJdbcType(String columnName) {
for (int i = 0 ; i < columnNames.size(); i++) {
if (columnNames.get(i).equalsIgnoreCase(columnName)) {
return jdbcTypes.get(i);
}
}
return null;
}
/**
* Gets the type handler to use when reading the result set.
* Tries to get from the TypeHandlerRegistry by searching for the property type.
* If not found it gets the column JDBC type and tries to get a handler for it.
*
* @param propertyType
* @param columnName
* @return
*/
public TypeHandler<?> getTypeHandler(Class<?> propertyType, String columnName) {
TypeHandler<?> handler = null;
Map<Class<?>, TypeHandler<?>> columnHandlers = typeHandlerMap.get(columnName);
if (columnHandlers == null) {
columnHandlers = new HashMap<>();
typeHandlerMap.put(columnName, columnHandlers);
} else {
handler = columnHandlers.get(propertyType);
}
if (handler == null) {
JdbcType jdbcType = getJdbcType(columnName);
handler = typeHandlerRegistry.getTypeHandler(propertyType, jdbcType);
// Replicate logic of UnknownTypeHandler#resolveTypeHandler
// See issue #59 comment 10
if (handler == null || handler instanceof UnknownTypeHandler) {
final int index = columnNames.indexOf(columnName);
final Class<?> javaType = resolveClass(classNames.get(index));
if (javaType != null && jdbcType != null) {
handler = typeHandlerRegistry.getTypeHandler(javaType, jdbcType);
} else if (javaType != null) {
handler = typeHandlerRegistry.getTypeHandler(javaType);
} else if (jdbcType != null) {
handler = typeHandlerRegistry.getTypeHandler(jdbcType);
}
}
if (handler == null || handler instanceof UnknownTypeHandler) {
handler = new ObjectTypeHandler();
}
columnHandlers.put(propertyType, handler);
}
return handler;
}
private Class<?> resolveClass(String className) {
try {
// #699 className could be null
if (className != null) {
return Resources.classForName(className);
}
} catch (ClassNotFoundException e) {
// ignore
}
return null;
}
private void loadMappedAndUnmappedColumnNames(ResultMap resultMap, String columnPrefix) throws SQLException {
List<String> mappedColumnNames = new ArrayList<>();
List<String> unmappedColumnNames = new ArrayList<>();
final String upperColumnPrefix = columnPrefix == null ? null : columnPrefix.toUpperCase(Locale.ENGLISH);
final Set<String> mappedColumns = prependPrefixes(resultMap.getMappedColumns(), upperColumnPrefix);
for (String columnName : columnNames) {
final String upperColumnName = columnName.toUpperCase(Locale.ENGLISH);
if (mappedColumns.contains(upperColumnName)) {
mappedColumnNames.add(upperColumnName);
} else {
unmappedColumnNames.add(columnName);
}
}
mappedColumnNamesMap.put(getMapKey(resultMap, columnPrefix), mappedColumnNames);
unMappedColumnNamesMap.put(getMapKey(resultMap, columnPrefix), unmappedColumnNames);
}
public List<String> getMappedColumnNames(ResultMap resultMap, String columnPrefix) throws SQLException {
List<String> mappedColumnNames = mappedColumnNamesMap.get(getMapKey(resultMap, columnPrefix));
if (mappedColumnNames == null) {
loadMappedAndUnmappedColumnNames(resultMap, columnPrefix);
mappedColumnNames = mappedColumnNamesMap.get(getMapKey(resultMap, columnPrefix));
}
return mappedColumnNames;
}
public List<String> getUnmappedColumnNames(ResultMap resultMap, String columnPrefix) throws SQLException {
List<String> unMappedColumnNames = unMappedColumnNamesMap.get(getMapKey(resultMap, columnPrefix));
if (unMappedColumnNames == null) {
loadMappedAndUnmappedColumnNames(resultMap, columnPrefix);
unMappedColumnNames = unMappedColumnNamesMap.get(getMapKey(resultMap, columnPrefix));
}
return unMappedColumnNames;
}
private String getMapKey(ResultMap resultMap, String columnPrefix) {
return resultMap.getId() + ":" + columnPrefix;
}
private Set<String> prependPrefixes(Set<String> columnNames, String prefix) {
if (columnNames == null || columnNames.isEmpty() || prefix == null || prefix.length() == 0) {
return columnNames;
}
final Set<String> prefixed = new HashSet<>();
for (String columnName : columnNames) {
prefixed.add(prefix + columnName);
}
return prefixed;
}
}
|
[
"king@qq.com"
] |
king@qq.com
|
85246b9a9b4dd3ca7a66eec44c41c3ac52c8177b
|
20bb49c60f5c9c1290f08f9199c3ecca6146e9c3
|
/src/main/java/top/minecode/exception/NameExistedException.java
|
6cdde7f2b68bf2c9c7d2fb17910a79f33cce8f11
|
[] |
no_license
|
NJULighting/NaiveTag_Phase_II
|
9f805dda2b847942623b70ae28480f0c93e56818
|
44cd966690d89c9e7a509326f62d3fd29fde41cd
|
refs/heads/master
| 2020-03-20T21:55:57.767456
| 2018-05-07T09:36:12
| 2018-05-07T09:36:12
| 137,769,082
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 158
|
java
|
package top.minecode.exception;
/**
* Created on 2018/4/2.
* Description:
*
* @author iznauy
*/
public class NameExistedException extends Exception {
}
|
[
"zy05160516@126.com"
] |
zy05160516@126.com
|
842d8de483f9d01f656185fddd021e7debcb343f
|
f12ac48a1f34c0c7d12d4c12ffe7092323ad2c76
|
/jdk8-boot2-yidao620c-2018-xkcoding-2020@nice/ch3-biz/springboot-img-compress-thumbnailator@nice@todo/src/main/java/com/xncoding/pos/controller/UploadController.java
|
7f60a6cdd8b0f1788a555974f9df6953b3a54105
|
[
"MIT"
] |
permissive
|
mphz/summer-demo-springboot
|
8a3df406baa69eb8e5dabe76de3196618561dd3a
|
821075a97454f52b7f88532c7853fbab38be21ba
|
refs/heads/master
| 2023-01-25T00:54:41.754275
| 2020-11-22T05:30:54
| 2020-11-22T05:30:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,113
|
java
|
package com.xncoding.pos.controller;
import cn.hutool.core.date.DateUtil;
import net.coobird.thumbnailator.Thumbnails;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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 org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@Controller
@RequestMapping("/")
public class UploadController {
private static final Logger logger = LoggerFactory.getLogger(UploadController.class);
/**
* java 上传图片 并压缩图片大小
* https://www.cnblogs.com/miskis/p/5500822.html
*/
@RequestMapping(value = "/upload", method = RequestMethod.POST)
public String upload(@RequestParam("imgFile") MultipartFile imageFile) {
// 校验判断
if (imageFile == null) {
// return new BaseResult(false, "imageFile不能为空");
}
if (imageFile.getSize() >= 10 * 1024 * 1024) {
// return new BaseResult(false, "文件不能大于10M");
}
//拼接后台文件名称
String uuid = UUID.randomUUID().toString();
String fileDirectory = DateUtil.format(new Date(), "YYYY-MM-DD");
String pathName = fileDirectory + File.separator + uuid + "."
+ FilenameUtils.getExtension(imageFile.getOriginalFilename());
// 构建保存文件
String realPath = "d:/upload";
//获取服务器绝对路径 linux 服务器地址 获取当前使用的配置文件配置
String filePathName = realPath + File.separator + pathName;
logger.info("图片上传路径:" + filePathName);
// 判断文件保存是否存在
File file = new File(filePathName);
if (file.getParentFile() != null || !file.getParentFile().isDirectory()) {
file.getParentFile().mkdirs();
}
InputStream inputStream = null;
FileOutputStream fileOutputStream = null;
try {
inputStream = imageFile.getInputStream();
fileOutputStream = new FileOutputStream(file);
//写出文件
//2016-05-12 yangkang 改为增加缓存
// IOUtils.copy(inputStream, fileOutputStream);
byte[] buffer = new byte[2048];
IOUtils.copyLarge(inputStream, fileOutputStream, buffer);
buffer = null;
} catch (IOException e) {
filePathName = null;
// return new BaseResult(false, "操作失败", e.getMessage());
} finally {
try {
if (inputStream != null) {
inputStream.close();
}
if (fileOutputStream != null) {
fileOutputStream.flush();
fileOutputStream.close();
}
} catch (IOException e) {
filePathName = null;
// return new BaseResult(false, "操作失败", e.getMessage());
}
}
// 生成缩略图
String thumbnailPathName = fileDirectory + File.separator + uuid + "small."
+ FilenameUtils.getExtension(imageFile.getOriginalFilename());
if (thumbnailPathName.contains(".png")) {
thumbnailPathName = thumbnailPathName.replace(".png", ".jpg");
}
long size = imageFile.getSize();
double scale = 1.0d;
if (size >= 200 * 1024) {
if (size > 0) {
scale = (200 * 1024f) / size;
}
}
// 缩略图路径
String thumbnailFilePathName = realPath + File.separator + thumbnailPathName;
try {
//added by chenshun 2016-3-22 注释掉之前长宽的方式,改用大小
// Thumbnails.of(filePathName).size(width, height).toFile(thumbnailFilePathName);
if (size < 200 * 1024) {
Thumbnails.of(filePathName).scale(1f).outputFormat("jpg").toFile(thumbnailFilePathName);
} else {
Thumbnails.of(filePathName).scale(1f).outputQuality(scale).outputFormat("jpg").toFile(thumbnailFilePathName);
}
} catch (Exception e) {
// return new BaseResult(false, "操作失败", e1.getMessage());
}
/**
* 缩略图end
*/
Map<String, Object> map = new HashMap<String, Object>();
// 原图地址
map.put("originalUrl", pathName);
// 缩略图地址
map.put("thumbnailUrl", thumbnailPathName);
return map.toString();
}
@RequestMapping("/")
public String demo() {
return "index";
}
}
|
[
"1095847440@qq.com"
] |
1095847440@qq.com
|
e134714727135afc3aa818d68cb65b58420dc4cd
|
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
|
/crash-reproduction-new-fitness/results/MATH-70b-3-19-Single_Objective_GGA-WeightedSum-BasicBlockCoverage-opt/org/apache/commons/math/analysis/solvers/BisectionSolver_ESTest.java
|
9c5ea898afa8f3c614766bfe377e0f88cbe4baab
|
[
"MIT",
"CC-BY-4.0"
] |
permissive
|
STAMP-project/Botsing-basic-block-coverage-application
|
6c1095c6be945adc0be2b63bbec44f0014972793
|
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
|
refs/heads/master
| 2022-07-28T23:05:55.253779
| 2022-04-20T13:54:11
| 2022-04-20T13:54:11
| 285,771,370
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,159
|
java
|
/*
* This file was automatically generated by EvoSuite
* Tue Oct 26 10:19:10 UTC 2021
*/
package org.apache.commons.math.analysis.solvers;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.apache.commons.math.analysis.UnivariateRealFunction;
import org.apache.commons.math.analysis.solvers.BisectionSolver;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class BisectionSolver_ESTest extends BisectionSolver_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
BisectionSolver bisectionSolver0 = new BisectionSolver();
UnivariateRealFunction univariateRealFunction0 = mock(UnivariateRealFunction.class, new ViolatedAssumptionAnswer());
// Undeclared exception!
bisectionSolver0.solve(univariateRealFunction0, (-1009.0), 1.0, (-827.9565151036117));
}
}
|
[
"pderakhshanfar@serg2.ewi.tudelft.nl"
] |
pderakhshanfar@serg2.ewi.tudelft.nl
|
9a366d1df079629b247d2f50ae991b11f15f54b6
|
7fd1a21e414d96964ec86c8107bf25e210b40d34
|
/Bwagner/greenfoot/scenarios/Mario Climb - key/Ladder.java
|
6c7dbcdda8f1fe3afd68b618715cfefaff0342f7
|
[] |
no_license
|
HebronHS/HebronHS.github.io
|
7b58575003ad09931616c5f3de60b780244129a5
|
f6ae8a8887f821a501814f96f9ac4f02a3ecc355
|
refs/heads/master
| 2023-07-04T18:13:39.146975
| 2021-08-19T14:23:10
| 2021-08-19T14:23:10
| 305,490,650
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 480
|
java
|
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Ladder here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Ladder extends Actor
{
/**
* Act - do whatever the Ladder wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
// Add your action code here.
}
}
|
[
"sm10095178@localhost.localdomain"
] |
sm10095178@localhost.localdomain
|
7f781b824531c0613104bb75eabb4870dad63ea6
|
be608e227e7e385cd8e68bdfae4c79283ee88595
|
/service-claimisubmision/target/generated-sources/xjc/org/delta/b2b/edi/t837/SAMTCoordinationOfBenefitsCOBTotalNonCoveredAmount.java
|
f85112f1ec0a2d2012e5389222575cc17befadb2
|
[] |
no_license
|
msen2000/services
|
4867cdc3e2be12e9b5f54f2568e7c9844e91af25
|
cb84c48792aee88ab8533f407b8150430c5da2dd
|
refs/heads/master
| 2016-08-04T19:08:09.872078
| 2014-02-16T08:11:16
| 2014-02-16T08:11:16
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,863
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.5-b02-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: 2011.10.25 at 02:23:02 PM PDT
//
package org.delta.b2b.edi.t837;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlType;
/**
* To indicate the total monetary amount
*
* <p>Java class for S-AMT-Coordination_of_Benefits__COB__Total_Non-covered_Amount complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="S-AMT-Coordination_of_Benefits__COB__Total_Non-covered_Amount">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="E-AMT01-Amount_Qualifier_Code" type="{http://www.delta.org/b2b/edi/t837}E-AMT01-Amount_Qualifier_Code_3"/>
* <element name="E-AMT02-Monetary_Amount" type="{http://www.delta.org/b2b/edi/t837}E-AMT02-Monetary_Amount"/>
* <element name="E-AMT03-Credit_Debit_Flag_Code" type="{http://www.delta.org/b2b/edi/t837}E-AMT03-Credit_Debit_Flag_Code" minOccurs="0"/>
* </sequence>
* <attribute name="ID" type="{http://www.w3.org/2001/XMLSchema}string" default="AMT" />
* <attribute name="Name" type="{http://www.w3.org/2001/XMLSchema}string" default="Coordination of Benefits (COB) Total Non-covered Amount" />
* <attribute name="Type" type="{http://www.w3.org/2001/XMLSchema}string" default="Segment" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "S-AMT-Coordination_of_Benefits__COB__Total_Non-covered_Amount", propOrder = {
"eamt01AmountQualifierCode",
"eamt02MonetaryAmount",
"eamt03CreditDebitFlagCode"
})
public class SAMTCoordinationOfBenefitsCOBTotalNonCoveredAmount {
@XmlElement(name = "E-AMT01-Amount_Qualifier_Code", required = true)
protected EAMT01AmountQualifierCode3 eamt01AmountQualifierCode;
@XmlElement(name = "E-AMT02-Monetary_Amount", required = true)
protected EAMT02MonetaryAmount eamt02MonetaryAmount;
@XmlElementRef(name = "E-AMT03-Credit_Debit_Flag_Code", namespace = "http://www.delta.org/b2b/edi/t837", type = JAXBElement.class)
protected JAXBElement<EAMT03CreditDebitFlagCode> eamt03CreditDebitFlagCode;
@XmlAttribute(name = "ID")
protected String id;
@XmlAttribute(name = "Name")
protected String name;
@XmlAttribute(name = "Type")
protected String type;
/**
* Gets the value of the eamt01AmountQualifierCode property.
*
* @return
* possible object is
* {@link EAMT01AmountQualifierCode3 }
*
*/
public EAMT01AmountQualifierCode3 getEAMT01AmountQualifierCode() {
return eamt01AmountQualifierCode;
}
/**
* Sets the value of the eamt01AmountQualifierCode property.
*
* @param value
* allowed object is
* {@link EAMT01AmountQualifierCode3 }
*
*/
public void setEAMT01AmountQualifierCode(EAMT01AmountQualifierCode3 value) {
this.eamt01AmountQualifierCode = value;
}
/**
* Gets the value of the eamt02MonetaryAmount property.
*
* @return
* possible object is
* {@link EAMT02MonetaryAmount }
*
*/
public EAMT02MonetaryAmount getEAMT02MonetaryAmount() {
return eamt02MonetaryAmount;
}
/**
* Sets the value of the eamt02MonetaryAmount property.
*
* @param value
* allowed object is
* {@link EAMT02MonetaryAmount }
*
*/
public void setEAMT02MonetaryAmount(EAMT02MonetaryAmount value) {
this.eamt02MonetaryAmount = value;
}
/**
* Gets the value of the eamt03CreditDebitFlagCode property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link EAMT03CreditDebitFlagCode }{@code >}
*
*/
public JAXBElement<EAMT03CreditDebitFlagCode> getEAMT03CreditDebitFlagCode() {
return eamt03CreditDebitFlagCode;
}
/**
* Sets the value of the eamt03CreditDebitFlagCode property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link EAMT03CreditDebitFlagCode }{@code >}
*
*/
public void setEAMT03CreditDebitFlagCode(JAXBElement<EAMT03CreditDebitFlagCode> value) {
this.eamt03CreditDebitFlagCode = ((JAXBElement<EAMT03CreditDebitFlagCode> ) value);
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getID() {
if (id == null) {
return "AMT";
} else {
return id;
}
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setID(String value) {
this.id = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
if (name == null) {
return "Coordination of Benefits (COB) Total Non-covered Amount";
} else {
return name;
}
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the type property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getType() {
if (type == null) {
return "Segment";
} 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;
}
}
|
[
"msen2000@gmail.com"
] |
msen2000@gmail.com
|
3500d3fbcaa6c975cb37dcf84eb8cfa246466805
|
751ce96dd6e58dbd67c69f130b7fb4f0250e8a07
|
/private-class-data/src/test/java/com/iluwatar/AppTest.java
|
48818f5ad5f0cfa08c2dde02cea3dea5c3d8b63c
|
[
"MIT"
] |
permissive
|
grysh/java-design-patterns
|
d4886d7553c6d4be299019232c4b63ec006408b3
|
8656e954bdfe2caeead7d53b2ad4a87b3cfe677d
|
refs/heads/master
| 2021-01-20T17:23:32.266803
| 2015-05-24T10:00:32
| 2015-05-24T10:00:32
| 36,184,715
| 1
| 0
| null | 2015-05-24T17:47:31
| 2015-05-24T17:47:31
| null |
UTF-8
|
Java
| false
| false
| 158
|
java
|
package com.iluwatar;
import org.junit.Test;
public class AppTest {
@Test
public void test() {
String[] args = {};
App.main(args);
}
}
|
[
"iluwatar@gmail.com"
] |
iluwatar@gmail.com
|
98217ac547816659c364ad12f38ed73f144a219f
|
c11dfb8d82ae0660e3ef5b0a753562b1f72cf5e1
|
/fresco-2.5.0/imagepipeline-base/src/main/java/com/facebook/imagepipeline/cache/StagingAreaTest.java
|
e1be4d0676dd316d3ae308531e3bb2429fcde3e3
|
[
"MIT"
] |
permissive
|
Poomipat-Ch/Software-Architecture-and-Design-Fresco
|
8e7cad0b64fa1f7c5ae672da1bc6484d68639afb
|
fac688c6406738970780ef965c0fc2a13eacc600
|
refs/heads/main
| 2023-09-01T23:47:48.348929
| 2021-11-21T18:20:50
| 2021-11-21T18:20:50
| 430,391,642
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,490
|
java
|
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.imagepipeline.cache;
import com.facebook.cache.common.CacheKey;
import com.facebook.cache.common.SimpleCacheKey;
import com.facebook.common.memory.PooledByteBuffer;
import com.facebook.common.references.CloseableReference;
import com.facebook.imagepipeline.image.EncodedImage;
import org.junit.*;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
@RunWith(RobolectricTestRunner.class)
@Config(manifest = Config.NONE)
public class StagingAreaTest {
private StagingArea mStagingArea;
private com.facebook.common.references.CloseableReference<PooledByteBuffer> mCloseableReference;
private com.facebook.common.references.CloseableReference<PooledByteBuffer> mCloseableReference2;
private com.facebook.imagepipeline.image.EncodedImage mEncodedImage;
private com.facebook.imagepipeline.image.EncodedImage mSecondEncodedImage;
private com.facebook.cache.common.CacheKey mCacheKey;
@Before
public void setUp() {
mStagingArea = StagingArea.getInstance();
mCloseableReference = CloseableReference.of(mock(PooledByteBuffer.class));
mCloseableReference2 = CloseableReference.of(mock(PooledByteBuffer.class));
mEncodedImage = new EncodedImage(mCloseableReference);
mSecondEncodedImage = new EncodedImage(mCloseableReference2);
mCacheKey = new SimpleCacheKey("http://this.is/uri");
mStagingArea.put(mCacheKey, mEncodedImage);
}
@Test
public void testContains() {
assertTrue(mStagingArea.containsKey(mCacheKey));
assertFalse(mStagingArea.containsKey(new SimpleCacheKey("http://this.is.not.uri")));
}
@Test
public void testDoesntContainInvalid() {
mEncodedImage.close();
assertTrue(mStagingArea.containsKey(mCacheKey));
assertTrue(EncodedImage.isValid(mStagingArea.get(mCacheKey)));
}
@Test
public void testGetValue() {
assertSame(
mCloseableReference.getUnderlyingReferenceTestOnly(),
mStagingArea.get(mCacheKey).getByteBufferRef().getUnderlyingReferenceTestOnly());
}
@Test
public void testBumpsRefCountOnGet() {
mStagingArea.get(mCacheKey);
assertEquals(4, mCloseableReference.getUnderlyingReferenceTestOnly().getRefCountTestOnly());
}
@Test
public void testAnotherPut() {
mStagingArea.put(mCacheKey, mSecondEncodedImage);
assertEquals(2, mCloseableReference.getUnderlyingReferenceTestOnly().getRefCountTestOnly());
assertSame(
mCloseableReference2.getUnderlyingReferenceTestOnly(),
mStagingArea.get(mCacheKey).getByteBufferRef().getUnderlyingReferenceTestOnly());
}
@Test
public void testSamePut() {
assertEquals(3, mCloseableReference.getUnderlyingReferenceTestOnly().getRefCountTestOnly());
mStagingArea.put(mCacheKey, mEncodedImage);
assertEquals(3, mCloseableReference.getUnderlyingReferenceTestOnly().getRefCountTestOnly());
assertSame(
mCloseableReference.getUnderlyingReferenceTestOnly(),
mStagingArea.get(mCacheKey).getByteBufferRef().getUnderlyingReferenceTestOnly());
}
@Test
public void testRemove() {
assertTrue(mStagingArea.remove(mCacheKey, mEncodedImage));
assertEquals(2, mCloseableReference.getUnderlyingReferenceTestOnly().getRefCountTestOnly());
assertFalse(mStagingArea.remove(mCacheKey, mEncodedImage));
}
@Test
public void testRemoveWithBadRef() {
assertFalse(mStagingArea.remove(mCacheKey, mSecondEncodedImage));
assertTrue(CloseableReference.isValid(mCloseableReference));
assertTrue(CloseableReference.isValid(mCloseableReference2));
}
@Test
public void testRemoveWithoutValueCheck() {
assertTrue(mStagingArea.remove(mCacheKey));
assertEquals(2, mCloseableReference.getUnderlyingReferenceTestOnly().getRefCountTestOnly());
assertFalse(mStagingArea.remove(mCacheKey));
}
@Test
public void testClearAll() {
mStagingArea.put(new SimpleCacheKey("second"), mSecondEncodedImage);
mStagingArea.clearAll();
assertEquals(2, mCloseableReference.getUnderlyingReferenceTestOnly().getRefCountTestOnly());
assertEquals(2, mCloseableReference2.getUnderlyingReferenceTestOnly().getRefCountTestOnly());
assertFalse(mStagingArea.remove(mCacheKey));
}
}
|
[
"poomipat002@gmail.com"
] |
poomipat002@gmail.com
|
e012281fd2acda938bfde4ac907de34fcb6fe4ae
|
d3eefa5d9c4be591a13ce46b4631feec6e8d9fda
|
/20200217_1/practice/src/NET/udp_server.java
|
99a50d4b4ec6f72a2fff652e1a78d54c2b3289fe
|
[] |
no_license
|
zxq19970820/code
|
3fb7b8013c5b42a4ee752433b3506e7f3f00f5a7
|
9238dac8b8a09e4d457ef310bc3e30e5cfaed32e
|
refs/heads/master
| 2023-01-18T17:59:39.609751
| 2020-11-18T05:47:15
| 2020-11-18T05:47:15
| 313,832,991
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 991
|
java
|
package NET;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
public class udp_server {
public static void main(String[] args) throws IOException {
System.out.println("接收端启动");
DatagramSocket ds = new DatagramSocket(14752);
while (true) {
byte[] by = new byte[1024];
DatagramPacket dp = new DatagramPacket(by, by.length);
ds.receive(dp);
String ip = dp.getAddress().getHostAddress(); //ip地址
int port = dp.getPort(); //端口号
int num=dp.getLength();
String data = new String(dp.getData(), 0, num); //内容
System.out.println(ip);
System.out.println(port);
System.out.println(data);
// System.out.println("--------分割线--------");
// System.out.println("接收端关闭");
// ds.close();
}
}
}
|
[
"1415990264@qq.com"
] |
1415990264@qq.com
|
b8d7cefe77ade91ec008e7b1bb7f68e468c26dc7
|
9bc2e16bd25461ee4fa641aafb268b5029f9b0e2
|
/autotest.report.excel/src/main/java/com/surenpi/autotest/report/excel/writer/ExcelReportWriter.java
|
0ea918ef70de5998a704cb603c2d795b798ff902
|
[] |
no_license
|
sergueik/selenium_java
|
775432bb23f418893551d73d82acd210bf07e43c
|
18eca29cd2e87b4e0bdf9f450e7608aae97b8e8d
|
refs/heads/master
| 2023-08-31T21:56:41.765828
| 2023-08-28T23:14:28
| 2023-08-28T23:14:28
| 40,056,997
| 25
| 14
| null | 2023-02-22T08:44:35
| 2015-08-01T19:00:35
|
Java
|
UTF-8
|
Java
| false
| false
| 3,775
|
java
|
/*
*
* * Copyright 2002-2007 the original author or authors.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * 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.surenpi.autotest.report.excel.writer;
import java.io.File;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.annotation.PreDestroy;
import org.modelmapper.ModelMapper;
import com.surenpi.autotest.report.RecordReportWriter;
import com.surenpi.autotest.report.ReportStatus;
import com.surenpi.autotest.report.excel.model.ExcelReport;
import com.surenpi.autotest.report.excel.util.ExcelUtils;
import com.surenpi.autotest.report.record.ExceptionRecord;
import com.surenpi.autotest.report.record.NormalRecord;
import com.surenpi.autotest.report.record.ProjectRecord;
import com.surenpi.autotest.report.util.DateUtils;
/**
* Excel格式报告导出
* @author suren
*/
public class ExcelReportWriter implements RecordReportWriter
{
private ExcelUtils utils;
private ProjectRecord projectRecord;
@Override
public void write(ExceptionRecord record)
{
NormalRecord normalRecord = record.getNormalRecord();
ModelMapper mapper = new ModelMapper();
ExcelReport excelReport = mapper.map(normalRecord, ExcelReport.class);
excelReport.setDetail(record.getStackTraceText());
fillReport(normalRecord, ReportStatus.EXCEPTION, excelReport);
utils.export(excelReport);
}
@Override
public void write(NormalRecord normalRecord)
{
ExcelReport excelReport = new ModelMapper().map(normalRecord, ExcelReport.class);
fillReport(normalRecord, ReportStatus.NORMAL, excelReport);
utils.export(excelReport);
}
/**
* 填充公共数据
* @param normalRecord
* @param reportStatus
* @param excelReport
*/
private void fillReport(NormalRecord normalRecord, ReportStatus reportStatus, ExcelReport excelReport)
{
excelReport.setStatus(reportStatus.name());
excelReport.setBeginTime(DateUtils.getDateText(normalRecord.getBeginTime()));
excelReport.setEndTime(DateUtils.getDateText(normalRecord.getEndTime()));
excelReport.setTotalTime(((normalRecord.getEndTime() - normalRecord.getBeginTime()) / 1000) + "秒");
}
@Override
public void write(ProjectRecord projectRecord)
{
utils = new ExcelUtils(
new File(projectRecord.getName() + "-" + System.currentTimeMillis() + ".xls"));
utils.init();
this.projectRecord = projectRecord;
}
/**
* 保存文件
*/
@PreDestroy
public void saveFile()
{
Map<String,String> info = new LinkedHashMap<String, String>();
info.put("测试流程", projectRecord.getName());
info.put("IP", projectRecord.getAddressInfo());
info.put("操作系统", projectRecord.getOsName() + "-"
+ projectRecord.getOsArch() + "-"
+ projectRecord.getOsVersion());
info.put("项目地址", "https://github.com/LinuxSuRen/phoenix.webui.framework");
if(projectRecord.getUserInfo() != null)
{
info.putAll(projectRecord.getUserInfo());
}
utils.fillStaticInfo(info, "环境信息");
utils.save();
}
}
|
[
"kouzmine_serguei@yahoo.com"
] |
kouzmine_serguei@yahoo.com
|
aa0b1776ca343b79c5839be2dd6ab3229c658284
|
ca6ed1b41ccc5d8ac491aaa077c9974f443d8c94
|
/mall-geteway/src/test/java/com/yp/mallgeteway/MallGetewayApplicationTests.java
|
17212a8387f475f2c6c09df362cfdab30fdf7a8a
|
[] |
no_license
|
yanping1/guli-mall
|
2b7996f6f5477c315ac7ad8ef8076913d3081fe9
|
60a0a6d9283f29bb1c0295639497ef76a9ed8f46
|
refs/heads/master
| 2023-07-01T12:56:57.413042
| 2021-08-06T09:26:23
| 2021-08-06T09:26:23
| 388,312,493
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 224
|
java
|
package com.yp.mallgeteway;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class MallGetewayApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"1822117257@qq.com"
] |
1822117257@qq.com
|
ad921a780b7aae3c6c3065647bb68bffd30a82a3
|
87cb582539377c162ca3cd2d38d15740293f0966
|
/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/MapSqlParameterSource.java
|
f57b60017ca32395854acaaf13ef032869660ffa
|
[
"Apache-2.0"
] |
permissive
|
TACHAI/study_spring_source
|
37723b9d63c303063f4cb72f28dd36984f96593b
|
ca59f2e922aaebe0de4fd5dea112dbe6daa5bfe9
|
refs/heads/master
| 2022-11-07T15:39:02.557035
| 2020-06-17T13:08:17
| 2020-06-17T13:08:17
| 272,933,657
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,642
|
java
|
/*
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.springframework.jdbc.core.namedparam;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import org.springframework.jdbc.core.SqlParameterValue;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* {@link SqlParameterSource} implementation that holds a given Map of parameters.
*
* <p>This class is intended for passing in a simple Map of parameter values
* to the methods of the {@link NamedParameterJdbcTemplate} class.
*
* <p>The {@code addValue} methods on this class will make adding several values
* easier. The methods return a reference to the {@link MapSqlParameterSource}
* itself, so you can chain several method calls together within a single statement.
*
* @author Thomas Risberg
* @author Juergen Hoeller
* @since 2.0
* @see #addValue(String, Object)
* @see #addValue(String, Object, int)
* @see #registerSqlType
* @see NamedParameterJdbcTemplate
*/
public class MapSqlParameterSource extends AbstractSqlParameterSource {
private final Map<String, Object> values = new LinkedHashMap<>();
/**
* Create an empty MapSqlParameterSource,
* with values to be added via {@code addValue}.
* @see #addValue(String, Object)
*/
public MapSqlParameterSource() {
}
/**
* Create a new MapSqlParameterSource, with one value
* comprised of the supplied arguments.
* @param paramName the name of the parameter
* @param value the value of the parameter
* @see #addValue(String, Object)
*/
public MapSqlParameterSource(String paramName, Object value) {
addValue(paramName, value);
}
/**
* Create a new MapSqlParameterSource based on a Map.
* @param values a Map holding existing parameter values (can be {@code null})
*/
public MapSqlParameterSource(@Nullable Map<String, ?> values) {
addValues(values);
}
/**
* Add a parameter to this parameter source.
* @param paramName the name of the parameter
* @param value the value of the parameter
* @return a reference to this parameter source,
* so it's possible to chain several calls together
*/
public MapSqlParameterSource addValue(String paramName, Object value) {
Assert.notNull(paramName, "Parameter name must not be null");
this.values.put(paramName, value);
if (value instanceof SqlParameterValue) {
registerSqlType(paramName, ((SqlParameterValue) value).getSqlType());
}
return this;
}
/**
* Add a parameter to this parameter source.
* @param paramName the name of the parameter
* @param value the value of the parameter
* @param sqlType the SQL type of the parameter
* @return a reference to this parameter source,
* so it's possible to chain several calls together
*/
public MapSqlParameterSource addValue(String paramName, Object value, int sqlType) {
Assert.notNull(paramName, "Parameter name must not be null");
this.values.put(paramName, value);
registerSqlType(paramName, sqlType);
return this;
}
/**
* Add a parameter to this parameter source.
* @param paramName the name of the parameter
* @param value the value of the parameter
* @param sqlType the SQL type of the parameter
* @param typeName the type name of the parameter
* @return a reference to this parameter source,
* so it's possible to chain several calls together
*/
public MapSqlParameterSource addValue(String paramName, Object value, int sqlType, String typeName) {
Assert.notNull(paramName, "Parameter name must not be null");
this.values.put(paramName, value);
registerSqlType(paramName, sqlType);
registerTypeName(paramName, typeName);
return this;
}
/**
* Add a Map of parameters to this parameter source.
* @param values a Map holding existing parameter values (can be {@code null})
* @return a reference to this parameter source,
* so it's possible to chain several calls together
*/
public MapSqlParameterSource addValues(@Nullable Map<String, ?> values) {
if (values != null) {
values.forEach((key, value) -> {
this.values.put(key, value);
if (value instanceof SqlParameterValue) {
registerSqlType(key, ((SqlParameterValue) value).getSqlType());
}
});
}
return this;
}
/**
* Expose the current parameter values as read-only Map.
*/
public Map<String, Object> getValues() {
return Collections.unmodifiableMap(this.values);
}
@Override
public boolean hasValue(String paramName) {
return this.values.containsKey(paramName);
}
@Override
@Nullable
public Object getValue(String paramName) {
if (!hasValue(paramName)) {
throw new IllegalArgumentException("No value registered for key '" + paramName + "'");
}
return this.values.get(paramName);
}
@Override
@Nullable
public String[] getParameterNames() {
return StringUtils.toStringArray(this.values.keySet());
}
}
|
[
"1206966083@qq.com"
] |
1206966083@qq.com
|
5d86545ffa5c34866e04160d99a57d7d0cc533f7
|
33b2f42275f3e02db4a5afdb31593952ce195d28
|
/src/main/java/com/sissi/server/exchange/ExchangerContext.java
|
02b0d377e346353614076011afd7117b66974a5c
|
[
"Apache-2.0"
] |
permissive
|
xintao222/sissi
|
6c41d8aac0c6c0d843ba504ecfed3f99a62a536f
|
1b2da0676ba54596d2e9a8b3f09038b46d04190d
|
refs/heads/master
| 2020-12-06T19:15:54.396294
| 2014-04-11T11:10:05
| 2014-04-11T11:10:05
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 300
|
java
|
package com.sissi.server.exchange;
import com.sissi.write.Transfer;
/**
* @author kim 2013年12月22日
*/
public interface ExchangerContext {
public Exchanger join(String host, boolean induct, Transfer transfer);
public Exchanger active(String host);
public boolean exists(String host);
}
|
[
"sjw_job@126.com"
] |
sjw_job@126.com
|
3167b2c46061951c35742a91fcc4fbfadab229ea
|
96d06bfbeff740f661e7ef409183f348f551a414
|
/myjetty/myjetty-server/src/main/java/io/leopard/myjetty/LoggerConstant.java
|
c85406ecbc4c4645a5c96fab960231dc848809d8
|
[
"Apache-2.0"
] |
permissive
|
cuidd2018/leopard
|
135648152202f00b405af1f0039f3dd95ee1689c
|
bcc6c394d5a7246384c666f94ac3c5e494e777a3
|
refs/heads/master
| 2021-09-22T11:11:37.093267
| 2018-09-09T05:24:19
| 2018-09-09T05:24:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 366
|
java
|
package io.leopard.myjetty;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class LoggerConstant {
public static Log getJettyLogger(Class<?> clazz) {
// return Log4jUtil.getLogger("JETTYLOG." + clazz.getName(), Level.DEBUG, "/data2/log/resin/jetty.log", false);
return LogFactory.getLog(clazz);
}
}
|
[
"tanhaichao@gmail.com"
] |
tanhaichao@gmail.com
|
1c476339ed56220f5dc7cf0bea20f25754ef4f29
|
4e721c6f4651c27ba1e8f4358d9086b458f2962a
|
/spring-cloud-contract-wiremock/src/main/java/org/springframework/cloud/contract/wiremock/JettyFaultInjectorFactory.java
|
00ebaa6c3bd2b0bd38eeeed08c2190e2f941d1a8
|
[
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] |
permissive
|
WhyINeedToFillUsername/spring-cloud-contract
|
1a3f08402d3e9b6d5eb1c103c1d3988846622b66
|
5381ef8447d1dfc4439c7415874ab79e10961854
|
refs/heads/master
| 2021-01-20T21:32:09.605070
| 2017-08-29T13:40:30
| 2017-08-29T13:40:30
| 101,644,996
| 0
| 0
| null | 2017-08-28T13:17:52
| 2017-08-28T13:17:52
| null |
UTF-8
|
Java
| false
| false
| 1,202
|
java
|
/*
* Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.springframework.cloud.contract.wiremock;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.github.tomakehurst.wiremock.core.FaultInjector;
import com.github.tomakehurst.wiremock.servlet.FaultInjectorFactory;
/**
* @author Dave Syer
*
*/
public class JettyFaultInjectorFactory implements FaultInjectorFactory {
@Override
public FaultInjector buildFaultInjector(HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {
return new JettyFaultInjector(httpServletResponse);
}
}
|
[
"dsyer@pivotal.io"
] |
dsyer@pivotal.io
|
82395c3a7454ca6f5c385331019e95b8c613fb6f
|
4f12d12ed3e9809eff54e58eb23f62e0a953153a
|
/gp_java/src/main/java/com/jeffheaton/dissertation/experiments/payloads/ExperimentPayload.java
|
99ec5c20a30180d8dac4dea54c16c67d3aa05506
|
[] |
no_license
|
solversa/phd-dissertation
|
e5fd1aacfc6614025b072daff9affa26c906b20a
|
9041a907da3c1b62a67ce847b284f9528480076d
|
refs/heads/master
| 2022-02-22T03:49:30.565294
| 2017-04-21T15:29:15
| 2017-04-21T15:29:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 386
|
java
|
package com.jeffheaton.dissertation.experiments.payloads;
import com.jeffheaton.dissertation.experiments.manager.ExperimentTask;
import org.encog.ml.data.MLDataSet;
public interface ExperimentPayload {
boolean isVerbose();
void setVerbose(boolean theVerbose);
PayloadReport run(ExperimentTask task);
MLDataSet obtainCommonProcessing(ExperimentTask task);
}
|
[
"jeff@jeffheaton.com"
] |
jeff@jeffheaton.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.