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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cba5e6a2de766753d267f3e61e3b8dc5b1b7a8bc | e75be673baeeddee986ece49ef6e1c718a8e7a5d | /submissions/blizzard/Corpus/eclipse.jdt.core/5550.java | 4bf77ce464b7f67458dee1311aed866869c7fda4 | [
"MIT"
] | permissive | zhendong2050/fse18 | edbea132be9122b57e272a20c20fae2bb949e63e | f0f016140489961c9e3c2e837577f698c2d4cf44 | refs/heads/master | 2020-12-21T11:31:53.800358 | 2018-07-23T10:10:57 | 2018-07-23T10:10:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 179 | java | package b6;
/* Test case for bug 10386 NPE in MatchLocator.lookupType */
public class A {
int[] field;
int foo() {
return this.field.length;
}
}
| [
"tim.menzies@gmail.com"
] | tim.menzies@gmail.com |
12fe673b7fa06373650d03b8e43d2051b9c21471 | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/google/android/exoplayer2/h/f.java | 79234b2fd541f6d0fd5a94becfd33e25b0559a63 | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 505 | java | package com.google.android.exoplayer2.h;
import android.net.Uri;
public abstract interface f
{
public abstract long a(i parami);
public abstract void close();
public abstract Uri getUri();
public abstract int read(byte[] paramArrayOfByte, int paramInt1, int paramInt2);
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes-dex2jar.jar
* Qualified Name: com.google.android.exoplayer2.h.f
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
d18852cd99e9280ebc724fe135f087f82324df3c | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project412/src/test/java/org/gradle/test/performance/largejavamultiproject/project412/p2063/Test41278.java | b6df8d5fe1e383027aa9a1367da88c9bb08edaab | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,182 | java | package org.gradle.test.performance.largejavamultiproject.project412.p2063;
import org.junit.Test;
import static org.junit.Assert.*;
public class Test41278 {
Production41278 objectUnderTest = new Production41278();
@Test
public void testProperty0() {
Production41269 value = new Production41269();
objectUnderTest.setProperty0(value);
assertEquals(value, objectUnderTest.getProperty0());
}
@Test
public void testProperty1() {
Production41273 value = new Production41273();
objectUnderTest.setProperty1(value);
assertEquals(value, objectUnderTest.getProperty1());
}
@Test
public void testProperty2() {
Production41277 value = new Production41277();
objectUnderTest.setProperty2(value);
assertEquals(value, objectUnderTest.getProperty2());
}
@Test
public void testProperty3() {
String value = "value";
objectUnderTest.setProperty3(value);
assertEquals(value, objectUnderTest.getProperty3());
}
@Test
public void testProperty4() {
String value = "value";
objectUnderTest.setProperty4(value);
assertEquals(value, objectUnderTest.getProperty4());
}
@Test
public void testProperty5() {
String value = "value";
objectUnderTest.setProperty5(value);
assertEquals(value, objectUnderTest.getProperty5());
}
@Test
public void testProperty6() {
String value = "value";
objectUnderTest.setProperty6(value);
assertEquals(value, objectUnderTest.getProperty6());
}
@Test
public void testProperty7() {
String value = "value";
objectUnderTest.setProperty7(value);
assertEquals(value, objectUnderTest.getProperty7());
}
@Test
public void testProperty8() {
String value = "value";
objectUnderTest.setProperty8(value);
assertEquals(value, objectUnderTest.getProperty8());
}
@Test
public void testProperty9() {
String value = "value";
objectUnderTest.setProperty9(value);
assertEquals(value, objectUnderTest.getProperty9());
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
0cf16dc2f6447c99a246906069e4fd1949e0af98 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Lang/65/org/apache/commons/lang/mutable/MutableInt_getValue_70.java | 6c8e256fe724c9a65101469c67f51a8e21910d71 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 410 | java |
org apach common lang mutabl
mutabl code code wrapper
integ
version
mutabl int mutableint number compar mutabl
integ instanc
integ
object getvalu
integ
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
4f6f9dcd1f71faeef99f9c2efef6b13f7d4dc0ae | 16bacd6ef5d524c9c0fe99f32f2d2403d43b3aec | /instrument-modules/user-modules/module-elasticsearch/src/main/java/com/pamirs/attach/plugin/es/common/impl/SyncedFlushRequestIndexRename.java | 78b94fbde5b293bde5d1145560ec57a774cf8f22 | [
"Apache-2.0"
] | permissive | shulieTech/LinkAgent | cbcc9717d07ea636e791ebafe84aced9b03730e8 | 73fb7cd6d86fdce5ad08f0623c367b407e405d76 | refs/heads/main | 2023-09-02T11:21:57.784204 | 2023-08-31T07:02:01 | 2023-08-31T07:02:01 | 362,708,051 | 156 | 112 | Apache-2.0 | 2023-09-13T02:24:11 | 2021-04-29T06:05:47 | Java | UTF-8 | Java | false | false | 2,125 | java | /**
* Copyright 2021 Shulie Technology, Co.Ltd
* Email: shulie@shulie.io
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.pamirs.attach.plugin.es.common.impl;
import com.pamirs.pradar.Pradar;
import com.pamirs.pradar.pressurement.agent.shared.service.GlobalConfig;
import org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* @Description
* @Author xiaobin.zfb
* @mail xiaobin@shulie.io
* @Date 2020/7/13 6:07 下午
*/
public class SyncedFlushRequestIndexRename extends AbstractReadRequestIndexRename {
@Override
public String getName() {
return "syncedFlush";
}
@Override
public List<String> reindex0(Object target) {
SyncedFlushRequest req = (SyncedFlushRequest) target;
String[] indexes = req.indices();
for (int i = 0, len = indexes.length; i < len; i++) {
String index = indexes[i];
/**
* 如果在白名单中则不允许写
*/
if (GlobalConfig.getInstance().getSearchWhiteList().contains(indexes)) {
continue;
}
if (!Pradar.isClusterTestPrefix(index)) {
index = Pradar.addClusterTestPrefixLower(index);
indexes[i] = index;
}
}
req.indices(indexes);
return Arrays.asList(indexes);
}
@Override
public List<String> getIndex0(Object target) {
SyncedFlushRequest req = (SyncedFlushRequest) target;
return (req.indices() == null || req.indices().length == 0) ? Collections.EMPTY_LIST : Arrays.asList(req.indices());
}
}
| [
"jirenhe@shulie.io"
] | jirenhe@shulie.io |
a722caef17c9f311505edfcc36908f2aef0878fd | 3b9cf2936abe0bb4d5507853a79d98f2d91af870 | /vividus-plugin-web-app/src/test/java/org/vividus/ui/web/action/NavigateActionsTests.java | 732755186711883f018d6865d61c1d020d3ef451 | [
"Apache-2.0"
] | permissive | ALegchilov/vividus | ef8a4906efb0c2ff68fd624fde4d2e6d743bae9b | 55bce7d2a7bcf5c43f17d34eb2c190dd6142f552 | refs/heads/master | 2020-09-08T16:50:21.014816 | 2019-11-12T10:40:45 | 2019-11-15T10:10:52 | 221,188,634 | 0 | 0 | Apache-2.0 | 2019-11-12T10:15:40 | 2019-11-12T10:15:39 | null | UTF-8 | Java | false | false | 5,599 | java | /*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.vividus.ui.web.action;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.net.URI;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriver.Navigation;
import org.vividus.selenium.IWebDriverProvider;
import org.vividus.softassert.ISoftAssert;
@ExtendWith(MockitoExtension.class)
class NavigateActionsTests
{
private static final String SCRIPT_WINDOW_STOP = "window.stop()";
private static final String URL_STR = "http://somewhere.com/page";
private static final URI URL = URI.create(URL_STR);
private static final long WAIT_MILLS = 5;
@Mock
private IWebDriverProvider webDriverProvider;
@Mock
private WebDriver webDriver;
@Mock
private Navigation navigation;
@Mock
private IWaitActions waitActions;
@Mock
private ISoftAssert softAssert;
@Mock
private IJavascriptActions javascriptActions;
@InjectMocks
private NavigateActions navigateActions;
@Test
void testNavigateTo()
{
when(webDriver.navigate()).thenReturn(navigation);
when(webDriverProvider.get()).thenReturn(webDriver);
navigateActions.navigateTo(URL_STR);
verify(navigation).to(URL_STR);
}
@Test
void testNavigateToByUri()
{
when(webDriver.navigate()).thenReturn(navigation);
when(webDriverProvider.get()).thenReturn(webDriver);
navigateActions.navigateTo(URL);
verify(navigation).to(URL_STR);
}
@Test
void testNavigateToTimeoutException()
{
when(webDriver.navigate()).thenReturn(navigation);
when(webDriverProvider.get()).thenReturn(webDriver);
TimeoutException exception = mock(TimeoutException.class);
doThrow(exception).when(navigation).to(URL_STR);
navigateActions.navigateTo(URL_STR);
verify(softAssert).recordFailedAssertion(exception);
verify(javascriptActions).executeScript(SCRIPT_WINDOW_STOP);
}
@Test
void testRefresh()
{
when(webDriver.navigate()).thenReturn(navigation);
when(webDriverProvider.get()).thenReturn(webDriver);
navigateActions.refresh();
verify(navigation).refresh();
verify(waitActions).waitForPageLoad();
}
@Test
void testRefreshTimeoutException()
{
when(webDriver.navigate()).thenReturn(navigation);
when(webDriverProvider.get()).thenReturn(webDriver);
TimeoutException exception = mock(TimeoutException.class);
doThrow(exception).when(navigation).refresh();
navigateActions.refresh();
verify(softAssert).recordFailedAssertion(exception);
verify(javascriptActions).executeScript(SCRIPT_WINDOW_STOP);
}
@Test
void testRefreshWithWebDriver()
{
when(webDriver.navigate()).thenReturn(navigation);
navigateActions.refresh(webDriver);
verify(webDriverProvider, never()).get();
verify(navigation).refresh();
verify(waitActions).waitForPageLoad();
}
@Test
void testBack()
{
when(webDriver.navigate()).thenReturn(navigation);
when(webDriverProvider.get()).thenReturn(webDriver);
navigateActions.back();
verify(navigation).back();
verify(waitActions).waitForPageLoad();
}
@Test
void testBackWithPreviousUrl()
{
when(webDriver.navigate()).thenReturn(navigation);
String defaultUrl = URL_STR + "/previous";
when(webDriverProvider.get()).thenReturn(webDriver);
when(webDriver.getCurrentUrl()).thenReturn(URL_STR).thenReturn(URL_STR);
navigateActions.back(defaultUrl);
verify(navigation).to(defaultUrl);
}
@Test
void testBackWithPreviousUrlEqualToCurrent()
{
when(webDriverProvider.get()).thenReturn(webDriver);
when(webDriver.getCurrentUrl()).thenReturn(URL_STR);
navigateActions.back(URL_STR);
verify(navigation, never()).to(URL_STR);
}
@Test
void testLoadPage()
{
when(webDriver.navigate()).thenReturn(navigation);
String url = "http://somewhere.com";
when(webDriverProvider.get()).thenReturn(webDriver);
Mockito.doAnswer(invocation ->
{
Thread.sleep(WAIT_MILLS);
return null;
}).when(navigation).to(url);
navigateActions.loadPage(url);
assertThat(navigateActions.getActualPageLoadTimeInMs(), Matchers.greaterThanOrEqualTo(WAIT_MILLS));
}
}
| [
"valfirst@yandex.ru"
] | valfirst@yandex.ru |
5da489e355104d0517957d743a8962a8ac97386d | 245f4c11504dc9ab1fba7fb4711f3ce7d56bfe1d | /java/src/main/java/chouc/java/thread/model01/UserThread.java | f1bd309a669be8bdc76d37fb74980684433fabd8 | [] | no_license | choucmei/learning | 58c00690f8b687e1d0370815f7a1a3c98b3bb4fe | 131f925bcefd5a2f247276e95f47de6391b1b5b6 | refs/heads/master | 2023-04-29T14:04:01.226143 | 2023-02-09T05:57:19 | 2023-02-09T05:57:19 | 200,195,543 | 3 | 1 | null | 2023-04-21T20:48:40 | 2019-08-02T08:19:53 | Java | UTF-8 | Java | false | false | 638 | java | package chouc.java.thread.model01;
/**
* @author chouc
* @version V1.0
* @Title: UserThread
* @Package chouc.java.thread.review.example01
* @Description:
* @date 1/9/20
*/
public class UserThread extends Thread {
private final Gate gate;
private final String myname;
private final String myaddress;
public UserThread(Gate gate, String myname, String myaddress) {
this.gate = gate;
this.myname = myname;
this.myaddress = myaddress;
}
public void run() {
System.out.println(myname + " BEGIN");
while (true) {
gate.pass(myname, myaddress);
}
}
} | [
"chouc.mei@gmail.com"
] | chouc.mei@gmail.com |
cffc989443b413258c3ff6744f1212ebec7bc1d9 | 868373281b856f1a7265670d3828ee70779dbb9d | /backend-dscatalog_Docker_File/src/main/java/pt/amane/dscatalog/repositories/RoleRepository.java | 188505d6a9dfc8450c929d475fa0643b62d68968 | [] | no_license | manoansu/dscatalog-deploy-aws-app | 0c64eb336ecd0e2c47fd17c8ea935afd505aac44 | 46827db1aafe31b46987ced8e16425e76c32059d | refs/heads/master | 2023-09-04T02:43:13.586729 | 2021-10-31T11:55:56 | 2021-10-31T11:55:56 | 422,663,984 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 279 | java | package pt.amane.dscatalog.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import pt.amane.dscatalog.entities.Role;
@Repository
public interface RoleRepository extends JpaRepository<Role, Long>{
}
| [
"manoansu@gmail.com"
] | manoansu@gmail.com |
3588c756f649c48515f8b458e2028b45309845af | 23e29b3faca0a2c6260bbd01698ea9e7f252d256 | /app/src/main/java/com/android/fitz/fastreading/injector/module/ApplicationModule.java | a61d0667f62a84c349dd0d0936f0982bed89c9f4 | [] | no_license | zq019633/fast | 14d2288b227c40d03bc1fe2103a093332d594251 | 4223804459b93104f44f87785db836961e945a83 | refs/heads/master | 2020-09-28T04:18:04.122174 | 2019-12-08T15:08:38 | 2019-12-08T15:08:38 | 226,685,846 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,033 | java | package com.android.fitz.fastreading.injector.module;
import android.app.Application;
import android.content.Context;
import com.android.library.util.AppUtils;
import com.android.library.util.EncryptUtils;
import com.android.library.util.ObjectUtils;
import com.android.library.util.PreferencesUtils;
import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import com.android.fitz.fastreading.base.AppApplication;
import com.android.fitz.fastreading.base.RetrofitService;
import com.android.fitz.fastreading.constant.AppConfig;
import com.android.fitz.fastreading.constant.Preferences;
import com.android.fitz.fastreading.injector.ContextLife;
import java.io.IOException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Iterator;
import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
import javax.inject.Named;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import okhttp3.FormBody;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Author: ljo_h
* Date: 2016/6/28
* Description:
*/
@Module
public class
ApplicationModule {
AppApplication mApplication;
public ApplicationModule(AppApplication application) {
mApplication = application;
}
@Provides
@Singleton
@ContextLife("Application")
public Context provideContext() {
return mApplication.getApplicationContext();
}
@Provides
@Singleton
RetrofitService provideRetrofitService(){
//手动创建一个OkHttpClient并设置超时时间
OkHttpClient.Builder httpClientBuilder = new OkHttpClient.Builder();
if(AppConfig.DEBUG) {
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
httpClientBuilder.addInterceptor(logging);
}
httpClientBuilder.connectTimeout(2, TimeUnit.MINUTES);
//String baseUrl = "https://api.github.com";
//String baseUrl = "http://121.40.30.66:9038";
//String baseUrl = "http://192.168.1.63:8886";
Retrofit retrofit = new Retrofit.Builder()
.client(httpClientBuilder.build())
.baseUrl(AppConfig.HTTP_URL)
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build();
return retrofit.create(RetrofitService.class);
}
@Provides
@Named("UserID")
String provideUserID(){
return PreferencesUtils.getString(mApplication.getApplicationContext(), Preferences.USERID);
}
@Provides
@Named("TokenID")
String provideTokenID(){
return PreferencesUtils.getString(mApplication.getApplicationContext(), Preferences.TAKENID);
}
}
| [
"1020498110@qq.com"
] | 1020498110@qq.com |
acd7cc3f823b7819eab6ee8fbfb1067df2d6e9bf | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/26/26_efc1785bc6f5510de1b90825997023fe1fe8abaf/Util/26_efc1785bc6f5510de1b90825997023fe1fe8abaf_Util_t.java | c146bf451f14d61958ae14e2df7fde589572b700 | [] | 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 | 838 | java | package edu.cmu.cs.diamond.opendiamond;
public class Util {
// XXX endian specific
public static int extractInt(byte[] value) {
return (value[3] & 0xFF) << 24 | (value[2] & 0xFF) << 16
| (value[1] & 0xFF) << 8 | (value[0] & 0xFF);
}
public static long extractLong(byte[] value) {
return ((long) (value[7] & 0xFF) << 56)
| ((long) (value[6] & 0xFF) << 48)
| ((long) (value[5] & 0xFF) << 40)
| ((long) (value[4] & 0xFF) << 32)
| ((long) (value[3] & 0xFF) << 24)
| ((long) (value[2] & 0xFF) << 16)
| ((long) (value[1] & 0xFF) << 8) | (value[0] & 0xFF);
}
public static double extractDouble(byte[] value) {
return Double.longBitsToDouble(extractLong(value));
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
895bf46ab261a762f50586e0ab31a51640c04b76 | dbe59da45f4cee95debb721141aeab16f44b4cac | /src/main/java/com/syuesoft/st/dao/BasPartsTypeDAO.java | 0f0902d1b58fb887359b5c226dbb437b31f31f69 | [] | no_license | tonyliu830204/UESoft | 5a8a546107f2093ee920facf6d93eedd1affd248 | 9dd48ff19f40556d1892688f6426e4bfe68c7d10 | refs/heads/master | 2021-01-23T15:51:00.782632 | 2014-03-26T15:56:46 | 2014-03-26T15:56:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 653 | java | package com.syuesoft.st.dao;
import com.syuesoft.bas.dao.BaseDaoI;
import com.syuesoft.model.BasPartsType;
import com.syuesoft.util.Json;
/**
* 配件型号DAO接口
* @author SuMing
*/
public interface BasPartsTypeDAO extends BaseDaoI<BasPartsType> {
/**配件型号信息 预加载*/
public Json loadPartsType(final int page, final int rows, final String sort,final String order,final int enterprise_id)throws Exception;
/**配件型号信息 综合查询*/
public Json searchPartsTypeByCondition(final String ptypeId,final String ptypeName,final int enterprise_id)throws Exception;
/** 根据配件品牌获取配件型号*/
} | [
"liweinan0423@gmail.com"
] | liweinan0423@gmail.com |
4508996c2369edbe4a9e82f940c7b06738f92c07 | 5bfa069cf394595d25ddb331b8cd701acf37eeb3 | /app/src/main/java/fi/polar/polarflow/ui/exeview/laps/b_package/d.java | 21aeca93f42cc40fbc0aa2920ed87ecd68225ce4 | [] | no_license | skorotkov/reversed | 747d36a44314e2bf3ebee0607152a0873b191ca5 | 3f5222de57befe8a54fd1d07462492f3a605efdd | refs/heads/master | 2020-03-27T23:45:35.198114 | 2018-09-04T14:11:47 | 2018-09-04T14:11:47 | 147,343,931 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,592 | java | package fi.polar.polarflow.ui.exeview.laps.b_package;
import fi.polar.polarflow.data.SportProfileSettings;
import fi.polar.polarflow.ui.exeview.a_package.a_package.bj;
import java.util.ArrayList;
import java.util.List;
public class d {
static List a(SportProfileSettings var0, boolean var1) {
int var2 = 0;
boolean var3;
boolean var4;
if (var0 != null) {
var3 = var0.isSensorEnabled(4);
var4 = var0.isSwimmingSport();
} else {
var4 = false;
var3 = false;
}
List var5 = a(var3, var1, var4);
ArrayList var6;
for(var6 = new ArrayList(); var2 < var5.size(); ++var2) {
fi.polar.polarflow.ui.exeview.laps.b_package.a_package.a var7 = new fi.polar.polarflow.ui.exeview.laps.b_package.a_package.a();
var7.a(var2);
var7.b((Integer)var5.get(var2));
var7.a(bj.a);
var6.add(var7.a());
}
return var6;
}
private static List a(boolean var0, boolean var1, boolean var2) {
ArrayList var3 = new ArrayList();
if (var2) {
if (var1) {
var3.add(7);
} else {
var3.add(6);
}
var3.add(38);
var3.add(44);
} else if (var0) {
if (var1) {
var3.add(7);
} else {
var3.add(6);
}
var3.add(44);
var3.add(24);
} else {
if (var1) {
var3.add(7);
} else {
var3.add(6);
}
var3.add(25);
var3.add(24);
}
return var3;
}
}
| [
"sergey.korotkov@prowidelabs.com"
] | sergey.korotkov@prowidelabs.com |
43bbf2e646de8386dfb2c27527ab4443f111c562 | ac1768b715e9fe56be8b340bc1e4bc7f917c094a | /ant_tasks/tags/release/11.02.x/11.02.1/common/source/java/ch/systemsx/cisd/common/compression/tiff/TiffCpCompressionMethod.java | c9ddf4163ec56ddc4888f48f8af99ac817405496 | [
"Apache-2.0"
] | permissive | kykrueger/openbis | 2c4d72cb4b150a2854df4edfef325f79ca429c94 | 1b589a9656d95e343a3747c86014fa6c9d299b8d | refs/heads/master | 2023-05-11T23:03:57.567608 | 2021-05-21T11:54:58 | 2021-05-21T11:54:58 | 364,558,858 | 0 | 0 | Apache-2.0 | 2021-06-04T10:08:32 | 2021-05-05T11:48:20 | Java | UTF-8 | Java | false | false | 3,228 | java | /*
* Copyright 2008 ETH Zuerich, CISD
*
* 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 ch.systemsx.cisd.common.compression.tiff;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import ch.systemsx.cisd.base.utilities.OSUtilities;
import ch.systemsx.cisd.common.fileconverter.TiffCompressionStrategy;
import ch.systemsx.cisd.common.logging.LogInitializer;
/**
* A compression method for TIFF files using the <code>tiffcp</code> utility with specified
* compression type parameter (by default: <code>lzw:2</code>).
*
* @deprecated Use {@link TiffCompressionStrategy} instead.
* @author Piotr Buczek
*/
@Deprecated
public class TiffCpCompressionMethod extends AbstractTiffCompressionMethod
{
private final static String executableName = "tiffcp";
private final static File executable = OSUtilities.findExecutable(executableName);
private final static String DEFAULT_COMPRESSION_TYPE = "lzw:2";
/**
* @returns compression method using specified compression type
* @param compressionTypeOrNull compression type to use (if <code>null</code> default
* compression type will be used)
*/
public static TiffCpCompressionMethod create(String compressionTypeOrNull)
{
return compressionTypeOrNull == null ? new TiffCpCompressionMethod()
: new TiffCpCompressionMethod(compressionTypeOrNull);
}
/** Constructs compression method using default compression type. */
private TiffCpCompressionMethod()
{
this(DEFAULT_COMPRESSION_TYPE);
}
/** Constructs compression method using specified <var>compressonType</var>. */
private TiffCpCompressionMethod(String compressionType)
{
super(compressionType);
}
@Override
protected List<String> createCommandLine(File fileToCompress, File inProgressFile)
{
assert executable != null;
assert fileToCompress != null;
assert fileToCompress.isFile();
assert inProgressFile != null;
assert inProgressFile.exists() == false;
final List<String> parameters =
Arrays.asList(executable.getAbsolutePath(), "-c", getCompressionType(),
fileToCompress.getAbsolutePath(), inProgressFile.getAbsolutePath());
return parameters;
}
public static void main(String[] args)
{
LogInitializer.init();
final TiffCpCompressionMethod compressor = new TiffCpCompressionMethod();
compressor.check();
}
@Override
protected File getExecutable()
{
return executable;
}
@Override
protected String getExecutableName()
{
return executableName;
}
}
| [
"fedoreno"
] | fedoreno |
682833a16e2243f46e2c21e2468249dd6b762347 | 732ac04a2f64fb72c16408b8b980260ad806a74d | /src/org/omg/PortableServer/ServantLocatorOperations.java | c7446dd245ccdc63d76446872cc04ee2e848abc7 | [
"Apache-2.0"
] | permissive | Golde-nchow/jdk1.8-source-analysis | bb45a4d659ab02de37422b2fefbf452712de3b9e | e30ab95df7f147c261cc2f0c5723b6c530197ad2 | refs/heads/master | 2022-07-03T01:29:57.438319 | 2022-06-12T14:20:25 | 2022-06-12T14:20:25 | 210,581,079 | 0 | 0 | Apache-2.0 | 2019-09-24T11:00:27 | 2019-09-24T11:00:26 | null | UTF-8 | Java | false | false | 3,079 | java | package org.omg.PortableServer;
/**
* org/omg/PortableServer/ServantLocatorOperations.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u151/9699/corba/src/share/classes/org/omg/PortableServer/poa.idl
* Tuesday, September 5, 2017 7:35:46 PM PDT
*/
/**
* When the POA has the NON_RETAIN policy it uses servant
* managers that are ServantLocators. Because the POA
* knows that the servant returned by this servant
* manager will be used only for a single request,
* it can supply extra information to the servant
* manager's operations and the servant manager's pair
* of operations may be able to cooperate to do
* something different than a ServantActivator.
* When the POA uses the ServantLocator interface,
* immediately after performing the operation invocation
* on the servant returned by preinvoke, the POA will
* invoke postinvoke on the servant manager, passing the
* ObjectId value and the Servant value as parameters
* (among others). This feature may be used to force
* every request for objects associated with a POA to
* be mediated by the servant manager.
*/
public interface ServantLocatorOperations extends org.omg.PortableServer.ServantManagerOperations
{
/**
* This operations is used to get a servant that will be
* used to process the request that caused preinvoke to
* be called.
* @param oid the object id associated with object on
* which the request was made.
* @param adapter the reference for POA in which the
* object is being activated.
* @param operation the operation name.
* @param the_cookie an opaque value that can be set
* by the servant manager to be used
* during postinvoke.
* @return Servant used to process incoming request.
* @exception ForwardRequest to indicate to the ORB
* that it is responsible for delivering
* the current request and subsequent
* requests to the object denoted in the
* forward_reference member of the exception.
*/
org.omg.PortableServer.Servant preinvoke (byte[] oid, org.omg.PortableServer.POA adapter, String operation, org.omg.PortableServer.ServantLocatorPackage.CookieHolder the_cookie) throws org.omg.PortableServer.ForwardRequest;
/**
* This operation is invoked whenener a servant completes
* a request.
* @param oid the object id ssociated with object on which
* the request was made.
* @param adapter the reference for POA in which the
* object was active.
* @param the_cookie an opaque value that contains
* the data set by preinvoke.
* @param the_servant reference to the servant that is
* associated with the object.
*/
void postinvoke (byte[] oid, org.omg.PortableServer.POA adapter, String operation, java.lang.Object the_cookie, org.omg.PortableServer.Servant the_servant);
} // interface ServantLocatorOperations
| [
"793514387@qq.com"
] | 793514387@qq.com |
9d898f5aa5b04551f48e3eec4a47eec9cac92e5f | 377e5e05fb9c6c8ed90ad9980565c00605f2542b | /bin/ext-accelerator/acceleratorservices/src/de/hybris/platform/acceleratorservices/payment/strategies/impl/DefaultFraudCallbackStrategy.java | 6fb6fd2dcfba1d212287e904e61e405eb939e80d | [] | no_license | automaticinfotech/HybrisProject | c22b13db7863e1e80ccc29774f43e5c32e41e519 | fc12e2890c569e45b97974d2f20a8cbe92b6d97f | refs/heads/master | 2021-07-20T18:41:04.727081 | 2017-10-30T13:24:11 | 2017-10-30T13:24:11 | 108,957,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 946 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 SAP SE or an SAP affiliate company.
* All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package de.hybris.platform.acceleratorservices.payment.strategies.impl;
import de.hybris.platform.acceleratorservices.payment.strategies.FraudCallbackStrategy;
import java.util.Map;
import org.apache.log4j.Logger;
public class DefaultFraudCallbackStrategy implements FraudCallbackStrategy
{
private static final Logger LOG = Logger.getLogger(DefaultFraudCallbackStrategy.class);
@Override
public void handleFraudCallback(final Map<String, String> parameters)
{
LOG.warn("An empty implementation of fraudulent transaction handling called.");
}
}
| [
"santosh.kshirsagar@automaticinfotech.com"
] | santosh.kshirsagar@automaticinfotech.com |
bf6f9576ca6b34e145315846ad174e48ddd771d9 | 7ac7180c84f1fc54e07d0051ee35296d43c7831a | /src/main/java/com/runoob/mediator/User.java | 029e1cc717511833f7f990eed097c8ebaf63a03f | [] | no_license | dengbin19910916/design-pattern | 2fab3dbd0b3cdf85e419a2b72054cdef428c5b54 | 93aef9bbc1eb544cb52cbbb82c8defedc8bebe08 | refs/heads/master | 2021-04-09T11:01:17.946893 | 2018-03-16T23:36:33 | 2018-03-16T23:36:33 | 125,484,049 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 257 | java | package com.runoob.mediator;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class User {
private String name;
public void sendMessage(String message) {
ChatRoom.showMessage(this, message);
}
}
| [
"dengbin19910916@163.com"
] | dengbin19910916@163.com |
1c7158ce875a7e535d4cbb34bfd79d2b49e146b7 | c85c460e7c7410e66aec5d2b1c5b44467a320d58 | /src/test/java/com/alibaba/druid/bvt/sql/mysql/CobarHintsTest.java | 3105692f4bfc236f60cd09ef322d8b6849ac6a43 | [] | no_license | Pengxiaolong/druid | f51900708114a34872b79a397a254344f066bb54 | cc6956c7df7c2037d8d2169cea068444b20f7d5d | refs/heads/master | 2020-12-25T17:03:11.640854 | 2012-08-18T14:28:42 | 2012-08-18T14:28:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,166 | java | package com.alibaba.druid.bvt.sql.mysql;
import junit.framework.TestCase;
import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils;
import com.alibaba.druid.util.JdbcUtils;
public class CobarHintsTest extends TestCase {
public void test_0 () throws Exception {
String sql = "/*!cobar: select,4,ireport.dm_mdm_mem_prod_noeff_sdt0.admin_member_seq=45654723*/ " +
"select product_id, noeff_days,total_cnt from (" +
"select product_id," +
" noeff_days," +
" count(*) over() as total_cnt " +
" from ( " +
" select product_id," +
" noeff_days " +
" from ireport.dm_mdm_mem_prod_noeff_sdt0" +
" where admin_member_seq = 45654723" +
") b Order by product_id desc ) a limit 25 offset (1-1)*20";
String mergedSql = ParameterizedOutputVisitorUtils.parameterize(sql, JdbcUtils.POSTGRESQL);
System.out.println(mergedSql);
}
}
| [
"szujobs@hotmail.com"
] | szujobs@hotmail.com |
1d2898e7e3d0d26f422ccade3794f85a6d36cd85 | 770392e45192a15327f594f61685360cb91162fb | /src/main/java/com/example/appwspro/security/AuthorizationFilter.java | bd77c7ccbb9a925e12fd76be297bc70b39982da5 | [] | no_license | ValeriyEmelyanov/app-ws-pro | a206f7fa74d7362c03fa261f96baa773b6dbd917 | 9106c764c2b3723be584c481fa78f4d9a9ed48c3 | refs/heads/master | 2022-06-23T12:27:25.985468 | 2020-01-13T18:28:48 | 2020-01-13T18:28:48 | 199,335,698 | 0 | 0 | null | 2022-06-21T01:35:47 | 2019-07-28T20:48:29 | Java | UTF-8 | Java | false | false | 2,203 | java | package com.example.appwspro.security;
import io.jsonwebtoken.Jwts;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
public class AuthorizationFilter extends BasicAuthenticationFilter {
public AuthorizationFilter(AuthenticationManager authenticationManager) {
super(authenticationManager);
}
@Override
protected void doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain chain) throws IOException, ServletException {
String header = request.getHeader(SecurityConstants.HEADER_STRING);
if (header == null || !header.startsWith(SecurityConstants.TOKEN_PREFIX)) {
chain.doFilter(request, response);
return;
}
UsernamePasswordAuthenticationToken authentication = getAuthentication(request);
SecurityContextHolder.getContext().setAuthentication(authentication);
chain.doFilter(request, response);
}
private UsernamePasswordAuthenticationToken getAuthentication(HttpServletRequest request) {
String token = request.getHeader(SecurityConstants.HEADER_STRING);
if (token != null) {
token = token.replace(SecurityConstants.TOKEN_PREFIX, "");
String user = Jwts.parser()
.setSigningKey(SecurityConstants.getTokenSecret())
.parseClaimsJws(token)
.getBody()
.getSubject();
if (user != null) {
return new UsernamePasswordAuthenticationToken(user, null, new ArrayList<>());
}
return null;
}
return null;
}
}
| [
"emelva@rambler.ru"
] | emelva@rambler.ru |
8795dc0cb107eb700cfb54eba8dcf1e2e2daeaad | 3a92132d74b183a9b77ca9c78bdf6e80c68a99e8 | /WebApps/ServerII/src/com/dimdim/conference/action/common/GetNewUUID.java | 43955ad00cd3c1ee3f93f3db11dcb93676ebbf74 | [] | no_license | holdensmagicalunicorn/DimSim | d2ee09dd586b03e365bd673fd474d2934277ee90 | 4fbc916bd6e79fc91fc32614a7d83ffc6e41b421 | refs/heads/master | 2021-01-17T08:38:23.350840 | 2011-08-28T21:52:17 | 2011-08-28T21:52:17 | 2,285,304 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,118 | java | /*
**************************************************************************
* *
* DDDDD iii DDDDD iii *
* DD DD mm mm mmmm DD DD mm mm mmmm *
* DD DD iii mmm mm mm DD DD iii mmm mm mm *
* DD DD iii mmm mm mm DD DD iii mmm mm mm *
* DDDDDD iii mmm mm mm DDDDDD iii mmm mm mm *
* *
**************************************************************************
**************************************************************************
* *
* Part of the DimDim V 1.0 Codebase (http://www.dimdim.com) *
* *
* Copyright (c) 2006 Communiva Inc. All Rights Reserved. *
* *
* *
* This code is licensed under the DimDim License *
* For details please visit http://www.dimdim.com/license *
* *
**************************************************************************
*/
package com.dimdim.conference.action.common;
import java.util.UUID;
import com.dimdim.conference.action.CommonDimDimAction;
public class GetNewUUID extends CommonDimDimAction
{
protected String jsonBuffer = "{a:\"b\"}";
public String execute() throws Exception
{
String uuid = UUID.randomUUID().toString();
// jsonBuffer = "{uuid:\""+uuid+"\" }";
jsonBuffer = uuid;
System.out.println(" New UUID:"+jsonBuffer);
return SUCCESS;
}
public String getJsonBuffer()
{
return jsonBuffer;
}
public void setJsonBuffer(String jsonBuffer)
{
this.jsonBuffer = jsonBuffer;
}
}
| [
"mattwilmott@gmail.com"
] | mattwilmott@gmail.com |
986e76fd7e9415d00b50d8f8de0a1b58d82bbd45 | fbc78e5eef0ec352ff501359f47cf3664239d9ea | /Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSymbolContainerImpl.java | 373abcb58f8646e60e72d4271f11d3b5ef1d7877 | [
"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 | AYIDouble/ghidra | a6b218b823bf475ac010a82840bf99e09dfc14e5 | 3066bc941ce89a66e8dced1f558cc352a6f38fdd | refs/heads/master | 2022-05-27T04:09:13.440867 | 2022-04-30T23:25:27 | 2022-04-30T23:25:27 | 203,525,745 | 20 | 2 | Apache-2.0 | 2019-08-21T07:02:35 | 2019-08-21T06:58:25 | Java | UTF-8 | Java | false | false | 3,029 | java | /* ###
* IP: GHIDRA
*
* 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 agent.frida.model.impl;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import agent.frida.manager.FridaSymbol;
import agent.frida.model.iface2.FridaModelTargetSymbolContainer;
import agent.frida.model.methods.*;
import ghidra.dbg.target.TargetObject;
import ghidra.dbg.target.schema.TargetAttributeType;
import ghidra.dbg.target.schema.TargetElementType;
import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode;
import ghidra.dbg.target.schema.TargetObjectSchemaInfo;
@TargetObjectSchemaInfo(
name = "SymbolContainer",
elements = {
@TargetElementType(type = FridaModelTargetSymbolImpl.class) },
elementResync = ResyncMode.ONCE,
attributes = {
@TargetAttributeType(type = Object.class) },
canonicalContainer = true)
public class FridaModelTargetSymbolContainerImpl extends FridaModelTargetObjectImpl
implements FridaModelTargetSymbolContainer {
protected final FridaModelTargetModuleImpl module;
private FridaModelTargetSymbolFromAddressImpl fromAddr;
private FridaModelTargetSymbolFromNameImpl fromName;
private FridaModelTargetSymbolLoadImpl load;
public FridaModelTargetSymbolContainerImpl(FridaModelTargetModuleImpl module) {
super(module.getModel(), module, "Symbols", "SymbolContainer");
this.module = module;
this.fromAddr = new FridaModelTargetSymbolFromAddressImpl(this);
this.fromName = new FridaModelTargetSymbolFromNameImpl(this);
this.load = new FridaModelTargetSymbolLoadImpl(this);
this.changeAttributes(List.of(), List.of( //
fromAddr, //
fromName, //
load //
), Map.of(), "Initialized");
}
@Override
public CompletableFuture<Void> requestElements(boolean refresh) {
return getManager().listModuleSymbols(module.getModule()).thenAccept(byName -> {
List<TargetObject> symbols;
synchronized (this) {
symbols = byName.values()
.stream()
.map(this::getTargetSymbol)
.collect(Collectors.toList());
}
setElements(symbols, Map.of(), "Refreshed");
});
}
@Override
public synchronized FridaModelTargetSymbolImpl getTargetSymbol(FridaSymbol symbol) {
TargetObject targetObject = getMapObject(symbol);
if (targetObject != null) {
FridaModelTargetSymbolImpl targetSymbol = (FridaModelTargetSymbolImpl) targetObject;
targetSymbol.setModelObject(symbol);
return targetSymbol;
}
return new FridaModelTargetSymbolImpl(this, symbol);
}
}
| [
"ryanmkurtz@users.noreply.github.com"
] | ryanmkurtz@users.noreply.github.com |
47e4616214b358d9e9be4f2bb37bf51d60097803 | d66c28f374d74fea8d3f72c5319df32717db0261 | /FirstPOC/src/com/test/poc/basic/Combination1.java | 01b7ed105009742bc40e2a9d7cde62998c22a202 | [] | no_license | ppuja1994/POCs | cecd58cd4b37a5e82938b08fd74e289b96a45f41 | 7c6465e4d9e26cac5f1861ff937987a66a93755a | refs/heads/master | 2020-07-14T01:44:45.352979 | 2016-09-06T09:00:52 | 2016-09-06T09:00:52 | 67,487,836 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 801 | java | package com.test.poc.basic;
public class Combination1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int i, j, k, x;
for (i = 5; i >= 1; i--) {
for (j = 5; j > i; j--) {
System.out.print(" ");
}
for (k = 1; k <= i; k++) {
System.out.print("*");
}
// System.out.println();
for (j = 1; j < i; j++) {
System.out.print("*");
}
System.out.println();
}
for (i = 5, x = 1; i >= 1; i--, x++) {
for (j = 1; j <= i - 1; j++) {
System.out.print(" ");
}
for (k = 5; k >= i; k--) {
System.out.print("*");
}
// for(i=1;i<=6;i++){
for (j = 1; j < x; j++) {
System.out.print("*");
}
// System.out.println();
// }
System.out.println();
}
}
}
| [
"user@user-PC"
] | user@user-PC |
9108f8f32b78c03a0aeecf5c60f7a7cdef911455 | ed166738e5dec46078b90f7cca13a3c19a1fd04b | /minor/guice-OOM-error-reproduction/src/main/java/gen/D_Gen89.java | d8fe906ce4654acbb82290590b3f154d6958d93f | [] | no_license | michalradziwon/script | 39efc1db45237b95288fe580357e81d6f9f84107 | 1fd5f191621d9da3daccb147d247d1323fb92429 | refs/heads/master | 2021-01-21T21:47:16.432732 | 2016-03-23T02:41:50 | 2016-03-23T02:41:50 | 22,663,317 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java |
package gen;
public class D_Gen89 {
@com.google.inject.Inject
public D_Gen89(D_Gen90 d_gen90){
System.out.println(this.getClass().getCanonicalName() + " created. " + d_gen90 );
}
@com.google.inject.Inject public void injectInterfaceWithoutImpl(gen.InterfaceWithoutImpl i){} // should expolode :)
}
| [
"michal.radzi.won@gmail.com"
] | michal.radzi.won@gmail.com |
a520918359306a229b82c910401e1e862c81e085 | 5ec06dab1409d790496ce082dacb321392b32fe9 | /clients/java-undertow-server/generated/src/main/java/org/openapitools/model/OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo.java | 2ef5a98cdc8c4121f102e4c84978f5018b5d6582 | [
"Apache-2.0"
] | permissive | shinesolutions/swagger-aem-osgi | e9d2385f44bee70e5bbdc0d577e99a9f2525266f | c2f6e076971d2592c1cbd3f70695c679e807396b | refs/heads/master | 2022-10-29T13:07:40.422092 | 2021-04-09T07:46:03 | 2021-04-09T07:46:03 | 190,217,155 | 3 | 3 | Apache-2.0 | 2022-10-05T03:26:20 | 2019-06-04T14:23:28 | null | UTF-8 | Java | false | false | 3,998 | java | package org.openapitools.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserProperties;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen", date = "2019-08-05T00:56:20.785Z[GMT]")
public class OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo {
private String pid = null;
private String title = null;
private String description = null;
private OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserProperties properties = null;
/**
**/
public OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo pid(String pid) {
this.pid = pid;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("pid")
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
/**
**/
public OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo title(String title) {
this.title = title;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("title")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
/**
**/
public OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo description(String description) {
this.description = description;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("description")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
/**
**/
public OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo properties(OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserProperties properties) {
this.properties = properties;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("properties")
public OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserProperties getProperties() {
return properties;
}
public void setProperties(OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserProperties properties) {
this.properties = properties;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo orgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo = (OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo) o;
return Objects.equals(pid, orgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo.pid) &&
Objects.equals(title, orgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo.title) &&
Objects.equals(description, orgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo.description) &&
Objects.equals(properties, orgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo.properties);
}
@Override
public int hashCode() {
return Objects.hash(pid, title, description, properties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OrgApacheSlingCommonsHtmlInternalTagsoupHtmlParserInfo {\n");
sb.append(" pid: ").append(toIndentedString(pid)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"cliffano@gmail.com"
] | cliffano@gmail.com |
39a0e398b9a5d4c23d4aa39da8b53452ac9ffdd4 | bf81ae2cad6a39e6edae58894550ef03f3ad5dcb | /src/main/java/com/sdt/kid/auth/JwtAuthentication.java | b8fb4a6f7338c9ffad075f8db58a73d596f122c7 | [] | no_license | kisdy502/kid | 21c04e1e7d3ecbbef90644085d14eaa0fecea5ca | 6b11f5c62214a28c3e6d78a7cc4fa28d601ba327 | refs/heads/master | 2020-07-05T17:32:23.246514 | 2019-09-21T03:44:49 | 2019-09-21T03:44:49 | 202,714,032 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,537 | java | package com.sdt.kid.auth;
import com.sdt.kid.bean.User;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
import static java.util.Collections.emptyList;
public class JwtAuthentication implements Authentication {
private String token;
private User user;
private Map<String, Object> details;
public JwtAuthentication(User user, String token, Map<String, Object> details) {
this.token = token;
this.user = user;
this.details = details;
}
public Optional<User> user() {
return Optional.ofNullable(user);
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return emptyList();
}
@Override
public Object getCredentials() {
return token;
}
@Override
public Object getDetails() {
return details;
}
@Override
public Object getPrincipal() {
return user;
}
@Override
public boolean isAuthenticated() {
return user != null && user.getName() != null && user.getMobile() != null;
}
@Override
public void setAuthenticated(boolean b) throws IllegalArgumentException {
if (!isAuthenticated()) {
user = null;
}
}
@Override
public String getName() {
return user.getName();
}
@Override
public String toString() {
return token;
}
}
| [
"bwply2009@163.com"
] | bwply2009@163.com |
d1e3e13a365ba63e9be0ccf913bcb250eec1b38a | dfd7e70936b123ee98e8a2d34ef41e4260ec3ade | /analysis/reverse-engineering/decompile-fitts-20191031-2200/sources/androidx/appcompat/widget/TintContextWrapper.java | 9a0375a86c882c4f0daef76081611f0337779786 | [
"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 | 3,534 | java | package androidx.appcompat.widget;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.content.res.Resources.Theme;
import android.os.Build.VERSION;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
@RestrictTo({Scope.LIBRARY_GROUP})
public class TintContextWrapper extends ContextWrapper {
private static final Object CACHE_LOCK = new Object();
private static ArrayList<WeakReference<TintContextWrapper>> sCache;
private final Resources mResources;
private final Theme mTheme;
public static Context wrap(@NonNull Context context) {
if (!shouldWrap(context)) {
return context;
}
synchronized (CACHE_LOCK) {
if (sCache == null) {
sCache = new ArrayList<>();
} else {
for (int size = sCache.size() - 1; size >= 0; size--) {
WeakReference weakReference = (WeakReference) sCache.get(size);
if (weakReference == null || weakReference.get() == null) {
sCache.remove(size);
}
}
for (int size2 = sCache.size() - 1; size2 >= 0; size2--) {
WeakReference weakReference2 = (WeakReference) sCache.get(size2);
TintContextWrapper tintContextWrapper = weakReference2 != null ? (TintContextWrapper) weakReference2.get() : null;
if (tintContextWrapper != null && tintContextWrapper.getBaseContext() == context) {
return tintContextWrapper;
}
}
}
TintContextWrapper tintContextWrapper2 = new TintContextWrapper(context);
sCache.add(new WeakReference(tintContextWrapper2));
return tintContextWrapper2;
}
}
private static boolean shouldWrap(@NonNull Context context) {
if ((context instanceof TintContextWrapper) || (context.getResources() instanceof TintResources) || (context.getResources() instanceof VectorEnabledTintResources)) {
return false;
}
if (VERSION.SDK_INT < 21 || VectorEnabledTintResources.shouldBeUsed()) {
return true;
}
return false;
}
private TintContextWrapper(@NonNull Context context) {
super(context);
if (VectorEnabledTintResources.shouldBeUsed()) {
this.mResources = new VectorEnabledTintResources(this, context.getResources());
this.mTheme = this.mResources.newTheme();
this.mTheme.setTo(context.getTheme());
return;
}
this.mResources = new TintResources(this, context.getResources());
this.mTheme = null;
}
public Theme getTheme() {
Theme theme = this.mTheme;
return theme == null ? super.getTheme() : theme;
}
public void setTheme(int i) {
Theme theme = this.mTheme;
if (theme == null) {
super.setTheme(i);
} else {
theme.applyStyle(i, true);
}
}
public Resources getResources() {
return this.mResources;
}
public AssetManager getAssets() {
return this.mResources.getAssets();
}
}
| [
"33246398+ajid951125@users.noreply.github.com"
] | 33246398+ajid951125@users.noreply.github.com |
3bda0a3d7670d19e3add6ff09c5ccae01a42de3f | 1fe19b325c67a1e223260c135378c487f5768613 | /src/main/java/org/cyberpwn/novabomb/util/ListTag.java | 847f8a8f8235ca944caf9cc8893765af7b887a09 | [] | no_license | cyberpwnn/NovaBomb | e5d9244959048fa38065f6020bcc45ed59606674 | e4381c07c0d45f719467a01d23159cba334952db | refs/heads/master | 2021-01-01T04:52:33.148590 | 2017-07-14T19:27:07 | 2017-07-14T19:27:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,991 | java | package org.cyberpwn.novabomb.util;
/*
* JNBT License
*
* Copyright (c) 2010 Graham Edgecombe
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of the JNBT team nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
*/
import java.util.Collections;
import java.util.List;
/**
* The <code>TAG_List</code> tag.
* @author Graham Edgecombe
*
*/
public final class ListTag extends Tag {
/**
* The type.
*/
private final Class<? extends Tag> type;
/**
* The value.
*/
private final List<Tag> value;
/**
* Creates the tag.
* @param name The name.
* @param type The type of item in the list.
* @param value The value.
*/
public ListTag(String name, Class<? extends Tag> type, List<Tag> value) {
super(name);
this.type = type;
this.value = Collections.unmodifiableList(value);
}
/**
* Gets the type of item in this list.
* @return The type of item in this list.
*/
public Class<? extends Tag> getType() {
return type;
}
@Override
public List<Tag> getValue() {
return value;
}
@Override
public String toString() {
String name = getName();
String append = "";
if(name != null && !name.equals("")) {
append = "(\"" + this.getName() + "\")";
}
StringBuilder bldr = new StringBuilder();
bldr.append("TAG_List" + append + ": " + value.size() + " entries of type " + NBTUtils.getTypeName(type) + "\r\n{\r\n");
for(Tag t : value) {
bldr.append(" " + t.toString().replaceAll("\r\n", "\r\n ") + "\r\n");
}
bldr.append("}");
return bldr.toString();
}
}
| [
"danielmillst@gmail.com"
] | danielmillst@gmail.com |
830963c0fe75fcea8935e5a68f33ea9a2695891a | 45f87afc7fe493a3739885d39f9eb0184c96e0c9 | /services/vserver/src/main/java/com/ncloud/vserver/model/LoginKey.java | 8dccdcc0bf984a50c4c52b0b7e203f53a8ca5011 | [
"MIT"
] | permissive | NaverCloudPlatform/ncloud-sdk-java | 6635639835ed19dc82e4605c554f894a14645004 | bb692dab5f00f94f36c1fcc622bec6d2f2c88d28 | refs/heads/master | 2023-05-03T07:21:03.219343 | 2023-04-19T10:56:17 | 2023-04-19T10:56:17 | 210,761,909 | 7 | 6 | MIT | 2023-04-19T10:56:52 | 2019-09-25T05:23:36 | Java | UTF-8 | Java | false | false | 3,102 | java | /*
* vserver
* VPC Compute 관련 API<br/>https://ncloud.apigw.ntruss.com/vserver/v2
*
* NBP corp.
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.ncloud.vserver.model;
import java.util.Objects;
/**
* LoginKey
*/
public class LoginKey {
private String keyName = null;
private String fingerprint = null;
private String publicKey = null;
private String createDate = null;
public LoginKey keyName(String keyName) {
this.keyName = keyName;
return this;
}
/**
* 키이름
* @return keyName
**/
public String getKeyName() {
return keyName;
}
public void setKeyName(String keyName) {
this.keyName = keyName;
}
public LoginKey fingerprint(String fingerprint) {
this.fingerprint = fingerprint;
return this;
}
/**
* 핑거프린트
* @return fingerprint
**/
public String getFingerprint() {
return fingerprint;
}
public void setFingerprint(String fingerprint) {
this.fingerprint = fingerprint;
}
public LoginKey publicKey(String publicKey) {
this.publicKey = publicKey;
return this;
}
/**
* 공개키
* @return publicKey
**/
public String getPublicKey() {
return publicKey;
}
public void setPublicKey(String publicKey) {
this.publicKey = publicKey;
}
public LoginKey createDate(String createDate) {
this.createDate = createDate;
return this;
}
/**
* 생성일시
* @return createDate
**/
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
LoginKey loginKey = (LoginKey) o;
return Objects.equals(this.keyName, loginKey.keyName) &&
Objects.equals(this.fingerprint, loginKey.fingerprint) &&
Objects.equals(this.publicKey, loginKey.publicKey) &&
Objects.equals(this.createDate, loginKey.createDate);
}
@Override
public int hashCode() {
return Objects.hash(keyName, fingerprint, publicKey, createDate);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class LoginKey {\n");
sb.append(" keyName: ").append(toIndentedString(keyName)).append("\n");
sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n");
sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n");
sb.append(" createDate: ").append(toIndentedString(createDate)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"lee.yongtak@navercorp.com"
] | lee.yongtak@navercorp.com |
bc01bd7d6702db725b57c97b39f3b96cc5874857 | 03edba2d9dc32c4701f19925b345e577e58b9f4c | /core/src/main/java/com/leo/core/iapi/main/IViewApiBean.java | d05d2e3f49feed0ebec7dd36f0dd289e48c46977 | [] | no_license | liushunxin4613/full | 0a8495985be09685c27eae57c65ff1e1c16a28f6 | f8f542944e71628d9f4b42cd5e54b48932f363e9 | refs/heads/master | 2021-06-02T14:07:59.313640 | 2019-12-04T16:18:41 | 2019-12-04T16:18:41 | 133,017,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 444 | java | package com.leo.core.iapi.main;
public interface IViewApiBean<A extends IControllerApi, AA extends IControllerApi, B extends
IViewApiBean> extends IApiBean<A, AA> {
/**
* 当数据绑定时
*/
void onBindApi(A api);
/**
* 绑定
*/
void bind(IBindControllerApi<A, B> api);
/**
* 解除绑定
*/
void unBind();
/**
* 更新绑定数据
*/
void updateBind();
} | [
"1249169756@qq.com"
] | 1249169756@qq.com |
8083165944fabfcfe28bac52f1a807b463e5f8ac | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/alibaba--druid/204d94d6f417ebf27b0a72f116c37f74bcbf0c40/after/SQLSelectQueryBlock.java | a36dce05afa2c1e50d6fbb6bf10d4dffcdb66850 | [] | 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 | 3,685 | java | /*
* Copyright 1999-2011 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.druid.sql.ast.statement;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.SQLSetQuantifier;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
public class SQLSelectQueryBlock extends SQLSelectQuery {
private static final long serialVersionUID = 1L;
protected int distionOption;
protected final List<SQLSelectItem> selectList = new ArrayList<SQLSelectItem>();
protected SQLTableSource from;
protected SQLExprTableSource into;
protected SQLExpr where;
protected SQLSelectGroupByClause groupBy;
public SQLSelectQueryBlock(){
}
public SQLExprTableSource getInto() {
return into;
}
public void setInto(SQLExpr into) {
this.into = new SQLExprTableSource(into);
}
public void setInto(SQLExprTableSource into) {
this.into = into;
}
public SQLSelectGroupByClause getGroupBy() {
return this.groupBy;
}
public void setGroupBy(SQLSelectGroupByClause groupBy) {
this.groupBy = groupBy;
}
public SQLExpr getWhere() {
return this.where;
}
public void setWhere(SQLExpr where) {
this.where = where;
}
public int getDistionOption() {
return this.distionOption;
}
public void setDistionOption(int distionOption) {
this.distionOption = distionOption;
}
public List<SQLSelectItem> getSelectList() {
return this.selectList;
}
public SQLTableSource getFrom() {
return this.from;
}
public void setFrom(SQLTableSource from) {
this.from = from;
}
@Override
protected void accept0(SQLASTVisitor visitor) {
if (visitor.visit(this)) {
acceptChild(visitor, this.selectList);
acceptChild(visitor, this.from);
acceptChild(visitor, this.where);
acceptChild(visitor, this.groupBy);
}
visitor.endVisit(this);
}
public void output(StringBuffer buf) {
buf.append("SELECT ");
if (SQLSetQuantifier.ALL == this.distionOption) buf.append("ALL ");
else if (SQLSetQuantifier.DISTINCT == this.distionOption) buf.append("DISTINCT ");
else if (SQLSetQuantifier.UNIQUE == this.distionOption) {
buf.append("UNIQUE ");
}
int i = 0;
for (int size = this.selectList.size(); i < size; ++i) {
if (i != 0) {
buf.append(", ");
}
((SQLSelectItem) this.selectList.get(i)).output(buf);
}
buf.append(" FROM ");
if (this.from == null) {
buf.append("DUAL");
} else {
this.from.output(buf);
}
if (this.where != null) {
buf.append(" WHERE ");
this.where.output(buf);
}
if (this.groupBy != null) {
buf.append(" ");
this.groupBy.output(buf);
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
e8e6e65ade018dfd6ab4444873de7ae46da339e2 | d61eb73f504248f9244185739430d3ad244b0a6a | /src/main/java/PduParser/GenericPdu.java | 20db59a8115183e585b37a07fd799e3d6f6c2b77 | [
"Apache-2.0"
] | permissive | Autom-liu/SMSGate | 35531b1a285144e669a2fdf472535b99f261ab27 | d0f2df1441734f39fbf39e973686e09201ac22f8 | refs/heads/netty4 | 2020-11-25T12:50:32.257897 | 2020-08-26T12:57:16 | 2020-08-26T12:57:16 | 228,670,614 | 1 | 0 | Apache-2.0 | 2020-08-26T12:57:18 | 2019-12-17T17:44:17 | null | UTF-8 | Java | false | false | 2,393 | java | package PduParser;
public class GenericPdu {
/**
* The headers of pdu.
*/
PduHeaders mPduHeaders = null;
/**
* Constructor.
*/
public GenericPdu() {
mPduHeaders = new PduHeaders();
}
/**
* Constructor.
*
* @param headers Headers for this PDU.
*/
GenericPdu(PduHeaders headers) {
mPduHeaders = headers;
}
/**
* Get the headers of this PDU.
*
* @return A PduHeaders of this PDU.
*/
PduHeaders getPduHeaders() {
return mPduHeaders;
}
/**
* Get X-Mms-Message-Type field value.
*
* @return the X-Mms-Report-Allowed value
*/
public int getMessageType() {
return mPduHeaders.getOctet(PduHeaders.MESSAGE_TYPE);
}
/**
* Set X-Mms-Message-Type field value.
*
* @param value the value
* @throws InvalidHeaderValueException if the value is invalid.
* RuntimeException if field's value is not Octet.
*/
public void setMessageType(int value) throws InvalidHeaderValueException {
mPduHeaders.setOctet(value, PduHeaders.MESSAGE_TYPE);
}
/**
* Get X-Mms-MMS-Version field value.
*
* @return the X-Mms-MMS-Version value
*/
public int getMmsVersion() {
return mPduHeaders.getOctet(PduHeaders.MMS_VERSION);
}
/**
* Set X-Mms-MMS-Version field value.
*
* @param value the value
* @throws InvalidHeaderValueException if the value is invalid.
* RuntimeException if field's value is not Octet.
*/
public void setMmsVersion(int value) throws InvalidHeaderValueException {
mPduHeaders.setOctet(value, PduHeaders.MMS_VERSION);
}
/**
* Get From value.
* From-value = Value-length
* (Address-present-token Encoded-string-value | Insert-address-token)
*
* @return the value
*/
public EncodedStringValue getFrom() {
return mPduHeaders.getEncodedStringValue(PduHeaders.FROM);
}
/**
* Set From value.
*
* @param value the value
* @throws NullPointerException if the value is null.
*/
public void setFrom(EncodedStringValue value) {
mPduHeaders.setEncodedStringValue(value, PduHeaders.FROM);
}
}
| [
"jameslover121@163.com"
] | jameslover121@163.com |
b207a45a79cb9037d936c22e81782eae5f5df17f | b634de75a070612d159c91865872a38ce4333718 | /kie-infinispan/drools-infinispan-persistence/src/main/java/org/drools/persistence/util/CharEncoding.java | a7716b920e93ec186301eae01440bdf76b118553 | [
"Apache-2.0"
] | permissive | garmanli/droolsjbpm-integration | 2b9046a0d65269cc7b0f470826a181e714e07413 | 4fb2e41a776546b7251c932fb2f1abbf57861c2c | refs/heads/master | 2021-01-23T20:40:11.341046 | 2014-08-12T16:00:45 | 2014-08-12T16:00:45 | 23,016,006 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,318 | java | package org.drools.persistence.util;
/**
* Character encoding names required of every implementation of the Java platform.
*
* From the Java documentation <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html">Standard
* charsets</a>:
* <p>
* <cite>Every implementation of the Java platform is required to support the following character encodings. Consult the
* release documentation for your implementation to see if any other encodings are supported. Consult the release
* documentation for your implementation to see if any other encodings are supported. </cite>
* </p>
*
* <ul>
* <li><code>US-ASCII</code><br/>
* Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set.</li>
* <li><code>ISO-8859-1</code><br/>
* ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1.</li>
* <li><code>UTF-8</code><br/>
* Eight-bit Unicode Transformation Format.</li>
* <li><code>UTF-16BE</code><br/>
* Sixteen-bit Unicode Transformation Format, big-endian byte order.</li>
* <li><code>UTF-16LE</code><br/>
* Sixteen-bit Unicode Transformation Format, little-endian byte order.</li>
* <li><code>UTF-16</code><br/>
* Sixteen-bit Unicode Transformation Format, byte order specified by a mandatory initial byte-order mark (either order
* accepted on input, big-endian used on output.)</li>
* </ul>
*
* This perhaps would best belong in the [lang] project. Even if a similar interface is defined in [lang], it is not
* forseen that [codec] would be made to depend on [lang].
*
* @see <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
* @since 1.4
* @version $Id: CharEncoding.java 797857 2009-07-25 23:43:33Z ggregory $
*/
public class CharEncoding {
/**
* CharEncodingISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1. </p>
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
*
* @see <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final String ISO_8859_1 = "ISO-8859-1";
/**
* <p>
* Seven-bit ASCII, also known as ISO646-US, also known as the Basic Latin block of the Unicode character set.
* </p>
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
*
* @see <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final String US_ASCII = "US-ASCII";
/**
* <p>
* Sixteen-bit Unicode Transformation Format, The byte order specified by a mandatory initial byte-order mark
* (either order accepted on input, big-endian used on output)
* </p>
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
*
* @see <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final String UTF_16 = "UTF-16";
/**
* <p>
* Sixteen-bit Unicode Transformation Format, big-endian byte order.
* </p>
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
*
* @see <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final String UTF_16BE = "UTF-16BE";
/**
* <p>
* Sixteen-bit Unicode Transformation Format, little-endian byte order.
* </p>
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
*
* @see <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final String UTF_16LE = "UTF-16LE";
/**
* <p>
* Eight-bit Unicode Transformation Format.
* </p>
* <p>
* Every implementation of the Java platform is required to support this character encoding.
* </p>
*
* @see <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
public static final String UTF_8 = "UTF-8";
}
| [
"mario.fusco@gmail.com"
] | mario.fusco@gmail.com |
f28710f05fb3bc0d0343695f8f2f0d519172caa7 | afcca25fdcbaaa4bdd08babcf234dcdecf21b6f6 | /quasar-sika-design-server/quasar-sika-design-server-common/src/main/java/com/quasar/sika/design/server/business/dictdata/constant/DictDataErrorCodeEnum.java | a4910e967fe5f8f8566b737b5caaedd1c86fae66 | [
"MIT"
] | permissive | Auntie233/quasar-sika-design | cd12faedaeb1f24c6e6de8462ce0d692a2e62a9c | a4463dbcf4ed19cbc8453d7d6161f92b85d9d076 | refs/heads/main | 2023-07-05T10:43:23.726149 | 2021-08-23T09:04:48 | 2021-08-23T09:04:48 | 399,025,717 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 616 | java | package com.quasar.sika.design.server.business.dictdata.constant;
import com.sika.code.basic.errorcode.BaseErrorCode;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* <p>
* 字典数据表 错误枚举类
* </p>
*
* @author daiqi
* @since 2021-01-07 23:34:31
*/
@Getter
@AllArgsConstructor
public enum DictDataErrorCodeEnum implements BaseErrorCode {
/**
* 错误枚举示例
*/
DICTDATA_ERROR_CODE_ENUM("DICTDATA_000001", "错误枚举示例")
;
/**
* 错误码
*/
private String code;
/**
* 错误信息
*/
private String message;
}
| [
"466608943@qq.com"
] | 466608943@qq.com |
1a393da059a080ffce748b50d3a1014a4951d3b9 | c9a9a86e5b04767ad007796ca4dc513d79dc4720 | /src/main/java/com/selectica/Demka/definitions/CSalesBO/actions/SetLastManageDateActionScript.java | e90d09bc0e06e73efc7363a80b9b2d4c6bec6eb5 | [] | no_license | LeoSigal/demka | 7afbe80000169f536225e8c3a3dcd8c7fd4bf81b | 3a5018b2c109884365a5a29fc69e152af435e08a | refs/heads/master | 2016-09-06T17:51:28.056622 | 2015-06-19T15:31:51 | 2015-06-19T15:31:51 | 37,727,903 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package com.selectica.Demka.definitions.CSalesBO.actions;
import com.selectica.Demka.eclm.definitions.shared.actions.SetLastManageDateAction;
import com.selectica.rcfscripts.AbstractBOWriteScript;
/**#SetLastManageDate*/
public class SetLastManageDateActionScript extends SetLastManageDateAction {
}
| [
"user@rcfproj.aws.selectica.net"
] | user@rcfproj.aws.selectica.net |
9306b6f66eb71b7f403955e7ce7c2400e91517be | af280e5d529695c86e05dc22e10d4aa85ef8af45 | /app/src/main/java/com/bfurns/model/QuestionModel.java | 5cc7eed766492da9e1438831aa3164ecea278b77 | [] | no_license | Dummyurl/DoctorApp- | 9ef88e153f96efb55573bad55b1106c2874ec3ae | bb21ddc3e7be935499a76688b0c7b7697560dc4a | refs/heads/master | 2020-04-10T01:04:41.785249 | 2018-03-12T09:45:10 | 2018-03-12T09:45:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,000 | java | package com.bfurns.model;
/**
* Created by Mahesh on 09/01/18.
*/
public class QuestionModel {
public QuestionModel() {
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
private String subject;
private String description;
private String id;
public String getReplyBy() {
return replyBy;
}
public void setReplyBy(String replyBy) {
this.replyBy = replyBy;
}
private String replyBy;
public String getDoctorName() {
return doctorName;
}
public void setDoctorName(String doctorName) {
this.doctorName = doctorName;
}
private String doctorName;
public String getQ_reply_id() {
return q_reply_id;
}
public void setQ_reply_id(String q_reply_id) {
this.q_reply_id = q_reply_id;
}
public String getQ_read() {
return q_read;
}
public void setQ_read(String q_read) {
this.q_read = q_read;
}
public String getCreated() {
return created;
}
public void setCreated(String created) {
this.created = created;
}
private String q_reply_id;
private String q_read; // 0 means show gray else white
private String created;
public String getDoctor_id() {
return doctor_id;
}
public void setDoctor_id(String doctor_id) {
this.doctor_id = doctor_id;
}
private String doctor_id;
public String getFlag() {
return flag;
}
public void setFlag(String flag) {
this.flag = flag;
}
private String flag; //flag 0 means hide reply text else show
}
| [
"karishmanadaf77@outlook.com"
] | karishmanadaf77@outlook.com |
30511aa07113df45117cd1b56f746e454f7da589 | 2b051afbdd923fa1512193671f8d3484615c84fd | /edu/bupt/zyq/FactorialTrailingZeroes.java | 17be3c404b77990bd4e514968246d96fdcaf3328 | [] | no_license | zyq001/leetcode | 21156c1dcbdd960d8cec56edeeac16446849917a | bb437e2904b7ed122e244802425d2cfb02d19151 | refs/heads/master | 2020-05-17T18:39:19.424028 | 2015-03-31T05:38:27 | 2015-03-31T05:38:27 | 21,115,480 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 687 | java | package edu.bupt.zyq;
public class FactorialTrailingZeroes {
/**
* Given an integer n, return the number of trailing zeroes in n!.
Note: Your solution should be in logarithmic time complexity.
*
* */
public static int trailingZeroes(int n) {
int re = 0;
int x = 5;
while(n >= x){
re += n / x;
if(Integer.MAX_VALUE / 5 <= x)
break;
x *= 5;
}
return re;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(System.currentTimeMillis());
System.out.println(trailingZeroes(2147483647));
System.out.println(System.currentTimeMillis());
}
}
| [
"mikezang625@gmail.com"
] | mikezang625@gmail.com |
6bb6a345328cb6b886201ff8c79e003468e370bd | 1c13fda24e2de8f7891a93bf52dac6aa3bc409ce | /app/src/main/java/com/example/it01/retrofitrx/api/ApiDrawing.java | fdf45cf1903b3e166a461638dd9ae92b6f605e42 | [] | no_license | melkikun/RetrofitRx | 74128a8ae3c87aae80560b729c9a1ca0c56ba8ec | 9d76820539daea94109c77899b8b31ca2b9a11af | refs/heads/master | 2021-01-18T07:02:24.261373 | 2017-03-10T08:40:58 | 2017-03-10T08:40:58 | 84,285,335 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 471 | java | package com.example.it01.retrofitrx.api;
import com.example.it01.retrofitrx.entities.MasterDrawing;
import java.util.List;
import retrofit2.http.GET;
import retrofit2.http.Path;
import rx.Observable;
import rx.Observer;
/**
* Created by IT01 on 3/8/2017.
*/
public interface ApiDrawing {
@GET("data/master-drawing")
Observable<List<MasterDrawing>> md();
@GET("data/master-drawing/id/{id}")
Observable<MasterDrawing> detailMd(@Path("id") int id);
}
| [
"a"
] | a |
a4beac149ad62fc3caa117fd111fe766d094a7f0 | 63489b9d7f48b5f95dd7823f1ee0e81beb88aba4 | /artrade/src/main/java/com/unionpay/mobile/android/upwidget/n.java | 54189ddc22135f4c89aa946cacea14d7118feaf2 | [] | no_license | h4x0r139/MyApplication | 7f7b7b65c160cad5af5baa5727163fae5d26a2bb | b71648d2963761efdfdf66de72075e590781c835 | refs/heads/master | 2020-05-21T14:55:31.488110 | 2019-05-28T11:29:45 | 2019-05-28T11:29:45 | 63,512,880 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,084 | java | package com.unionpay.mobile.android.upwidget;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import java.util.ArrayList;
import java.util.Iterator;
final class n
implements View.OnClickListener
{
n(h paramh)
{
}
public final void onClick(View paramView)
{
int i = ((Integer)paramView.getTag()).intValue();
if (i == h.a(this.a))
return;
h.c(this.a, i);
if ((h.l(this.a)) && (!TextUtils.isEmpty(h.m(this.a)[i].d)))
{
paramView.setTag(h.m(this.a)[i].d);
Iterator localIterator = h.n(this.a).iterator();
while (localIterator.hasNext())
((View.OnClickListener)localIterator.next()).onClick(paramView);
h.a(this.a, (LinearLayout)h.m(this.a)[i].c, "正在查询。。。");
h.o(this.a);
}
paramView.setTag(Integer.valueOf(i));
}
}
/* Location: D:\yinxm\Android\work\拍卖\apktool\artrade\classes_dex2jar.jar
* Qualified Name: com.unionpay.mobile.android.upwidget.n
* JD-Core Version: 0.6.2
*/ | [
"h4x0r_001@163.com"
] | h4x0r_001@163.com |
0b2e5969c929f5a14ff61e7f05cfbcfa227558b4 | 591c0a95d5af2da85b8842370d2d6184d2f1a323 | /src/main/java/mcjty/immcraft/items/ModItems.java | 5b0c38f748f4e3401239f05626171a67cae64b4f | [
"MIT"
] | permissive | TerraFirmaCraft-The-Final-Frontier/ImmersiveCraft | 64d1068f7962da57bf4f6d30d68275384fb5af9e | 7070b78ceca3ee6009267660098c37a3c90612ef | refs/heads/master | 2022-05-10T22:21:52.518084 | 2017-01-04T11:30:18 | 2017-01-04T11:30:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 919 | java | package mcjty.immcraft.items;
import mcjty.immcraft.blocks.ModBlocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ModItems {
public static ItemChisel chisel;
public static ItemSaw saw;
public static void init() {
chisel = new ItemChisel();
saw = new ItemSaw();
}
public static void initCrafting() {
GameRegistry.addShapedRecipe(new ItemStack(saw), " sr", "sr ", "s ", 's', Items.stick, 'r', ModBlocks.rockBlock);
GameRegistry.addShapedRecipe(new ItemStack(chisel), " r", " r ", "s ", 's', Items.stick, 'r', ModBlocks.rockBlock);
}
@SideOnly(Side.CLIENT)
public static void initModels() {
chisel.initModel();
saw.initModel();
}
}
| [
"mcjty1@gmail.com"
] | mcjty1@gmail.com |
aef24407508c391b535813a614e3e60ecd44ddd8 | 7947046cd0c16ad51b94f31b809268e192cb1c9c | /4.JavaCollections/src/com/javarush/task/task31/task3111/SearchFileVisitor.java | a7c87129f54c83948b64ac5101ba2a7bb1ccb96f | [] | no_license | Alexey-Che/JavaRush | 128e1bade566de4618e399694c9e3ea75b961243 | 5e6d684e0a8eb430e79407c1499e140603417dd5 | refs/heads/master | 2023-07-18T03:53:00.126283 | 2021-09-10T07:18:38 | 2021-09-10T07:18:38 | 343,357,413 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,918 | java | package com.javarush.task.task31.task3111;
import java.io.IOException;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.List;
public class SearchFileVisitor<P> extends SimpleFileVisitor<Path> {
private String partOfName;
private String partOfContent;
private int minSize;
private int maxSize;
private List<Path> foundFiles = new ArrayList<>();
public void setPartOfName(String partOfName) {
this.partOfName = partOfName;
}
public void setPartOfContent(String partOfContent) {
this.partOfContent = partOfContent;
}
public void setMinSize(int minSize) {
this.minSize = minSize;
}
public void setMaxSize(int maxSize) {
this.maxSize = maxSize;
}
public List<Path> getFoundFiles() {
return foundFiles;
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
// check if file name contains search string
if (partOfName != null && !file.getFileName().toString().contains(partOfName)) return FileVisitResult.CONTINUE;
// read file content
byte[] content = Files.readAllBytes(file);
//check size of file
if ((maxSize > 0 && content.length > maxSize) || (minSize > 0 && content.length < minSize)) return FileVisitResult.CONTINUE;
// check contents of file
if (partOfContent != null && !partOfContent.isEmpty()) {
String contentString = new String(content);
if (!contentString.contains(partOfContent)) return FileVisitResult.CONTINUE;
}
// if all checks are passed, add file to result list
foundFiles.add(file);
return super.visitFile(file, attrs);
}
}
| [
"lexa.36484@gmail.com"
] | lexa.36484@gmail.com |
ff6925abd989e92eb91ec5bdd5d5a41e2e86868a | 1c47c4f834ec5f5a89d2262768486da8054d7544 | /src/main/java/mekanism/common/content/gear/mekasuit/ModuleChargeDistributionUnit.java | 637612c772c89b4b17d6d30370cf842a7f72606a | [
"MIT"
] | permissive | Sinmis077/Meka-Guide | d4443cd1ae48929aa6ff5f811e2d00d7caf3ba17 | c42191d9d5a4e8add654a6cf8720abc8af2896c3 | refs/heads/main | 2023-08-07T19:45:42.813342 | 2021-09-26T21:55:10 | 2021-09-26T21:55:10 | 383,550,665 | 1 | 1 | MIT | 2021-09-26T21:55:11 | 2021-07-06T17:34:34 | Java | UTF-8 | Java | false | false | 3,862 | java | package mekanism.common.content.gear.mekasuit;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import java.util.Set;
import mekanism.api.Action;
import mekanism.api.energy.IEnergyContainer;
import mekanism.api.energy.IStrictEnergyHandler;
import mekanism.api.math.FloatingLong;
import mekanism.common.MekanismLang;
import mekanism.common.config.MekanismConfig;
import mekanism.common.content.gear.ModuleConfigItem;
import mekanism.common.content.gear.ModuleConfigItem.BooleanData;
import mekanism.common.content.network.distribution.EnergySaveTarget;
import mekanism.common.integration.energy.EnergyCompatUtils;
import mekanism.common.util.EmitUtils;
import mekanism.common.util.StorageUtils;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
public class ModuleChargeDistributionUnit extends ModuleMekaSuit {
private ModuleConfigItem<Boolean> chargeSuit;
private ModuleConfigItem<Boolean> chargeInventory;
@Override
public void init() {
super.init();
chargeSuit = addConfigItem(new ModuleConfigItem<>(this, "charge_suit", MekanismLang.MODULE_CHARGE_SUIT, new BooleanData(), true));
chargeInventory = addConfigItem(new ModuleConfigItem<>(this, "charge_inventory", MekanismLang.MODULE_CHARGE_INVENTORY, new BooleanData(), false));
}
@Override
public void tickServer(PlayerEntity player) {
super.tickServer(player);
// charge inventory first
if (chargeInventory.get()) {
chargeInventory(player);
}
// distribute suit charge next
if (chargeSuit.get()) {
chargeSuit(player);
}
}
private void chargeSuit(PlayerEntity player) {
Set<EnergySaveTarget> saveTargets = new ObjectOpenHashSet<>();
FloatingLong total = FloatingLong.ZERO;
for (ItemStack stack : player.inventory.armorInventory) {
IEnergyContainer energyContainer = StorageUtils.getEnergyContainer(stack, 0);
if (energyContainer != null) {
EnergySaveTarget saveTarget = new EnergySaveTarget();
saveTarget.addHandler(Direction.NORTH, energyContainer);
saveTargets.add(saveTarget);
total = total.plusEqual(energyContainer.getEnergy());
}
}
EmitUtils.sendToAcceptors(saveTargets, saveTargets.size(), total.copy());
for (EnergySaveTarget saveTarget : saveTargets) {
saveTarget.save(Direction.NORTH);
}
}
private void chargeInventory(PlayerEntity player) {
FloatingLong toCharge = MekanismConfig.gear.mekaSuitInventoryChargeRate.get();
// first try to charge mainhand/offhand item
toCharge = charge(player, player.getHeldItemMainhand(), toCharge);
toCharge = charge(player, player.getHeldItemOffhand(), toCharge);
for (ItemStack stack : player.inventory.mainInventory) {
if (stack == player.getHeldItemMainhand() || stack == player.getHeldItemOffhand()) {
continue;
}
if (toCharge.isZero()) {
break;
}
toCharge = charge(player, stack, toCharge);
}
}
/** return rejects */
private FloatingLong charge(PlayerEntity player, ItemStack stack, FloatingLong amount) {
IStrictEnergyHandler handler = EnergyCompatUtils.getStrictEnergyHandler(stack);
if (handler != null) {
FloatingLong remaining = handler.insertEnergy(amount, Action.SIMULATE);
if (remaining.smallerThan(amount)) {
//If we can actually insert any energy into
return handler.insertEnergy(useEnergy(player, amount.subtract(remaining), false), Action.EXECUTE).add(remaining);
}
}
return amount;
}
} | [
"llelga8@gmail.com"
] | llelga8@gmail.com |
1d221b7a1d98d67902b5a000ab6c658ba137d1c5 | cde62d07c3f0adeb34bcadbf164a9d7b62d8d4d8 | /.metadata/.plugins/org.eclipse.core.resources/.history/34/f089a4be5b3100191c86e4c9ef29f9d7 | 2ce0449ebf4188dced3ee17f1f195182eecbab26 | [] | no_license | adithnaveen/sdet-2weeks | 65b31ec697209702e933f5503ea4f86cbfa9fc8a | 728dd92632f2858e800474012cda259273bb4369 | refs/heads/master | 2020-04-22T07:08:02.802134 | 2019-02-15T21:55:56 | 2019-02-15T21:55:56 | 170,211,115 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 163 | package com.training.utilities;
public interface DriverNames {
String CHROME ="CHROME";
String FIREFOX="FIREFOX";
String IE="IE";
String SAFARI="SAFARI";
}
| [
"adith.naveen@gmail.com"
] | adith.naveen@gmail.com | |
23d16423d9ae8d1c918367e0b8f10faff495e75a | 3d5a4e32fb95d5a80d126ef0a6ba04b6d8a1eb1b | /app/src/main/java/com/xk/mall/presenter/EnterLogisticsPresenter.java | b292c91a86a5d0412a92884baf36baf52bdfc52c | [] | no_license | 18236905854/XiKouShangCheng | 691fdd5056e35d8218bdb57be4f01cac185dd3e1 | 015bbcdb0199a9f04f57cc693a252eb687c43e2e | refs/heads/master | 2022-11-03T12:33:35.955106 | 2020-06-17T08:37:19 | 2020-06-17T08:37:19 | 272,629,839 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,430 | java | package com.xk.mall.presenter;
import com.xk.mall.base.BaseModel;
import com.xk.mall.base.BaseObserver;
import com.xk.mall.base.BasePresenter;
import com.xk.mall.model.impl.EnterLogisticsViewImpl;
import com.xk.mall.model.request.WriteLogisticsRequestBody;
/**
* @ClassName: EnterLogisticsPresenter
* @Description: 填写物流信息页面请求类
* @Author: 卿凯
* @Date: 2019/12/10/010 14:29
* @Version: 1.0
*/
public class EnterLogisticsPresenter extends BasePresenter<EnterLogisticsViewImpl> {
public EnterLogisticsPresenter(EnterLogisticsViewImpl baseView) {
super(baseView);
}
/**
* 提交物流信息
* @param expressCompany 物流公司
* @param logisticsNo 物流单号
* @param orderNo 订单号
*/
public void postLogisticInfo(String expressCompany, String logisticsNo, String orderNo){
WriteLogisticsRequestBody requestBody = new WriteLogisticsRequestBody();
requestBody.setExpressCompany(expressCompany);
requestBody.setLogisticsNo(logisticsNo);
requestBody.setRefundOrderNo(orderNo);
addDisposable(apiServer.writeLogisticsInfo(requestBody), new BaseObserver(baseView) {
@Override
public void onSuccess(Object o) {
baseView.onPostSuccess((BaseModel) o);
}
@Override
public void onError(String msg) {
}
});
}
}
| [
"1071048617@qq.com"
] | 1071048617@qq.com |
b57a61484f2a13b1542025354b10ac9fe7c2044c | a1c9e069d3cb754e39ecb66d03ef1c77eb097078 | /avchatkit/build/generated/source/buildConfig/release/com/netease/nim/avchatkit/BuildConfig.java | 5d94df3039296cc83d05cd14b949f7f24816e641 | [] | no_license | huang2177/TopNew | 1dac76016bda9164069ec99ab10667814319c66e | 9a9182b6c992d6f9d9718da2c4b3e4986396f723 | refs/heads/master | 2020-03-29T11:48:57.314314 | 2018-10-11T06:49:15 | 2018-10-11T06:49:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 439 | java | /**
* Automatically generated file. DO NOT MODIFY
*/
package com.netease.nim.avchatkit;
public final class BuildConfig {
public static final boolean DEBUG = false;
public static final String APPLICATION_ID = "com.netease.nim.avchatkit";
public static final String BUILD_TYPE = "release";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 15;
public static final String VERSION_NAME = "1.1.4";
}
| [
"15378412400@163.com"
] | 15378412400@163.com |
76e16a7e1f5fa7be050519c5608737755eb74f50 | 73ddf37cb32504a6f504fe7bff8ef7842b15550a | /src/test/java/com/alibaba/druid/bvt/sql/mysql/update/MySqlUpdateTest_0.java | 27a80cf18d387b2fe58725404c7f3be31a34aad6 | [
"Apache-2.0"
] | permissive | onlyscorpion/scorpion-sql-parser | 2c0ecd4758d5bc5e6f1a50e0fadcfcb012e3524f | a55f9597c7a3a8b9c610cacc5a957a41d3ea018a | refs/heads/master | 2021-08-19T14:15:55.462593 | 2017-11-26T15:47:17 | 2017-11-26T15:47:17 | 112,094,653 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,265 | java | /*
* Copyright 1999-2017 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.druid.bvt.sql.mysql.update;
import java.util.List;
import org.junit.Assert;
import com.alibaba.druid.sql.MysqlTest;
import com.alibaba.druid.sql.ast.SQLStatement;
import com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser;
import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlSchemaStatVisitor;
import com.alibaba.druid.stat.TableStat;
import com.alibaba.druid.stat.TableStat.Column;
public class MySqlUpdateTest_0 extends MysqlTest {
public void test_0() throws Exception {
String sql = "UPDATE `z_code` SET `key`='INTRANT_NOTALLOWED_CATEGORY_C'";
MySqlStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> statementList = parser.parseStatementList();
SQLStatement statemen = statementList.get(0);
// print(statementList);
Assert.assertEquals(1, statementList.size());
MySqlSchemaStatVisitor visitor = new MySqlSchemaStatVisitor();
statemen.accept(visitor);
// System.out.println("Tables : " + visitor.getTables());
// System.out.println("fields : " + visitor.getColumns());
// System.out.println("coditions : " + visitor.getConditions());
// System.out.println("orderBy : " + visitor.getOrderByColumns());
Assert.assertEquals(1, visitor.getTables().size());
Assert.assertEquals(1, visitor.getColumns().size());
Assert.assertEquals(0, visitor.getConditions().size());
Assert.assertTrue(visitor.getTables().containsKey(new TableStat.Name("z_code")));
Assert.assertTrue(visitor.getColumns().contains(new Column("z_code", "key")));
}
}
| [
"zhengchenglei@jd.com"
] | zhengchenglei@jd.com |
2bbbb76091e9db129e9fe6872342161f5a7b16f5 | b9a2aa01a5756a591e423371bb0b6fa5c680b435 | /bundles/org.connectorio.addons.binding.relayweblog/src/main/java/org/connectorio/addons/binding/relayweblog/client/SigningContext.java | 2f155cd5f3a3c3c733840054c8d88563649e8ac7 | [
"GPL-3.0-only",
"Apache-2.0",
"LicenseRef-scancode-proprietary-license",
"GPL-1.0-or-later"
] | permissive | ConnectorIO/connectorio-addons | 49dbae8ab38537e3ec18f7860070431612d375c1 | 7757376a6b4535bedabf5fdcb76e4193aa2bbc76 | refs/heads/master | 2023-08-31T20:33:38.295013 | 2023-07-14T23:47:45 | 2023-07-14T23:47:45 | 243,823,699 | 22 | 8 | Apache-2.0 | 2023-07-16T22:28:43 | 2020-02-28T17:58:51 | Java | UTF-8 | Java | false | false | 1,768 | java | /*
* Copyright (C) 2019-2021 ConnectorIO Sp. z o.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.
*
* SPDX-License-Identifier: Apache-2.0
*/
package org.connectorio.addons.binding.relayweblog.client;
import static org.connectorio.addons.binding.relayweblog.client.Hash.hmacsha512;
import static org.connectorio.addons.binding.relayweblog.client.Hash.sha512;
public class SigningContext {
private final String passwordHash;
private String session;
public SigningContext(String passwordHash) {
this.passwordHash = sha512(passwordHash);
}
public void setSession(String sessionToken) {
if (this.session != null) {
throw new IllegalArgumentException("Session already set");
}
this.session = sessionToken;
}
public void resetSession() {
this.session = null;
}
public String getSession() {
return session;
}
public String getHash(String uri, long microtime) {
return hmacsha512(uri + microtime, getHmacKey());
}
public String getHash(String uri, long microtime, String payload) {
return hmacsha512(uri + microtime + payload, getHmacKey());
}
public String getHmacKey() {
if (session == null) {
return passwordHash;
}
return sha512(passwordHash + session);
}
} | [
"luke@code-house.org"
] | luke@code-house.org |
7bd61a3ccf3e3bfbed7f3ecfcac9cc8e60f32af6 | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/spoon/learning/4262/CtLiteralImpl.java | f8cb165dc15976c8da93fd42eccbc0b614ae64e6 | [] | no_license | ASSERT-KTH/synthetic-checkstyle-error-dataset | 40e8d1e0a7ebe7f7711def96a390891a6922f7bd | 40c057e1669584bfc6fecf789b5b2854660222f3 | refs/heads/master | 2023-03-18T12:50:55.410343 | 2019-01-25T09:54:39 | 2019-01-25T09:54:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,810 | java | /**
* Copyright (C) 2006-2018 INRIA and contributors
* Spoon - http://spoon.gforge.inria.fr/
*
* This software is governed by the CeCILL-C License under French law and
* abiding by the rules of distribution of free software. You can use, modify
* and/or redistribute the software under the terms of the CeCILL-C license as
* circulated by CEA, CNRS and INRIA at http://www.cecill.info.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL-C License for more details.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C license and that you accept its terms.
*/
package spoon.support.reflect.code;
import spoon.reflect.annotations.MetamodelPropertyField;
import spoon.reflect.code.CtLiteral;
import spoon.reflect.declaration.CtElement;
import spoon.reflect.path.CtRole;
import spoon.reflect.visitor.CtVisitor;
import static spoon.reflect.path.CtRole.EXPRESSION;
public class CtLiteralImpl<T> extends CtExpressionImpl<T> implements CtLiteral<T> {
private static final long serialVersionUID = 1L;
@MetamodelPropertyField(role = CtRole.VALUE)
T value;
@Override
public void accept(CtVisitor visitor) {
visitor.visitCtLiteral(this);
}
@Override
public T getValue() {
return value;
}
@Override
public <C extends CtLiteral<T>> C setValue(T value) {
if (this.value instanceof CtElement) {
((CtElement) this.value).setParent(this);
}
getFactory().getEnvironment().getModelChangeListener().onObjectUpdate(this, EXPRESSION, value, this. value);
this.value = value;
return (C) this;
}
@Override
public CtLiteral<T> clone() {
return (CtLiteral<T>) super.clone();
}
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
b840b5c01d12286de6e1c68a4b0c4ccd37869500 | 43eb759f66530923dfe1c6e191ec4f350c097bd9 | /projects/commons-math/src/main/java/org/apache/commons/math3/exception/MathIllegalStateException.java | f5165366b70df48c59c30fddffa8c5b32af002dd | [
"MIT",
"BSD-3-Clause",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"Minpack",
"LicenseRef-scancode-generic-cla"
] | permissive | hayasam/lightweight-effectiveness | fe4bd04f8816c6554e35c8c9fc8489c11fc8ce0b | f6ef4c98b8f572a86e42252686995b771e655f80 | refs/heads/master | 2023-08-17T01:51:46.351933 | 2020-09-03T07:38:35 | 2020-09-03T07:38:35 | 298,672,257 | 0 | 0 | MIT | 2023-09-08T15:33:03 | 2020-09-25T20:23:43 | null | UTF-8 | Java | false | false | 2,922 | 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.commons.math3.exception;
import org.apache.commons.math3.exception.util.Localizable;
import org.apache.commons.math3.exception.util.LocalizedFormats;
import org.apache.commons.math3.exception.util.ExceptionContext;
import org.apache.commons.math3.exception.util.ExceptionContextProvider;
/**
* Base class for all exceptions that signal that the process
* throwing the exception is in a state that does not comply with
* the set of states that it is designed to be in.
*
* @since 2.2
*/
public class MathIllegalStateException extends IllegalStateException
implements ExceptionContextProvider {
/** Serializable version Id. */
private static final long serialVersionUID = -6024911025449780478L;
/** Context. */
private final ExceptionContext context;
/**
* Simple constructor.
*
* @param pattern Message pattern explaining the cause of the error.
* @param args Arguments.
*/
public MathIllegalStateException(Localizable pattern,
Object ... args) {
context = new ExceptionContext(this);
context.addMessage(pattern, args);
}
/**
* Simple constructor.
*
* @param cause Root cause.
* @param pattern Message pattern explaining the cause of the error.
* @param args Arguments.
*/
public MathIllegalStateException(Throwable cause,
Localizable pattern,
Object ... args) {
super(cause);
context = new ExceptionContext(this);
context.addMessage(pattern, args);
}
/**
* Default constructor.
*/
public MathIllegalStateException() {
this(LocalizedFormats.ILLEGAL_STATE);
}
/** {@inheritDoc} */
public ExceptionContext getContext() {
return context;
}
/** {@inheritDoc} */
@Override
public String getMessage() {
return context.getMessage();
}
/** {@inheritDoc} */
@Override
public String getLocalizedMessage() {
return context.getLocalizedMessage();
}
}
| [
"granogiovanni90@gmail.com"
] | granogiovanni90@gmail.com |
046d76168287cda474cd8f730c423190f46609ce | 72451944f5e57ce17f60442783229f4b05d207d7 | /code/src/com/ai/bce/configtool/service/impl/ConfAttrFieldMapSVImpl.java | c3872c335855de00f8daae5cb8adb0058f85cd92 | [] | no_license | amosgavin/db2app55 | ab1d29247be16bc9bbafd020e1a234f98bac1a39 | 61be5acb3143f5035f789cd0e0fd4e01238d9d7d | refs/heads/master | 2020-04-07T08:26:20.757572 | 2018-07-13T01:55:47 | 2018-07-13T01:55:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,030 | java | package com.ai.bce.configtool.service.impl;
import java.rmi.RemoteException;
import com.ai.bce.configtool.dao.interfaces.IConfAttrFieldMapDAO;
import com.ai.bce.configtool.service.interfaces.IConfAttrFieldMapSV;
import com.ai.bce.ivalues.IBceAttrFieldMapValue;
import com.ai.bce.util.BServiceFactory;
public class ConfAttrFieldMapSVImpl implements IConfAttrFieldMapSV {
public IBceAttrFieldMapValue[] getAttrFieldMapValues(String cond,
int startIndex, int endIndex) throws RemoteException,Exception {
return getDao().getAttrFieldMapValues(cond, startIndex, endIndex);
}
public int getAttrFieldMapValuesCount(String cond) throws RemoteException,Exception {
return getDao().getAttrFieldMapValuesCount(cond);
}
public IBceAttrFieldMapValue getAttrFieldMapValue(String configId) throws RemoteException,Exception {
return getDao().getAttrFieldMapValue(configId);
}
public IConfAttrFieldMapDAO getDao() throws Exception{
return (IConfAttrFieldMapDAO) BServiceFactory.getService(IConfAttrFieldMapDAO.class);
}
}
| [
"chendb@asiainfo.com"
] | chendb@asiainfo.com |
bf5771fe7c609012ea5f1143644c73229b8e8d29 | 8c4c33c4d1ede60caebe1723a3b1a3c6a9bd6d58 | /spring-configuration/src/test/java/com/example/aop/CustomerServiceTest.java | 0c61a9120218c3df56c21d1616b7f47825f9c10e | [] | no_license | freebook1191/cloud-native-java | 4d1e3751bdf43d6a054f70b9a0e97d58ddf1a86c | 05823c2621b465d2953675e09d03aa26b0b2d598 | refs/heads/master | 2020-04-15T17:52:14.979816 | 2019-01-09T15:46:06 | 2019-01-09T15:46:06 | 164,891,119 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,082 | java | package com.example.aop;
import com.example.TestConfiguration;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.rule.OutputCapture;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import static org.hamcrest.Matchers.containsString;
@RunWith(SpringRunner.class)
@ContextConfiguration(classes = { ApplicationConfiguration.class,
TestConfiguration.class })
public class CustomerServiceTest {
@Rule
public OutputCapture outputCapture = new OutputCapture();
@Autowired
private CustomerService customerService;
@Test
public void findAll() throws Exception {
int size = this.customerService.findAll().size();
org.junit.Assert.assertEquals(size, 2);
String consoleOutput = this.outputCapture.toString();
Assert.assertThat(consoleOutput, containsString("starting @"));
Assert.assertThat(consoleOutput, containsString("finishing @"));
}
} | [
"josh@joshlong.com"
] | josh@joshlong.com |
1e8d5888bbc192da376ff7da1af8a8ccc3e2d670 | 8ce0c240112752d2a96a2ab2b2e7e9d1170cb4a1 | /objectbox/src/main/java/com/angcyo/objectbox/EntityLib.java | d3fa138bcb7700278e3e5e505dce3b79f1a05a71 | [] | no_license | angcyo/ObjectboxDemo | 40ee543a6fd391ddca4687aa23b087ad50df1406 | 15ffad4029166af8b04c29ec210bb487a9b0c75b | refs/heads/master | 2020-05-16T16:41:03.625244 | 2019-04-24T07:17:50 | 2019-04-24T07:17:50 | 183,171,009 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 351 | java | package com.angcyo.objectbox;
import io.objectbox.annotation.Entity;
import io.objectbox.annotation.Id;
/**
* Email:angcyo@126.com
*
* @author angcyo
* @date 2019/04/23
* Copyright (c) 2019 ShenZhen O&M Cloud Co., Ltd. All rights reserved.
*/
@Entity
public class EntityLib {
@Id
public long id;
public String name2 = "d_name";
}
| [
"angcyo@126.com"
] | angcyo@126.com |
82e668b06bcb56a768619d74a09f1b96223f01b4 | 423abe698ff96aff3c129a58bf85b572eec60e4a | /src/test/java/com/hazelcast/compatibilityV1/binary/CustomByteArraySerializer.java | e5b240b472d2079db74b2f36a6c784eac57ce6ed | [] | no_license | isabella232/hazelcast-serialization-compatibility | da6789e20609bef82fa330eb329163c9ae934d7c | 896ae945e8fa7065b75d7e4daa444ffd606b74d7 | refs/heads/master | 2023-03-15T15:56:32.462856 | 2016-03-18T16:13:14 | 2016-03-18T16:13:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,568 | java | /*
* Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hazelcast.compatibilityV1.binary;
import com.hazelcast.nio.serialization.ByteArraySerializer;
import java.io.IOException;
import java.nio.ByteBuffer;
public class CustomByteArraySerializer implements ByteArraySerializer<CustomByteArraySerializable> {
@Override
public int getTypeId() {
return ReferenceObjects.CUSTOM_BYTE_ARRAY_SERILAZABLE_ID;
}
@Override
public byte[] write(CustomByteArraySerializable object) throws IOException {
byte[] bytes = new byte[10];
ByteBuffer wrap = ByteBuffer.wrap(bytes);
wrap.putInt(object.i);
wrap.putFloat(object.f);
return bytes;
}
@Override
public CustomByteArraySerializable read(byte[] buffer) throws IOException {
ByteBuffer wrap = ByteBuffer.wrap(buffer);
return new CustomByteArraySerializable(wrap.getInt(), wrap.getFloat());
}
@Override
public void destroy() {
}
} | [
"sancar@hazelcast.com"
] | sancar@hazelcast.com |
053e2e231ba3614a34eab9b61c8e306ee50b4d5b | 571ce46236afb5d836b713c5f3cc165db5d2ae77 | /packages/apps/PrizeSettings/src/com/android/settings/PrizeBluLightTimePreference.java | bc21398e797dc9dc551b30117ca16683f08666d5 | [
"Apache-2.0"
] | permissive | sengeiou/prize | d6f56746ba82e0bbdaa47b5bea493ceddb0abd0c | e27911e194c604bf651f7bed0f5f9ce8f7dc8d4d | refs/heads/master | 2020-04-28T04:45:42.207852 | 2018-11-23T13:50:20 | 2018-11-23T13:50:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,461 | java | package com.android.settings;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.FragmentManager;
import android.app.TimePickerDialog;
import android.content.ContentResolver;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceViewHolder;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.TimePicker;
import android.provider.Settings;
import java.util.Calendar;
public class PrizeBluLightTimePreference extends Preference {
public static final String TAG = "PrizeBluLightPreference";
private Context mContext;
private TextView mModeStatus;
private int mHourOfDay;
private int mMinute;
private Callback mCallback;
public PrizeBluLightTimePreference(Context context, final FragmentManager mgr) {
super(context);
setLayoutResource(R.layout.prize_blulight_material_summary_right);
setWidgetLayoutResource(R.layout.prize_blulight_widget_text_right_arrow);
mContext = context;
setPersistent(false);
setOnPreferenceClickListener(new OnPreferenceClickListener(){
@Override
public boolean onPreferenceClick(Preference preference) {
TimePickerFragment frag = new TimePickerFragment();
frag.pref = PrizeBluLightTimePreference.this;
frag.show(mgr, PrizeBluLightTimePreference.class.getName());
return true;
}
});
}
public void setCallback(Callback callback) {
mCallback = callback;
}
@Override
public void onBindViewHolder(PreferenceViewHolder view) {
super.onBindViewHolder(view);
mModeStatus = (TextView) view.findViewById(R.id.mode_status);
final ContentResolver resolver = mContext.getContentResolver();
String mBluLightTimeStatus = Settings.System.getString(resolver, getKey());
if(mBluLightTimeStatus == null){
String key = getKey();
if(key.equals(Settings.System.PRIZE_BLULIGHT_START_TIME)){
mBluLightTimeStatus ="22:00";
} else if(key.equals(Settings.System.PRIZE_BLULIGHT_END_TIME)){
mBluLightTimeStatus ="07:00";
}
Settings.System.putString(resolver, getKey(),mBluLightTimeStatus);
}
setStatus(mBluLightTimeStatus);
}
public void setStatus(String modeStatus){
Log.d(TAG,"setStatus() modeStatus = "+modeStatus);
if(modeStatus != null && mModeStatus != null){
mModeStatus.setText(modeStatus);
}
}
public void setTime(int hourOfDay, int minute) {
if (mCallback != null && !mCallback.onSetTime(hourOfDay, minute)) return;
mHourOfDay = hourOfDay;
mMinute = minute;
Log.d(TAG,"setTime() mHourOfDay = "+mHourOfDay+", mMinute = "+mMinute);
updateSummary();
}
private void updateSummary() {
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, mHourOfDay);
c.set(Calendar.MINUTE, mMinute);
String hourAndMinute = formatTime(c.get(Calendar.HOUR_OF_DAY),c.get(Calendar.MINUTE));
setStatus(hourAndMinute);
}
private String formatTime(int hour, int minute){
String hourStr = null;
if(hour < 10){
hourStr = "0"+hour;
} else {
hourStr = ""+hour;
}
String minuteStr = null;
if(minute < 10){
minuteStr = "0"+minute;
} else {
minuteStr = ""+minute;
}
String hourAndMinute = hourStr+":"+minuteStr;
return hourAndMinute;
}
public static class TimePickerFragment extends DialogFragment implements
TimePickerDialog.OnTimeSetListener {
public PrizeBluLightTimePreference pref;
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
if(pref != null){
int[] mHourAndMinuteArr = PrizeBluLightUtil.parseBluLightTime(pref.getContext(),pref.getKey());
final Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, mHourAndMinuteArr[0]);
calendar.set(Calendar.MINUTE, mHourAndMinuteArr[1]);
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
Log.d("BluLight","onCreateDialog() hour = "+hour+", minute = "+minute);
return new TimePickerDialog(getActivity(), this, hour, minute,
DateFormat.is24HourFormat(getActivity()));
}
return super.onCreateDialog(savedInstanceState);
}
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
if (pref != null) {
pref.setTime(hourOfDay, minute);
}
}
}
public interface Callback {
boolean onSetTime(int hour, int minute);
}
}
| [
"18218724438@163.com"
] | 18218724438@163.com |
72599514da79e6fcd5fded93dfb62b460772c764 | bd6920bbe8762e1ff8fd53bd1844d95cee1920c7 | /src/br/com/nalthus/efdpc/modelo/RC990.java | dd37d20fa502032b881da9dc92c1f7ae111da51f | [] | no_license | tbaiocco/sped | 4f08a4427f9e1772ce0ac5fec5050fa702354755 | 19988093ce45ed10d89a718f6e1c457a080e0818 | refs/heads/master | 2021-05-09T14:37:30.978380 | 2018-01-26T15:32:37 | 2018-01-26T15:32:37 | 119,068,923 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package br.com.nalthus.efdpc.modelo;
public class RC990 {
public String REG = "C990";
public String QTD_LIN_C;
public String getQTD_LIN_C() {
return QTD_LIN_C;
}
public void setQTD_LIN_C(String qtd_lin_c) {
QTD_LIN_C = qtd_lin_c;
}
public String getREG() {
return REG;
}
public void setREG(String reg) {
REG = reg;
}
}
| [
"teo@rsdata.com.br"
] | teo@rsdata.com.br |
500f70a0b0ba749b1296627e56a5e6348a941d38 | 64bbf74f3eb6448aae6485c3ab80375f67f6071e | /addOns/network/src/main/java/org/zaproxy/addon/network/internal/ui/HttpProxyExclusionTableModel.java | 8ea4b7af191d2f7ae5e83dabceb20862c3ab0946 | [
"Apache-2.0"
] | permissive | zaproxy/zap-extensions | 0ce06cd939b5c2b4183c0ccb399b625d1674667a | ed8f0469cd7ed4bfcafda99849736ab138942861 | refs/heads/main | 2023-08-25T05:10:57.321613 | 2023-08-24T13:50:37 | 2023-08-24T13:50:37 | 35,210,580 | 790 | 977 | Apache-2.0 | 2023-09-14T18:48:40 | 2015-05-07T09:17:13 | Java | UTF-8 | Java | false | false | 3,372 | java | /*
* Zed Attack Proxy (ZAP) and its related class files.
*
* ZAP is an HTTP/HTTPS proxy for assessing web application security.
*
* Copyright 2022 The ZAP Development Team
*
* 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.zaproxy.addon.network.internal.ui;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.parosproxy.paros.Constant;
import org.zaproxy.addon.network.internal.client.HttpProxyExclusion;
import org.zaproxy.zap.view.AbstractMultipleOptionsTableModel;
@SuppressWarnings("serial")
public class HttpProxyExclusionTableModel
extends AbstractMultipleOptionsTableModel<HttpProxyExclusion> {
private static final long serialVersionUID = 1L;
private static final String[] COLUMN_NAMES = {
Constant.messages.getString(
"network.ui.options.connection.httpproxy.exclusions.table.header.enabled"),
Constant.messages.getString(
"network.ui.options.connection.httpproxy.exclusions.table.header.host")
};
private static final int COLUMN_COUNT = COLUMN_NAMES.length;
private List<HttpProxyExclusion> exclusions;
public HttpProxyExclusionTableModel() {
super();
exclusions = Collections.emptyList();
}
@Override
public String getColumnName(int col) {
return COLUMN_NAMES[col];
}
@Override
public int getColumnCount() {
return COLUMN_COUNT;
}
@Override
public int getRowCount() {
return exclusions.size();
}
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
return columnIndex == 0;
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
switch (columnIndex) {
case 0:
return getElement(rowIndex).isEnabled();
case 1:
return getElement(rowIndex).getHost().pattern();
default:
return null;
}
}
@Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
if (columnIndex == 0 && aValue instanceof Boolean) {
exclusions.get(rowIndex).setEnabled((Boolean) aValue);
fireTableCellUpdated(rowIndex, columnIndex);
}
}
@Override
public Class<?> getColumnClass(int c) {
if (c == 0) {
return Boolean.class;
}
return String.class;
}
public void setHttpProxyExclusions(List<HttpProxyExclusion> exclusions) {
this.exclusions = new ArrayList<>(exclusions.size());
for (HttpProxyExclusion exclusion : exclusions) {
this.exclusions.add(new HttpProxyExclusion(exclusion));
}
fireTableDataChanged();
}
@Override
public List<HttpProxyExclusion> getElements() {
return exclusions;
}
}
| [
"thc202@gmail.com"
] | thc202@gmail.com |
3b7a99c7995dce2bcb54f1d24a280e2fce29a2e2 | 83110fbb179713c411ddf301c90ef4b814285846 | /src/FindAllByDnsNameResponse.java | a778b3270df66200566549a0bf155b9ab904de74 | [] | no_license | mikelopez/jvm | f10590edf42b498f2d81dec71b0fee120e381c9a | 36a960897062224eabd0c18a1434f7c8961ee81c | refs/heads/master | 2021-01-19T05:36:54.710665 | 2013-06-09T04:36:41 | 2013-06-09T04:36:41 | 3,783,647 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,036 | java |
package com.vmware.vim25;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="returnval" type="{urn:vim25}ManagedObjectReference" maxOccurs="unbounded"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"returnval"
})
@XmlRootElement(name = "FindAllByDnsNameResponse")
public class FindAllByDnsNameResponse {
@XmlElement(required = true)
protected List<ManagedObjectReference> returnval;
/**
* Gets the value of the returnval property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the returnval property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getReturnval().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ManagedObjectReference }
*
*
*/
public List<ManagedObjectReference> getReturnval() {
if (returnval == null) {
returnval = new ArrayList<ManagedObjectReference>();
}
return this.returnval;
}
}
| [
"dev@scidentify.info"
] | dev@scidentify.info |
d23714c3cca2bc8bcd35da09454c4f0ff50eb075 | 9bf14b4d2eac89c403109c15a5d48127a81ef8a9 | /src/minecraft/net/minecraft/world/gen/layer/GenLayerShore.java | 6f646d994cd574cd88bd19619e498369cfe0dc97 | [
"MIT"
] | permissive | mchimsak/VodkaSrc | e6d7e968b645566b3eeb1c0995c8d65afc983d1e | 8f0cf23bac81c6bdf784228616f54afa84d03757 | refs/heads/master | 2020-05-01T08:48:11.781283 | 2018-11-20T05:46:18 | 2018-11-20T05:46:18 | 177,386,099 | 1 | 0 | MIT | 2019-03-24T07:59:07 | 2019-03-24T07:59:06 | null | UTF-8 | Java | false | false | 7,836 | java | package net.minecraft.world.gen.layer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenJungle;
import net.minecraft.world.biome.BiomeGenMesa;
public class GenLayerShore extends GenLayer
{
public GenLayerShore(long p_i2130_1_, GenLayer p_i2130_3_)
{
super(p_i2130_1_);
this.parent = p_i2130_3_;
}
/**
* Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
* amounts, or biomeList[] indices based on the particular GenLayer subclass.
*/
public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
{
int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2);
int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);
for (int i = 0; i < areaHeight; ++i)
{
for (int j = 0; j < areaWidth; ++j)
{
this.initChunkSeed((long)(j + areaX), (long)(i + areaY));
int k = aint[j + 1 + (i + 1) * (areaWidth + 2)];
BiomeGenBase biomegenbase = BiomeGenBase.getBiome(k);
if (k == BiomeGenBase.mushroomIsland.biomeID)
{
int j2 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
int i3 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
int l3 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
int k4 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];
if (j2 != BiomeGenBase.ocean.biomeID && i3 != BiomeGenBase.ocean.biomeID && l3 != BiomeGenBase.ocean.biomeID && k4 != BiomeGenBase.ocean.biomeID)
{
aint1[j + i * areaWidth] = k;
}
else
{
aint1[j + i * areaWidth] = BiomeGenBase.mushroomIslandShore.biomeID;
}
}
else if (biomegenbase != null && biomegenbase.getBiomeClass() == BiomeGenJungle.class)
{
int i2 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
int l2 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
int k3 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
int j4 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];
if (this.func_151631_c(i2) && this.func_151631_c(l2) && this.func_151631_c(k3) && this.func_151631_c(j4))
{
if (!isBiomeOceanic(i2) && !isBiomeOceanic(l2) && !isBiomeOceanic(k3) && !isBiomeOceanic(j4))
{
aint1[j + i * areaWidth] = k;
}
else
{
aint1[j + i * areaWidth] = BiomeGenBase.beach.biomeID;
}
}
else
{
aint1[j + i * areaWidth] = BiomeGenBase.jungleEdge.biomeID;
}
}
else if (k != BiomeGenBase.extremeHills.biomeID && k != BiomeGenBase.extremeHillsPlus.biomeID && k != BiomeGenBase.extremeHillsEdge.biomeID)
{
if (biomegenbase != null && biomegenbase.isSnowyBiome())
{
this.func_151632_a(aint, aint1, j, i, areaWidth, k, BiomeGenBase.coldBeach.biomeID);
}
else if (k != BiomeGenBase.mesa.biomeID && k != BiomeGenBase.mesaPlateau_F.biomeID)
{
if (k != BiomeGenBase.ocean.biomeID && k != BiomeGenBase.deepOcean.biomeID && k != BiomeGenBase.river.biomeID && k != BiomeGenBase.swampland.biomeID)
{
int l1 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
int k2 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
int j3 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
int i4 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];
if (!isBiomeOceanic(l1) && !isBiomeOceanic(k2) && !isBiomeOceanic(j3) && !isBiomeOceanic(i4))
{
aint1[j + i * areaWidth] = k;
}
else
{
aint1[j + i * areaWidth] = BiomeGenBase.beach.biomeID;
}
}
else
{
aint1[j + i * areaWidth] = k;
}
}
else
{
int l = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
int i1 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
int j1 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
int k1 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];
if (!isBiomeOceanic(l) && !isBiomeOceanic(i1) && !isBiomeOceanic(j1) && !isBiomeOceanic(k1))
{
if (this.func_151633_d(l) && this.func_151633_d(i1) && this.func_151633_d(j1) && this.func_151633_d(k1))
{
aint1[j + i * areaWidth] = k;
}
else
{
aint1[j + i * areaWidth] = BiomeGenBase.desert.biomeID;
}
}
else
{
aint1[j + i * areaWidth] = k;
}
}
}
else
{
this.func_151632_a(aint, aint1, j, i, areaWidth, k, BiomeGenBase.stoneBeach.biomeID);
}
}
}
return aint1;
}
private void func_151632_a(int[] p_151632_1_, int[] p_151632_2_, int p_151632_3_, int p_151632_4_, int p_151632_5_, int p_151632_6_, int p_151632_7_)
{
if (isBiomeOceanic(p_151632_6_))
{
p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_6_;
}
else
{
int i = p_151632_1_[p_151632_3_ + 1 + (p_151632_4_ + 1 - 1) * (p_151632_5_ + 2)];
int j = p_151632_1_[p_151632_3_ + 1 + 1 + (p_151632_4_ + 1) * (p_151632_5_ + 2)];
int k = p_151632_1_[p_151632_3_ + 1 - 1 + (p_151632_4_ + 1) * (p_151632_5_ + 2)];
int l = p_151632_1_[p_151632_3_ + 1 + (p_151632_4_ + 1 + 1) * (p_151632_5_ + 2)];
if (!isBiomeOceanic(i) && !isBiomeOceanic(j) && !isBiomeOceanic(k) && !isBiomeOceanic(l))
{
p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_6_;
}
else
{
p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_7_;
}
}
}
private boolean func_151631_c(int p_151631_1_)
{
return BiomeGenBase.getBiome(p_151631_1_) != null && BiomeGenBase.getBiome(p_151631_1_).getBiomeClass() == BiomeGenJungle.class ? true : p_151631_1_ == BiomeGenBase.jungleEdge.biomeID || p_151631_1_ == BiomeGenBase.jungle.biomeID || p_151631_1_ == BiomeGenBase.jungleHills.biomeID || p_151631_1_ == BiomeGenBase.forest.biomeID || p_151631_1_ == BiomeGenBase.taiga.biomeID || isBiomeOceanic(p_151631_1_);
}
private boolean func_151633_d(int p_151633_1_)
{
return BiomeGenBase.getBiome(p_151633_1_) instanceof BiomeGenMesa;
}
}
| [
"wyy-666"
] | wyy-666 |
cfd4d8b1da1ed4492fc2fd403da77f0274614d4a | 83593598f21cba234f08eca4dec44d2f73a6052d | /prj/otcol/web-mgr-platform/src/main/java/gnnt/MEBS/timebargain/manage/model/DelayStatusLocal.java | 413f2790c021773407aa489ffae73306d2fcf246 | [
"Apache-2.0"
] | permissive | bigstar18/prjs | 23a04309a51b0372ddf6c391ee42270e640ec13c | c29da4d0892ce43e074d9e9831f1eedf828cd9d8 | refs/heads/master | 2021-05-31T19:55:16.217893 | 2016-06-24T02:35:31 | 2016-06-24T02:35:31 | 42,025,473 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,155 | java | package gnnt.MEBS.timebargain.manage.model;
import java.io.Serializable;
public class DelayStatusLocal
implements Serializable
{
private static final long serialVersionUID = 1L;
private String tradeDate;
private String status;
private Long sectionID;
private String note;
private String recoverTime;
public String getNote()
{
return this.note;
}
public void setNote(String paramString)
{
this.note = paramString;
}
public String getRecoverTime()
{
return this.recoverTime;
}
public void setRecoverTime(String paramString)
{
this.recoverTime = paramString;
}
public Long getSectionID()
{
return this.sectionID;
}
public void setSectionID(Long paramLong)
{
this.sectionID = paramLong;
}
public String getStatus()
{
return this.status;
}
public void setStatus(String paramString)
{
this.status = paramString;
}
public String getTradeDate()
{
return this.tradeDate;
}
public void setTradeDate(String paramString)
{
this.tradeDate = paramString;
}
}
| [
"hxx@hxx-PC"
] | hxx@hxx-PC |
246eb67274f5f6a4a75c770b8c11bbb625e00222 | 4433c9767b109bc4eae917a2031508775d20ac19 | /SPRING_CLOUD_FRONT_DEMO/src/main/java/com/hs/web/front/base/conditional/CustomRequestMappingHandlerMapping.java | 80b741f6c8e6bb32869c07ac6b40b2484d482115 | [] | no_license | shuanger051/SpringCloud | 361d9b3ef02dc6827ed248d4bd1e4c78691b8ff6 | e49f95b0755dfa270cf56c58fbe08f38250c5c41 | refs/heads/master | 2021-09-10T09:12:38.402185 | 2018-03-23T10:08:58 | 2018-03-23T10:08:58 | 116,376,056 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,359 | java | package com.hs.web.front.base.conditional;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.web.servlet.mvc.condition.RequestCondition;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import java.lang.reflect.Method;
/**
* Project : SPRING_CLOUD_EUREKA_DEMO
* PackageName : com.hs.web.app.core.conditional
* Author : caijl
* Date : 2018/1/5
* Time : 14:40
* Description : 为使自定义@ApiVersion注解生效,扩展原版的HandlerMapping
* 系统版本 : 1.0
*/
public class CustomRequestMappingHandlerMapping extends RequestMappingHandlerMapping {
@Override
protected RequestCondition<ApiVesrsionCondition> getCustomTypeCondition(Class<?> handlerType) {
ApiVersion apiVersion = AnnotationUtils.findAnnotation(handlerType, ApiVersion.class);
return createCondition(apiVersion);
}
@Override
protected RequestCondition<ApiVesrsionCondition> getCustomMethodCondition(Method method) {
ApiVersion apiVersion = AnnotationUtils.findAnnotation(method, ApiVersion.class);
return createCondition(apiVersion);
}
private RequestCondition<ApiVesrsionCondition> createCondition(ApiVersion apiVersion) {
return apiVersion == null ? null : new ApiVesrsionCondition(apiVersion.value());
}
}
| [
"shuanger051@163.com"
] | shuanger051@163.com |
0d7c2702ec9b8917604d79f0fdedd5fe88bcda2f | d18af2a6333b1a868e8388f68733b3fccb0b4450 | /java/src/com/google/android/gms/internal/zzbn$zza.java | b47b8a1a4b6c95dce9d8551ba0182e6ce4486aae | [] | no_license | showmaxAlt/showmaxAndroid | 60576436172495709121f08bd9f157d36a077aad | d732f46d89acdeafea545a863c10566834ba1dec | refs/heads/master | 2021-03-12T20:01:11.543987 | 2015-08-19T20:31:46 | 2015-08-19T20:31:46 | 41,050,587 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,958 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.google.android.gms.internal;
import android.os.Binder;
import android.os.IBinder;
import android.os.Parcel;
import android.os.RemoteException;
import com.google.android.gms.dynamic.zzd;
// Referenced classes of package com.google.android.gms.internal:
// zzbn
public static abstract class zza.zzle extends Binder
implements zzbn
{
private static class zza
implements zzbn
{
private IBinder zzle;
public IBinder asBinder()
{
return zzle;
}
public IBinder zza(zzd zzd1, int i)
throws RemoteException
{
Parcel parcel;
Parcel parcel1;
parcel = Parcel.obtain();
parcel1 = Parcel.obtain();
parcel.writeInterfaceToken("com.google.android.gms.ads.internal.client.IMobileAdsSettingManagerCreator");
if (zzd1 == null)
{
break MISSING_BLOCK_LABEL_73;
}
zzd1 = zzd1.asBinder();
_L1:
parcel.writeStrongBinder(zzd1);
parcel.writeInt(i);
zzle.transact(1, parcel, parcel1, 0);
parcel1.readException();
zzd1 = parcel1.readStrongBinder();
parcel1.recycle();
parcel.recycle();
return zzd1;
zzd1 = null;
goto _L1
zzd1;
parcel1.recycle();
parcel.recycle();
throw zzd1;
}
zza(IBinder ibinder)
{
zzle = ibinder;
}
}
public static zzbn zzk(IBinder ibinder)
{
if (ibinder == null)
{
return null;
}
android.os.IInterface iinterface = ibinder.queryLocalInterface("com.google.android.gms.ads.internal.client.IMobileAdsSettingManagerCreator");
if (iinterface != null && (iinterface instanceof zzbn))
{
return (zzbn)iinterface;
} else
{
return new zza(ibinder);
}
}
public boolean onTransact(int i, Parcel parcel, Parcel parcel1, int j)
throws RemoteException
{
switch (i)
{
default:
return super.onTransact(i, parcel, parcel1, j);
case 1598968902:
parcel1.writeString("com.google.android.gms.ads.internal.client.IMobileAdsSettingManagerCreator");
return true;
case 1: // '\001'
parcel.enforceInterface("com.google.android.gms.ads.internal.client.IMobileAdsSettingManagerCreator");
parcel = zza(com.google.android.gms.dynamic.zau(parcel.readStrongBinder()), parcel.readInt());
parcel1.writeNoException();
parcel1.writeStrongBinder(parcel);
return true;
}
}
}
| [
"invisible@example.com"
] | invisible@example.com |
b876f4baf8924bb61d457b5a2b55d209620c78bb | 365267d7941f76c97fac8af31a788d8c0fb2d384 | /src/main/java/net/minecraft/client/renderer/entity/RenderLightningBolt.java | 2ee33e04519d36c46afd07bdddf86196eafcd71d | [
"MIT"
] | permissive | potomy/client | 26d8c31657485f216639efd13b2fdda67570d9b5 | c01d23eb05ed83abb4fee00f9bf603b6bc3e2e27 | refs/heads/master | 2021-06-21T16:02:26.920860 | 2017-08-02T02:03:49 | 2017-08-02T02:03:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,051 | java | package net.minecraft.client.renderer.entity;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import java.util.Random;
public class RenderLightningBolt extends Render
{
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityLightningBolt p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
Tessellator var10 = Tessellator.instance;
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
double[] var11 = new double[8];
double[] var12 = new double[8];
double var13 = 0.0D;
double var15 = 0.0D;
Random var17 = new Random(p_76986_1_.boltVertex);
for (int var18 = 7; var18 >= 0; --var18)
{
var11[var18] = var13;
var12[var18] = var15;
var13 += (double)(var17.nextInt(11) - 5);
var15 += (double)(var17.nextInt(11) - 5);
}
for (int var45 = 0; var45 < 4; ++var45)
{
Random var46 = new Random(p_76986_1_.boltVertex);
for (int var19 = 0; var19 < 3; ++var19)
{
int var20 = 7;
int var21 = 0;
if (var19 > 0)
{
var20 = 7 - var19;
}
if (var19 > 0)
{
var21 = var20 - 2;
}
double var22 = var11[var20] - var13;
double var24 = var12[var20] - var15;
for (int var26 = var20; var26 >= var21; --var26)
{
double var27 = var22;
double var29 = var24;
if (var19 == 0)
{
var22 += (double)(var46.nextInt(11) - 5);
var24 += (double)(var46.nextInt(11) - 5);
}
else
{
var22 += (double)(var46.nextInt(31) - 15);
var24 += (double)(var46.nextInt(31) - 15);
}
var10.startDrawing(5);
float var31 = 0.5F;
var10.setColorRGBA_F(0.9F * var31, 0.9F * var31, 1.0F * var31, 0.3F);
double var32 = 0.1D + (double)var45 * 0.2D;
if (var19 == 0)
{
var32 *= (double)var26 * 0.1D + 1.0D;
}
double var34 = 0.1D + (double)var45 * 0.2D;
if (var19 == 0)
{
var34 *= (double)(var26 - 1) * 0.1D + 1.0D;
}
for (int var36 = 0; var36 < 5; ++var36)
{
double var37 = p_76986_2_ + 0.5D - var32;
double var39 = p_76986_6_ + 0.5D - var32;
if (var36 == 1 || var36 == 2)
{
var37 += var32 * 2.0D;
}
if (var36 == 2 || var36 == 3)
{
var39 += var32 * 2.0D;
}
double var41 = p_76986_2_ + 0.5D - var34;
double var43 = p_76986_6_ + 0.5D - var34;
if (var36 == 1 || var36 == 2)
{
var41 += var34 * 2.0D;
}
if (var36 == 2 || var36 == 3)
{
var43 += var34 * 2.0D;
}
var10.addVertex(var41 + var22, p_76986_4_ + (double)(var26 * 16), var43 + var24);
var10.addVertex(var37 + var27, p_76986_4_ + (double)((var26 + 1) * 16), var39 + var29);
}
var10.draw();
}
}
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityLightningBolt p_110775_1_)
{
return null;
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
{
return this.getEntityTexture((EntityLightningBolt)p_110775_1_);
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
this.doRender((EntityLightningBolt)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
}
| [
"dav.nico@orange.fr"
] | dav.nico@orange.fr |
2b67ac146342314d50618b9295dc6305296e923a | 4901cda2ff40bea3a4dbe9c9a32ea7b43e5d5393 | /java01/src/step17/Exam083_2.java | fd07f039adbff45ca893ad2608dfa3d1dbc165ec | [] | no_license | Liamkimjihwan/java01 | 287adc817ba7c7c4e711c392cb78e965d967742c | 3e0c75e63b81acbb94c9e91a63251a252c18af77 | refs/heads/master | 2021-06-07T16:22:28.061338 | 2016-11-04T11:38:44 | 2016-11-04T11:38:44 | 72,842,529 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,320 | java | package step17;
public class Exam083_2 {
static int plus(int a, int b) {return a + b;}
static int minus(int a, int b) {return a - b;}
static int multiple(int a, int b) {return a * b;}
static int divide(int a, int b) {return a / b;}
static class Student {
String name;
String email;
String tel;
int age;
boolean working;
// 인스턴스 메서드
// => ↓ 생성자인데 인스턴스의 값을 다루는 모든 메서드는 그 데이터 타입의 '연산자'라 할 수 있다.
// 인스턴스 생성할 때 최초로 자동으로 호출되는 메서드를 '생성자'라 한다.
Student(String name, String email, String tel, int age, boolean working) { // ★
this.name = name;
this.email = email;
this.tel = tel;
this.age = age;
this.working = working;
}
void printStudent() { // ★ ★★ = 연산자
System.out.printf("%s,%s,%s,%d,%b\n",
this.name, this.email, this.tel, this.age, this.working);
}
}
static class Calculator {
static int sum = 0;
static void plus(int a) {sum += a;}
static void minus(int a) {sum -= a;}
static void multiple(int a) {sum *= a;}
static void divide(int a) {sum /= a;}
}
public static void main(String[] args) {
int sum = 0;
sum = plus(3, 2);
sum = multiple(sum, 3);
sum = minus(sum, 1);
System.out.println(sum);
int sum2 = 0;
sum2 = plus(2, 3);
sum2 = multiple(sum2, 4);
sum2 = minus(sum2, 3);
System.out.println(sum2);
// 인스턴스를 생성할 때 값을 넘겨주면
Student[] arr = new Student[3];
arr[0] = new Student("홍길동", "hong@test.com", "111-1111", 20, true);// 생성자 호출명
arr[1] = new Student("임꺽정", "leem@test.com", "111-1112", 30, false);
arr[2] = new Student("유관순", "yoo@test.com", "111-1113", 40, true);
// 그 값을 받을수 있는 생성자를 호출한다.
// 만약 그 값을 받을 수 있는 생성자를 못 찾으면 컴파일 오류
//생성자는 다음과 같이 나중에 따로 호출할 수 없다.
// arr[0] Student("홍길동", "hong@test.com", "111-1111", 20, true); // 오류
for (Student student : arr) {
student.printStudent();
}
Calculator.plus(3);
Calculator.plus(2);
Calculator.multiple(3);
Calculator.minus(1);
System.out.println(Calculator.sum);
}
}
| [
"wwwwwwlghskdlekd@naver.com"
] | wwwwwwlghskdlekd@naver.com |
f6623a78acf09d7c85be3faae98a130899a867da | d16f17f3b9d0aa12c240d01902a41adba20fad12 | /src/leetcode/leetcode14xx/leetcode1452/SolutionTest.java | 225b047213835e2228f758ea7a42b63846b2b44c | [] | no_license | redsun9/leetcode | 79f9293b88723d2fd123d9e10977b685d19b2505 | 67d6c16a1b4098277af458849d352b47410518ee | refs/heads/master | 2023-06-23T19:37:42.719681 | 2023-06-09T21:11:39 | 2023-06-09T21:11:39 | 242,967,296 | 38 | 3 | null | null | null | null | UTF-8 | Java | false | false | 735 | java | package leetcode.leetcode14xx.leetcode1452;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertEquals;
class SolutionTest {
@Test
void test1() {
List<List<String>> favoriteCompanies =
Arrays.asList(
Arrays.asList("leetcode", "google", "facebook"),
Arrays.asList("google", "microsoft"),
Arrays.asList("google", "facebook"),
Arrays.asList("google"),
Arrays.asList("amazon")
);
assertEquals(Arrays.asList(0, 1, 4), new Solution().peopleIndexes(favoriteCompanies));
}
} | [
"mokeev.vladimir@gmail.com"
] | mokeev.vladimir@gmail.com |
c668542b891e26de862a04d932dec4cf3662fdc4 | 7569f9a68ea0ad651b39086ee549119de6d8af36 | /cocoon-2.1.9/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidatorTag.java | 9d42be914ab4823d3ab692a8e852b5b183295f58 | [
"Apache-2.0"
] | permissive | tpso-src/cocoon | 844357890f8565c4e7852d2459668ab875c3be39 | f590cca695fd9930fbb98d86ae5f40afe399c6c2 | refs/heads/master | 2021-01-10T02:45:37.533684 | 2015-07-29T18:47:11 | 2015-07-29T18:47:11 | 44,549,791 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,339 | java | /*
* Copyright 1999-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 org.apache.cocoon.faces.taglib;
import org.apache.cocoon.taglib.TagSupport;
import org.apache.cocoon.faces.FacesUtils;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import javax.faces.component.EditableValueHolder;
import javax.faces.validator.Validator;
/**
* Base class for validator tags.
* Can be extended to implement custom validators.
*
* @version CVS $Id: ValidatorTag.java 53791 2004-10-05 13:16:15Z vgritsenko $
*/
public class ValidatorTag extends TagSupport {
private String validatorId;
public String getValidatorId() {
return this.validatorId;
}
public void setValidatorId(String validatorId) {
this.validatorId = validatorId;
}
public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
throws SAXException {
UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
if (tag == null) {
throw new SAXException("Tag <" + getClass().getName() + "> have to be nested within a UIComponentTag");
}
if (!tag.getCreated()) {
return 0;
}
Validator validator = createValidator();
((EditableValueHolder)tag.getComponentInstance()).addValidator(validator);
return SKIP_BODY;
}
/**
* Override to create custom validator
*/
protected Validator createValidator() {
final UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
String validatorIdVal = (String) tag.evaluate(validatorId);
return tag.getApplication().createValidator(validatorIdVal);
}
public void recycle() {
super.recycle();
this.validatorId = null;
}
}
| [
"ms@tpso.com"
] | ms@tpso.com |
bb664986d0a99f7d6bcfba85444a0aa545692fa1 | e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3 | /src/chosun/ciis/ad/com/servlet/AdComServlet.java | 628d1502a1a0936d5accd9b736b1f8a8a6da959c | [] | no_license | nosmoon/misdevteam | 4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60 | 1829d5bd489eb6dd307ca244f0e183a31a1de773 | refs/heads/master | 2020-04-15T15:57:05.480056 | 2019-01-10T01:12:01 | 2019-01-10T01:12:01 | 164,812,547 | 1 | 0 | null | null | null | null | UHC | Java | false | false | 5,501 | java | /***************************************************************************************************
* 파일명 : AdComServlet.java
* 기능 : 광고관리 - 업무연락 서블릿
* 작성일자 :
* 작성자 :
***************************************************************************************************/
/***************************************************************************************************
* 수정내역 :
* 수정자 :
* 수정일자 :
* 백업 :
***************************************************************************************************/
package chosun.ciis.ad.com.servlet;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import somo.framework.expt.AppException;
import somo.framework.expt.SysException;
import chosun.ciis.ad.com.wb.AdCom1400WB;
import chosun.ciis.ad.com.wb.AdCom1500WB;
import chosun.ciis.co.base.servlet.BaseServlet;
import chosun.ciis.co.base.wb.BaseWB;
public class AdComServlet extends BaseServlet {
/**
* 상속하는 ControllerServlet 의 doGet, doPost 메소드에서 호출된다.<br>
* 요청된 URL을 파싱하여 pid를 얻어 excuteWorker()를 호출하며,<br>
* 리턴된 nextPage로 request를 forward한다.
*
* @param req request
* @param res response
* @throws IOException
* @throws ServletException
*/
public void process(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException {
String requestURI = null;
String strPid = null;
int iPid = 0;
String nextPage = null;
try {
String servletMappedUrl = "/ad/com/";
iPid = extractPid(req, servletMappedUrl);
System.out.println("AdComServlet : process : iPid : " + iPid);
nextPage = executeWorker(req, res, iPid);
System.out.println("AdComServlet : process : nextPage : " + nextPage);
}
catch (AppException ae) {
req.setAttribute("appException", ae);
nextPage = "/common/jsp/app_error.jsp";
}
catch (SysException se) {
req.setAttribute("sysException", se);
nextPage = "/common/jsp/sys_error.jsp";
}
catch (Exception e) {
req.setAttribute("sysException", new SysException(e));
nextPage = "/common/jsp/sys_error.jsp";
}
RequestDispatcher rd = getServletContext().getRequestDispatcher(
nextPage);
rd.forward(req, res);
}
/**
* AdComWBMapping.java 에 정의된 상수에 따라 분기하여 Worker Bean을 생성하고,<br>
* 메소드를 호출한다.
* 결과에 따라 nextPage를 반환한다.
*
* @param req request
* @param res response
* @param pid process id
* @return forward할 nextPage
* @throws SysException
* @throws AppException
*/
public String executeWorker(HttpServletRequest req, HttpServletResponse res,
int pid) throws AppException, IOException {
String nextPage = null;
BaseWB workbean = null;
switch (pid) {
case AdComWBMapping.AD_COM_1410: //광고원고수배장 / 중점확인광고리스트 조회
workbean = new AdCom1400WB();
((AdCom1400WB)workbean).ad_com_1410_l(req, res);
nextPage = "/jsp/ad/com/ad_com_1410_l.jsp";
break;
case AdComWBMapping.AD_COM_1420: //광고원고수배장 등록, 수정, 삭제
workbean = new AdCom1400WB();
((AdCom1400WB)workbean).ad_com_1420_a(req, res);
nextPage = "/common/jsp/resultMsg.jsp";
break;
case AdComWBMapping.AD_COM_1430: //중점확인광고리스트 등록, 수정, 삭제
workbean = new AdCom1400WB();
((AdCom1400WB)workbean).ad_com_1430_a(req, res);
nextPage = "/common/jsp/resultMsg.jsp";
break;
case AdComWBMapping.AD_COM_1440: //광고원고수배장 출력
nextPage = "/jsp/ad/com/ad_com_1440_p.jsp";
break;
case AdComWBMapping.AD_COM_1450: //중점확인광고리스트 출력
nextPage = "/jsp/ad/com/ad_com_1450_p.jsp";
break;
case AdComWBMapping.AD_COM_1510: //공문 - 목록조회
workbean = new AdCom1500WB();
((AdCom1500WB)workbean).ad_com_1510_l(req, res);
nextPage = "/jsp/ad/com/ad_com_1510_l.jsp";
break;
case AdComWBMapping.AD_COM_1520: //공문 - 상세조회
workbean = new AdCom1500WB();
((AdCom1500WB)workbean).ad_com_1520_s(req, res);
nextPage = "/jsp/ad/com/ad_com_1520_s.jsp";
break;
case AdComWBMapping.AD_COM_1530: //공문 - 등록,수정,삭제
workbean = new AdCom1500WB();
((AdCom1500WB)workbean).ad_com_1530_a(req, res);
nextPage = "/common/jsp/resultMsg.jsp";
break;
default:
throw new SysException(new Exception("요청한 페이지를 찾을 수 없습니다."));
}
return nextPage;
}
}
| [
"DLCOM000@172.16.30.11"
] | DLCOM000@172.16.30.11 |
0f7634e53f96966c9e85063c9828eead1db33a6c | 243a31a30a60dbf7521e2e0d780177b5851d3b71 | /core-java-modules/core-java-lang-syntax/src/main/java/www/tom/com/oop/interfaceclass/behavioralfunctionality/Employee.java | 974a4fc5b30714cc8d068a7efbba42ca2ac996c4 | [] | no_license | tomlxq/tutorials | db6c5524d0324631c4b5d9338ed9e20b9efa87f7 | 3bd7739e89b6d5dff3e4518c0b8fe98425600809 | refs/heads/master | 2020-12-19T07:13:42.578910 | 2020-07-19T16:23:10 | 2020-07-19T16:23:10 | 235,655,480 | 0 | 0 | null | 2020-06-13T02:00:22 | 2020-01-22T20:00:48 | Java | UTF-8 | Java | false | false | 324 | java | package www.tom.com.oop.interfaceclass.behavioralfunctionality;
/**
* 功能描述
*
* @author TomLuo
* @date 2020/1/19
*/
public class Employee {
private double salary;
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
} | [
"21429503@qq.com"
] | 21429503@qq.com |
f31f9c6f64d51af70c691620056aec5783dc8707 | 3789ffd6dd597b701c49f899f7737f8050d24883 | /Lesson 04 arrays/src/d/arrays/copy/ArrayCopy.java | 3acaa4271e95906dc54f9b0e0ee61ae4e6688ec6 | [] | no_license | eldarba/qa-java-54914.7-tel-aviv | 1549daf8f955ffcfe22dc4846defa3c9995e1338 | 36bf368b9625e0c470c73a1d34a955d6b00dd09f | refs/heads/master | 2023-01-05T11:59:25.179244 | 2020-10-28T14:23:15 | 2020-10-28T14:23:15 | 303,962,069 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 633 | java | package d.arrays.copy;
import java.util.Arrays;
public class ArrayCopy {
public static void main(String[] args) {
// create the original array
int[] arr = { 2, 4, 6 };
System.out.println(Arrays.toString(arr));
// to resize create another array
int[] arrTemp = new int[arr.length + 2];
// System.out.println(Arrays.toString(arrTemp));
// array copy (from original to the new array)
System.arraycopy(arr, 0, arrTemp, 0, arr.length);
// System.out.println(Arrays.toString(arrTemp));
// Reassign address of arr to the new array object
arr = arrTemp;
System.out.println(Arrays.toString(arr));
}
}
| [
"eldarba@gmail.com"
] | eldarba@gmail.com |
11dd229643a09916075c74ae10305deb334c6121 | 077f81916b719a57435ae579628977c3ebbc1478 | /trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/xml/parse/ColorParserFactory.java | 8ec8c23ae79e2d4ede5d39a20199d39cc2bfe8f5 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | m-y-mo/myfaces-trinidad_20165019 | e9f2da811aaa07160b8b660fa13743750c5932d4 | 43125e45e1c56fab0cc56e32d079be787209d3b4 | refs/heads/master | 2020-03-07T10:27:37.758086 | 2018-03-30T13:34:10 | 2018-03-30T13:34:10 | 127,431,966 | 0 | 1 | Apache-2.0 | 2020-02-11T14:23:38 | 2018-03-30T13:35:24 | Java | UTF-8 | Java | false | false | 2,360 | 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.myfaces.trinidadinternal.image.xml.parse;
import java.awt.Color;
import org.apache.myfaces.trinidadinternal.share.xml.ParserFactory;
import org.apache.myfaces.trinidadinternal.share.xml.ParserManager;
import org.apache.myfaces.trinidadinternal.share.xml.NodeParser;
import org.apache.myfaces.trinidadinternal.share.xml.ParseContext;
/**
* Factory for creating ColorParsers
* @version $Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/image/xml/parse/ColorParserFactory.java#0 $) $Date: 10-nov-2005.19:04:02 $
*/
public class ColorParserFactory implements ParserFactory
{
/**
* Gets the shared ColorParserFactory instance.
*/
public static ColorParserFactory sharedInstance()
{
return _sInstance;
}
/**
* Registers this factory on a ParserManager.
*/
public void registerSelf(ParserManager manager, String namespace)
{
// We support parsing of both a single ImageProviderRequest as
// well as a set of ImageProviderRequests.
manager.registerFactory(Color.class, namespace, this);
}
/**
* Returns the parser used for creating ImageProviderRequest
* instances with the given namespace and local name.
*/
public NodeParser getParser(
ParseContext context,
String namespaceURI,
String localName)
{
return new ColorParser();
}
private ColorParserFactory() {}
private static final ColorParserFactory _sInstance =
new ColorParserFactory();
}
| [
"mmo@semmle.com"
] | mmo@semmle.com |
7e33d70f36d719477b1e3d7cef06ef284393dff3 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/neo4j/2019/4/ValueTypeTest.java | 3dbba83a02a735094562b13fb91572084ceebf77 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 3,769 | java | /*
* Copyright (c) 2002-2019 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.internal.batchimport.input;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import java.io.Flushable;
import java.io.IOException;
import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.io.fs.FlushableChannel;
import org.neo4j.test.extension.EphemeralFileSystemExtension;
import org.neo4j.test.extension.Inject;
import org.neo4j.test.extension.TestDirectoryExtension;
import org.neo4j.test.rule.TestDirectory;
import static org.junit.jupiter.api.Assertions.assertEquals;
@ExtendWith( {EphemeralFileSystemExtension.class, TestDirectoryExtension.class} )
class ValueTypeTest
{
@Inject
private FileSystemAbstraction fs;
@Inject
private TestDirectory directory;
@Test
void arraysShouldCalculateCorrectLength() throws IOException
{
// given
int[] value = new int[3];
for ( int i = 0; i < value.length; i++ )
{
value[i] = 100 + i;
}
ValueType valueType = ValueType.typeOf( value );
CountingChannel channel = new CountingChannel();
// when
int length = valueType.length( value );
valueType.write( value, channel );
// then
int expected =
1 + // component type
Integer.BYTES + // array length
value.length * Integer.BYTES; // array data
assertEquals( expected, length );
assertEquals( expected, channel.position() );
}
private static class CountingChannel implements FlushableChannel
{
private long position;
@Override
public Flushable prepareForFlush()
{
throw new UnsupportedOperationException();
}
@Override
public FlushableChannel put( byte value )
{
position += Byte.BYTES;
return this;
}
@Override
public FlushableChannel putShort( short value )
{
position += Short.BYTES;
return this;
}
@Override
public FlushableChannel putInt( int value )
{
position += Integer.BYTES;
return this;
}
@Override
public FlushableChannel putLong( long value )
{
position += Long.BYTES;
return this;
}
@Override
public FlushableChannel putFloat( float value )
{
position += Float.BYTES;
return this;
}
@Override
public FlushableChannel putDouble( double value )
{
position += Double.BYTES;
return this;
}
@Override
public FlushableChannel put( byte[] value, int length )
{
position += length;
return this;
}
@Override
public void close()
{
}
long position()
{
return position;
}
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
ddac5ed1c37fbc8181a9f34786edcfad98bcb55d | 7956e27cab2db0b3cde1998bd70f18fac07f6726 | /leetcode/src/HammingDistance.java | 82032bfe74a5d1886b570d144f414a0858a394bb | [] | no_license | sbiswas4/DPP | 9ba31d38f48d7c6bbcec6c71ab32abb5ce208099 | 08977b47927d961a82db69bc5ca362da86cf6dd2 | refs/heads/master | 2020-03-12T18:44:47.959390 | 2018-04-21T03:30:21 | 2018-04-21T03:30:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | /**
* https://leetcode.com/contest/leetcode-weekly-contest-13/problems/hamming-distance/
* Created by pankaj on 18/12/16.
*/
public class HammingDistance {
public int hammingDistance(int x, int y) {
int cnt = 0, z = x ^ y;
while (z > 0) {
z = z & (z - 1);
cnt++;
}
return cnt;
}
}
| [
"pankajmore@gmail.com"
] | pankajmore@gmail.com |
b3e44cf05411cd6f9cd779cb702c261ca53be9fa | cc761aa870d6d52fb32d31457bc7bf1a6e2b68fb | /src/main/java/com/casic/patrol/party/web/PartyTypeController.java | 1e4a2db87b1b1991b71d7729e92468a4011b0564 | [] | no_license | feisishui/surveillance | 8b8c58900e040da170c19804db7fac71891d7f74 | ec43764ea03dfb77df0362e94063e6123a7607e4 | refs/heads/master | 2020-05-02T02:15:04.225208 | 2017-07-16T03:48:18 | 2017-07-16T03:48:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,590 | java | package com.casic.patrol.party.web;
import com.casic.patrol.api.tenant.TenantHolder;
import com.casic.patrol.core.mapper.BeanMapper;
import com.casic.patrol.core.page.Page;
import com.casic.patrol.core.query.PropertyFilter;
import com.casic.patrol.core.spring.MessageHelper;
import com.casic.patrol.party.persistence.domain.PartyType;
import com.casic.patrol.party.persistence.manager.PartyTypeManager;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("party")
public class PartyTypeController {
private PartyTypeManager partyTypeManager;
private MessageHelper messageHelper;
private BeanMapper beanMapper = new BeanMapper();
private TenantHolder tenantHolder;
@RequestMapping("party-type-list")
public String list(@ModelAttribute Page page,
@RequestParam Map<String, Object> parameterMap, Model model) {
String tenantId = tenantHolder.getTenantId();
List<PropertyFilter> propertyFilters = PropertyFilter
.buildFromMap(parameterMap);
propertyFilters.add(new PropertyFilter("EQS_tenantId", tenantId));
page = partyTypeManager.pagedQuery(page, propertyFilters);
model.addAttribute("page", page);
return "party/party-type-list";
}
@RequestMapping("party-type-input")
public String input(@RequestParam(value = "id", required = false) Long id,
Model model) {
if (id != null) {
PartyType partyType = partyTypeManager.get(id);
model.addAttribute("model", partyType);
}
return "party/party-type-input";
}
@RequestMapping("party-type-save")
public String save(@ModelAttribute PartyType partyType,
RedirectAttributes redirectAttributes) {
String tenantId = tenantHolder.getTenantId();
PartyType dest = null;
Long id = partyType.getId();
if (id != null) {
dest = partyTypeManager.get(id);
beanMapper.copy(partyType, dest);
} else {
dest = partyType;
dest.setTenantId(tenantId);
}
partyTypeManager.save(dest);
messageHelper.addFlashMessage(redirectAttributes, "core.success.save",
"保存成功");
return "redirect:/party/party-type-list.do";
}
@RequestMapping("party-type-remove")
public String remove(@RequestParam("selectedItem") List<Long> selectedItem,
RedirectAttributes redirectAttributes) {
partyTypeManager.removeAll(partyTypeManager.findByIds(selectedItem));
messageHelper.addFlashMessage(redirectAttributes,
"core.success.delete", "删除成功");
return "redirect:/party/party-type-list.do";
}
// ~ ======================================================================
@Resource
public void setPartyTypeManager(PartyTypeManager partyTypeManager) {
this.partyTypeManager = partyTypeManager;
}
@Resource
public void setMessageHelper(MessageHelper messageHelper) {
this.messageHelper = messageHelper;
}
@Resource
public void setTenantHolder(TenantHolder tenantHolder) {
this.tenantHolder = tenantHolder;
}
}
| [
"zhangfan1212@126.com"
] | zhangfan1212@126.com |
ec061664af134dd302914ad4b0072f9df49a9fdf | c9a25cef7c3ab26aa66ea584fae5ed7dc87ebb9d | /mod/src-1.7.2/openeye/notes/ScreenNotificationHolder.java | 4d0b51a6bfa6126095f6ec54989522d0795f58f9 | [
"MIT"
] | permissive | SinusoidalC/OpenData | b17e2a031e240e64dd09addb8b345a8724194d31 | b2b8776ff2082067658d297deaa213f691ff0707 | refs/heads/master | 2020-12-07T05:21:58.553406 | 2014-05-08T20:47:25 | 2014-05-08T20:47:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,476 | java | package openeye.notes;
import net.minecraft.util.*;
public class ScreenNotificationHolder {
private static class Entry {
final int level;
public final WrappedChatComponent msg;
private Entry(int level, IChatComponent msg) {
this.level = level;
this.msg = new WrappedChatComponent(msg);
}
}
private final ChatStyle DANGEROUS_FILE_STYLE = new ChatStyle().setBold(true).setColor(EnumChatFormatting.RED);
private final ChatStyle KNOWN_CRASH_STYLE = new ChatStyle().setColor(EnumChatFormatting.GREEN);
private final ChatStyle INTRO_STYLE = new ChatStyle().setColor(EnumChatFormatting.GOLD);
private Entry selectedLine;
public void addLine(int level, IChatComponent msg) {
if (selectedLine == null || level > selectedLine.level) selectedLine = new Entry(level, msg);
}
public void signalDangerousFile() {
addLine(64, new ChatComponentTranslation("openeye.main_screen.dangerous_file").setChatStyle(DANGEROUS_FILE_STYLE));
}
public void signalCrashReported() {
addLine(8, new ChatComponentTranslation("openeye.main_screen.crash_reported"));
}
public void signalKnownCrash() {
addLine(32, new ChatComponentTranslation("openeye.main_screen.known_crash").setChatStyle(KNOWN_CRASH_STYLE));
}
public void signalIntroStuff() {
addLine(256, new ChatComponentTranslation("openeye.main_screen.intro").setChatStyle(INTRO_STYLE));
}
public WrappedChatComponent getSelectedLine() {
return selectedLine != null? selectedLine.msg : null;
}
} | [
"bartek.bok@gmail.com"
] | bartek.bok@gmail.com |
9fcc93bf4c5a62ca1ec725efa70fc41624862f8c | 3ca934c5e29147bffc57a7212a450681d12b12ce | /Code/functional-testing/mobile-api-step-defs/src/main/java/com.hotwire.test/steps/util/DiscountJdoBuilder.java | d9c5a312426423b82453fe340ef03eda3e6425f3 | [] | no_license | amitoj/spring_cucumber | 8af821fd183e8a1ce049a3dc326dac9d80fc3e9a | fd4d207bca1645fb6f0465d1e016bfc607b39b43 | refs/heads/master | 2020-09-04T00:23:35.762856 | 2017-04-19T15:27:51 | 2017-04-19T15:27:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,790 | java | /*
* Copyright 2015 Hotwire. All Rights Reserved.
*
* This software is the proprietary information of Hotwire.
* Use is subject to license terms.
*/
package com.hotwire.test.steps.util;
import com.hotwire.test.steps.coupons.CouponCodesService;
import hotwire.biz.domain.fn.MoneyJdo;
import hotwire.biz.order.discount.DiscountJdo;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Field;
import java.util.Calendar;
import java.util.Date;
/**
* @author v-vbychkovskyy
* @since 2015.04
*/
public class DiscountJdoBuilder {
public static final String BDD_COUPON_PREFIX = "BDD_COUPON";
private static final Logger LOGGER = LoggerFactory.getLogger(DiscountJdoBuilder.class);
private String couponName;
private boolean firstTimePurchase;
private CouponCodesService.CountryCodes countryCodes;
private char pGoodCode;
private String siteType;
private String currency;
private int amount;
private CouponCodesService.SampleType sampleType;
public DiscountJdo build() {
DiscountJdo discount = new DiscountJdo();
discount.setEnabled(true);
discount.setDescription("VALID discount code");
discount.setDomainCode(1000);
discount.setMaxUsageAmount(10000f);
discount.setEncryptionKey(null);
discount.setPublicInd('Y');
discount.setpGoodCode(Character.toUpperCase(pGoodCode));
discount.setCode("CCC_" + couponName);
setFieldValue(discount, "coupon", couponName);
setFieldValue(discount, "siteId", CouponCodesService.CountryCodes.getCountryCode(countryCodes));
setFieldValue(discount, "siteTypeList", siteType);
setFieldValue(discount, "isFirstTimePurchase", firstTimePurchase);
populateDiscountValue(amount, currency, discount);
populateDiscountDates(sampleType, discount);
return discount;
}
public DiscountJdoBuilder withAmount(int amount) {
this.amount = amount;
return this;
}
public DiscountJdoBuilder withCurrency(String currency) {
this.currency = currency;
return this;
}
public DiscountJdoBuilder withSiteType(String siteType) {
this.siteType = siteType;
return this;
}
public DiscountJdoBuilder withPgoodCode(char pGoodCode) {
this.pGoodCode = pGoodCode;
return this;
}
public DiscountJdoBuilder withCountryCodes(CouponCodesService.CountryCodes countryCodes) {
this.countryCodes = countryCodes;
return this;
}
public DiscountJdoBuilder isFirstTimePurchase(boolean firstTimePurchase) {
this.firstTimePurchase = firstTimePurchase;
return this;
}
public DiscountJdoBuilder withCouponName(String couponName) {
this.couponName = couponName;
return this;
}
public DiscountJdoBuilder withSampleType(CouponCodesService.SampleType sampleType) {
this.sampleType = sampleType;
return this;
}
private void setFieldValue(DiscountJdo discount, String fieldName, Object fieldValue) {
try {
Field couponField = DiscountJdo.class.getDeclaredField(fieldName);
couponField.setAccessible(true);
couponField.set(discount, fieldValue);
}
catch (NoSuchFieldException | IllegalAccessException e) {
LOGGER.info("Can't set value to field" + fieldName + e.getMessage());
}
}
private void populateDiscountDates(CouponCodesService.SampleType sampleType, DiscountJdo discountCode) {
Date startDate;
Date endDate;
switch (sampleType) {
case VALID:
startDate = DateUtils.truncate(new Date(), Calendar.DAY_OF_MONTH);
endDate = DateUtils.addDays(startDate, 20);
break;
case EXPIRED:
startDate = DateUtils.addDays(
DateUtils.truncate(new Date(), Calendar.DAY_OF_MONTH), -30);
endDate = DateUtils.addDays(startDate, 10);
break;
default:
startDate = null;
endDate = null;
}
discountCode.setStartDate(startDate);
discountCode.setEndDate(endDate);
}
private boolean isPercentDiscount(String currency) {
return currency.isEmpty();
}
private void populateDiscountValue(int amount, String currency, DiscountJdo discount) {
if (isPercentDiscount(currency)) {
discount.setPercent(amount);
discount.setValue(new MoneyJdo(0, "USD"));
}
else {
discount.setPercent(0);
discount.setValue(new MoneyJdo(amount, currency));
}
}
}
| [
"jiniguez@foundationmedicine.com"
] | jiniguez@foundationmedicine.com |
2ab469427a837557b9b49298a7ae29d778b08bd8 | 258de8e8d556901959831bbdc3878af2d8933997 | /utopia-service/utopia-dubbing/utopia-dubbing-impl/src/main/java/com/voxlearning/utopia/service/dubbing/impl/dao/DubbingRawDao.java | 2d5218e65dafb9b66fe8651e1c098f19dbc54e5f | [] | no_license | Explorer1092/vox | d40168b44ccd523748647742ec376fdc2b22160f | 701160b0417e5a3f1b942269b0e7e2fd768f4b8e | refs/heads/master | 2020-05-14T20:13:02.531549 | 2019-04-17T06:54:06 | 2019-04-17T06:54:06 | 181,923,482 | 0 | 4 | null | 2019-04-17T15:53:25 | 2019-04-17T15:53:25 | null | UTF-8 | Java | false | false | 704 | java | package com.voxlearning.utopia.service.dubbing.impl.dao;
import com.voxlearning.alps.dao.mongo.dao.AlpsStaticMongoDao;
import com.voxlearning.utopia.service.dubbing.api.entity.DubbingRaw;
import javax.inject.Named;
import java.util.Collection;
/**
* @Author: wei.jiang
* @Date: Created on 2017/10/12
*/
@Named
public class DubbingRawDao extends AlpsStaticMongoDao<DubbingRaw, String> {
/**
* Calculate cache dimensions based on specified document.
*
* @param document the non null document.
* @param dimensions put calculated result into this
*/
@Override
protected void calculateCacheDimensions(DubbingRaw document, Collection<String> dimensions) {
}
}
| [
"wangahai@300.cn"
] | wangahai@300.cn |
905c7acbcee527fe6df480413b27df4d9b77cef5 | 8218aacb5bd27f7389c980b7a9c284e19116836c | /streamtau_manager/src/test/java/com/zetyun/streamtau/manager/citrus/behavior/Files.java | 8d0949ad6984d90cdcf189b5e2b3417efc57e0de | [
"Apache-2.0"
] | permissive | lwc-Arnold/StreamTau2 | 6117be703059cbd8ca98de658153ec412b21f434 | 766175573dc268977a726236736ca568fbbf8eb3 | refs/heads/master | 2022-12-27T04:58:52.422508 | 2020-09-27T09:17:02 | 2020-09-27T09:17:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,569 | java | /*
* Copyright 2020 Zetyun
*
* 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.zetyun.streamtau.manager.citrus.behavior;
import com.consol.citrus.dsl.design.AbstractTestBehavior;
import com.consol.citrus.message.MessageType;
import com.zetyun.streamtau.manager.controller.protocol.StreamTauResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import static com.zetyun.streamtau.manager.citrus.CitrusCommon.SERVER_ID;
import static com.zetyun.streamtau.manager.citrus.CitrusCommon.varRef;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE;
public class Files {
@RequiredArgsConstructor
public static class Upload extends AbstractTestBehavior {
private final String projectId;
private final String assetId;
private final Resource resource;
@Override
public void apply() {
MultiValueMap<String, Object> payload = new LinkedMultiValueMap<>();
payload.add("file", resource);
http().client(SERVER_ID).send()
.post("/api/projects/" + varRef(Projects.idVarName(projectId))
+ "/assets/" + varRef(Assets.idVarName(assetId))
+ "/file/")
.accept(APPLICATION_JSON_VALUE)
.contentType(MULTIPART_FORM_DATA_VALUE)
.payload(payload);
http().client(SERVER_ID).receive()
.response(HttpStatus.OK)
.messageType(MessageType.JSON)
.jsonPath("$.status", StreamTauResponse.OK)
.jsonPath("$.message", StreamTauResponse.SUCCESS)
.jsonPath("$.data.id", varRef(Assets.idVarName(assetId)));
echo("Upload file for asset " + varRef(Assets.idVarName(assetId)) + " successfully.");
}
}
}
| [
"jiaoyg@zetyun.com"
] | jiaoyg@zetyun.com |
fa6ee05e5b390aee8b222295823cd2b7157e1a41 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/17/17_3f4f832669090279e140ad5f2deb0953279af548/AWTUtil/17_3f4f832669090279e140ad5f2deb0953279af548_AWTUtil_t.java | 7c083da179eb815046eedbde2bbe64f67b5c3752 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 7,999 | java | /*
* Copyright (c) 2002-2008 LWJGL Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'LWJGL' nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.lwjgl.opengl;
/**
* @author elias_naur
*/
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.GraphicsDevice;
import java.awt.GraphicsConfiguration;
import java.awt.IllegalComponentStateException;
import java.awt.Point;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.lang.reflect.Method;
import java.nio.IntBuffer;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import org.lwjgl.LWJGLException;
import org.lwjgl.LWJGLUtil;
final class AWTUtil {
public static boolean hasWheel() {
return true;
}
public static int getButtonCount() {
return MouseEventQueue.NUM_BUTTONS;
}
public static int getNativeCursorCapabilities() {
if (LWJGLUtil.getPlatform() != LWJGLUtil.PLATFORM_MACOSX || LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 4)) {
int cursor_colors = Toolkit.getDefaultToolkit().getMaximumCursorColors();
boolean supported = cursor_colors >= Short.MAX_VALUE && getMaxCursorSize() > 0;
int caps = supported ? org.lwjgl.input.Cursor.CURSOR_8_BIT_ALPHA | org.lwjgl.input.Cursor.CURSOR_ONE_BIT_TRANSPARENCY: 0 | org.lwjgl.input.Cursor.CURSOR_ANIMATION;
return caps;
} else {
/* Return no capability in Mac OS X 10.3 and earlier , as there are two unsolved bugs (both reported to apple along with
minimal test case):
1. When a custom cursor (or some standard) java.awt.Cursor is assigned to a
Componennt, it is reset to the default pointer cursor when the window is de-
activated and the re-activated. The Cursor can not be reset to the custom cursor,
with another setCursor.
2. When the cursor is moving in the top pixel row (y = 0 in AWT coordinates) in fullscreen
mode, no mouse moved events are reported, even though mouse pressed/released and dragged
events are reported
*/
return 0;
}
}
public static Robot createRobot(final Component component) {
try {
Robot robot = (Robot)AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run() throws Exception {
return new Robot(component.getGraphicsConfiguration().getDevice());
}
});
return robot;
} catch (PrivilegedActionException e) {
LWJGLUtil.log("Got exception while creating robot: " + e.getCause());
return null;
}
}
private static int transformY(Component component, int y) {
return component.getHeight() - 1 - y;
}
/**
* Use reflection to access the JDK 1.5 pointer location, if possible and
* only if the given component is on the same screen as the cursor. Return
* null otherwise.
*/
private static Point getPointerLocation(final Component component) {
try {
final Class MouseInfo_class = Class.forName("java.awt.MouseInfo");
final Method getPointerInfo_method = MouseInfo_class.getMethod("getPointerInfo", null);
final Class PointerInfo_class = Class.forName("java.awt.PointerInfo");
final Method getDevice_method = PointerInfo_class.getMethod("getDevice", null);
final Method getLocation_method = PointerInfo_class.getMethod("getLocation", null);
return (Point)AccessController.doPrivileged(new PrivilegedExceptionAction() {
public final Object run() throws Exception {
GraphicsConfiguration config = component.getGraphicsConfiguration();
if (config != null) {
Object pointer_info = getPointerInfo_method.invoke(null, null);
GraphicsDevice device = (GraphicsDevice)getDevice_method.invoke(pointer_info, null);
if (device == config.getDevice()) {
return (Point)getLocation_method.invoke(pointer_info, null);
}
}
return null;
}
});
} catch (PrivilegedActionException e) {
LWJGLUtil.log("Failed to query pointer location: " + e.getCause());
} catch (NoSuchMethodException e) {
LWJGLUtil.log("Failed to query pointer location: " + e);
} catch (ClassNotFoundException e) {
LWJGLUtil.log("Failed to query pointer location: " + e);
}
return null;
}
/**
* Use the 1.5 API to get the cursor position relative to the component. Return null
* if it fails (JDK <= 1.4).
*/
public static Point getCursorPosition(Component component) {
try {
Point pointer_location = getPointerLocation(component);
if (pointer_location != null) {
Point location = component.getLocationOnScreen();
pointer_location.translate(-location.x, -location.y);
pointer_location.move(pointer_location.x, transformY(component, pointer_location.y));
return pointer_location;
}
} catch (IllegalComponentStateException e) {
LWJGLUtil.log("Failed to set cursor position: " + e);
} catch (NoClassDefFoundError e) { // Not JDK 1.5
LWJGLUtil.log("Failed to query cursor position: " + e);
}
return null;
}
public static void setCursorPosition(Component component, Robot robot, int x, int y) {
if (robot != null) {
try {
Point location = component.getLocationOnScreen();
int transformed_x = location.x + x;
int transformed_y = location.y + transformY(component, y);
robot.mouseMove(transformed_x, transformed_y);
} catch (IllegalComponentStateException e) {
LWJGLUtil.log("Failed to set cursor position: " + e);
}
}
}
public static int getMinCursorSize() {
Dimension min_size = Toolkit.getDefaultToolkit().getBestCursorSize(0, 0);
return Math.max(min_size.width, min_size.height);
}
public static int getMaxCursorSize() {
Dimension max_size = Toolkit.getDefaultToolkit().getBestCursorSize(10000, 10000);
return Math.min(max_size.width, max_size.height);
}
/** Native cursor handles */
public static Cursor createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
BufferedImage cursor_image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
int[] pixels = new int[images.remaining()];
int old_position = images.position();
images.get(pixels);
images.position(old_position);
cursor_image.setRGB(0, 0, width, height, pixels, 0, width);
return Toolkit.getDefaultToolkit().createCustomCursor(cursor_image, new Point(xHotspot, yHotspot), "LWJGL Custom cursor");
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
aa5f7a5f9fa30527198812c01bd329f51342e5ab | 1dada7d3a04b273c674c2e2a2e5a947d5f31f46f | /src/main/java/com/bfa/app/config/liquibase/AsyncSpringLiquibase.java | 0f92227b7320fc73bcf28bd508fe16799a1666be | [] | no_license | godbolerr/bfa-jhipster-ui-website | 882d4d18d4ddd0a9eb99792f705d99434abf9d94 | 8733bf215778b9c1af5f3323b7fc50ff5e19636f | refs/heads/master | 2021-01-13T04:25:52.410342 | 2017-01-25T09:31:49 | 2017-01-25T09:31:49 | 79,887,452 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,903 | java | package com.bfa.app.config.liquibase;
import javax.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.env.Environment;
import org.springframework.core.task.TaskExecutor;
import org.springframework.util.StopWatch;
import com.bfa.app.config.Constants;
import liquibase.exception.LiquibaseException;
import liquibase.integration.spring.SpringLiquibase;
/**
* Specific liquibase.integration.spring.SpringLiquibase that will update the database asynchronously.
* <p>
* By default, this asynchronous version only works when using the "dev" profile.<p>
* The standard liquibase.integration.spring.SpringLiquibase starts Liquibase in the current thread:
* <ul>
* <li>This is needed if you want to do some database requests at startup</li>
* <li>This ensure that the database is ready when the application starts</li>
* </ul>
* But as this is a rather slow process, we use this asynchronous version to speed up our start-up time:
* <ul>
* <li>On a recent MacBook Pro, start-up time is down from 14 seconds to 8 seconds</li>
* <li>In production, this can help your application run on platforms like Heroku, where it must start/restart very quickly</li>
* </ul>
*/
public class AsyncSpringLiquibase extends SpringLiquibase {
// named "logger" because there is already a field called "log" in "SpringLiquibase"
private final Logger logger = LoggerFactory.getLogger(AsyncSpringLiquibase.class);
@Inject
@Qualifier("taskExecutor")
private TaskExecutor taskExecutor;
@Inject
private Environment env;
@Override
public void afterPropertiesSet() throws LiquibaseException {
if (!env.acceptsProfiles(Constants.SPRING_PROFILE_NO_LIQUIBASE)) {
if (env.acceptsProfiles(Constants.SPRING_PROFILE_DEVELOPMENT, Constants.SPRING_PROFILE_HEROKU)) {
taskExecutor.execute(() -> {
try {
logger.warn("Starting Liquibase asynchronously, your database might not be ready at startup!");
initDb();
} catch (LiquibaseException e) {
logger.error("Liquibase could not start correctly, your database is NOT ready: {}", e.getMessage(), e);
}
});
} else {
logger.debug("Starting Liquibase synchronously");
initDb();
}
} else {
logger.debug("Liquibase is disabled");
}
}
protected void initDb() throws LiquibaseException {
StopWatch watch = new StopWatch();
watch.start();
super.afterPropertiesSet();
watch.stop();
logger.debug("Started Liquibase in {} ms", watch.getTotalTimeMillis());
}
}
| [
"admin@test.com"
] | admin@test.com |
c2a5c22bc276b20d222e2dd1c05691354a765d4e | b783502faf6fda33eb03575c054a198306541f81 | /PODM/SW/pod-manager/podm-business-services/src/main/java/com/intel/podm/business/redfish/services/allocation/strategy/RemoteDriveAllocationContextDescriptor.java | e610a2ac6e69d5b0b4077745a19d1fdf8085d156 | [
"Apache-2.0"
] | permissive | intelsdi-x/intelRSD | 53f763e386de0b1cb9c50427d76943327e2b6315 | de77af174608d3b30232625e0f0e6e7cbbae8b59 | refs/heads/master | 2022-11-23T03:14:50.978516 | 2022-11-07T23:02:34 | 2022-11-07T23:02:34 | 153,187,714 | 0 | 0 | null | 2018-10-15T22:06:10 | 2018-10-15T22:06:09 | null | UTF-8 | Java | false | false | 2,897 | java | /*
* Copyright (c) 2017-2018 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intel.podm.business.redfish.services.allocation.strategy;
import com.intel.podm.business.Violations;
import com.intel.podm.common.types.Id;
import com.intel.podm.common.types.Protocol;
import com.intel.podm.common.types.ReplicaType;
import java.math.BigDecimal;
import java.net.URI;
@SuppressWarnings({"checkstyle:MethodCount"})
public class RemoteDriveAllocationContextDescriptor {
private Id storagePoolId;
private URI storagePoolUri;
private Id storageServiceId;
private URI masterUri;
private Violations violations;
private BigDecimal capacity;
private Protocol protocol;
private ReplicaType replicaType;
private URI newRemoteVolumeUri;
public Id getStoragePoolId() {
return storagePoolId;
}
public void setStoragePoolId(Id storagePoolId) {
this.storagePoolId = storagePoolId;
}
public URI getStoragePoolUri() {
return storagePoolUri;
}
public void setStoragePoolUri(URI storagePoolUri) {
this.storagePoolUri = storagePoolUri;
}
public Id getStorageServiceId() {
return storageServiceId;
}
public void setStorageServiceId(Id storageServiceId) {
this.storageServiceId = storageServiceId;
}
public URI getMasterUri() {
return masterUri;
}
public void setMasterUri(URI masterUri) {
this.masterUri = masterUri;
}
public Violations getViolations() {
return violations;
}
public void setViolations(Violations violations) {
this.violations = violations;
}
public BigDecimal getCapacity() {
return capacity;
}
public void setCapacity(BigDecimal capacity) {
this.capacity = capacity;
}
public Protocol getProtocol() {
return protocol;
}
public void setProtocol(Protocol protocol) {
this.protocol = protocol;
}
public ReplicaType getReplicaType() {
return replicaType;
}
public void setReplicaType(ReplicaType replicaType) {
this.replicaType = replicaType;
}
public URI getNewRemoteVolumeUri() {
return newRemoteVolumeUri;
}
public void setNewRemoteVolumeUri(URI newRemoteVolumeUri) {
this.newRemoteVolumeUri = newRemoteVolumeUri;
}
}
| [
"tomasz.bykowski@intel.com"
] | tomasz.bykowski@intel.com |
6723a405594ab6d181b2ea62907999fd8be8ea4d | 0136bdbcba620caae2ede8668f05c038afd8807f | /basic/src/com/programmers/level01/No15_Rectangular_Star.java | b27cd0e9d1caf5186e5e184fde4384eee6245362 | [] | no_license | dh37789/basic | 40c7ae83fdb20d2763b7ebf55f9f247e87fd448f | b9b84db0e832ae0dd4d0d9c1ed5bf2259dbefc38 | refs/heads/master | 2023-08-31T01:27:12.497153 | 2023-08-20T07:12:22 | 2023-08-20T07:12:22 | 199,305,523 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | package com.programmers.level01;
import java.util.Scanner;
/**
* 직사각형 별찍기
* link : https://programmers.co.kr/learn/courses/30/lessons/12969
*/
public class No15_Rectangular_Star {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
for (int i = 0; i < b; i++) {
for (int j = 0; j < a; j++) {
System.out.print("*");
}
System.out.println("");
}
}
}
| [
"dhaudgkr@gmail.com"
] | dhaudgkr@gmail.com |
562702543c9741a0dc6da65fed1c4176b7a756e2 | f1f529aecd3af78f5f4eebf65dbfb33a51a77117 | /osgi.enroute.base.api/src/osgi/enroute/launch/api/Launcher.java | dfcff90155c29b08c353b30aec41c92396dddb48 | [
"Apache-2.0"
] | permissive | peterkir/v2archive.osgi.enroute | e12a3d3283f46d0cd76f1bc03d1d4ef68dcdf61d | 6372b3c348b76af1f2b1d83da748a7af05d2aa5a | refs/heads/master | 2021-07-16T04:42:49.232058 | 2020-05-21T22:16:11 | 2020-05-21T22:16:11 | 160,483,355 | 0 | 0 | Apache-2.0 | 2021-02-10T05:05:16 | 2018-12-05T08:11:33 | JavaScript | UTF-8 | Java | false | false | 501 | java | package osgi.enroute.launch.api;
/**
* A launcher is a program that starts an OSGi framework and manages the set of
* installed bundles.
* <p>
* This service will be registered when the launcher has started all the
* bundles. It will contain a property {@link #LAUNCHER_MAIN} that contains the
* command line arguments as a String[].
*/
public interface Launcher {
/**
* This property contains a String[] for the command line arguments.
*/
String LAUNCHER_MAIN = "osgi.launcher.main";
}
| [
"peter.kriens@aqute.biz"
] | peter.kriens@aqute.biz |
305690a6b905b94acb060bbd95c3fe5a7ef567a7 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/ReactiveX--RxJava/4017e26b22b4905c241d1f3b13e9387bab5ccbd8/before/ObservableRetryBiPredicate.java | 715c740083daa0c341d458b3fb19c82da54245b7 | [] | 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 | 3,599 | java | /**
* Copyright 2016 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
* the License for the specific language governing permissions and limitations under the License.
*/
package io.reactivex.internal.operators.observable;
import java.util.concurrent.atomic.AtomicInteger;
import io.reactivex.*;
import io.reactivex.disposables.Disposable;
import io.reactivex.exceptions.*;
import io.reactivex.functions.BiPredicate;
import io.reactivex.internal.disposables.SequentialDisposable;
public final class ObservableRetryBiPredicate<T> extends AbstractObservableWithUpstream<T, T> {
final BiPredicate<? super Integer, ? super Throwable> predicate;
public ObservableRetryBiPredicate(
Observable<T> source,
BiPredicate<? super Integer, ? super Throwable> predicate) {
super(source);
this.predicate = predicate;
}
@Override
public void subscribeActual(Observer<? super T> s) {
SequentialDisposable sa = new SequentialDisposable();
s.onSubscribe(sa);
RetryBiSubscriber<T> rs = new RetryBiSubscriber<T>(s, predicate, sa, source);
rs.subscribeNext();
}
static final class RetryBiSubscriber<T> extends AtomicInteger implements Observer<T> {
private static final long serialVersionUID = -7098360935104053232L;
final Observer<? super T> actual;
final SequentialDisposable sa;
final ObservableSource<? extends T> source;
final BiPredicate<? super Integer, ? super Throwable> predicate;
int retries;
RetryBiSubscriber(Observer<? super T> actual,
BiPredicate<? super Integer, ? super Throwable> predicate, SequentialDisposable sa, ObservableSource<? extends T> source) {
this.actual = actual;
this.sa = sa;
this.source = source;
this.predicate = predicate;
}
@Override
public void onSubscribe(Disposable s) {
sa.update(s);
}
@Override
public void onNext(T t) {
actual.onNext(t);
}
@Override
public void onError(Throwable t) {
boolean b;
try {
b = predicate.test(++retries, t);
} catch (Throwable e) {
Exceptions.throwIfFatal(e);
actual.onError(new CompositeException(e, t));
return;
}
if (!b) {
actual.onError(t);
return;
}
subscribeNext();
}
@Override
public void onComplete() {
actual.onComplete();
}
/**
* Subscribes to the source again via trampolining.
*/
void subscribeNext() {
if (getAndIncrement() == 0) {
int missed = 1;
for (;;) {
if (sa.isDisposed()) {
return;
}
source.subscribe(this);
missed = addAndGet(-missed);
if (missed == 0) {
break;
}
}
}
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
605fa9df16ad39f36bdccff9f9b4bbe82cafdd50 | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_2692487_0/java/xiaowuc1/A.java | a52b33a5184a52cf5b149c76a91e19d3adf7ff7d | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,736 | java | import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;
public class A {
static BufferedReader br;
static StringTokenizer st;
static PrintWriter pw;
static int[] list;
public static void main(String[] args) throws IOException {
br = new BufferedReader(new FileReader("a.in"));
pw = new PrintWriter(new BufferedWriter(new FileWriter("a.out")));
final int MAX_CASES = readInt();
for(int casenum = 1; casenum <= MAX_CASES; casenum++) {
pw.printf("Case #%d: ", casenum);
int me = readInt();
int n = readInt();
list = new int[n];
for(int i = 0; i < n; i++) {
list[i] = readInt();
}
Arrays.sort(list);
pw.println(solve(me, 0));
}
pw.close();
}
private static int solve(long me, int i) {
if(i == list.length) {
return 0;
}
if(me > list[i]) {
return solve(me+list[i], i+1);
}
if(me == 1) {
return 1 + solve(me, i+1);
}
return 1 + Math.min(solve(2*me-1, i), solve(me, i+1));
}
public static int readInt() throws IOException {
return Integer.parseInt(nextToken());
}
public static long readLong() throws IOException {
return Long.parseLong(nextToken());
}
public static double readDouble() throws IOException {
return Double.parseDouble(nextToken());
}
public static String nextToken() throws IOException {
while(st == null || !st.hasMoreTokens()) {
if(!br.ready()) {
pw.close();
System.exit(0);
}
st = new StringTokenizer(br.readLine());
}
return st.nextToken();
}
public static String readLine() throws IOException {
st = null;
return br.readLine();
}
}
| [
"eewestman@gmail.com"
] | eewestman@gmail.com |
8734f91404a11eaf878041c1926b791ab930d434 | a6f6591c145d4461629ceffbc7dfcd257c42acde | /src/com/ufgov/zc/server/zc/service/IZcEbJieXiangService.java | e4cdd29ec83bd256ae185873fc12f376afd92f16 | [] | no_license | jielen/dtnw | 95f9ba7d0fb4b5d46affff2ee2321a4b6f800f54 | fba344dc8eae14c10348fa6c74f23c4e6552a154 | refs/heads/master | 2021-01-10T17:11:47.838007 | 2016-10-20T14:03:16 | 2016-10-20T14:03:16 | 41,956,295 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 759 | java | /**
*
*/
package com.ufgov.zc.server.zc.service;
import java.util.List;
import java.util.Map;
import com.ufgov.zc.common.system.RequestMeta;
import com.ufgov.zc.common.system.dto.ElementConditionDto;
import com.ufgov.zc.common.zc.model.ZcEbJieXiang;
/**
* @author Administrator
*
*/
public interface IZcEbJieXiangService {
public List getList(ElementConditionDto elementConditionDto, RequestMeta requestMeta);
public ZcEbJieXiang readJieXiang(Map para, RequestMeta requestMeta);
public void cancelCaiGou(ZcEbJieXiang jiexiang, RequestMeta requestMeta);
public void unFinishCaiGou(ZcEbJieXiang jiexiang, RequestMeta requestMeta);
public void finishCaiGou(ZcEbJieXiang jiexiang, RequestMeta requestMeta);
}
| [
"jielenzghsy1@163.com"
] | jielenzghsy1@163.com |
c6e5ed30d83bb8e78623f1f5e08065d0d2b828fb | f7f49edc0c6d8fdb0c753862035b7f945d92e135 | /bitcamp-java-basic/src/main/java/ch18/e/Canvas.java | 1349da6365a37843e06687e542821b2a18ff9428 | [] | no_license | madridista18/bitcamp-java-20190527 | 6a38a8687432d54e3140d9876f08b86579260e77 | 8ae5ea7882114b452c16c98c0dd8fd41caf8e96c | refs/heads/master | 2022-03-05T13:12:31.111267 | 2019-11-07T03:27:05 | 2019-11-07T03:27:05 | 194,775,341 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,146 | java | package ch18.e;
public class Canvas {
// Canvas가 사용할 도구를 구체적으로 지정(클래스 이름을 사용)하는 대신에
// 좀 더 추상적인 방식으로 클래스 이름 대신 인터페이스를 사용하여
// 특정 규칙에 따라 만든 도구를 사용하겠다고 지정한다.
// => 이 방식의 장점은 규칙에 따라 만든 도구가 어떤 클래스를 상속 받는 상관하지 않는다.
// => 만약 Pen이 인터페이스가 아니라 클래스라면 반드시 Pen의 서브 클래스만 사용해야 한다.
// 따라서 클래스를 사용하는 것 보다 인터페이스를 사용하는 것이 훨신 유연한 코딩을 할 수 있다.
Pen tool;
// 만약 캔버스의 그리기 도구로서 다음과 같이 클래스를 지정한다면,
// => 오직 Monami 도구만, Monami의 서브 클래스만 사용할 수 있다.
// Canvas가 사용할 도구를 만들 때도 오직 Monami의 서브 클래스만 만들어야 한다.
// 도구를 사용하는 쪽이나 도구를 만드는 쪽 모두 Monami로 제한되어 유연하지 못하다.
// => 그러나 위의 필드처럼 도구를 지정할 때 인터페이스를 사용하면,
// 어느 클래스를 상속 받는지 상관없이 다양한 도구를 사용할 수 있어
// Canvas를 만든 개발자 입장에서는 훨씬 편리하다.
// 또한 도구를 만드는 입장에서도 다른 유용한 클래스를 마음껏 상속 받아 도구를 만들 수 있어
// 매우 편리하다. 어떤 클래스를 상속 받든 단지 Pen 이라는 규칙만 따르면 되기 때문이다.
//Monami tool;
public Canvas(Pen tool) {
this.tool = tool;
}
public void setPen(Pen tool) {
this.tool = tool;
}
public void render(String contents) {
// 어떤 Pen인지 상관없이
// Pen 사용 규칙에 따라 메서드를 호출한다.
// => 클래스에 상관없이 일관된 방법으로 펜을 사용할 수 있어 유지보수에 좋다.
// => 이것이 인터페이스를 사용하는 이유이다.
tool.write(contents);
}
}
| [
"madridista18@naver.com"
] | madridista18@naver.com |
196345e99dc654f762ada79652bb2ff6b895599f | c9cf73543d7c81f8e87a58e051380e98e92f978a | /baseline/happy_trader/platform/client/clientHT/clientUI/src/com/fin/httrader/hlpstruct/PosStateQuery.java | a8b025a63ac4ec8b9e50370660096975e840262a | [] | no_license | vit2000005/happy_trader | 0802d38b49d5313c09f79ee88407806778cb4623 | 471e9ca4a89db1b094e477d383c12edfff91d9d8 | refs/heads/master | 2021-01-01T19:46:10.038753 | 2015-08-23T10:29:57 | 2015-08-23T10:29:57 | 41,203,190 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 375 | java | /*
* PosStateQuery.java
*
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package com.fin.httrader.hlpstruct;
/**
*
* @author Victor_Zoubok
* note - BITWISE!!!
*/
public class PosStateQuery {
public static final int QUERY_OPEN = 0x0002;
public static final int QUERY_HISTORY = 0x0004;
}
| [
"victorofff@gmail.com"
] | victorofff@gmail.com |
14d98793d6b9557cf17ff20a8f0368581390feef | 1275073bd1c3bcec2f7c4c351b1bc7ff17aa7f94 | /app/src/main/java/com/northmeter/equipmentcloud/I/I_ShowNetWorkPicture.java | ee4a787467f2a26a6abbfae9f0b3fcda5e614b6e | [] | no_license | newYearsDeng/EquipmentCloud | fa8e3918abbaedf7f8a57ff240a83c69ae399767 | 0cd2e90d052ff6dd0bf8450e94df26345dc752ba | refs/heads/master | 2020-05-16T01:59:59.532420 | 2019-08-14T07:13:47 | 2019-08-14T07:13:47 | 182,614,706 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package com.northmeter.equipmentcloud.I;
import android.graphics.Bitmap;
import com.northmeter.equipmentcloud.bean.NetWorkPictureBean;
/**
* Created by dyd on 2019/3/27.
*/
public interface I_ShowNetWorkPicture {
void showData(NetWorkPictureBean.PictureData pictureData);
void showBitmap(Bitmap bitmap);
void returnMessage(String message);
}
| [
"905087116@qq.com"
] | 905087116@qq.com |
880ed7b5460b852e94e5170e270e5452d4fe1726 | 42d905620be66de79bbeda093fa34f712225ea6c | /src/com/cndym/sendClient/ltkj/change/ToLtkj1121102.java | 36dc3c698a787249421a01b9cc033d2e34af2091 | [] | no_license | lichaoliu/tob | daad2730b188b322fba3ad39a9d9a3a4497faae9 | 619d06d4aa4bf62e5f92d04b6bbee8950ae1f024 | refs/heads/master | 2020-06-08T20:06:25.235433 | 2019-06-23T02:59:20 | 2019-06-23T02:59:20 | 193,297,933 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 555 | java | package com.cndym.sendClient.ltkj.change;
import com.cndym.sendClient.IChange;
import org.springframework.stereotype.Component;
/**
* 青海11选5(前二组选复式)
* @author 李娜
*
*/
@Component
public class ToLtkj1121102 implements IChange {
@Override
public String toSendNumberCode(String number) {
return number.replaceAll(",", "") + "-02";
}
public static void main(String[] args) {
ToLtkj1121102 to = new ToLtkj1121102();
String number = "01,02,03,06,08,09,10,11";
System.out.println(to.toSendNumberCode(number));
}
}
| [
"1147149597@qq.com"
] | 1147149597@qq.com |
c8e7010e963f4419123400f638016369a0581475 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/aosp-mirror--platform_frameworks_base/6ebe3de331efd00ba23bc4191d4a82cfa4c39160/before/TransitionValues.java | 1ef6bf438e145acbb6c000d97c347c470bc3b77b | [] | 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 | 2,336 | java | /*
* Copyright (C) 2013 The Android Open Source 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 android.view.transition;
import android.util.ArrayMap;
import android.view.View;
import android.view.ViewGroup;
import java.util.Map;
/**
* Data structure which holds cached values for the transition.
* The view field is the target which all of the values pertain to.
* The values field is a map which holds information for fields
* according to names selected by the transitions. These names should
* be unique to avoid clobbering values stored by other transitions,
* such as the convention project:transition_name:property_name. For
* example, the platform might store a property "alpha" in a transition
* "Fader" as "android:fader:alpha".
*
* <p>These values are cached during the
* {@link Transition#captureValues(TransitionValues, boolean)}
* capture} phases of a scene change, once when the start values are captured
* and again when the end values are captured. These start/end values are then
* passed into the transitions during the play phase of the scene change,
* for {@link Transition#prePlay(ViewGroup, TransitionValues, TransitionValues)} and
* for {@link Transition#play(ViewGroup, TransitionValues, TransitionValues)}.</p>
*/
public class TransitionValues {
/**
* The View with these values
*/
public View view;
/**
* The set of values tracked by transitions for this scene
*/
public final Map<String, Object> values = new ArrayMap<String, Object>();
@Override
public String toString() {
String returnValue = "TransitionValues@" + Integer.toHexString(hashCode()) + ":\n";
returnValue += " view = " + view + "\n";
returnValue += " values = " + values + "\n";
return returnValue;
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
031a95caddc6af1edadec4d23071039dc5c5c37e | a770e95028afb71f3b161d43648c347642819740 | /sources/org/telegram/ui/ChangePhoneActivity$PhoneView$$ExternalSyntheticLambda5.java | cc004e257981df168d0681912a7eab631fd85454 | [] | no_license | Edicksonjga/TGDecompiledBeta | d7aa48a2b39bbaefd4752299620ff7b72b515c83 | d1db6a445d5bed43c1dc8213fb8dbefd96f6c51b | refs/heads/master | 2023-08-25T04:12:15.592281 | 2021-10-28T20:24:07 | 2021-10-28T20:24:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,211 | java | package org.telegram.ui;
import android.os.Bundle;
import org.telegram.tgnet.TLObject;
import org.telegram.tgnet.TLRPC$TL_account_sendChangePhoneCode;
import org.telegram.tgnet.TLRPC$TL_error;
import org.telegram.ui.ChangePhoneActivity;
public final /* synthetic */ class ChangePhoneActivity$PhoneView$$ExternalSyntheticLambda5 implements Runnable {
public final /* synthetic */ ChangePhoneActivity.PhoneView f$0;
public final /* synthetic */ TLRPC$TL_error f$1;
public final /* synthetic */ Bundle f$2;
public final /* synthetic */ TLObject f$3;
public final /* synthetic */ TLRPC$TL_account_sendChangePhoneCode f$4;
public /* synthetic */ ChangePhoneActivity$PhoneView$$ExternalSyntheticLambda5(ChangePhoneActivity.PhoneView phoneView, TLRPC$TL_error tLRPC$TL_error, Bundle bundle, TLObject tLObject, TLRPC$TL_account_sendChangePhoneCode tLRPC$TL_account_sendChangePhoneCode) {
this.f$0 = phoneView;
this.f$1 = tLRPC$TL_error;
this.f$2 = bundle;
this.f$3 = tLObject;
this.f$4 = tLRPC$TL_account_sendChangePhoneCode;
}
public final void run() {
this.f$0.lambda$onNextPressed$6(this.f$1, this.f$2, this.f$3, this.f$4);
}
}
| [
"fabian_pastor@msn.com"
] | fabian_pastor@msn.com |
2ee4ad670b887c5d9a4ab6472f866b9838f62ff8 | 39481154f1a728c73367efa782346844b9272492 | /src/main/java/top/zywork/dto/GoodsOrderItemDTO.java | 696da88f4fc13afe9a4cb57995f77ea4ff488075 | [] | no_license | hyx-jetbrains/zywork-app | 1580d544df8dbe7e4547d70ff797a68cf8a9c104 | 81a26a374496aa1e15b2847f2a32f0fc8a982367 | refs/heads/master | 2020-07-06T08:28:42.718528 | 2019-08-16T09:10:09 | 2019-08-16T09:10:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,483 | java | package top.zywork.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
/**
* GoodsOrderItemDTO数据传输对象类<br/>
*
* 创建于2019-07-26<br/>
*
* @author http://zywork.top 王振宇
* @version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = true)
public class GoodsOrderItemDTO extends BaseDTO {
private static final long serialVersionUID = -9223372035243011194L;
/**
* 订单项编号
*/
private Long id;
/**
* 订单编号
*/
private Long orderId;
/**
* 店铺编号
*/
private Long shopId;
/**
* 商品编号
*/
private Long goodsId;
/**
* SKU编号
*/
private Long goodsSkuId;
/**
* SKU图片编号
*/
private Long skuPicId;
/**
* 售卖标题
*/
private String skuTitle;
/**
* SKU规格信息
*/
private String skuInfo;
/**
* 购买数量
*/
private Integer quantity;
/**
* 实付金额(元)
*/
private BigDecimal payAmount;
/**
* 优惠金额(元)
*/
private BigDecimal discountAmount;
/**
* 赠送积分
*/
private Long integralAmount;
/**
* 版本号
*/
private Integer version;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 是否激活
*/
private Byte isActive;
}
| [
"847315251@qq.com"
] | 847315251@qq.com |
48ef5147b0e4a1d245e97d3500098d5d4facd154 | 63aab12f6627e5cd016adff777ee3ab3084be64e | /src/main/java/com/kondratev/exam/web/rest/PublicUserResource.java | a8d5428012f1484268a441a08903ba18112e6efd | [] | no_license | Menadza/exam-class | a33d179f85ae3326e0ddd357f18022e67daece63 | 5a9d17f9bfdb56ce10464065deeffcd07955ede6 | refs/heads/main | 2023-08-26T11:37:22.249170 | 2021-10-09T18:54:16 | 2021-10-09T18:54:16 | 415,396,090 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,485 | java | package com.kondratev.exam.web.rest;
import com.kondratev.exam.service.UserService;
import com.kondratev.exam.service.dto.UserDTO;
import java.util.*;
import java.util.Collections;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import tech.jhipster.web.util.PaginationUtil;
@RestController
@RequestMapping("/api")
public class PublicUserResource {
private static final List<String> ALLOWED_ORDERED_PROPERTIES = Collections.unmodifiableList(
Arrays.asList("id", "login", "firstName", "lastName", "email", "activated", "langKey")
);
private final Logger log = LoggerFactory.getLogger(PublicUserResource.class);
private final UserService userService;
public PublicUserResource(UserService userService) {
this.userService = userService;
}
/**
* {@code GET /users} : get all users with only the public informations - calling this are allowed for anyone.
*
* @param pageable the pagination information.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body all users.
*/
@GetMapping("/users")
public ResponseEntity<List<UserDTO>> getAllPublicUsers(Pageable pageable) {
log.debug("REST request to get all public User names");
if (!onlyContainsAllowedProperties(pageable)) {
return ResponseEntity.badRequest().build();
}
final Page<UserDTO> page = userService.getAllPublicUsers(pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page);
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}
private boolean onlyContainsAllowedProperties(Pageable pageable) {
return pageable.getSort().stream().map(Sort.Order::getProperty).allMatch(ALLOWED_ORDERED_PROPERTIES::contains);
}
/**
* Gets a list of all roles.
* @return a string list of all roles.
*/
@GetMapping("/authorities")
public List<String> getAuthorities() {
return userService.getAuthorities();
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
a9dd6ad2390f26c0d65b57e94b241e224403d5ba | 02844a1bc2446f0deb1bee7db0f94d24556062b6 | /social-im-provider/social-im-game-center/src/main/java/com/enuos/live/service/impl/GameUserRecordServiceImpl.java | 740694ffda30bd386953037e2bceec3460214c4c | [] | no_license | xubinxmcog/xbObj20201120 | 7b48f73f910fc79854b59edec38c67a17ea35168 | f4e9dc95ba69395eefb50c3c6f7ef4ba1a99943e | refs/heads/master | 2023-01-23T02:51:45.427100 | 2020-11-30T02:59:32 | 2020-11-30T02:59:32 | 314,460,677 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,968 | java | package com.enuos.live.service.impl;
import com.enuos.live.assets.GameInviteAssets;
import com.enuos.live.mapper.GameUserRecordMapper;
import com.enuos.live.pojo.GameUserRecord;
import com.enuos.live.result.Result;
import com.enuos.live.service.GameUserRecordService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* TODO 游玩记录(GameUserRecord)服务实现类.
*
* @author WangCaiWen - missiw@163.com
* @version 1.0
* @since 2020-05-19 10:45:13
*/
@Service("gameUserRecordService")
public class GameUserRecordServiceImpl implements GameUserRecordService {
@Resource
private GameUserRecordMapper gameUserRecordMapper;
@Override
public Result getRecentlyGameList(Map<String, Object> params) {
if (params == null || params.isEmpty()) {
return Result.error();
}
// long userId = ((Number) params.get("userId")).longValue();
Long userId = MapUtils.getLong(params, "userId");
if (userId <= 0) {
return Result.error();
}
List<Map<String, Object>> recentlyGameList = this.gameUserRecordMapper.getRecentlyGameList(userId);
return Result.success(recentlyGameList);
}
@Override
public Result getFrequentlyGameList(Map<String, Object> params) {
if (params == null || params.isEmpty()) {
return Result.error();
}
Long userId = MapUtils.getLong(params, "targetUserId");
if (userId <= 0) {
return Result.error();
}
int isChat = 0;
if (params.containsKey("isChat")) {
isChat = (Integer) params.get("isChat");
}
List<Map<String, Object>> frequentlyGameList = this.gameUserRecordMapper.getFrequentlyGameList(userId);
if (CollectionUtils.isNotEmpty(frequentlyGameList) && isChat == 1) {
frequentlyGameList = frequentlyGameList.stream()
.filter(objectMap -> GameInviteAssets.getErrorInvite(((Number)objectMap.get("gameCode")).longValue()) == null)
.collect(Collectors.toList());
}
return Result.success(frequentlyGameList);
}
@Override
public Result refreshUserRecord(Map<String, Object> params) {
Long gameCode = ((Number) params.get("gameId")).longValue();
Long userId = ((Number) params.get("userId")).longValue();
if (gameCode <= 0 || userId <= 0) {
return Result.error();
}
Integer numberOfData = this.gameUserRecordMapper.getNumberOfData(gameCode, userId);
if (numberOfData > 0) {
this.gameUserRecordMapper.updateUserRecord(gameCode, userId);
} else {
GameUserRecord gameUserRecord = new GameUserRecord();
gameUserRecord.setUserId(userId);
gameUserRecord.setGamePlay(1);
gameUserRecord.setGameCode(gameCode);
this.gameUserRecordMapper.insertUserRecord(gameUserRecord);
}
return Result.success();
}
} | [
"xubinxmcog@sina.com"
] | xubinxmcog@sina.com |
967c80bbde3d7a6fb6eac18276a23481560d14c6 | 7b12f67da8c10785efaebe313547a15543a39c77 | /jjg-member/src/main/java/com/xdl/jjg/mapper/EsOpenidMobileMapper.java | a211098450577c43393f5a34d2dcd7c2bf528200 | [] | no_license | liujinguo1994/xdl-jjg | 071eaa5a8fb566db6b47dbe046daf85dd2b9bcd8 | 051da0a0dba18e6e5021ecb4ef3debca16b01a93 | refs/heads/master | 2023-01-06T09:11:30.487559 | 2020-11-06T14:42:45 | 2020-11-06T14:42:45 | 299,525,315 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package com.xdl.jjg.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdl.jjg.entity.EsOpenidMobile;
/**
* <p>
* 微信关联手机号 Mapper 接口
* </p>
*
* @author rm 2817512105@qq.com
* @since 2020-05-09
*/
public interface EsOpenidMobileMapper extends BaseMapper<EsOpenidMobile> {
}
| [
"344009799@qq.com"
] | 344009799@qq.com |
4c1afeffdb69fb34309006f811d1a77f1d688f95 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/neo4j/2016/8/LabelCountsTest.java | 80ad345510e645cec1eaf936c88844acc2ea9684 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 5,847 | java | /*
* Copyright (c) 2002-2016 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.counts;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import java.util.function.Supplier;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Transaction;
import org.neo4j.kernel.api.ReadOperations;
import org.neo4j.kernel.api.Statement;
import org.neo4j.kernel.impl.core.ThreadToStatementContextBridge;
import org.neo4j.test.rule.DatabaseRule;
import org.neo4j.test.rule.ImpermanentDatabaseRule;
import static org.junit.Assert.assertEquals;
import static org.neo4j.graphdb.Label.label;
public class LabelCountsTest
{
@Rule
public final DatabaseRule db = new ImpermanentDatabaseRule();
@Test
public void shouldGetNumberOfNodesWithLabel() throws Exception
{
// given
GraphDatabaseService graphDb = db.getGraphDatabaseAPI();
try ( Transaction tx = graphDb.beginTx() )
{
graphDb.createNode( label( "Foo" ) );
graphDb.createNode( label( "Bar" ) );
graphDb.createNode( label( "Bar" ) );
tx.success();
}
// when
long fooCount = numberOfNodesWith( label( "Foo" ) );
long barCount = numberOfNodesWith( label( "Bar" ) );
// then
assertEquals( 1, fooCount );
assertEquals( 2, barCount );
}
@Test
public void shouldAccountForDeletedNodes() throws Exception
{
// given
GraphDatabaseService graphDb = db.getGraphDatabaseAPI();
Node node;
try ( Transaction tx = graphDb.beginTx() )
{
node = graphDb.createNode( label( "Foo" ) );
graphDb.createNode( label( "Foo" ) );
tx.success();
}
try ( Transaction tx = graphDb.beginTx() )
{
node.delete();
tx.success();
}
// when
long fooCount = numberOfNodesWith( label( "Foo" ) );
// then
assertEquals( 1, fooCount );
}
@Test
public void shouldAccountForAddedLabels() throws Exception
{
// given
GraphDatabaseService graphDb = db.getGraphDatabaseAPI();
Node n1, n2, n3;
try ( Transaction tx = graphDb.beginTx() )
{
n1 = graphDb.createNode( label( "Foo" ) );
n2 = graphDb.createNode();
n3 = graphDb.createNode();
tx.success();
}
try ( Transaction tx = graphDb.beginTx() )
{
n1.addLabel( label( "Bar" ) );
n2.addLabel( label( "Bar" ) );
n3.addLabel( label( "Foo" ) );
tx.success();
}
// when
long fooCount = numberOfNodesWith( label( "Foo" ) );
long barCount = numberOfNodesWith( label( "Bar" ) );
// then
assertEquals( 2, fooCount );
assertEquals( 2, barCount );
}
@Test
public void shouldAccountForRemovedLabels() throws Exception
{
// given
GraphDatabaseService graphDb = db.getGraphDatabaseAPI();
Node n1, n2, n3;
try ( Transaction tx = graphDb.beginTx() )
{
n1 = graphDb.createNode( label( "Foo" ), label( "Bar" ) );
n2 = graphDb.createNode( label( "Bar" ) );
n3 = graphDb.createNode( label( "Foo" ) );
tx.success();
}
try ( Transaction tx = graphDb.beginTx() )
{
n1.removeLabel( label( "Bar" ) );
n2.removeLabel( label( "Bar" ) );
n3.removeLabel( label( "Foo" ) );
tx.success();
}
// when
long fooCount = numberOfNodesWith( label( "Foo" ) );
long barCount = numberOfNodesWith( label( "Bar" ) );
// then
assertEquals( 1, fooCount );
assertEquals( 0, barCount );
}
/** Transactional version of {@link #countsForNode(Label)} */
private long numberOfNodesWith( Label label )
{
try ( Transaction tx = db.getGraphDatabaseAPI().beginTx() )
{
long nodeCount = countsForNode( label );
tx.success();
return nodeCount;
}
}
/** @param label the label to get the number of nodes of, or {@code null} to get the total number of nodes. */
private long countsForNode( Label label )
{
ReadOperations read = statementSupplier.get().readOperations();
int labelId;
if ( label == null )
{
labelId = ReadOperations.ANY_LABEL;
}
else
{
if ( ReadOperations.NO_SUCH_LABEL == (labelId = read.labelGetForName( label.name() )) )
{
return 0;
}
}
return read.countsForNode( labelId );
}
private Supplier<Statement> statementSupplier;
@Before
public void exposeGuts()
{
statementSupplier = db.getGraphDatabaseAPI().getDependencyResolver()
.resolveDependency( ThreadToStatementContextBridge.class );
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
89f1830421d354edfd9cf4c2c80da410c69065b5 | 15fd51ad2461979d8cd599291d9964aa8458debd | /src/com/dgut/main/member/entity/Talk.java | 47690f8ecad575928d12544fe2029807b9b4e4d6 | [] | no_license | HGITHome/LetGo | 0b6fb9ed7c031642063ddf7e1256721055e3890f | 70d9590220d29b4f8c9c39ff8f705ed8822e0188 | refs/heads/master | 2021-07-25T18:54:53.687153 | 2017-11-07T14:43:32 | 2017-11-07T14:43:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 463 | java | package com.dgut.main.member.entity;
import java.util.Date;
import java.util.List;
import java.util.Set;
import com.dgut.main.member.entity.base.BaseTalk;
public class Talk extends BaseTalk{
public Talk() {
super();
// TODO Auto-generated constructor stub
}
public Talk(Integer talk_id, Date publish_time, String contents,
String video_url) {
super(talk_id, publish_time, contents, video_url);
// TODO Auto-generated constructor stub
}
}
| [
"2465824792@qq.com"
] | 2465824792@qq.com |
3b55771139ba3cad13878a14110dc5552cc6d6e2 | aecffb5cc456d31f938774a02de30c062fee726b | /sources/android/support/v4/media/SeslAudioManagerReflector.java | 9119cade2b11e3ffb67d65008b4c050477b8a776 | [] | no_license | Austin-Chow/SamsungClock10.0.04.3 | 6d48abd288f3b182a6520315ef526163a94b0278 | 5523378f7fea1bf462248fddf52a7828ff2de0a9 | refs/heads/master | 2020-06-29T12:44:41.353764 | 2019-08-04T20:47:14 | 2019-08-04T20:47:14 | 200,538,351 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,136 | java | package android.support.v4.media;
import android.media.AudioManager;
import android.support.v4.SeslBaseReflector;
import java.lang.reflect.Field;
public class SeslAudioManagerReflector {
static final AudioManagerBaseImpl IMPL = new AudioManagerApi21Impl();
private static final Class<?> mClass = AudioManager.class;
private interface AudioManagerBaseImpl {
int getField_SOUND_TIME_PICKER_SCROLL();
}
private static class AudioManagerApi21Impl implements AudioManagerBaseImpl {
private AudioManagerApi21Impl() {
}
public int getField_SOUND_TIME_PICKER_SCROLL() {
Field field = SeslBaseReflector.getField(SeslAudioManagerReflector.mClass, "SOUND_TIME_PICKER_SCROLL");
if (field != null) {
Object sound = SeslBaseReflector.get(null, field);
if (sound instanceof Integer) {
return ((Integer) sound).intValue();
}
}
return 0;
}
}
public static int getField_SOUND_TIME_PICKER_SCROLL() {
return IMPL.getField_SOUND_TIME_PICKER_SCROLL();
}
}
| [
"myemail"
] | myemail |
f880f210ce2c84fcdbfb3196598c0744ae4f6462 | 17e8438486cb3e3073966ca2c14956d3ba9209ea | /dso/branches/3.4/code/base/dso-l2/src/com/tc/objectserver/tx/PassiveServerTransactionImpl.java | 9c5613cad2d651f5f90733eabc24080ebc737191 | [] | no_license | sirinath/Terracotta | fedfc2c4f0f06c990f94b8b6c3b9c93293334345 | 00a7662b9cf530dfdb43f2dd821fa559e998c892 | refs/heads/master | 2021-01-23T05:41:52.414211 | 2015-07-02T15:21:54 | 2015-07-02T15:21:54 | 38,613,711 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,780 | java | /*
* All content copyright (c) 2003-2008 Terracotta, Inc., except as may otherwise be noted in a separate copyright
* notice. All rights reserved.
*/
package com.tc.objectserver.tx;
import com.tc.net.NodeID;
import com.tc.object.dmi.DmiDescriptor;
import com.tc.object.dna.impl.ObjectStringSerializer;
import com.tc.object.locks.LockID;
import com.tc.object.tx.TransactionID;
import com.tc.object.tx.TxnBatchID;
import com.tc.object.tx.TxnType;
import com.tc.util.SequenceID;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class PassiveServerTransactionImpl extends ServerTransactionImpl implements ServerTransaction {
public PassiveServerTransactionImpl(TxnBatchID batchID, TransactionID txID, SequenceID sequenceID, LockID[] lockIDs,
NodeID source, List dnas, ObjectStringSerializer serializer, Map newRoots,
TxnType transactionType, Collection notifies, DmiDescriptor[] dmis,
int numApplicationTxn, long[] highWaterMarks) {
super(batchID, txID, sequenceID, lockIDs, source, dnas, serializer, newRoots, transactionType, notifies, dmis,
numApplicationTxn, highWaterMarks);
}
@Override
public DmiDescriptor[] getDmiDescriptors() {
throw new UnsupportedOperationException();
}
@Override
public Collection getNotifies() {
return Collections.EMPTY_LIST;
}
@Override
public ObjectStringSerializer getSerializer() {
throw new UnsupportedOperationException();
}
@Override
public boolean isActiveTxn() {
return false;
}
@Override
public String toString() {
return "PassiveServerTransactionImpl [ " + super.toString() + " ]";
}
}
| [
"jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864"
] | jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864 |
9d67ae69854612c0429f091d952006c89bd03182 | 32f0d9e3ea7e4c753c8d0b5ded5902ab08fa42bb | /oldataservice/src/main/java/com/sbm/module/onlineleasing/api/admin/merchantdetail/biz/impl/ProcessLawsuitServiceImpl.java | 083dfd6b0232e71893449c5c614a84f2f3539f5f | [] | no_license | superbrandmall/oldataservice | 8c30a746369b636c3f700109b35cfbe01f5e59f0 | 8749b32973300bff2f0aac1ef50c067923936f41 | refs/heads/master | 2018-12-25T01:06:23.913911 | 2018-10-18T01:25:42 | 2018-10-18T01:25:42 | 115,701,195 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,935 | java | package com.sbm.module.onlineleasing.api.admin.merchantdetail.biz.impl;
import java.text.MessageFormat;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.sbm.module.common.base.constant.CommonConstant;
import com.sbm.module.common.business.biz.impl.BusinessServiceImpl;
import com.sbm.module.common.business.constant.TransactionConstant;
import com.sbm.module.onlineleasing.api.admin.merchantdetail.biz.IProcessLawsuitService;
import com.sbm.module.onlineleasing.base.merchant.domain.TOLMerchant;
import com.sbm.module.onlineleasing.base.merchantdetail.lawsuit.biz.ITOLMerchantLawsuitService;
import com.sbm.module.onlineleasing.base.merchantdetail.lawsuit.domain.TOLMerchantLawsuit;
import com.sbm.module.partner.tianyancha.rest.lawsuit.biz.ILawSuitService;
import com.sbm.module.partner.tianyancha.rest.lawsuit.domain.LawSuit;
import com.sbm.module.partner.tianyancha.rest.lawsuit.domain.LawSuitItem;
/*****************************************************************************/
/**
* Project Name:oldataservice<br/>
* Package Name:com.sbm.module.onlineleasing.api.merchantdetail.biz.impl<br/>
* File Name:ProcessCourtAccountmentServiceImpl.java<br/>
*
* 作成日 :2017-10-20 下午3:33:57 <br/>
*
* @author :junkai.zhang
*/
@Component
@Transactional(value = TransactionConstant.OL, propagation = Propagation.REQUIRED)
public class ProcessLawsuitServiceImpl extends BusinessServiceImpl implements IProcessLawsuitService {
@Autowired
private ITOLMerchantLawsuitService service;
@Autowired
private ILawSuitService tycService;
public void process(TOLMerchant obj) {
// 删除记录
service.deleteByCode(obj.getCode());
// 添加记录
TOLMerchantLawsuit po = null;
try {
// 查询记录
LawSuit tmpList = tycService.findResultByName(obj.getName(), null);
for (LawSuitItem tmp : tmpList.getData().getItems()) {
po = new TOLMerchantLawsuit();
// 设置code
po.setCode(obj.getCode());
// 转换
convert(po, tmp);
service.save(po);
}
CommonConstant.FRAMEWORK.info(MessageFormat.format("{0}: save {1} ", this.getClass().getSimpleName(),
String.valueOf(tmpList.getData().getItems().size())));
} catch (Exception e) {
CommonConstant.FRAMEWORK.info(MessageFormat.format("{0}: {1}", this.getClass().getSimpleName(),
e.getMessage()));
}
}
private void convert(TOLMerchantLawsuit po, LawSuitItem tmp) {
po.setTitle(tmp.getTitle());
if (null != tmp.getSubmittime()) {
po.setSubmittime(new Date(tmp.getSubmittime()));
}
po.setCourt(tmp.getCourt());
po.setDoctype(tmp.getDoctype());
po.setUrl(tmp.getUrl());
po.setCaseno(tmp.getCaseno());
po.setCasetype(tmp.getCasetype());
po.setUuid(tmp.getUuid());
}
}
| [
"295322187@qq.com"
] | 295322187@qq.com |
dd0f6825600e6060376675fb9f04e6286e3bc6f2 | d8ce6c570362cdb088bc05297674fbb1f6fa3f34 | /api-consumer-circuit-breaker-enabled/src/main/java/poc/springcloud/ApiConsumerCircuitBreakerEnabledApplication.java | 87189dbcccc8a92c7b5ba345e728d3df412e3a5c | [] | no_license | ashishb888/spring-cloud-circuit-breaker-1.0-poc | 88cb0887f156d8d9585ab14355d15d848fbf587b | 2dfea524dc387e8b0acbc954bfa952e3e8f90c1b | refs/heads/master | 2022-12-10T00:00:25.428630 | 2020-09-14T04:14:36 | 2020-09-14T04:14:36 | 295,290,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package poc.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ApiConsumerCircuitBreakerEnabledApplication {
public static void main(String[] args) {
SpringApplication.run(ApiConsumerCircuitBreakerEnabledApplication.class, args);
}
}
| [
"ashish.bhosle008@gmail.com"
] | ashish.bhosle008@gmail.com |
f7c5e25762a947853e421f5b93f8520a27cb5a51 | 8a54e1c1ba300812528a42c4c588f7377ad303a2 | /lottie/src/main/java/com/airbnb/lottie/utils/LottieValueAnimator.java | b6014c4e767e2785253bd3019447926a65750ada | [] | no_license | niplus/obex | 47493c87aa3b1bd0d411fdd060ad191181b909c8 | b75de893543f60a0742cae64a9c139167f1fa677 | refs/heads/master | 2023-06-08T19:37:54.074589 | 2021-05-08T05:56:26 | 2021-05-08T05:56:26 | 364,802,048 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,897 | java | package com.airbnb.lottie.utils;
import android.animation.ValueAnimator;
import android.view.Choreographer;
import androidx.annotation.FloatRange;
import androidx.annotation.MainThread;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.airbnb.lottie.LottieComposition;
/**
* This is a slightly modified {@link ValueAnimator} that allows us to update start and end values
* easily optimizing for the fact that we know that it's a value animator with 2 floats.
*/
public class LottieValueAnimator extends BaseLottieAnimator implements Choreographer.FrameCallback {
private float speed = 1f;
private boolean speedReversedForRepeatMode = false;
private long lastFrameTimeNs = 0;
private float frame = 0;
private int repeatCount = 0;
private float minFrame = Integer.MIN_VALUE;
private float maxFrame = Integer.MAX_VALUE;
@Nullable
private LottieComposition composition;
@VisibleForTesting
protected boolean running = false;
public LottieValueAnimator() {
}
/**
* Returns a float representing the current value of the animation from 0 to 1
* regardless of the animation speed, direction, or min and max frames.
*/
@Override public Object getAnimatedValue() {
return getAnimatedValueAbsolute();
}
/**
* Returns the current value of the animation from 0 to 1 regardless
* of the animation speed, direction, or min and max frames.
*/
@FloatRange(from = 0f, to = 1f) public float getAnimatedValueAbsolute() {
if (composition == null) {
return 0;
}
return (frame - composition.getStartFrame()) / (composition.getEndFrame() - composition.getStartFrame());
}
/**
* Returns the current value of the currently playing animation taking into
* account direction, min and max frames.
*/
@Override @FloatRange(from = 0f, to = 1f) public float getAnimatedFraction() {
if (composition == null) {
return 0;
}
if (isReversed()) {
return (getMaxFrame() - frame) / (getMaxFrame() - getMinFrame());
} else {
return (frame - getMinFrame()) / (getMaxFrame() - getMinFrame());
}
}
@Override public long getDuration() {
return composition == null ? 0 : (long) composition.getDuration();
}
public float getFrame() {
return frame;
}
@Override public boolean isRunning() {
return running;
}
@Override public void doFrame(long frameTimeNanos) {
postFrameCallback();
if (composition == null || !isRunning()) {
return;
}
long now = System.nanoTime();
long timeSinceFrame = now - lastFrameTimeNs;
float frameDuration = getFrameDurationNs();
float dFrames = timeSinceFrame / frameDuration;
frame += isReversed() ? -dFrames : dFrames;
boolean ended = !MiscUtils.contains(frame, getMinFrame(), getMaxFrame());
frame = MiscUtils.clamp(frame, getMinFrame(), getMaxFrame());
lastFrameTimeNs = now;
notifyUpdate();
if (ended) {
if (getRepeatCount() != INFINITE && repeatCount >= getRepeatCount()) {
frame = getMaxFrame();
removeFrameCallback();
notifyEnd(isReversed());
} else {
notifyRepeat();
repeatCount++;
if (getRepeatMode() == REVERSE) {
speedReversedForRepeatMode = !speedReversedForRepeatMode;
reverseAnimationSpeed();
} else {
frame = isReversed() ? getMaxFrame() : getMinFrame();
}
lastFrameTimeNs = now;
}
}
verifyFrame();
}
private float getFrameDurationNs() {
if (composition == null) {
return Float.MAX_VALUE;
}
return Utils.SECOND_IN_NANOS / composition.getFrameRate() / Math.abs(speed);
}
public void clearComposition() {
this.composition = null;
minFrame = Integer.MIN_VALUE;
maxFrame = Integer.MAX_VALUE;
}
public void setComposition(LottieComposition composition) {
// Because the initial composition is loaded async, the first min/max frame may be set
boolean keepMinAndMaxFrames = this.composition == null;
this.composition = composition;
if (keepMinAndMaxFrames) {
setMinAndMaxFrames(
(int) Math.max(this.minFrame, composition.getStartFrame()),
(int) Math.min(this.maxFrame, composition.getEndFrame())
);
} else {
setMinAndMaxFrames((int) composition.getStartFrame(), (int) composition.getEndFrame());
}
setFrame((int) frame);
lastFrameTimeNs = System.nanoTime();
}
public void setFrame(int frame) {
if (this.frame == frame) {
return;
}
this.frame = MiscUtils.clamp(frame, getMinFrame(), getMaxFrame());
lastFrameTimeNs = System.nanoTime();
notifyUpdate();
}
public void setMinFrame(int minFrame) {
setMinAndMaxFrames(minFrame, (int) maxFrame);
}
public void setMaxFrame(int maxFrame) {
setMinAndMaxFrames((int) minFrame, maxFrame);
}
public void setMinAndMaxFrames(int minFrame, int maxFrame) {
float compositionMinFrame = composition == null ? -Float.MAX_VALUE : composition.getStartFrame();
float compositionMaxFrame = composition == null ? Float.MAX_VALUE : composition.getEndFrame();
this.minFrame = MiscUtils.clamp(minFrame, compositionMinFrame, compositionMaxFrame);
this.maxFrame = MiscUtils.clamp(maxFrame, compositionMinFrame, compositionMaxFrame);
setFrame((int) MiscUtils.clamp(frame, minFrame, maxFrame));
}
public void reverseAnimationSpeed() {
setSpeed(-getSpeed());
}
public void setSpeed(float speed) {
this.speed = speed;
}
/**
* Returns the current speed. This will be affected by repeat mode REVERSE.
*/
public float getSpeed() {
return speed;
}
@Override public void setRepeatMode(int value) {
super.setRepeatMode(value);
if (value != REVERSE && speedReversedForRepeatMode) {
speedReversedForRepeatMode = false;
reverseAnimationSpeed();
}
}
@MainThread
public void playAnimation() {
running = true;
notifyStart(isReversed());
setFrame((int) (isReversed() ? getMaxFrame() : getMinFrame()));
lastFrameTimeNs = System.nanoTime();
repeatCount = 0;
postFrameCallback();
}
@MainThread
public void endAnimation() {
removeFrameCallback();
notifyEnd(isReversed());
}
@MainThread
public void pauseAnimation() {
removeFrameCallback();
}
@MainThread
public void resumeAnimation() {
running = true;
postFrameCallback();
lastFrameTimeNs = System.nanoTime();
if (isReversed() && getFrame() == getMinFrame()) {
frame = getMaxFrame();
} else if (!isReversed() && getFrame() == getMaxFrame()) {
frame = getMinFrame();
}
}
@MainThread
@Override public void cancel() {
notifyCancel();
removeFrameCallback();
}
private boolean isReversed() {
return getSpeed() < 0;
}
public float getMinFrame() {
if (composition == null) {
return 0;
}
return minFrame == Integer.MIN_VALUE ? composition.getStartFrame() : minFrame;
}
public float getMaxFrame() {
if (composition == null) {
return 0;
}
return maxFrame == Integer.MAX_VALUE ? composition.getEndFrame() : maxFrame;
}
protected void postFrameCallback() {
if (isRunning()) {
removeFrameCallback(false);
Choreographer.getInstance().postFrameCallback(this);
}
}
@MainThread
protected void removeFrameCallback() {
this.removeFrameCallback(true);
}
@MainThread
protected void removeFrameCallback(boolean stopRunning) {
Choreographer.getInstance().removeFrameCallback(this);
if (stopRunning) {
running = false;
}
}
private void verifyFrame() {
if (composition == null) {
return;
}
if (frame < minFrame || frame > maxFrame) {
throw new IllegalStateException(String.format("Frame must be [%f,%f]. It is %f", minFrame, maxFrame, frame));
}
}
}
| [
"841270527@qq.com"
] | 841270527@qq.com |
d7a53fbe6ace189660bc7b4cbecbee8eac1050e2 | 6f88b4fd01b9d7632a47d794ed20a1349dcdb918 | /android/app/src/debug/java/com/snowy_unit_26217/ReactNativeFlipper.java | ceb667a2678752ceb998f6281c47d6fd95b5ef28 | [] | no_license | crowdbotics-apps/snowy-unit-26217 | c2dc9ee8dac7abf398c11b9205a636464ce17ed9 | e79feedd08865b24c0345398e60c05bc060b3ecd | refs/heads/master | 2023-04-22T07:58:24.017289 | 2021-05-06T02:55:03 | 2021-05-06T02:55:03 | 364,767,001 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,271 | java | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.snowy_unit_26217;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}
| [
"team@crowdbotics.com"
] | team@crowdbotics.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.