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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7d36ec343da77d66c4c387e94df43064f447a508 | c474b03758be154e43758220e47b3403eb7fc1fc | /apk/decompiled/com.tinder_2018-07-26_source_from_JADX/sources/com/tinder/settings/feed/activity/FeedSettingsActivity.java | 5b11faeda7f2bfa1a0184b90526daa2727992497 | [] | no_license | EstebanDalelR/tinderAnalysis | f80fe1f43b3b9dba283b5db1781189a0dd592c24 | 941e2c634c40e5dbf5585c6876ef33f2a578b65c | refs/heads/master | 2020-04-04T09:03:32.659099 | 2018-11-23T20:41:28 | 2018-11-23T20:41:28 | 155,805,042 | 0 | 0 | null | 2018-11-18T16:02:45 | 2018-11-02T02:44:34 | null | UTF-8 | Java | false | false | 3,853 | java | package com.tinder.settings.feed.activity;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.tinder.R;
import com.tinder.base.ActivitySignedInBase;
import com.tinder.managers.ManagerApp;
import com.tinder.settings.feed.injection.FeedSettingsActivityComponent;
import com.tinder.settings.feed.injection.FeedSettingsActivityComponentProvider;
import kotlin.Metadata;
import kotlin.TypeCastException;
import kotlin.jvm.internal.C2668g;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@Metadata(bv = {1, 0, 2}, d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u0018\u0000 \f2\u00020\u00012\u00020\u0002:\u0001\fB\u0005¢\u0006\u0002\u0010\u0003J\b\u0010\u0006\u001a\u00020\u0007H\u0016J\u0012\u0010\b\u001a\u00020\u00072\b\u0010\t\u001a\u0004\u0018\u00010\nH\u0014J\b\u0010\u000b\u001a\u00020\u0005H\u0016R\u000e\u0010\u0004\u001a\u00020\u0005X.¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Lcom/tinder/settings/feed/activity/FeedSettingsActivity;", "Lcom/tinder/base/ActivitySignedInBase;", "Lcom/tinder/settings/feed/injection/FeedSettingsActivityComponentProvider;", "()V", "feedSettingsActivityComponent", "Lcom/tinder/settings/feed/injection/FeedSettingsActivityComponent;", "finish", "", "onCreate", "bundle", "Landroid/os/Bundle;", "provideComponent", "Companion", "Tinder_release"}, k = 1, mv = {1, 1, 10})
public final class FeedSettingsActivity extends ActivitySignedInBase implements FeedSettingsActivityComponentProvider {
/* renamed from: a */
public static final C14870a f60019a = new C14870a();
/* renamed from: b */
private FeedSettingsActivityComponent f60020b;
@Metadata(bv = {1, 0, 2}, d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u000e\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006¨\u0006\u0007"}, d2 = {"Lcom/tinder/settings/feed/activity/FeedSettingsActivity$Companion;", "", "()V", "newIntent", "Landroid/content/Intent;", "context", "Landroid/content/Context;", "Tinder_release"}, k = 1, mv = {1, 1, 10})
/* renamed from: com.tinder.settings.feed.activity.FeedSettingsActivity$a */
public static final class C14870a {
private C14870a() {
}
@NotNull
/* renamed from: a */
public final Intent m56298a(@NotNull Context context) {
C2668g.b(context, "context");
return new Intent(context, FeedSettingsActivity.class);
}
}
protected void onCreate(@Nullable Bundle bundle) {
Application application = getApplication();
if (application == null) {
throw new TypeCastException("null cannot be cast to non-null type com.tinder.managers.ManagerApp");
}
this.f60020b = ((ManagerApp) application).h().feedSettingsActivityComponentBuilder().feedSettingsActivity(this).build();
super.onCreate(bundle);
setContentView(R.layout.activity_feed_settings);
overridePendingTransition(R.anim.enter_right_to_left, R.anim.enter_left_to_right);
}
public void finish() {
super.finish();
overridePendingTransition(R.anim.exit_left_to_right, R.anim.exit_right_to_left);
}
@NotNull
public FeedSettingsActivityComponent provideComponent() {
FeedSettingsActivityComponent feedSettingsActivityComponent = this.f60020b;
if (feedSettingsActivityComponent == null) {
C2668g.b("feedSettingsActivityComponent");
}
return feedSettingsActivityComponent;
}
}
| [
"jdguzmans@hotmail.com"
] | jdguzmans@hotmail.com |
29dc46dfa571be0dff2b9b3e3c2b1a9ad6b2e218 | dfbb30bee1b30c3a6520d2fd3e412f24637a5a87 | /flowless-mvp-example/src/main/java/com/zhuinden/examplegithubclient/domain/interactor/impl/LoginInteractorImpl.java | 5da19630925648bb01f757169462688a2e947ee0 | [
"Apache-2.0"
] | permissive | matrixxun/flowless | e57658421345ae3f599c2117e750441def676192 | a315f00c13c5488ff5f34c80a35ce7469e4c64ab | refs/heads/master | 2021-01-11T23:31:59.282202 | 2017-01-08T16:23:47 | 2017-01-08T16:23:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package com.zhuinden.examplegithubclient.domain.interactor.impl;
import com.zhuinden.examplegithubclient.application.BoltsExecutors;
import com.zhuinden.examplegithubclient.application.injection.ActivityScope;
import com.zhuinden.examplegithubclient.domain.interactor.LoginInteractor;
import javax.inject.Inject;
import bolts.Task;
/**
* Created by Zhuinden on 2016.12.18..
*/
@ActivityScope
public class LoginInteractorImpl
implements LoginInteractor {
@Inject
public LoginInteractorImpl() {
}
@Override
public Task<Boolean> login(String username, String password) {
return Task.call(() -> {
Thread.sleep(3250); // simulate login
return true;
}, BoltsExecutors.BACKGROUND_THREAD);
}
}
| [
"zhuinden@gmail.com"
] | zhuinden@gmail.com |
433bd0e90c77f18c361ed1fd5ab1d39dec174b1f | 1c3efc6e953032c4a72db38fbda8d3a046f6a39c | /bitcamp-java-basic/src/step02/Exam01.java | f279366c0c55693a49ed937ad1eaa8f7320659e1 | [] | no_license | Roktar/Bitcamp | 0ec49a91b45e686f6fb22be5523b5fa4b1799071 | c297eeff409bce686c3e404f36a36bcaab0cd7d0 | refs/heads/master | 2021-03-27T11:13:15.320024 | 2018-08-10T07:35:34 | 2018-08-10T07:35:34 | 122,951,923 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 145 | java | package step02;
public class Exam01 {
public static void main(String[] args) {
System.out.println("src/step02/Exam01.java");
}
} | [
"outofsight_@naver.com"
] | outofsight_@naver.com |
19967e67640336756b24bdd081e98a273ce79293 | c42531b0f0e976dd2b11528504e349d5501249ae | /Teeside/MHSystems/app/src/main/java/com/mh/systems/teesside/web/models/CompetitionsResultItems.java | bc6ca9b1ed5826a3c6c1b48f4d97a23564ac8cf2 | [
"MIT"
] | permissive | Karan-nassa/MHSystems | 4267cc6939de7a0ff5577c22b88081595446e09e | a0e20f40864137fff91784687eaf68e5ec3f842c | refs/heads/master | 2021-08-20T05:59:06.864788 | 2017-11-28T08:02:39 | 2017-11-28T08:02:39 | 112,189,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,356 | java |
package com.mh.systems.teesside.web.models;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class CompetitionsResultItems {
@SerializedName("Message")
@Expose
private String Message;
@SerializedName("Result")
@Expose
private Integer Result;
@SerializedName("MyAccountData")
@Expose
private List<CompetitionsData> Data = new ArrayList<CompetitionsData>();
/**
*
* @return
* The Message
*/
public String getMessage() {
return Message;
}
/**
*
* @param Message
* The Message
*/
public void setMessage(String Message) {
this.Message = Message;
}
/**
*
* @return
* The Result
*/
public Integer getResult() {
return Result;
}
/**
*
* @param Result
* The Result
*/
public void setResult(Integer Result) {
this.Result = Result;
}
/**
*
* @return
* The MyAccountData
*/
public List<CompetitionsData> getData() {
return Data;
}
/**
*
* @param Data
* The MyAccountData
*/
public void setData(List<CompetitionsData> Data) {
this.Data = Data;
}
}
| [
"karan@ucreate.co.in"
] | karan@ucreate.co.in |
44ae66de217bcee9db52e9e9099520861c9b767f | 050c78ac5017ab5600cfda79d982a350930b2ea3 | /okhttp-tests/src/test/java/okhttp3/internal/SingleInetAddressDns.java | 225fee9e6f2a1246b319367ce59cc059e3f466ec | [
"Apache-2.0"
] | permissive | zeroci/okhttp | bcc8769eaf1b582ed19dccb49eb7462b7dc07779 | f4b70f495b5a55f0694b75f8650dae0706ea43ce | refs/heads/master | 2021-01-15T08:32:30.984615 | 2015-12-22T04:36:59 | 2015-12-22T04:36:59 | 48,425,527 | 1 | 0 | null | 2015-12-22T10:22:47 | 2015-12-22T10:22:47 | null | UTF-8 | Java | false | false | 1,224 | java | /*
* Copyright (C) 2014 Square, 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 okhttp3.internal;
import okhttp3.Dns;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Collections;
import java.util.List;
/**
* A network that resolves only one IP address per host. Use this when testing
* route selection fallbacks to prevent the host machine's various IP addresses
* from interfering.
*/
public class SingleInetAddressDns implements Dns {
@Override public List<InetAddress> lookup(String hostname) throws UnknownHostException {
List<InetAddress> addresses = Dns.SYSTEM.lookup(hostname);
return Collections.singletonList(addresses.get(0));
}
}
| [
"jwilson@squareup.com"
] | jwilson@squareup.com |
529039db565a8acd7a829cf823037ad1c26b2e36 | da181f89e0b26ffb3fc5f9670a3a5f8f1ccf0884 | /BackGestionTextilLevel/src/ar/com/textillevel/gui/modulos/personal/modulos/recibossueldo/impresion/CreadorItemReciboSueldoTOVisitor.java | dadd243379b89e07f903b8ed1f5bd6104a4bd028 | [] | no_license | nacho270/GTL | a1b14b5c95f14ee758e6b458de28eae3890c60e1 | 7909ed10fb14e24b1536e433546399afb9891467 | refs/heads/master | 2021-01-23T15:04:13.971161 | 2020-09-18T00:58:24 | 2020-09-18T00:58:24 | 34,962,369 | 2 | 1 | null | 2016-08-22T22:12:57 | 2015-05-02T20:31:49 | Java | UTF-8 | Java | false | false | 2,371 | java | package ar.com.textillevel.gui.modulos.personal.modulos.recibossueldo.impresion;
import java.util.List;
import ar.com.textillevel.modulos.personal.entidades.recibosueldo.ItemReciboSueldoDeduccion;
import ar.com.textillevel.modulos.personal.entidades.recibosueldo.ItemReciboSueldoHaber;
import ar.com.textillevel.modulos.personal.entidades.recibosueldo.ItemReciboSueldoNoRemunerativo;
import ar.com.textillevel.modulos.personal.entidades.recibosueldo.ItemReciboSueldoRetencion;
import ar.com.textillevel.modulos.personal.entidades.recibosueldo.visitor.IItemReciboSueldoVisitor;
public class CreadorItemReciboSueldoTOVisitor implements IItemReciboSueldoVisitor {
private List<ItemReciboSueldoTO> items;
public CreadorItemReciboSueldoTOVisitor(List<ItemReciboSueldoTO> items) {
this.items = items;
}
public void visit(ItemReciboSueldoHaber irsh) {
ItemReciboSueldoTO item = new ItemReciboSueldoTO();
item.setConcepto(irsh.getDescripcion());
item.setCodigo(irsh.getCodigo() == null ? "" : irsh.getCodigo());
item.setHaberes(irsh.getMonto().toString());
item.setUnidades(irsh.getUnidades() == null ? "" : irsh.getUnidades().toString());
items.add(item);
}
public void visit(ItemReciboSueldoNoRemunerativo irsnr) {
ItemReciboSueldoTO item = new ItemReciboSueldoTO();
item.setConcepto(irsnr.getDescripcion());
item.setCodigo(irsnr.getCodigo() == null ? "" : irsnr.getCodigo());
item.setNoRemun(irsnr.getMonto().toString());
item.setUnidades(irsnr.getUnidades() == null ? "" : irsnr.getUnidades().toString());
items.add(item);
}
public void visit(ItemReciboSueldoRetencion irsr) {
ItemReciboSueldoTO item = new ItemReciboSueldoTO();
item.setConcepto(irsr.getDescripcion());
item.setCodigo(irsr.getCodigo() == null ? "" : irsr.getCodigo());
item.setRetenciones(irsr.getMonto().toString());
item.setUnidades(irsr.getUnidades() == null ? "" : item.getUnidades().toString());
items.add(item);
}
public void visit(ItemReciboSueldoDeduccion irsd) {
ItemReciboSueldoTO item = new ItemReciboSueldoTO();
item.setConcepto(irsd.getDescripcion());
item.setCodigo(irsd.getCodigo() == null ? "" : irsd.getCodigo());
item.setDeducciones(irsd.getMonto().toString());
item.setUnidades(irsd.getUnidades() == null ? "" : item.getUnidades().toString());
items.add(item);
}
} | [
"ignaciocicero@gmail.com@9de48aec-ec99-11dd-b2d9-215335d0b316"
] | ignaciocicero@gmail.com@9de48aec-ec99-11dd-b2d9-215335d0b316 |
b341f1072eb57d3ebb23f1a9ea8d49398e57559c | 92225460ebca1bb6a594d77b6559b3629b7a94fa | /src/com/kingdee/eas/fdc/invite/app/AbstractInviteTimeConsultEditUIHandler.java | f40ebdac356e6928a2be67d7f56a6472231505ad | [] | no_license | yangfan0725/sd | 45182d34575381be3bbdd55f3f68854a6900a362 | 39ebad6e2eb76286d551a9e21967f3f5dc4880da | refs/heads/master | 2023-04-29T01:56:43.770005 | 2023-04-24T05:41:13 | 2023-04-24T05:41:13 | 512,073,641 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 681 | java | /**
* output package name
*/
package com.kingdee.eas.fdc.invite.app;
import com.kingdee.bos.Context;
import com.kingdee.eas.framework.batchHandler.RequestContext;
import com.kingdee.eas.framework.batchHandler.ResponseContext;
/**
* output class name
*/
public abstract class AbstractInviteTimeConsultEditUIHandler extends com.kingdee.eas.fdc.invite.app.BaseInviteEditUIHandler
{
public void handleShowProjects(RequestContext request,ResponseContext response, Context context) throws Exception {
_handleShowProjects(request,response,context);
}
protected void _handleShowProjects(RequestContext request,ResponseContext response, Context context) throws Exception {
}
} | [
"yfsmile@qq.com"
] | yfsmile@qq.com |
0c762694708477402726f6501a48213eedc263a0 | 8c0f810e3fabb9310d1bd404c8a26f4d7ba3345a | /library/src/main/java/com/flash3388/flashview/commands/data/DataTypes.java | 17745265f1bbfe2c223e75ffd8106443142ac441 | [] | no_license | Flash3388/FlashView | 61950a49f4fcddab60cc55614b17ec573d9eb408 | 32e47f2b43bbea5523aa209743c062c04f9c4ab4 | refs/heads/master | 2023-08-23T23:31:20.437376 | 2023-06-29T12:07:19 | 2023-06-29T12:07:19 | 222,299,284 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 251 | java | package com.flash3388.flashview.commands.data;
public class DataTypes {
private DataTypes() {}
public static final DataType<Double> DOUBLE = new DoubleDataType();
public static final DataType<Integer> INTEGER = new IntegerDataType();
}
| [
"tomtzook@gmail.com"
] | tomtzook@gmail.com |
0a78d2ea8ecc03b42b360e0d6e61f5da37243836 | 33b1fb5acdfb4f23fd08b7e8defb487897fdd60f | /odbcprovider/src/main/java/ec/tss/tsproviders/odbc/registry/OdbcDataSource.java | 7d066cc4e8e315a4d4fe9827ce16e9a87b82e46a | [] | no_license | IngaDa/jdemetra-core | 6cafed92ea5fd08690f7e0831a45468f87f21284 | 865da3a076d0b68570b0f7978ca6de1ac38864e1 | refs/heads/master | 2020-05-04T16:14:44.176623 | 2019-01-15T09:59:48 | 2019-01-15T09:59:48 | 179,272,719 | 1 | 0 | null | 2019-04-03T11:07:26 | 2019-04-03T11:07:26 | null | UTF-8 | Java | false | false | 1,929 | java | /*
* Copyright 2013 National Bank of Belgium
*
* Licensed under the EUPL, Version 1.1 or – as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://ec.europa.eu/idabc/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package ec.tss.tsproviders.odbc.registry;
import ec.tstoolkit.design.Immutable;
@Immutable
public final class OdbcDataSource {
public enum Type {
SYSTEM, USER, FILE
};
//
private final Type type;
private final String name;
private final String description;
private final String driverDescription;
private final String driver;
private final String serverName;
public OdbcDataSource(Type type, String name, String description, String driverDescription, String driver, String serverName) {
this.type = type;
this.name = name;
this.description = description;
this.driverDescription = driverDescription;
this.driver = driver;
this.serverName = serverName;
}
public Type getType() {
return type;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public String getDriverDescription() {
return driverDescription;
}
public String getDriver() {
return driver;
}
public String getServerName() {
return serverName;
}
@Override
public String toString() {
return name;
}
}
| [
"philippe.charles@nbb.be"
] | philippe.charles@nbb.be |
e54f90befbeb57981f4c7eec3e9b2257f2f8fcdb | 7890d31a9ffd9e245782bc2b185e3eb8b9d5a63d | /broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/amqp_1_0/framing/TransportFrame.java | 47dcfb6ca27113c47ddbab6fd8dafa35d8cb1fea | [
"Apache-2.0",
"MIT"
] | permissive | vbohinc/qpid-java | 93f55f94720fbf08543e6ce436ff6bff03f2172a | d7d0b7f38aa4ab9b7daa16e0c2a129bacee2d4bd | refs/heads/master | 2022-07-22T05:56:30.908536 | 2015-12-03T15:13:30 | 2015-12-03T15:13:30 | 223,738,619 | 0 | 0 | Apache-2.0 | 2022-07-06T20:04:57 | 2019-11-24T12:13:16 | null | UTF-8 | Java | false | false | 1,520 | 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.qpid.amqp_1_0.framing;
import org.apache.qpid.amqp_1_0.type.FrameBody;
import org.apache.qpid.bytebuffer.QpidByteBuffer;
import java.nio.ByteBuffer;
public final class TransportFrame extends AMQFrame<FrameBody>
{
private final short _channel;
TransportFrame(short channel, FrameBody frameBody)
{
super(frameBody);
_channel = channel;
}
public TransportFrame(short channel, FrameBody frameBody, QpidByteBuffer payload)
{
super(frameBody, payload);
_channel = channel;
}
@Override public short getChannel()
{
return _channel;
}
@Override public byte getFrameType()
{
return (byte)0;
}
}
| [
"rgodfrey@apache.org"
] | rgodfrey@apache.org |
1a5caad6c92beadde21c21fc8c8e099e4f2b0ae6 | 2512eae0f5cbe889827b7d97452f03081ee45348 | /app/src/main/java/com/example/logonrm/pizzaria/MainActivity.java | 834d879926e28c0ea3a350bb75e701866fb7c8c9 | [] | no_license | persistere/Pizzaria | f21dfdc4e541fb14222b4de5f59bc8359e0a2e4d | bb14d957856f3a971d43f4059d0bc55bae4e3288 | refs/heads/master | 2021-08-28T10:44:39.038047 | 2017-12-12T01:15:04 | 2017-12-12T01:15:04 | 113,922,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,248 | java | package com.example.logonrm.pizzaria;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.TextView;
import com.example.logonrm.pizzaria.model.Pedido;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class MainActivity extends AppCompatActivity {
@BindView(R.id.cbBacon)
CheckBox cbBacon;
@BindView(R.id.cbAtum)
CheckBox cbAtumm;
@BindView(R.id.rgTamanho)
RadioGroup rgTamanho;
@BindView(R.id.spPagamentos)
Spinner spPagamentos;
private String nomeUsuario;
Pedido pedido = new Pedido();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
nomeUsuario = getIntent().getStringExtra("USUARIO");
setListernerCheckbox(cbAtumm);
setListernerCheckbox(cbBacon);
}
private void setListernerCheckbox(final CheckBox checkbox) {
checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
pedido.addSabor(checkbox.getText().toString());
} else {
pedido.removerSabor(checkbox.getText().toString());
}
}
});
}
@OnClick(R.id.btFecharPedido)
public void fecharPedido() {
pedido.setCliente(nomeUsuario);
pedido.setTamanho(getTamanhoSelecionado());
pedido.setFormaPagamento(spPagamentos.getSelectedItem().toString());
Intent i = new Intent(this, ConfirmarPedidoActivity.class);
i.putExtra("PEDIDO", pedido);
startActivity(i);
}
public String getTamanhoSelecionado() {
return ((RadioButton) findViewById(rgTamanho.getCheckedRadioButtonId()))
.getText().toString();
}
}
| [
"logonrm@fiap.com.br"
] | logonrm@fiap.com.br |
f97b3e3ba7b38690f3775e1c36a9b1d9cc8c4b97 | fbf98719e28de8c3621be4d2d99ba558321a53b4 | /src/main/java/com/fisc/declsituation/aop/logging/LoggingAspect.java | 9e608272994d46cf294edfe8a6c7020489a0fe9f | [] | no_license | sandalothier/jhipster-declsituation | ff1ad921f366264ebfca6fde53bdc5e6e8951b65 | d32cd9a0a3486bed29ae57d1147967c38e90a6bf | refs/heads/master | 2022-12-21T15:04:27.325039 | 2020-01-29T14:32:26 | 2020-01-29T14:32:26 | 229,047,905 | 0 | 0 | null | 2022-12-16T06:35:03 | 2019-12-19T12:15:20 | Java | UTF-8 | Java | false | false | 3,910 | java | package com.fisc.declsituation.aop.logging;
import io.github.jhipster.config.JHipsterConstants;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import org.springframework.core.env.Profiles;
import java.util.Arrays;
/**
* Aspect for logging execution of service and repository Spring components.
*
* By default, it only runs with the "dev" profile.
*/
@Aspect
public class LoggingAspect {
private final Logger log = LoggerFactory.getLogger(this.getClass());
private final Environment env;
public LoggingAspect(Environment env) {
this.env = env;
}
/**
* Pointcut that matches all repositories, services and Web REST endpoints.
*/
@Pointcut("within(@org.springframework.stereotype.Repository *)" +
" || within(@org.springframework.stereotype.Service *)" +
" || within(@org.springframework.web.bind.annotation.RestController *)")
public void springBeanPointcut() {
// Method is empty as this is just a Pointcut, the implementations are in the advices.
}
/**
* Pointcut that matches all Spring beans in the application's main packages.
*/
@Pointcut("within(com.fisc.declsituation.repository..*)"+
" || within(com.fisc.declsituation.service..*)"+
" || within(com.fisc.declsituation.web.rest..*)")
public void applicationPackagePointcut() {
// Method is empty as this is just a Pointcut, the implementations are in the advices.
}
/**
* Advice that logs methods throwing exceptions.
*
* @param joinPoint join point for advice.
* @param e exception.
*/
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT))) {
log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL", e.getMessage(), e);
} else {
log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
joinPoint.getSignature().getName(), e.getCause() != null? e.getCause() : "NULL");
}
}
/**
* Advice that logs when a method is entered and exited.
*
* @param joinPoint join point for advice.
* @return result.
* @throws Throwable throws {@link IllegalArgumentException}.
*/
@Around("applicationPackagePointcut() && springBeanPointcut()")
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
if (log.isDebugEnabled()) {
log.debug("Enter: {}.{}() with argument[s] = {}", joinPoint.getSignature().getDeclaringTypeName(),
joinPoint.getSignature().getName(), Arrays.toString(joinPoint.getArgs()));
}
try {
Object result = joinPoint.proceed();
if (log.isDebugEnabled()) {
log.debug("Exit: {}.{}() with result = {}", joinPoint.getSignature().getDeclaringTypeName(),
joinPoint.getSignature().getName(), result);
}
return result;
} catch (IllegalArgumentException e) {
log.error("Illegal argument: {} in {}.{}()", Arrays.toString(joinPoint.getArgs()),
joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName());
throw e;
}
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
0c571a4d858b2f983acffe2cd8ed35eef887078a | 3991404cc2dbef3df1cf4e20554619c9dd937051 | /src/test/java/com/test/abc/service/UsractionsServiceTest.java | 32824e89176a5ad1a8273aebfca88015509aa06c | [] | no_license | gmai2006/powerbuildertest | c2f26004c2fe45c423b5090fbcced4f00649d0ac | 01199c0d42722bed8eb71d46ef7c23f8636e98d3 | refs/heads/master | 2023-03-28T02:58:46.604352 | 2021-03-25T06:10:35 | 2021-03-25T06:10:35 | 316,666,970 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,457 | java | /**
* %% Copyright (C) 2021 DataScience 9 LLC %% Licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* <p>http://www.apache.org/licenses/LICENSE-2.0
*
* <p>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. #L%
*
* <p>This code is 100% AUTO generated. Please do not modify it DIRECTLY If you need new features or
* function or changes please update the templates then submit the template through our web
* interface.
*/
package com.test.abc.service;
import com.test.abc.entity.Usractions;
import com.test.abc.utils.FileUtils;
import com.google.gson.JsonArray;
import com.google.gson.GsonBuilder;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.Arrays;
import com.google.gson.Gson;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class UsractionsServiceTest {
private static DefaultUsractionsService serviceMock;
private static Usractions[] records;
static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss.S").create();
/** Run when the class is loaded. */
@BeforeClass
public static void setUp() {
serviceMock = mock(DefaultUsractionsService.class);
String inputFile = "Usractions.json";
try {
String json = FileUtils.readFileFromResource2String(inputFile, Charset.defaultCharset());
records = gson.fromJson(json, Usractions[].class);
} catch (IOException ex) {
ex.printStackTrace();
}
// test data
when(serviceMock.find(records[0].getKodapp())).thenReturn(records[0]);
}
@Test
public void testFind_success() {
Usractions testResult = serviceMock.find(records[0].getKodapp());
org.junit.Assert.assertNotNull(testResult);
org.junit.Assert.assertEquals(
"expect equals descaction ", this.records[0].getDescaction(), testResult.getDescaction());
org.junit.Assert.assertEquals(
"expect equals kodaction ", this.records[0].getKodaction(), testResult.getKodaction());
}
}
| [
"gmai2006@gmail.com"
] | gmai2006@gmail.com |
b406d7130dfd4c7c8e0dea1c00d55fb39f19793f | 4bb3a88b8e2dfa18c592fd0878a3110740c6db38 | /remote/branches/VuzeRemote_2.6.0/vuzeAndroidRemote/src/coreFlavor/java/com/vuze/android/remote/service/VuzeServiceIncomingHandler.java | 77b06cd3b6e533cd42fa2ddfef83c2d49ed5986a | [] | no_license | svn2github/vuze-android | 84f725baf90f17b64bfe5be8b350434a46160a95 | 833b9ee1c6b151d2b9ae7a7f9d646a0ca807a7d8 | refs/heads/master | 2023-09-03T15:33:20.420306 | 2017-03-06T23:47:51 | 2017-03-06T23:47:51 | 48,538,637 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,511 | java | /*
* Copyright (c) Azureus Software, Inc, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package com.vuze.android.remote.service;
import java.lang.ref.WeakReference;
import com.vuze.android.remote.AndroidUtils;
import com.vuze.util.RunnableWithObject;
import com.vuze.util.Thunk;
import android.os.*;
class VuzeServiceIncomingHandler
extends Handler
{
@Thunk
final WeakReference<VuzeServiceInitImpl> callback;
public VuzeServiceIncomingHandler(VuzeServiceInitImpl callback) {
this.callback = new WeakReference<>(callback);
}
@Override
public void handleMessage(Message msg) {
VuzeServiceInitImpl cb = callback.get();
if (cb == null) {
return;
}
if (AndroidUtils.DEBUG) {
Bundle data = msg.getData();
cb.logd("] Received from service: " + msg.what + ";"
+ (data == null ? null : data.get("data")));
}
switch (msg.what) {
case VuzeService.MSG_OUT_REPLY_ADD_LISTENER:
Runnable onAddedListener = cb.mapListeners.get("onAddedListener");
String state = msg.getData().getString("state");
if (onAddedListener != null) {
if (onAddedListener instanceof RunnableWithObject) {
((RunnableWithObject) onAddedListener).object = state;
}
onAddedListener.run();
}
if (state != null && state.equals("ready-to-start")) {
Message msgIn = Message.obtain(null, VuzeService.MSG_IN_START_CORE);
try {
cb.messengerService.send(msgIn);
} catch (RemoteException e) {
e.printStackTrace();
}
}
break;
case VuzeService.MSG_OUT_CORE_STARTED:
Runnable onCoreStarted = cb.mapListeners.get("onCoreStarted");
if (onCoreStarted != null) {
onCoreStarted.run();
}
cb.coreServiceRestarting = false;
break;
case VuzeService.MSG_OUT_CORE_STOPPING:
Runnable onCoreStopping = cb.mapListeners.get("onCoreStopping");
cb.coreServiceRestarting = msg.getData().getBoolean("restarting");
if (!cb.coreServiceRestarting && onCoreStopping != null) {
onCoreStopping.run();
}
Runnable onCoreRestarting = cb.mapListeners.get("onCoreRestarting");
if (cb.coreServiceRestarting && onCoreRestarting != null) {
onCoreRestarting.run();
}
break;
case VuzeService.MSG_OUT_SERVICE_DESTROY:
cb.coreServiceRestarting = msg.getData().getBoolean("restarting");
// trigger a powerUp, so that we attach our listeners to the
// new service
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1200);
} catch (InterruptedException e) {
e.printStackTrace();
}
VuzeServiceInitImpl cb = callback.get();
if (cb == null) {
return;
}
if (cb.coreServiceRestarting) {
cb.powerUp();
}
}
}).start();
break;
default:
super.handleMessage(msg);
}
}
}
| [
"amogge@c2c1b7af-1477-405b-86ee-8aefd1fc4dd2"
] | amogge@c2c1b7af-1477-405b-86ee-8aefd1fc4dd2 |
671b98de871ebc5a20a5a0a316c2acd811f28741 | 83110fbb179713c411ddf301c90ef4b814285846 | /src/DeviceControllerNotSupported.java | 756432195cdc3b26228f88a5df99efb1ce8d0792 | [] | 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 | 1,571 | java |
package com.vmware.vim25;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for DeviceControllerNotSupported complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="DeviceControllerNotSupported">
* <complexContent>
* <extension base="{urn:vim25}DeviceNotSupported">
* <sequence>
* <element name="controller" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DeviceControllerNotSupported", propOrder = {
"controller"
})
public class DeviceControllerNotSupported
extends DeviceNotSupported
{
@XmlElement(required = true)
protected String controller;
/**
* Gets the value of the controller property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getController() {
return controller;
}
/**
* Sets the value of the controller property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setController(String value) {
this.controller = value;
}
}
| [
"dev@scidentify.info"
] | dev@scidentify.info |
cac5db8e9305a7899d65ffa10a300e7b2973b2e3 | 4c7f91c81fc39969441d829826dcc5b9a14d2c4f | /app/src/main/java/com/wootag/dto/RecentLikes.java | 35be0890552e7076dc29a869439976c8207834b5 | [] | no_license | sarvex/TagFuA | 785a0387cdd6ab4a3fe3ab9234c580dcb988ac67 | 044caf536415eba650f026c9531c66647ff2a6b7 | refs/heads/master | 2023-05-28T10:47:43.603088 | 2023-05-03T03:18:00 | 2023-05-03T03:18:00 | 26,382,518 | 0 | 0 | null | 2023-05-03T03:18:01 | 2014-11-09T02:48:11 | C | UTF-8 | Java | false | false | 1,238 | java | /*
* Copyright (C) 2014 - present : TagFu Pte Ltd - All Rights Reserved. Unauthorized copying of this file, via any
* medium is strictly prohibited - Proprietary and confidential
*/
package com.TagFu.dto;
import java.io.Serializable;
import org.json.JSONException;
import org.json.JSONObject;
import com.noveogroup.android.log.Logger;
import com.noveogroup.android.log.LoggerManager;
import com.TagFu.Constant;
import com.TagFu.util.Stream;
public class RecentLikes implements Serializable {
private static final Logger LOG = LoggerManager.getLogger();
private static final long serialVersionUID = -6874843950726331400L;
private String userName;
private String userId;
public String getUserId() {
return this.userId;
}
public String getUserName() {
return this.userName;
}
public void load(final JSONObject response) throws JSONException {
this.userName = Stream.getString(response, Constant.USER_NAME);
this.userId = Stream.getString(response, Constant.USER_ID);
}
public void setUserId(final String userId) {
this.userId = userId;
}
public void setUserName(final String userName) {
this.userName = userName;
}
}
| [
"sarvex.jatasra@gmail.com"
] | sarvex.jatasra@gmail.com |
4906b472dfa1e1e5e5acff0878ad779deeb533cc | e3196972bb84665d67b32b3a17a0589b45f4e80d | /plugins/svn4idea/testSource/org/jetbrains/idea/svn17/MultipleRefreshesTest.java | 52efd8412809851c755aeb4b109e0b9f413c6a69 | [
"Apache-2.0"
] | permissive | hablutzel1/intellij-community | de62128e7770562b5d6111e4fcd55174c225f5fe | 8d7f3d1d1a978715420a5722e6fe7892c24d89e9 | refs/heads/master | 2021-01-18T04:42:31.374164 | 2012-02-15T13:45:38 | 2012-02-15T14:06:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,755 | java | /*
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.idea.svn17;
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
import org.junit.After;
import org.junit.Before;
import org.junit.runners.Parameterized;
import java.util.ArrayList;
import java.util.List;
/**
* Created with IntelliJ IDEA.
* User: Irina.Chernushina
* Date: 1/25/12
* Time: 12:37 PM
*/
@org.junit.runner.RunWith(org.junit.runners.Parameterized.class)
public class MultipleRefreshesTest {
private SvnChangesCorrectlyRefreshedTest myTest;
@Before
public void setUp() throws Exception {
myTest.setUp();
}
@After
public void tearDown() throws Exception {
myTest.tearDown();
}
@Parameterized.Parameters
public static List<Object[]> data() {
final ArrayList<Object[]> result = new ArrayList<Object[]>(10);
for (int i = 0; i < 100; i++) {
result.add(new Object[]{i});
}
return result;
}
public MultipleRefreshesTest(int cnt) {
ChangeListManagerImpl.LOG.info("TEST " + cnt);
myTest = new SvnChangesCorrectlyRefreshedTest();
}
@org.junit.Test
public void testName() throws Exception {
myTest.testModificationAndAfterRevert();
}
}
| [
"Irina.Chernushina@jetbrains.com"
] | Irina.Chernushina@jetbrains.com |
f242113d23e778717cf2f3436ae44e39a52bd727 | fbafb851e4c6d120b1cebad7edc03be56bbf5323 | /vip-desigin/src/main/java/com/lxl/proxy/simpleproxy/RealSubject.java | 0dcc070933fedfd669d1fdf2c80d6ce2edfb3fe5 | [] | no_license | jackhman/vip | aa807d89701b929aaa6ee4dc3c728bf9af5ebe13 | f397ee69a6d90ba431f18934d735dc37c4fb75b1 | refs/heads/master | 2023-04-09T12:46:14.652796 | 2020-04-23T03:14:16 | 2020-04-23T03:14:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 183 | java | package com.lxl.proxy.simpleproxy;
public class RealSubject implements Subject{
@Override
public void request() {
System.out.println("real service is called.");
}
}
| [
"408030514@qq.com"
] | 408030514@qq.com |
2604c1b39335257e85e0eca2f05e4a6e776c0ff8 | 9acd0cb19c1cf4485a1516eb04b9844c3600c879 | /dada/sports-oss-comm/src/main/java/com/youyisi/sports/domain/step/StepWithUser.java | 8386da4e0379e57de3c8a922a9e8f792eb9b0717 | [] | no_license | kevinkerry/dada | e8156f0dc57d2745334bb13d1b9010bf64f97a21 | ff6a8d0be3dbfc61ca72a2cac22b1cb57f80bce7 | refs/heads/master | 2021-04-26T23:54:10.877546 | 2017-02-21T05:36:07 | 2017-02-21T05:36:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,589 | java | package com.youyisi.sports.domain.step;
import com.youyisi.sports.domain.BaseEntity;
import com.youyisi.sports.domain.user.User;
/**
* @author shuye
* @time 2016-05-12
*/
public class StepWithUser extends BaseEntity {
/**
*
*/
private static final long serialVersionUID = 2848165974761604213L;
private Long userId; //
private Integer step; //
private Integer status; //
private Long date; //
private Long createTime; //
private Long updateTime; //
private User user;
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getUserId() {
return userId;
}
public void setStep(Integer step) {
this.step = step;
}
public Integer getStep() {
return step;
}
public void setDate(Long date) {
this.date = date;
}
public Long getDate() {
return date;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getCreateTime() {
return createTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public Long getUpdateTime() {
return updateTime;
}
@Override
public String toString() {
return "Step [userId=" + userId + ", step=" + step + ", date=" + date + ", createTime=" + createTime
+ ", updateTime=" + updateTime + "]";
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
| [
"804745459@qq.com"
] | 804745459@qq.com |
268737f4496d83075d68fe10cd93deeba1988afd | 6ef6cf87e48177aae1012ec63e660a5f7e25463d | /lottery/src/main/java/com/daxiang/lottery/fragment/jcfragment/JczqLotteryResultFragment.java | 00b2e2dc5b5c96293f44803d64302471c145b598 | [] | no_license | yudonghui/lottery | 95de9fd019d4f546c1b9d7f0bfc1437e603be94e | fde0afc9cd0c3bed7e64913685ee881b60272de4 | refs/heads/master | 2020-04-16T18:19:41.833999 | 2019-01-15T08:36:34 | 2019-01-15T08:36:34 | 165,814,602 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,623 | java | package com.daxiang.lottery.fragment.jcfragment;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ExpandableListView;
import com.daxiang.lottery.R;
import com.daxiang.lottery.adapter.jcadapter.JclqResultAdapter;
import com.daxiang.lottery.adapter.jcadapter.JczqResultAdapter;
import com.daxiang.lottery.constant.Url;
import com.daxiang.lottery.cxinterface.HttpInterface2;
import com.daxiang.lottery.cxinterface.JsonInterface;
import com.daxiang.lottery.entity.JclqData;
import com.daxiang.lottery.entity.LotteryResultData;
import com.daxiang.lottery.utils.HttpUtils2;
import com.daxiang.lottery.utils.dialogutils.LoadingDialogUtils;
import com.daxiang.lottery.view.NoDataView;
import com.google.gson.Gson;
import com.ydh.refresh_layout.SmartRefreshLayout;
import com.ydh.refresh_layout.api.RefreshLayout;
import com.ydh.refresh_layout.listener.OnRefreshListener;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
* Created by Administrator on 2016/8/17 0017.
*/
public class JczqLotteryResultFragment extends Fragment {
View v;
private ExpandableListView mListView;
private SmartRefreshLayout mRefresh;
private NoDataView mNoData;
private String mLotcode;
public HashMap<String, ArrayList<LotteryResultData.DataBean.ItemBean>> mapJZ = new HashMap<>();
public HashMap<String, ArrayList<JclqData.DataBean>> mapJL = new HashMap<>();
public ArrayList<ArrayList<LotteryResultData.DataBean.ItemBean>> mListDataJZ = new ArrayList<>();
public ArrayList<ArrayList<JclqData.DataBean>> mListDataJL = new ArrayList<>();
private Context mContext;
public void setData(String lotcode, Context mContext) {
this.mContext = mContext;
if ("1000".equals(lotcode) || "42".equals(lotcode)) {
this.mLotcode = "42";
}
if ("1001".equals(lotcode) || "43".equals(lotcode)) {
this.mLotcode = "43";
}
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if (v == null) {
v = inflater.inflate(R.layout.jczq_lottery_result, null);
mRefresh = (SmartRefreshLayout) v.findViewById(R.id.refresh);
mListView = (ExpandableListView) v.findViewById(R.id.lottery_result_lv);
mListView.setGroupIndicator(null);
mNoData = (NoDataView) v.findViewById(R.id.no_data);
mNoData.setButtonText(mNoData.REFRESH);
}
mContext = getContext();
/* mListDataJZ.clear();
mListDataJL.clear();
mapJZ.clear();
mapJL.clear();
addData();*/
addListener();
return v;
}
private boolean isFirst = true;
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser && isFirst) {
isFirst = false;
addData();
}
}
private void addData() {
// LoadingDialogUtils.loading(getContext());
final LoadingDialogUtils loadingDialogUtils = new LoadingDialogUtils(mContext);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
Date date = new Date();
String issue = simpleDateFormat.format(date);
HttpInterface2 mHttp = new HttpUtils2(mContext);
Bundle params = new Bundle();
params.putString("lotCode", mLotcode);
params.putString("queryDays", "4");
mHttp.get(Url.RESULT_DETAIL_URL, params, new JsonInterface() {
@Override
public void callback(String result) {
loadingDialogUtils.setDimiss();
mRefresh.finishRefresh();
Gson gson = new Gson();
LotteryResultData jczqData = gson.fromJson(result, LotteryResultData.class);
if (jczqData.getCode() == 0) {
List<LotteryResultData.DataBean.ItemBean> data = jczqData.getData().getItem();
//用于排序
ArrayList<String> orderList = new ArrayList<String>();
for (int i = 0; i < data.size(); i++) {
ArrayList<LotteryResultData.DataBean.ItemBean> list;
if (mapJZ.containsKey(data.get(i).getIssue())) {
list = mapJZ.get(data.get(i).getIssue());
} else {
list = new ArrayList<>();
}
list.add(data.get(i));
mapJZ.put(data.get(i).getIssue(), list);
if (!orderList.contains(data.get(i).getIssue())) {
orderList.add(data.get(i).getIssue());
}
}
for (int i = 0; i < orderList.size(); i++) {
mListDataJZ.add(mapJZ.get(orderList.get(i)));
}
if ("42".equals(mLotcode)) {
JczqResultAdapter mAdapter = new JczqResultAdapter();
mAdapter.setData(getContext(), mLotcode, mListDataJZ);
mListView.setAdapter(mAdapter);
} else {
JclqResultAdapter mAdapter = new JclqResultAdapter();
mAdapter.setData(getContext(), mLotcode, mListDataJZ);
mListView.setAdapter(mAdapter);
}
for (int i = 0; i < mListDataJZ.size(); i++) {
mListView.expandGroup(i);
}
} //如果没有数据是显示个图片
if (mListDataJZ != null && mListDataJZ.size() != 0) {
mListView.setVisibility(View.VISIBLE);
mNoData.setVisibility(View.GONE);
} else {
mListView.setVisibility(View.GONE);
mNoData.setVisibility(View.VISIBLE);
}
}
@Override
public void onError() {
loadingDialogUtils.setDimiss();
mRefresh.finishRefresh();
if (mListDataJZ != null && mListDataJZ.size() != 0) {
mListView.setVisibility(View.VISIBLE);
mNoData.setVisibility(View.GONE);
} else {
mListView.setVisibility(View.GONE);
mNoData.setVisibility(View.VISIBLE);
}
}
});
}
private void addListener() {
mNoData.setOnClickListener(RefreshListener);
mRefresh.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
mapJZ.clear();
mapJL.clear();
mListDataJZ.clear();
mListDataJL.clear();
addData();
}
});
}
View.OnClickListener RefreshListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
mapJZ.clear();
mapJL.clear();
mListDataJZ.clear();
mListDataJL.clear();
addData();
}
};
}
| [
"yudonghui@51caixiang.com"
] | yudonghui@51caixiang.com |
0a1c6b14c9fdefba19d3f619fb86ab4e20e0ef53 | 6372f6bcc8578922803d914ce6d5bec58e483baa | /infra/prism/src/main/java/com/evolveum/midpoint/prism/query/ObjectOrdering.java | fa26e32b2aabb9b5d7ca36a2b896068c7ddd401e | [
"Apache-2.0",
"GPL-1.0-or-later",
"CDDL-1.0",
"MIT",
"LGPL-2.1-or-later"
] | permissive | Identicum/midpoint | 6a806b4ffc716d810b10b50759cc0ba7759d2ee4 | 5395e426cbf5990a60166ab04fa2b14917a0726c | refs/heads/master | 2022-10-21T23:38:22.677498 | 2018-06-21T21:11:49 | 2018-06-21T21:11:49 | 87,228,053 | 0 | 0 | Apache-2.0 | 2022-10-19T18:53:28 | 2017-04-04T19:43:55 | Java | UTF-8 | Java | false | false | 2,151 | java | /*
* Copyright (c) 2010-2015 Evolveum
*
* 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.evolveum.midpoint.prism.query;
import com.evolveum.midpoint.prism.path.ItemPath;
import java.io.Serializable;
/**
* @author mederly
*/
public class ObjectOrdering implements Serializable {
final private ItemPath orderBy;
final private OrderDirection direction;
ObjectOrdering(ItemPath orderBy, OrderDirection direction) {
if (ItemPath.isNullOrEmpty(orderBy)) {
throw new IllegalArgumentException("Null or empty ordering path is not supported.");
}
this.orderBy = orderBy;
this.direction = direction;
}
public static ObjectOrdering createOrdering(ItemPath orderBy, OrderDirection direction) {
return new ObjectOrdering(orderBy, direction);
}
public ItemPath getOrderBy() {
return orderBy;
}
public OrderDirection getDirection() {
return direction;
}
@Override
public String toString() {
return orderBy.toString() + " " + direction;
}
@Override
public boolean equals(Object o) {
return equals(o, true);
}
public boolean equals(Object o, boolean exact) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ObjectOrdering that = (ObjectOrdering) o;
if (orderBy != null ? !orderBy.equals(that.orderBy, exact) : that.orderBy != null)
return false;
return direction == that.direction;
}
@Override
public int hashCode() {
int result = 1;
result = 31 * result + (direction != null ? direction.hashCode() : 0);
return result;
}
}
| [
"mederly@evolveum.com"
] | mederly@evolveum.com |
6f25a5bc63c94ca112c073d0da7fbfca67a31dbd | 155a82cd25c6e3f6b26021869b9f501cc8b450a2 | /src/test/java/controller/people/TutorialControllerTest.java | 7103cdc52a2f012d16963bf8b93b79392dd84398 | [] | no_license | 215062264/Assignment9 | 6afe3f3ee70d7891d07fc7f10f983166e916d617 | 5cf55bfbd63cb3722386b50dd5e5d20016c24321 | refs/heads/master | 2020-05-25T20:47:23.034525 | 2019-05-22T07:11:37 | 2019-05-22T07:11:37 | 187,983,368 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,741 | java | package controller.people;
import ac.za.cput.domain.people.Student;
import ac.za.cput.factory.peopleFactory.StudentFactory;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.*;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.client.HttpClientErrorException;
import static junit.framework.TestCase.assertEquals;
import static org.junit.Assert.assertNotNull;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@RunWith(SpringRunner.class)
public class TutorialControllerTest {
@Autowired
private TestRestTemplate restTemplate;
private String baseURL="http://localhost:8080/student";
@Test
public void testGetAllStudents() {
HttpHeaders headers = new HttpHeaders();
HttpEntity<String> entity = new HttpEntity<String>(null, headers);
ResponseEntity<String> response = restTemplate.exchange(baseURL + "/read/all",
HttpMethod.GET, entity, String.class);
assertNotNull(response.getBody());
}
@Ignore
public void testGetStudentById() {
Student student = restTemplate.getForObject(baseURL + "/student/1", Student.class);
System.out.println(student.getStudentFirstName());
assertNotNull(student);
}
@Ignore
public void testCreateStudent() {
Student student = StudentFactory.getStudent("John"," Doh",29);
ResponseEntity<Student> postResponse = restTemplate.postForEntity(baseURL + "/create", student, Student.class);
assertNotNull(postResponse);
assertNotNull(postResponse.getBody());
}
@Ignore
public void testUpdateStudent() {
int id = 1;
Student student = restTemplate.getForObject(baseURL + "/student/" + id, Student.class);
restTemplate.put(baseURL + "/students/" + id, student);
Student updatedStudent = restTemplate.getForObject(baseURL + "/Student/" + id, Student.class);
assertNotNull(updatedStudent);
}
@Ignore
public void testDeleteEmployee() {
int id = 2;
Student student = restTemplate.getForObject(baseURL + "/students/" + id, Student.class);
assertNotNull(student);
restTemplate.delete(baseURL + "/students/" + id);
try {
student = restTemplate.getForObject(baseURL + "/students/" + id, Student.class);
} catch (final HttpClientErrorException e) {
assertEquals(e.getStatusCode(), HttpStatus.NOT_FOUND);
}
}
}
| [
"Kylejosias6@gmail.com"
] | Kylejosias6@gmail.com |
a6103bd999d8d41aa96a3e7434a03e7a688436f8 | ffeaf567e9b1aadb4c00d95cd3df4e6484f36dcd | /Talagram/androidx/work/l.java | c90d8b2d5a2b8cbbc9d54f2daaaa2c1be545b301 | [] | no_license | danielperez9430/Third-party-Telegram-Apps-Spy | dfe541290c8512ca366e401aedf5cc5bfcaa6c3e | f6fc0f9c677bd5d5cd3585790b033094c2f0226d | refs/heads/master | 2020-04-11T23:26:06.025903 | 2018-12-18T10:07:20 | 2018-12-18T10:07:20 | 162,166,647 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 858 | java | package androidx.work;
import android.os.Build$VERSION;
public final class l extends r {
public final class a extends androidx.work.r$a {
public a(Class arg2) {
super(arg2);
this.c.d = OverwritingInputMerger.class.getName();
}
l a() {
if((this.a) && Build$VERSION.SDK_INT >= 23) {
if(!this.c.j.c()) {
}
else {
throw new IllegalArgumentException("Cannot set backoff criteria on an idle mode job");
}
}
return new l(this);
}
a b() {
return this;
}
androidx.work.r$a c() {
return this.b();
}
r d() {
return this.a();
}
}
l(a arg3) {
super(arg3.b, arg3.c, arg3.d);
}
}
| [
"dpefe@hotmail.es"
] | dpefe@hotmail.es |
7369929f31a96e1111fa4080058211e9c4e72ac6 | 0fe0fdce7c3f1e0f210b6ad6a121847fc942d97c | /src/main/java/com/alipay/api/response/AlipayOpenPublicTopicBatchqueryResponse.java | 93d75a7f37bfdf292b46114a2a545a9a1e9ce90c | [
"Apache-2.0"
] | permissive | rico-bee/alipay-sdk | d9f6d9d481a0e2fbdf17aa61e37335281597d02f | 1386001bb496ab0e5dfe0c2455ed06a38d1799e6 | refs/heads/master | 2021-04-09T15:50:59.171276 | 2018-03-04T04:44:29 | 2018-03-04T04:44:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 780 | java | package com.alipay.api.response;
import java.util.List;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
import com.alipay.api.domain.Topic;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.open.public.topic.batchquery response.
*
* @author auto create
* @since 1.0, 2018-01-05 15:06:33
*/
public class AlipayOpenPublicTopicBatchqueryResponse extends AlipayResponse {
private static final long serialVersionUID = 7698271144627874861L;
/**
* 营销位列表
*/
@ApiListField("topic_list")
@ApiField("topic")
private List<Topic> topicList;
public void setTopicList(List<Topic> topicList) {
this.topicList = topicList;
}
public List<Topic> getTopicList( ) {
return this.topicList;
}
}
| [
"howechiang@gmail.com"
] | howechiang@gmail.com |
f3a10b279d4e8baa3b37231e5c2ea55d25841a23 | e15d7d0a2dc15998ba32de8ba0dbb2e515068f92 | /SIG_HDP_Master/SIG_HDP_Master-war/src/java/util/UploadFicheiro.java | 96d6f5f525f96f84127d5a3d0a6b7eac9e48dec9 | [] | no_license | Projecto2/PFII | 2e004c9010478edb64aa9192dcb060d1f46d8a4a | d21eb80fde87340c8ce34459966e0b8c0d2b6fa2 | refs/heads/master | 2021-09-09T14:00:07.955077 | 2018-03-16T19:09:58 | 2018-03-16T19:09:58 | 125,555,909 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,465 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package util;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import javax.servlet.http.Part;
/**
*
* @author Ornela F. Boaventura
*/
public class UploadFicheiro
{
private static final UploadFicheiro INSTANCE = new UploadFicheiro();
private UploadFicheiro ()
{
}
public static UploadFicheiro getInstance ()
{
return INSTANCE;
}
/**
* Realiza o carregamento de um ficheiro submetido, e guarda num diretório
* indicado
*
* @param part Objecto que contém o ficheiro submetido
* @param dirDestino Diretório destino para guardar o ficheiro
* @param novoNome Novo nome com que será gravado o ficheiro
* @return
* @throws IOException
*/
public String gravar (Part part, String dirDestino, String novoNome) throws IOException
{
String fileName = part.getSubmittedFileName();
File fileSalvarDir = new File(dirDestino);
//O diretório destino é criado caso ainda não exista
if (!fileSalvarDir.exists())
{
fileSalvarDir.mkdir();
}
InputStream input = part.getInputStream();
if (novoNome != null && ! novoNome.trim().isEmpty())
{
//Pegando o índice do ultimo ponto na String fileName
//depois do ponto está a extensão (Ex: .png ou .jpg)
int index = fileName.lastIndexOf(".");
fileName = (novoNome + "_" + gerarDataHoraActual() + fileName.substring(index)).trim();
}
Files.copy(input, new File(fileSalvarDir, fileName).toPath(), StandardCopyOption.REPLACE_EXISTING);
return fileName;
}
/**
* Apaga um ficheiro
*
* @param file Ficheiro que se pretenda apagar
* @return
*/
public boolean apagarFicheiro (File file)
{
return file.isFile() && file.delete();
}
/**
* Retorna a data e hora actual em String
* @return
*/
public static String gerarDataHoraActual ()
{
Date d = Calendar.getInstance().getTime();
String dataString = new SimpleDateFormat("yyyy_MM_dd-HH_mm_ss_SSS").format(d);
return dataString;
}
}
| [
"amed@AMED-PC"
] | amed@AMED-PC |
e7229459ef33af5e3a3d0752d4b931c5da043125 | 22facd037e1138b85b9f40b0781af6745cbb48d6 | /src/main/java/com/insightfullogic/honest_profiler/ports/javafx/profile/TreeViewCell.java | 3c2169f08a3d12062738aedc5f84ab8acbf633a7 | [
"Apache-2.0",
"MIT"
] | permissive | slaveuser/honest-profiler20160430 | 2868ca218620afe3677ba4ef5774d4f0a1213ef3 | df8f4565d4c695a3909f9bc33a13b166ef47b0cc | refs/heads/master | 2020-05-17T00:14:03.551988 | 2019-04-25T08:32:31 | 2019-04-25T08:32:31 | 183,391,374 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,826 | java | /**
* Copyright (c) 2014 Richard Warburton (richard.warburton@gmail.com)
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
**/
package com.insightfullogic.honest_profiler.ports.javafx.profile;
import com.insightfullogic.honest_profiler.core.profiles.ProfileNode;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.TreeCell;
import javafx.scene.control.TreeItem;
import javafx.scene.paint.Color;
import static com.insightfullogic.honest_profiler.ports.javafx.Rendering.renderMethod;
import static com.insightfullogic.honest_profiler.ports.javafx.Rendering.renderTimeShare;
import static com.insightfullogic.honest_profiler.ports.javafx.profile.TreeViewModel.MethodNodeAdapter;
import static com.insightfullogic.honest_profiler.ports.javafx.profile.TreeViewModel.ThreadNodeAdapter;
import static javafx.scene.paint.Color.RED;
import static javafx.scene.paint.Color.WHEAT;
public class TreeViewCell extends TreeCell<ProfileNode>
{
private static final int IMAGE_WIDTH = 50;
private static final int IMAGE_HEIGHT = 15;
private static final int TEXT_HORIZONTAL_INSET = 10;
private static final int TEXT_VERTICAL_INSET = 12;
/**
* Not threadsafe: must be run on JavaFx thread.
*/
@Override
protected void updateItem(ProfileNode profileNode, boolean empty)
{
super.updateItem(profileNode, empty);
TreeItem<ProfileNode> treeItem = getTreeItem();
if (treeItem instanceof ThreadNodeAdapter)
{
ThreadNodeAdapter adapter = (ThreadNodeAdapter) treeItem;
setText("Thread " + adapter.getThreadId());
setGraphic(null);
}
else if (treeItem instanceof MethodNodeAdapter)
{
renderMethodNode(profileNode, empty);
}
}
private void renderMethodNode(ProfileNode profileNode, boolean empty)
{
if (!empty && isVisible())
{
setText(renderMethod(profileNode.getFrameInfo()));
Canvas canvas = new Canvas(IMAGE_WIDTH, IMAGE_HEIGHT);
GraphicsContext context = canvas.getGraphicsContext2D();
context.setFill(Color.BLACK);
context.strokeRect(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT);
double timeShare = profileNode.getTotalTimeShare();
double scaledShare = timeShare * IMAGE_WIDTH;
double xStart = IMAGE_WIDTH - scaledShare;
context.setFill(Color.GREEN);
context.fillRect(xStart, 0, scaledShare, IMAGE_HEIGHT);
Color color = timeShare > 0.5 ? WHEAT : RED;
context.setFill(color);
context.fillText(renderTimeShare(timeShare), TEXT_HORIZONTAL_INSET, TEXT_VERTICAL_INSET);
setGraphic(canvas);
}
}
}
| [
"gmcpo@LAPTOP-2AD376QK"
] | gmcpo@LAPTOP-2AD376QK |
5a683e6fbeded3a131e311f30fedc7f6fe4931ee | cd6d88376a672159edd9adcff6db60125a2820ce | /src/main/java/org/motechproject/newebodac/exception/BaseFormattedException.java | b89402d45a6adf4da12a5fba11acc853b4319ea1 | [
"Apache-2.0"
] | permissive | motech-implementations/new-ebodac | f735826f0f1ab976d0f67c6d651b9886da4e8e2b | bba8478a4c3703e7272d52cd286191ecaf5caf0e | refs/heads/dev | 2023-01-12T03:15:36.049978 | 2020-05-31T18:20:27 | 2020-05-31T18:20:27 | 194,908,955 | 1 | 0 | Apache-2.0 | 2023-01-04T04:29:57 | 2019-07-02T17:41:46 | Java | UTF-8 | Java | false | false | 677 | java | package org.motechproject.newebodac.exception;
import java.text.MessageFormat;
public abstract class BaseFormattedException extends NewEbodacException {
private static final long serialVersionUID = 1L;
public BaseFormattedException(String message) {
super(message);
}
public BaseFormattedException(Throwable cause, String message) {
super(message, cause);
}
public BaseFormattedException(String format, final Object... parameters) {
super(MessageFormat.format(format, parameters));
}
public BaseFormattedException(Throwable cause, String format, final Object... parameters) {
super(MessageFormat.format(format, parameters), cause);
}
}
| [
"pmuchowski@soldevelo.com"
] | pmuchowski@soldevelo.com |
dade90375f80f2ed89c0fb3ffed1307c903fd219 | 63d319fbd88e49701d8dcc2919c8f3a6013e90d0 | /Applications/ModelSoC/plugins/org.oasisopen.names.tc.opendocument/src/org/oasisopen/names/tc/opendocument/xmlns/drawing/FillType.java | 1f83b0ba265ea0bf6f8fff8f418d6112e13f30db | [] | no_license | DevBoost/Reuseware | 2e6b3626c0d434bb435fcf688e3a3c570714d980 | 4c2f0170df52f110c77ee8cffd2705af69b66506 | refs/heads/master | 2021-01-19T21:28:13.184309 | 2019-06-09T20:39:41 | 2019-06-09T20:48:34 | 5,324,741 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,425 | java | /*******************************************************************************
* Copyright (c) 2006-2012
* Software Technology Group, Dresden University of Technology
* DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Software Technology Group - TU Dresden, Germany;
* DevBoost GmbH - Berlin, Germany
* - initial API and implementation
******************************************************************************/
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.oasisopen.names.tc.opendocument.xmlns.drawing;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.eclipse.emf.common.util.Enumerator;
/**
* <!-- begin-user-doc -->
* A representation of the literals of the enumeration '<em><b>Fill Type</b></em>',
* and utility methods for working with them.
* <!-- end-user-doc -->
* @see org.oasisopen.names.tc.opendocument.xmlns.drawing.DrawingPackage#getFillType()
* @model extendedMetaData="name='fill_._type'"
* @generated
*/
public enum FillType implements Enumerator {
/**
* The '<em><b>None</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #NONE_VALUE
* @generated
* @ordered
*/
NONE(0, "none", "none"),
/**
* The '<em><b>Solid</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #SOLID_VALUE
* @generated
* @ordered
*/
SOLID(1, "solid", "solid"),
/**
* The '<em><b>Bitmap</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #BITMAP_VALUE
* @generated
* @ordered
*/
BITMAP(2, "bitmap", "bitmap"),
/**
* The '<em><b>Gradient</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #GRADIENT_VALUE
* @generated
* @ordered
*/
GRADIENT(3, "gradient", "gradient"),
/**
* The '<em><b>Hatch</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #HATCH_VALUE
* @generated
* @ordered
*/
HATCH(4, "hatch", "hatch");
/**
* The '<em><b>None</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>None</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #NONE
* @model name="none"
* @generated
* @ordered
*/
public static final int NONE_VALUE = 0;
/**
* The '<em><b>Solid</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Solid</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #SOLID
* @model name="solid"
* @generated
* @ordered
*/
public static final int SOLID_VALUE = 1;
/**
* The '<em><b>Bitmap</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Bitmap</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #BITMAP
* @model name="bitmap"
* @generated
* @ordered
*/
public static final int BITMAP_VALUE = 2;
/**
* The '<em><b>Gradient</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Gradient</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #GRADIENT
* @model name="gradient"
* @generated
* @ordered
*/
public static final int GRADIENT_VALUE = 3;
/**
* The '<em><b>Hatch</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Hatch</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #HATCH
* @model name="hatch"
* @generated
* @ordered
*/
public static final int HATCH_VALUE = 4;
/**
* An array of all the '<em><b>Fill Type</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static final FillType[] VALUES_ARRAY =
new FillType[] {
NONE,
SOLID,
BITMAP,
GRADIENT,
HATCH,
};
/**
* A public read-only list of all the '<em><b>Fill Type</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final List<FillType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the '<em><b>Fill Type</b></em>' literal with the specified literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static FillType get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
FillType result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Fill Type</b></em>' literal with the specified name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static FillType getByName(String name) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
FillType result = VALUES_ARRAY[i];
if (result.getName().equals(name)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Fill Type</b></em>' literal with the specified integer value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static FillType get(int value) {
switch (value) {
case NONE_VALUE: return NONE;
case SOLID_VALUE: return SOLID;
case BITMAP_VALUE: return BITMAP;
case GRADIENT_VALUE: return GRADIENT;
case HATCH_VALUE: return HATCH;
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final int value;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final String name;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private final String literal;
/**
* Only this class can construct instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private FillType(int value, String name, String literal) {
this.value = value;
this.name = name;
this.literal = literal;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getLiteral() {
return literal;
}
/**
* Returns the literal value of the enumerator, which is its string representation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
return literal;
}
} //FillType
| [
"jendrik.johannes@devboost.de"
] | jendrik.johannes@devboost.de |
86ea152dba4e944bc357033157f7e71c4a1f081a | f1ab67476d54ca5ade49d21f2019f32fd6b6c90d | /wanma/src/main/java/com/bluemobi/product/utils/JsonPublishXmlReader.java | 7edd2fb83f236c1aafe95c379ff6332a167f1d8a | [] | no_license | wang-shun/eichong.web | 4578f63ed717cba921872a0767814a6b808d1b64 | 08dbcabb8c1868a0ea755a2d7faecefc51c3c144 | refs/heads/master | 2020-04-02T12:19:22.702237 | 2018-04-02T06:14:01 | 2018-04-02T06:14:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,144 | java | /**
* FileName:AuthorizedXmlReader.java
* Author: Administrator
* Create: 2014年7月8日
* Last Modified: 2014年7月8日
* Version: V1.0
*/
package com.bluemobi.product.utils;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.druid.util.StringUtils;
import com.bluemobi.product.common.CommonConsts;
import com.bluemobi.product.model.common.XMLModel;
/**
*
* @version V1.0
* @author Administrator
* @date 2014年7月8日
*/
public class JsonPublishXmlReader {
/** 发送标识 */
public static String publish_FLG_YES = "1";
/** XML标签:类名 */
public static String XML_TAGERT_CLASS_NAME = "class-name";
/** XML标签:是否有limit处理 */
private static List<String> publishList = null;
private static boolean childMatch = false;
public static void main(String[] args) {
List<String> pubList = JsonPublishXmlReader
.getPublishList("com.bluemobi.product.model.AppApiModel");
for (String sss : pubList) {
System.out.println(sss);
}
}
public static List<String> getPublishList(String clasName) {
if (StringUtil.isEmpty(clasName)) {
return null;
}
childMatch = false;
publishList = null;
// 通过设置文件取得权限设置信息
XMLModel xmlModel = XmlUtil
.parseNoAwareXML(CommonConsts.JSON_PUBLISH_SETTING_XML);
if (ObjectUtil.isEmpty(xmlModel) || !xmlModel.getHasChildFlg()) {
return null;
}
getAuthSqlSetByKey(clasName, xmlModel);
// 权限设置信息
return publishList;
}
private static void getAuthSqlSetByKey(String className, XMLModel xmlModel) {
if (ObjectUtil.isEmpty(xmlModel) || !xmlModel.getHasChildFlg()
|| (publishList != null && publishList.size() > 0)) {
return;
}
List<XMLModel> childModelList = xmlModel.getChildList();
String xmlValue = "";
if (childMatch) {
return;
}
publishList = new ArrayList<String>();
for (XMLModel childModel : childModelList) {
if (childModel.getHasChildFlg()) {
if (!childMatch) {
getAuthSqlSetByKey(className, childModel);
}
} else {
String xmlTarget = childModel.getKey();
xmlValue = childModel.getValue();
if (XML_TAGERT_CLASS_NAME.equalsIgnoreCase(xmlTarget)
&& StringUtils.equalsIgnoreCase(className, xmlValue)) {
childMatch = true;
}
if (publish_FLG_YES.equalsIgnoreCase(xmlValue)) {
if (publishList == null) {
publishList = new ArrayList<String>();
}
publishList.add(xmlTarget);
}
}
}
if (!childMatch) {
publishList = null;
}
}
public static String getValueFromList(List<XMLModel> modelList, String key) {
String tagertValue = "";
for (XMLModel xmlModel : modelList) {
String tagertKey = xmlModel.getKey();
if (StringUtils.equals(key, tagertKey)) {
tagertValue = xmlModel.getValue();
break;
}
}
return tagertValue;
}
/**
* @return the publishList
*/
public static List<String> getPublishList() {
return publishList;
}
/**
* @param publishList
* the publishList to set
*/
public static void setPublishList(List<String> publishList) {
JsonPublishXmlReader.publishList = publishList;
}
}
| [
"wwzero@hotmail.com"
] | wwzero@hotmail.com |
06c036d1ed5b71f3a65ff6d8247dbea1cb6fd967 | 8e67fdab6f3a030f38fa127a79050b8667259d01 | /JavaStudyHalUk/src/MENTORING/oop/inheritance_2/books/Book.java | 5e0ba5ccee8757c71e46c82ec0ee5807f871cae2 | [] | no_license | mosmant/JavaStudyHalUk | 07e38ade6c7a31d923519a267a63318263c5910f | a41e16cb91ef307b50cfc497535126aa1e4035e5 | refs/heads/master | 2023-07-27T13:31:11.004490 | 2021-09-12T14:59:25 | 2021-09-12T14:59:25 | 405,671,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 529 | java | package MENTORING.oop.inheritance_2.books;
public class Book {
public int page;
public String author;
public String language;
public Book(int page, String author, String language) {
this.page = page;
this.author = author;
this.language = language;
}
@Override
public String toString() {
return "Book{" +
"page=" + page +
", author='" + author + '\'' +
", language='" + language + '\'' +
'}';
}
}
| [
"mottnr@gmail.com"
] | mottnr@gmail.com |
436efa02f767a2dcde62d0520423d7a545787776 | e3a37aaf17ec41ddc7051f04b36672db62a7863d | /common-service/device-service-project/device-service-interface/src/main/java/com/iot/device/vo/rsp/DeviceParamResp.java | 5cd03384c645149b8e2b4399a8fdaa3457de5b36 | [] | no_license | github4n/cloud | 68477a7ecf81d1526b1b08876ca12cfe575f7788 | 7974042dca1ee25b433177e2fe6bda1de28d909a | refs/heads/master | 2020-04-18T02:04:33.509889 | 2019-01-13T02:19:32 | 2019-01-13T02:19:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 615 | java | package com.iot.device.vo.rsp;
import java.io.Serializable;
import java.util.List;
/**
* @Author: xfz
* @Descrpiton:
* @Date: 9:02 2018/5/11
* @Modify by:
*/
public class DeviceParamResp implements Serializable {
private List<DeviceResp> deviceResps;
private int count = 0;
public List<DeviceResp> getDeviceResps() {
return deviceResps;
}
public void setDeviceResps(List<DeviceResp> deviceResps) {
this.deviceResps = deviceResps;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
}
| [
"qizhiyong@LDS-Z-C5497.LEEDARSON.LOCAL"
] | qizhiyong@LDS-Z-C5497.LEEDARSON.LOCAL |
1630651767bd83644cf1d70019ae125cc9b7fa4b | 8818d6a1111866a7e4ea525abdd881916c389ade | /src/main/java/com/blastedstudios/scab/physics/ContactListener.java | c40b53ebde4e5846ac1c2e96775363380ec8e1eb | [] | no_license | narfman0/scab | 5994ce446fce31d023781f74b406aaf60f4d22b2 | 8210cf6f6321f475fc46d957947e16d1af0496ee | refs/heads/master | 2021-01-10T07:00:28.536296 | 2016-08-20T05:49:10 | 2016-08-20T05:49:10 | 51,808,220 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,940 | java | package com.blastedstudios.scab.physics;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.Contact;
import com.badlogic.gdx.physics.box2d.ContactImpulse;
import com.badlogic.gdx.physics.box2d.Fixture;
import com.badlogic.gdx.physics.box2d.Manifold;
import com.blastedstudios.gdxworld.util.Properties;
import com.blastedstudios.scab.world.WorldManager;
import com.blastedstudios.scab.world.being.Being;
import com.blastedstudios.scab.world.weapon.Melee;
import com.blastedstudios.scab.world.weapon.shot.GunShot;
public class ContactListener implements com.badlogic.gdx.physics.box2d.ContactListener {
private final WorldManager worldManager;
public ContactListener(WorldManager worldManager){
this.worldManager = worldManager;
}
@Override public void preSolve(Contact contact, Manifold arg1) {
GunShot gunshot = (GunShot) (contact.getFixtureA().getBody().getUserData() instanceof GunShot ? contact.getFixtureA().getBody().getUserData() :
contact.getFixtureB().getBody().getUserData() instanceof GunShot ? contact.getFixtureB().getBody().getUserData() : null);
Fixture hit = contact.getFixtureA().getBody().getUserData() instanceof Being ? contact.getFixtureA() :
contact.getFixtureB().getBody().getUserData() instanceof Being ? contact.getFixtureB() : null;
if(gunshot != null && !gunshot.collideWithOrigin() && gunshot.getBeing().isOwned(hit))
contact.setEnabled(false);
}
@Override public void beginContact(Contact contact) {
Body aBody = contact.getFixtureA().getBody(), bBody = contact.getFixtureB().getBody();
Body gunshotBody = aBody.getUserData() instanceof GunShot ? aBody : bBody.getUserData() instanceof GunShot ? bBody : null;
Fixture hit = aBody.getUserData() instanceof Being ? contact.getFixtureA() : bBody.getUserData() instanceof Being ? contact.getFixtureB() : null;
Body meleeBody = aBody.getUserData() instanceof Melee ? aBody : bBody.getUserData() instanceof Melee ? bBody : null;
if(aBody.getUserData() == WorldManager.REMOVE_USER_DATA || bBody.getUserData() == WorldManager.REMOVE_USER_DATA)
return;
if(gunshotBody != null){//handle projectile contact
GunShot gunshot = (GunShot) gunshotBody.getUserData();
if(gunshot.collideWithOrigin() || !gunshot.getBeing().isOwned(hit)){//skip if self
if(hit != null){//handle getting shot
Being target = (Being) hit.getBody().getUserData();
worldManager.processHit(gunshot.getGun().getDamage(), target, gunshot.getBeing(),
hit, contact.getWorldManifold().getNormal(), contact.getWorldManifold().getPoints()[0]);
}
gunshot.beginContact(gunshotBody, hit, worldManager, contact.getWorldManifold());
}
}else if(meleeBody != null && hit != null){//handle melee attack
Being target = (Being) hit.getBody().getUserData();
Melee melee = (Melee) meleeBody.getUserData();
melee.beginContact(worldManager, target, hit, contact, calculateMomentumImpulse(contact));
}else if(hit != null){//handle physics object collision dmg
Being target = (Being) hit.getBody().getUserData();
float i = calculateMomentumImpulse(contact);
if(i > Properties.getFloat("contact.impulse.threshold", 13f))
worldManager.processHit(impulseToDamage(i), target, null, hit,
contact.getWorldManifold().getNormal(),
contact.getWorldManifold().getPoints()[0]);
}
}
public static float impulseToDamage(float impulse){
return Math.max(0f, impulse - Properties.getFloat("contact.impulse.threshold"));
}
private static float calculateMomentumImpulse(Contact contact){
Vector2 velocity = contact.getFixtureA().getBody().getLinearVelocity().sub(
contact.getFixtureB().getBody().getLinearVelocity());
return velocity.scl(contact.getWorldManifold().getNormal()).len() ;
}
@Override public void postSolve(Contact contact, ContactImpulse oldManifold) {}
@Override public void endContact(Contact contact) {}
}
| [
"narfman0@gmail.com"
] | narfman0@gmail.com |
3d3848753008de4d71a83c75b2dbc44aa01cadd1 | a33aac97878b2cb15677be26e308cbc46e2862d2 | /data/libgdx/VoxelChunk_set.java | 6c1661f9803d35c8b17dfdfc4766293f1ad54afd | [] | no_license | GabeOchieng/ggnn.tensorflow | f5d7d0bca52258336fc12c9de6ae38223f28f786 | 7c62c0e8427bea6c8bec2cebf157b6f1ea70a213 | refs/heads/master | 2022-05-30T11:17:42.278048 | 2020-05-02T11:33:31 | 2020-05-02T11:33:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 218 | java | public void set(int x, int y, int z, byte voxel) {
if (x < 0 || x >= width)
return;
if (y < 0 || y >= height)
return;
if (z < 0 || z >= depth)
return;
setFast(x, y, z, voxel);
}
| [
"bdqnghi@gmail.com"
] | bdqnghi@gmail.com |
151b599ea871a0f593bbc5557137cadb715f2400 | 1ba27fc930ba20782e9ef703e0dc7b69391e191b | /Src/prjCheckstyle/src2/com/compuware/caqs/pmd/rules/strings/AvoidDuplicateLiteralsRule.java | 131f915f2ef8db6a652ba3bd611a1fe25d59045a | [] | no_license | LO-RAN/codeQualityPortal | b0d81c76968bdcfce659959d0122e398c647b09f | a7c26209a616d74910f88ce0d60a6dc148dda272 | refs/heads/master | 2023-07-11T18:39:04.819034 | 2022-03-31T15:37:56 | 2022-03-31T15:37:56 | 37,261,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,111 | java | /**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package com.compuware.caqs.pmd.rules.strings;
import com.compuware.caqs.pmd.AbstractRule;
import com.compuware.caqs.pmd.ast.ASTCompilationUnit;
import com.compuware.caqs.pmd.ast.ASTLiteral;
import com.compuware.caqs.pmd.ast.SimpleNode;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.LineNumberReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class AvoidDuplicateLiteralsRule extends AbstractRule {
public static class ExceptionParser {
private static final char ESCAPE_CHAR = '\\';
private char delimiter;
public ExceptionParser(char delimiter) {
this.delimiter = delimiter;
}
public Set parse(String in) {
Set result = new HashSet();
StringBuffer currentToken = new StringBuffer();
boolean inEscapeMode = false;
for (int i = 0; i < in.length(); i++) {
if (inEscapeMode) {
inEscapeMode = false;
currentToken.append(in.charAt(i));
continue;
}
if (in.charAt(i) == ESCAPE_CHAR) {
inEscapeMode = true;
continue;
}
if (in.charAt(i) == delimiter) {
result.add(currentToken.toString());
currentToken = new StringBuffer();
} else {
currentToken.append(in.charAt(i));
}
}
if (currentToken.length() > 0) {
result.add(currentToken.toString());
}
return result;
}
}
private static final char DEFAULT_SEPARATOR = ',';
private static final String EXCEPTION_LIST_PROPERTY = "exceptionlist";
private static final String SEPARATOR_PROPERTY = "separator";
private static final String EXCEPTION_FILE_NAME_PROPERTY = "exceptionfile";
private Map literals = new HashMap();
private Set exceptions = new HashSet();
public Object visit(ASTCompilationUnit node, Object data) {
literals.clear();
if (hasProperty(EXCEPTION_LIST_PROPERTY)) {
ExceptionParser p;
if (hasProperty(SEPARATOR_PROPERTY)) {
p = new ExceptionParser(getStringProperty(SEPARATOR_PROPERTY).charAt(0));
} else {
p = new ExceptionParser(DEFAULT_SEPARATOR);
}
exceptions = p.parse(getStringProperty(EXCEPTION_LIST_PROPERTY));
} else if (hasProperty(EXCEPTION_FILE_NAME_PROPERTY)) {
exceptions = new HashSet();
LineNumberReader reader = null;
try {
reader = new LineNumberReader(new BufferedReader(new FileReader(new File(getStringProperty(EXCEPTION_FILE_NAME_PROPERTY)))));
String line;
while ((line = reader.readLine()) != null) {
exceptions.add(line);
}
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
try {
if (reader != null)
reader.close();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}
super.visit(node, data);
int threshold = getIntProperty("threshold");
for (Iterator i = literals.keySet().iterator(); i.hasNext();) {
String key = (String) i.next();
List occurrences = (List) literals.get(key);
if (occurrences.size() >= threshold) {
Object[] args = new Object[]{key, new Integer(occurrences.size()), new Integer(((SimpleNode) occurrences.get(0)).getBeginLine())};
addViolation(data, (SimpleNode) occurrences.get(0), args);
}
}
return data;
}
public Object visit(ASTLiteral node, Object data) {
// just catching strings of 5 chars or more (including the enclosing quotes) for now - no numbers
if (node.getImage() == null || node.getImage().indexOf('\"') == -1 || node.getImage().length() < 5) {
return data;
}
// skip any exceptions
if (exceptions.contains(node.getImage().substring(1, node.getImage().length() - 1))) {
return data;
}
if (literals.containsKey(node.getImage())) {
List occurrences = (List) literals.get(node.getImage());
occurrences.add(node);
} else {
List occurrences = new ArrayList();
occurrences.add(node);
literals.put(node.getImage(), occurrences);
}
return data;
}
}
| [
"laurent.izac@gmail.com"
] | laurent.izac@gmail.com |
4d666d06cfd79c5b39c415ebf63315c3f849ef32 | 18606c6b3f164a935e571932b3356260b493e543 | /benchmarks/xalan/src/org/apache/xalan/xsltc/compiler/util/MatchGenerator.java | ec30dcda8f3322bba1457a153cf16eb82d6a7b06 | [
"Apache-2.0",
"BSD-2-Clause",
"Apache-1.1"
] | permissive | jackyhaoli/abc | d9a3bd2d4140dd92b9f9d0814eeafa16ea7163c4 | 42071b0dcb91db28d7b7fdcffd062f567a5a1e6c | refs/heads/master | 2020-04-03T09:34:47.612136 | 2019-01-11T07:16:04 | 2019-01-11T07:16:04 | 155,169,244 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,806 | java | /*
* @(#)$Id: MatchGenerator.java,v 1.2 2002/02/01 20:27:46 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 APACHE SOFTWARE FOUNDATION OR
* ITS 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 2001, Sun
* Microsystems., http://www.sun.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
*
*/
package org.apache.xalan.xsltc.compiler.util;
import org.apache.bcel.generic.Type;
import org.apache.bcel.generic.*;
import org.apache.xalan.xsltc.compiler.Template;
public final class MatchGenerator extends MethodGenerator {
private static int CURRENT_INDEX = 1;
private int _iteratorIndex = INVALID_INDEX;
private final Instruction _iloadCurrent;
private final Instruction _istoreCurrent;
private Instruction _aloadDom;
public MatchGenerator(int access_flags, Type return_type,
Type[] arg_types, String[] arg_names,
String method_name, String class_name,
InstructionList il, ConstantPoolGen cp) {
super(access_flags, return_type, arg_types, arg_names, method_name,
class_name, il, cp);
_iloadCurrent = new ILOAD(CURRENT_INDEX);
_istoreCurrent = new ISTORE(CURRENT_INDEX);
}
public Instruction loadCurrentNode() {
return _iloadCurrent;
}
public Instruction storeCurrentNode() {
return _istoreCurrent;
}
public int getHandlerIndex() {
return INVALID_INDEX; // not available
}
/**
* Get index of the register where the DOM is stored.
*/
public Instruction loadDOM() {
return _aloadDom;
}
/**
* Set index where the reference to the DOM is stored.
*/
public void setDomIndex(int domIndex) {
_aloadDom = new ALOAD(domIndex);
}
/**
* Get index of the register where the current iterator is stored.
*/
public int getIteratorIndex() {
return _iteratorIndex;
}
/**
* Set index of the register where the current iterator is stored.
*/
public void setIteratorIndex(int iteratorIndex) {
_iteratorIndex = iteratorIndex;
}
public int getLocalIndex(String name) {
if (name.equals("current")) {
return CURRENT_INDEX;
}
return super.getLocalIndex(name);
}
}
| [
"xiemaisi@40514614-586c-40e6-bf05-bf7e477dc3e6"
] | xiemaisi@40514614-586c-40e6-bf05-bf7e477dc3e6 |
e588a97c9af9dfbab09e5937fb2850d21f0b66ea | 2fd1b33dd3110777e9b41ee1371daf12a749a9ee | /Chap5/PE_5_21_FinanceComprehensive.java | 99113f5cf184e9a03deaa3b686491455c0700673 | [] | no_license | HULLZHU/eclipse-workspace | 04c474c3cdfdfc79567342974ef04c037e684fae | 3989116abd9a994336e649af11650761693e92c3 | refs/heads/master | 2021-06-09T18:34:17.479825 | 2019-11-05T20:39:05 | 2019-11-05T20:39:05 | 145,763,364 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,418 | java | import java.util.*;
public class PE_5_21_FinanceComprehensive {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Please input loan amount and number of years");
int loanAmount = input.nextInt();
double timePeriod = input.nextDouble();
double InterestRate=0.05;
double InterestRateInPercentage = InterestRate * 100;//**
double monthlyInterestRate= InterestRate / 12;
double monthlyPayment = (loanAmount*monthlyInterestRate)/(1-1/(Math.pow(1+monthlyInterestRate, timePeriod*12)));
double totalPayment = 12 * timePeriod * monthlyPayment;
System.out.println(" Loan Amount :" + loanAmount);
System.out.println(" Number of Years: " + (int)timePeriod );
System.out.println(" Interest Rate Monthly Payment Total Payment");
while (InterestRate<= 0.08)
{
System.out.printf(" %.3f", InterestRateInPercentage);
System.out.print("%");
System.out.printf(" %.2f %.2f", monthlyPayment, totalPayment);
System.out.println("");
InterestRate =InterestRate+(0.125/100);
monthlyInterestRate= InterestRate / 12;
monthlyPayment = (loanAmount*monthlyInterestRate)/(1-1/(Math.pow(1+monthlyInterestRate, timePeriod*12)));
InterestRateInPercentage = InterestRate * 100;
totalPayment = 12 * timePeriod * monthlyPayment;
}
// TODO Auto-generated method stub
}
}
| [
"42597991+HULLZHU@users.noreply.github.com"
] | 42597991+HULLZHU@users.noreply.github.com |
8929623842531ec0c53332339c620f315553d7b6 | 2eab4dd42cb7cd1f52426f39864f8a6e168b5539 | /coffee.model/src/main/java/com/lrgoncalves/coffee/model/neo4j/Neo4jSessionFactory.java | 5785c7e7c35f3c3b9779fc6f1ea9e67e1107ef02 | [] | no_license | leandr0/coffee | 5e552a4a6dbbd21faeac4ffcbf347b0c9ec67861 | b276c5d7ae0ed3762f58e35e23e18f5a3d933a9b | refs/heads/master | 2020-04-03T00:41:10.193412 | 2018-11-15T21:15:39 | 2018-11-15T21:15:39 | 154,905,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 937 | java | package com.lrgoncalves.coffee.model.neo4j;
import org.neo4j.ogm.config.Configuration;
import org.neo4j.ogm.session.Session;
import org.neo4j.ogm.session.SessionFactory;
public class Neo4jSessionFactory {
private static Configuration configuration = null;
private static SessionFactory sessionFactory = null;
private static Neo4jSessionFactory factory = null;
private Neo4jSessionFactory() {
}
public static Neo4jSessionFactory getInstance() {
if(configuration == null) {
configuration = new Configuration.Builder()
.uri("bolt://localhost:7687")
.credentials("neo4j", "!1eduarda")
.build();
}
if(sessionFactory == null) {
sessionFactory= new SessionFactory(configuration,"com.lrgoncalves.coffee.model");
}
if(factory == null) {
factory = new Neo4jSessionFactory();
}
return factory;
}
public Session getNeo4jSession() {
return sessionFactory.openSession();
}
}
| [
"root@localhost.localdomain"
] | root@localhost.localdomain |
949d57ac4bbba34f7254ed7826e4174973df8bff | 0721305fd9b1c643a7687b6382dccc56a82a2dad | /src/app.zenly.locator_4.8.0_base_source_from_JADX/sources/app/zenly/locator/friendshipfacts/p100m/C3816f.java | d9d738fad7039e2c7d0c5d69f5aae32cf7ee7ab0 | [] | no_license | a2en/Zenly_re | 09c635ad886c8285f70a8292ae4f74167a4ad620 | f87af0c2dd0bc14fd772c69d5bc70cd8aa727516 | refs/heads/master | 2020-12-13T17:07:11.442473 | 2020-01-17T04:32:44 | 2020-01-17T04:32:44 | 234,470,083 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,414 | java | package app.zenly.locator.friendshipfacts.p100m;
import app.zenly.locator.friendshipfacts.C3781e;
import app.zenly.locator.friendshipfacts.p099l.C3806a;
import com.snap.p327ui.recycling.p328d.C11722a;
import java.util.concurrent.TimeUnit;
import kotlin.Lazy;
import kotlin.TypeCastException;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.C12932j;
import kotlin.jvm.internal.C12933k;
import kotlin.jvm.internal.C12940r;
import kotlin.jvm.internal.C12941s;
import kotlin.jvm.internal.C12946x;
import kotlin.reflect.KProperty;
/* renamed from: app.zenly.locator.friendshipfacts.m.f */
public final class C3816f extends C11722a {
/* renamed from: k */
static final /* synthetic */ KProperty[] f10160k;
/* renamed from: f */
private final long f10161f;
/* renamed from: g */
private final Lazy f10162g;
/* renamed from: h */
private final C3806a f10163h;
/* renamed from: i */
private final boolean f10164i;
/* renamed from: j */
private final int f10165j;
/* renamed from: app.zenly.locator.friendshipfacts.m.f$a */
static final class C3817a extends C12933k implements Function0<Long> {
/* renamed from: f */
final /* synthetic */ C3816f f10166f;
C3817a(C3816f fVar) {
this.f10166f = fVar;
super(0);
}
public final long invoke() {
return this.f10166f.mo10403i() + TimeUnit.HOURS.toMillis(this.f10166f.mo10400f().mo10378a());
}
}
static {
C12941s sVar = new C12941s(C12946x.m33834a(C3816f.class), "ongoingTimeSpentMillis", "getOngoingTimeSpentMillis()J");
C12946x.m33839a((C12940r) sVar);
f10160k = new KProperty[]{sVar};
}
public C3816f(long j, C3806a aVar, boolean z, int i) {
C12932j.m33818b(aVar, "bestFriend");
super(C3781e.TST_USER, j);
this.f10163h = aVar;
this.f10164i = z;
this.f10165j = i;
this.f10161f = this.f10164i ? this.f10163h.mo10381d() : this.f10163h.mo10380c();
this.f10162g = C12896f.m33751a(new C3817a(this));
}
/* renamed from: a */
public boolean mo7088a(C11722a aVar) {
if (aVar != null) {
C3816f fVar = (C3816f) aVar;
return C12932j.m33817a((Object) fVar.f10163h.mo10382e().getUuid(), (Object) this.f10163h.mo10382e().getUuid()) && fVar.f10163h.mo10382e().getAvatarVersion() == this.f10163h.mo10382e().getAvatarVersion() && C12932j.m33817a((Object) fVar.f10163h.mo10382e().getName(), (Object) this.f10163h.mo10382e().getName()) && fVar.mo10401g() == fVar.mo10401g() && fVar.f10165j == this.f10165j && fVar.f10164i == this.f10164i;
}
throw new TypeCastException("null cannot be cast to non-null type app.zenly.locator.friendshipfacts.viewmodels.TstUserViewModel");
}
/* renamed from: f */
public final C3806a mo10400f() {
return this.f10163h;
}
/* renamed from: g */
public final long mo10401g() {
Lazy lazy = this.f10162g;
KProperty kProperty = f10160k[0];
return ((Number) lazy.getValue()).longValue();
}
/* renamed from: h */
public final int mo10402h() {
return this.f10165j;
}
/* renamed from: i */
public final long mo10403i() {
return this.f10161f;
}
/* renamed from: j */
public final boolean mo10404j() {
return this.f10164i;
}
}
| [
"developer@appzoc.com"
] | developer@appzoc.com |
a386f18bd6ccc1eeec3f3b78173318c483f905d4 | 392b183ece3b41beaec08ab88dcafd504e8cf4e9 | /org/apache/commons/io/filefilter/NameFileFilter.java | 0a80e88fdddb1c96cacb45b426aa77a1c4e23c50 | [
"MIT"
] | permissive | 3000IQPlay/RailHack-0.5.9-Src | 552decf5749ee744b565494415f89af948257a98 | 9c1396d095a72f7a414f24cfb1720fc294a9f24a | refs/heads/main | 2023-06-27T16:58:42.177134 | 2021-08-04T15:53:07 | 2021-08-04T15:53:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,008 | java | package org.apache.commons.io.filefilter;
import java.io.File;
import java.io.Serializable;
import java.util.List;
import org.apache.commons.io.IOCase;
public class NameFileFilter extends AbstractFileFilter implements Serializable {
private static final long serialVersionUID = 176844364689077340L;
private final String[] names;
private final IOCase caseSensitivity;
public NameFileFilter(String name) {
this(name, (IOCase) null);
}
public NameFileFilter(String name, IOCase caseSensitivity) {
if (name == null) {
throw new IllegalArgumentException("The wildcard must not be null");
} else {
this.names = new String[] { name};
this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
}
}
public NameFileFilter(String[] names) {
this(names, (IOCase) null);
}
public NameFileFilter(String[] names, IOCase caseSensitivity) {
if (names == null) {
throw new IllegalArgumentException("The array of names must not be null");
} else {
this.names = new String[names.length];
System.arraycopy(names, 0, this.names, 0, names.length);
this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
}
}
public NameFileFilter(List names) {
this(names, (IOCase) null);
}
public NameFileFilter(List names, IOCase caseSensitivity) {
if (names == null) {
throw new IllegalArgumentException("The list of names must not be null");
} else {
this.names = (String[]) names.toArray(new String[names.size()]);
this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
}
}
public boolean accept(File file) {
String name = file.getName();
String[] astring = this.names;
int i = astring.length;
for (int j = 0; j < i; ++j) {
String name2 = astring[j];
if (this.caseSensitivity.checkEquals(name, name2)) {
return true;
}
}
return false;
}
public boolean accept(File dir, String name) {
String[] astring = this.names;
int i = astring.length;
for (int j = 0; j < i; ++j) {
String name2 = astring[j];
if (this.caseSensitivity.checkEquals(name, name2)) {
return true;
}
}
return false;
}
public String toString() {
StringBuilder buffer = new StringBuilder();
buffer.append(super.toString());
buffer.append("(");
if (this.names != null) {
for (int i = 0; i < this.names.length; ++i) {
if (i > 0) {
buffer.append(",");
}
buffer.append(this.names[i]);
}
}
buffer.append(")");
return buffer.toString();
}
}
| [
"56791945+AfkBranta@users.noreply.github.com"
] | 56791945+AfkBranta@users.noreply.github.com |
aca4a4228f13d7d84c6d97df1f4a01a93cb720a6 | d8be8c45aca2ffa4b9e8f7778a2ee7a5d29b0adb | /splitted/project/int-queue/src/main/java/com/slimjars/dist/gnu/trove/queue/TIntQueue.java | 614e7730a23938a8eac29ee83987b773401d9474 | [] | no_license | slimjars/trove4j-plain | 530aba3fae2bd10b39c8d6da6cbd2c05106777ff | a23ef0bde2f5546540186b1f2b90f787fb26a309 | refs/heads/master | 2020-12-03T03:46:17.527811 | 2017-07-13T11:27:35 | 2017-07-13T11:27:35 | 95,769,713 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,326 | java | ///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2009, Rob Eden All Rights Reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
///////////////////////////////////////////////////////////////////////////////
package com.slimjars.dist.gnu.trove.queue;
import com.slimjars.dist.gnu.trove.TIntCollection;
/**
* Interface for Trove queue implementations.
*
* @see java.util.Queue
*/
public interface TIntQueue extends TIntCollection {
/**
* Retrieves and removes the head of this queue. This method differs from
* {@link #poll} only in that it throws an exception if this queue is empty.
*/
public int element();
/**
* Inserts the specified element into this queue if it is possible to do so
* immediately without violating capacity restrictions. When using a
* capacity-restricted queue, this method is generally preferable to
* {@link #add}, which can fail to insert an element only by throwing an exception.
*
* @param e The element to add.
*
* @return <tt>true</tt> if the element was added to this queue, else <tt>false</tt>
*/
public boolean offer( int e );
/**
* Retrieves, but does not remove, the head of this queue, or returns
* {@link #getNoEntryValue} if this queue is empty.
*
* @return the head of this queue, or {@link #getNoEntryValue} if this queue is empty
*/
public int peek();
/**
* Retrieves and removes the head of this queue, or returns {@link #getNoEntryValue}
* if this queue is empty.
*
* @return the head of this queue, or {@link #getNoEntryValue} if this queue is empty
*/
public int poll();
}
| [
"sebastian@topobyte.de"
] | sebastian@topobyte.de |
a59d989e890431a103975b8cf401127502d39a7c | 37f53ea93eaa9bd64423e07b1f7c0ad7bc79e98c | /users/src/main/java/com/laidongs/sba/user/domain/Training.java | 8f6812ee916cd9bfe36303d9a6fd515543fed519 | [] | no_license | woyaowoyao/hipster4FSD | 15621a2f8eee77d1a0e1730ac2c98edcf5e07910 | 259e039f131a3d01d9dc43b361f149cc2bba8145 | refs/heads/master | 2022-12-24T01:34:45.535515 | 2019-11-22T02:50:31 | 2019-11-22T02:50:31 | 217,682,878 | 0 | 0 | null | 2022-12-16T04:41:34 | 2019-10-26T09:00:17 | Java | UTF-8 | Java | false | false | 4,363 | java | package com.laidongs.sba.user.domain;
import io.swagger.annotations.ApiModel;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.Instant;
import com.laidongs.sba.user.domain.enumeration.TrainStatus;
/**
* Training entity.\n@author full stack trainning laidongshi.
*/
@ApiModel(description = "Training entity.\n@author full stack trainning laidongshi.")
@Entity
@Table(name = "training")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Training implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "status", nullable = false)
private TrainStatus status;
@NotNull
@Column(name = "name", nullable = false)
private String name;
@NotNull
@Column(name = "commission_amount", nullable = false)
private Float commissionAmount;
@Column(name = "avg_rating")
private Float avgRating;
@Column(name = "start_date")
private Instant startDate;
@Column(name = "end_date")
private Instant endDate;
@Column(name = "remarks")
private String remarks;
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public TrainStatus getStatus() {
return status;
}
public Training status(TrainStatus status) {
this.status = status;
return this;
}
public void setStatus(TrainStatus status) {
this.status = status;
}
public String getName() {
return name;
}
public Training name(String name) {
this.name = name;
return this;
}
public void setName(String name) {
this.name = name;
}
public Float getCommissionAmount() {
return commissionAmount;
}
public Training commissionAmount(Float commissionAmount) {
this.commissionAmount = commissionAmount;
return this;
}
public void setCommissionAmount(Float commissionAmount) {
this.commissionAmount = commissionAmount;
}
public Float getAvgRating() {
return avgRating;
}
public Training avgRating(Float avgRating) {
this.avgRating = avgRating;
return this;
}
public void setAvgRating(Float avgRating) {
this.avgRating = avgRating;
}
public Instant getStartDate() {
return startDate;
}
public Training startDate(Instant startDate) {
this.startDate = startDate;
return this;
}
public void setStartDate(Instant startDate) {
this.startDate = startDate;
}
public Instant getEndDate() {
return endDate;
}
public Training endDate(Instant endDate) {
this.endDate = endDate;
return this;
}
public void setEndDate(Instant endDate) {
this.endDate = endDate;
}
public String getRemarks() {
return remarks;
}
public Training remarks(String remarks) {
this.remarks = remarks;
return this;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Training)) {
return false;
}
return id != null && id.equals(((Training) o).id);
}
@Override
public int hashCode() {
return 31;
}
@Override
public String toString() {
return "Training{" +
"id=" + getId() +
", status='" + getStatus() + "'" +
", name='" + getName() + "'" +
", commissionAmount=" + getCommissionAmount() +
", avgRating=" + getAvgRating() +
", startDate='" + getStartDate() + "'" +
", endDate='" + getEndDate() + "'" +
", remarks='" + getRemarks() + "'" +
"}";
}
}
| [
"laidongs@cn.ibm.com"
] | laidongs@cn.ibm.com |
bfb0c9a7c841e415e1e89be756690bd2ecf90f61 | 005553bcc8991ccf055f15dcbee3c80926613b7f | /generated/com/guidewire/_generated/entity/PercentMetricLimitDelegateInternal.java | 43ee1ad4a39238cb2e27b5218cb89c3e55995174 | [] | no_license | azanaera/toggle-isbtf | 5f14209cd87b98c123fad9af060efbbee1640043 | faf991ec3db2fd1d126bc9b6be1422b819f6cdc8 | refs/heads/master | 2023-01-06T22:20:03.493096 | 2020-11-16T07:04:56 | 2020-11-16T07:04:56 | 313,212,938 | 0 | 0 | null | 2020-11-16T08:48:41 | 2020-11-16T06:42:23 | null | UTF-8 | Java | false | false | 1,593 | java | package com.guidewire._generated.entity;
@javax.annotation.processing.Generated(value = "com.guidewire.pl.metadata.codegen.Codegen", comments = "PercentMetricLimitDelegate.eti;PercentMetricLimitDelegate.eix;PercentMetricLimitDelegate.etx")
@java.lang.SuppressWarnings(value = {"deprecation", "unchecked"})
public interface PercentMetricLimitDelegateInternal extends com.guidewire.pl.domain.persistence.core.impl.BeanInternal, com.guidewire.cc.domain.metric.impl.PercentMetricLimitDelegateInternal, gw.cc.metric.entity.PercentMetricLimitDelegate {
/**
* Gets the value of the PercentRedValue field.
* Percent field to store the red value.
*/
@gw.internal.gosu.parser.ExtendedProperty
public java.math.BigDecimal getPercentRedValue();
/**
* Gets the value of the PercentTargetValue field.
* Percent field to store the target value.
*/
@gw.internal.gosu.parser.ExtendedProperty
public java.math.BigDecimal getPercentTargetValue();
/**
* Gets the value of the PercentYellowValue field.
* Percent field to store the yellow value.
*/
@gw.internal.gosu.parser.ExtendedProperty
public java.math.BigDecimal getPercentYellowValue();
/**
* Sets the value of the PercentRedValue field.
*/
public void setPercentRedValue(java.math.BigDecimal value);
/**
* Sets the value of the PercentTargetValue field.
*/
public void setPercentTargetValue(java.math.BigDecimal value);
/**
* Sets the value of the PercentYellowValue field.
*/
public void setPercentYellowValue(java.math.BigDecimal value);
} | [
"azanaera691@gmail.com"
] | azanaera691@gmail.com |
fc7f00fb9b8bca0e5f05b07c10ccc7cb23d1ba25 | 0f948a402451822cbc5be84cedd8178771d79b19 | /springboot/springboot-mybatis-generator/src/main/java/cn/lwb/generator/mybatis/plugin/CustomPlugin.java | a25de2dd5fe9d9f4d338786a98d0545b9bd1a6ba | [] | no_license | kajayinnn/Springboot | 6c4a6f7734a214c913ba3ba110cf9c41f37d2bc0 | 40ec8ed40cfeca1f45fcb832dabc9b08c0df5f41 | refs/heads/master | 2022-12-12T23:21:35.864747 | 2020-09-02T05:49:03 | 2020-09-02T05:49:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,866 | java | package cn.lwb.generator.mybatis.plugin;
import java.util.List;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.PluginAdapter;
import org.mybatis.generator.api.dom.java.Interface;
import org.mybatis.generator.api.dom.java.TopLevelClass;
import org.mybatis.generator.api.dom.xml.Document;
import org.mybatis.generator.codegen.mybatis3.javamapper.elements.AbstractJavaMapperMethodGenerator;
import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.AbstractXmlElementGenerator;
/**
* 自定义插件
* 增加
* 1. find
* 2. list
* 3. pageList
*
* 参考
* @see org.mybatis.generator.plugins.ToStringPlugin
* @author My
*/
public class CustomPlugin extends PluginAdapter {
@Override
public boolean validate(List<String> warnings) {
return true;
}
@Override
public boolean sqlMapDocumentGenerated(Document document,
IntrospectedTable introspectedTable) {
AbstractXmlElementGenerator elementGenerator = new CustomAbstractXmlElementGenerator();
elementGenerator.setContext(context);
elementGenerator.setIntrospectedTable(introspectedTable);
elementGenerator.addElements(document.getRootElement());
return super.sqlMapDocumentGenerated(document, introspectedTable);
}
@Override
public boolean clientGenerated(Interface interfaze, TopLevelClass topLevelClass,
IntrospectedTable introspectedTable) {
AbstractJavaMapperMethodGenerator methodGenerator = new CustomJavaMapperMethodGenerator();
methodGenerator.setContext(context);
methodGenerator.setIntrospectedTable(introspectedTable);
methodGenerator.addInterfaceElements(interfaze);
return super.clientGenerated(interfaze, topLevelClass, introspectedTable);
}
} | [
"597186288@qq.com"
] | 597186288@qq.com |
ed014e8822446759afc271292352b07adf102e01 | 838fe21048f4da4ba6a2ec1679e2a9e3aff188c9 | /Calix-android/app/src/main/java/com/calix/calixgigamanage/ui/media/MediaFileList.java | 4b3cab81616fec45e1a47e72ea6d833b34b38129 | [] | no_license | PrithivDharmarajan/Projects | 03b162e0666dc08888d73bd3c6fa7771525677c7 | 1548b60025adc4f7a0570d51950c144a1cacce3a | refs/heads/master | 2020-03-30T22:36:22.465572 | 2018-11-12T16:39:01 | 2018-11-12T16:39:01 | 151,672,600 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,779 | java | package com.calix.calixgigamanage.ui.media;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.calix.calixgigamanage.R;
import com.calix.calixgigamanage.adapter.MyMediaFileListAdapter;
import com.calix.calixgigamanage.main.BaseActivity;
import com.calix.calixgigamanage.utils.NumberUtil;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class MediaFileList extends BaseActivity {
@BindView(R.id.media_file_parent_lay)
ViewGroup mMediaFileViewGroup;
@BindView(R.id.media_file_header_bg_lay)
RelativeLayout mMediaFileHeaderBgLay;
@BindView(R.id.media_file_header_msg_lay)
RelativeLayout mMediaFileHeaderMsgLay;
@BindView(R.id.header_txt)
TextView mHeaderTxt;
@BindView(R.id.media_file_recycler_view)
RecyclerView mMediaFileRecyclerView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ui_media_file_list);
initView();
}
/*View initialization*/
private void initView() {
/*ButterKnife for variable initialization*/
ButterKnife.bind(this);
/*Keypad to be hidden when a touch made outside the edit text*/
setupUI(mMediaFileViewGroup);
setHeaderView();
setAdapter();
}
private void setHeaderView() {
/*set header changes*/
mMediaFileHeaderMsgLay.setVisibility(IsScreenModePortrait() ? View.VISIBLE : View.GONE);
mHeaderTxt.setVisibility(View.VISIBLE);
mHeaderTxt.setText("Media");
/*Set header adjustment - status bar we applied transparent color so header tack full view*/
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
mMediaFileHeaderBgLay.post(new Runnable() {
public void run() {
int heightInt = getResources().getDimensionPixelSize(IsScreenModePortrait() ? R.dimen.size190 : R.dimen.size45);
mMediaFileHeaderBgLay.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, heightInt + NumberUtil.getInstance().getStatusBarHeight(MediaFileList.this)));
mMediaFileHeaderBgLay.setPadding(0, NumberUtil.getInstance().getStatusBarHeight(MediaFileList.this), 0, 0);
mMediaFileHeaderBgLay.setBackground(IsScreenModePortrait() ? getResources().getDrawable(R.drawable.header_violet_bg) : getResources().getDrawable(R.color.violet));
}
});
}
}
/*Screen orientation Changes*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
setHeaderView();
}
/*View onClick*/
@OnClick({R.id.header_left_img_lay})
public void onClick(View v) {
switch (v.getId()) {
case R.id.header_left_img_lay:
onBackPressed();
break;
}
}
private void setAdapter() {
MyMediaFileListAdapter mediaAdapter = new MyMediaFileListAdapter(this);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
mMediaFileRecyclerView.setLayoutManager(linearLayoutManager);
mMediaFileRecyclerView.setAdapter(mediaAdapter);
mMediaFileRecyclerView.setNestedScrollingEnabled(false);
}
@Override
public void onBackPressed() {
backScreen();
}
} | [
"prithiviraj@smaatapps.com"
] | prithiviraj@smaatapps.com |
ad033580492aa9f55436b59fbd95c3a225651ff9 | 369caa6b25db5d7f69eb0a782ce0b294aa602faf | /components/Component-remote-lock/src/test/java/TestLock.java | a59806a0acca7b8d673a46e7cccd47a8913aa8e3 | [] | no_license | lianshufeng/FastDev | 15cd1b22579ab3b9bc60230044b7ea171546656a | c2b4cc5541dc63fe7b2693ed061b1c3775df8054 | refs/heads/master | 2021-01-20T09:49:13.466479 | 2018-10-17T00:52:17 | 2018-10-17T00:52:17 | 101,608,179 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,742 | java | import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.fast.dev.component.remote.lock.config.RemoteLockOption;
import com.fast.dev.component.remote.lock.impl.RemoteLockZooKeeper;
import com.fast.dev.core.lock.factory.RemoteLock;
import com.fast.dev.core.lock.factory.RemoteLockFactory;
public class TestLock {
// 最大线程池数量
private static int maxThreadCount = 3000;
// 最大运行次数
private static int maxRunCount = 100000;
private static CountDownLatch countDownLatch = new CountDownLatch(maxRunCount);
static RemoteLock remoteLock = null;
public static void main(String[] args) throws Exception {
ExecutorService fixedThreadPool = Executors.newFixedThreadPool(maxThreadCount);
remoteLock = RemoteLockFactory.build(RemoteLockZooKeeper.class,
new RemoteLockOption(new String[] { "127.0.0.1:2181" }));
long time = System.currentTimeMillis();
for (int i = 0; i < maxRunCount; i++) {
final String resourcesName = "test_resources";
fixedThreadPool.execute(new Runnable() {
@Override
public void run() {
runLock(resourcesName);
}
});
}
countDownLatch.await();
fixedThreadPool.shutdownNow();
long castTime = System.currentTimeMillis() - time;
System.out.println("run count : " + maxRunCount + " time : " + (castTime) + " , qps : "
+ (((double) maxRunCount / (double) (castTime)) * 1000));
}
private static void runLock(String resourcesName) {
try {
boolean lock = remoteLock.lock(resourcesName);
if (lock) {
System.out.println("token thread : " + Thread.currentThread());
}
} catch (Exception e) {
e.printStackTrace();
}
countDownLatch.countDown();
}
}
| [
"251708339@qq.com"
] | 251708339@qq.com |
75fd970234de9914e08258362327f91be377c82e | 4a7cb14aa934df8f362cf96770e3e724657938d8 | /MFES/ATS/Project/structuring/projectsPOO_1920/84/POO-master/src/model/EmpresaTransporte.java | d95c423127b80a2d689b3c8dbdf510c649b46823 | [] | no_license | pCosta99/Masters | 7091a5186f581a7d73fd91a3eb31880fa82bff19 | f835220de45a3330ac7a8b627e5e4bf0d01d9f1f | refs/heads/master | 2023-08-11T01:01:53.554782 | 2021-09-22T07:51:51 | 2021-09-22T07:51:51 | 334,012,667 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,817 | java | package model;
import exceptions.ExcecaoRegistoDeEncomendasNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class EmpresaTransporte implements Serializable {
private String nome;
private String id;
private List<Encomenda> registoEncomendas;
private double taxaKm; //taxa efetiva de uma empresa por km
private double facturacao; // Facturacao total de uma empresa
private int capacidadeEncomendas; //Capacidade de encomendas que uma empresa tem para transportar
private Coordenadas localizacao;
private double classificacao;
public EmpresaTransporte() {
this.nome = "";
this.registoEncomendas = new ArrayList<Encomenda>();
this.taxaKm = 0;
this.facturacao = 0;
this.capacidadeEncomendas = 0;
this.localizacao = new Coordenadas();
this.classificacao = 0.0;
}
public EmpresaTransporte(String nome,String id,List<Encomenda> reg, double taxaKm, int capacidadeEncomendas, Coordenadas localizacao, double classificacao) {
this.nome = nome;
this.id = id;
setRegistoEncomendas(reg);
this.taxaKm = taxaKm;
this.capacidadeEncomendas = capacidadeEncomendas;
this.localizacao = localizacao;
this.facturacao = this.facturacaoTotal(); //já faz o calculo da facturaçao
this.classificacao = classificacao;
}
public EmpresaTransporte(EmpresaTransporte k) {
setNome(k.getNome());
setId(k.getId());
setCapacidadeEncomendas(k.getCapacidadeEncomendas());
setLocalizacao(k.getLocalizacao());
setTaxaKm(k.getTaxaKm());
setFacturacao(k.facturacaoTotal());
setClassificacao(k.getClassificacao());
setCapacidadeEncomendas(k.getCapacidadeEncomendas());
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public void setRegistoEncomendas(List<Encomenda> reg) {
this.registoEncomendas = new ArrayList<>();
for (Encomenda p : reg) this.registoEncomendas.add(p);
}
public List<Encomenda> getRegistoEncomendas() {
List<Encomenda> encomendas = new ArrayList<>();
for(Encomenda enc: registoEncomendas){
encomendas.add(enc.clone());
}
return encomendas;
}
public void addEncomendaEmpresa(Encomenda e){
this.registoEncomendas.add(e);
}
public int getCapacidadeEncomendas() {
return capacidadeEncomendas;
}
public void setCapacidadeEncomendas(int capacidadeEncomendas) {
this.capacidadeEncomendas = capacidadeEncomendas;
}
public double getClassificacao() {
return classificacao;
}
public void setClassificacao(double classificacao) {
this.classificacao = classificacao;
}
public double getFacturacao() {
return facturacao;
}
public void setFacturacao(double facturacao) {
this.facturacao = facturacao;
}
public Coordenadas getLocalizacao() {
return localizacao;
}
public void setLocalizacao(Coordenadas localizacao) {
this.localizacao = localizacao;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public double getTaxaKm() {
return taxaKm;
}
public void setTaxaKm(double taxaKm) {
this.taxaKm = taxaKm;
}
public boolean equals(Object obj) {
if (obj == this) return true;
if (obj == null || obj.getClass() != this.getClass()) return false;
EmpresaTransporte empresa = (EmpresaTransporte) obj;
return this.getCapacidadeEncomendas() == empresa.getCapacidadeEncomendas() &&
this.getId().equals(empresa.getId()) &&
this.getClassificacao() == empresa.getClassificacao() &&
this.getFacturacao() == empresa.getFacturacao() &&
this.getNome().equals(empresa.getNome()) &&
this.getLocalizacao().equals(empresa.getLocalizacao()) &&
this.getTaxaKm() == empresa.getTaxaKm() &&
this.getRegistoEncomendas().equals(empresa.getRegistoEncomendas());
}
public String toString(){
StringBuilder sb = new StringBuilder();
sb.append(getNome()).append("\n");
sb.append(this.getId()).append("\n");
sb.append(this.getFacturacao()).append("\n");
sb.append(this.getTaxaKm()).append("\n");
sb.append(this.getCapacidadeEncomendas()).append("\n");
sb.append(this.getLocalizacao()).append("\n");
sb.append(this.getClassificacao()).append("\n");
return sb.toString();
}
/*
public String topToString(){
StringBuilder sb = new StringBuilder();
sb.append(this.getId()).append("\n");
sb.append(this.numeroEncomendas()).append("\n");
return sb.toString();
}
*/
public List<Encomenda> registoEncomendaemPeriodo(LocalDateTime inicio, LocalDateTime fim){
return this.getRegistoEncomendas().stream().filter(encomenda -> encomenda.getData().isEqual(inicio) && encomenda.getData().isAfter(inicio)
&& encomenda.getData().isEqual(fim) && encomenda.getData().isBefore(fim)).collect(Collectors.toList());
}
public EmpresaTransporte clone(){
return new EmpresaTransporte(this);
}
public double facturacaoTotal() {
int total = 0;
for (Encomenda e : this.getRegistoEncomendas()) {
total += e.custoReal();
}
return total;
}
public int numeroEncomendas(){ return this.registoEncomendas.size();}
}
| [
"costapedro.a1999@gmail.com"
] | costapedro.a1999@gmail.com |
24ff0564512dd1b2d77d859cc619ef3a1cad5d24 | d5e67541765f6ea3782ec2b75be2a5416cb35cc3 | /L14-structuralPatterns/homework/src/main/java/ru/otus/ObjectForMessage.java | 82df747c1a27940ef46856e9ccdc95bd1a17b641 | [
"MIT"
] | permissive | petrelevich/otus_java_2020_06 | 53ddbf0fd96fa1fe17df289766447a239869a819 | 432ffe13dc58466c7845b268b024c4f0df5caaeb | refs/heads/master | 2023-01-09T09:42:55.653183 | 2020-11-09T22:18:15 | 2020-11-09T22:18:15 | 275,573,565 | 3 | 17 | MIT | 2020-08-02T17:07:47 | 2020-06-28T11:47:40 | Java | UTF-8 | Java | false | false | 249 | java | package ru.otus;
import java.util.List;
public class ObjectForMessage {
private List<String> data;
public List<String> getData() {
return data;
}
public void setData(List<String> data) {
this.data = data;
}
}
| [
"petrelevich@yandex.ru"
] | petrelevich@yandex.ru |
08b0ed9c4b198413bad6adab15817ebb695c0e5a | 1cf48cae99501879c9970502d393cf8b77c5d820 | /event/src/main/java/org/jotserver/ot/model/event/EventEngine.java | 1892da12022632185b262ae0ab42293b9c033f81 | [] | no_license | BenDol/jOTServer | 4145888acf82a05ffdd48497a4941975b17ebe70 | b4ef1fe315d06aee21089bcb85338505942059a5 | refs/heads/master | 2021-01-22T05:54:10.482209 | 2015-10-21T22:57:25 | 2015-10-21T22:57:25 | 27,660,695 | 15 | 24 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | package org.jotserver.ot.model.event;
import org.jotserver.ot.model.chat.ChatChannelEventEngine;
import org.jotserver.ot.model.item.ItemEventEngine;
import org.jotserver.ot.model.world.LocalGameWorld;
public interface EventEngine {
void init(LocalGameWorld world);
ItemEventEngine getItemEngine();
ChatChannelEventEngine getChatEngine();
}
| [
"dolb90@gmail.com"
] | dolb90@gmail.com |
d385ae59960812f97df982a007de30f1b186e50e | b1c43a10dde95741aef29f62dcc6637e12ba48db | /Important topics/GUI/Swing/С ТОП КАНАЛА/18)AWT(ТУТ МНОГО)/4)Прогресс загрузки приложения/src/Main.java | b83b981c6977b804c03d6d731cb2b127b483615b | [] | no_license | KonecKonca/javaProjects | d29701bfd5b5487e193a7c2542b9c47a06a2219f | 2a57cfc4f8142b6dd44ccd591c4b45cbf54103a9 | refs/heads/master | 2020-03-30T06:57:31.378408 | 2019-02-08T20:45:27 | 2019-02-08T20:46:08 | 150,903,011 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,368 | java | import com.sun.javafx.charts.ChartLayoutAnimator;
import javax.print.*;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.filechooser.FileFilter;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
import java.beans.EventHandler;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.*;
import java.net.URL;
import java.util.concurrent.Exchanger;
// -splash:smile.jpg -- что-то, что открывается до запуска приложения (указать в настройках(VM options))
public class Main{
public static void main(String[] args) throws Exception {
// всё ниже для полосы прогрузки
SplashScreen splashScreen = SplashScreen.getSplashScreen();
Rectangle bounds = splashScreen.getBounds();
Graphics2D g2 = splashScreen.createGraphics();
g2.setColor(Color.blue);
for(int i = 0; i < 100; i++){
g2.fillRect(0, 0, bounds.width*i/100,20 );
splashScreen.update();
Thread.sleep(100);
}
}
} | [
"andrei.kozitsky@mail.ru"
] | andrei.kozitsky@mail.ru |
fe65df1be6d6c969db9f3c4877c05901e2d42c0b | 7ac63dbc58cd592d3fbe55ce87393db52f36e622 | /crm-reactive-microservice/src/main/java/com/example/crm/repository/CustomerReactiveRepository.java | a57dfb2deb73fbd100ffcf44bde025a1043e56c6 | [
"MIT"
] | permissive | deepcloudlabs/dcl350-2021-sep-06 | 74846c6448a5c45474a644bd2e5702efaff4aa50 | d467c4b39443fa4405f9d45b7682956560ea55b5 | refs/heads/main | 2023-08-04T12:26:27.052788 | 2021-09-10T17:53:03 | 2021-09-10T17:53:03 | 403,676,519 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 651 | java | package com.example.crm.repository;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
import com.example.crm.entity.Customer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
public interface CustomerReactiveRepository extends ReactiveMongoRepository<Customer, String>{
@Query("{}")
Flux<Customer> findAllByPage(Pageable page); // asynchronous
Mono<Customer> findByEmail(String email); // asynchronous
Flux<Customer> findAllByBirthYearBetween(int fromYear,int toYear); // asynchronous
}
| [
"deepcloudlabs@gmail.com"
] | deepcloudlabs@gmail.com |
2f961e8b45536d04f067b4562ad6f817338fac16 | d9477e8e6e0d823cf2dec9823d7424732a7563c4 | /plugins/TextAutocomplete/tags/RELEASE-0_9_4/tests/net/jakubholy/jedit/autocomplete/TestUtils.java | e3bf5d0113741d4b938cc65683c8a26478621a32 | [] | no_license | RobertHSchmidt/jedit | 48fd8e1e9527e6f680de334d1903a0113f9e8380 | 2fbb392d6b569aefead29975b9be12e257fbe4eb | refs/heads/master | 2023-08-30T02:52:55.676638 | 2018-07-11T13:28:01 | 2018-07-11T13:28:01 | 140,587,948 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,459 | java | /**
*
*/
package net.jakubholy.jedit.autocomplete;
import java.io.File;
import java.io.IOException;
import java.util.ResourceBundle;
import org.gjt.sp.jedit.EditPlugin;
import org.gjt.sp.jedit.jEdit;
import org.gjt.sp.util.Log;
/**
* @author Jakub Holy
*
*/
public class TestUtils
{
private static boolean isJEditStarted = false;
/** Holds test properties. */
static ResourceBundle CONFIG = ResourceBundle.getBundle("junit_test");
/** Direcotry with jEdit user settings - relative to user.home */
private static final String jEditSettingsDir =
System.getProperty("user.home") + File.separator
+ "test_jedit_settings";
/** Where jEdit is installed. */
private static String jeditHome = CONFIG.getString("test.jedit.home");
/** Start jEdit if it is not running already. */
public static synchronized void startJEdit()
{
// -log=
// -settings=settingsDir
if (!isJEditStarted)
{
// Check the jEditSettingsDir
File settings = new File(jEditSettingsDir);
if(!settings.exists())
{
throw new RuntimeException("The jEdit settings directory '"
+ settings.getAbsolutePath() + "' doesn't exist, "
+ "create it first, please.");
}
else if (!settings.isDirectory())
{
throw new RuntimeException("The given jEdit settings directory '"
+ settings.getAbsolutePath() + "' isn't a directory.");
}
else
{
// Don't show the splash screen
File nosplash = new File(jEditSettingsDir,"nosplash");
try
{
nosplash.createNewFile();
}
catch (IOException e)
{} // ignore
// Check for the plugin
File pluginJar = new File(jEditSettingsDir,"jars"
+ File.separator + "TextAutocomplete.jar");
if(! pluginJar.exists())
{
throw new RuntimeException("The tested plugin "
+ "TextAutocomplete is not installed in the settings "
+ "directory '"
+ settings.getAbsolutePath() + "' ");
}
}
// Set jEdit home
if(System.getProperty("jedit.home") == null)
{ System.setProperty("jedit.home", jeditHome); }
// Start jEdit
String[] args = new String[]{
"-log=" + Log.DEBUG,
"-settings=" + jEditSettingsDir,
"-noserver",
"-norestore"
};
jEdit.main( args );
isJEditStarted = true;
}
else
{
// TODO: Reload the plugin?
// see jEdit.removePluginJAR(PluginJAR jar, boolean exit)
// jEdit.getPluginJAR(String path)
} // if-else jEdit not yet started
} // startJEdit
}
| [
"nobody@6b1eeb88-9816-0410-afa2-b43733a0f04e"
] | nobody@6b1eeb88-9816-0410-afa2-b43733a0f04e |
385d15089ab1153a25a3d758aae9851b9be13ae8 | 55331a702818e705d2020de7a21436e41a0cadab | /learnJava/src/InnerClasses/Test.java | e1185333c1f022c61eff022ac77fe8efc5f8ebc7 | [] | no_license | bordea/testBordea | fe9cee3c6d2ab9fe0128b2f615a4dd34459e2dc9 | a61ad9030c576b84e41071795a5dd58e80124f8d | refs/heads/master | 2016-09-06T05:54:02.193551 | 2013-06-16T19:20:21 | 2013-06-16T19:20:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 307 | java | package InnerClasses;
class Test {
public static void main (String[] args) {
Animal h = new Horse();
h.eat(); // totul este in regula pentru ca eat apartine Animal class
// h.buck(); // eroare pentru ca Animal class nu are buck
}
}
| [
"test@test.com"
] | test@test.com |
1f5df5b59b7aabec30993d2cfcc80c5754443a17 | 92cb886d4a5a5c86894d4679f76045e92dfdc986 | /souyue/src/main/java/com/zhongsou/souyue/module/VideoDetailItem.java | 66456024812cbc34b6fb3bda653b07743dea6e4b | [] | no_license | chzh1377/souyue_android | 9602d84fb5fd0360b98fb320cc09f343c32147ff | be27d88f6187a374e3bd611835f6d421c34d7bb7 | refs/heads/master | 2016-09-14T05:12:51.419652 | 2016-05-18T13:01:14 | 2016-05-18T13:01:14 | 59,115,792 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,359 | java | package com.zhongsou.souyue.module;
import com.zhongsou.souyue.circle.model.VideoAboutResult;
import com.zhongsou.souyue.module.listmodule.BaseInvoke;
import com.zhongsou.souyue.module.listmodule.BaseListData;
import com.zhongsou.souyue.module.listmodule.FootItemBean;
import com.zhongsou.souyue.module.listmodule.SigleBigImgBean;
import java.io.Serializable;
import java.util.List;
/**
* @description:
* @auther: qubian
* @data: 2016/3/23.
*/
public class VideoDetailItem extends ResponseObject implements Serializable {
private long id;
private String netUrl;
private String videoUrl;
private String imageUrl;
private String title;
private int palyPosition;
private String keyword;
private String srpId;
private long mBlogId;
private long mInterestId;
private FootItemBeanSer footView;
private int skip;//跳转标识
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getNetUrl() {
return netUrl;
}
public void setNetUrl(String netUrl) {
this.netUrl = netUrl;
}
public int getSkip() {
return skip;
}
public void setSkip(int skip) {
this.skip = skip;
}
public FootItemBeanSer getFootView() {
return footView;
}
public void setFootView(FootItemBeanSer footView) {
this.footView = footView;
}
public long getmInterestId() {
return mInterestId;
}
public void setmInterestId(long mInterestId) {
this.mInterestId = mInterestId;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getPalyPosition() {
return palyPosition;
}
public void setPalyPosition(int palyPosition) {
this.palyPosition = palyPosition;
}
public long getmBlogId() {
return mBlogId;
}
public void setmBlogId(long mBlogId) {
this.mBlogId = mBlogId;
}
public String getVideoUrl() {
return videoUrl;
}
public void setVideoUrl(String videoUrl) {
this.videoUrl = videoUrl;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public String getSrpId() {
return srpId;
}
public void setSrpId(String srpId) {
this.srpId = srpId;
}
public static VideoDetailItem InVokeToVideoDetailItem(BaseInvoke invoke)
{
VideoDetailItem item = new VideoDetailItem();
item.setId(invoke.getId());
item.setTitle(invoke.getTitle());
item.setKeyword(invoke.getKeyword());
item.setmBlogId(invoke.getBlogId());
item.setSrpId(invoke.getSrpId());
BaseListData data =invoke.getData();
if(data instanceof SigleBigImgBean)
{
item.setVideoUrl(((SigleBigImgBean) data).getPhoneImageUrl());
}
item.setImageUrl(invoke.getBigImgUrl());
item.setmInterestId(invoke.getInterestId());
item.setFootView(setFoot(invoke.getData().getFootView()));
item.setSkip(invoke.getFlag(BaseInvoke.FLAG_SKIP_COMMENT)?1:0);
item.setNetUrl(invoke.getUrl());
return item;
}
public static FootItemBeanSer setFoot(FootItemBean bean)
{
FootItemBeanSer ser = new FootItemBeanSer();
ser.setIsUp(bean.getIsUp());
ser.setCommentCount(bean.getCommentCount());
ser.setDeleteId(bean.getDeleteId());
ser.setDownCount(bean.getDownCount());
ser.setIsDown(bean.getIsDown());
ser.setIsFavorator(bean.getIsFavorator());
ser.setShareUrl(bean.getShareUrl());
ser.setUpCount(bean.getUpCount());
return ser;
}
public static VideoDetailItem ResultToVideoDetailItem(VideoAboutResult invoke) {
VideoDetailItem item = new VideoDetailItem();
item.setId(invoke.getId());
item.setTitle(invoke.getTitle());
item.setKeyword(invoke.getKeyword());
item.setSrpId(invoke.getSrpId());
item.setVideoUrl(invoke.getPhoneImageUrl());
item.setNetUrl(invoke.getUrl());
item.setFootView(setFoot(invoke.getFootView()));
List<String> images = invoke.getImage();
if(images!=null&&images.size()>0)
{
item.setImageUrl(images.get(0));
}
return item;
}
public static VideoDetailItem SearchResultItemToVideoDetailItem(SearchResultItem searchResultItem)
{
VideoDetailItem item = new VideoDetailItem();
item.setId(Long.parseLong(searchResultItem.id()));
item.setTitle(searchResultItem.title());
item.setKeyword(searchResultItem.keyword());
item.setSrpId(searchResultItem.srpId());
item.setVideoUrl(searchResultItem.bigImgUrl());
item.setNetUrl(searchResultItem.url());
// item.setFootView(setFoot(invoke.getFootView()));
List<String> images = searchResultItem.image();
if(images!=null&&images.size()>0)
{
item.setImageUrl(images.get(0));
}
return item;
}
}
| [
"zhch1377@163.com"
] | zhch1377@163.com |
4a73ccdc1422bb479cad94961649eb730b8a2a2e | 277bf3a0d3587808141942d0f0d42882e7b3cd8f | /ProjectSourceCode /Apache Commons Math v3.5/src/test/java/org/apache/commons/math3/fraction/BigFractionFieldTest.java | 4dfb0d78b8c1f6b503e4f9083fc21f624750675c | [
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-public-domain",
"Unlicense"
] | permissive | yashgolwala/Software_Measurement_Team_M | d1b13389651dacbc8f735dc87a7d0992829c8909 | 3d2aef4c0711b7a02155a42ca6b08bb6c2693d4c | refs/heads/master | 2020-06-11T11:19:32.815146 | 2019-06-26T03:45:15 | 2019-06-26T03:45:15 | 193,592,231 | 0 | 0 | Unlicense | 2019-06-25T16:17:29 | 2019-06-24T22:57:31 | HTML | UTF-8 | Java | false | false | 129 | java | version https://git-lfs.github.com/spec/v1
oid sha256:87912c9551d54352307b265272d7b5d02b3b8a839bcb268e779a8fefa409928a
size 1510
| [
"golwalayash@gmail.com"
] | golwalayash@gmail.com |
2cc2c201ef69c0b28038cd55635c08e10cb33686 | 71ba147e55699433122b883b248611e27a4a6192 | /apollo-app/src/main/java/com/wizinno/apollo/app/domain/NetworkSpeedMapper.java | a7b04e752b7459f1c841ee7a1a83169fe0256b9f | [] | no_license | yanglong1360075452/apollo | 25a30d178b79c1dd300e99376ce014c1154b5b73 | 0401b9b5182466f07177151b3c6580e9556941fa | refs/heads/master | 2021-05-11T10:27:39.031194 | 2018-01-19T08:58:27 | 2018-01-19T08:58:27 | 116,779,820 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,790 | java | package com.wizinno.apollo.app.domain;
import com.wizinno.apollo.app.domain.model.NetworkSpeed;
import java.util.Date;
import java.util.List;
import com.wizinno.apollo.app.dto.UserAndNetworksDto;
import com.wizinno.apollo.common.condition.NetworksSpeedCondition;
import org.apache.ibatis.annotations.Param;
public interface NetworkSpeedMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table network_speed
*
* @mbggenerated Tue Sep 26 15:43:55 CST 2017
*/
int deleteByPrimaryKey(@Param("userId") String userId, @Param("timeStamp") Date timeStamp);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table network_speed
*
* @mbggenerated Tue Sep 26 15:43:55 CST 2017
*/
int insert(NetworkSpeed record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table network_speed
*
* @mbggenerated Tue Sep 26 15:43:55 CST 2017
*/
NetworkSpeed selectByPrimaryKey(@Param("userId") String userId, @Param("timeStamp") Date timeStamp);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table network_speed
*
* @mbggenerated Tue Sep 26 15:43:55 CST 2017
*/
List<NetworkSpeed> selectAll();
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table network_speed
*
* @mbggenerated Tue Sep 26 15:43:55 CST 2017
*/
int updateByPrimaryKey(NetworkSpeed record);
List<UserAndNetworksDto> getNetworksSpeeds(NetworksSpeedCondition con);
Long getNetworksSpeedsTotal(NetworksSpeedCondition con);
} | [
"1360075452@qq.com"
] | 1360075452@qq.com |
6703feea0ed8732f3f589ca151555bbf9e8a2f67 | 40d844c1c780cf3618979626282cf59be833907f | /src/testcases/CWE369_Divide_by_Zero/s02/CWE369_Divide_by_Zero__float_zero_divide_21.java | 1f9f079646b28edd11dc3c98cadb5719e6d33526 | [] | no_license | rubengomez97/juliet | f9566de7be198921113658f904b521b6bca4d262 | 13debb7a1cc801977b9371b8cc1a313cd1de3a0e | refs/heads/master | 2023-06-02T00:37:24.532638 | 2021-06-23T17:22:22 | 2021-06-23T17:22:22 | 379,676,259 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,381 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE369_Divide_by_Zero__float_zero_divide_21.java
Label Definition File: CWE369_Divide_by_Zero__float.label.xml
Template File: sources-sinks-21.tmpl.java
*/
/*
* @description
* CWE: 369 Divide by zero
* BadSource: zero Set data to a hardcoded value of zero
* GoodSource: A hardcoded non-zero number (two)
* Sinks: divide
* GoodSink: Check for zero before dividing
* BadSink : Dividing by a value that may be zero
* Flow Variant: 21 Control flow: Flow controlled by value of a private variable. All functions contained in one file.
*
* */
package testcases.CWE369_Divide_by_Zero.s02;
import testcasesupport.*;
public class CWE369_Divide_by_Zero__float_zero_divide_21 extends AbstractTestCase
{
/* The variable below is used to drive control flow in the sink function */
private boolean badPrivate = false;
public void bad() throws Throwable
{
float data;
data = 0.0f; /* POTENTIAL FLAW: data is set to zero */
badPrivate = true;
badSink(data );
}
private void badSink(float data ) throws Throwable
{
if (badPrivate)
{
/* POTENTIAL FLAW: Possibly divide by zero */
int result = (int)(100.0 / data);
IO.writeLine(result);
}
}
/* The variables below are used to drive control flow in the sink functions. */
private boolean goodB2G1Private = false;
private boolean goodB2G2Private = false;
private boolean goodG2BPrivate = false;
public void good() throws Throwable
{
goodB2G1();
goodB2G2();
goodG2B();
}
/* goodB2G1() - use BadSource and GoodSink by setting the variable to false instead of true */
private void goodB2G1() throws Throwable
{
float data;
data = 0.0f; /* POTENTIAL FLAW: data is set to zero */
goodB2G1Private = false;
goodB2G1Sink(data );
}
private void goodB2G1Sink(float data ) throws Throwable
{
if (goodB2G1Private)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
IO.writeLine("Benign, fixed string");
}
else
{
/* FIX: Check for value of or near zero before dividing */
if (Math.abs(data) > 0.000001)
{
int result = (int)(100.0 / data);
IO.writeLine(result);
}
else
{
IO.writeLine("This would result in a divide by zero");
}
}
}
/* goodB2G2() - use BadSource and GoodSink by reversing the blocks in the if in the sink function */
private void goodB2G2() throws Throwable
{
float data;
data = 0.0f; /* POTENTIAL FLAW: data is set to zero */
goodB2G2Private = true;
goodB2G2Sink(data );
}
private void goodB2G2Sink(float data ) throws Throwable
{
if (goodB2G2Private)
{
/* FIX: Check for value of or near zero before dividing */
if (Math.abs(data) > 0.000001)
{
int result = (int)(100.0 / data);
IO.writeLine(result);
}
else
{
IO.writeLine("This would result in a divide by zero");
}
}
}
/* goodG2B() - use GoodSource and BadSink */
private void goodG2B() throws Throwable
{
float data;
/* FIX: Use a hardcoded number that won't a divide by zero */
data = 2.0f;
goodG2BPrivate = true;
goodG2BSink(data );
}
private void goodG2BSink(float data ) throws Throwable
{
if (goodG2BPrivate)
{
/* POTENTIAL FLAW: Possibly divide by zero */
int result = (int)(100.0 / data);
IO.writeLine(result);
}
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"you@example.com"
] | you@example.com |
59473cad89fdef8e0670308761bab56c12fdb7d8 | 851ae06614ae7c7c11963bf48cd3f5efc92ceea1 | /kitchenware/tableware/src/main/java/tableware/TablewareContainer.java | 8b416346bc34ad1c408dbe1fe4f8e30928c38506 | [] | no_license | musketyr/christmas-dinner | c110839f87adea70de7525a1bd331e7794288f8a | 0ebc1a6f7756610aa191bc267e740d4f07153d3f | refs/heads/master | 2023-08-05T03:22:44.162935 | 2021-09-06T09:19:09 | 2021-09-06T09:19:09 | 402,694,203 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 319 | java | package tableware;
import java.util.ServiceLoader;
import java.util.stream.StreamSupport;
public class TablewareContainer {
public static Tableware currentTableware() {
return StreamSupport.stream(ServiceLoader.load(Tableware.class).spliterator(), false).findFirst().orElse(new Tableware() { });
}
}
| [
"vladimir@orany.cz"
] | vladimir@orany.cz |
07309146028bc6eb1104bdaf36791b0f30e98060 | 7e5144632008fa1c8d4e5be76f9de83d295f5f0d | /app/src/main/java/com/likeits/sanyou/view/CircleImageView.java | 1ea921dae8044042ef8ec01f77b8396fb0012bbc | [] | no_license | sengeiou/Sanyou | ba1fa8c21152248c41f7fba641f5114bf835e1ee | 970303a9d3c14e2a46e0fd59d74534fb83c0d4b9 | refs/heads/master | 2021-09-14T04:10:10.583500 | 2018-05-08T08:22:26 | 2018-05-08T08:22:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,986 | java | package com.likeits.sanyou.view;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.util.AttributeSet;
import android.widget.ImageView;
import com.likeits.sanyou.R;
/**
* 第三方View,显示圆形图片
*
* 注意:attrs中有该自定义视图的属性
*
*
*/
public class CircleImageView extends ImageView {
private static final ScaleType SCALE_TYPE = ScaleType.CENTER_CROP;
private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888;
private static final int COLORDRAWABLE_DIMENSION = 2;
private static final int DEFAULT_BORDER_WIDTH = 0;
private static final int DEFAULT_BORDER_COLOR = Color.BLACK;
private final RectF mDrawableRect = new RectF();
private final RectF mBorderRect = new RectF();
private final Matrix mShaderMatrix = new Matrix();
private final Paint mBitmapPaint = new Paint();
private final Paint mBorderPaint = new Paint();
private int mBorderColor = DEFAULT_BORDER_COLOR;
private int mBorderWidth = DEFAULT_BORDER_WIDTH;
private Bitmap mBitmap;
private BitmapShader mBitmapShader;
private int mBitmapWidth;
private int mBitmapHeight;
private float mDrawableRadius;
private float mBorderRadius;
private ColorFilter mColorFilter;
private boolean mReady;
private boolean mSetupPending;
public CircleImageView(Context context) {
super(context);
init();
}
public CircleImageView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public CircleImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.CircleImageView, defStyle, 0);
mBorderWidth = a.getDimensionPixelSize(
R.styleable.CircleImageView_border_width, DEFAULT_BORDER_WIDTH);
mBorderColor = a.getColor(R.styleable.CircleImageView_border_color,
DEFAULT_BORDER_COLOR);
a.recycle();
init();
}
private void init() {
super.setScaleType(SCALE_TYPE);
mReady = true;
if (mSetupPending) {
setup();
mSetupPending = false;
}
}
@Override
public ScaleType getScaleType() {
return SCALE_TYPE;
}
@Override
public void setScaleType(ScaleType scaleType) {
if (scaleType != SCALE_TYPE) {
throw new IllegalArgumentException(String.format(
"ScaleType %s not supported.", scaleType));
}
}
@Override
public void setAdjustViewBounds(boolean adjustViewBounds) {
if (adjustViewBounds) {
throw new IllegalArgumentException(
"adjustViewBounds not supported.");
}
}
@Override
protected void onDraw(Canvas canvas) {
if (getDrawable() == null) {
return;
}
canvas.drawCircle(getWidth() / 2, getHeight() / 2, mDrawableRadius,
mBitmapPaint);
if (mBorderWidth != 0) {
canvas.drawCircle(getWidth() / 2, getHeight() / 2, mBorderRadius,
mBorderPaint);
}
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
setup();
}
public int getBorderColor() {
return mBorderColor;
}
public void setBorderColor(int borderColor) {
if (borderColor == mBorderColor) {
return;
}
mBorderColor = borderColor;
mBorderPaint.setColor(mBorderColor);
invalidate();
}
public int getBorderWidth() {
return mBorderWidth;
}
public void setBorderWidth(int borderWidth) {
if (borderWidth == mBorderWidth) {
return;
}
mBorderWidth = borderWidth;
setup();
}
@Override
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
mBitmap = bm;
setup();
}
@Override
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
mBitmap = getBitmapFromDrawable(drawable);
setup();
}
@Override
public void setImageResource(int resId) {
super.setImageResource(resId);
mBitmap = getBitmapFromDrawable(getDrawable());
setup();
}
@Override
public void setImageURI(Uri uri) {
super.setImageURI(uri);
mBitmap = getBitmapFromDrawable(getDrawable());
setup();
}
@Override
public void setColorFilter(ColorFilter cf) {
if (cf == mColorFilter) {
return;
}
mColorFilter = cf;
mBitmapPaint.setColorFilter(mColorFilter);
invalidate();
}
private Bitmap getBitmapFromDrawable(Drawable drawable) {
if (drawable == null) {
return null;
}
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
}
try {
Bitmap bitmap;
if (drawable instanceof ColorDrawable) {
bitmap = Bitmap.createBitmap(COLORDRAWABLE_DIMENSION,
COLORDRAWABLE_DIMENSION, BITMAP_CONFIG);
} else {
bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(),
drawable.getIntrinsicHeight(), BITMAP_CONFIG);
}
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
return bitmap;
} catch (OutOfMemoryError e) {
return null;
}
}
private void setup() {
if (!mReady) {
mSetupPending = true;
return;
}
if (mBitmap == null) {
return;
}
mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP,
Shader.TileMode.CLAMP);
mBitmapPaint.setAntiAlias(true);
mBitmapPaint.setShader(mBitmapShader);
mBorderPaint.setStyle(Paint.Style.STROKE);
mBorderPaint.setAntiAlias(true);
mBorderPaint.setColor(mBorderColor);
mBorderPaint.setStrokeWidth(mBorderWidth);
mBitmapHeight = mBitmap.getHeight();
mBitmapWidth = mBitmap.getWidth();
mBorderRect.set(0, 0, getWidth(), getHeight());
mBorderRadius = Math.min((mBorderRect.height() - mBorderWidth) / 2,
(mBorderRect.width() - mBorderWidth) / 2);
mDrawableRect.set(mBorderWidth, mBorderWidth, mBorderRect.width()
- mBorderWidth, mBorderRect.height() - mBorderWidth);
mDrawableRadius = Math.min(mDrawableRect.height() / 2,
mDrawableRect.width() / 2);
updateShaderMatrix();
invalidate();
}
private void updateShaderMatrix() {
float scale;
float dx = 0;
float dy = 0;
mShaderMatrix.set(null);
if (mBitmapWidth * mDrawableRect.height() > mDrawableRect.width()
* mBitmapHeight) {
scale = mDrawableRect.height() / (float) mBitmapHeight;
dx = (mDrawableRect.width() - mBitmapWidth * scale) * 0.5f;
} else {
scale = mDrawableRect.width() / (float) mBitmapWidth;
dy = (mDrawableRect.height() - mBitmapHeight * scale) * 0.5f;
}
mShaderMatrix.setScale(scale, scale);
mShaderMatrix.postTranslate((int) (dx + 0.5f) + mBorderWidth,
(int) (dy + 0.5f) + mBorderWidth);
mBitmapShader.setLocalMatrix(mShaderMatrix);
}
}
| [
"931317632@qq.com"
] | 931317632@qq.com |
fec1ab12a8eb0c44cdaef1306a5924539721a368 | a4a017a96ec2d5ebf75581746e99df6215afb01d | /webmagic-core/src/main/java/us/codecraft/webmagic/utils/WMCollections.java | aa1ec6f6de351e9c8bbf5f4ffae43589a2fd65c2 | [
"Apache-2.0"
] | permissive | uptonking/dataspiderman | e4595af03c117590b0ff269a0698360ebe13c7bb | 14ca0716a470c99a2ba7b0c4825dca524d70dfab | refs/heads/master | 2021-04-27T07:39:45.207452 | 2018-02-27T04:42:11 | 2018-02-27T04:42:11 | 122,637,165 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 785 | java | package us.codecraft.webmagic.utils;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* 集合工具类
*
* @author code4crafter@gmail.com
* Date: 16/12/18
* Time: 上午10:16
*/
public class WMCollections {
/**
* 创建大小为输入元素个数的HashSet
*/
public static <T> Set<T> newHashSet(T... t) {
Set<T> set = new HashSet<T>(t.length);
for (T t1 : t) {
set.add(t1);
}
return set;
}
/**
* 创建大小为输入元素个数的ArrayList
*/
public static <T> List<T> newArrayList(T... t) {
List<T> list = new ArrayList<T>(t.length);
for (T t1 : t) {
list.add(t1);
}
return list;
}
}
| [
"jinyaoo86@gmail.com"
] | jinyaoo86@gmail.com |
6f9c787ef8df7e21b0808181e8d91ddc36a19043 | a831428f29eb6dfa669450e7b43cabe8d1af51ce | /src/main/java/book1/chapter9/graphs/SimpleGraph.java | 72d34bb917e5c91750f0ac0d95780a6837695883 | [] | no_license | marcuscarvalho/datastructure | 9dd7a9f9679f790d931a41c1d7f4be9b7c0d4286 | 78fa85ef39bf0921b6682c4f9af0f0b1ccf7cb73 | refs/heads/master | 2021-01-18T02:05:24.182214 | 2015-04-16T02:50:28 | 2015-04-16T02:50:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,264 | java | package book1.chapter9.graphs;
public class SimpleGraph // a directed graph
{
Listing vertex[]; // the reference to the vertex array
int edge[][]; // reference to the adjacency matrix array
int max, numberOfVertices;
public SimpleGraph(int n) {
vertex = new Listing[n]; // allocation of the vertex array
edge = new int[n][n]; // adjacency matrix with all elements set to 0
max = n;
numberOfVertices = 0;
}
public boolean insertVertex(int vertexNumber, Listing newListing) {
if (vertexNumber >= max) // the graph is full
return false;
vertex[vertexNumber] = newListing.deepCopy();
numberOfVertices++;
return true;
}
public boolean insertEdge(int fromVertex, int toVertex) {
if (vertex[fromVertex] == null || vertex[toVertex] == null) // non-existent
// vertex
return false;
edge[fromVertex][toVertex] = 1;
return true;
}
public void showVertex(int vertexNumber) {
System.out.println(vertex[vertexNumber]);
}
public void showEdges(int vertexNumber) // edges emanating from vertexNumber
{
for (int column = 0; column < numberOfVertices; column++) {
if (edge[vertexNumber][column] == 1) // there is an edge
System.out.println(vertexNumber + "," + column);
}
}
}// end of SimpleGraph class
| [
"danielbgg@gmail.com"
] | danielbgg@gmail.com |
92f6771abd936d974245ff56390f7263403cbb0f | dba87418d2286ce141d81deb947305a0eaf9824f | /sources/p011io/reactivex/functions/Function4.java | ebd93a2b60063346c8d1015b3113ca12c1582f7b | [] | no_license | Sluckson/copyOavct | 1f73f47ce94bb08df44f2ba9f698f2e8589b5cf6 | d20597e14411e8607d1d6e93b632d0cd2e8af8cb | refs/heads/main | 2023-03-09T12:14:38.824373 | 2021-02-26T01:38:16 | 2021-02-26T01:38:16 | 341,292,450 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 293 | java | package p011io.reactivex.functions;
import p011io.reactivex.annotations.NonNull;
/* renamed from: io.reactivex.functions.Function4 */
public interface Function4<T1, T2, T3, T4, R> {
@NonNull
R apply(@NonNull T1 t1, @NonNull T2 t2, @NonNull T3 t3, @NonNull T4 t4) throws Exception;
}
| [
"lucksonsurprice94@gmail.com"
] | lucksonsurprice94@gmail.com |
6d9eadbf6ed5531359537e616fb8f82a89357fb3 | d4987a5410ab4384d85ff46a2e757525d088f2fd | /master-worker-demo/src/com/masterworker/demo/Task.java | e865360ff0636968239142d37051cd982bf26437 | [] | no_license | lyb-geek/master-worker-demo | be3640179bf506445b04ca2150670181926be600 | 2f156cf5a66819f68a4c86e7af98ca6996e2e878 | refs/heads/master | 2020-12-30T14:12:46.576864 | 2017-05-15T02:55:09 | 2017-05-15T02:55:09 | 91,289,064 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 591 | java | package com.masterworker.demo;
/**
*
* <p>
* Title:Task
* </p>
* <p>
* Description:
* </p>
* <p>
* Company:
* </p>
*
* @author linyb
* @date 2017年4月13日
*/
public class Task {
private Long id;
private String taskName;
private int price;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
}
| [
"410480180@qq.com"
] | 410480180@qq.com |
95773ce164745cdfc24d15a1637895acfd47cb64 | 5e7a6880ba132187ad977cbcc70d4416372f1924 | /src/main/java/com/dev/olivebakery/domain/dtos/board/PostDetailsResponseDto.java | 0c35e4c5358c078f64a107802f7c778a73fc5efa | [] | no_license | iyoungman/olive-bakery-api | b2b116504299289dd14f18f1a8d065496e023cc4 | c34cca5da6c46f1cc2ae5c466728d71bc5791cf4 | refs/heads/master | 2020-05-16T10:31:16.335519 | 2019-08-22T11:36:38 | 2019-08-22T11:36:38 | 182,987,769 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,891 | java | package com.dev.olivebakery.domain.dtos.board;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@Getter
@NoArgsConstructor
public class PostDetailsResponseDto {
private Long boardId;
private LocalDateTime insertTime;
private LocalDateTime updateTime;
private String title;
private String context;
private boolean isNotice;
private boolean isSecret;
private String userId;
private List<CommentListResponseDto> commentList = new ArrayList<>();
@Builder
public PostDetailsResponseDto(Long boardId, LocalDateTime insertTime, LocalDateTime updateTime, String title, String context, boolean isNotice, boolean isSecret, String userId, List<CommentListResponseDto> commentList) {
this.boardId = boardId;
this.insertTime = insertTime;
this.updateTime = updateTime;
this.title = title;
this.context = context;
this.isNotice = isNotice;
this.isSecret = isSecret;
this.userId = userId;
this.commentList = commentList;
}
public PostDetailsResponseDto convertListToDetail(PostListResponseDto postListResponseDto){
this.boardId = postListResponseDto.getBoardId();
this.insertTime = postListResponseDto.getInsertTime();
this.updateTime = postListResponseDto.getUpdateTime();
this.title = postListResponseDto.getTitle();
this.context = postListResponseDto.getContext();
this.isNotice = postListResponseDto.isNotice();
this.isSecret = postListResponseDto.isSecret();
this.userId = postListResponseDto.getUserId();
return this;
}
public PostDetailsResponseDto setCommentList(List<CommentListResponseDto> commentList){
this.commentList = commentList;
return this;
}
}
| [
"cnsth123@gmail.com"
] | cnsth123@gmail.com |
62c8b7759c4771a51885aa8c1e3739c9034a196f | ff20c88023816ca15ab8f8c5fc90f21620b0c08a | /app/src/main/java/com/kunminx/puremusic/data/usecase/DownloadUseCase.java | 59757ee279986dd24d6de04363dbe5f995b149bb | [
"Apache-2.0"
] | permissive | zuilintan/Jetpack-MVVM-Best-Practice | 59c081ba5df6f9ffc40cd69a14756836d34d867d | 96c2079ddf0844bcd4764815cdf28d3d644ca6b6 | refs/heads/master | 2022-09-17T16:39:13.809394 | 2020-06-05T10:55:03 | 2020-06-05T10:55:03 | 269,685,045 | 2 | 0 | null | 2020-06-05T15:30:20 | 2020-06-05T15:30:19 | null | UTF-8 | Java | false | false | 2,073 | java | package com.kunminx.puremusic.data.usecase;
import com.kunminx.architecture.data.usecase.UseCase;
import com.kunminx.puremusic.data.config.Configs;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
/**
* Create by KunMinX at 20/03/16
*/
public class DownloadUseCase extends UseCase<DownloadUseCase.RequestValues, DownloadUseCase.ResponseValue> {
@Override
protected void executeUseCase(RequestValues requestValues) {
try {
URL url = new URL(requestValues.url);
InputStream is = url.openStream();
File file = new File(Configs.COVER_PATH, requestValues.path);
OutputStream os = new FileOutputStream(file);
byte[] buffer = new byte[1024];
int len = 0;
while ((len = is.read(buffer)) > 0) {
os.write(buffer, 0, len);
}
is.close();
os.close();
getUseCaseCallback().onSuccess(new ResponseValue(file));
} catch (IOException e) {
e.printStackTrace();
}
}
public static final class RequestValues implements UseCase.RequestValues {
private String url;
private String path;
public RequestValues(String url, String path) {
this.url = url;
this.path = path;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
}
public static final class ResponseValue implements UseCase.ResponseValue {
private File mFile;
public ResponseValue(File file) {
mFile = file;
}
public File getFile() {
return mFile;
}
public void setFile(File file) {
mFile = file;
}
}
}
| [
"kunminx@gmail.com"
] | kunminx@gmail.com |
aa921f450100077d3c25b2a462e16924838c6406 | 6d6e93cf5cf0860f73aa3e44d0ef5b8f15c68c69 | /src/main/java/io/demo/application/config/MetricsConfiguration.java | 095182864e49957bcb242ae5ef687e83ab2cff53 | [] | no_license | sanjeev1787/jhipster-sample-application | 4f426d9670dab01aa33b311ceacc4d997346c908 | 4b7d7cf6c0a18436ccbd3c0fece84f8dc561e5dd | refs/heads/master | 2020-04-01T01:04:59.127438 | 2018-10-12T09:17:56 | 2018-10-12T09:17:56 | 152,725,531 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,743 | java | package io.demo.application.config;
import io.github.jhipster.config.JHipsterProperties;
import com.codahale.metrics.JmxReporter;
import com.codahale.metrics.JvmAttributeGaugeSet;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Slf4jReporter;
import com.codahale.metrics.health.HealthCheckRegistry;
import com.codahale.metrics.jcache.JCacheGaugeSet;
import com.codahale.metrics.jvm.*;
import com.ryantenney.metrics.spring.config.annotation.EnableMetrics;
import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter;
import com.zaxxer.hikari.HikariDataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.CacheManager;
import org.springframework.context.annotation.*;
import javax.annotation.PostConstruct;
import java.lang.management.ManagementFactory;
import java.util.concurrent.TimeUnit;
@Configuration
@EnableMetrics(proxyTargetClass = true)
public class MetricsConfiguration extends MetricsConfigurerAdapter {
private static final String PROP_METRIC_REG_JVM_MEMORY = "jvm.memory";
private static final String PROP_METRIC_REG_JVM_GARBAGE = "jvm.garbage";
private static final String PROP_METRIC_REG_JVM_THREADS = "jvm.threads";
private static final String PROP_METRIC_REG_JVM_FILES = "jvm.files";
private static final String PROP_METRIC_REG_JVM_BUFFERS = "jvm.buffers";
private static final String PROP_METRIC_REG_JVM_ATTRIBUTE_SET = "jvm.attributes";
private static final String PROP_METRIC_REG_JCACHE_STATISTICS = "jcache.statistics";
private final Logger log = LoggerFactory.getLogger(MetricsConfiguration.class);
private MetricRegistry metricRegistry = new MetricRegistry();
private HealthCheckRegistry healthCheckRegistry = new HealthCheckRegistry();
private final JHipsterProperties jHipsterProperties;
private HikariDataSource hikariDataSource;
// The cacheManager is injected here to force its initialization, so the JCacheGaugeSet
// will be correctly created below.
public MetricsConfiguration(JHipsterProperties jHipsterProperties, CacheManager cacheManager) {
this.jHipsterProperties = jHipsterProperties;
}
@Autowired(required = false)
public void setHikariDataSource(HikariDataSource hikariDataSource) {
this.hikariDataSource = hikariDataSource;
}
@Override
@Bean
public MetricRegistry getMetricRegistry() {
return metricRegistry;
}
@Override
@Bean
public HealthCheckRegistry getHealthCheckRegistry() {
return healthCheckRegistry;
}
@PostConstruct
public void init() {
log.debug("Registering JVM gauges");
metricRegistry.register(PROP_METRIC_REG_JVM_MEMORY, new MemoryUsageGaugeSet());
metricRegistry.register(PROP_METRIC_REG_JVM_GARBAGE, new GarbageCollectorMetricSet());
metricRegistry.register(PROP_METRIC_REG_JVM_THREADS, new ThreadStatesGaugeSet());
metricRegistry.register(PROP_METRIC_REG_JVM_FILES, new FileDescriptorRatioGauge());
metricRegistry.register(PROP_METRIC_REG_JVM_BUFFERS, new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()));
metricRegistry.register(PROP_METRIC_REG_JVM_ATTRIBUTE_SET, new JvmAttributeGaugeSet());
metricRegistry.register(PROP_METRIC_REG_JCACHE_STATISTICS, new JCacheGaugeSet());
if (hikariDataSource != null) {
log.debug("Monitoring the datasource");
// remove the factory created by HikariDataSourceMetricsPostProcessor until JHipster migrate to Micrometer
hikariDataSource.setMetricsTrackerFactory(null);
hikariDataSource.setMetricRegistry(metricRegistry);
}
if (jHipsterProperties.getMetrics().getJmx().isEnabled()) {
log.debug("Initializing Metrics JMX reporting");
JmxReporter jmxReporter = JmxReporter.forRegistry(metricRegistry).build();
jmxReporter.start();
}
if (jHipsterProperties.getMetrics().getLogs().isEnabled()) {
log.info("Initializing Metrics Log reporting");
Marker metricsMarker = MarkerFactory.getMarker("metrics");
final Slf4jReporter reporter = Slf4jReporter.forRegistry(metricRegistry)
.outputTo(LoggerFactory.getLogger("metrics"))
.markWith(metricsMarker)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.MILLISECONDS)
.build();
reporter.start(jHipsterProperties.getMetrics().getLogs().getReportFrequency(), TimeUnit.SECONDS);
}
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
2acaf3d8e8d3efdbf8a6a477100d093f3f5bd54e | c5e6c9fc7942572ddbdfb0c087505254d2a4ffc4 | /game7/xxkg/src/main/java/com/tumei/game/protos/star/RequestStarSelect.java | d4adca7ea92dac9800a4612fd8f77ec247143953 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | zhangwei9757/xiaocaibao | 60074b00651ae41506c4eabb2636dfaae7947d7c | 9e2ad2669af0b0453ea9149f8732953c57c2bb7e | refs/heads/master | 2020-03-25T01:26:04.975319 | 2018-10-15T09:30:17 | 2018-10-15T09:30:17 | 143,237,486 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,103 | java | package com.tumei.game.protos.star;
import com.tumei.websocket.WebSocketUser;
import com.tumei.game.GameUser;
import com.tumei.model.PackBean;
import com.tumei.model.StarBean;
import com.tumei.model.beans.StarHeroFragsBean;
import com.tumei.common.Readonly;
import com.tumei.modelconf.StarConf;
import com.tumei.common.utils.ErrCode;
import com.tumei.websocket.BaseProtocol;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import static com.tumei.common.utils.Defs.活力;
/**
* Created by Administrator on 2017/3/13 0013.
* 选择
*/
@Component
public class RequestStarSelect extends BaseProtocol {
public int seq;
/**
* 序号 [1,13], 根据返回的条目索引
*/
public int index;
/**
* 0: 6小时
* 1: 8小时
* 2: 10小时
*/
public int mode;
class ReturnStarSelect extends BaseProtocol {
public int seq;
public String result = "";
public int sp;
public List<StarHeroFragsBean> stars = new ArrayList<>();
}
@Override
public void onProcess(WebSocketUser session) {
GameUser user = (GameUser)session;
ReturnStarSelect rsi = new ReturnStarSelect();
rsi.seq = seq;
StarBean sb = user.getDao().findStar(user.getUid());
sb.updateStars(0);
List<StarHeroFragsBean> sfbs = sb.getStars();
if (sfbs.stream().filter((sfb) -> {
return sfb.status != 0;
}).count() >= 3) {
rsi.result = "已经达到点将上限";
user.send(rsi);
return;
}
StarHeroFragsBean sfb = sfbs.get(index - 1);
StarConf sc = Readonly.getInstance().findStars().get(index - 1);
PackBean pb = user.getDao().findPack(user.getUid());
int spirit = sc.cost[mode][1];
int currentSpirit = pb.flushSpirit(0);
if (currentSpirit < spirit) {
rsi.result = ErrCode.活力不足.name();
user.send(rsi);
return;
}
if (!sfb.select(mode)) {
rsi.result = ErrCode.未知参数.name();
user.send(rsi);
return;
}
//user.payItem(活力, spirit, "活力兑换");
// 修改使用活力函数
pb.flushSpirit(-spirit);
rsi.stars = sb.getStars();
rsi.sp = spirit;
user.send(rsi);
}
}
| [
"245370344@qq.com"
] | 245370344@qq.com |
f319422830d3d9e2f606068c69d02324c3567988 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/neo4j/2016/12/RaftServer.java | 715dcef6707aed712824f2c108c1eb03bdaae96c | [] | 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 | 7,617 | 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 Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.causalclustering.core.consensus;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
import io.netty.handler.codec.LengthFieldPrepender;
import java.net.BindException;
import java.util.concurrent.TimeUnit;
import org.neo4j.causalclustering.VersionDecoder;
import org.neo4j.causalclustering.VersionPrepender;
import org.neo4j.causalclustering.core.CausalClusteringSettings;
import org.neo4j.causalclustering.core.replication.ReplicatedContent;
import org.neo4j.causalclustering.handlers.ExceptionLoggingHandler;
import org.neo4j.causalclustering.handlers.ExceptionMonitoringHandler;
import org.neo4j.causalclustering.handlers.ExceptionSwallowingHandler;
import org.neo4j.causalclustering.messaging.Inbound;
import org.neo4j.helpers.ListenSocketAddress;
import org.neo4j.causalclustering.messaging.marshalling.ChannelMarshal;
import org.neo4j.causalclustering.messaging.marshalling.RaftMessageDecoder;
import org.neo4j.graphdb.config.Setting;
import org.neo4j.helpers.NamedThreadFactory;
import org.neo4j.kernel.configuration.Config;
import org.neo4j.kernel.lifecycle.LifecycleAdapter;
import org.neo4j.kernel.monitoring.Monitors;
import org.neo4j.logging.Log;
import org.neo4j.logging.LogProvider;
import static java.lang.String.format;
public class RaftServer extends LifecycleAdapter implements Inbound<RaftMessages.ClusterIdAwareMessage>
{
private static final Setting<ListenSocketAddress> setting = CausalClusteringSettings.raft_listen_address;
private final ChannelMarshal<ReplicatedContent> marshal;
private final ListenSocketAddress listenAddress;
private final LogProvider logProvider;
private final Log log;
private final Log userLog;
private final Monitors monitors;
private MessageHandler<RaftMessages.ClusterIdAwareMessage> messageHandler;
private EventLoopGroup workerGroup;
private Channel channel;
private final NamedThreadFactory threadFactory = new NamedThreadFactory( "raft-server" );
public RaftServer( ChannelMarshal<ReplicatedContent> marshal, Config config, LogProvider logProvider,
LogProvider userLogProvider, Monitors monitors )
{
this.marshal = marshal;
this.listenAddress = config.get( setting );
this.logProvider = logProvider;
this.log = logProvider.getLog( getClass() );
this.userLog = userLogProvider.getLog( getClass() );
this.monitors = monitors;
}
@Override
public synchronized void start() throws Throwable
{
startNettyServer();
}
@Override
public synchronized void stop() throws Throwable
{
log.info( "RaftServer stopping and unbinding from " + listenAddress );
try
{
channel.close().sync();
}
catch ( InterruptedException e )
{
Thread.currentThread().interrupt();
log.warn( "Interrupted while closing channel." );
}
if ( workerGroup.shutdownGracefully( 2, 5, TimeUnit.SECONDS ).awaitUninterruptibly( 10, TimeUnit.SECONDS ) )
{
log.warn( "Worker group not shutdown within 10 seconds." );
}
}
private void startNettyServer()
{
workerGroup = new NioEventLoopGroup( 0, threadFactory );
log.info( "Starting server at: " + listenAddress );
ServerBootstrap bootstrap = new ServerBootstrap()
.group( workerGroup )
.channel( NioServerSocketChannel.class )
.option( ChannelOption.SO_REUSEADDR, true )
.localAddress( listenAddress.socketAddress() )
.childHandler( new ChannelInitializer<SocketChannel>()
{
@Override
protected void initChannel( SocketChannel ch ) throws Exception
{
ChannelPipeline pipeline = ch.pipeline();
pipeline.addLast( new LengthFieldBasedFrameDecoder( Integer.MAX_VALUE, 0, 4, 0, 4 ) );
pipeline.addLast( new LengthFieldPrepender( 4 ) );
pipeline.addLast( new VersionDecoder( logProvider ) );
pipeline.addLast( new VersionPrepender() );
pipeline.addLast( new RaftMessageDecoder( marshal ) );
pipeline.addLast( new RaftMessageHandler() );
pipeline.addLast( new ExceptionLoggingHandler( log ) );
pipeline.addLast( new ExceptionMonitoringHandler(
monitors.newMonitor( ExceptionMonitoringHandler.Monitor.class, RaftServer.class ) ) );
pipeline.addLast( new ExceptionSwallowingHandler() );
}
} );
try
{
channel = bootstrap.bind().syncUninterruptibly().channel();
}
catch ( Exception e )
{
// thanks to netty we need to catch everything and do an instanceof because it does not declare properly
// checked exception but it still throws them with some black magic at runtime.
//noinspection ConstantConditions
if ( e instanceof BindException )
{
userLog.error( "Address is already bound for setting: " + setting + " with value: " + listenAddress );
log.error( "Address is already bound for setting: " + setting + " with value: " + listenAddress, e );
throw e;
}
}
}
@Override
public void registerHandler( Inbound.MessageHandler<RaftMessages.ClusterIdAwareMessage> handler )
{
this.messageHandler = handler;
}
private class RaftMessageHandler extends SimpleChannelInboundHandler<RaftMessages.ClusterIdAwareMessage>
{
@Override
protected void channelRead0( ChannelHandlerContext channelHandlerContext,
RaftMessages.ClusterIdAwareMessage clusterIdAwareMessage ) throws Exception
{
try
{
messageHandler.handle( clusterIdAwareMessage );
}
catch ( Exception e )
{
log.error( format( "Failed to process message %s", clusterIdAwareMessage ), e );
}
}
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
5433512218e025df5a1b9326e88cde21d85dfd99 | 8e7dd9aa1735d962ffc39c9f4cdfba2cba7c409f | /loser-cache/src/main/java/com/loserico/cache/factory/JedisClusterPoolFactory.java | c557150e4f9446f92e58e659b08c7174531ebb69 | [
"MIT"
] | permissive | JiaBaoChen/awesome-loser | 7987c5196744469cb032a5d972bd841b7bba926a | 03ad1dfcda5a0d0e37025455a4bb3616c3182174 | refs/heads/master | 2023-05-17T04:14:02.501743 | 2021-06-11T00:54:54 | 2021-06-11T00:54:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,742 | java | package com.loserico.cache.factory;
import com.loserico.cache.config.RedisProperties;
import com.loserico.common.lang.resource.PropertyReader;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisCluster;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.util.Pool;
import java.util.Set;
import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toSet;
/**
* <p>
* Copyright: (C), 2019/10/23 18:02
* <p>
* <p>
* Company: Sexy Uncle Inc.
*
* @author Rico Yu ricoyu520@gmail.com
* @version 1.0
*/
public class JedisClusterPoolFactory implements PoolFactory {
@Override
public JedisCluster createCluster(PropertyReader propertyReader) {
String clusters = propertyReader.getString(JedisPoolFactories.CLUSTERS);
Set<HostAndPort> nodes = asList(clusters.split(","))
.stream()
.map((hostPort) -> {
String[] hostAndPort = hostPort.split(":");
return new HostAndPort(hostAndPort[0].trim(), Integer.parseInt(hostAndPort[1].trim()));
}).collect(toSet());
JedisPoolConfig poolConfig = config(propertyReader);
String password = propertyReader.getString("redis.password");
// 默认50秒连接超时
int connectionTimeout = propertyReader.getInt("redis.connectionTimeout", 50000);
//执行redis命令默认1秒超时
int socketTimeout = propertyReader.getInt("redis.socketTimeout", 1000);
//出现异常最大重试次数
int maxAttempts = propertyReader.getInt("redis.cluster.maxAttempts", 3);
return new JedisCluster(nodes, connectionTimeout, socketTimeout, maxAttempts, password, poolConfig);
}
@Override
public Pool<Jedis> createPool(RedisProperties redisProperties) {
return null;
}
}
| [
"ricoyu520@gmail.com"
] | ricoyu520@gmail.com |
f37b5e60abb9f5290101f19dcdfc83d712bf05d9 | 0adcb787c2d7b3bbf81f066526b49653f9c8db40 | /src/main/java/com/alipay/api/domain/AlipayUserAgreementExecutionplanModifyModel.java | a2641ebf355f2ae92640c0dbc7519ca44a3ea93b | [
"Apache-2.0"
] | permissive | yikey/alipay-sdk-java-all | 1cdca570c1184778c6f3cad16fe0bcb6e02d2484 | 91d84898512c5a4b29c707b0d8d0cd972610b79b | refs/heads/master | 2020-05-22T13:40:11.064476 | 2019-04-11T14:11:02 | 2019-04-11T14:11:02 | 186,365,665 | 1 | 0 | null | 2019-05-13T07:16:09 | 2019-05-13T07:16:08 | null | UTF-8 | Java | false | false | 1,166 | java | package com.alipay.api.domain;
import java.util.Date;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 周期性扣款协议执行计划修改接口
*
* @author auto create
* @since 1.0, 2019-04-03 19:38:59
*/
public class AlipayUserAgreementExecutionplanModifyModel extends AlipayObject {
private static final long serialVersionUID = 3195688277344852682L;
/**
* 周期性扣款产品,授权免密支付协议号
*/
@ApiField("agreement_no")
private String agreementNo;
/**
* 商户下一次扣款时间
*/
@ApiField("deduct_time")
private Date deductTime;
/**
* 具体修改原因
*/
@ApiField("memo")
private String memo;
public String getAgreementNo() {
return this.agreementNo;
}
public void setAgreementNo(String agreementNo) {
this.agreementNo = agreementNo;
}
public Date getDeductTime() {
return this.deductTime;
}
public void setDeductTime(Date deductTime) {
this.deductTime = deductTime;
}
public String getMemo() {
return this.memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
112116a03346650912fa2212c34744979f1619d1 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Lang/56/org/apache/commons/lang/text/StrBuilder_write_2349.java | ed5d0b1e0cd88a086695d3237108dcf2164c9efa | [] | 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 | 3,442 | java |
org apach common lang text
build string constitu part provid flexibl power api
string buffer stringbuff
main differ string buffer stringbuff string builder stringbuild
subclass direct access charact arrai
addit method
append separ appendwithsepar add arrai valu separ
append pad appendpad add length pad charact
append fix length appendfixedlength add fix width field builder
char arrai tochararrai char getchar simpler wai rang charact arrai
delet delet string
replac search replac string
left string leftstr string rightstr mid string midstr substr except
builder string
size clear empti isempti collect style api method
view
token astoken intern buffer sourc str token strtoken
reader asread intern buffer sourc reader
writer aswrit writer write directli intern buffer
aim provid api mimic close string buffer stringbuff
addit method note edg case
invalid indic input alter individu method
biggest output text
'null' control properti link set null text setnulltext string
author stephen colebourn
version
str builder strbuilder
inherit doc inheritdoc
write cbuf len
str builder strbuilder append cbuf len
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
ac23e20775492ad9e009a4acc8d4d755c13e8e13 | 1998595c1dc1d02a141b4f1aa7ebb790d3deba72 | /Lab07/src/main/java/open/feign/lab07/Lab07Application.java | 8c45fa3c141898352826bc39c9c1c7838817ca18 | [] | no_license | lileskinder/Software-Architecture-Design | a8e080f52b8ea498239806041219e6cdeddca5be | 66bb009abc936312e24333274ce228a5dc9ef39b | refs/heads/master | 2023-07-03T15:53:39.713843 | 2021-08-15T10:09:16 | 2021-08-15T10:09:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 390 | java | package open.feign.lab07;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableFeignClients
public class Lab07Application {
public static void main(String[] args) {
SpringApplication.run(Lab07Application.class, args);
}
}
| [
"kidusmamuye@gmail.com"
] | kidusmamuye@gmail.com |
a7292281775088bd8fb17928576558bbfae8dfb4 | f41bdbc59cb6f1f48d6520a93f517fd44f83f153 | /net/minecraft/block/BlockSnowBlock.java | 2907e5a6d59cf1e4a9dfbd018c3c7c4dd06711e3 | [
"MIT"
] | permissive | BantorSchwanzVor/plotscanner-leak | f9ec02b2538fe51af94cfc807c7beb3ef158f106 | cbf130076159711d939affb4b0343c46c3466107 | refs/heads/master | 2021-05-20T12:02:47.993998 | 2020-04-01T21:23:59 | 2020-04-01T21:23:59 | 252,285,321 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,220 | java | package net.minecraft.block;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
public class BlockSnowBlock extends Block {
protected BlockSnowBlock() {
super(Material.CRAFTED_SNOW);
setTickRandomly(true);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
}
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return Items.SNOWBALL;
}
public int quantityDropped(Random random) {
return 4;
}
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
if (worldIn.getLightFor(EnumSkyBlock.BLOCK, pos) > 11) {
dropBlockAsItem(worldIn, pos, worldIn.getBlockState(pos), 0);
worldIn.setBlockToAir(pos);
}
}
}
/* Location: C:\Users\BSV\AppData\Local\Temp\Rar$DRa6216.20396\Preview\Preview.jar!\net\minecraft\block\BlockSnowBlock.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/ | [
"germangamera@gmail.com"
] | germangamera@gmail.com |
338544631e2abe7b85b2227a04ef8c5eb9780dd1 | 6e0cb681fb76f9e53722d9bd27e69a76d38dd7ea | /mp-fanout-comsumer/src/main/java/com/ls/comsumer/MpFanoutComsumerApplication.java | 794946fa4c60abe29f0d76a0fb319b7f6a726b37 | [] | no_license | liusCoding/springboot-rabbitmq | 738ca47d246f900ca335542ceec0dd0f1aa68f29 | 2893d3fe14505eaa326181c63b728d78f3a80e10 | refs/heads/master | 2020-07-23T07:10:30.295689 | 2019-09-12T06:26:13 | 2019-09-12T06:26:13 | 207,481,555 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package com.ls.comsumer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MpFanoutComsumerApplication {
public static void main(String[] args) {
SpringApplication.run(MpFanoutComsumerApplication.class, args);
}
}
| [
"14786469221@163.com"
] | 14786469221@163.com |
6e4494b4c63f1e4fa98bcb450578fc40ae4b2a29 | 421f0a75a6b62c5af62f89595be61f406328113b | /generated_tests/model_seeding/15_beanbin-net.sourceforge.beanbin.reflect.resolve.GetImplementations-1.0-10/net/sourceforge/beanbin/reflect/resolve/GetImplementations_ESTest_scaffolding.java | 623aa7a589d02b909062edc5c6007c3b85e71501 | [] | no_license | tigerqiu712/evosuite-model-seeding-empirical-evaluation | c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6 | 11a920b8213d9855082d3946233731c843baf7bc | refs/heads/master | 2020-12-23T21:04:12.152289 | 2019-10-30T08:02:29 | 2019-10-30T08:02:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 564 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sat Oct 26 01:37:57 GMT 2019
*/
package net.sourceforge.beanbin.reflect.resolve;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class GetImplementations_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pderakhshanfar@bsr01.win.tue.nl"
] | pderakhshanfar@bsr01.win.tue.nl |
179c8919254945b600e608b1ed45b599dc5857bd | 012e9bd5bfbc5ceca4e36af55a7ddf4fce98b403 | /code/app/src/main/java/com/yzb/card/king/ui/travel/adapter/TrafficAdapter.java | 28bb49680135ebf45afea4cf6249c3ba711119c4 | [] | no_license | litliang/ms | a7152567c2f0e4d663efdda39503642edd33b4b6 | d7483bc76d43e060906c47acc1bc2c3179838249 | refs/heads/master | 2021-09-01T23:51:50.934321 | 2017-12-29T07:30:49 | 2017-12-29T07:30:49 | 115,697,248 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,154 | java | package com.yzb.card.king.ui.travel.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.yzb.card.king.R;
import com.yzb.card.king.bean.travel.TravelLineBean;
import com.yzb.card.king.ui.base.BaseRecyAdapter;
import com.yzb.card.king.util.CommonUtil;
import java.util.List;
/**
* 功能:交通工具
*
* @author:gengqiyun
* @date: 2016/11/19
*/
public class TrafficAdapter extends BaseRecyAdapter<TravelLineBean.Traffic>
{
public TrafficAdapter(Context context)
{
super(context);
}
public TrafficAdapter(List<TravelLineBean.Traffic> trafficBeans, Context context)
{
super(trafficBeans, context);
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
{
View itemView = inflater.inflate(R.layout.item_travel_detail_traffic, parent, false);
TrafficViewHolder trafficViewHolder = new TrafficViewHolder(itemView);
return trafficViewHolder;
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position)
{
TrafficViewHolder viewHolder = (TrafficViewHolder) holder;
final TravelLineBean.Traffic trafficBean = mList.get(position);
viewHolder.tvTrafficType.setText(trafficBean.getTrafficName());
viewHolder.tvTrafficTime.setText(CommonUtil.formatMmToHh(trafficBean.getTrafficLength()));
viewHolder.veticalDivider.setVisibility(position == mList.size() - 1 ? View.GONE : View.VISIBLE);
}
class TrafficViewHolder extends RecyclerView.ViewHolder
{
public TextView tvTrafficType;
public TextView tvTrafficTime;
public View veticalDivider;
public TrafficViewHolder(View itemView)
{
super(itemView);
tvTrafficType = (TextView) itemView.findViewById(R.id.tvTrafficType);
tvTrafficTime = (TextView) itemView.findViewById(R.id.tvTrafficTime);
veticalDivider = itemView.findViewById(R.id.veticalDivider);
}
}
}
| [
"864631546@qq.com"
] | 864631546@qq.com |
64b8b767700731d581051649665085b3c07093a9 | 1d89f07e856611623df943f5f0dee6d2185fb7c4 | /app/src/main/java/com/app/goldenhealth/model/TimKiemLoc.java | 2f3ffee6f14c1e60068d4cec5e2919910492bf95 | [] | no_license | namtv1997/golde | 5d67ea096a465f62ea2ed081ab3b3fea693b8532 | 05cc930568c812b4ee7821da8b155f10d29bcd4d | refs/heads/master | 2020-11-30T18:52:01.067064 | 2019-12-27T14:30:11 | 2019-12-27T14:30:11 | 230,457,807 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 702 | java | package com.app.goldenhealth.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class TimKiemLoc {
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("name")
@Expose
private String name;
private boolean isCheck;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isCheck() {
return isCheck;
}
public void setCheck(boolean check) {
isCheck = check;
}
}
| [
"nam.ta.intern@ntq-solution.com.vn"
] | nam.ta.intern@ntq-solution.com.vn |
ef53a3ccef568c685ca8be882742cbad38555c46 | ee4200e20d475c46846abc1d2cf764dcdb1f8f2b | /src/main/java/org/apache/ibatis/scripting/LanguageDriverRegistry.java | 7422b5f246ad752cc2c5d844c9a66cfc9797cdc2 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | yylstudy/mybatis-3.5.0-sourcescode | 8ba9a09b7897ce90f2a03867101b7b65a4b55bb8 | bb0ec45e4be31fc33a0e0c3ef151809a5fe401bd | refs/heads/master | 2022-10-12T04:37:33.036096 | 2020-12-21T04:53:14 | 2020-12-21T04:53:14 | 143,408,367 | 0 | 0 | Apache-2.0 | 2022-09-08T00:07:43 | 2018-08-03T09:34:12 | Java | UTF-8 | Java | false | false | 2,444 | java | /**
* Copyright ${license.git.copyrightYears} the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.scripting;
import java.util.HashMap;
import java.util.Map;
/**
* @author Frank D. Martinez [mnesarco]
*/
public class LanguageDriverRegistry {
/**语言驱动类和其实例的集合,一般有
* XMLLanguageDriver
* RawLanguageDriver
*/
private final Map<Class<? extends LanguageDriver>, LanguageDriver> LANGUAGE_DRIVER_MAP = new HashMap<>();
/**默认的语言驱动类 XMLLanguageDriver*/
private Class<? extends LanguageDriver> defaultDriverClass;
public void register(Class<? extends LanguageDriver> cls) {
if (cls == null) {
throw new IllegalArgumentException("null is not a valid Language Driver");
}
if (!LANGUAGE_DRIVER_MAP.containsKey(cls)) {
try {
LANGUAGE_DRIVER_MAP.put(cls, cls.newInstance());
} catch (Exception ex) {
throw new ScriptingException("Failed to load language driver for " + cls.getName(), ex);
}
}
}
public void register(LanguageDriver instance) {
if (instance == null) {
throw new IllegalArgumentException("null is not a valid Language Driver");
}
Class<? extends LanguageDriver> cls = instance.getClass();
if (!LANGUAGE_DRIVER_MAP.containsKey(cls)) {
LANGUAGE_DRIVER_MAP.put(cls, instance);
}
}
public LanguageDriver getDriver(Class<? extends LanguageDriver> cls) {
return LANGUAGE_DRIVER_MAP.get(cls);
}
public LanguageDriver getDefaultDriver() {
return getDriver(getDefaultDriverClass());
}
public Class<? extends LanguageDriver> getDefaultDriverClass() {
return defaultDriverClass;
}
public void setDefaultDriverClass(Class<? extends LanguageDriver> defaultDriverClass) {
register(defaultDriverClass);
this.defaultDriverClass = defaultDriverClass;
}
}
| [
"1594818954@qq.com"
] | 1594818954@qq.com |
eff0f1b0fef62eb22e556637e562231236d9a3e5 | 32fd0a92293e1f28c3acc0d66f82f9e74b37d357 | /app/src/main/java/com/music/data/source/PreferenceManager.java | e25cff7c6c1a5520ef8a5294a6b186bf0168af08 | [] | no_license | Clyr/TestList | bba28d62ffb50420b171a73f524f9680b6977b62 | 3af631927075dea14dcdfef04c82bcf19f7f6e08 | refs/heads/master | 2021-07-10T13:03:19.494218 | 2020-08-18T12:13:12 | 2020-08-18T12:13:12 | 185,518,920 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,050 | java | package com.music.data.source;
import android.content.Context;
import android.content.SharedPreferences;
import com.music.player.PlayMode;
/**
* Created with Android Studio.
* User: ryan.hoo.j@gmail.com
* Date: 9/10/16
* Time: 11:05 PM
* Desc: PreferenceManager
*/
public class PreferenceManager {
private static final String PREFS_NAME = "config.xml";
/**
* For deciding whether to add the default folders(SDCard/Download/Music),
* if it's being deleted manually by users, then they should not be auto-recreated.
* {@link #isFirstQueryFolders(Context)}, {@link #reportFirstQueryFolders(Context)}
*/
private static final String KEY_FOLDERS_FIRST_QUERY = "firstQueryFolders";
/**
* Play mode from the last time.
*/
private static final String KEY_PLAY_MODE = "playMode";
private static SharedPreferences preferences(Context context) {
return context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
}
private static SharedPreferences.Editor edit(Context context) {
return preferences(context).edit();
}
/**
* {@link #KEY_FOLDERS_FIRST_QUERY}
*/
public static boolean isFirstQueryFolders(Context context) {
return preferences(context).getBoolean(KEY_FOLDERS_FIRST_QUERY, true);
}
/**
* {@link #KEY_FOLDERS_FIRST_QUERY}
*/
public static void reportFirstQueryFolders(Context context) {
edit(context).putBoolean(KEY_FOLDERS_FIRST_QUERY, false).commit();
}
/**
* {@link #KEY_PLAY_MODE}
*/
public static PlayMode lastPlayMode(Context context) {
String playModeName = preferences(context).getString(KEY_PLAY_MODE, null);
if (playModeName != null) {
return PlayMode.valueOf(playModeName);
}
return PlayMode.getDefault();
}
/**
* {@link #KEY_PLAY_MODE}
*/
public static void setPlayMode(Context context, PlayMode playMode) {
edit(context).putString(KEY_PLAY_MODE, playMode.name()).commit();
}
}
| [
"fxsinb2@163.com"
] | fxsinb2@163.com |
40bfe6f5007473403c52ca15eeb38b0c26a0d729 | f3d1de810644d5e5c58fa7fc0ca8e1c1c52af1ff | /hermes5/src/test/java/ch/admin/isb/hermes5/business/modelimport/TranslationMergeTest.java | f9794d6977701da8296d5e4e5009fadb008dc912 | [
"Apache-2.0"
] | permissive | mc-b/websolution | 22b3970f426c15ba55390bc431c4a24ac8c7f2c0 | ca96126bf9b5fd9c363fdbbccd89d10667f3f703 | refs/heads/master | 2020-06-15T07:18:59.248830 | 2014-08-27T13:35:07 | 2014-08-27T13:35:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,620 | java | /*----------------------------------------------------------------------------------------------
* Copyright 2014 Federal IT Steering Unit FITSU 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.admin.isb.hermes5.business.modelimport;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import org.junit.Before;
import org.junit.Test;
import ch.admin.isb.hermes5.business.modelrepository.ModelRepository;
import ch.admin.isb.hermes5.business.translation.TranslationRepository;
import ch.admin.isb.hermes5.domain.EPFModel;
import ch.admin.isb.hermes5.domain.Status;
import ch.admin.isb.hermes5.domain.TranslateableText;
public class TranslationMergeTest {
private static final String MODEL_IDENTIFIER = "modelIdentifier";
private TranslationMerge translationMerge;
@Before
public void setUp() throws Exception {
translationMerge = new TranslationMerge();
translationMerge.modelRepository = mock(ModelRepository.class);
translationMerge.translationRepository = mock(TranslationRepository.class);
EPFModel model = new EPFModel();
model.setIdentifier(MODEL_IDENTIFIER);
when(translationMerge.modelRepository.getPublishedModel()).thenReturn(model);
}
@Test
public void testMergeWithPublishedDeUnchangedFrAvailable() {
translationMerge.init();
helperFr(Status.FREIGEGEBEN, "textFr", "textFr", "textDe");
}
@Test
public void testMergeWithPublishedDeChangedFrAvailable() {
translationMerge.init();
helperFr(Status.UNVOLLSTAENDIG, "textFr", "textFr", "textDe1");
}
@Test
public void testMergeWithPublishedDeChangedFrNotAvailable() {
translationMerge.init();
helperFr(Status.UNVOLLSTAENDIG, null, null, "textDe1");
}
@Test
public void testMergeWithPublishedDeUnchangedFrNotAvailable() {
translationMerge.init();
helperFr(Status.UNVOLLSTAENDIG, null, null, "textDe");
}
private void helperFr(Status status, String expected, String publishedTextFr, String publishedTextFrTextDe) {
TranslateableText publishedTranslateableText = new TranslateableText(MODEL_IDENTIFIER, "elementType",
"rootElementIdentifier", "fileType", "fileName", "elementIdentifier", "textIdentifier", publishedTextFrTextDe);
publishedTranslateableText.setTextFr(publishedTextFr);
publishedTranslateableText.setStatusFr(publishedTextFr != null ? Status.FREIGEGEBEN: Status.UNVOLLSTAENDIG);
when(translationMerge.translationRepository.getTranslateableText(MODEL_IDENTIFIER, "elementIdentifier", "textIdentifier")).thenReturn(publishedTranslateableText);
TranslateableText translateableText = new TranslateableText(MODEL_IDENTIFIER, "elementType",
"rootElementIdentifier", "fileType", "fileName", "elementIdentifier", "textIdentifier", "textDe");
TranslateableText mergeWithPublished = translationMerge.mergeWithPublished(translateableText);
assertEquals(status, mergeWithPublished.getStatusFr());
assertEquals(expected, mergeWithPublished.getTextFr());
}
@Test
public void testMergeWithPublishedDeUnchangedItAvailable() {
translationMerge.init();
helperIt(Status.FREIGEGEBEN, "textIt", "textIt", "textDe");
}
@Test
public void testMergeWithPublishedDeChangedItAvailable() {
translationMerge.init();
helperIt(Status.UNVOLLSTAENDIG, "textIt", "textIt", "textDe1");
}
@Test
public void testMergeWithPublishedDeChangedItNotAvailable() {
translationMerge.init();
helperIt(Status.UNVOLLSTAENDIG, null, null, "textDe1");
}
@Test
public void testMergeWithPublishedDeUnchangedItNotAvailable() {
translationMerge.init();
helperIt(Status.UNVOLLSTAENDIG, null, null, "textDe");
}
private void helperIt(Status status, String expected, String publishedTextIt, String publishedTextItTextDe) {
TranslateableText publishedTranslateableText = new TranslateableText(MODEL_IDENTIFIER, "elementType",
"rootElementIdentifier", "fileType", "fileName", "elementIdentifier", "textIdentifier", publishedTextItTextDe);
publishedTranslateableText.setTextIt(publishedTextIt);
publishedTranslateableText.setStatusIt(publishedTextIt != null ? Status.FREIGEGEBEN: Status.UNVOLLSTAENDIG);
when(translationMerge.translationRepository.getTranslateableText(MODEL_IDENTIFIER, "elementIdentifier", "textIdentifier")).thenReturn(publishedTranslateableText);
TranslateableText translateableText = new TranslateableText(MODEL_IDENTIFIER, "elementType",
"rootElementIdentifier", "fileType", "fileName", "elementIdentifier", "textIdentifier", "textDe");
TranslateableText mergeWithPublished = translationMerge.mergeWithPublished(translateableText);
assertEquals(status, mergeWithPublished.getStatusIt());
assertEquals(expected, mergeWithPublished.getTextIt());
}
@Test
public void testMergeWEnhPublishedDeUnchangedEnAvailable() {
translationMerge.init();
helperEn(Status.FREIGEGEBEN, "textEn", "textEn", "textDe");
}
@Test
public void testMergeWEnhPublishedDeChangedEnAvailable() {
translationMerge.init();
helperEn(Status.UNVOLLSTAENDIG, "textEn", "textEn", "textDe1");
}
@Test
public void testMergeWEnhPublishedDeChangedEnNotAvailable() {
translationMerge.init();
helperEn(Status.UNVOLLSTAENDIG, null, null, "textDe1");
}
@Test
public void testMergeWEnhPublishedDeUnchangedEnNotAvailable() {
translationMerge.init();
helperEn(Status.UNVOLLSTAENDIG, null, null, "textDe");
}
private void helperEn(Status status, String expected, String publishedTextEn, String publishedTextEnTextDe) {
TranslateableText publishedTranslateableText = new TranslateableText(MODEL_IDENTIFIER, "elementType",
"rootElementIdentifier", "fileType", "fileName", "elementIdentifier", "textIdentifier", publishedTextEnTextDe);
publishedTranslateableText.setTextEn(publishedTextEn);
publishedTranslateableText.setStatusEn(publishedTextEn != null ? Status.FREIGEGEBEN: Status.UNVOLLSTAENDIG);
when(translationMerge.translationRepository.getTranslateableText(MODEL_IDENTIFIER, "elementIdentifier", "textIdentifier")).thenReturn(publishedTranslateableText);
TranslateableText translateableText = new TranslateableText(MODEL_IDENTIFIER, "elementType",
"rootElementIdentifier", "fileType", "fileName", "elementIdentifier", "textIdentifier", "textDe");
TranslateableText mergeWEnhPublished = translationMerge.mergeWithPublished(translateableText);
assertEquals(status, mergeWEnhPublished.getStatusEn());
assertEquals(expected, mergeWEnhPublished.getTextEn());
}
}
| [
"marcel.bernet@ch-open.ch"
] | marcel.bernet@ch-open.ch |
756de40a12f4a537497f4e59d38e62dc8f3b353d | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithoutLambdasApi21_ReducedClassCount/applicationModule/src/main/java/applicationModulepackageJava8/Foo366.java | be23aa277b815ab5171441501a4f3863d0697e21 | [] | no_license | NikitaKozlov/generated-project-for-desugaring | 0bc1443ab3ddc84cd289331c726761585766aea7 | 81506b3711004185070ca4bb9a93482b70011d36 | refs/heads/master | 2020-03-20T00:35:06.996525 | 2018-06-12T09:30:37 | 2018-06-12T09:30:37 | 137,049,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 506 | java | package applicationModulepackageJava8;
public class Foo366 {
public void foo0() {
new applicationModulepackageJava8.Foo365().foo9();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
public void foo6() {
foo5();
}
public void foo7() {
foo6();
}
public void foo8() {
foo7();
}
public void foo9() {
foo8();
}
}
| [
"nikita.e.kozlov@gmail.com"
] | nikita.e.kozlov@gmail.com |
9bb337e5a61eabc19b4de776f9743a3fcb5b2f8d | 08798b2882b5876a6630076477f5718d2ecc6116 | /kronos-core-cloud/src/main/java/com/arrow/kronos/repo/SoftwareReleaseScheduleRepositoryExtensionImpl.java | eded019c40f8951e5d3837a647a9537c889f068b | [
"Apache-2.0"
] | permissive | konexios/moonstone | 8c5d4dc035c586204bc996582f0f176b50e64919 | 47f7b874e68833e19314dd9bc5fdf1755a82a42f | refs/heads/master | 2023-01-20T18:41:36.646922 | 2019-11-12T20:44:59 | 2019-11-12T20:44:59 | 195,619,626 | 4 | 1 | Apache-2.0 | 2023-01-12T11:50:07 | 2019-07-07T06:50:12 | Java | UTF-8 | Java | false | false | 6,957 | java | package com.arrow.kronos.repo;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.core.query.Criteria;
import com.arrow.kronos.data.SoftwareReleaseSchedule;
import com.arrow.pegasus.repo.DistinctCountResult;
import com.arrow.pegasus.repo.RepositoryExtensionAbstract;
public class SoftwareReleaseScheduleRepositoryExtensionImpl extends RepositoryExtensionAbstract<SoftwareReleaseSchedule>
implements SoftwareReleaseScheduleRepositoryExtension {
public SoftwareReleaseScheduleRepositoryExtensionImpl() {
super(SoftwareReleaseSchedule.class);
}
@Override
public Page<SoftwareReleaseSchedule> findSoftwareReleaseSchedules(Pageable pageable,
SoftwareReleaseScheduleSearchParams params) {
String method = "findSoftwareReleaseSchedules";
logInfo(method, "...");
return doProcessQuery(pageable, buildCriteria(params));
}
@Override
public List<SoftwareReleaseSchedule> findSoftwareReleaseSchedules(SoftwareReleaseScheduleSearchParams params) {
String method = "findSoftwareReleaseSchedules";
logInfo(method, "...");
return doProcessQuery(buildCriteria(params));
}
@Override
public long findSoftwareReleaseScheduleCount(SoftwareReleaseScheduleSearchParams params) {
String method = "findSoftwareReleaseScheduleCount";
logDebug(method, "...");
return doCount(doProcessCriteria(buildCriteria(params)));
}
@Override
public Page<SoftwareReleaseSchedule> findSoftwareReleaseSchedules(Pageable pageable,
SoftwareReleaseScheduleStatusSearchParams params) {
String method = "findSoftwareReleaseSchedules";
logInfo(method, "...");
return doProcessQuery(pageable, buildPendingCriteria(params));
}
@Override
public List<SoftwareReleaseSchedule> findSoftwareReleaseSchedulesByObjectIds(String... objectIds) {
String method = "findSoftwareReleaseSchedulesByObjectIds";
logInfo(method, "...");
return doProcessQuery(buildCriteria(objectIds));
}
public List<DistinctCountResult> countDistinctCreatedBy(SoftwareReleaseScheduleSearchParams params) {
String method = "countDistinctCreatedBy";
logInfo(method, "...");
List<DistinctCountResult> result = doDistinctCount(SoftwareReleaseSchedule.COLLECTION_NAME,
buildCriteria(params), "createdBy");
for (DistinctCountResult item : result) {
logDebug(method, "---> name: %s, count: %d", item.getName(), item.getCount());
}
return result;
}
public List<DistinctCountResult> countDistinctDeviceTypeId(SoftwareReleaseScheduleSearchParams params) {
String method = "countDistinctDeviceTypeId";
logInfo(method, "...");
List<DistinctCountResult> result = doDistinctCount(SoftwareReleaseSchedule.COLLECTION_NAME,
buildCriteria(params), "deviceTypeId");
logInfo(method, "result: %d", result.size());
for (DistinctCountResult item : result) {
logDebug(method, "---> name: %s, count: %d", item.getName(), item.getCount());
}
return result;
}
public List<DistinctCountResult> countDistinctStatus(SoftwareReleaseScheduleSearchParams params) {
String method = "countDistinctDeviceTypeId";
logInfo(method, "...");
List<DistinctCountResult> result = doDistinctCount(SoftwareReleaseSchedule.COLLECTION_NAME,
buildCriteria(params), "status");
for (DistinctCountResult item : result) {
logDebug(method, "---> name: %s, count: %d", item.getName(), item.getCount());
}
return result;
}
private List<Criteria> buildCriteria(String... objectIds) {
return Collections.singletonList(Criteria.where("objectIds").in((Object[]) objectIds));
}
private List<Criteria> buildCriteria(SoftwareReleaseScheduleSearchParams params) {
List<Criteria> criteria = new ArrayList<>();
if (params != null) {
criteria = addCriteria(criteria, "_id", params.getIds());
criteria = addCriteria(criteria, "scheduledDate", params.getFromScheduledDate(),
params.getToScheduledDate());
criteria = addCriteria(criteria, "applicationId", params.getApplicationIds());
criteria = addCriteria(criteria, "softwareReleaseId", params.getSoftwareReleaseIds());
criteria = addCriteria(criteria, "deviceCategory", params.getDeviceCategories());
criteria = addCriteria(criteria, "objectIds", params.getObjectIds());
criteria = addCriteria(criteria, "status", params.getStatuses());
criteria = addCriteria(criteria, "notifyOnStart", params.getNotifyOnStart());
criteria = addCriteria(criteria, "notifyOnEnd", params.getNotifyOnEnd());
criteria = addCriteria(criteria, "notifyOnSubmit", params.getNotifyOnSubmit());
criteria = addCriteria(criteria, "onDemand", params.getOnDemand());
if (!StringUtils.isEmpty(params.getName())) {
criteria.add(Criteria.where("name").regex(params.getName(), "i"));
}
criteria = addCriteria(criteria, "deviceTypeId", params.getDeviceTypeIds());
criteria = addCriteria(criteria, "hardwareVersionId", params.getHardwareVersionIds());
}
return criteria;
}
private List<Criteria> buildPendingCriteria(SoftwareReleaseScheduleStatusSearchParams params) {
List<Criteria> criteria = new ArrayList<>();
if (params != null) {
if (params.getOnDemand()) {
criteria = addCriteria(criteria, "onDemand", params.getOnDemand());
} else {
criteria = addCriteria(criteria, "scheduledDate", params.getScheduledDate(), null);
}
criteria = addCriteria(criteria, "applicationId", params.getApplicationIds());
criteria = addCriteria(criteria, "objectIds", params.getObjectIds());
if (params.getRequestorIds() != null && !params.getRequestorIds().isEmpty()) {
Criteria[] orCriteria = params.getRequestorIds().stream()
.map(id -> Criteria.where("createdBy").regex(id, "i")).toArray(Criteria[]::new);
criteria.add(new Criteria().orOperator(orCriteria));
}
criteria = addCriteria(criteria, "hid", params.getHids());
criteria = addCriteria(criteria, "ended", params.getCompletedDate(), null);
criteria = addCriteria(criteria, "deviceTypeId", params.getDeviceTypeIds());
if (params.getCompletedStatuses() != null && params.getCompletedStatuses().size() != 0) {
Criteria c1 = null, c2 = null;
if (params.getCompletedStatuses().contains("Cancelled")) {
Criteria cancelled = Criteria.where("status").is(SoftwareReleaseSchedule.Status.CANCELLED);
c1 = cancelled;
}
if (params.getCompletedStatuses().contains("Complete")) {
Criteria complete = Criteria.where("status").is(SoftwareReleaseSchedule.Status.COMPLETE);
if (c1 != null) {
c2 = complete;
} else {
c1 = complete;
}
}
if (c1 != null && c2 != null) {
criteria.add(new Criteria().orOperator(c1, c2));
} else {
criteria.add(c1);
}
} else {
criteria = addCriteria(criteria, "status", params.getStatuses());
}
}
return criteria;
}
}
| [
"tam.nguyen1@arrow.com"
] | tam.nguyen1@arrow.com |
a806026eb38314e7d5020d776a2151501f4af266 | c961d4f98d6012b55e406e297e472a4bbcbd7c66 | /core/src/test/java/mblog/data/test/AuthMenuDaoTest.java | 010008a1483c8a26a6040f136508fa389d0e7775 | [
"Apache-2.0"
] | permissive | 527088995/mblog | 60226fa5a18e7ae867d34c0de7a126316a179dc2 | e1702c326faea3f5fc2125256cd321ccecfd4c18 | refs/heads/master | 2023-08-03T10:48:21.538218 | 2020-02-22T08:01:44 | 2020-02-22T08:01:44 | 160,331,307 | 3 | 0 | Apache-2.0 | 2023-07-25T14:00:09 | 2018-12-04T09:22:07 | TSQL | UTF-8 | Java | false | false | 509 | java | //package mblog.data.test;
//
//import java.util.List;
//
//import org.junit.Test;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import mblog.core.persist.dao.AuthMenuDao;
//import mblog.core.persist.entity.AuthMenu;
//
//public class AuthMenuDaoTest extends SpringTransactionalContextTests{
//
// @Autowired
// private AuthMenuDao authMenuDao;
//
// @Test
// public void testFindByParentId(){
// List<AuthMenu> list = authMenuDao.findAll();
// System.out.println(list);
// }
//
//}
| [
"527088995@qq.com"
] | 527088995@qq.com |
a2374aedc25355891e8587c6e19ee1caaa96755b | 6d60a8adbfdc498a28f3e3fef70366581aa0c5fd | /codebase/dataset/t1/813_frag2.java | 28177510ab29b1c037bc1b6239a561716f423e9d | [] | no_license | rayhan-ferdous/code2vec | 14268adaf9022d140a47a88129634398cd23cf8f | c8ca68a7a1053d0d09087b14d4c79a189ac0cf00 | refs/heads/master | 2022-03-09T08:40:18.035781 | 2022-02-27T23:57:44 | 2022-02-27T23:57:44 | 140,347,552 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,319 | java | out.write('\n');
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write('\n');
| [
"aaponcseku@gmail.com"
] | aaponcseku@gmail.com |
cd0e1dbc17f33ebf98872acadfe62bd5e8682442 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/4/4_b261a94707646de23b8bc84a730f8a7449c1f21e/RasterTextLabel/4_b261a94707646de23b8bc84a730f8a7449c1f21e_RasterTextLabel_s.java | 705eb42fdffd784332dd6a10bfecaea5e61edae8 | [] | 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,914 | java | /*****************************************************************************
* J3D.org Copyright (c) 2000
* Java Source
*
* This source is licensed under the GNU LGPL v2.1
* Please read http://www.gnu.org/copyleft/lgpl.html for more information
*
****************************************************************************/
package org.j3d.geom;
// Standard imports
import javax.media.j3d.*;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import javax.vecmath.Point3f;
// Application specific imports
/**
* A text label for labelling objects on screen that uses a Java 3D Raster
* to produce the overlay effect.
* <p>
*
* If the label text is null, then no label will be displayed. All of the
* setup will be done, but no raster will be created.
* <p>
*
* The current implementation does not allow updating the text or colors
*
* @author Justin Couch, based on work from Corysia Taware
* @version $Revision: 1.1 $
*/
public class RasterTextLabel extends Shape3D
{
/** The inset between the text and the border if one is required. */
private static final int BORDER_INSETS = 2;
/** The current color of the text */
private Color textColor;
/** The current color of the border. Null if not in use */
private Color borderColor;
/** The font of the label. Null if using system default */
private Font labelFont;
/**
* Create a new blank label with no text. It is located at the origin.
*/
public RasterTextLabel()
{
this(null, null, 0, 0, 0, null, null);
}
/**
* Create a new blank label with the given text located at the origin.
* If the text color is not specified, white is used.
*
* @param label The string to use on the label
* @param col The text color to be drawn in
*/
public RasterTextLabel(String label, Color col)
{
this(label, col, 0, 0, 0, null, null);
}
/**
* Create a new blank label with the given text located at a specific
* point in 3D world coordinates.
*
* @param label The string to use on the label
* @param col The text color to be drawn in
* @param x The x world coordinate to place the label
* @param y The y world coordinate to place the label
* @param z The z world coordinate to place the label
*/
public RasterTextLabel(String label, Color col, float x, float y, float z)
{
this(label, col, x, y, z, null, null);
}
/**
* Create a new blank label with the given text located at a specific
* point in 3D world coordinates and an option to show a border and
* selected font. If the border color is specified, it will show a 1
* pixel wide border in that color. If no font is defined, the system
* default font will be used.
*
* @param label The string to use on the label
* @param col The text color to be drawn in
* @param x The x world coordinate to place the label
* @param y The y world coordinate to place the label
* @param z The z world coordinate to place the label
* @param border The color to use for the border or null for none
* @param font The font to draw the string in or null for default
*/
public RasterTextLabel(String label,
Color col,
float x,
float y,
float z,
Color border,
Font font)
{
textColor = col;
borderColor = border;
labelFont = font;
Appearance app = new Appearance();
RenderingAttributes ra = new RenderingAttributes();
ra.setDepthBufferEnable(false);
ra.setDepthBufferWriteEnable(false);
app.setRenderingAttributes(ra);
TransparencyAttributes ta =
new TransparencyAttributes(TransparencyAttributes.FASTEST, 1.0f);
app.setTransparencyAttributes(ta);
setAppearance(app);
if(label == null)
return;
// create a disposable 1x1 image so that we can fetch the font
// metrics associated with the font and text label. This will allow
// us to determine the real image size. This is kludgy, but I can't
// think of a better way of doing it!
BufferedImage tmp_img =
new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
Graphics graphics = tmp_img.getGraphics();
FontMetrics fm;
if(font == null)
fm = graphics.getFontMetrics();
else
fm = graphics.getFontMetrics(font);
// now we have the metrics, let's work out how big the label is!
Rectangle2D dimensions = fm.getStringBounds(label, graphics);
graphics.dispose();
tmp_img.flush();
int width = (int)dimensions.getWidth();
int height = (int)dimensions.getHeight();
int ascent = fm.getMaxAscent();
if(border != null)
{
width += BORDER_INSETS * 2 + 2;
height += BORDER_INSETS * 2 + 2;
}
tmp_img = new BufferedImage(width,
height,
BufferedImage.TYPE_INT_ARGB);
graphics = tmp_img.getGraphics();
if(border != null)
{
graphics.setColor(borderColor);
graphics.drawRect(0, 0, width - 1, height - 1);
if(textColor == null)
graphics.setColor(Color.white);
else
graphics.setColor(textColor);
graphics.drawString(label,
BORDER_INSETS + 1,
ascent + BORDER_INSETS + 1);
}
else
{
if(textColor == null)
graphics.setColor(Color.white);
else
graphics.setColor(textColor);
graphics.drawString(label, 0, ascent);
}
graphics.dispose();
ImageComponent2D img_comp =
new ImageComponent2D(ImageComponent2D.FORMAT_RGBA, tmp_img);
Point3f origin = new Point3f(x, y, z);
Raster raster = new Raster(origin,
Raster.RASTER_COLOR,
0,
0,
width,
height,
img_comp,
null);
setGeometry(raster);
}
/**
* Set the label string that is to be rendered. This maintains the
* current text color.
*
* @param label to be used
*/
public void setLabel(String label)
{
}
/**
* Set the label string that is to be rendered and changes the color
* to the new value.
*
* @param label to be used
* @param col The new color to be used or null for the default
*/
public void setLabel(String label, Color col)
{
}
/**
* Set the condition of whether the implementation should resize the
* canvas after each new label is set or just stick to a fixed size
* canvas. A fixed size label is useful when you are making fast updates
* such as a counter. When this is called, the label will not be resized
* from it's current dimensions.
*
* @param fixed true if the label size should remain fixed
*/
public void fixSize(boolean fixed)
{
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
bedd9be3552399267390558d853c82c128c86c8c | 6148c05cb07f772bf3d46ed83087a4da0964d79f | /app/src/main/java/cn/appoa/afdemo/widget/UpgradeLayout03.java | a49bd917f72782b66bd71e4a17299515495fb4ca | [] | no_license | lijiazhen1201/AfDemo | c19a12aec465874552f43351fe784c61926ed5b6 | 6c59fbb850413d8a6527fa9d814a93a421f00a1d | refs/heads/master | 2021-07-11T12:11:52.192994 | 2020-07-27T06:28:56 | 2020-07-27T06:28:56 | 161,132,778 | 10 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,109 | java | package cn.appoa.afdemo.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
public class UpgradeLayout03 extends RelativeLayout {
public UpgradeLayout03(Context context) {
super(context);
}
public UpgradeLayout03(Context context, AttributeSet attrs) {
super(context, attrs);
}
public UpgradeLayout03(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@SuppressWarnings("unused")
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
setMeasuredDimension(getDefaultSize(0, widthMeasureSpec), getDefaultSize(0, heightMeasureSpec));
int childWidthSize = getMeasuredWidth();
int childHeightSize = getMeasuredHeight();
widthMeasureSpec = MeasureSpec.makeMeasureSpec(childWidthSize, MeasureSpec.EXACTLY);
heightMeasureSpec = MeasureSpec.makeMeasureSpec(childWidthSize * 1128 / 1086, MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
| [
"949393653@qq.com"
] | 949393653@qq.com |
9e2abab03bafb423d138915eb729565c576e46ae | 5eae683a6df0c4b97ab1ebcd4724a4bf062c1889 | /bin/platform/bootstrap/gensrc/de/hybris/platform/permissionsfacades/data/PermissionsData.java | 8624e8a6c670462751ace484ea8e3be61eb777fd | [] | no_license | sujanrimal/GiftCardProject | 1c5e8fe494e5c59cca58bbc76a755b1b0c0333bb | e0398eec9f4ec436d20764898a0255f32aac3d0c | refs/heads/master | 2020-12-11T18:05:17.413472 | 2020-01-17T18:23:44 | 2020-01-17T18:23:44 | 233,911,127 | 0 | 0 | null | 2020-06-18T15:26:11 | 2020-01-14T18:44:18 | null | UTF-8 | Java | false | false | 1,606 | java | /*
* ----------------------------------------------------------------
* --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN!
* --- Generated at Jan 17, 2020 11:49:29 AM
* ----------------------------------------------------------------
*
* [y] hybris Platform
*
* Copyright (c) 2018 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.permissionsfacades.data;
import java.io.Serializable;
import java.util.Map;
public class PermissionsData implements Serializable
{
/** Default serialVersionUID value. */
private static final long serialVersionUID = 1L;
/** <i>Generated property</i> for <code>PermissionsData.id</code> property defined at extension <code>permissionsfacades</code>. */
private String id;
/** <i>Generated property</i> for <code>PermissionsData.permissions</code> property defined at extension <code>permissionsfacades</code>. */
private Map<String, String> permissions;
public PermissionsData()
{
// default constructor
}
public void setId(final String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setPermissions(final Map<String, String> permissions)
{
this.permissions = permissions;
}
public Map<String, String> getPermissions()
{
return permissions;
}
}
| [
"travis.d.crawford@accenture.com"
] | travis.d.crawford@accenture.com |
9c9dc235239a9ac0a3cb7d4ac86b0e1caa55d604 | 7b73756ba240202ea92f8f0c5c51c8343c0efa5f | /classes/com/tencent/mobileqq/activity/aio/tips/TipsConstants$EventType.java | 2d00bdb5ccbb377a9220031ea781893916f2f794 | [] | no_license | meeidol-luo/qooq | 588a4ca6d8ad579b28dec66ec8084399fb0991ef | e723920ac555e99d5325b1d4024552383713c28d | refs/heads/master | 2020-03-27T03:16:06.616300 | 2016-10-08T07:33:58 | 2016-10-08T07:33:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 412 | java | package com.tencent.mobileqq.activity.aio.tips;
public abstract interface TipsConstants$EventType
{
public static final int a = 1000;
public static final int b = 1001;
public static final int c = 1002;
}
/* Location: E:\apk\QQ_91\classes-dex2jar.jar!\com\tencent\mobileqq\activity\aio\tips\TipsConstants$EventType.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"1776098770@qq.com"
] | 1776098770@qq.com |
b94c3927d7608f0c7672b21c01a530f2a540f3cd | 3f243b5911044af035c9421c4f12d92e3b92fb9d | /MyTestDemo/module/refreshview/src/main/java/com/handmark/pulltorefresh/library/PullToRefreshScrollView.java | f08269a478da822ddbc9e46bc1bb0f7e9016eb2c | [] | no_license | sea2/mytest | c1743769cc9bf290e301a14029c8f99bcd6319ed | ad924919e58a2265cc026575c11cf432c4bf6094 | refs/heads/master | 2021-05-23T04:59:03.407805 | 2020-05-14T03:37:29 | 2020-05-14T03:37:29 | 81,179,971 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,653 | java | package com.handmark.pulltorefresh.library;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;
/**
* 封装了ScrollView的下拉刷新
*
* @author Li Hong
* @since 2013-8-22
*/
public class PullToRefreshScrollView extends PullToRefreshBase<ScrollView> {
/**
* 构造方法
*
* @param context context
*/
public PullToRefreshScrollView(Context context) {
this(context, null);
}
/**
* 构造方法
*
* @param context context
* @param attrs attrs
*/
public PullToRefreshScrollView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
/**
* 构造方法
*
* @param context context
* @param attrs attrs
* @param defStyle defStyle
*/
public PullToRefreshScrollView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
/**
*/
@Override
protected ScrollView createRefreshableView(Context context, AttributeSet attrs) {
ScrollView scrollView = new ScrollView(context);
return scrollView;
}
/**
*/
@Override
protected boolean isReadyForPullDown() {
return mRefreshableView.getScrollY() == 0;
}
/**
*/
@Override
protected boolean isReadyForPullUp() {
View scrollViewChild = mRefreshableView.getChildAt(0);
if (null != scrollViewChild) {
return mRefreshableView.getScrollY() >= (scrollViewChild.getHeight() - getHeight());
}
return false;
}
}
| [
"497661292@qq.com"
] | 497661292@qq.com |
69998ebac61252bd192731bf416329dfb091c665 | 47119d527d55e9adcb08a3a5834afe9a82dd2254 | /dbclient/src/main/java/com/emc/storageos/db/client/model/Initiator.java | f8242b0ca76fc8d3fe41a04a325b8b97215f0a71 | [] | no_license | chrisdail/coprhd-controller | 1c3ddf91bb840c66e4ece3d4b336a6df421b43e4 | 38a063c5620135a49013aae5e078aeb6534a5480 | refs/heads/master | 2020-12-03T10:42:22.520837 | 2015-06-08T15:24:36 | 2015-06-08T15:24:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,551 | java | /**
* Copyright 2015 EMC Corporation
* All Rights Reserved
*/
/**
* Copyright (c) 2012 EMC Corporation
* All Rights Reserved
*
* This software contains the intellectual property of EMC Corporation
* or is licensed to EMC Corporation from third parties. Use of this
* software and the intellectual property contained therein is expressly
* limited to the terms and conditions of the License Agreement under which
* it is provided by or on behalf of EMC.
*/
package com.emc.storageos.db.client.model;
import com.emc.storageos.db.client.util.EndpointUtility;
import com.emc.storageos.db.client.util.WWNUtility;
/**
* SCSI initiator in either a Fiber Channel or iSCSI SAN.
*/
@Cf("Initiator")
public class Initiator extends HostInterface {
private String _port;
private String _node;
// to do - This is temporary until initiator service is remove
private String _hostName;
// to do - This is temporary until initiator service is remove
private String _clusterName;
/**
* Default Constructor. This is the constructor used by the API.
*/
public Initiator() {
setIsManualCreation(true);
}
/**
* Constructor.
*
* @param protocol The initiator port protocol.
* @param port The initiator port identifier.
* @param node The initiator node identifier.
* @param hostName The FQDN of the initiator host.
* @param isManualCreation the flag that indicates if the initiator is user or system created
*/
public Initiator(String protocol, String port, String node, String hostName, boolean isManualCreation) {
super(null, protocol);
setInitiatorPort(port);
setInitiatorNode(node == null ? "" : node);
setHostName(hostName == null ? "" : hostName);
setIsManualCreation(isManualCreation);
}
/**
* Constructor supports setting of optional cluster name.
*
* @param protocol The initiator port protocol.
* @param port The initiator port identifier.
* @param node The initiator node identifier.
* @param hostName The FQDN of the initiator host.
* @param clusterName The FQDN of the cluster.
* @param isManualCreation the flag that indicates if the initiator is user or system created
*/
public Initiator(String protocol, String port, String node, String hostName,
String clusterName, boolean isManualCreation) {
super(null, protocol);
setInitiatorPort(port);
setInitiatorNode(node == null ? "" : node);
setHostName(hostName == null ? "" : hostName);
setClusterName(clusterName == null ? "" : clusterName);
setIsManualCreation(isManualCreation);
}
/**
* Getter for the initiator port identifier. For FC, this is the port WWN.
* For iSCSI, this is port name in IQN or EUI format.
*
* @return The initiator port identifier.
*/
@Name("iniport")
@AlternateId("InitiatorPortIndex")
public String getInitiatorPort() {
return _port;
}
/**
* Setter for the initiator port identifier.
*
* @param port The initiator port identifier.
*/
public void setInitiatorPort(String port) {
_port = EndpointUtility.changeCase(port);
setChanged("iniport");
}
/**
* Getter for the initiator node identifier. For FC, this is the node WWN.
* For iSCSI, this field is optional.
*
* @return The initiator node identifier.
*/
@Name("ininode")
public String getInitiatorNode() {
return _node;
}
/**
* Setter for the initiator node identifier.
*
* @param node The initiator node identifier.
*/
public void setInitiatorNode(String node) {
_node = EndpointUtility.changeCase(node);
setChanged("ininode");
}
/**
* Getter for the FQDN of the initiator host.
* to do - This is temporary until initiator service is remove
* @return The FQDN of the initiator host.
*/
@AlternateId("AltIdIndex")
@Name("hostname")
public String getHostName() {
return _hostName;
}
/**
* Setter for the FQDN of the initiator host.
* to do - This is temporary until initiator service is remove
*
* @param hostName The FQDN of the initiator host.
*/
public void setHostName(String hostName) {
_hostName = hostName;
setChanged("hostname");
}
/**
* Getter for the FQDN of the initiator cluster.
* to do - This is temporary until initiator service is remove
* @return The FQDN of the initiator cluster or null if not applicable.
*/
@Name("clustername")
public String getClusterName() {
return _clusterName;
}
/**
* Setter for the FQDN of the initiator cluster.
* to do - This is temporary until initiator service is remove
* @param clusterName The FQDN of the initiator cluster.
*/
public void setClusterName(String clusterName) {
_clusterName = clusterName;
setChanged("clustername");
}
@Override
public final String toString() {
return String.format(
"Initiator(Protocol:%s, Node:%s, Port:%s, Host Name: %s, Cluster Name: %s)",
getProtocol(), getInitiatorNode(), getInitiatorPort(), getHostName(),
getClusterName());
}
static public String normalizePort(String port) {
String normalizedPort = port;
if (WWNUtility.isValidWWN(port)) {
normalizedPort = WWNUtility.getUpperWWNWithNoColons(port);
}
return normalizedPort;
}
static public String toPortNetworkId(String port) {
String portNetworkId = port;
if (port.startsWith("iqn")) {
// iSCSI port may have some other values after the port name (e.g.,
// iqn.1992-04.com.emc:cx.apm00121500018.b9,t,0x0001).
// Exclude the extraneous parts to arrive at
// iqn.1992-04.com.emc:cx.apm00121500018.b9
int firstComma = port.indexOf(',');
if (firstComma != -1) {
portNetworkId = port.substring(0, firstComma);
}
} else if (!WWNUtility.isValidWWN(port)) {
portNetworkId = WWNUtility.getWWNWithColons(port);
}
return portNetworkId;
}
@Override
public Object[] auditParameters() {
return new Object[] {getInitiatorPort(), getInitiatorNode(),
getHost(), getId()};
}
}
| [
"review-coprhd@coprhd.org"
] | review-coprhd@coprhd.org |
6556af3def721a2d99415616c8f5e2e22a08592a | e33641e38393833b179b793d590749a97272e818 | /app/src/main/java/dong/lan/smarttrip/base/BaseFragment.java | f424e4fb24908282f5a6e11a0357a05b5ba8341e | [] | no_license | donlan/SmartTrip | 2a9daf6ee81da102c0160ba78b8225bb496d3d1f | 7f53b364cb9746f17f3c1e37b54d39304e40264c | refs/heads/master | 2021-01-24T11:08:35.299952 | 2017-07-15T06:49:32 | 2017-07-15T06:50:06 | 70,250,343 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,687 | java | package dong.lan.smarttrip.base;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.Toast;
import com.tencent.qcloud.ui.Dialog;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/**
* Created by 梁桂栋 on 17-1-18 : 下午9:52.
* Email: 760625325@qq.com
* GitHub: github.com/donlan
* description: SmartTrip
*/
public class BaseFragment extends Fragment implements BaseView,DelayInitView {
protected final static String KEY_TITTLE = "tittle";
protected boolean isStart;
protected View content;
private Unbinder unbinder;
private Dialog dialog;
public void dialog(String text) {
if (dialog == null) {
dialog = new Dialog(getContext());
}
dialog.setMessageText(text).show();
}
@Override
public void show(String text) {
if (getView() != null)
Snackbar.make(getView(), text, Snackbar.LENGTH_SHORT).show();
else
Toast.makeText(getContext(), text, Toast.LENGTH_SHORT).show();
}
@Override
public void toast(String text) {
Toast.makeText(getContext(), text, Toast.LENGTH_SHORT).show();
}
public void bindView(View view) {
unbinder = ButterKnife.bind(this, view);
}
@Override
public void onDestroy() {
super.onDestroy();
content = null;
if (unbinder != null)
unbinder.unbind();
unbinder = null;
if (dialog != null)
dialog.destroy();
dialog = null;
}
@Override
public void start(Object data) {
isStart = true;
}
}
| [
"760625325@qq.com"
] | 760625325@qq.com |
0f2eb991695c0d989ec372050b298288acb8ab92 | 43eb759f66530923dfe1c6e191ec4f350c097bd9 | /projects/checkstyle/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/equalshashcode/InputEqualsHashCode.java | 308cfbf690c75388cce8710a4608728b7de44c6d | [
"MIT",
"Apache-2.0",
"LGPL-2.1-only"
] | 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 | 723 | java | package com.puppycrawl.tools.checkstyle.checks.coding.equalshashcode;
public class InputEqualsHashCode {
public boolean notEquals() {
return true;
}
public boolean equals() {
return false;
}
public boolean equals(Object o1) {
return false;
}
private boolean equals(Object o1, Object o2) {
return false;
}
private boolean equals(String s) {
return false;
}
protected int notHashCode() {
return 1;
}
public int hashCode() {
return 1;
}
public int hashCode(Object o1) {
return 1;
}
private int hashCode(Object o1, Object o2) {
return 1;
}
}
| [
"granogiovanni90@gmail.com"
] | granogiovanni90@gmail.com |
49ff5c1e1d38332eaacccb0fadca771317edb6c5 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_8720d0d708ecb88a6425761c9d540c979c926270/TokenPanelTreeCellRenderer/5_8720d0d708ecb88a6425761c9d540c979c926270_TokenPanelTreeCellRenderer_t.java | 8d7af524f85723c9231a6546902a572f738cc71b | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,810 | java | package net.rptools.maptool.client.ui.tokenpanel;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Transparency;
import java.awt.image.BufferedImage;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JTree;
import javax.swing.tree.DefaultTreeCellRenderer;
import net.rptools.lib.swing.SwingUtil;
import net.rptools.maptool.client.MapTool;
import net.rptools.maptool.model.AssetManager;
import net.rptools.maptool.model.Token;
import net.rptools.maptool.util.ImageManager;
public class TokenPanelTreeCellRenderer extends DefaultTreeCellRenderer {
private BufferedImage image;
private int row;
private Object rowValue;
private TokenPanelTreeModel model;
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row,
boolean hasFocus) {
setBorder(null);
model = (TokenPanelTreeModel) tree.getModel();
String text = null;
this.row = row;
rowValue = value;
if (value instanceof Token) {
Token token = (Token) value;
int height = getPreferredSize().height != 0 ? getPreferredSize().height : 15;
if (image == null || image.getHeight() != height) {
image = new BufferedImage(height, height, Transparency.TRANSLUCENT);
}
// Make a thumbnail of the image
// TODO: This could be cached somehow, right now it's quick enough though
BufferedImage tokenImage = ImageManager.getImage(AssetManager.getAsset(token.getAssetID()), this);
Dimension dim = new Dimension(tokenImage.getWidth(), tokenImage.getHeight());
SwingUtil.constrainTo(dim, height);
Graphics g = image.getGraphics();
// TODO: Center the image
g.drawImage(tokenImage, 0, 0, dim.width, dim.height, this);
g.dispose();
text = token.getName();
}
if (value instanceof TokenPanelTreeModel.View) {
TokenPanelTreeModel.View view = (TokenPanelTreeModel.View)value ;
text = view.getDisplayName();
// Is this the active layer
if (MapTool.getFrame().getCurrentZoneRenderer() != null && view.getLayer() == MapTool.getFrame().getCurrentZoneRenderer().getActiveLayer()) {
hasFocus = false;
sel = false;
}
}
super.getTreeCellRendererComponent(tree, text, sel, expanded, leaf, row, hasFocus);
return this;
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
// Highlight the current layer (view)
if (rowValue instanceof TokenPanelTreeModel.View) {
TokenPanelTreeModel.View view = (TokenPanelTreeModel.View)rowValue ;
// Is this the active layer
if (MapTool.getFrame().getCurrentZoneRenderer() != null && view.getLayer() == MapTool.getFrame().getCurrentZoneRenderer().getActiveLayer()) {
Dimension size = getSize();
g.setColor(Color.gray);
g.drawRect(0, 0, size.width-1, size.height-1);
}
}
}
@Override
public Dimension getPreferredSize() {
int height = row > 0 ? getFontMetrics(getFont()).getHeight() + 4 : 0;
return new Dimension(100, height);
}
@Override
public Icon getLeafIcon() {
return new ImageIcon(image);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
af71da39a8ea7dc47f8b6323587008ea890843e0 | 6a0d4cb96d741105254f94d485cab2e0a0f24fd2 | /core/src/test/java/com/expert_soft/service/impl/CartServiceImplIntTest.java | e9c708b27342f4cb2f868a4558fe76156be7af05 | [] | no_license | Redchush/com.expert_soft.PhoneShop | 6b196c5b802bc7d700bc4855d70c57b69c0f1cb7 | 5877e5b829bd1fbb09ae841495bad8165faeb24c | refs/heads/master | 2021-01-13T03:09:15.650145 | 2017-02-16T10:23:12 | 2017-02-16T10:23:12 | 77,405,827 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,681 | java | package com.expert_soft.service.impl;
import com.expert_soft.model.order.Cart;
import com.expert_soft.model.order.OrderItem;
import com.expert_soft.test_util.Context;
import com.expert_soft.test_util.DataBuilder;
import com.expert_soft.test_util.db.DbInfo;
import org.apache.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import javax.sql.DataSource;
import java.math.BigDecimal;
import static com.expert_soft.test_util.asserts.ModelAsserts._assertEquals;
import static org.hamcrest.Matchers.lessThan;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={Context.ROOT_WITH_CART})
@TestExecutionListeners({
DependencyInjectionTestExecutionListener.class,
})
@ActiveProfiles("test")
public class CartServiceImplIntTest {
private static final Logger logger = Logger.getLogger(CartServiceImplTest.class);
@Autowired private CartServiceImpl service;
@Autowired private DataSource source;
private DbInfo rowCounter;
private Cart actual;
@Before
public void setUp() throws Exception {
rowCounter = new DbInfo(new JdbcTemplate(source));
service.setCart(new Cart());
actual = service.getCart();
}
@Test
public void addToCart_CalculatorMerge(){
OrderItem first = DataBuilder.Order_2.getItem_1();
OrderItem second = DataBuilder.Order_2.getItem_2();
Cart expected = DataBuilder.Carts.byOrder_2();
service.addToCart(first.getPhone(), first.getQuantity());
service.addToCart(second.getPhone(), second.getQuantity());
assertEquals("Fail to calculate new quantity", 2, actual.getOrderItems().size());
assertEquals("Fail to calculate new subtotal", expected.getSubtotal(), actual.getSubtotal());
}
@Test
public void deleteFromCart_CalculatorMerge(){
Cart expected = DataBuilder.Carts.byOrder_1();
Cart actual = DataBuilder.Carts.byOrder_2();
service.setCart(actual);
OrderItem second = DataBuilder.Order_2.getItem_2();
BigDecimal prevSubtotal = actual.getSubtotal();
OrderItem itemDeleted = service.deleteFromCart(second.getPhone().getKey());
BigDecimal currentSubtotal = actual.getSubtotal();
assertEquals("Returned incorrect item", second, itemDeleted);
assertThat("Subtotal after deleted item not lessen",
currentSubtotal, lessThan(prevSubtotal));
assertEquals("Subtotal incorrect. Try test OrderCalculator",
expected.getSubtotal(), actual.getSubtotal());
_assertEquals(expected, actual);
}
@Test
public void deleteFromCart_Last_CalculatorMerge(){
Cart actual = DataBuilder.Carts.byOrder_1();
service.setCart(actual);
OrderItem item = DataBuilder.Order_1.getItem_1_new();
service.deleteFromCart(item.getPhone().getKey());
assertEquals(actual.getSubtotal(), new BigDecimal("0.00"));
}
@Test(expected = NullPointerException.class)
public void addToCart_NonExistentPhone() throws Exception {
service.addToCart(100L, 3);
}
}
| [
"redchush@gmail.com"
] | redchush@gmail.com |
3610c35a943ddbb1c4802cbf90bede2003c22b72 | bd42db461465fe3bede4a1eea0b2f80e0bba2a22 | /core/src/main/java/com/huaweicloud/sdk/core/HttpListener.java | d314a673da73704533b04ed733b39b90b1e2e08a | [
"Apache-2.0"
] | permissive | Lance52259/huaweicloud-sdk-java-v3 | ce762482c715453bd6ff58f7ab4735062787d2f0 | 7ab09629dff1bbc73c23f701d0b29af5d43dfd73 | refs/heads/master | 2023-02-07T06:16:33.086234 | 2020-12-31T09:43:51 | 2020-12-31T09:43:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,124 | java | /*
* Copyright 2020 Huawei Technologies Co.,Ltd.
*
* 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 com.huaweicloud.sdk.core;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
public interface HttpListener {
interface RequestListener {
String httpMethod();
String uri();
Map<String, List<String>> headers();
Optional<String> body();
}
interface ResponseListener {
String httpMethod();
String uri();
Map<String, List<String>> headers();
Optional<String> body();
int statusCode();
}
default void preRequest(RequestListener requestListener) {
}
default void postResponse(ResponseListener responseListener) {
}
static HttpListener forRequestListener(Consumer<RequestListener> func) {
return new HttpListener() {
@Override
public void preRequest(RequestListener requestListener) {
func.accept(requestListener);
}
};
}
static HttpListener forResponseListener(Consumer<ResponseListener> func) {
return new HttpListener() {
@Override
public void postResponse(ResponseListener requestListener) {
func.accept(requestListener);
}
};
}
}
| [
"hwcloudsdk@huawei.com"
] | hwcloudsdk@huawei.com |
68bfbc4ed24111767864e31f96b7f6c401098ffa | 635a46bfe01cf64d3c9b0040a3462fb32e337d8d | /alerting/command/src/main/java/org/apache/karaf/decanter/alerting/command/RemoveAlert.java | 01113f94a97c49c696fcd2f1bff2e496dd18da1b | [
"Apache-2.0",
"BSD-3-Clause",
"EPL-1.0",
"MIT"
] | permissive | YotpoLtd/karaf-decanter | 8d574cb16e2fa41be27bb9eaad5d40294fa03e17 | 87309abda62ac716ccc695a4ddf648ca0294289b | refs/heads/master | 2023-03-31T03:35:00.641558 | 2020-02-15T07:57:46 | 2020-02-15T07:57:46 | 243,440,171 | 0 | 0 | Apache-2.0 | 2023-03-21T17:45:42 | 2020-02-27T05:39:02 | null | UTF-8 | Java | false | false | 2,063 | 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.karaf.decanter.alerting.command;
import org.apache.karaf.decanter.alerting.checker.AlertStore;
import org.apache.karaf.decanter.alerting.command.completers.AlertCompleter;
import org.apache.karaf.decanter.alerting.command.completers.LevelCompleter;
import org.apache.karaf.shell.api.action.Action;
import org.apache.karaf.shell.api.action.Argument;
import org.apache.karaf.shell.api.action.Command;
import org.apache.karaf.shell.api.action.Completion;
import org.apache.karaf.shell.api.action.lifecycle.Reference;
import org.apache.karaf.shell.api.action.lifecycle.Service;
@Service
@Command(scope = "decanter", name = "alert-remove", description = "Remove an alert")
public class RemoveAlert implements Action {
@Reference
private AlertStore store;
@Argument(index = 0, name = "level", description = "Alert level", required = true, multiValued = false)
@Completion(LevelCompleter.class)
String level;
@Argument(index = 1, name = "name", description = "Alert name", required = true, multiValued = false)
@Completion(AlertCompleter.class)
String name;
@Override
public Object execute() throws Exception {
store.remove(name, AlertStore.Level.valueOf(level));
return null;
}
}
| [
"jbonofre@apache.org"
] | jbonofre@apache.org |
bec9ef8227582e685c02bda317c291a7e2c1421c | 4ce127193ee76e73d743d7c64fe0434569e87e9d | /src/main/java/org/syaku/springboot/web/utils/ParameterUtils.java | c8c69adbf51a4de086ced5ece1c565db861ed4c0 | [] | no_license | syakuis/spring-boot | 690703fd3aedcf8729c218a90dedac5b321ad037 | ad76524bb3d336fb39d0f7d6a55bb1abd1761c88 | refs/heads/master | 2020-03-21T22:20:42.755800 | 2018-07-04T06:56:00 | 2018-07-04T06:56:00 | 139,120,163 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,965 | java | package org.syaku.springboot.web.utils;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.*;
import lombok.extern.slf4j.Slf4j;
/**
* @author Seok Kyun. Choi. 최석균 (Syaku)
* @since 2018. 7. 2.
*/
@Slf4j
public final class ParameterUtils {
private static String charset = "UTF-8";
/**
* {@link URLDecoder} 에 사용될 언어셋을 설정할 수 있다.
* @param charset String default UTF-8
*/
public static void setCharset(String charset) {
if (charset == null || charset.length() == 0) {
ParameterUtils.charset = charset;
}
}
private static String decode(String value) throws UnsupportedEncodingException {
return URLDecoder.decode(value, ParameterUtils.charset);
}
private static List<String> add(List<String> values, String value) {
if (value != null && value.length() > 0) {
values.add(value);
}
return values;
}
/**
* 문자열 파라메터를 맵 형식으로 만들어 반환한다. 순서를 유지하기 위해 {@link LinkedHashMap} 을 사용했다.
* @param params string parameter type
* @return parameter map
*/
static Map<String, String[]> stringToMap(String params) {
if (params == null || params.length() == 0) {
return Collections.emptyMap();
}
Map<String, List<String>> store = new LinkedHashMap<>();
String[] pairs = params.split("&");
try {
for (String pair : pairs) {
int idx = pair.indexOf("=");
String name = decode(pair.substring(0, idx));
String value = decode(pair.substring(idx + 1));
List<String> values = new LinkedList<>();
if (store.containsKey(name)) {
values = store.get(name);
}
store.put(name, add(values, value));
}
} catch (UnsupportedEncodingException e) {
log.error(e.getMessage());
}
Map<String, String[]> result = new LinkedHashMap<>();
for (Map.Entry<String, List<String>> values: store.entrySet()) {
result.put(values.getKey(), values.getValue().toArray(new String[values.getValue().size()]));
}
return result;
}
/**
* @param target 대상이될 파라메터 맵
* @return string parameter
*/
static String mapToString(Map<String, String[]> target) {
return mapToString(target, false);
}
/**
* 파라메터 맵을 문자열로 만들어 반환한다. allowEmpty 가 true 인 경우 빈값도 이름을 만든다. 기본적으로 false 이다.
* @param target 대상이될 파라메터맵
* @param allowEmpty 빈값을 만들지 여부 기본적으로 만들지 않는 다.
* @return parameter string
*/
public static String mapToString(Map<String, String[]> target, boolean allowEmpty) {
if (target == null || target.isEmpty()) {
return "";
}
StringBuilder result = new StringBuilder();
for (Map.Entry<String, String[]> map : target.entrySet()) {
String[] values = map.getValue();
if (!allowEmpty && (values == null || values.length == 0)) {
continue;
}
if (values == null || values.length == 0) {
result.append(map.getKey()).append("=&");
continue;
}
for (String value : values) {
result.append(map.getKey()).append("=").append(value).append("&");
}
}
return result.toString().replaceAll("&$", "");
}
/**
* 두개의 맵을 병합한다.
* @param target 원래 맵
* @param value 새로운 맵
* @return parameter map
*/
static Map<String, String[]> union(Map<String, String[]> target, String value) {
Map<String, String[]> result;
if (target == null || target.isEmpty()) {
result = new LinkedHashMap<>();
} else {
result = new LinkedHashMap<>(target);
}
result.putAll(stringToMap(value));
return result;
}
/**
* parameter query string 첫 문자가 ? 혹은 & 인 경우 반환한다.
* @param query parameter query string
* @return string ? | & | ''
*/
private static String findInitialString(String query) {
if (query == null) {
return "";
}
if (query.indexOf("?") == 0) {
return "?";
} else if (query.indexOf("&") == 0) {
return "&";
} else {
return "";
}
}
/**
* & 혹은 ? 문자가 첫글자에 포함되어있다면 제거한다.
* @param query 파라메터 쿼리
* @return 파라메터
*/
private static String initialStringReplace(String query) {
return query == null ? null : query.replaceAll("^(\\&|\\?)", "");
}
/**
* 대상이 되는 파라매터 맵에 문자열 파라메터 구문을 이용하여 문자열 파라메터를 반환한다.
* @param target parameter map
* @param query parameter query string
* @return parameter string
*/
public static String merge(Map<String, String[]> target, String query) {
return merge(target, query, false);
}
/**
* 대상이 되는 파라매터 맵에 문자열 파라메터 구문을 이용하여 문자열 파라메터를 반환한다.
* 빈값을 가진 파라메터는 대상이 되는 파라메터에서 삭제한다. allowEmpty = false 인 경우에 해당한다.
* value 파라메터 일부가 target 파라메터에 있는 경우 값을 수정한다.
* value 파라메터 일부가 target 파라메터에 없는 경우 이름과 값을 추가한다.
*
* (page=1&search=choi , page=2&search=) return "page=2"
* (page=1&search=choi , page=2&search=&mode=save) return "page=2&mode=save"
* (page=1&search=choi , mode=save) return "page=1&search=choi&mode=save"
* @param target parameter map
* @param query parameter query string
* @param allowEmpty 빈값을 가진 파라메터를 제거할지 여부를 설정한다. mapToString 에서 사용된다.
* @return parameter string
*/
public static String merge(Map<String, String[]> target, String query, boolean allowEmpty) {
return finalQueryString(query, mapToString(union(target, initialStringReplace(query)), allowEmpty));
}
private static String mapToLog(Map<String, String[]> target) {
StringBuilder builder = new StringBuilder();
for (Map.Entry<String, String[]> map : target.entrySet()) {
if (map.getValue() == null || map.getValue().length == 0) {
builder.append(map.getKey()).append("=&");
} else {
for (String value : map.getValue()) {
builder.append(map.getKey()).append("=").append(value).append("&");
}
}
}
String result = builder.toString().replaceAll("&$", "");
// log.debug(result);
return result;
}
/**
* 대상이 되는 파라메터 맵에서 쿼리에 맞는 파라메터만 추출한다.
*
* (page=1&search=choi , page=) return "page=2"
* (page=1&search=choi , page=2&mode=save) return "page=2&mode=save"
* (page=1&search=choi , mode=save) return "mode=save"
* @param target parameter map
* @param query parameter query string
* @return parameter string
*/
public static String pick(Map<String, String[]> target, String query) {
String newQuery = initialStringReplace(query);
Map<String, String[]> result = stringToMap(newQuery);
if (target == null || target.isEmpty()) {
return finalQueryString(query, mapToString(result));
}
for (Map.Entry<String, String[]> map : result.entrySet()) {
if (map.getValue() == null || map.getValue().length == 0) {
result.put(map.getKey(), target.get(map.getKey()));
}
}
return finalQueryString(query, mapToString(result));
}
/**
* 최종 파라메터 쿼리를 완성한다.
* @param query 파라메터 쿼리
* @param parameter 변형된 파라메터 쿼리
* @return 파라메터 쿼리
*/
private static String finalQueryString(String query, String parameter) {
if (parameter == null || Objects.equals("", parameter)) {
return "";
}
return findInitialString(query) + parameter;
}
}
| [
"syaku@naver.com"
] | syaku@naver.com |
cbd416ccf54bf7a6ad265511e4a3d6ed2aca2e97 | 0386dd72896464326174b50eb6743a02d1a87c3f | /examples/simple/src/main/java/org/apache/myfaces/examples/misc/TestCheckBox.java | a6a02e3581072917ea097c6a31b6613095a8b17f | [] | no_license | bschuette/tomahawk | f6922930bbb54e6914325fce11764eeeff63ef07 | 8e300e4adbadeb7221df00c3bb2e71ead86b656f | refs/heads/master | 2023-01-04T06:06:33.733606 | 2020-11-05T20:33:48 | 2020-11-05T20:33:48 | 310,410,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,376 | 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.examples.misc;
import java.io.Serializable;
/**
* @author Sylvain Vieujot (latest modification by $Author$)
* @version $Revision$ $Date$
*/
public class TestCheckBox implements Serializable
{
private boolean checked;
private String text;
public boolean isChecked() {
return checked;
}
public void setChecked(boolean checked) {
this.checked = checked;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
| [
"bjoern@schuette.se"
] | bjoern@schuette.se |
85fd1c78ecd2f188f0e2898e7bb0a90dba645258 | 74628a494f212f9cfdd3670f9bc21f59957b531f | /org.eclipse.gef4.graph.io/src/org/eclipse/gef4/graph/io/graphml/model/Edge.java | 0ed4fe7fbdce4f2cc7c94c8ceb570bb045a11955 | [] | no_license | lucascraft/gef4io | 3a940f2db5f686e8fd26f4d9c489ad08b2b69dd9 | 21c316c86f466d25fba5cbea564f419016f7564f | refs/heads/master | 2021-01-10T07:36:31.163421 | 2015-12-28T20:14:21 | 2015-12-28T20:14:21 | 48,576,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 637 | java | package org.eclipse.gef4.graph.io.graphml.model;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlIDREF;
public class Edge {
@XmlAttribute(name="id")
private String eid;
@XmlIDREF
@XmlAttribute
private Node source;
@XmlIDREF
@XmlAttribute
private Node target;
private List<Attribute> edata;
public Edge(String id, Node source, Node target) {
this.eid = id;
this.source = source;
this.target = target;
}
public void setData(List<Attribute> data) {
this.edata = data;
}
public List<Attribute> getData() {
return edata;
}
}
| [
"lucas.bigeardel@gmail.com"
] | lucas.bigeardel@gmail.com |
24a187ecef4b530e73e0784437fe0c48441046e6 | caecf26c07434fca594fd35834bafac175cda7c0 | /GSpy + JNetLib/JNetLib/src/jnet/packet/PacketVersion.java | 39214650c8236a1069d2981760bd5f79bfd6f91f | [
"BSD-3-Clause"
] | permissive | jwoo1601/Java-Minecraft-Mods | b390dca652a893e3ef5b927094ab272db65a5d19 | 1029d5ddd35cd7289b63ff34db6bb95b67763dc7 | refs/heads/master | 2020-12-27T10:22:46.668158 | 2020-02-03T02:04:42 | 2020-02-03T02:04:42 | 237,867,633 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,828 | java | package jnet.packet;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Calendar;
import java.util.Date;
public class PacketVersion implements Externalizable, Comparable<PacketVersion>, Cloneable
{
public final static PacketVersion INVALID_VERSION = new PacketVersion((byte)-1, (byte)-1, (byte)-1, (byte)-1);
// public final static PacketVersion CURRENT_VERSION = new PacketVersion((byte)18, (byte)1, (byte)9, (byte)PacketHeader.getChecksumManager().CurrentlyUsedAlgorithm);
public PacketVersion()
{
this(INVALID_VERSION);
}
public PacketVersion(final PacketVersion other)
{
this(other._1, other._2, other._3, other._4, other.compatibleVersion);
}
public PacketVersion(byte _1, byte _2, byte _3, byte _4)
{
this(_1, _2, _3, _4, null);
}
public PacketVersion(byte _1, byte _2, byte _3, byte _4, PacketVersion compatibleVersion)
{
this._1 = _1;
this._2 = _2;
this._3 = _3;
this._4 = _4;
this.compatibleVersion = compatibleVersion;
}
// TODO: implement this method
public static PacketVersion fromDate(Date date)
{
return null;
}
public static PacketVersion valueOf(int compressedData)
{
byte[] extractedData = extractVersionData(compressedData);
return new PacketVersion(extractedData[0], extractedData[1], extractedData[2], extractedData[3]);
}
public static PacketVersion valueOf(long compactData)
{
PacketVersion myVersion = valueOf((int) (compactData & 0xFFFFFFFFL));
myVersion.compatibleVersion = valueOf((int) (compactData >>> 32));
return myVersion;
}
private static byte[] extractVersionData(int compactVersionData)
{
return new byte[]
{
(byte) ((compactVersionData /* & 0xFF000000 */) >>> 25),
(byte) ((compactVersionData & 0x00FF0000) >>> 17),
(byte) ((compactVersionData & 0x0000FF00) >>> 9),
(byte) (compactVersionData & 0x000000FF)
};
}
public boolean isLowerThan(PacketVersion version)
{
if (version == null)
{
return false;
}
return this._1 >= version._1?
(this._1 == version._1?
(this._2 >= version._2?
(this._2 == version._2? (this._3 < version._3) : false)
: true)
: false)
: false;
}
public boolean isSameWith(PacketVersion version)
{
if (version == null)
{
return false;
}
return this._1 == version._1 && this._2 == version._2 && this._3 == version._3;
}
public boolean isHigherThan(PacketVersion version)
{
return !(isSameWith(version) || isLowerThan(version));
}
public boolean isCompatibleWith(PacketVersion version)
{
return isSameWith(version) || isLowerThan(version);
}
public int getCompressed()
{
return _1 << 23 | _2 << 15 | _3 << 7 | _4;
}
public long getCompactData()
{
return compatibleVersion == null? (long) getCompressed() : ((long)compatibleVersion.getCompressed()) << 32 | getCompressed();
}
public String toCompactString()
{
return String.format("%d.%d.%d_%d", _1, _2, _3, _4);
}
@Override
public String toString()
{
return String.format("PacketVersion: %d.%d.%d_%d, Compatible PacketVersion: %s", _1, _2, _3, _4, compatibleVersion);
}
@Override
public boolean equals(Object obj)
{
if (obj != null && obj instanceof PacketVersion)
{
PacketVersion version = (PacketVersion) obj;
return this._1 == version._1 && this._2 == version._2 && this._3 == version._3 && this._4 == version._4;
}
return false;
}
@Override
public int hashCode()
{
return getCompressed();
}
@Override
public int compareTo(PacketVersion version)
{
if (isSameWith(version))
{
return 0;
}
else if (isLowerThan(version))
{
return -1;
}
return 1;
}
@Override
public void writeExternal(ObjectOutput out) throws IOException
{
out.writeLong(getCompactData());
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
PacketVersion versionData = valueOf(in.readLong());
this._1 = versionData._1;
this._2 = versionData._2;
this._3 = versionData._3;
this._4 = versionData._4;
this.compatibleVersion = versionData.compatibleVersion;
}
/**
* First element of PacketVersion (typically the last two digits of the year when the version was made e.g. 18 for 2018)
*/
private byte _1;
/**
* Second element of PacketVersion (typically the month when the version was made e.g. 01 for January)
*/
private byte _2;
/**
* Third element of PacketVersion (typically the date when the version was made)
*/
private byte _3;
/**
* Last element of PacketVersion (typically used as a custom number to provide certain information)
*/
private byte _4;
PacketVersion compatibleVersion;
public PacketVersion getCompatibleVersion()
{
return compatibleVersion;
}
}
| [
"jkim504@myseneca.ca"
] | jkim504@myseneca.ca |
450e2fd613669ea3c1b0b2c51b625d355e116446 | 32f38cd53372ba374c6dab6cc27af78f0a1b0190 | /app/src/main/java/com/autonavi/indoor/pdr/ErrorCode.java | cb8ae8b3b0b527752f553615ea0a033d6e09f38c | [] | no_license | shuixi2013/AmapCode | 9ea7aefb42e0413f348f238f0721c93245f4eac6 | 1a3a8d4dddfcc5439df8df570000cca12b15186a | refs/heads/master | 2023-06-06T23:08:57.391040 | 2019-08-29T04:36:02 | 2019-08-29T04:36:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,497 | java | package com.autonavi.indoor.pdr;
public class ErrorCode extends Error {
public static final int SENSOR_ACC_TIMESTAMP_ERROR = 1024;
public static final int SENSOR_ACC_UN_AVAILABLE = 1;
public static final int SENSOR_ACC_UPDATE_ERROR = 32;
public static final int SENSOR_GRAVITY_TIMESTAMP_ERROR = 2048;
public static final int SENSOR_GRAVITY_UN_AVAILABLE = 2;
public static final int SENSOR_GRAVITY_UPDATE_ERROR = 64;
public static final int SENSOR_GYRO_TIMESTAMP_ERROR = 4096;
public static final int SENSOR_GYRO_UN_AVAILABLE = 4;
public static final int SENSOR_GYRO_UPDATE_ERROR = 128;
public static final int SENSOR_MAGNETIC_TIMESTAMP_ERROR = 8192;
public static final int SENSOR_MAGNETIC_UN_AVAILABLE = 8;
public static final int SENSOR_MAGNETIC_UPDATE_ERROR = 256;
public static final int SENSOR_PRESS_TIMESTAMP_ERROR = 16384;
public static final int SENSOR_PRESS_UN_AVAILABLE = 16;
public static final int SENSOR_PRESS_UPDATE_ERROR = 512;
public ErrorCode(String str) {
super(str);
}
public static String getErrorString(long j) {
String str = "";
int i = ((1 & j) > 0 ? 1 : ((1 & j) == 0 ? 0 : -1));
if (i != 0) {
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.append("加速度计不可用,");
str = sb.toString();
}
int i2 = ((2 & j) > 0 ? 1 : ((2 & j) == 0 ? 0 : -1));
if (i2 != 0) {
StringBuilder sb2 = new StringBuilder();
sb2.append(str);
sb2.append("重力计不可用,");
str = sb2.toString();
}
if (!(i == 0 || i2 == 0)) {
StringBuilder sb3 = new StringBuilder();
sb3.append(str);
sb3.append(" 定位方向会不准确");
str = sb3.toString();
}
int i3 = ((4 & j) > 0 ? 1 : ((4 & j) == 0 ? 0 : -1));
if (i3 != 0) {
StringBuilder sb4 = new StringBuilder();
sb4.append(str);
sb4.append("陀螺仪不可用,");
str = sb4.toString();
}
int i4 = ((8 & j) > 0 ? 1 : ((8 & j) == 0 ? 0 : -1));
if (i4 != 0) {
StringBuilder sb5 = new StringBuilder();
sb5.append(str);
sb5.append("地磁计不可用,");
str = sb5.toString();
}
if (!(i3 == 0 || i4 == 0)) {
StringBuilder sb6 = new StringBuilder();
sb6.append(str);
sb6.append("定位结果可能会存在跳点现象");
str = sb6.toString();
}
if ((16 & j) != 0) {
StringBuilder sb7 = new StringBuilder();
sb7.append(str);
sb7.append("气压计不可用,楼层判断可能不准确。");
str = sb7.toString();
}
int i5 = ((32 & j) > 0 ? 1 : ((32 & j) == 0 ? 0 : -1));
if (i5 != 0) {
StringBuilder sb8 = new StringBuilder();
sb8.append(str);
sb8.append("加速度计更新错误,");
sb8.append("监测到了此传感器,但是一段时间内没有接收到回调数据.");
str = sb8.toString();
}
int i6 = ((64 & j) > 0 ? 1 : ((64 & j) == 0 ? 0 : -1));
if (i6 != 0) {
StringBuilder sb9 = new StringBuilder();
sb9.append(str);
sb9.append("重力计更新错误");
sb9.append("监测到了此传感器,但是一段时间内没有接收到回调数据.");
str = sb9.toString();
}
if (!(i5 == 0 || i6 == 0)) {
StringBuilder sb10 = new StringBuilder();
sb10.append(str);
sb10.append(" 定位方向会不准确");
str = sb10.toString();
}
int i7 = ((128 & j) > 0 ? 1 : ((128 & j) == 0 ? 0 : -1));
if (i7 != 0) {
StringBuilder sb11 = new StringBuilder();
sb11.append(str);
sb11.append("陀螺仪更新错误");
sb11.append("监测到了此传感器,但是一段时间内没有接收到回调数据.");
str = sb11.toString();
}
int i8 = ((256 & j) > 0 ? 1 : ((256 & j) == 0 ? 0 : -1));
if (i8 != 0) {
StringBuilder sb12 = new StringBuilder();
sb12.append(str);
sb12.append("地磁更新错误");
sb12.append("监测到了此传感器,但是一段时间内没有接收到回调数据.");
str = sb12.toString();
}
if (!(i7 == 0 || i8 == 0)) {
StringBuilder sb13 = new StringBuilder();
sb13.append(str);
sb13.append("定位结果可能会存在跳点现象");
str = sb13.toString();
}
if ((512 & j) != 0) {
StringBuilder sb14 = new StringBuilder();
sb14.append(str);
sb14.append("气压计更新错误");
sb14.append("监测到了此传感器,但是一段时间内没有接收到回调数据.");
sb14.append(",楼层判断可能不准确。");
str = sb14.toString();
}
if ((1024 & j) != 0) {
StringBuilder sb15 = new StringBuilder();
sb15.append(str);
sb15.append("时间戳错误,传感器");
sb15.append("陀螺仪或磁传感器的时间戳不在同一维度,将用系统时间代替,最后角度精度可能下降");
str = sb15.toString();
}
if ((2048 & j) != 0) {
StringBuilder sb16 = new StringBuilder();
sb16.append(str);
sb16.append("时间戳错误");
sb16.append("陀螺仪或磁传感器的时间戳不在同一维度,将用系统时间代替,最后角度精度可能下降");
str = sb16.toString();
}
if ((4096 & j) != 0) {
StringBuilder sb17 = new StringBuilder();
sb17.append(str);
sb17.append("时间戳错误");
str = sb17.toString();
}
if ((8192 & j) != 0) {
StringBuilder sb18 = new StringBuilder();
sb18.append(str);
sb18.append("时间戳错误");
str = sb18.toString();
}
if ((j & 16384) == 0) {
return str;
}
StringBuilder sb19 = new StringBuilder();
sb19.append(str);
sb19.append("时间戳错误");
return sb19.toString();
}
}
| [
"hubert.yang@nf-3.com"
] | hubert.yang@nf-3.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.