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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fa49de6b05973af126d7d283cb730346f2b149fe
|
0b341d234ad1f366322098708591f23146d0e56b
|
/src/main/java/ru/job4j/io/Matches.java
|
2a5edb3f88449c189ae8c7f3b775d91bda8ce9eb
|
[] |
no_license
|
eskendarov/job4j_tracker
|
eea356eaaa4b7928e2eff8ec86f3f96c81f400af
|
56fa123f9142e883dd6ce96dfaa96a375af7c3ec
|
refs/heads/master
| 2023-08-15T09:10:18.692177
| 2021-10-04T14:33:15
| 2021-10-04T14:33:15
| 259,375,475
| 1
| 0
| null | 2020-04-27T15:37:14
| 2020-04-27T15:37:14
| null |
UTF-8
|
Java
| false
| false
| 1,606
|
java
|
package ru.job4j.io;
import java.util.Scanner;
/**
* Игра 11. Смысл игры в следующем. На столе лежат 11 спичек. Два игрока по очереди берут от 1 до 3 спичек.
* Выигрывает тот, кто забрал последние спички.
* @author Enver Eskendarov
*/
public class Matches {
public static void main(String[] args) {
int amount = 11;
boolean gamer1 = true;
Scanner input = new Scanner(System.in);
while (amount > 0) {
if (gamer1) {
System.out.println("Игрок №1, введите количество спичек");
} else {
System.out.println("Игрок №2, введите количество спичек");
}
int took = Integer.valueOf(input.nextLine());
if (took <= 3 && took > 0) {
if (amount - took < 0) {
System.out.println("Вы не можете взять больше чем осталось!");
} else {
amount = amount - took;
System.out.println("Отобрано " + took + ", осталось " + amount + " спичек");
gamer1 = !gamer1;
}
} else {
System.out.println("Допустимое количество спичек 1-3");
}
}
System.out.println("Вы выиграли, отобрав последние спички, игра завершена!");
}
}
|
[
"envereskendarov@gmail.com"
] |
envereskendarov@gmail.com
|
f3ced1489e79efb5dfcbcc9871a802c36db77426
|
5ec06dab1409d790496ce082dacb321392b32fe9
|
/clients/jaxrs-jersey/generated/src/gen/java/org/openapitools/model/ComDayCqDamCoreProcessMetadataProcessorProcessInfo.java
|
4c418ea1ce7fa2700ac99c44a256232bee847414
|
[
"Apache-2.0"
] |
permissive
|
shinesolutions/swagger-aem-osgi
|
e9d2385f44bee70e5bbdc0d577e99a9f2525266f
|
c2f6e076971d2592c1cbd3f70695c679e807396b
|
refs/heads/master
| 2022-10-29T13:07:40.422092
| 2021-04-09T07:46:03
| 2021-04-09T07:46:03
| 190,217,155
| 3
| 3
|
Apache-2.0
| 2022-10-05T03:26:20
| 2019-06-04T14:23:28
| null |
UTF-8
|
Java
| false
| false
| 4,710
|
java
|
/*
* Adobe Experience Manager OSGI config (AEM) API
* Swagger AEM OSGI is an OpenAPI specification for Adobe Experience Manager (AEM) OSGI Configurations API
*
* OpenAPI spec version: 1.0.0-pre.0
* Contact: opensource@shinesolutions.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.ComDayCqDamCoreProcessMetadataProcessorProcessProperties;
import javax.validation.constraints.*;
/**
* ComDayCqDamCoreProcessMetadataProcessorProcessInfo
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2019-08-05T00:58:47.028Z[GMT]")
public class ComDayCqDamCoreProcessMetadataProcessorProcessInfo {
@JsonProperty("pid")
private String pid = null;
@JsonProperty("title")
private String title = null;
@JsonProperty("description")
private String description = null;
@JsonProperty("properties")
private ComDayCqDamCoreProcessMetadataProcessorProcessProperties properties = null;
public ComDayCqDamCoreProcessMetadataProcessorProcessInfo pid(String pid) {
this.pid = pid;
return this;
}
/**
* Get pid
* @return pid
**/
@JsonProperty("pid")
@ApiModelProperty(value = "")
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public ComDayCqDamCoreProcessMetadataProcessorProcessInfo title(String title) {
this.title = title;
return this;
}
/**
* Get title
* @return title
**/
@JsonProperty("title")
@ApiModelProperty(value = "")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public ComDayCqDamCoreProcessMetadataProcessorProcessInfo description(String description) {
this.description = description;
return this;
}
/**
* Get description
* @return description
**/
@JsonProperty("description")
@ApiModelProperty(value = "")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public ComDayCqDamCoreProcessMetadataProcessorProcessInfo properties(ComDayCqDamCoreProcessMetadataProcessorProcessProperties properties) {
this.properties = properties;
return this;
}
/**
* Get properties
* @return properties
**/
@JsonProperty("properties")
@ApiModelProperty(value = "")
public ComDayCqDamCoreProcessMetadataProcessorProcessProperties getProperties() {
return properties;
}
public void setProperties(ComDayCqDamCoreProcessMetadataProcessorProcessProperties properties) {
this.properties = properties;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ComDayCqDamCoreProcessMetadataProcessorProcessInfo comDayCqDamCoreProcessMetadataProcessorProcessInfo = (ComDayCqDamCoreProcessMetadataProcessorProcessInfo) o;
return Objects.equals(this.pid, comDayCqDamCoreProcessMetadataProcessorProcessInfo.pid) &&
Objects.equals(this.title, comDayCqDamCoreProcessMetadataProcessorProcessInfo.title) &&
Objects.equals(this.description, comDayCqDamCoreProcessMetadataProcessorProcessInfo.description) &&
Objects.equals(this.properties, comDayCqDamCoreProcessMetadataProcessorProcessInfo.properties);
}
@Override
public int hashCode() {
return Objects.hash(pid, title, description, properties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ComDayCqDamCoreProcessMetadataProcessorProcessInfo {\n");
sb.append(" pid: ").append(toIndentedString(pid)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"cliffano@gmail.com"
] |
cliffano@gmail.com
|
3b8f489aab2340021a7ba9614e880751c448b360
|
76852b1b29410436817bafa34c6dedaedd0786cd
|
/sources-2020-07-19-tempmail/sources/com/google/android/gms/common/a.java
|
008450d5967fd2bcd9a57610f867f7d7c70bb877
|
[] |
no_license
|
zteeed/tempmail-apks
|
040e64e07beadd8f5e48cd7bea8b47233e99611c
|
19f8da1993c2f783b8847234afb52d94b9d1aa4c
|
refs/heads/master
| 2023-01-09T06:43:40.830942
| 2020-11-04T18:55:05
| 2020-11-04T18:55:05
| 310,075,224
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,989
|
java
|
package com.google.android.gms.common;
import android.content.Context;
import android.os.RemoteException;
import android.os.StrictMode;
import android.util.Log;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.internal.zzm;
import com.google.android.gms.common.internal.zzn;
import com.google.android.gms.dynamic.ObjectWrapper;
import com.google.android.gms.dynamite.DynamiteModule;
import javax.annotation.CheckReturnValue;
@CheckReturnValue
final class a {
/* renamed from: a reason: collision with root package name */
private static volatile zzm f2676a;
/* renamed from: b reason: collision with root package name */
private static final Object f2677b = new Object();
/* renamed from: c reason: collision with root package name */
private static Context f2678c;
static i a(String str, c cVar, boolean z, boolean z2) {
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
try {
return d(str, cVar, z, z2);
} finally {
StrictMode.setThreadPolicy(allowThreadDiskReads);
}
}
static final /* synthetic */ String b(boolean z, String str, c cVar) throws Exception {
boolean z2 = true;
if (z || !d(str, cVar, true, false).f2946a) {
z2 = false;
}
return i.e(str, cVar, z, z2);
}
/* JADX WARNING: Code restructure failed: missing block: B:13:0x0019, code lost:
return;
*/
/* Code decompiled incorrectly, please refer to instructions dump. */
static synchronized void c(android.content.Context r2) {
/*
java.lang.Class<com.google.android.gms.common.a> r0 = com.google.android.gms.common.a.class
monitor-enter(r0)
android.content.Context r1 = f2678c // Catch:{ all -> 0x001a }
if (r1 != 0) goto L_0x0011
if (r2 == 0) goto L_0x0018
android.content.Context r2 = r2.getApplicationContext() // Catch:{ all -> 0x001a }
f2678c = r2 // Catch:{ all -> 0x001a }
monitor-exit(r0)
return
L_0x0011:
java.lang.String r2 = "GoogleCertificates"
java.lang.String r1 = "GoogleCertificates has been initialized already"
android.util.Log.w(r2, r1) // Catch:{ all -> 0x001a }
L_0x0018:
monitor-exit(r0)
return
L_0x001a:
r2 = move-exception
monitor-exit(r0)
throw r2
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.common.a.c(android.content.Context):void");
}
private static i d(String str, c cVar, boolean z, boolean z2) {
try {
if (f2676a == null) {
Preconditions.k(f2678c);
synchronized (f2677b) {
if (f2676a == null) {
f2676a = zzn.E(DynamiteModule.e(f2678c, DynamiteModule.k, "com.google.android.gms.googlecertificates").d("com.google.android.gms.common.GoogleCertificatesImpl"));
}
}
}
Preconditions.k(f2678c);
try {
if (f2676a.D1(new zzk(str, cVar, z, z2), ObjectWrapper.b0(f2678c.getPackageManager()))) {
return i.f();
}
return i.c(new b(z, str, cVar));
} catch (RemoteException e2) {
Log.e("GoogleCertificates", "Failed to get Google certificates from remote", e2);
return i.b("module call", e2);
}
} catch (DynamiteModule.LoadingException e3) {
Log.e("GoogleCertificates", "Failed to get Google certificates from remote", e3);
String valueOf = String.valueOf(e3.getMessage());
return i.b(valueOf.length() != 0 ? "module init: ".concat(valueOf) : new String("module init: "), e3);
}
}
}
|
[
"zteeed@minet.net"
] |
zteeed@minet.net
|
44be45eb57441a0bdf734ac0bae4f7baabcf6fab
|
d81f6a896dace4eb31b326743776d55982333c12
|
/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionRefsOperation.java
|
7b48ac0d0f9623d3d8b879fa5477d66f5920b052
|
[
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] |
permissive
|
michaelandrepearce/activemq-artemis
|
a19fda7c97a232b320551d6b2bd46ad34a693b6e
|
fafbd7e2e5953e03573088577be620828cd77bc5
|
refs/heads/master
| 2021-10-08T09:52:26.277367
| 2019-03-12T19:53:07
| 2019-03-12T19:53:07
| 90,807,775
| 1
| 1
|
Apache-2.0
| 2018-05-23T17:42:35
| 2017-05-10T01:29:30
|
Java
|
UTF-8
|
Java
| false
| false
| 3,047
|
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.activemq.artemis.protocol.amqp.proton.transaction;
import java.util.LinkedList;
import java.util.Map;
import org.apache.activemq.artemis.core.persistence.StorageManager;
import org.apache.activemq.artemis.core.server.MessageReference;
import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.core.server.ServerConsumer;
import org.apache.activemq.artemis.core.server.impl.QueueImpl;
import org.apache.activemq.artemis.core.server.impl.RefsOperation;
import org.apache.activemq.artemis.core.transaction.Transaction;
import org.apache.qpid.proton.engine.Delivery;
/**
* AMQP Protocol has different TX Rollback behaviour for Acks depending on whether an AMQP delivery has been settled
* or not. This class extends the Core RefsOperation used for normal acks. In the case where deliveries have been
* settled, normal Ack rollback is applied. For cases where deliveries are unsettled and rolled back, we increment
* the delivery count and return to the consumer.
*/
public class ProtonTransactionRefsOperation extends RefsOperation {
public ProtonTransactionRefsOperation(final Queue queue, StorageManager storageManager) {
super(queue, storageManager);
}
@Override
public void rollbackRedelivery(Transaction txn, MessageReference ref, long timeBase, Map<QueueImpl, LinkedList<MessageReference>> queueMap) throws Exception {
ProtonTransactionImpl tx = (ProtonTransactionImpl) txn;
if (tx.getDeliveries().containsKey(ref)) {
Delivery del = tx.getDeliveries().get(ref).getA();
ServerConsumer consumer = (ServerConsumer) tx.getDeliveries().get(ref).getB().getBrokerConsumer();
// Rollback normally if the delivery is not settled or a forced TX rollback is done (e.g. connection drop).
if (del.remotelySettled() || !tx.isDischarged()) {
super.rollbackRedelivery(tx, ref, timeBase, queueMap);
} else {
ref.incrementDeliveryCount();
consumer.backToDelivering(ref);
del.disposition(del.getLocalState() == null ? del.getDefaultDeliveryState() : del.getLocalState());
}
} else {
super.rollbackRedelivery(tx, ref, timeBase, queueMap);
}
}
}
|
[
"clebertsuconic@apache.org"
] |
clebertsuconic@apache.org
|
b1082bcaee95d6678b09d273eb3a6dd8b3f04e02
|
a16369facaad30e8560ee8f85770375e710223f7
|
/jetsencloud/src/main/java/com/chanlin/jetsencloud/QuestionViewActivity.java
|
53ffb351dddea0c6e510561caf9fca4955953894
|
[] |
no_license
|
jecn/jetsen
|
c595bf36b255a0624a0daf07829e9be87f904243
|
bad286f723b26aa9e48016b4b704499df57e514f
|
refs/heads/master
| 2021-05-14T03:39:38.096781
| 2020-04-09T08:35:10
| 2020-04-09T08:35:10
| 116,622,373
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,118
|
java
|
package com.chanlin.jetsencloud;
import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.webkit.WebView;
public class QuestionViewActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏
setContentView(R.layout.activity_question_view);
initView();
}
private void initView(){
findViewById(R.id.title_back).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
Intent it = getIntent();
String html = it.getStringExtra("html");
WebView webView = (WebView) findViewById(R.id.wv_question_detail);
webView.loadData(html,"text/html;charset=utf-8","UTF-8");
}
}
|
[
"xlwei920@163.com"
] |
xlwei920@163.com
|
4e3a38db1e80a0aaa4aeb80bd8aedfc9897b2e74
|
01ebbc94cd4d2c63501c2ebd64b8f757ac4b9544
|
/backend/gxqpt-pt/gxqpt-hardware-repository/src/main/java/com/hengyunsoft/platform/hardware/repository/apply/dao/ApplyRecordMapper.java
|
e711efb9f116a5fe149567b0f5bd5f65a10e6b3f
|
[] |
no_license
|
KevinAnYuan/gxq
|
60529e527eadbbe63a8ecbbad6aaa0dea5a61168
|
9b59f4e82597332a70576f43e3f365c41d5cfbee
|
refs/heads/main
| 2023-01-04T19:35:18.615146
| 2020-10-27T06:24:37
| 2020-10-27T06:24:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 358
|
java
|
package com.hengyunsoft.platform.hardware.repository.apply.dao;
import org.springframework.stereotype.Repository;
@Repository
public interface ApplyRecordMapper extends com.hengyunsoft.base.dao.BaseAllDao<Long, com.hengyunsoft.platform.hardware.entity.apply.po.ApplyRecord, com.hengyunsoft.platform.hardware.repository.apply.example.ApplyRecordExample> {
}
|
[
"470382668@qq.com"
] |
470382668@qq.com
|
7c8d7853e7061558c4f11405bf2b4dc40a91cb63
|
26a41203694014098e96a7bdb38ef641439b68f2
|
/microservices/software-licensing/cluster-manager-service/src/main/java/com/services/cluster_manager/App.java
|
fe231aab5aae250e63e990ab4e5485266c913c3c
|
[
"Apache-2.0"
] |
permissive
|
Kyledmw/student-projects
|
42035d41cb4db04ef47e783d32424903436f5c8a
|
766ef9d4b879c8c2d2086c2abe0fa224e2e051c6
|
refs/heads/master
| 2021-09-06T22:42:01.507696
| 2018-02-12T18:51:41
| 2018-02-12T18:51:41
| 100,615,064
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 528
|
java
|
package com.services.cluster_manager;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.spi.cluster.ClusterManager;
import io.vertx.spi.cluster.hazelcast.HazelcastClusterManager;
public class App {
public static void main(String[] args) {
ClusterManager mgr = new HazelcastClusterManager();
VertxOptions options = new VertxOptions().setClusterManager(mgr);
Vertx.clusteredVertx(options, res -> {
if (res.succeeded()) {
Vertx vertx = res.result();
} else {
}
});
}
}
|
[
"kyle.d.m.williamson@gmail.com"
] |
kyle.d.m.williamson@gmail.com
|
fbe9fbeb3a0d53f22cb1b21d967fca8e472be978
|
94ee0a4b8ba9de465d501a0f89fb1189399a73c5
|
/app/src/main/java/com/kunminx/puremusic/domain/usecase/CanBeStoppedUseCase.java
|
73d33acc7e6e32c59a68ec73ba646e95a0e0a99c
|
[
"Apache-2.0"
] |
permissive
|
harisucici/Jetpack-MVVM-Scaffold
|
b9050d00ec0381e0be06c4c381a6054b7249a155
|
48ae3650017dbeaf3e7027394dcd6b8d62a3a837
|
refs/heads/master
| 2022-08-06T16:12:13.668628
| 2020-05-23T08:19:44
| 2020-05-23T08:19:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,492
|
java
|
/*
* Copyright 2018-2020 KunMinX
*
* 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.kunminx.puremusic.domain.usecase;
import androidx.annotation.NonNull;
import androidx.lifecycle.DefaultLifecycleObserver;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.kunminx.architecture.data.usecase.UseCase;
import com.kunminx.puremusic.data.bean.DownloadFile;
import com.kunminx.puremusic.data.repository.DataRepository;
import static com.kunminx.puremusic.domain.usecase.CanBeStoppedUseCase.RequestValues;
import static com.kunminx.puremusic.domain.usecase.CanBeStoppedUseCase.ResponseValue;
/**
* UseCase 示例,实现 LifeCycle 接口,单独服务于 有 “叫停” 需求 的业务
*
* TODO tip:
* 同样是“下载”,我不是在数据层分别写两个方法,
* 而是遵循开闭原则,在 vm 和 数据层之间,插入一个 UseCase,来专门负责可叫停的情况,
* 除了开闭原则,使用 UseCase 还有个考虑就是避免内存泄漏,
* 具体缘由可详见 https://xiaozhuanlan.com/topic/6257931840 评论区 15 楼
*
* Create by KunMinX at 19/11/25
*/
public class CanBeStoppedUseCase extends UseCase<RequestValues, ResponseValue> implements DefaultLifecycleObserver {
@Override
public void onStop(@NonNull LifecycleOwner owner) {
if (getRequestValues() != null && getRequestValues().liveData != null) {
DownloadFile downloadFile = getRequestValues().liveData.getValue();
downloadFile.setForgive(true);
getRequestValues().liveData.setValue(downloadFile);
getUseCaseCallback().onSuccess(new ResponseValue(getRequestValues().liveData));
}
}
@Override
protected void executeUseCase(RequestValues requestValues) {
//访问数据层资源,在 UseCase 中处理带叫停性质的业务
DataRepository.getInstance().downloadFile(requestValues.liveData);
}
public static final class RequestValues implements UseCase.RequestValues {
private MutableLiveData<DownloadFile> liveData;
public RequestValues(MutableLiveData<DownloadFile> liveData) {
this.liveData = liveData;
}
public MutableLiveData<DownloadFile> getLiveData() {
return liveData;
}
public void setLiveData(MutableLiveData<DownloadFile> liveData) {
this.liveData = liveData;
}
}
public static final class ResponseValue implements UseCase.ResponseValue {
private MutableLiveData<DownloadFile> liveData;
public ResponseValue(MutableLiveData<DownloadFile> liveData) {
this.liveData = liveData;
}
public LiveData<DownloadFile> getLiveData() {
return liveData;
}
public void setLiveData(MutableLiveData<DownloadFile> liveData) {
this.liveData = liveData;
}
}
}
|
[
"kunminx@gmail.com"
] |
kunminx@gmail.com
|
338ba2a43fe3fdb4afeaa5b809391ce0b401fd8c
|
d9e78246af5911628bd85fe705f8b9ea28a12408
|
/src/main/java/com/note/old/itcast_framework/beanfactory/cfg/PropertyConfig.java
|
d7dc7b182abcf9a93272f4629b971ef5d4ec431f
|
[] |
no_license
|
thinkal01/note02
|
c2775d9c72f8f65a2bf771d5ec8606a4628e1bca
|
33583112b1f52a3f49d61931a4f2f3189690dd61
|
refs/heads/master
| 2022-12-22T11:01:51.290414
| 2020-03-16T11:25:06
| 2020-03-16T11:25:06
| 164,791,160
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 935
|
java
|
package com.note.old.itcast_framework.beanfactory.cfg;
public class PropertyConfig {
private String name;
private String value;
private String ref;
@Override
public String toString() {
return "PropertyConfig [name=" + name + ", value=" + value + ", ref="
+ ref + "]";
}
public PropertyConfig(String name, String value, String ref) {
super();
this.name = name;
this.value = value;
this.ref = ref;
}
public PropertyConfig() {
super();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getRef() {
return ref;
}
public void setRef(String ref) {
this.ref = ref;
}
}
|
[
"875535828@qq.com"
] |
875535828@qq.com
|
44153acd049d05bd7b11e78c8f318933da94fa36
|
b07e059862bee387e62af1d08a229649a022277e
|
/src/main/java/com/niulipeng/controller/base/FyPublicBoxController.java
|
d79b951367652a73fbf12f69e84ed906a4b17356
|
[] |
no_license
|
nlp0520/service_plateform
|
5b04e774a0edba4559bbeb517ea0068dcbe4c35d
|
1c0731bbbfdbb6275a476cbb9a83e030e3e00a7a
|
refs/heads/master
| 2023-07-08T04:56:29.575374
| 2021-08-17T09:22:32
| 2021-08-17T09:22:32
| 397,186,912
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 336
|
java
|
package com.niulipeng.controller.base;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
/**
* <p>
* 公表信息 前端控制器
* </p>
*
* @author lian
* @since 2021-07-29
*/
@Controller
@RequestMapping("/fyPublicBox")
public class FyPublicBoxController {
}
|
[
"784115501@qq.com"
] |
784115501@qq.com
|
9594d4886682334dd24333a039ce95fe217bb22f
|
9a7ec216a1deeab63e5bf293381d06cf25419251
|
/batch13022014/core/BeanPostProcessor/src/com/bpp/test/BPPTest.java
|
751e65b844f7feda41e36a9680d41118e6b07ced
|
[] |
no_license
|
Mallikarjun0535/Spring
|
63b2fb705af3477402639557dbda1378fe20b538
|
041f538c7ae2eca113df7cb9277e438ec6221c08
|
refs/heads/master
| 2020-06-04T00:22:21.910592
| 2019-06-20T19:18:09
| 2019-06-20T19:18:09
| 191,792,835
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 940
|
java
|
package com.bpp.test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import com.bpp.beans.EditEmpController;
import com.bpp.beans.ValueObjectBeanPostProcessor;
public class BPPTest {
public static void main(String[] args) {
BeanFactory factory = new XmlBeanFactory(new ClassPathResource(
"com/bpp/common/application-context.xml"));
// registering bean post process with ioc container
((ConfigurableListableBeanFactory) factory)
.addBeanPostProcessor(new ValueObjectBeanPostProcessor());
EditEmpController eec = factory.getBean("editEmpController",
EditEmpController.class);
eec.editEmp(1, "Rama", 25422.23f, "rama@sriman.com");
}
}
|
[
"mallik.mitta@outlook.com"
] |
mallik.mitta@outlook.com
|
78d4db4feb92cbfa381df4dd3441800c49e77536
|
a89c95173ba2d099e37803f618033a824d5387e1
|
/7.31/Week 2/RecyclerView/app/src/main/java/com/example/user/recyclerview/SecondActivity.java
|
2caddfbd7cfc4c9937bae0bc8f1393947be6d43f
|
[] |
no_license
|
DroidSingh89/MAC_Training
|
69715c2b1476857d924034391449b70400d80b15
|
096293a249f220cb7366747d45a727c05a9050e7
|
refs/heads/master
| 2021-07-12T23:01:46.912045
| 2018-12-13T15:26:12
| 2018-12-13T15:26:12
| 133,825,375
| 2
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 606
|
java
|
package com.example.user.recyclerview;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
public class SecondActivity extends AppCompatActivity {
private static final String TAG = "Second";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
Intent intent = getIntent();
Food food = (Food) intent.getSerializableExtra("food");
Log.d(TAG, "onCreate: " + food.toString());
}
}
|
[
"singh@manroop.com"
] |
singh@manroop.com
|
7721327337e788efe6694d01bd72ba2c3b0d09c7
|
77ab252244005f80fbfc33f8e931a41e65e83e5a
|
/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java
|
3073b6467721944270f499da7d699ac7c332c215
|
[
"Apache-2.0"
] |
permissive
|
llsydn/spring-boot
|
d4401969d8ca51937bda7736fabea82944417c39
|
b88906cf98c4aa307952d27696897b2d4384b7e8
|
refs/heads/master
| 2023-01-03T12:14:42.767063
| 2019-09-26T08:53:10
| 2019-09-26T08:53:10
| 171,982,414
| 2
| 1
|
Apache-2.0
| 2022-12-27T14:50:56
| 2019-02-22T02:44:30
|
Java
|
UTF-8
|
Java
| false
| false
| 5,861
|
java
|
/*
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.context.embedded;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.jar.JarOutputStream;
import java.util.zip.ZipEntry;
import com.samskivert.mustache.Mustache;
import org.apache.maven.shared.invoker.DefaultInvocationRequest;
import org.apache.maven.shared.invoker.DefaultInvoker;
import org.apache.maven.shared.invoker.InvocationRequest;
import org.apache.maven.shared.invoker.InvocationResult;
import org.apache.maven.shared.invoker.MavenInvocationException;
import org.junit.rules.TemporaryFolder;
import org.springframework.util.FileCopyUtils;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Builds a Spring Boot application using Maven. To use this class, the {@code maven.home}
* system property must be set.
*
* @author Andy Wilkinson
*/
class ApplicationBuilder {
private final TemporaryFolder temp;
private final String packaging;
private final String container;
private final String containerVersion;
ApplicationBuilder(TemporaryFolder temp, String packaging, String container,
String containerVersion) {
this.temp = temp;
this.packaging = packaging;
this.container = container;
this.containerVersion = containerVersion;
}
File buildApplication() throws Exception {
File containerFolder = new File(this.temp.getRoot(),
this.container + "-" + this.containerVersion);
if (containerFolder.exists()) {
return new File(containerFolder, "app/target/app-0.0.1." + this.packaging);
}
return doBuildApplication(containerFolder);
}
private File doBuildApplication(File containerFolder)
throws IOException, FileNotFoundException, MavenInvocationException {
File resourcesJar = createResourcesJar();
File appFolder = new File(containerFolder, "app");
appFolder.mkdirs();
writePom(appFolder, resourcesJar);
copyApplicationSource(appFolder);
packageApplication(appFolder);
return new File(appFolder, "target/app-0.0.1." + this.packaging);
}
private File createResourcesJar() throws IOException, FileNotFoundException {
File resourcesJar = new File(this.temp.getRoot(), "resources.jar");
if (resourcesJar.exists()) {
return resourcesJar;
}
JarOutputStream resourcesJarStream = new JarOutputStream(
new FileOutputStream(resourcesJar));
resourcesJarStream.putNextEntry(new ZipEntry("META-INF/resources/"));
resourcesJarStream.closeEntry();
resourcesJarStream.putNextEntry(
new ZipEntry("META-INF/resources/nested-meta-inf-resource.txt"));
resourcesJarStream.write("nested".getBytes());
resourcesJarStream.closeEntry();
resourcesJarStream.close();
return resourcesJar;
}
private void writePom(File appFolder, File resourcesJar)
throws FileNotFoundException, IOException {
Map<String, Object> context = new HashMap<String, Object>();
context.put("packaging", this.packaging);
context.put("container", this.container);
context.put("bootVersion", Versions.getBootVersion());
context.put("resourcesJarPath", resourcesJar.getAbsolutePath());
context.put("containerVersion",
"current".equals(this.containerVersion) ? ""
: String.format("<%s.version>%s</%s.version>", this.container,
this.containerVersion, this.container));
context.put("additionalDependencies", getAdditionalDependencies());
FileWriter out = new FileWriter(new File(appFolder, "pom.xml"));
Mustache.compiler().escapeHTML(false)
.compile(new FileReader("src/test/resources/pom-template.xml"))
.execute(context, out);
out.close();
}
private List<Map<String, String>> getAdditionalDependencies() {
List<Map<String, String>> additionalDependencies = new ArrayList<Map<String, String>>();
if ("tomcat".equals(this.container) && !"current".equals(this.containerVersion)) {
Map<String, String> juli = new HashMap<String, String>();
juli.put("groupId", "org.apache.tomcat");
juli.put("artifactId", "tomcat-juli");
juli.put("version", "${tomcat.version}");
additionalDependencies.add(juli);
}
return additionalDependencies;
}
private void copyApplicationSource(File appFolder) throws IOException {
File examplePackage = new File(appFolder, "src/main/java/com/example");
examplePackage.mkdirs();
FileCopyUtils.copy(
new File("src/test/java/com/example/ResourceHandlingApplication.java"),
new File(examplePackage, "ResourceHandlingApplication.java"));
if ("war".equals(this.packaging)) {
File srcMainWebapp = new File(appFolder, "src/main/webapp");
srcMainWebapp.mkdirs();
FileCopyUtils.copy("webapp resource",
new FileWriter(new File(srcMainWebapp, "webapp-resource.txt")));
}
}
private void packageApplication(File appFolder) throws MavenInvocationException {
InvocationRequest invocation = new DefaultInvocationRequest();
invocation.setBaseDirectory(appFolder);
invocation.setGoals(Collections.singletonList("package"));
InvocationResult execute = new DefaultInvoker().execute(invocation);
assertThat(execute.getExitCode()).isEqualTo(0);
}
}
|
[
"1091391667@qq.com"
] |
1091391667@qq.com
|
768e45b16b10e3c51e1d6466048d7522a97fd91c
|
b327a374de29f80d9b2b3841db73f3a6a30e5f0d
|
/out/host/linux-x86/obj/EXECUTABLES/vm-tests_intermediates/main_files/dot/junit/opcodes/shr_int_2addr/Main_testB2.java
|
a2eb590705d45fc7c148aeb5ca292453639f9b60
|
[] |
no_license
|
nikoltu/aosp
|
6409c386ed6d94c15d985dd5be2c522fefea6267
|
f99d40c9d13bda30231fb1ac03258b6b6267c496
|
refs/heads/master
| 2021-01-22T09:26:24.152070
| 2011-09-27T15:10:30
| 2011-09-27T15:10:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 405
|
java
|
//autogenerated by util.build.BuildDalvikSuite, do not change
package dot.junit.opcodes.shr_int_2addr;
import dot.junit.opcodes.shr_int_2addr.d.*;
import dot.junit.*;
public class Main_testB2 extends DxAbstractMain {
public static void main(String[] args) throws Exception {
T_shr_int_2addr_1 t = new T_shr_int_2addr_1();
assertEquals(0x3FFFFFFF, t.run(Integer.MAX_VALUE, 1));
}
}
|
[
"fred.faust@gmail.com"
] |
fred.faust@gmail.com
|
28577f4d1030b020c1e3b53a8ca12161d79a3d31
|
71b491ba1bc32a8bb5713cbe481f93bd4abb2fa5
|
/app/src/main/java/com/datacomo/mc/spider/android/params/note/CloudNoteListParams.java
|
7202f6973481f0022d22b2868842d4f501e6d71b
|
[] |
no_license
|
niucong/MC_Spider_Android_Client_V2.0
|
1d26f16cafd1a15eab5528a3e44a281c3b39add1
|
02fc0d39f02a435839cde60bccc046fc20b0cc50
|
refs/heads/master
| 2020-12-03T06:45:17.513496
| 2017-06-30T01:57:27
| 2017-06-30T01:57:27
| 95,725,302
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,723
|
java
|
package com.datacomo.mc.spider.android.params.note;
import android.content.Context;
import com.datacomo.mc.spider.android.params.BasicParams;
/**
* 获取云笔记列表
*
* @author datacomo-160
*
*/
public class CloudNoteListParams extends BasicParams {
/**
* 获取云笔记列表
*
* @param context
* @param noteType
* 1:自己创建的、2:社员分享、3:第三方同步过来的 如 “有道”等、4:所有的(创建+分享+第三方同步)、5:星标笔记
* @param isNoteBook
* 是否获取某个笔记本下的所有笔记 true:是(获取某个笔记本下的笔记)false:否(获取所有笔记)
* @param noteBookId
* 笔记本id 如果isNoteBook为true,则笔记本id不能为空,此查询就为查询某个笔记本下的所有笔记
* @param startRecord
* @param maxResults
*/
public CloudNoteListParams(Context context, String noteType,
String isNoteBook, String noteBookId, String startRecord,
String maxResults) {
super(context);
setVariable(noteType, isNoteBook, noteBookId, startRecord, maxResults);
}
/**
* 设置参数
*/
private void setVariable(String noteType, String isNoteBook,
String noteBookId, String startRecord, String maxResults) {
paramsMap.put("orderByType", "EDIT_TIME_DESC");
paramsMap.put("noteType", noteType);
paramsMap.put("isNoteBook", isNoteBook);
paramsMap.put("noteBookId", noteBookId);
paramsMap.put("startRecord", startRecord);
paramsMap.put("maxResults", maxResults);
paramsMap.put("noPaging", "false");
paramsMap.put("method", "getCloudNoteList");
super.setVariable(true);
}
@Override
public String getParams() {
return strParams;
}
}
|
[
"niucong@julong.cc"
] |
niucong@julong.cc
|
99a8db04d8699deeeb63e170cc8b238d59e5d376
|
0ac05e3da06d78292fdfb64141ead86ff6ca038f
|
/OSWE/oswe/Manage/src/org/apache/jsp/jsp/mssql/database_jsp.java
|
c102349d9f3cc106a1ac8188709543ce5816ae98
|
[] |
no_license
|
qoo7972365/timmy
|
31581cdcbb8858ac19a8bb7b773441a68b6c390a
|
2fc8baba4f53d38dfe9c2b3afd89dcf87cbef578
|
refs/heads/master
| 2023-07-26T12:26:35.266587
| 2023-07-17T12:35:19
| 2023-07-17T12:35:19
| 353,889,195
| 7
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,327
|
java
|
/* */ package org.apache.jsp.jsp.mssql;
/* */
/* */ import java.io.IOException;
/* */ import java.util.Map;
/* */ import javax.el.ExpressionFactory;
/* */ import javax.servlet.ServletConfig;
/* */ import javax.servlet.ServletException;
/* */ import javax.servlet.http.HttpServletRequest;
/* */ import javax.servlet.http.HttpServletResponse;
/* */ import javax.servlet.jsp.JspFactory;
/* */ import javax.servlet.jsp.JspWriter;
/* */ import javax.servlet.jsp.PageContext;
/* */ import org.apache.jasper.runtime.InstanceManagerFactory;
/* */ import org.apache.jasper.runtime.JspSourceDependent;
/* */
/* */ public final class database_jsp extends org.apache.jasper.runtime.HttpJspBase implements JspSourceDependent
/* */ {
/* 18 */ private static final JspFactory _jspxFactory = ;
/* */
/* */ private static Map<String, Long> _jspx_dependants;
/* */
/* */ private ExpressionFactory _el_expressionfactory;
/* */ private org.apache.tomcat.InstanceManager _jsp_instancemanager;
/* */
/* */ public Map<String, Long> getDependants()
/* */ {
/* 27 */ return _jspx_dependants;
/* */ }
/* */
/* */ public void _jspInit() {
/* 31 */ this._el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
/* 32 */ this._jsp_instancemanager = InstanceManagerFactory.getInstanceManager(getServletConfig());
/* */ }
/* */
/* */
/* */ public void _jspDestroy() {}
/* */
/* */
/* */ public void _jspService(HttpServletRequest request, HttpServletResponse response)
/* */ throws IOException, ServletException
/* */ {
/* 42 */ javax.servlet.http.HttpSession session = null;
/* */
/* */
/* 45 */ JspWriter out = null;
/* 46 */ Object page = this;
/* 47 */ JspWriter _jspx_out = null;
/* 48 */ PageContext _jspx_page_context = null;
/* */
/* */ try
/* */ {
/* 52 */ response.setContentType("text/html");
/* 53 */ PageContext pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true);
/* */
/* 55 */ _jspx_page_context = pageContext;
/* 56 */ javax.servlet.ServletContext application = pageContext.getServletContext();
/* 57 */ ServletConfig config = pageContext.getServletConfig();
/* 58 */ session = pageContext.getSession();
/* 59 */ out = pageContext.getOut();
/* 60 */ _jspx_out = out;
/* */ }
/* */ catch (Throwable t) {
/* 63 */ if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
/* 64 */ out = _jspx_out;
/* 65 */ if ((out != null) && (out.getBufferSize() != 0))
/* 66 */ try { out.clearBuffer(); } catch (IOException e) {}
/* 67 */ if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
/* */ }
/* */ } finally {
/* 70 */ _jspxFactory.releasePageContext(_jspx_page_context);
/* */ }
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\ManageEngine\AppManager12\working\WEB-INF\lib\AdventNetAppManagerWebClient.jar!\org\apache\jsp\jsp\mssql\database_jsp.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"qoo7972365@gmail.com"
] |
qoo7972365@gmail.com
|
f803af09018fde18416af93bf2dbcbd43175b2f8
|
c0d6ff616713c68b5437ea682c6d865e31bc58f5
|
/SpringBoot/demoapplicationcontextexercise/src/main/java/me/aop/dao/UserDao.java
|
f7e60cf3199c093383f18afa4c110ae4d4c626da
|
[] |
no_license
|
mike6321/Spring
|
24662f00a5ab3f7b68c4e907db2fe8df688294a1
|
71fc04547738fe193aa5815adaccb2fee7198293
|
refs/heads/master
| 2023-03-04T08:54:17.364478
| 2022-03-20T12:49:13
| 2022-03-20T12:49:13
| 192,348,246
| 0
| 0
| null | 2023-02-22T07:55:05
| 2019-06-17T13:02:50
|
Java
|
UTF-8
|
Java
| false
| false
| 404
|
java
|
package me.aop.dao;
import me.aop.dto.User;
import java.util.List;
/**
* Project : demoapplicationcontextexercise
* Created by InteliJ IDE
* Developer : junwoochoi
* Date : 2020/03/23
* Time : 9:36 오후
*/
public interface UserDao {
public void add(User user);
public User get(String id);
public void deleteAll();
public List<User> getAll();
void update(User user);
}
|
[
"33277588+mike6321@users.noreply.github.com"
] |
33277588+mike6321@users.noreply.github.com
|
40f75f4bdd76928217a5c18c0107a2bde0d157a0
|
5cc3b051e592b4f38679c86365cb4290d726debc
|
/java/server/src/org/openqa/grid/internal/cli/CommonCliOptions.java
|
e3e45d6ab07b6072b1dd78e6652855a622cf4448
|
[
"Apache-2.0"
] |
permissive
|
narayananpalani/selenium
|
faa41c870ad92db1a69f6fa9f7f9fa8988835337
|
90216e938f4ffda83c3afd1fca901069d6a1fc1b
|
refs/heads/master
| 2021-04-12T10:04:05.994491
| 2017-02-27T15:03:44
| 2018-03-25T16:43:56
| 126,752,137
| 1
| 1
|
Apache-2.0
| 2018-03-26T00:18:50
| 2018-03-26T00:18:49
| null |
UTF-8
|
Java
| false
| false
| 4,895
|
java
|
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The SFC 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.openqa.grid.internal.cli;
import com.beust.jcommander.Parameter;
import org.openqa.grid.internal.utils.configuration.StandaloneConfiguration;
public abstract class CommonCliOptions {
@Parameter(
names = {"--version", "-version"},
description = "Displays the version and exits."
)
// initially defaults to false from boolean primitive type
public Boolean version = false;
@Parameter(
names = {"--help", "-help", "-h"},
help = true,
hidden = true,
description = "Displays this help."
)
// Initially defaults to false from boolean primitive type
public Boolean help = false;
/**
* Enable {@code LogLevel.FINE} log messages. Default {@code false}.
*/
@Parameter(
names = {"--debug", "-debug"},
description = "<Boolean> : enables LogLevel.FINE."
)
private Boolean debug = false;
/**
* Filename to use for logging. Defaults to {@code null}.
*/
@Parameter(
names = "-log",
description = "<String> filename : the filename to use for logging. If omitted, will log to STDOUT"
)
private String log;
/**
* Server role. Default determined by configuration type.
*/
@Parameter(
names = "-role",
description = "<String> options are [hub], [node], or [standalone]."
)
private String role;
/**
* Port to bind to. Default determined by configuration type.
*/
@Parameter(
names = {"-port"},
description = "<Integer> : the port number the server will use."
)
private Integer port;
/**
* Client timeout. Default 1800 sec.
*/
@Parameter(
names = {"-timeout", "-sessionTimeout"},
description = "<Integer> in seconds : Specifies the timeout before the server automatically kills a session that hasn't had any activity in the last X seconds. The test slot will then be released for another test to use. This is typically used to take care of client crashes. For grid hub/node roles, cleanUpCycle must also be set."
)
private Integer timeout;
/**
* Browser timeout. Default 0 (indefinite wait).
*/
@Parameter(
names = "-browserTimeout",
description = "<Integer> in seconds : number of seconds a browser session is allowed to hang while a WebDriver command is running (example: driver.get(url)). If the timeout is reached while a WebDriver command is still processing, the session will quit. Minimum value is 60. An unspecified, zero, or negative value means wait indefinitely."
)
private Integer browserTimeout;
@Parameter(
names = {"-avoidProxy"},
description = "DO NOT USE: Hack to allow selenium 3.0 server run in SauceLabs",
hidden = true
)
// initially defaults to false from boolean primitive type
private Boolean avoidProxy;
/**
* Max threads for Jetty. Defaults to {@code null}.
*/
@Parameter(
names = {"-jettyThreads", "-jettyMaxThreads"},
description = "<Integer> : max number of threads for Jetty. An unspecified, zero, or negative value means the Jetty default value (200) will be used."
)
private Integer jettyMaxThreads;
@Parameter(
names = "-browserSideLog",
description = "DO NOT USE: Provided for compatibility with 2.0",
hidden = true
)
// initially defaults to false from boolean primitive type
private Boolean browserSideLog = false;
@Parameter(
names = "-captureLogsOnQuit",
description = "DO NOT USE: Provided for compatibility with 2.0",
hidden = true
)
// initially defaults to false from boolean primitive type
private Boolean captureLogsOnQuit = false;
void fillCommonConfiguration(StandaloneConfiguration configuration) {
if (debug != null) {
configuration.debug = debug;
}
if (log != null) {
configuration.log = log;
}
if (port != null) {
configuration.port = port;
}
if (timeout != null) {
configuration.timeout = timeout;
}
if (browserTimeout != null) {
configuration.browserTimeout = browserTimeout;
}
}
abstract public StandaloneConfiguration toConfiguration();
}
|
[
"barancev@gmail.com"
] |
barancev@gmail.com
|
d076b4ad60d917eafdc8afc9d3ac1b06a157a4ff
|
8ab456b4c94b5f4b37bf89612e99f7ef7e9a4e97
|
/im-chat/src/main/java/pers/kinson/im/chat/logic/search/message/res/ResSearchFriends.java
|
615441ee37d7358764fa445ccf10259c46ad37a1
|
[] |
no_license
|
zillachan/im
|
5ae775d5e322457692566270f6d7036f0bd9e8af
|
7a61cb0f16392dfe377fac06f74efa0ca9297c50
|
refs/heads/master
| 2023-03-16T14:56:55.979818
| 2021-03-10T12:59:11
| 2021-03-10T12:59:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,233
|
java
|
package pers.kinson.im.chat.logic.search.message.res;
import java.util.ArrayList;
import java.util.List;
import pers.kinson.im.chat.logic.search.message.vo.RecommendFriendItem;
import pers.kinson.im.chat.net.IoSession;
import pers.kinson.im.chat.net.message.AbstractPacket;
import pers.kinson.im.chat.net.message.PacketType;
import io.netty.buffer.ByteBuf;
public class ResSearchFriends extends AbstractPacket {
private List<RecommendFriendItem> friends;
@Override
public PacketType getPacketType() {
return PacketType.ResSearchFriends;
}
@Override
public void writeBody(ByteBuf buf) {
buf.writeInt(friends.size());
for (RecommendFriendItem item : friends) {
item.writeBody(buf);
}
}
@Override
public void readBody(ByteBuf buf) {
int size = buf.readInt();
this.friends = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
RecommendFriendItem item = new RecommendFriendItem();
item.readBody(buf);
friends.add(item);
}
}
public List<RecommendFriendItem> getFriends() {
return friends;
}
public void setFriends(List<RecommendFriendItem> friends) {
this.friends = friends;
}
@Override
public void execPacket(IoSession session) {
// TODO Auto-generated method stub
}
}
|
[
"475139136@qq.com"
] |
475139136@qq.com
|
05b01864dae2e2503d48ed46a7aa5caa18dcc6f9
|
e3170f21bea849ca7436da5363381d0cf978b3af
|
/src/youzheng/algorithm/beakjoon/beakjoon1/beakjoon_1068.java
|
7aa86c790a7f866c5f2c7ecd177d1df31e841e30
|
[] |
no_license
|
yangfriendship/algorithmJava
|
ac698d82a4ab09a5172cca4719cbe32c3b31ff2c
|
a0bda01ba4e5955262762c53d381ecea34ad4282
|
refs/heads/master
| 2023-06-14T23:22:29.436105
| 2021-07-15T07:46:11
| 2021-07-15T07:46:11
| 309,068,333
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,371
|
java
|
package youzheng.algorithm.beakjoon.beakjoon1;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class beakjoon_1068 {
static List<List<Integer>> tree = new ArrayList<>();
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
StringTokenizer st = new StringTokenizer(br.readLine());
List<Integer> zeroIndex = new ArrayList<>();
int target = Integer.parseInt(br.readLine());
if(target==0){
System.out.println(0);
return;
}
st.nextToken();
zeroIndex.add(-1);
tree.add(zeroIndex);
for (int i = 1; i < n; i++) {
List<Integer> child = new ArrayList<>();
int parent = Integer.parseInt(st.nextToken());
child.add(parent);
tree.add(child);
tree.get(parent).add(i);
}
Integer targetParent = tree.get(target).get(0);
Integer remove = tree.get(targetParent).remove(target);
order(tree,0);
System.out.println(sum);
}// main
static int sum = 0;
public static void order(List<List<Integer>> tree, int r){
List<Integer> leaf = tree.get(r);
if(leaf.size()==1){
sum ++;
return;
}
for (int i = 1; i < leaf.size(); i++) {
if(!leaf.isEmpty()){
order(tree,leaf.get(i));
}
}
}
}
|
[
"yangfriendship@naver.com"
] |
yangfriendship@naver.com
|
ceaa4a5afb8c0689de13a6a23b5c6a6f0cf6d236
|
91eeea43a933f374dba67f458a62a4b59821fc7d
|
/src/test/java/ru/neustupov/votingforrestaurants/web/menu/AdminMenuRestControllerTest.java
|
6c2a446da3d81a023b39581d5226f5da1577626b
|
[] |
no_license
|
neustupov/votingForRestaurants
|
f9ff84d0eb568fc5d356ba581eb5407eb7d5c7f0
|
4251e2568145594de60bc9b0b19c481f0862a669
|
refs/heads/master
| 2018-11-11T12:21:57.966398
| 2018-10-23T14:58:20
| 2018-10-23T14:58:20
| 113,659,557
| 0
| 0
| null | 2018-08-22T15:00:07
| 2017-12-09T10:01:34
|
Java
|
UTF-8
|
Java
| false
| false
| 4,972
|
java
|
package ru.neustupov.votingforrestaurants.web.menu;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.ResultActions;
import ru.neustupov.votingforrestaurants.TestUtil;
import ru.neustupov.votingforrestaurants.model.Menu;
import ru.neustupov.votingforrestaurants.service.MenuService;
import ru.neustupov.votingforrestaurants.web.AbstractControllerTest;
import ru.neustupov.votingforrestaurants.web.json.JsonUtil;
import java.sql.Date;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import static ru.neustupov.votingforrestaurants.MenuTestData.*;
import static ru.neustupov.votingforrestaurants.RestaurantTestData.RUSSIA_ID;
import static ru.neustupov.votingforrestaurants.TestUtil.userHttpBasic;
import static ru.neustupov.votingforrestaurants.UserTestData.ADMIN;
import static ru.neustupov.votingforrestaurants.UserTestData.USER;
class AdminMenuRestControllerTest extends AbstractControllerTest {
private static final String REST_URL = AdminMenuRestController.REST_URL + '/';
@Autowired
private MenuService menuService;
@Test
void testGet() throws Exception {
mockMvc.perform(get(REST_URL + RUSSIA_MENU_ID1)
.with(userHttpBasic(ADMIN))
.param("restId", "100002"))
.andExpect(status().isOk())
.andDo(print())
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
.andExpect(contentJson(RUSSIA_MENU1));
}
@Test
void testDelete() throws Exception {
mockMvc.perform(delete(REST_URL + RUSSIA_MENU_ID1)
.with(userHttpBasic(ADMIN))
.param("restId", "100002"))
.andDo(print())
.andExpect(status().isNoContent());
assertMatch(menuService.getAll(RUSSIA_ID), RUSSIA_MENU2, MENU_TODAYS_WITH_MEALS);
}
@Test
void testCreate() throws Exception {
Menu expected = new Menu(getCreated());
ResultActions action = mockMvc.perform(post(REST_URL)
.with(userHttpBasic(ADMIN))
.param("restId", "100002")
.contentType(MediaType.APPLICATION_JSON)
.content(JsonUtil.writeValue(expected)))
.andExpect(status().isCreated());
Menu returned = TestUtil.readFromJson(action, Menu.class);
expected.setId(returned.getId());
assertMatch(returned, expected);
assertMatch(menuService.getAll(RUSSIA_ID), RUSSIA_MENU1, RUSSIA_MENU2, MENU_TODAYS_WITH_MEALS, expected);
}
@Test
void testGetAll() throws Exception {
TestUtil.print(mockMvc.perform(get(REST_URL)
.with(userHttpBasic(ADMIN))
.param("restId", "100002"))
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))
.andExpect(contentJson(RUSSIA_MENU1, RUSSIA_MENU2, MENU_TODAYS_WITH_MEALS)));
}
@Test
void testUpdate() throws Exception {
Menu updated = new Menu(getCreated());
updated.setId(100007);
updated.setAddDate(Date.valueOf("2017-06-01"));
mockMvc.perform(put(REST_URL + RUSSIA_MENU_ID1)
.with(userHttpBasic(ADMIN))
.param("restId", "100002")
.contentType(MediaType.APPLICATION_JSON)
.content(JsonUtil.writeValue(updated)))
.andExpect(status().isOk());
assertMatch(menuService.get(100007, RUSSIA_ID), updated);
}
@Test
void testGetUnauth() throws Exception {
mockMvc.perform(get(REST_URL))
.andExpect(status().isUnauthorized());
}
@Test
void testGetForbidden() throws Exception {
mockMvc.perform(get(REST_URL)
.with(userHttpBasic(USER)))
.andExpect(status().isForbidden());
}
@Test
void testGetNotFound() throws Exception {
mockMvc.perform(get(REST_URL + 1)
.param("restId", "100002")
.with(userHttpBasic(ADMIN)))
.andExpect(status().isUnprocessableEntity())
.andDo(print());
}
@Test
void testDeleteNotFound() throws Exception {
mockMvc.perform(delete(REST_URL + 1)
.param("restId", "100002")
.with(userHttpBasic(ADMIN)))
.andExpect(status().isUnprocessableEntity())
.andDo(print());
}
}
|
[
"neustupov@yandex.ru"
] |
neustupov@yandex.ru
|
1ba9e6cb60d99afa69900aca214b44d28adf062d
|
8f3633a215fc69bb7402c13b57f48e8b21fc1829
|
/ch13Interfaces/src/com/coderbd/interfaces/other/Dog.java
|
49bf5a9077e8d002fff408cf1a8e3c274108385e
|
[] |
no_license
|
springapidev/Java-8
|
44c167c2ef607de135b83de44c42943a317870f0
|
6801f2f003631c10fcb39c899443ec5b6cc11752
|
refs/heads/master
| 2021-06-06T12:25:16.111508
| 2020-02-23T08:51:28
| 2020-02-23T08:51:28
| 145,200,749
| 10
| 11
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 629
|
java
|
package com.coderbd.interfaces.other;
public class Dog implements Animal, Animal2 {
@Override
public void bark() {
System.out.println("::::Bark::::");
}
@Override
public void bite() {
System.out.println("::::bite::::");
}
@Override
public void eat() {
System.out.println("::::eat::::");
}
@Override
public void sleep() {
System.out.println("::::sleep::::");
}
@Override
public void run() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
|
[
"springapidev@gmail.com"
] |
springapidev@gmail.com
|
fbc227f9d1c9e2d413bee225eb200cb6247d4df4
|
b60da22bc192211b3978764e63af23e2e24081f5
|
/cdc/src/share/personal/classes/common/sun/net/TelnetOutputStream.java
|
f761b17258f96332b90e5f36cc5aa271f0444e2d
|
[] |
no_license
|
clamp03/JavaAOTC
|
44d566927c057c013538ab51e086c42c6348554e
|
0ade633837ed9698cd74a3f6928ebde3d96bd3e3
|
refs/heads/master
| 2021-01-01T19:33:51.612033
| 2014-12-02T14:29:58
| 2014-12-02T14:29:58
| 27,435,591
| 5
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,522
|
java
|
/*
* @(#)TelnetOutputStream.java 1.25 06/10/10
*
* Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version
* 2 only, as published by the Free Software Foundation.
*
* 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 version 2 for more details (a copy is
* included at /legal/license.txt).
*
* You should have received a copy of the GNU General Public License
* version 2 along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 or visit www.sun.com if you need additional
* information or have any questions.
*
*/
package sun.net;
import java.io.*;
/**
* This class provides input and output streams for telnet clients.
* This class overrides write to do CRLF processing as specified in
* RFC 854. The class assumes it is running on a system where lines
* are terminated with a single newline <LF> character.
*
* This is the relevant section of RFC 824 regarding CRLF processing:
*
* <pre>
* The sequence "CR LF", as defined, will cause the NVT to be
* positioned at the left margin of the next print line (as would,
* for example, the sequence "LF CR"). However, many systems and
* terminals do not treat CR and LF independently, and will have to
* go to some effort to simulate their effect. (For example, some
* terminals do not have a CR independent of the LF, but on such
* terminals it may be possible to simulate a CR by backspacing.)
* Therefore, the sequence "CR LF" must be treated as a single "new
* line" character and used whenever their combined action is
* intended; the sequence "CR NUL" must be used where a carriage
* return alone is actually desired; and the CR character must be
* avoided in other contexts. This rule gives assurance to systems
* which must decide whether to perform a "new line" function or a
* multiple-backspace that the TELNET stream contains a character
* following a CR that will allow a rational decision.
*
* Note that "CR LF" or "CR NUL" is required in both directions
* (in the default ASCII mode), to preserve the symmetry of the
* NVT model. Even though it may be known in some situations
* (e.g., with remote echo and suppress go ahead options in
* effect) that characters are not being sent to an actual
* printer, nonetheless, for the sake of consistency, the protocol
* requires that a NUL be inserted following a CR not followed by
* a LF in the data stream. The converse of this is that a NUL
* received in the data stream after a CR (in the absence of
* options negotiations which explicitly specify otherwise) should
* be stripped out prior to applying the NVT to local character
* set mapping.
* </pre>
*
* @version 1.21, 08/19/02
* @author Jonathan Payne
*/
public class TelnetOutputStream extends BufferedOutputStream {
boolean stickyCRLF = false;
boolean seenCR = false;
public boolean binaryMode = false;
public TelnetOutputStream(OutputStream fd, boolean binary) {
super(fd);
binaryMode = binary;
}
/**
* Writes the int to the stream and does CR LF processing if necessary.
*/
public void write(int c) throws IOException {
if (binaryMode)
super.write(c);
else {
if (seenCR) {
if (c != '\n')
super.write(0);
} else if (c == '\r') {
if (stickyCRLF)
seenCR = true;
else {
super.write('\r');
c = 0;
}
}
super.write(c);
}
}
/**
* Write the bytes at offset <i>off</i> in buffer <i>bytes</i> for
* <i>length</i> bytes.
*/
public void write(byte bytes[], int off, int length) throws IOException {
if (binaryMode) {
super.write(bytes, off, length);
return;
}
while (--length >= 0) {
write(bytes[off++]);
}
}
}
|
[
"clamp03@gmail.com"
] |
clamp03@gmail.com
|
aabdcc1ce7c9c3f81b80692b3aa235731f3a51fa
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/9/9_c6924fdcf0b8676ab1be0240fb572d5d212e2386/RuleFlowImportsDialog/9_c6924fdcf0b8676ab1be0240fb572d5d212e2386_RuleFlowImportsDialog_t.java
|
1a99db416518889f0b9c7c91b4ecd8b6df607bbc
|
[] |
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,092
|
java
|
/*
* Copyright 2005 JBoss 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 org.drools.eclipse.flow.ruleflow.view.property.constraint;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.drools.eclipse.editors.DRLSourceViewerConfig;
import org.drools.eclipse.editors.scanners.DRLPartionScanner;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.reconciler.IReconciler;
import org.eclipse.jface.text.rules.FastPartitioner;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.jbpm.process.core.Process;
import org.jbpm.workflow.core.WorkflowProcess;
/**
* Dialog for editing imports.
*/
public class RuleFlowImportsDialog extends Dialog {
private static final Pattern IMPORT_PATTERN = Pattern.compile(
"\\n\\s*import\\s+([^\\s;#]+);?", Pattern.DOTALL);
private static final Pattern FUNCTION_IMPORT_PATTERN = Pattern.compile(
"\\n\\s*import\\s+function\\s+([^\\s;#]+);?", Pattern.DOTALL);
private WorkflowProcess process;
private boolean success;
private TabFolder tabFolder;
private SourceViewer importsViewer;
private List<String> imports;
private List<String> functionImports;
public RuleFlowImportsDialog(Shell parentShell, WorkflowProcess process) {
super(parentShell);
this.process = process;
setShellStyle(getShellStyle() | SWT.RESIZE);
}
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText("Imports editor");
}
protected Point getInitialSize() {
return new Point(600, 450);
}
private Control createTextualEditor(Composite parent) {
importsViewer = new SourceViewer(parent, null, SWT.BORDER);
importsViewer.configure(new DRLSourceViewerConfig(null) {
public IReconciler getReconciler(ISourceViewer sourceViewer) {
return null;
}
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
IContentAssistProcessor completionProcessor = new ImportCompletionProcessor();
assistant.setContentAssistProcessor(
completionProcessor, IDocument.DEFAULT_CONTENT_TYPE);
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
return assistant;
}
});
IDocument document = new Document(getProcessImports());
importsViewer.setDocument(document);
IDocumentPartitioner partitioner =
new FastPartitioner(
new DRLPartionScanner(),
DRLPartionScanner.LEGAL_CONTENT_TYPES);
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
importsViewer.getControl().addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) {
if (e.character == ' ' && e.stateMask == SWT.CTRL) {
importsViewer.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
}
}
public void keyReleased(KeyEvent e) {
}
});
return importsViewer.getControl();
}
private String getProcessImports() {
String result = "// define your imports here: e.g. import com.sample.MyClass\n";
List<String> imports = ((Process) process).getImports();
if (imports != null) {
for (String importString: imports) {
result += "import " + importString + "\n";
}
}
imports = process.getFunctionImports();
if (imports != null) {
for (String importString: imports) {
result += "import function " + importString + "\n";
}
}
return result;
}
public Control createDialogArea(Composite parent) {
GridLayout layout = new GridLayout();
parent.setLayout(layout);
layout.numColumns = 1;
tabFolder = new TabFolder(parent, SWT.NONE);
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
gd.verticalAlignment = GridData.FILL;
gd.horizontalAlignment = GridData.FILL;
tabFolder.setLayoutData(gd);
TabItem textEditorTab = new TabItem(tabFolder, SWT.NONE);
textEditorTab.setText("Imports");
textEditorTab.setControl(createTextualEditor(tabFolder));
return tabFolder;
}
protected void okPressed() {
success = true;
updateImports();
super.okPressed();
}
public boolean isSuccess() {
return success;
}
public List<String> getImports() {
return imports;
}
public List<String> getFunctionImports() {
return functionImports;
}
private void updateImports() {
this.imports = new ArrayList<String>();
Matcher matcher = IMPORT_PATTERN.matcher(importsViewer.getDocument().get());
while (matcher.find()) {
String importString = matcher.group(1);
if (!"function".equals(importString)) {
this.imports.add(importString);
}
}
this.functionImports = new ArrayList<String>();
matcher = FUNCTION_IMPORT_PATTERN.matcher(importsViewer.getDocument().get());
while (matcher.find()) {
this.functionImports.add(matcher.group(1));
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
8c0742fb8a94ab7f60a2aa98ad229eae95b557a9
|
4c6adf0ce6ef3f02dcef9c345e0e5e4ff139d886
|
/Common/FO/fo-jar/fo-bank-corporate-api/src/main/java/com/pay/fo/bankcorp/common/BankCorpTransCode.java
|
97554cdebfdc6da57e20f0aaec2a5fe43c8ee40d
|
[] |
no_license
|
happyjianguo/pay-1
|
8631906be62707316f0ed3eb6b2337c90d213bc0
|
40ae79738cfe4e5d199ca66468f3a33e9d8f2007
|
refs/heads/master
| 2020-07-27T19:51:54.958859
| 2016-12-19T07:34:24
| 2016-12-19T07:34:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 721
|
java
|
/**
*
*/
package com.pay.fo.bankcorp.common;
/**
* @author new
*
*/
public enum BankCorpTransCode {
ERROR("9999","异常"),
PAYMENT_ORDER("0001","支付订单"),
QUERY_TRADE_STATUS("0002","查询交易状态"),
QUERY_BANK_ACC_BALANCE("0003","查询银行账号余额");
private String value;
private String desc;
private BankCorpTransCode(String val,String desc){
this.value = val;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
public BankCorpTransCode get(String val){
for (BankCorpTransCode element : BankCorpTransCode.values()) {
if(element.getValue().equals(val)){
return element;
}
}
return null;
}
}
|
[
"stanley.zou@hrocloud.com"
] |
stanley.zou@hrocloud.com
|
428b24668e5bb285c9a47cba0b796acc1860fda4
|
8553367f97586cfb9e878fcaffe7a11b912dbc96
|
/jdk-source/jdk1.8/src/main/java/org/omg/PortableInterceptor/USER_EXCEPTION.java
|
90e6180d7b300e67462c7bc915ee313f127c89c1
|
[] |
no_license
|
GoldWater16/GoldWater
|
92abb6b4f2e448469408771d8aad96a9b412aa0a
|
8180d5689c8059c0fe9fbbe2770e8f6947d35c73
|
refs/heads/master
| 2023-07-20T12:30:06.481550
| 2022-05-21T15:27:09
| 2022-05-21T15:27:09
| 174,562,633
| 2
| 3
| null | 2023-07-13T17:02:44
| 2019-03-08T15:36:04
|
Java
|
UTF-8
|
Java
| false
| false
| 689
|
java
|
package org.omg.PortableInterceptor;
/**
* org/omg/PortableInterceptor/USER_EXCEPTION.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u60/4407/corba/src/share/classes/org/omg/PortableInterceptor/Interceptors.idl
* Tuesday, August 4, 2015 11:07:53 AM PDT
*/
public interface USER_EXCEPTION
{
/**
* Indicates a UserException reply status. One possible value for
* <code>RequestInfo.reply_status</code>.
* @see RequestInfo#reply_status
* @see SUCCESSFUL
* @see SYSTEM_EXCEPTION
* @see LOCATION_FORWARD
* @see TRANSPORT_RETRY
*/
public static final short value = (short)(2);
}
|
[
"huzewu@lecloudpay.com"
] |
huzewu@lecloudpay.com
|
f116b38962fa8e7b29db601ba11b944d73dabb58
|
92dd6bc0a9435c359593a1f9b309bb58d3e3f103
|
/src/May2021GoogLeetcode/_0094BinaryTreeInorderTraversal.java
|
7458a5b27ae409702100946bce92929cc7c01ccc
|
[
"MIT"
] |
permissive
|
darshanhs90/Java-Coding
|
bfb2eb84153a8a8a9429efc2833c47f6680f03f4
|
da76ccd7851f102712f7d8dfa4659901c5de7a76
|
refs/heads/master
| 2023-05-27T03:17:45.055811
| 2021-06-16T06:18:08
| 2021-06-16T06:18:08
| 36,981,580
| 3
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 935
|
java
|
package May2021GoogLeetcode;
import java.util.ArrayList;
import java.util.List;
public class _0094BinaryTreeInorderTraversal {
static public class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode() {
}
TreeNode(int val) {
this.val = val;
}
TreeNode(int val, TreeNode left, TreeNode right) {
this.val = val;
this.left = left;
this.right = right;
}
}
public static void main(String[] args) {
TreeNode tn = new TreeNode(1);
tn.right = new TreeNode(2);
tn.right.left = new TreeNode(3);
System.out.println(inorderTraversal(tn));
}
public static List<Integer> inorderTraversal(TreeNode root) {
List<Integer> output = new ArrayList<Integer>();
inorder(root, output);
return output;
}
public static void inorder(TreeNode root, List<Integer> output) {
if (root == null)
return;
inorder(root.left, output);
output.add(root.val);
inorder(root.right, output);
}
}
|
[
"hsdars@gmail.com"
] |
hsdars@gmail.com
|
2045c684791481b79b03151d5c7d2ad110ab9d4d
|
38ae33ee28f3836f6d77b46917825c9f9a07729e
|
/test_examples/src/com/test/example/LongestCommonSubstring.java
|
70f713fd36a1d242a17d5596c6965f10f3aa5fe9
|
[] |
no_license
|
chinmaysept/java_general
|
c4f771cd30cffdcd24870f93ea699ac4703e838c
|
cb391b0dd1a3908814f6f3d1c26251576afa9c74
|
refs/heads/master
| 2022-12-22T20:25:16.680389
| 2019-11-14T08:44:53
| 2019-11-14T08:44:53
| 221,638,495
| 0
| 0
| null | 2022-12-16T03:32:16
| 2019-11-14T07:36:18
|
Java
|
UTF-8
|
Java
| false
| false
| 1,942
|
java
|
package com.test.example;
import java.util.HashSet;
import java.util.Set;
public class LongestCommonSubstring {
public static int find(char[] A, char[] B) {
int[][] LCS = new int[A.length + 1][B.length + 1];
// if A is null then LCS of A, B =0
for (int i = 0; i <= B.length; i++) {
LCS[0][i] = 0;
}
// if B is null then LCS of A, B =0
for (int i = 0; i <= A.length; i++) {
LCS[i][0] = 0;
}
// fill the rest of the matrix
for (int i = 1; i <= A.length; i++) {
for (int j = 1; j <= B.length; j++) {
if (A[i - 1] == B[j - 1]) {
LCS[i][j] = LCS[i - 1][j - 1] + 1;
} else {
LCS[i][j] = 0;
}
}
}
int result = -1;
for (int i = 0; i <= A.length; i++) {
for (int j = 0; j <= B.length; j++) {
if (result < LCS[i][j]) {
result = LCS[i][j];
}
}
}
return result;
}
public static Set<String> longestCommonSubstrings(String s, String t) {
int[][] table = new int[s.length()][t.length()];
int longest = 0;
Set<String> result = new HashSet<>();
for (int i = 0; i < s.length(); i++) {
for (int j = 0; j < t.length(); j++) {
if (s.charAt(i) != t.charAt(j)) {
continue;
}
table[i][j] = (i == 0 || j == 0) ? 1
: 1 + table[i - 1][j - 1];
if (table[i][j] > longest) {
longest = table[i][j];
result.clear();
}
if (table[i][j] == longest) {
result.add(s.substring(i - longest + 1, i + 1));
}
}
}
return result;
}
public static void main(String[] args) {
String A = "Hello";
String B = "Mello";
/*System.out.println("LCS length : "
+ find(A.toCharArray(), B.toCharArray()));*/
System.out.println(longestCommonSubstrings(A,B));
}
}
|
[
"chinmaya.sept@rediffmail.com"
] |
chinmaya.sept@rediffmail.com
|
03c988950be11fefa9a775b1ca1d1f82041ec35e
|
09feac7578002c1cb732b808946d911a17c2d61f
|
/gosu-xml/src/main/java/gw/internal/schema/gw/xsd/w3c/xmlschema/types/complex/NumFacet.java
|
a43a5614faf1836be8dd7f7dea79d579cafa410a
|
[] |
no_license
|
gosu-lang/gosu-pl
|
56cbb1592f6fc149e5de9905c0747eb4f227a471
|
5db623100b6c8ea6877bdc9f13a4a5e111a58812
|
refs/heads/master
| 2021-01-13T09:45:21.796743
| 2016-12-13T23:11:22
| 2016-12-13T23:11:22
| 69,290,008
| 2
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,866
|
java
|
package gw.internal.schema.gw.xsd.w3c.xmlschema.types.complex;
/***************************************************************************/
/* THIS IS AUTOGENERATED CODE - DO NOT MODIFY OR YOUR CHANGES WILL BE LOST */
/* THIS CODE CAN BE REGENERATED USING 'xsd-codegen' */
/***************************************************************************/
public class NumFacet extends gw.internal.schema.gw.xsd.w3c.xmlschema.types.complex.Facet implements gw.internal.xml.IXmlGeneratedClass {
public static final javax.xml.namespace.QName $ATTRIBUTE_QNAME_Fixed = new javax.xml.namespace.QName( "", "fixed", "" );
public static final javax.xml.namespace.QName $ATTRIBUTE_QNAME_Id = new javax.xml.namespace.QName( "", "id", "" );
public static final javax.xml.namespace.QName $ATTRIBUTE_QNAME_Value = new javax.xml.namespace.QName( "", "value", "" );
public static final javax.xml.namespace.QName $ELEMENT_QNAME_Annotation = new javax.xml.namespace.QName( "http://www.w3.org/2001/XMLSchema", "annotation", "xs" );
public static final javax.xml.namespace.QName $QNAME = new javax.xml.namespace.QName( "http://www.w3.org/2001/XMLSchema", "numFacet", "xs" );
public static final gw.util.concurrent.LockingLazyVar<gw.lang.reflect.IType> TYPE = new gw.util.concurrent.LockingLazyVar<gw.lang.reflect.IType>( gw.lang.reflect.TypeSystem.getGlobalLock() ) {
@Override
protected gw.lang.reflect.IType init() {
return gw.lang.reflect.TypeSystem.getByFullName( "gw.xsd.w3c.xmlschema.types.complex.NumFacet" );
}
};
private static final gw.util.concurrent.LockingLazyVar<java.lang.Object> SCHEMAINFO = new gw.util.concurrent.LockingLazyVar<java.lang.Object>( gw.lang.reflect.TypeSystem.getGlobalLock() ) {
@Override
protected java.lang.Object init() {
gw.lang.reflect.IType type = TYPE.get();
return getSchemaInfoByType( type );
}
};
public NumFacet() {
super( TYPE.get(), SCHEMAINFO.get() );
}
protected NumFacet( gw.lang.reflect.IType type, java.lang.Object schemaInfo ) {
super( type, schemaInfo );
}
public gw.internal.schema.gw.xsd.w3c.xmlschema.Annotation Annotation() {
return (gw.internal.schema.gw.xsd.w3c.xmlschema.Annotation) TYPE.get().getTypeInfo().getProperty( "Annotation" ).getAccessor().getValue( this );
}
public void setAnnotation$( gw.internal.schema.gw.xsd.w3c.xmlschema.Annotation param ) {
TYPE.get().getTypeInfo().getProperty( "Annotation" ).getAccessor().setValue( this, param );
}
public java.lang.Boolean Fixed() {
return (java.lang.Boolean) TYPE.get().getTypeInfo().getProperty( "Fixed" ).getAccessor().getValue( this );
}
public void setFixed$( java.lang.Boolean param ) {
TYPE.get().getTypeInfo().getProperty( "Fixed" ).getAccessor().setValue( this, param );
}
public java.lang.String Id() {
return (java.lang.String) TYPE.get().getTypeInfo().getProperty( "Id" ).getAccessor().getValue( this );
}
public void setId$( java.lang.String param ) {
TYPE.get().getTypeInfo().getProperty( "Id" ).getAccessor().setValue( this, param );
}
@Deprecated
public java.lang.String Value() {
return super.Value();
}
@Deprecated
public void setValue$( java.lang.String param ) {
super.setValue$( param );
}
public java.math.BigInteger Value$$gw_xsd_w3c_xmlschema_types_complex_NumFacet() {
return (java.math.BigInteger) TYPE.get().getTypeInfo().getProperty( "Value" ).getAccessor().getValue( this );
}
public void setValue$$gw_xsd_w3c_xmlschema_types_complex_NumFacet$( java.math.BigInteger param ) {
TYPE.get().getTypeInfo().getProperty( "Value" ).getAccessor().setValue( this, param );
}
@SuppressWarnings( {"UnusedDeclaration"} )
private static final long FINGERPRINT = 2110283714877373226L;
}
|
[
"rsmckinney@hotmail.com"
] |
rsmckinney@hotmail.com
|
2a17c128d559510d47e6711ee404beb0aa2ac973
|
e269c865ee1d9cecd543e08a08f665667076507e
|
/src/main/java/com/hrtxn/flchappinessmall/service/MenuService.java
|
b39db7100d8cd336860f6f52f15de53da0137803
|
[] |
no_license
|
GSIL-Monitor/flc
|
39434612d1f8d52da99c38724113c533df95cc3b
|
d508c206a9247a4d3ff1e79e7798947d88e37316
|
refs/heads/master
| 2020-04-22T09:10:23.678778
| 2019-02-11T18:02:58
| 2019-02-11T18:02:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 353
|
java
|
package com.hrtxn.flchappinessmall.service;
import com.hrtxn.flchappinessmall.pojo.pojoVo.MenuVo;
import java.util.List;
/**
* Author:封润
* Date:2018-11-04 下午 4:35
* Description:<描述>
*/
public interface MenuService {
/**
* 获取全部菜单url 根据等级封装完成
* @return
*/
List<MenuVo> getMenuAll();
}
|
[
"="
] |
=
|
357c5e5a236cc31cebb2156698c6733fd4141648
|
ca26cce035073e4a97fc09f3d3e9377a803748c1
|
/AccumulateWealth/src/com/jucaipen/main/my/QuerryAccountDetail.java
|
8fd9e2a085b368ecbdcc43828729465fe480f449
|
[] |
no_license
|
yanglangfei/jcpserver_news2016
|
945b74868f9d7e0c9df5ab84bdab6598cdfad168
|
b495bf1b09b3e60378710b66505f9f2e915495eb
|
refs/heads/master
| 2020-05-21T17:54:46.873139
| 2017-03-17T10:00:02
| 2017-03-17T10:00:02
| 61,979,144
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 2,835
|
java
|
package com.jucaipen.main.my;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jucaipen.model.Account;
import com.jucaipen.model.AccountDetail;
import com.jucaipen.model.ClientOsInfo;
import com.jucaipen.service.AccountDetailSer;
import com.jucaipen.service.AccountSer;
import com.jucaipen.utils.HeaderUtil;
import com.jucaipen.utils.JsonUtil;
import com.jucaipen.utils.StringUtil;
/**
* @author Administrator
*
* 获取账单详细信息 state 0 聚财币 1 积分
*/
public class QuerryAccountDetail extends HttpServlet {
private static final long serialVersionUID = -5370364459925577430L;
private String result;
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String userAgent=request.getParameter("User-Agent");
ClientOsInfo os=HeaderUtil.getMobilOS(userAgent);
int isDevice=HeaderUtil.isVaildDevice(os, userAgent);
if(isDevice==HeaderUtil.PHONE_APP){
String userId = request.getParameter("userId");
String page = request.getParameter("page");
String state = request.getParameter("state");
if (StringUtil.isNotNull(userId)) {
if (StringUtil.isInteger(userId)) {
int uId = Integer.parseInt(userId);
if (uId > 0) {
if (StringUtil.isNotNull(page)
&& StringUtil.isInteger(page)) {
int p = Integer.parseInt(page);
if (StringUtil.isNotNull(state)
&& StringUtil.isInteger(state)) {
int s = Integer.parseInt(state);
result = initAccountData(uId, p, s);
} else {
result = JsonUtil.getRetMsg(1, "state 参数异常");
}
} else {
result = JsonUtil.getRetMsg(1, "page 参数异常");
}
} else {
result = JsonUtil.getRetMsg(1, "该用户还没有登录");
}
} else {
result = JsonUtil.getRetMsg(1, "userId 数字格式化异常");
}
} else {
result = JsonUtil.getRetMsg(1, "userId 参数不能为空");
}
}else{
result=StringUtil.isVaild;
}
out.println(result);
out.flush();
out.close();
}
private String initAccountData(int userId, int page, int state) {
// 初始化账户信息
List<AccountDetail> details = AccountDetailSer
.findDetailByUserIdAndType(userId, state, page);
Account account=AccountSer.findAccountByUserId(userId);
return JsonUtil.getAccountDetail(details,account);
}
}
|
[
"185601452@qq.com"
] |
185601452@qq.com
|
7942837e1333d7934d7e8b0ace23342a1f4b4220
|
6392035b0421990479baf09a3bc4ca6bcc431e6e
|
/projects/infinispan-ce4f6292/curr/core/src/test/java/org/infinispan/partitionhandling/BaseOptimisticTxPartitionAndMergeTest.java
|
42150dc02c73dac3c75ccdad92cd191675a1552f
|
[] |
no_license
|
ameyaKetkar/RMinerEvaluationTools
|
4975130072bf1d4940f9aeb6583eba07d5fedd0a
|
6102a69d1b78ae44c59d71168fc7569ac1ccb768
|
refs/heads/master
| 2020-09-26T00:18:38.389310
| 2020-05-28T17:34:39
| 2020-05-28T17:34:39
| 226,119,387
| 3
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,210
|
java
|
package org.infinispan.partitionhandling;
import org.infinispan.Cache;
import org.infinispan.commands.tx.TransactionBoundaryCommand;
import org.infinispan.configuration.cache.CacheMode;
import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.transaction.LockingMode;
import org.infinispan.transaction.TransactionMode;
import org.infinispan.transaction.lookup.DummyTransactionManagerLookup;
import org.infinispan.transaction.tm.DummyTransaction;
import org.infinispan.transaction.tm.DummyTransactionManager;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import static org.testng.AssertJUnit.assertFalse;
import static org.testng.AssertJUnit.assertTrue;
/**
* It tests multiple scenarios where a split can happen during a transaction.
*
* @author Pedro Ruivo
* @since 8.0
*/
public abstract class BaseOptimisticTxPartitionAndMergeTest extends BaseTxPartitionAndMergeTest {
protected static final String OPTIMISTIC_TX_CACHE_NAME = "opt-cache";
@Override
protected void createCacheManagers() throws Throwable {
super.createCacheManagers();
ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC);
builder.clustering().partitionHandling().enabled(true);
builder.transaction().lockingMode(LockingMode.OPTIMISTIC).transactionMode(TransactionMode.TRANSACTIONAL).transactionManagerLookup(new DummyTransactionManagerLookup());
defineConfigurationOnAllManagers(OPTIMISTIC_TX_CACHE_NAME, builder);
}
protected abstract void checkLocksDuringPartition(SplitMode splitMode, KeyInfo keyInfo, boolean discard);
protected abstract boolean forceRollback();
protected abstract Class<? extends TransactionBoundaryCommand> getCommandClass();
protected void doTest(final SplitMode splitMode, boolean txFail, boolean discard) throws Exception {
waitForClusterToForm(OPTIMISTIC_TX_CACHE_NAME);
final KeyInfo keyInfo = createKeys(OPTIMISTIC_TX_CACHE_NAME);
final Cache<Object, String> originator = cache(0, OPTIMISTIC_TX_CACHE_NAME);
final FilterCollection filterCollection = createFilters(OPTIMISTIC_TX_CACHE_NAME, discard, getCommandClass(), splitMode);
Future<Void> put = fork(() -> {
final DummyTransactionManager transactionManager = (DummyTransactionManager) originator.getAdvancedCache().getTransactionManager();
transactionManager.begin();
keyInfo.putFinalValue(originator);
final DummyTransaction transaction = transactionManager.getTransaction();
transaction.runPrepare();
transaction.runCommit(forceRollback());
transaction.throwRollbackExceptionIfAny();
return null;
});
filterCollection.await(30, TimeUnit.SECONDS);
splitMode.split(this);
filterCollection.unblock();
try {
put.get();
assertFalse(txFail);
} catch (ExecutionException e) {
assertTrue(txFail);
}
checkLocksDuringPartition(splitMode, keyInfo, discard);
mergeCluster();
finalAsserts(OPTIMISTIC_TX_CACHE_NAME, keyInfo, txFail ? INITIAL_VALUE : FINAL_VALUE);
}
}
|
[
"ask1604@gmail.com"
] |
ask1604@gmail.com
|
017c9854fb22063e059d566a551d4c06b7a20a83
|
7aa02f902ad330c70b0b34ec2d4eb3454c7a3fc1
|
/com/google/android/gms/p046a/C0587f.java
|
cfbabd0d542fac254a518399e154c4e6820cd567
|
[] |
no_license
|
hisabimbola/andexpensecal
|
5e42c7e687296fae478dfd39abee45fae362bc5b
|
c47e6f0a1a6e24fe1377d35381b7e7e37f1730ee
|
refs/heads/master
| 2021-01-19T15:20:25.262893
| 2016-08-11T16:00:49
| 2016-08-11T16:00:49
| 100,962,347
| 1
| 0
| null | 2017-08-21T14:48:33
| 2017-08-21T14:48:33
| null |
UTF-8
|
Java
| false
| false
| 263
|
java
|
package com.google.android.gms.p046a;
/* renamed from: com.google.android.gms.a.f */
public class C0587f extends Exception {
public C0587f(String str) {
super(str);
}
public C0587f(String str, Throwable th) {
super(str, th);
}
}
|
[
"m.ravinther@yahoo.com"
] |
m.ravinther@yahoo.com
|
3ae7d6f51a19741ce213dcead8f5c2b42029fe2e
|
1d73232ed967213d44af9d75f4bd965ef342c0c3
|
/NeuralNetworkThingyBackup/programNode/Nodule.java
|
165358961860782bb60e3c05e14feadef2cc3add
|
[] |
no_license
|
sirkibsirkib/old_B_CS_code
|
8e95ac5345ef83f8ef17da34ec4ae0632a7885a6
|
bbaed7bdde2c803e788423cf5e84007bf883720f
|
refs/heads/master
| 2021-05-07T22:43:55.487410
| 2017-10-17T14:52:46
| 2017-10-17T14:52:46
| 107,283,289
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,577
|
java
|
package programNode;
import program.DoubleRow;
import program.Runner;
public class Nodule implements Node{
private NodeRow points;
private DoubleRow weights;
private String name;
private double stimulation,
fireCap,
x,
y;
private boolean fired;
public Nodule(String name, double x, double y){
this.name = name;
points = new NodeRow();
weights = new DoubleRow();
stimulation = 0;
fireCap = FIRE_DOUBLE;
this.x = x;
this.y = y;
fired = false;
}
public void removeRandomPoint(){
points.remove(Runner.rng(getNumberOfPoints()));
}
public void pointTo(Node other, double weight){
points.add(other);
weights.add(weight);
other.incrimentFireCap(1);
}
public void stimulate(double stimulation){
if(stimulation >= 1) return; //only fires once
this.stimulation += stimulation;
if(this.stimulation >= fireCap){
fire();
}
}
public void fire(){
fired = true;
for(int i = 0; i < points.getNumberOfNodes(); i++){
points.getNode(i).stimulate(weights.getDouble(i));
}
}
public void resetFire(){
fired = false;
stimulation = 0;
}
//GETS
public String getName(){
return name;
}
public double getX(){
return x;
}
public double getY(){
return y;
}
public int getNumberOfPoints(){
return points.getNumberOfNodes();
}
public double getXofPointedAtIndex(int index){
return points.getNode(index).getX();
}
public double getYofPointedAtIndex(int index){
return points.getNode(index).getY();
}
public double getWeightOfPoint(int index){
return weights.getDouble(index);
}
public boolean doesPointTo(Node to){
for(int i = 0; i < points.getNumberOfNodes(); i++){
if(points.getNode(i) == to){
return true;
}
}
return false;
}
public boolean didFire(){
return fired;
}
public void incrimentFireCap(int multiplicity){
fireCap += FIRE_DOUBLE*multiplicity;
}
public void decrementFireCap(int multiplicity){
fireCap -= FIRE_DOUBLE*multiplicity;
}
public Node duplicate() {
return new Nodule(name, x, y);
}
public PointVector[] getPointVectors() {
int numVectors = points.getNumberOfNodes();
PointVector[] vectors = new PointVector[numVectors];
for(int i = 0; i < numVectors; i++){
vectors[i] = new PointVector(name, points.getNodeName(i), weights.getDouble(i));
}
return vectors;
}
public void removePointsTo(String s){
int thingsRemoved = points.removeNodesWithNameReturnNumber(s);
if(thingsRemoved > 0){
decrementFireCap(thingsRemoved);
}
}
public boolean isRemovable(){
return 0 < y && y < 1;
}
}
|
[
"christopher.esterhuyse@gmail.com"
] |
christopher.esterhuyse@gmail.com
|
c230415e60f26b6cde14c3aa3c109caba51ac195
|
dd4a8106f9bdb2cb42d192644766fd93cb529eb5
|
/_/02/time-it/src/timeit/biz/test/StringVsStringBuffer.java
|
e0d6b8fec13fb4fd47dfee704373935abb85c521
|
[
"Apache-2.0"
] |
permissive
|
paullewallencom/vaadin-978-1-7821-6226-1
|
42c8b1a503875b9626b83c4fbc74dc50994ff9ab
|
ee8d5a97822834d93c59058b38e35a49055c69a0
|
refs/heads/main
| 2023-02-05T20:29:23.100623
| 2020-12-30T01:29:17
| 2020-12-30T01:29:17
| 319,441,484
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,206
|
java
|
package timeit.biz.test;
import timeit.biz.Test;
import timeit.biz.TestSet;
/**
*
* @author Alejandro Duarte.
*
*/
public class StringVsStringBuffer implements TestSet {
private static final String ADD_THIS = "a";
@SuppressWarnings("unused")
private String s;
private StringBuffer sb;
public class StringTest implements Test {
@Override
public String getName() {
return "String";
}
@Override
public void execute() {
s += "a";
}
}
public class StringBufferTest implements Test {
@Override
public String getName() {
return "StringBuffer";
}
@Override
public void execute() {
sb.append(ADD_THIS);
}
}
@Override
public Test[] getTests() {
return new Test[] {new StringTest(), new StringBufferTest()};
}
@Override
public void init() {
s = "";
sb = new StringBuffer();
}
@Override
public long getDefaultTimes() {
return 100000;
}
@Override
public String getTitle() {
return "String vs StringBuffer";
}
@Override
public String getDescription() {
return "How much do we gain by using StringBuffer instead of String when dealing with strings?";
}
}
|
[
"paullewallencom@users.noreply.github.com"
] |
paullewallencom@users.noreply.github.com
|
061ea55c83e3a306b2001050738a09fd9c88dd91
|
ec7942c929e1fcd16ae302a0b5e0e59378364afa
|
/core-base/core-base/src/main/java/org/nanotek/ImmutableLengthIdBase.java
|
dcfe6d3fecd89cf4b77a9fd2cf08bcf800b4259b
|
[
"Apache-2.0"
] |
permissive
|
JoseCanova/repository-spring-core
|
16e2df2f50efb4d8a9268aa42031d9fae6b15ad1
|
10dd4a39b674180e522f4dd53155e1b2f456298c
|
refs/heads/master
| 2022-12-20T23:48:24.257644
| 2022-05-22T17:10:04
| 2022-05-22T17:10:04
| 249,253,054
| 2
| 1
|
Apache-2.0
| 2022-06-22T18:37:11
| 2020-03-22T19:04:30
|
Java
|
UTF-8
|
Java
| false
| false
| 206
|
java
|
package org.nanotek;
import java.io.Serializable;
public interface ImmutableLengthIdBase<K extends IdBase<K,ID>, L extends Serializable , ID extends Serializable> extends IdBase<K,ID>{
L getLength();
}
|
[
"jose.c.canova@gmail.com"
] |
jose.c.canova@gmail.com
|
5877767dcd437943d2aa6de5e4132f1e97ba65ab
|
09891aaff36ef0db918828a1382041cce1e136e3
|
/src/main/java/ofx/PresentmentListTransactionResponse.java
|
d377b9f3707e5796a402bc75290c07cd6ea1418d
|
[] |
no_license
|
proyleg/InvestiaGenOFX2_mv
|
7f01555282b094581ae773421b23b3cae8656723
|
4d5524717067f66c1bec2d0702fbb8e448588611
|
refs/heads/master
| 2021-01-20T03:21:46.991208
| 2018-12-18T14:48:04
| 2018-12-18T14:48:04
| 89,526,447
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,116
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.12.12 at 04:58:05 PM EST
//
package ofx;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
*
* The OFX element "PRESLISTTRNRS" is of type "PresentmentListTransactionResponse"
*
*
* <p>Java class for PresentmentListTransactionResponse complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="PresentmentListTransactionResponse">
* <complexContent>
* <extension base="{http://ofx.net/types/2003/04}AbstractTransactionResponse">
* <sequence>
* <element name="PRESLISTRS" type="{http://ofx.net/types/2003/04}PresentmentListResponse" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PresentmentListTransactionResponse", propOrder = {
"preslistrs"
})
public class PresentmentListTransactionResponse
extends AbstractTransactionResponse
{
@XmlElement(name = "PRESLISTRS")
protected PresentmentListResponse preslistrs;
/**
* Gets the value of the preslistrs property.
*
* @return
* possible object is
* {@link PresentmentListResponse }
*
*/
public PresentmentListResponse getPRESLISTRS() {
return preslistrs;
}
/**
* Sets the value of the preslistrs property.
*
* @param value
* allowed object is
* {@link PresentmentListResponse }
*
*/
public void setPRESLISTRS(PresentmentListResponse value) {
this.preslistrs = value;
}
}
|
[
"proy_leg@hotmail.com"
] |
proy_leg@hotmail.com
|
c42ea254f5aa4ee705764f09ed819e015c4269ad
|
6ff9748df3de756deda7ea34529b356c298d63e7
|
/bank-txs/src/main/java/com/glarimy/bank/rest/BankController.java
|
64748538cb815fbdfecc7ba9bd64bca5a1998a70
|
[] |
no_license
|
deepanshumehtaa/spring-cloud-microservice
|
50cf4f1ea2ffaff29c727d311069c7f4bb0eb0f0
|
c592a01de798ab8cd8084d62b73f19dafc197e23
|
refs/heads/master
| 2022-11-12T08:14:23.907265
| 2019-08-01T13:28:54
| 2019-08-01T13:28:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,702
|
java
|
package com.glarimy.bank.rest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.util.UriComponentsBuilder;
import com.glarimy.bank.api.Bank;
import com.glarimy.bank.api.Transaction;
@RestController
public class BankController {
@Autowired
private Bank bank;
@PostMapping("/account/{number}/transaction")
public ResponseEntity<Transaction> transact(@PathVariable("number") int number, @RequestParam("type") String type,
@RequestParam("amount") double amount, UriComponentsBuilder builder) {
if (type.equalsIgnoreCase("deposite")) {
Transaction tx = bank.deposite(number, amount);
HttpHeaders headers = new HttpHeaders();
headers.setLocation(
builder.path("/account/{number}/transaction/{id}").buildAndExpand(number, tx.getId()).toUri());
return new ResponseEntity<Transaction>(tx, headers, HttpStatus.CREATED);
} else if (type.equalsIgnoreCase("withdraw")) {
Transaction tx = bank.withdraw(number, amount);
HttpHeaders headers = new HttpHeaders();
headers.setLocation(
builder.path("/account/{number}/transaction/{id}").buildAndExpand(number, tx.getId()).toUri());
return new ResponseEntity<Transaction>(tx, headers, HttpStatus.CREATED);
} else {
return new ResponseEntity<Transaction>(HttpStatus.BAD_REQUEST);
}
}
}
|
[
"krishna@glarimy.com"
] |
krishna@glarimy.com
|
176a83c8e5866b1f9068a6ce50a4dca9314251cf
|
52acbc630e80cf76a8a7c7b7c320b7e18d02c580
|
/src/main/java/sonar/logistics/client/gsi/interactions/text/TextHotKeyFunctions.java
|
d6873e935daee43ccfe5db6ebf59c09219698351
|
[] |
no_license
|
SonarSonic/Practical-Logistics-3
|
2f8d11a9a86545726182dc2121f459332f9c0215
|
bfd78dee190fef0964470549c3e023ddff3a2a61
|
refs/heads/master
| 2021-06-13T03:30:38.550886
| 2021-05-26T14:51:30
| 2021-05-26T14:51:30
| 254,422,436
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,234
|
java
|
package sonar.logistics.client.gsi.interactions.text;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.util.text.ITextComponent;
import sonar.logistics.client.gsi.components.text.AbstractTextComponent;
import sonar.logistics.client.gsi.interactions.GSIInteractionHandler;
import sonar.logistics.client.gui.GSIDesignSettings;
public enum TextHotKeyFunctions {
//cursor move
HOME((handler, key, scanCode, mod) -> key == 268 && !handler.hasShiftDown(), interaction -> {interaction.clearSelection(); interaction.moveCursorToStart(interaction.cursor);}),//
END((handler, key, scanCode, mod) -> key == 269 && !handler.hasShiftDown(), interaction -> {interaction.clearSelection(); interaction.moveCursorToEnd(interaction.cursor);}),//
UP((handler, key, scanCode, mod) -> key == 265 && !handler.hasShiftDown(), interaction -> {interaction.clearSelection(); interaction.moveCursorUp(interaction.cursor);}),//
DOWN((handler, key, scanCode, mod) -> key == 264 && !handler.hasShiftDown(), interaction -> {interaction.clearSelection(); interaction.moveCursorDown(interaction.cursor);}),//
LEFT((handler, key, scanCode, mod) -> key == 263 && !handler.hasShiftDown(), interaction -> {interaction.clearSelection(); interaction.moveCursorLeft(interaction.cursor);}),//
RIGHT((handler, key, scanCode, mod) -> key == 262 && !handler.hasShiftDown(), interaction -> {interaction.clearSelection(); interaction.moveCursorRight(interaction.cursor);}),//
HOME_SHIFT((handler, key, scanCode, mod) -> key == 268 && handler.hasShiftDown(), interaction -> {interaction.checkSelection(); interaction.moveCursorToStart(interaction.selectionEnd);}),//
END_SHIFT((handler, key, scanCode, mod) -> key == 269 && handler.hasShiftDown(), interaction -> {interaction.checkSelection(); interaction.moveCursorToEnd(interaction.selectionEnd);}),//
UP_SHIFT((handler, key, scanCode, mod) -> key == 265 && handler.hasShiftDown(), interaction -> {interaction.checkSelection(); interaction.moveCursorUp(interaction.selectionEnd);}),//
DOWN_SHIFT((handler, key, scanCode, mod) -> key == 264 && handler.hasShiftDown(), interaction -> {interaction.checkSelection(); interaction.moveCursorDown(interaction.selectionEnd);}),//
LEFT_SHIFT((handler, key, scanCode, mod) -> key == 263 && handler.hasShiftDown(), interaction -> {interaction.checkSelection(); interaction.moveCursorLeft(interaction.selectionEnd);}),//
RIGHT_SHIFT((handler, key, scanCode, mod) -> key == 262 && handler.hasShiftDown(), interaction -> {interaction.checkSelection(); interaction.moveCursorRight(interaction.selectionEnd);}),//
//selection move
//format changes
BOLD((handler, key, scanCode, mod) -> key == 78 && handler.hasControlDown() && !handler.hasShiftDown() && !handler.hasAltDown(), interaction -> GSIDesignSettings.toggleBoldStyling()),//
ITALIC((handler, key, scanCode, mod) -> key == 73 && handler.hasControlDown() && !handler.hasShiftDown() && !handler.hasAltDown(), interaction -> GSIDesignSettings.toggleItalicStyling()),//
UNDERLINE((handler, key, scanCode, mod) -> key == 85 && handler.hasControlDown() && !handler.hasShiftDown() && !handler.hasAltDown(), interaction -> GSIDesignSettings.toggleUnderlineStyling()),//
OBFUSCATED((handler, key, scanCode, mod) -> key == 79 && handler.hasControlDown() && !handler.hasShiftDown() && !handler.hasAltDown(), interaction -> GSIDesignSettings.toggleObfuscatedStyling()),//
ENTER((handler, key, scanCode, mod) -> key == 257 && !handler.hasShiftDown(), StandardTextInteraction::enter),//
COPY((handler, key, scanCode, mod) -> Screen.isCopy(key), StandardTextInteraction::copy),//
PASTE((handler, key, scanCode, mod) -> Screen.isPaste(key), StandardTextInteraction::paste),//
CUT((handler, key, scanCode, mod) -> Screen.isCut(key), StandardTextInteraction::cut),//
BACKSPACE((handler, key, scanCode, mod) -> key == 259, i -> i.deleteGlyph(true)),//
DEL((handler, key, scanCode, mod) -> key == 261, i -> i.deleteGlyph(false)),//
//no line required
//SAVE((key, scanCode, mod) -> key == Keyboard.KEY_S && GuiScreen.isCtrlKeyDown() && !GuiScreen.isShiftKeyDown() && !GuiScreen.isAltKeyDown(), (gui, chr, key) -> gui.save()),//
SELECT_ALL((handler, key, scanCode, mod) -> Screen.isSelectAll(key), StandardTextInteraction::selectAll); //
//DESELECT_ALL((key, scanCode, mod) -> c == 4, (gui, chr, key) -> GuiActions.DESELECT_ALL.trigger(gui)); //
public IKeyMatch key;
public ITextFunction textFunction;
TextHotKeyFunctions(IKeyMatch key, ITextFunction textFunction) {
this.key = key;
this.textFunction = textFunction;
}
public static boolean triggerHotKey(StandardTextInteraction textInteraction, GSIInteractionHandler handler, int key, int scanCode, int modifiers) {
for (TextHotKeyFunctions func : TextHotKeyFunctions.values()) {
if (func.key.canTrigger(handler, key, scanCode, modifiers)) {
func.textFunction.trigger(textInteraction);
return true;
}
}
return false;
}
@FunctionalInterface
public interface IKeyMatch {
boolean canTrigger(GSIInteractionHandler handler, int key, int scanCode, int modifiers);
}
@FunctionalInterface
public interface ITextFunction {
void trigger(StandardTextInteraction<AbstractTextComponent> textInteraction);
}
}
|
[
"ollielansdell@hotmail.co.uk"
] |
ollielansdell@hotmail.co.uk
|
c64ae0fa5bffcd5a51ee051058811bcba5c7e672
|
a95eba6c79375e7a6f068104d405613a52fe0fa5
|
/BiglyBT/src/main/java/com/biglybt/android/client/FragmentM.java
|
73366c79ebe9eefe32e9906ab5e686e37a6d5982
|
[] |
no_license
|
coen22/BiglyBT-Android
|
56420008515808d3118f8775c73e164c3a635f6e
|
16ec11198b339c2e2f1d0d417d93748e59729135
|
refs/heads/master
| 2020-04-10T14:43:19.971179
| 2018-12-12T12:55:22
| 2018-12-12T12:55:22
| 161,085,567
| 0
| 0
| null | 2018-12-09T22:03:50
| 2018-12-09T22:03:49
| null |
UTF-8
|
Java
| false
| false
| 6,584
|
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.biglybt.android.client;
import java.util.Arrays;
import android.annotation.SuppressLint;
import android.content.pm.PackageManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.util.LongSparseArray;
import android.util.Log;
/**
* Fragment with permission handing methods
*
* Created by TuxPaper on 3/18/16.
* <p/>
* Duplicate code in {@link AppCompatActivityM}
*/
public class FragmentM
extends Fragment
{
private int requestPermissionID = 0;
private final LongSparseArray<Runnable[]> requestPermissionRunnables = new LongSparseArray<>();
private String classSimpleName;
private class PermissionRequestResults
{
final String[] permissions;
final int[] grantResults;
public PermissionRequestResults(String[] permissions, int[] grantResults) {
this.permissions = permissions;
this.grantResults = grantResults;
}
}
private LongSparseArray<PermissionRequestResults> requestPermissionResults = null;
private boolean isPaused;
public void requestPermissions(String[] permissions, Runnable runnableOnGrant,
@Nullable Runnable runnableOnDeny) {
// requestPermissions supposedly does checkSelfPermission for us, but
// I get prompted anyway, and clicking Revoke (on an already granted perm):
// I/ActivityManager: Killing xxxx:com.vuze.android.client/u0a24 (adj 1): permissions revoked
// Also, requestPermissions assumes PERMISSION_REVOKED on unknown
// permission strings (ex READ_EXTERNAL_STORAGE on API 7)
boolean allGranted = true;
if (permissions.length > 0) {
PackageManager packageManager = getContext().getPackageManager();
for (String permission : permissions) {
try {
packageManager.getPermissionInfo(permission, 0);
} catch (PackageManager.NameNotFoundException e) {
Log.d("Perms", "requestPermissions: Permission " + permission
+ " doesn't exist. Assuming granted.");
continue;
}
if (ActivityCompat.checkSelfPermission(getContext(),
permission) != PackageManager.PERMISSION_GRANTED) {
allGranted = false;
break;
}
}
}
if (allGranted) {
if (AndroidUtils.DEBUG) {
Log.d("Perms", "requestPermissions: allGranted ("
+ Arrays.toString(permissions) + ", running " + runnableOnGrant);
}
if (runnableOnGrant != null) {
runnableOnGrant.run();
}
return;
}
if (AndroidUtils.DEBUG) {
Log.d("Perms", "requestPermissions: requesting "
+ Arrays.toString(permissions) + " for " + runnableOnGrant);
}
requestPermissionRunnables.put(requestPermissionID, new Runnable[] {
runnableOnGrant,
runnableOnDeny
});
requestPermissions(permissions, requestPermissionID);
requestPermissionID++;
}
@Override
public void onPause() {
isPaused = true;
super.onPause();
}
@Override
public void onResume() {
isPaused = false;
super.onResume();
// https://code.google.com/p/android/issues/detail?id=190966
if (requestPermissionResults != null
&& requestPermissionRunnables.size() > 0) {
synchronized (requestPermissionRunnables) {
for (int i = 0; i < requestPermissionResults.size(); i++) {
long requestCode = requestPermissionResults.keyAt(i);
PermissionRequestResults results = requestPermissionResults.get(
requestCode);
if (results != null) {
onRequestPermissionsResult((int) requestCode, results.permissions,
results.grantResults);
}
}
requestPermissionResults = null;
}
}
}
@Override
public void onRequestPermissionsResult(int requestCode,
@NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
Runnable[] runnables = requestPermissionRunnables.get(requestCode);
if (runnables != null) {
if (isPaused) {
// https://code.google.com/p/android/issues/detail?id=190966
// our onResume will call this function again, when it's safe for the
// runnables to open dialogs if they want
if (requestPermissionResults == null) {
requestPermissionResults = new LongSparseArray<>();
}
requestPermissionResults.put(requestCode,
new PermissionRequestResults(permissions, grantResults));
return;
}
requestPermissionRunnables.remove(requestCode);
boolean allGranted = grantResults.length > 0;
if (allGranted) {
for (int grantResult : grantResults) {
if (grantResult != PackageManager.PERMISSION_GRANTED) {
allGranted = false;
break;
}
}
}
if (AndroidUtils.DEBUG) {
Log.d("Perms",
"onRequestPermissionsResult: " + Arrays.toString(permissions) + " "
+ (allGranted ? "granted" : "revoked") + " for "
+ runnables[0]);
}
if (allGranted && runnables[0] != null) {
runnables[0].run();
return;
}
if (!allGranted && runnables[1] != null) {
runnables[1].run();
return;
}
}
}
@Override
public void onStart() {
super.onStart();
AnalyticsTracker.getInstance(this).fragmentResume(this);
}
@Override
public void onStop() {
super.onStop();
AnalyticsTracker.getInstance(this).fragmentPause(this);
}
@SuppressLint("LogConditional")
public void log(String TAG, String s) {
if (classSimpleName == null) {
classSimpleName = AndroidUtils.getSimpleName(getClass()) + "@"
+ Integer.toHexString(hashCode());
}
Log.d(classSimpleName, TAG + ": " + s);
}
@SuppressLint("LogConditional")
public void log(int prority, String TAG, String s) {
if (classSimpleName == null) {
classSimpleName = AndroidUtils.getSimpleName(getClass()) + "@"
+ Integer.toHexString(hashCode());
}
Log.println(prority, classSimpleName, TAG + ": " + s);
}
}
|
[
"725353+TuxPaper@users.noreply.github.com"
] |
725353+TuxPaper@users.noreply.github.com
|
8f72da09e32a4c9801cf266fe8e85234e40f4ff5
|
0b0f5aaf4fc19c1e6b2f4729756d1f08345f3f7a
|
/src/main/java/xutils/utils/UUIDUtils.java
|
cf8464d8d42703ca13ad9285f66a61b3884174c1
|
[] |
no_license
|
spiderII/commonUtils
|
bc6ffd2f5aacdaffeb07df563293d12626c0e35a
|
769f7ddd8f534eae8f434a84f05d6268d5ec784b
|
refs/heads/master
| 2020-11-26T05:01:47.399714
| 2018-01-19T09:39:58
| 2018-01-19T09:39:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,674
|
java
|
package xutils.utils;
import java.net.InetAddress;
/**
* UUID 生成工具类
*
* @author xuan
* @version $Revision: 1.0 $, $Date: 2012-11-22 上午9:54:58 $
*/
public class UUIDUtils {
private static UUIDUtils uuid = new UUIDUtils();
private static final int IP;
static {
int ipadd;
try {
ipadd = toInt(InetAddress.getLocalHost().getAddress());
} catch (Exception e) {
ipadd = 0;
}
IP = ipadd;
}
private static short counter = (short) 0;
private static final int JVM = (int) (System.currentTimeMillis() >>> 8);
/**
* 构造方法
*/
public UUIDUtils() {
}
/**
* 生成16进制表达的字符串 UUID。
*
* @return 32 字节长度的 UUID 字符串
*/
public String generateHex() {
StringBuilder sb = new StringBuilder(32);
sb.append(format(getIP()));
sb.append(format(getJVM()));
sb.append(format(getHighTime()));
sb.append(format(getLowTime()));
sb.append(format(getCount()));
return sb.toString().toUpperCase();
}
/**
* 生成字节数组的UUID
*
* @return
*/
public byte[] generateBytes() {
byte[] bytes = new byte[16];
System.arraycopy(getBytes(getIP()), 0, bytes, 0, 4);
System.arraycopy(getBytes(getJVM()), 0, bytes, 4, 4);
System.arraycopy(getBytes(getHighTime()), 0, bytes, 8, 2);
System.arraycopy(getBytes(getLowTime()), 0, bytes, 10, 4);
System.arraycopy(getBytes(getCount()), 0, bytes, 14, 2);
return bytes;
}
private String format(int intval) {
String formatted = Integer.toHexString(intval);
StringBuilder buf = new StringBuilder("00000000");
buf.replace(8 - formatted.length(), 8, formatted);
return buf.toString();
}
private String format(short shortval) {
String formatted = Integer.toHexString(shortval);
StringBuilder buf = new StringBuilder("0000");
buf.replace(4 - formatted.length(), 4, formatted);
return buf.toString();
}
/**
* Unique across JVMs on this machine (unless they load this class in the same quater second - very unlikely)
*/
private int getJVM() {
return JVM;
}
/**
* Unique in a millisecond for this JVM instance (unless there are > Short.MAX_VALUE instances created in a
* millisecond)
*/
private short getCount() {
synchronized (UUIDUtils.class) {
if (counter < 0) {
counter = 0;
}
return counter++;
}
}
/**
* Unique in a local network
*/
private int getIP() {
return IP;
}
/**
* Unique down to millisecond
*/
private short getHighTime() {
return (short) (System.currentTimeMillis() >>> 32);
}
private int getLowTime() {
return (int) System.currentTimeMillis();
}
private static int toInt(byte[] bytes) {
int result = 0;
for (int i = 0; i < 4; i++) {
result = (result << 8) - Byte.MIN_VALUE + bytes[i];
}
return result;
}
private static byte[] getBytes(int intval) {
return new byte[] { (byte) (intval >> 24), (byte) (intval >> 16), (byte) (intval >> 8), (byte) intval };
}
private static byte[] getBytes(short shortval) {
return new byte[] { (byte) (shortval >> 8), (byte) shortval };
}
/**
* 产生新的UUID
*
* @return 32位长的UUID字符串
*/
public static String uuid() {
return uuid.generateHex();
}
}
|
[
"test"
] |
test
|
78a9c5a7576ac325769d89d65ad4c8e11de3e524
|
cba5d5319b6efd200416c348d157fb7b53145f86
|
/SVG-Library/SVG-Plugin/src/main/groovy/com/android/svg/support/model/VectorModel.java
|
a10522a4385efe0a8318917c7a81c18f6d36b4e6
|
[
"Apache-2.0"
] |
permissive
|
chiwenheng/SVG-Android
|
f78dda2109878b7067e1e830da03928db6648182
|
8fe96d4ae449ee81f1779f9a187cad81fc3205a7
|
refs/heads/master
| 2020-06-26T18:15:35.423624
| 2016-11-17T07:34:06
| 2016-11-17T07:34:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 129
|
java
|
package com.android.svg.support.model;
public class VectorModel {
public String name;
public Vector vector;
}
|
[
"jgy08954@ly.com"
] |
jgy08954@ly.com
|
83d00b2a558b85b6a94c786e1a61793a28f429eb
|
2fd9d77d529e9b90fd077d0aa5ed2889525129e3
|
/DecompiledViberSrc/app/src/main/java/com/viber/voip/messages/conversation/adapter/viewbinders/v.java
|
009eef08285246994ba4068ca5e6233275685cb2
|
[] |
no_license
|
cga2351/code
|
703f5d49dc3be45eafc4521e931f8d9d270e8a92
|
4e35fb567d359c252c2feca1e21b3a2a386f2bdb
|
refs/heads/master
| 2021-07-08T15:11:06.299852
| 2021-05-06T13:22:21
| 2021-05-06T13:22:21
| 60,314,071
| 1
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,106
|
java
|
package com.viber.voip.messages.conversation.adapter.viewbinders;
import android.widget.TextView;
import com.viber.dexshared.Logger;
import com.viber.voip.ViberEnv;
import com.viber.voip.messages.conversation.aa;
import com.viber.voip.messages.conversation.adapter.a.a;
import com.viber.voip.messages.conversation.adapter.a.c.a.i;
import com.viber.voip.ui.g.e;
public class v extends e<a, i>
{
private static final Logger a = ViberEnv.getLogger();
private final TextView b;
private final TextView c;
public v(TextView paramTextView1, TextView paramTextView2)
{
this.b = paramTextView1;
this.c = paramTextView2;
}
public void a(a parama, i parami)
{
super.a(parama, parami);
aa localaa = parama.c();
String str1 = localaa.h();
String str2 = parami.c(localaa);
this.b.setText(str1);
this.c.setText(str2);
}
}
/* Location: E:\Study\Tools\apktool2_2\dex2jar-0.0.9.15\classes_viber_3_dex2jar.jar
* Qualified Name: com.viber.voip.messages.conversation.adapter.viewbinders.v
* JD-Core Version: 0.6.2
*/
|
[
"yu.liang@navercorp.com"
] |
yu.liang@navercorp.com
|
f56906405b84171ea11c10c34325a5686ace7ca1
|
e51edc59e2764a0a3498fdc6b76f87060e020392
|
/health_backend/src/main/java/com/itheima/service/SpringSecurityUserService.java
|
75da71faf304b567808a24c229b9a397295a445a
|
[] |
no_license
|
WXCD-LYY/wxcd_health
|
eb2d8dc286018a10c71270e488fce2bf7d622598
|
f2dca0ad6e1b501eb97e8e8256064cc10b8ea08d
|
refs/heads/master
| 2023-06-30T23:12:35.243470
| 2021-07-29T14:39:52
| 2021-07-29T14:39:52
| 326,877,290
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,076
|
java
|
package com.itheima.service;
import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.pojo.Permission;
import com.itheima.pojo.Role;
import com.itheima.pojo.User;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
/**
* @Company: CUG
* @Description: TODO
* @Author: LiYangyong
* @Date: 2021/1/26/026 20:21
**/
@Component
public class SpringSecurityUserService implements UserDetailsService {
// 使用dubbo通过网络远程调用服务提供方获取数据库中的用户信息
@Reference
private UserService userService;
// 根据用户名查询数据库获取用户信息
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
User user = userService.findByUsername(username);
if (user == null) {
// 用户名不存在
return null;
}
List<GrantedAuthority> list = new ArrayList<>();
// 动态为当前用户授权
Set<Role> roles = user.getRoles();
for (Role role : roles) {
// 遍历角色集合,为用户授予角色
list.add(new SimpleGrantedAuthority(role.getKeyword()));
Set<Permission> permissions = role.getPermissions();
for (Permission permission : permissions) {
// 遍历权限集合,为用户授权
list.add(new SimpleGrantedAuthority(permission.getKeyword()));
}
}
org.springframework.security.core.userdetails.User securityUser = new org.springframework.security.core.userdetails.User(username, user.getPassword(), list);
return securityUser;
}
}
|
[
"13222762017@163.com"
] |
13222762017@163.com
|
6390f80a3c2b6c7e7e7bdda2638d445f6ede621c
|
7c6652a58915f184c512ab893a4c07549d435efd
|
/spring-in-action/004.Aspect-oriented_Spring/spring-annotated-aspects/src/main/java/concert/ConcertConfig.java
|
b692c79415f5648c812b305aea15ef210b74aa9c
|
[
"MIT"
] |
permissive
|
lsieun/learn-spring
|
e780d5d76204537a080f9e388b390b140c3ca0cd
|
32e5ca9c2017f321c353b31c4231e496c051e6d7
|
refs/heads/master
| 2021-10-10T17:16:13.297287
| 2019-01-14T12:29:28
| 2019-01-14T12:29:28
| 107,852,693
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 460
|
java
|
package concert;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
@Configuration
@EnableAspectJAutoProxy //Enable AspectJ auto-proxying
@ComponentScan
public class ConcertConfig {
@Bean
public Audience audience() {
return new Audience();
}
}
|
[
"331505785@qq.com"
] |
331505785@qq.com
|
7c63167712a84c46772eaa873d8b3f55cc749572
|
8d6a347b3ee7d5f3abf2144de3ab788e4dfa3162
|
/src/main/java/com/stevesun/solutions/_484.java
|
3ef6731639548e6c301d240be0417521719fa43c
|
[
"Apache-2.0"
] |
permissive
|
Sam-Si/Leetcode
|
3f58b88325ad6a02da0d84c885f08bee8fce8b0d
|
5e7403360cd87c6f32bac05863e4679702f3417c
|
refs/heads/master
| 2021-01-22T03:31:26.751878
| 2017-05-24T15:11:50
| 2017-05-24T15:11:50
| 92,386,586
| 2
| 1
| null | 2017-05-25T09:18:22
| 2017-05-25T09:18:21
| null |
UTF-8
|
Java
| false
| false
| 2,509
|
java
|
package com.stevesun.solutions;
/**
484. Find Permutation
* By now, you are given a secret signature consisting of character 'D' and 'I'.
* 'D' represents a decreasing relationship between two numbers, 'I' represents an increasing relationship between two numbers.
* And our secret signature was constructed by a special integer array, which contains uniquely all the different number from 1 to n (n is the length of the secret signature plus 1).
* For example, the secret signature "DI" can be constructed by array [2,1,3] or [3,1,2],
* but won't be constructed by array [3,2,4] or [2,1,3,4], which are both illegal constructing special string that can't represent the "DI" secret signature.
On the other hand, now your job is to find the lexicographically smallest permutation of [1, 2, ... n] could refer to the given secret signature in the input.
Example 1:
Input: "I"
Output: [1,2]
Explanation: [1,2] is the only legal initial spectial string can construct secret signature "I", where the number 1 and 2 construct an increasing relationship.
Example 2:
Input: "DI"
Output: [2,1,3]
Explanation: Both [2,1,3] and [3,1,2] can construct the secret signature "DI",
but since we want to find the one with the smallest lexicographical permutation, you need to output [2,1,3]
Note:
The input string will only contain the character 'D' and 'I'.
The length of input string is a positive integer and will not exceed 10,000
*/
public class _484 {
/**credit:https://discuss.leetcode.com/topic/76221/java-o-n-clean-solution-easy-to-understand
*
For example, given IDIIDD we start with sorted sequence 1234567
Then for each k continuous D starting at index i we need to reverse [i, i+k] portion of the sorted sequence.
e.g.
IDIIDD
1234567 // sorted
1324765 // answer
*/
public int[] findPermutation(String s) {
int[] result = new int[s.length()+1];
for (int i = 0; i <= s.length(); i++) result[i] = i+1;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == 'D') {
int left = i;
while (i < s.length() && s.charAt(i) == 'D') i++;
reverse(result, left, i);
}
}
return result;
}
private void reverse(int[] result, int left, int i) {
while (left < i) {
int temp = result[left];
result[left] = result[i];
result[i] = temp;
left++;
i--;
}
}
}
|
[
"stevesun@coupang.com"
] |
stevesun@coupang.com
|
25590970132e20a1f8cddb01cc7827ed84ce93d2
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/28/28_f774b12840b659fe47fe77f6ca509712bed1a477/Neighborhood/28_f774b12840b659fe47fe77f6ca509712bed1a477_Neighborhood_s.java
|
0caaac769a9b4da3bf8234b785087af22f1aa2f2
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 4,105
|
java
|
package agent;
import java.util.ArrayList;
import java.util.List;
import board.Board;
import board.Cell;
public class Neighborhood {
public enum Direction {
TOP, TOPRIGHT, RIGHT, BOTTOMRIGHT, BOTTOM, BOTTOMLEFT, LEFT, TOPLEFT;
/**
* Potrzebne miedzy innymi do badania zagrozenia.
*
* @param dir
* zadany kierunek
* @return kierunek przeciwny do podanego
*/
public static Direction getOppositeDir(Direction dir) {
Direction opposite = null;
switch (dir) {
case TOP:
opposite = BOTTOM;
break;
case TOPRIGHT:
opposite = BOTTOMLEFT;
break;
case RIGHT:
opposite = LEFT;
break;
case BOTTOMRIGHT:
opposite = TOPLEFT;
break;
case BOTTOM:
opposite = TOP;
break;
case BOTTOMLEFT:
opposite = TOPRIGHT;
break;
case LEFT:
opposite = RIGHT;
break;
case TOPLEFT:
opposite = BOTTOMRIGHT;
break;
}
return opposite;
}
}
/**
* 9 to Agent, 0 to komrka nie brana pod uwag
*
* Tylko na razie tak "na pa"... ;]
*/
private static final Direction[] translateMask = { null, Direction.TOP,
Direction.TOPRIGHT, Direction.RIGHT, Direction.BOTTOMRIGHT,
Direction.BOTTOM, Direction.BOTTOMLEFT, Direction.LEFT,
Direction.TOPLEFT, null };
private static final int[][] mask = {
{ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0 },
{ 0, 0, 8, 8, 1, 1, 1, 1, 1, 2, 2, 0, 0 },
{ 0, 8, 8, 8, 8, 1, 1, 1, 2, 2, 2, 2, 0 },
{ 0, 7, 8, 8, 8, 1, 1, 1, 2, 2, 2, 3, 0 },
{ 0, 7, 7, 7, 8, 8, 1, 2, 2, 3, 3, 3, 0 },
{ 7, 7, 7, 7, 7, 7, 9, 3, 3, 3, 3, 3, 3 },
{ 0, 0, 7, 7, 6, 6, 5, 4, 4, 3, 3, 0, 0 },
{ 0, 0, 0, 6, 6, 5, 5, 5, 4, 4, 0, 0, 0 },
{ 0, 0, 0, 0, 6, 5, 5, 5, 4, 0, 0, 0, 0 } };
private static int cell9X = -1, cell9Y = -1;
private Agent.Orientation orientation;
private Cell firstCell;
private List<Cell> cells;
private int x, y;
private float temperature;
public Neighborhood(Board board, Agent agent, Direction direction) {
findCell9();
orientation = agent.getOrientation();
x = agent.getPosition().getX();
y = agent.getPosition().getY();
findAllCellsOfDirection(board, direction);
computeAverages();
}
private void computeAverages() {
float temperature = 0.0f;
float minDist = Float.POSITIVE_INFINITY;
for (Cell cell : cells) {
// temp
temperature += cell.getTemperature();
// which cell is first?
float dist = (float) Math.sqrt(Math.pow(cell.getX() - x, 2)
+ Math.pow(cell.getY() - y, 2));
if (dist < minDist) {
minDist = dist;
firstCell = cell;
}
}
this.temperature = temperature / cells.size();
}
private void findAllCellsOfDirection(Board board, Direction direction) {
cells = new ArrayList<Cell>();
for (int mx = 0; mx < mask.length; mx++)
for (int my = 0; my < mask[mx].length; my++)
if (translateMask[mask[mx][my]] == direction) {
Cell tmp = board.getCellAt(
x + tx(mx - cell9X, my - cell9Y),
y + ty(mx - cell9X, my - cell9Y));
if (tmp != null)
cells.add(tmp);
}
}
/**
* Obracanie wzgldnych wsprzdnych...
*
* @param x
* @param y
* @return
*/
private int tx(int x, int y) {
switch (orientation) {
default:
return x;
case SOUTH:
return -x;
case EAST:
return -y;
case WEST:
return y;
}
}
private int ty(int x, int y) {
switch (orientation) {
default:
return y;
case SOUTH:
return -y;
case EAST:
return x;
case WEST:
return -x;
}
}
private void findCell9() {
if (cell9X != -1 && cell9Y != -1)
return;
for (int x = 0; x < mask.length; x++)
for (int y = 0; y < mask[x].length; y++)
if (mask[x][y] == 9) {
cell9X = x;
cell9Y = y;
break;
}
}
public float getTemperature() {
return temperature;
}
public Cell getFirstCell() {
return firstCell;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
0679796fc45ea42000f67ba8573023f0d3bbedf3
|
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
|
/program_data/JavaProgramData/68/760.java
|
5810ac57e580802bfba8919e92732066b5b665ae
|
[
"MIT"
] |
permissive
|
qiuchili/ggnn_graph_classification
|
c2090fefe11f8bf650e734442eb96996a54dc112
|
291ff02404555511b94a4f477c6974ebd62dcf44
|
refs/heads/master
| 2021-10-18T14:54:26.154367
| 2018-10-21T23:34:14
| 2018-10-21T23:34:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 771
|
java
|
package <missing>;
public class GlobalMembers
{
public static void Main()
{
int n;
int i;
int j;
int k;
int t;
int m;
float a;
float b;
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
n = Integer.parseInt(tempVar);
}
for (m = 6;m <= n;m++)
{
if (m % 2 == 0)
{
System.out.printf("%ld=",m);
for (i = 3;i <= m - 3;i++)
{
a = Math.sqrt(i);
for (k = 2;k <= a;k++)
{
if (i % k == 0)
{
break;
}
}
if (k > a)
{
t = m - i;
b = Math.sqrt(t);
for (j = 2;j <= b;j++)
{
if (t % j == 0)
{
break;
}
}
if (j > b)
{
System.out.printf("%d+%d\n",i,t);
break;
}
}
}
}
}
}
}
|
[
"y.yu@open.ac.uk"
] |
y.yu@open.ac.uk
|
1425d8160ac751a21d91e647880c15ab05cd0cfc
|
2636b9ce828a7862d93ca19521bfec89e8530a2c
|
/turms-gateway/src/main/java/im/turms/gateway/infra/proto/TurmsRequestParser.java
|
b173783f3cb2e6c0ca6f954feb0e55e958356ef7
|
[
"LicenseRef-scancode-proprietary-license",
"Apache-2.0",
"AGPL-3.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"SSPL-1.0"
] |
permissive
|
turms-im/turms
|
f1ccbc78175a176b3f5edf34b2b2badc901dcece
|
33bef70a5737c23adea72c6ba150b851bee6bfb6
|
refs/heads/develop
| 2023-09-01T17:02:03.053493
| 2023-08-23T13:53:21
| 2023-08-23T14:04:20
| 191,290,973
| 1,506
| 217
|
Apache-2.0
| 2023-04-25T02:38:02
| 2019-06-11T04:01:39
|
Java
|
UTF-8
|
Java
| false
| false
| 3,803
|
java
|
/*
* Copyright (C) 2019 The Turms Project
* https://github.com/turms-im/turms
*
* 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 im.turms.gateway.infra.proto;
import java.io.IOException;
import com.google.protobuf.CodedInputStream;
import com.google.protobuf.ExtensionRegistry;
import com.google.protobuf.WireFormat;
import org.springframework.util.Assert;
import im.turms.server.common.access.client.dto.request.TurmsRequest;
import im.turms.server.common.access.client.dto.request.user.CreateSessionRequest;
import im.turms.server.common.access.common.ResponseStatusCode;
import im.turms.server.common.infra.exception.ResponseException;
import static im.turms.server.common.access.client.dto.request.TurmsRequest.KindCase.CREATE_SESSION_REQUEST;
import static im.turms.server.common.access.client.dto.request.TurmsRequest.KindCase.KIND_NOT_SET;
/**
* @author James Chen
*/
public final class TurmsRequestParser {
/**
* {@link TurmsRequest:73}
*/
private static final int REQUEST_ID_TAG = 8;
private static final ExtensionRegistry REGISTRY = ExtensionRegistry.getEmptyRegistry();
private static final long UNDEFINED_REQUEST_ID = Long.MIN_VALUE;
private TurmsRequestParser() {
}
public static SimpleTurmsRequest parseSimpleRequest(CodedInputStream turmsRequestInputStream) {
Assert.notNull(turmsRequestInputStream, "The input stream must not be null");
try {
long requestId = UNDEFINED_REQUEST_ID;
TurmsRequest.KindCase type;
while (true) {
int tag = turmsRequestInputStream.readTag();
if (tag == REQUEST_ID_TAG) {
if (requestId == UNDEFINED_REQUEST_ID) {
requestId = turmsRequestInputStream.readInt64();
} else {
throw ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
"Not a valid request: Duplicate request ID");
}
} else {
int kindFieldNumber = WireFormat.getTagFieldNumber(tag);
type = TurmsRequest.KindCase.forNumber(kindFieldNumber);
break;
}
}
if (requestId == UNDEFINED_REQUEST_ID) {
throw ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
"Not a valid request: No request ID");
}
if (type == null || type == KIND_NOT_SET) {
throw ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
"Not a valid request: Unknown request type: "
+ type);
}
CreateSessionRequest createSessionRequest = null;
if (type == CREATE_SESSION_REQUEST) {
createSessionRequest = turmsRequestInputStream
.readMessage(CreateSessionRequest.parser(), REGISTRY);
}
return new SimpleTurmsRequest(requestId, type, createSessionRequest);
} catch (IOException e) {
throw ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
"Not a valid request: "
+ e.getMessage());
}
}
}
|
[
"eurekajameschen@gmail.com"
] |
eurekajameschen@gmail.com
|
0a615ce3c25be0e3f1fa559b7ab4387666ae31f1
|
6635387159b685ab34f9c927b878734bd6040e7e
|
/src/azv.java
|
e10d2a653a110e06cb754047677cc8a5d77043b0
|
[] |
no_license
|
RepoForks/com.snapchat.android
|
987dd3d4a72c2f43bc52f5dea9d55bfb190966e2
|
6e28a32ad495cf14f87e512dd0be700f5186b4c6
|
refs/heads/master
| 2021-05-05T10:36:16.396377
| 2015-07-16T16:46:26
| 2015-07-16T16:46:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 659
|
java
|
import com.snapchat.android.analytics.framework.UpdateSnapsAnalyticsPlatform;
public final class azv
implements bvp<UpdateSnapsAnalyticsPlatform>
{
private final azj module;
static
{
if (!azv.class.desiredAssertionStatus()) {}
for (boolean bool = true;; bool = false)
{
$assertionsDisabled = bool;
return;
}
}
private azv(azj paramazj)
{
assert (paramazj != null);
module = paramazj;
}
public static bvp<UpdateSnapsAnalyticsPlatform> a(azj paramazj)
{
return new azv(paramazj);
}
}
/* Location:
* Qualified Name: azv
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"reverseengineeringer@hackeradmin.com"
] |
reverseengineeringer@hackeradmin.com
|
84e277a61adcff4109c82633e5e127da327f2ddb
|
36bda14cc10d4d1f53c06620ccb94c100a1368b3
|
/DuelistMod/src/main/java/duelistmod/cards/OjamaBlue.java
|
1bdef84d1d7ffc6d41d3bc2ff2e8a69a3e6e8e17
|
[
"Unlicense"
] |
permissive
|
Dream5366/StS-DuelistMod
|
465e5e3ec56e630ac659cc0e57861f9dd6c15548
|
f2902db0e14cfa175053188b9f37b4c9611955ac
|
refs/heads/master
| 2021-05-18T02:43:50.357300
| 2020-02-15T15:17:54
| 2020-02-15T15:17:54
| 251,068,687
| 0
| 0
|
Unlicense
| 2020-03-29T15:43:02
| 2020-03-29T15:43:01
| null |
UTF-8
|
Java
| false
| false
| 4,771
|
java
|
package duelistmod.cards;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.orbs.AbstractOrb;
import duelistmod.*;
import duelistmod.abstracts.DuelistCard;
import duelistmod.helpers.DebuffHelper;
import duelistmod.interfaces.*;
import duelistmod.orbs.*;
import duelistmod.patches.*;
import duelistmod.powers.*;
import duelistmod.variables.Tags;
public class OjamaBlue extends DuelistCard
{
// TEXT DECLARATION
public static final String ID = DuelistMod.makeID("OjamaBlue");
private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
public static final String IMG = DuelistMod.makeCardPath("OjamaBlue.png");
public static final String NAME = cardStrings.NAME;
public static final String DESCRIPTION = cardStrings.DESCRIPTION;
public static final String UPGRADE_DESCRIPTION = cardStrings.UPGRADE_DESCRIPTION;
// /TEXT DECLARATION/
// STAT DECLARATION
private static final CardRarity RARITY = CardRarity.RARE;
private static final CardTarget TARGET = CardTarget.ENEMY;
private static final CardType TYPE = CardType.SKILL;
public static final CardColor COLOR = AbstractCardEnum.DUELIST_MONSTERS;
private static final int COST = 2;
private static int MIN_DEBUFF_TURNS_ROLL = 1;
private static int MAX_DEBUFF_TURNS_ROLL = 5;
// /STAT DECLARATION/
public OjamaBlue() {
super(ID, NAME, IMG, COST, DESCRIPTION, TYPE, COLOR, RARITY, TARGET);
this.tags.add(Tags.MONSTER);
this.tags.add(Tags.OJAMA);
this.tags.add(Tags.ARCANE);
this.showEvokeValue = true;
this.showEvokeOrbCount = 1;
this.originalName = this.name;
this.tributes = this.baseTributes = 4;
this.magicNumber = this.baseMagicNumber = 2;
}
// Actions the card should do.
@Override
public void use(AbstractPlayer p, AbstractMonster m)
{
// Summon
tribute(p, this.tributes, false, this);
for (int i = 0; i < this.magicNumber; i++)
{
int randomTurnNum = AbstractDungeon.cardRandomRng.random(MIN_DEBUFF_TURNS_ROLL, MAX_DEBUFF_TURNS_ROLL);
applyPower(DebuffHelper.getRandomDebuff(p, m, randomTurnNum), m);
}
AbstractOrb earth = new Buffer();
channel(earth);
}
// Which card to return when making a copy of this card.
@Override
public AbstractCard makeCopy() {
return new OjamaBlue();
}
// Upgraded stats.
@Override
public void upgrade()
{
if (this.canUpgrade())
{
if (this.timesUpgraded > 0) { this.upgradeName(NAME + "+" + this.timesUpgraded); }
else { this.upgradeName(NAME + "+"); }
if (this.timesUpgraded == 1) { this.upgradeBaseCost(1); }
else if (this.tributes > 0) { this.upgradeTributes(-1); }
else { this.upgradeMagicNumber(1); }
this.rawDescription = UPGRADE_DESCRIPTION;
this.initializeDescription();
}
}
@Override
public boolean canUpgrade()
{
if (this.magicNumber <= 9) { return true; }
else { return false; }
}
// If player doesn't have enough summons, can't play card
@Override
public boolean canUse(AbstractPlayer p, AbstractMonster m)
{
// Check super canUse()
boolean canUse = super.canUse(p, m);
if (!canUse) { return false; }
// Pumpking & Princess
else if (this.misc == 52) { return true; }
// Mausoleum check
else if (p.hasPower(EmperorPower.POWER_ID))
{
EmperorPower empInstance = (EmperorPower)p.getPower(EmperorPower.POWER_ID);
if (!empInstance.flag)
{
return true;
}
else
{
if (p.hasPower(SummonPower.POWER_ID)) { int temp = (p.getPower(SummonPower.POWER_ID).amount); if (temp >= this.tributes) { return true; } }
}
}
// Check for # of summons >= tributes
else { if (p.hasPower(SummonPower.POWER_ID)) { int temp = (p.getPower(SummonPower.POWER_ID).amount); if (temp >= this.tributes) { return true; } } }
// Player doesn't have something required at this point
this.cantUseMessage = this.tribString;
return false;
}
@Override
public void onTribute(DuelistCard tributingCard) {
// TODO Auto-generated method stub
}
@Override
public void onResummon(int summons) {
// TODO Auto-generated method stub
}
@Override
public void summonThis(int summons, DuelistCard c, int var)
{
}
@Override
public void summonThis(int summons, DuelistCard c, int var, AbstractMonster m) {
}
@Override
public String getID() {
return ID;
}
@Override
public void optionSelected(AbstractPlayer arg0, AbstractMonster arg1, int arg2) {
// TODO Auto-generated method stub
}
}
|
[
"nyoxidetwitter@gmail.com"
] |
nyoxidetwitter@gmail.com
|
45218521224dfb642288e898606ce287de763344
|
34d9d1dbd41b2781f5d1839367942728ee199c2c
|
/VectorGraphics/src/org/freehep/swing/graphics/YSkewSelectionPanel.java
|
9eddfaf852b340ede20c648033720fdc18c329ea
|
[] |
no_license
|
Intrinsarc/intrinsarc-evolve
|
4808c0698776252ac07bfb5ed2afddbc087d5e21
|
4492433668893500ebc78045b6be24f8b3725feb
|
refs/heads/master
| 2020-05-23T08:14:14.532184
| 2015-09-08T23:07:35
| 2015-09-08T23:07:35
| 70,294,516
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,664
|
java
|
// Charles A. Loomis, Jr., and University of California, Santa Cruz,
// Copyright (c) 2000
package org.freehep.swing.graphics;
import java.awt.*;
import java.awt.geom.*;
import java.util.*;
import org.freehep.swing.images.*;
/**
* A panel which selects a parallogram-shaped region in which two sides are
* parallel to the x-axis and the other two are skewed with respect to the
* y-axis.
*
* @author Charles Loomis
* @version $Id: YSkewSelectionPanel.java,v 1.1 2009-03-04 22:46:55 andrew Exp $
*/
public class YSkewSelectionPanel extends AbstractRegionSelectionPanel
{
/**
* The initial starting width of the skewed rectangle.
*/
final private static int STARTING_WIDTH = 25;
/**
* Creates a YSkewSelectionPanel.
*/
public YSkewSelectionPanel()
{
super();
}
/**
* Get the number of control points 6---the four corners and the centerpoints
* of the two sides parallel to the x-axis.
*
* @return 6 the number of control points
*/
public int getNumberOfControlPoints()
{
return 6;
}
public Cursor getControlPointCursor(int index)
{
int k;
switch (index)
{
case 0 :
case 3 :
k = 4;
break;
case 1 :
case 2 :
k = 5;
break;
case 4 :
case 5 :
return FreeHepImage.getCursor("0_MoveCursor", 16, 16);
default :
return FreeHepImage.getCursor("YSkewCursor");
}
return compassCursor("Resize", xCtrlPts[index] - xCtrlPts[k], yCtrlPts[index] - yCtrlPts[k], 4, false);
}
/**
* Initialize the control points based on the starting point (x,y).
*
* @param x
* x-coordinate of the starting point
* @param y
* y-coordinate of the starting point
*/
public void initializeControlPoints(int x, int y)
{
// Set the fifth control point to be the active one and
// initialize all of the coordinates.
activeCtrlPt = 5;
Arrays.fill(yCtrlPts, y);
xCtrlPts[0] = x - STARTING_WIDTH;
xCtrlPts[1] = x - STARTING_WIDTH;
xCtrlPts[2] = x + STARTING_WIDTH;
xCtrlPts[3] = x + STARTING_WIDTH;
xCtrlPts[4] = x;
xCtrlPts[5] = x;
}
/**
* Move the active control point to the point (x,y).
*
* @param x
* x-coordinate of the new point
* @param y
* y-coordinate of the new point
*/
public void updateActiveControlPoint(int x, int y)
{
// Bring the location within bounds.
x = forceXCoordinateWithinBounds(x);
y = forceYCoordinateWithinBounds(y);
// Change what is done depending on which control point is
// active.
int width;
switch (activeCtrlPt)
{
case 0 :
width = x - xCtrlPts[4];
xCtrlPts[0] = xCtrlPts[4] + width;
xCtrlPts[1] = xCtrlPts[5] + width;
xCtrlPts[2] = xCtrlPts[5] - width;
xCtrlPts[3] = xCtrlPts[4] - width;
break;
case 1 :
width = x - xCtrlPts[5];
xCtrlPts[0] = xCtrlPts[4] + width;
xCtrlPts[1] = xCtrlPts[5] + width;
xCtrlPts[2] = xCtrlPts[5] - width;
xCtrlPts[3] = xCtrlPts[4] - width;
break;
case 2 :
width = x - xCtrlPts[5];
xCtrlPts[0] = xCtrlPts[4] - width;
xCtrlPts[1] = xCtrlPts[5] - width;
xCtrlPts[2] = xCtrlPts[5] + width;
xCtrlPts[3] = xCtrlPts[4] + width;
break;
case 3 :
width = x - xCtrlPts[4];
xCtrlPts[0] = xCtrlPts[4] - width;
xCtrlPts[1] = xCtrlPts[5] - width;
xCtrlPts[2] = xCtrlPts[5] + width;
xCtrlPts[3] = xCtrlPts[4] + width;
break;
case 4 :
// Determine the width.
width = xCtrlPts[4] - xCtrlPts[0];
// Update the active control point.
xCtrlPts[activeCtrlPt] = x;
yCtrlPts[activeCtrlPt] = y;
// Update the control points on either side.
xCtrlPts[0] = x - width;
yCtrlPts[0] = y;
xCtrlPts[3] = x + width;
yCtrlPts[3] = y;
break;
case 5 :
// Determine the width.
width = xCtrlPts[4] - xCtrlPts[0];
// Update the active control point.
xCtrlPts[activeCtrlPt] = x;
yCtrlPts[activeCtrlPt] = y;
// Update the control points on either side.
xCtrlPts[1] = x - width;
yCtrlPts[1] = y;
xCtrlPts[2] = x + width;
yCtrlPts[2] = y;
break;
default :
break;
}
repaintPanel();
}
public void paintComponent(Graphics g)
{
// Allow parent to draw any custom painting.
super.paintComponent(g);
// If the selection region is visible, paint it.
if (visible)
{
// Make a 2D graphics context.
Graphics2D g2d = (Graphics2D) g;
// Draw a rectangle on top the the image.
g2d.setStroke(thickStroke);
g.setColor(Color.black);
g.drawPolygon(xCtrlPts, yCtrlPts, 4);
if (visibleGuides)
{
g.drawLine(xCtrlPts[4], yCtrlPts[4], xCtrlPts[5], yCtrlPts[5]);
}
g2d.setStroke(thinStroke);
g.setColor(Color.white);
g.drawPolygon(xCtrlPts, yCtrlPts, 4);
if (visibleGuides)
{
g.drawLine(xCtrlPts[4], yCtrlPts[4], xCtrlPts[5], yCtrlPts[5]);
}
// Draw the active control point.
if (activeCtrlPt >= 0)
{
g.setColor(Color.black);
g.fillRect(xCtrlPts[activeCtrlPt] - ctrlPtSize - 1, yCtrlPts[activeCtrlPt] - ctrlPtSize - 1,
2 * ctrlPtSize + 3, 2 * ctrlPtSize + 3);
g.setColor(Color.white);
g.fillRect(xCtrlPts[activeCtrlPt] - ctrlPtSize, yCtrlPts[activeCtrlPt] - ctrlPtSize, 2 * ctrlPtSize + 1,
2 * ctrlPtSize + 1);
}
}
}
/**
* Make the affine transform which corresponds to this skewed selection.
*
* @return AffineTransform which describes the selected region
*/
public AffineTransform makeAffineTransform()
{
// Find first the upper, left-hand point. This is the one
// with the smallest y-value and then the smallest x-value.
int first = 0;
int xSavedValue = xCtrlPts[first];
int ySavedValue = yCtrlPts[first];
for (int i = 1; i < 4; i++)
{
int xValue = xCtrlPts[i];
int yValue = yCtrlPts[i];
if (yValue < ySavedValue)
{
xSavedValue = xValue;
ySavedValue = yValue;
first = i;
}
else
if (yValue == ySavedValue)
{
if (xValue < xSavedValue)
{
xSavedValue = xValue;
ySavedValue = yValue;
first = i;
}
}
}
// Calculate which is the opposite corner.
int third = (first + 2) % 4;
// Now use the cross-product to determine which of the
// remaining points is the one which keep the path going
// clockwise.
int second = (first + 1) % 4;
int dx0 = xCtrlPts[third] - xCtrlPts[first];
int dy0 = yCtrlPts[third] - yCtrlPts[first];
int dx1 = xCtrlPts[second] - xCtrlPts[first];
int dy1 = yCtrlPts[second] - yCtrlPts[first];
if (dx0 * dy1 - dy0 * dx1 > 0)
second = (first + 3) % 4;
// Now call the utility function of the parent.
return makeTransform((double) xCtrlPts[first], (double) yCtrlPts[first], (double) xCtrlPts[second],
(double) yCtrlPts[second], (double) xCtrlPts[third], (double) yCtrlPts[third]);
}
/**
* Check that the selection region is valid; regions with zero area are
* invalid.
*
* @return flag indicating whether this region is valid
*/
public boolean isValidSelection()
{
return (visible) && (yCtrlPts[4] != yCtrlPts[5]) && (xCtrlPts[0] != xCtrlPts[3]);
}
}
|
[
"devnull@localhost"
] |
devnull@localhost
|
35b4ef58974322a9803e2c54fd36af4570d1772f
|
4da9097315831c8639a8491e881ec97fdf74c603
|
/src/StockIT-v2-release_source_from_JADX/sources/com/google/android/gms/internal/ads/zzaan.java
|
cf82da19b223c0b08bd188eb3c94ab52228f4efc
|
[
"Apache-2.0"
] |
permissive
|
atul-vyshnav/2021_IBM_Code_Challenge_StockIT
|
5c3c11af285cf6f032b7c207e457f4c9a5b0c7e1
|
25c26a4cc59a3f3e575f617b59acc202ee6ee48a
|
refs/heads/main
| 2023-08-11T06:17:05.659651
| 2021-10-01T08:48:06
| 2021-10-01T08:48:06
| 410,595,708
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 208
|
java
|
package com.google.android.gms.internal.ads;
import java.util.List;
/* compiled from: com.google.android.gms:play-services-ads@@19.4.0 */
public interface zzaan {
List<String> zzf(List<String> list);
}
|
[
"57108396+atul-vyshnav@users.noreply.github.com"
] |
57108396+atul-vyshnav@users.noreply.github.com
|
8e73f09dc269a804d4ebb95d2b3918b107c51854
|
4cb6fed45cdec56994c475da9daa7f581374c7d9
|
/blade-cache/src/main/java/blade/cache/impl/FIFOCache.java
|
20399c474be28a15461a9d69c65e2b3f3a6d6e60
|
[
"Apache-2.0"
] |
permissive
|
JeffLi1993/blade
|
94228635ea57c304ded2c757c8eeb81eb14a28da
|
d3c9d809b66b1433dc569479343fe49fba5898c2
|
refs/heads/master
| 2021-01-25T11:27:43.058162
| 2015-10-28T07:17:49
| 2015-10-28T07:17:49
| 45,096,751
| 1
| 2
| null | 2015-10-28T07:47:50
| 2015-10-28T07:47:50
| null |
UTF-8
|
Java
| false
| false
| 979
|
java
|
package blade.cache.impl;
import java.util.Iterator;
import blade.cache.AbstractCache;
import blade.cache.CacheObject;
/**
* FIFO实现
*
* @author <a href="mailto:biezhi.me@gmail.com" target="_blank">biezhi</a>
* @since 1.0
* @param <K>
* @param <V>
*/
public class FIFOCache<K, V> extends AbstractCache<K, V> {
public FIFOCache(int cacheSize) {
super(cacheSize);
}
@Override
protected int eliminateCache() {
int count = 0;
K firstKey = null;
Iterator<CacheObject<K, V>> iterator = _mCache.values().iterator();
while (iterator.hasNext()) {
CacheObject<K, V> cacheObject = iterator.next();
if (cacheObject.isExpired()) {
iterator.remove();
count++;
} else {
if (firstKey == null)
firstKey = cacheObject.getKey();
}
}
if (firstKey != null && isFull()) {// 删除过期对象还是满,继续删除链表第一个
_mCache.remove(firstKey);
}
return count;
}
}
|
[
"biezhi.me@gmail.com"
] |
biezhi.me@gmail.com
|
95d069712f0e0b8c45481285a734289392473ceb
|
fda1ee633e8dbaae791da9a5e6c747c4d3cf50df
|
/faceye-hadoop-manager/src/template/project/src/test/java/com/faceye/test/component/mail/service/MailServiceTestCase.java
|
b009a0932c092824f6276cebb59124831d147375
|
[] |
no_license
|
haipenge/faceye-hadoop
|
4670fbd55f1cd63bbeb0e962c3851cef3426b48a
|
1dff867c820eee16da408ec4d91a089f2a1b0e1b
|
refs/heads/master
| 2021-01-22T02:17:17.733570
| 2018-04-02T13:08:08
| 2018-04-02T13:08:08
| 92,345,654
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,284
|
java
|
package com.faceye.test.component.mail.service;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.faceye.component.mail.service.MailService;
import com.faceye.component.mail.service.wrap.Mail;
import com.faceye.test.feature.service.BaseServiceTestCase;
@RunWith(SpringJUnit4ClassRunner.class)
public class MailServiceTestCase extends BaseServiceTestCase {
private Log log=LogFactory.getLog(getClass());
@Autowired
private MailService mailService=null;
@Test
public void testSendTextMail() throws Exception{
Mail mail=new Mail();
mail.setReceiver("haipenge@gmail.com");
mail.setSubject("test mail");
this.mailService.sendMail(mail);
}
@Test
public void testSendHtmlMail() throws Exception{
Mail mail=new Mail();
mail.setReceiver("haipenge@gmail.com");
mail.setSubject("test mail");
Map body =new HashMap();
body.put("key-1", "test-key-1");
body.put("key-2", "test-key-2");
mail.setBody(body);
this.mailService.sendMail(mail);
}
}
|
[
"haipenge@gmail.com"
] |
haipenge@gmail.com
|
c4a31efa6520a10dd9c0d65638d0d414caa6c6a0
|
bd8c6625df26b53bf8a9d6007a9a0d86cb4a5d5c
|
/app/src/main/java/com/nimgade/pk/tutorial101/MainActivity.java
|
2a8298b4b61f474b1ca42daace4e86558a666036
|
[] |
no_license
|
pankajnimgade/Tutorial101
|
7f43688a2813dbfe92d77c07c8db13361a5099d6
|
42859174024b2ade32f3b5ab157e265cc48cf5d6
|
refs/heads/master
| 2021-01-01T03:45:38.855697
| 2016-06-03T14:48:17
| 2016-06-03T14:48:17
| 58,360,021
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,478
|
java
|
package com.nimgade.pk.tutorial101;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.util.ArrayList;
import data.binding.list.activities.DataBindingListActivity;
import example101.list.activities.Example101Activity;
import realm.list.activities.RealmListActivity;
import recycler.view.list.activities.RecyclerViewListActivity;
import support.my.classes.MyListItem;
public class MainActivity extends AppCompatActivity {
private ListView listView;
private ArrayList<MyListItem> myListItems;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
initializeUI();
}
private void initializeUI() {
listView = (ListView) findViewById(R.id.MainActivity_listView);
myListItems = new ArrayList<>();
myListItems.add(new MyListItem("RecyclerView List", RecyclerViewListActivity.class));
myListItems.add(new MyListItem("Data Binding List", DataBindingListActivity.class));
myListItems.add(new MyListItem("Realm List", RealmListActivity.class));
myListItems.add(new MyListItem("Example 101", Example101Activity.class));
ArrayAdapter<MyListItem> adapter
= new ArrayAdapter<MyListItem>(getApplicationContext(), R.layout.simple_list_item_1, myListItems);
listView.setAdapter(adapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
MyListItem myListItem = (MyListItem) listView.getItemAtPosition(position);
Intent my_Intent = new Intent(getApplicationContext(), myListItem.getActivity_Class());
startActivity(my_Intent);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
|
[
"pankaj.nimgade@gmail.com"
] |
pankaj.nimgade@gmail.com
|
5890c936e32f2d05b58d745c617c2305e99aa6e6
|
1d0f087825a3e3462d477414691e66620c4170f6
|
/tutorials/examples/Chinese/javame_midp/JavaMEGISEngineTutorial/src/com/pstreets/gisengine/demo/midp/drawing/MIDPGraphicsFactory.java
|
7c4868207c7163023386e3c85ecce3bf95157264
|
[] |
no_license
|
guidebee/guidebeemaptutorial
|
4778a8e611fdceeb5f278fd65ebbf320ee5c86de
|
8f5900bd47fbd3b171f5c3cca131efd154b11ada
|
refs/heads/master
| 2021-01-19T21:48:20.574997
| 2014-07-25T11:38:45
| 2014-07-25T11:38:45
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,121
|
java
|
//------------------------------------------------------------------------------
// COPYRIGHT 2009 GUIDEBEE
// ALL RIGHTS RESERVED.
// GUIDEBEE CONFIDENTIAL PROPRIETARY
///////////////////////////////////// REVISIONS ////////////////////////////////
// Date Name Tracking # Description
// --------- ------------------- ---------- --------------------------
// 06NOV2009 James Shen Initial Creation
////////////////////////////////////////////////////////////////////////////////
//--------------------------------- PACKAGE ------------------------------------
package com.pstreets.gisengine.demo.midp.drawing;
//--------------------------------- IMPORTS ------------------------------------
import com.mapdigit.gis.drawing.AbstractGraphicsFactory;
import com.mapdigit.gis.drawing.IFont;
import com.mapdigit.gis.drawing.IImage;
import java.io.IOException;
import javax.microedition.lcdui.Font;
//[------------------------------ MAIN CLASS ----------------------------------]
//--------------------------------- REVISIONS ----------------------------------
// Date Name Tracking # Description
// -------- ------------------- ------------- --------------------------
// 06NOV2009 James Shen Initial Creation
////////////////////////////////////////////////////////////////////////////////
/**
* MIDP implementation of the AbstractGraphicsFactory class.
* <hr><b>© Copyright 2009 Guidebee, Inc. All Rights Reserved.</b>
* @version 1.00, 06/11/09
* @author Guidebee Pty Ltd.
*/
public class MIDPGraphicsFactory extends AbstractGraphicsFactory{
////////////////////////////////////////////////////////////////////////////
//--------------------------------- REVISIONS ------------------------------
// Date Name Tracking # Description
// --------- ------------------- ------------- ----------------------
// 06NOV2009 James Shen Initial Creation
////////////////////////////////////////////////////////////////////////////
/**
* get the graphics factory instance.
* @return
*/
public static MIDPGraphicsFactory getInstance(){
return INSTANCE;
}
////////////////////////////////////////////////////////////////////////////
//--------------------------------- REVISIONS ------------------------------
// Date Name Tracking # Description
// --------- ------------------- ------------- ----------------------
// 06NOV2009 James Shen Initial Creation
////////////////////////////////////////////////////////////////////////////
/**
* create image.
* @param width
* @param height
* @return
*/
public IImage createImage(int width, int height) {
return MIDPImage.createImage(width,height);
}
////////////////////////////////////////////////////////////////////////////
//--------------------------------- REVISIONS ------------------------------
// Date Name Tracking # Description
// --------- ------------------- ------------- ----------------------
// 06NOV2009 James Shen Initial Creation
////////////////////////////////////////////////////////////////////////////
/**
* create image.
* @param rgb
* @param width
* @param height
* @return
*/
public IImage createImage(int[] rgb, int width, int height) {
return MIDPImage.createImage(rgb,width,height);
}
////////////////////////////////////////////////////////////////////////////
//--------------------------------- REVISIONS ------------------------------
// Date Name Tracking # Description
// --------- ------------------- ------------- ----------------------
// 06NOV2009 James Shen Initial Creation
////////////////////////////////////////////////////////////////////////////
/**
* create image.
* @param bytes
* @param offset
* @param len
* @return
*/
public IImage createImage(byte[] bytes, int offset, int len) {
return MIDPImage.createImage(bytes,offset,len);
}
private final static MIDPGraphicsFactory INSTANCE=new MIDPGraphicsFactory();
////////////////////////////////////////////////////////////////////////////
//--------------------------------- REVISIONS ------------------------------
// Date Name Tracking # Description
// --------- ------------------- ------------- ----------------------
// 06NOV2009 James Shen Initial Creation
////////////////////////////////////////////////////////////////////////////
/**
* private construct.
*/
private MIDPGraphicsFactory(){
}
}
|
[
"james.shen@guidebee.com"
] |
james.shen@guidebee.com
|
da8b4e152619741a5e99b854ab95189e7b66e3b1
|
3776cad76c9c361a6fd1dcc02a2827d51d8ae88a
|
/Spring-Boot-Test/src/main/java/com/example/test/service/UserService.java
|
3bb01eb74bd512f379d3cf1fa23adfe374d24af1
|
[] |
no_license
|
WeiRuiCoding/SpringBootLearning
|
dab337580b06058fffe964a18f10ea210a70eebf
|
9df90391b107f5d68f5ae7e7e8b9c33e3b790829
|
refs/heads/master
| 2022-12-30T12:08:21.301005
| 2020-10-17T12:32:23
| 2020-10-17T12:32:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 271
|
java
|
package com.example.test.service;
import com.example.test.bean.User;
/**
* Created by dengzhiming on 2019/4/29
*/
public interface UserService {
int add(User user);
int update(User user);
int deleteById(String id);
User queryUserById(String id);
}
|
[
"36990141+JavaCodeMing@users.noreply.github.com"
] |
36990141+JavaCodeMing@users.noreply.github.com
|
af021145ebd5b0662b9dff2d86ca1985fdf7371d
|
7e3e88f04f8db8e0322308a2e0bc8dd7b61bc9b9
|
/src/test/java/br/com/dominio/domain/PhoneTest.java
|
8e38083ee7a01d1a126d4d86f85566c709608c2a
|
[] |
no_license
|
robsonlira/jhipster-person-app
|
548ae8dadff91c371c52ff2a452cefa0553e6417
|
bc6a0ddee0db0a77e9d4e83d85ca44617143493d
|
refs/heads/main
| 2023-06-14T07:37:40.793000
| 2021-07-11T15:43:36
| 2021-07-11T15:43:36
| 384,723,110
| 0
| 0
| null | 2021-07-11T15:43:37
| 2021-07-10T14:55:42
|
Java
|
UTF-8
|
Java
| false
| false
| 630
|
java
|
package br.com.dominio.domain;
import static org.assertj.core.api.Assertions.assertThat;
import br.com.dominio.web.rest.TestUtil;
import org.junit.jupiter.api.Test;
class PhoneTest {
@Test
void equalsVerifier() throws Exception {
TestUtil.equalsVerifier(Phone.class);
Phone phone1 = new Phone();
phone1.setId(1L);
Phone phone2 = new Phone();
phone2.setId(phone1.getId());
assertThat(phone1).isEqualTo(phone2);
phone2.setId(2L);
assertThat(phone1).isNotEqualTo(phone2);
phone1.setId(null);
assertThat(phone1).isNotEqualTo(phone2);
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
dd523cd2a77bf1194c5c99310e27418a40988c8f
|
cf7e9fcaa002d7e3a2e4396831bf122fd1ac7bbc
|
/cards/src/main/java/org/rnd/jmagic/cards/VensersJournal.java
|
53f0de838886d4ab89ba844f5d002e9f61e5f0b4
|
[] |
no_license
|
NorthFury/jmagic
|
9b28d803ce6f8bf22f22eb41e2a6411bc11c8cdf
|
efe53d9d02716cc215456e2794a43011759322d9
|
refs/heads/master
| 2020-05-28T11:04:50.631220
| 2014-06-17T09:48:44
| 2014-06-17T09:48:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,601
|
java
|
package org.rnd.jmagic.cards;
import static org.rnd.jmagic.Convenience.*;
import org.rnd.jmagic.engine.*;
import org.rnd.jmagic.engine.generators.*;
@Name("Venser's Journal")
@Types({Type.ARTIFACT})
@ManaCost("5")
@Printings({@Printings.Printed(ex = Expansion.SCARS_OF_MIRRODIN, r = Rarity.RARE)})
@ColorIdentity({})
public final class VensersJournal extends Card
{
public static final class SpellbookAbility extends StaticAbility
{
public SpellbookAbility(GameState state)
{
super(state, "You have no maximum hand size.");
ContinuousEffect.Part part = new ContinuousEffect.Part(ContinuousEffectType.SET_MAX_HAND_SIZE);
part.parameters.put(ContinuousEffectType.Parameter.PLAYER, ControllerOf.instance(This.instance()));
part.parameters.put(ContinuousEffectType.Parameter.RESTRICTION, Empty.instance());
this.addEffectPart(part);
}
}
public static final class VensersJournalAbility1 extends EventTriggeredAbility
{
public VensersJournalAbility1(GameState state)
{
super(state, "At the beginning of your upkeep, you gain 1 life for each card in your hand.");
this.addPattern(atTheBeginningOfYourUpkeep());
this.addEffect(gainLife(You.instance(), Count.instance(InZone.instance(HandOf.instance(You.instance()))), "You gain 1 life for each card in your hand."));
}
}
public VensersJournal(GameState state)
{
super(state);
// You have no maximum hand size.
this.addAbility(new SpellbookAbility(state));
// At the beginning of your upkeep, you gain 1 life for each card in
// your hand.
this.addAbility(new VensersJournalAbility1(state));
}
}
|
[
"robyter@gmail"
] |
robyter@gmail
|
57672d01d11358783548b3d9575c6329112972d8
|
16bfe4d91fa6d8c7cd1dce4db0d409e9c3ddc2af
|
/raj/arrays/FindLargesParisSumInUnsortedArray.java
|
725e4e2be9a3b3bb72cd2627d8504384cf4146f2
|
[] |
no_license
|
passionatecoderraj/dsa
|
84eb03b524efeb81012c91491fc3dce9aa65aa7a
|
b8a9654fed1183e464915fb4b8481ae10fe266d6
|
refs/heads/master
| 2020-05-21T12:24:38.812925
| 2020-01-21T04:29:58
| 2020-01-21T04:29:58
| 48,559,484
| 8
| 6
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 970
|
java
|
/**
*
*/
package com.raj.arrays;
/**
* @author Raj
*
*/
/*
* Given an unsorted of distinct integers, find the largest pair sum in it.
*/
public class FindLargesParisSumInUnsortedArray {
/**
* @param args
*/
public static void main(String[] args) {
FindLargesParisSumInUnsortedArray obj = new FindLargesParisSumInUnsortedArray();
int a[] = { 12, 34, 10, 6, 40 };
int n = a.length, result = -1;
// Time : O(n), Space : O(1)
result = obj.findLargestPairSumInArray(a, n);
System.out.println(result);
}
public int findLargestPairSumInArray(int[] a, int n) {
if (n <= 2)
return -1;
int firstmax, secondmax;
secondmax = Integer.MIN_VALUE;
firstmax = a[0];
for (int i = 1; i < n; i++) {
if (a[i] > firstmax) {
secondmax = firstmax;
firstmax = a[i];
}
else if (a[i] > secondmax) {
secondmax = a[i];
}
}
System.out.println("1st=" + firstmax + ",2nd=" + secondmax);
return firstmax + secondmax;
}
}
|
[
"passionatecoderraj@gmail.com"
] |
passionatecoderraj@gmail.com
|
a98dfd434d91198d9f2607e1b189f03da5819cf4
|
d1fd0c4703f46b854103d442e14569dc7b2a8b68
|
/libraries/FFMpeg/src/main/java/com/nativelibs4java/ffmpeg/avcodec/RcOverride.java
|
e0e3a4798e039fbe42e87c5311a3770be7251318
|
[] |
no_license
|
jonhare/nativelibs4java
|
ba239d2dee11156d6e6cc57c28b41b8c6d8100e1
|
07565be828ad8bb7d8dad9051616f16d40a9d16a
|
refs/heads/master
| 2020-12-25T17:45:59.682097
| 2020-10-17T14:14:52
| 2020-10-17T14:14:52
| 5,001,967
| 1
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,166
|
java
|
package com.nativelibs4java.ffmpeg.avcodec;
import org.bridj.Pointer;
import org.bridj.StructObject;
import org.bridj.ann.Field;
import org.bridj.ann.Library;
/**
* <i>native declaration : libavcodec/avcodec.h</i><br>
* This file was autogenerated by <a href="http://jnaerator.googlecode.com/">JNAerator</a>,<br>
* a tool written by <a href="http://ochafik.com/">Olivier Chafik</a> that <a href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few opensource projects.</a>.<br>
* For help, please visit <a href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a> or <a href="http://bridj.googlecode.com/">BridJ</a> .
*/
@Library("avcodec")
public class RcOverride extends StructObject {
public RcOverride() {
super();
}
public RcOverride(Pointer pointer) {
super(pointer);
}
@Field(0)
public int start_frame() {
return this.io.getIntField(this, 0);
}
@Field(0)
public RcOverride start_frame(int start_frame) {
this.io.setIntField(this, 0, start_frame);
return this;
}
public final int start_frame_$eq(int start_frame) {
start_frame(start_frame);
return start_frame;
}
@Field(1)
public int end_frame() {
return this.io.getIntField(this, 1);
}
@Field(1)
public RcOverride end_frame(int end_frame) {
this.io.setIntField(this, 1, end_frame);
return this;
}
public final int end_frame_$eq(int end_frame) {
end_frame(end_frame);
return end_frame;
}
/// If this is 0 then quality_factor will be used instead.
@Field(2)
public int qscale() {
return this.io.getIntField(this, 2);
}
/// If this is 0 then quality_factor will be used instead.
@Field(2)
public RcOverride qscale(int qscale) {
this.io.setIntField(this, 2, qscale);
return this;
}
public final int qscale_$eq(int qscale) {
qscale(qscale);
return qscale;
}
@Field(3)
public float quality_factor() {
return this.io.getFloatField(this, 3);
}
@Field(3)
public RcOverride quality_factor(float quality_factor) {
this.io.setFloatField(this, 3, quality_factor);
return this;
}
public final float quality_factor_$eq(float quality_factor) {
quality_factor(quality_factor);
return quality_factor;
}
}
|
[
"olivier.chafik@gmail.com"
] |
olivier.chafik@gmail.com
|
068aad48946abc3daf34a61f2a2ac945d3fc306e
|
7ff2c8ce35ae0ce423a03353c0225e5e5b708f7a
|
/trunk/myfacebookapp/src/org/myfacebookapp/AlbumServlet.java
|
2da640111687e07a95189b2336d4ac99ec17cf8b
|
[] |
no_license
|
BGCX067/facebook-diashow-svn-to-git
|
62cea27b8ad478bf249538b661218fa69e61cf3e
|
faf04469e0ef397ce3a16ad3b59409bf805e11e3
|
refs/heads/master
| 2016-09-01T08:53:53.264763
| 2015-12-28T14:37:02
| 2015-12-28T14:37:02
| 48,872,690
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,649
|
java
|
package org.myfacebookapp;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.JSONArray;
import org.json.JSONObject;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.facebook.api.FacebookException;
import com.facebook.api.FacebookRestClient;
import datastructure.Functions;
import datastructure.Names;
/**
* Servlet implementation class AlbumServlet
*/
public class AlbumServlet extends AbstractFacebookServlet implements
javax.servlet.Servlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public AlbumServlet() {
super();
// TODO Auto-generated constructor stub
}
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession();
FacebookRestClient facebook = getAuthenticatedFacebookClient(request,
response);
if (facebook != null) {
String friendIdString = request
.getParameter(Names.CLICKED_FRIEND_ID);
long friendId = Long.parseLong(friendIdString);
// List<Album> albums = Album.getAlbums(facebook, friendId);
//
// JSONArray jsonAlbums = new
// JSONArray(convertToJSONObjectList(albums));
String queryForAlbums = "SELECT aid, name, cover_pid, size FROM album WHERE owner = "
+ friendId;
try {
long time = System.currentTimeMillis();
Document albumsDoc = facebook.fql_query(queryForAlbums);
String queryForPics = "SELECT pid, src_small FROM photo WHERE pid in (SELECT cover_pid FROM album WHERE owner = "
+ friendId + ") ORDER BY pid ASC";
Document picsDoc = facebook.fql_query(queryForPics);
String jsonAlbumsString = convertToJSON(albumsDoc, picsDoc);
System.out.println("Albumloadtime: " + (System.currentTimeMillis() - time) / 1000 + "s");
System.out.println(jsonAlbumsString);
response.getOutputStream().write(jsonAlbumsString.getBytes());
} catch (FacebookException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
private static String convertToJSON(Document albumDoc, Document picDoc) {
NodeList nodes = albumDoc.getElementsByTagName("album");
String result = "[";
for (int i = 0; i < nodes.getLength(); i++) {
Node n = nodes.item(i);
result += processNode(n, picDoc);
if (i == nodes.getLength() - 1)
result += "}";
else
result += "},";
}
result += "]";
return result;
}
private static String processNode(Node n, Document picDoc) {
String result = "{";
Node aidNode = n.getFirstChild();
Node nameNode = aidNode.getNextSibling();
Node cover_pidNode = nameNode.getNextSibling();
Node sizeNode = cover_pidNode.getNextSibling();
String aidText = "\"" + aidNode.getNodeName() + "\":"
+ "\"" +aidNode.getFirstChild().getNodeValue() + "\"";
String nameText = "\"" + nameNode.getNodeName() + "\":\""
+ nameNode.getFirstChild().getNodeValue() + "\"";
String cover_pidText = transformPicIDToURLInJSON(cover_pidNode, picDoc);
String sizeText = "\"" + sizeNode.getNodeName() + "\":"
+ sizeNode.getFirstChild().getNodeValue();
result += aidText + "," + nameText + "," + cover_pidText + ","
+ sizeText;
return result;
}
private static String transformPicIDToURLInJSON(Node cover_pidNode,
Document picDoc) {
String picID = cover_pidNode.getFirstChild().getNodeValue();
NodeList nodes = picDoc.getElementsByTagName("photo");
for (int i = 0; i < nodes.getLength(); i++) {
Node n = nodes.item(i);
Node pidNode = n.getFirstChild();
String currentPicID = pidNode.getFirstChild().getNodeValue();
if (currentPicID.equals(picID)) {
Node picNode = pidNode.getNextSibling();
String result = "";
if (picNode.getFirstChild() != null) {
result = "\"" + picNode.getNodeName() + "\":\""
+ picNode.getFirstChild().getNodeValue() + "\"";
} else {
result = "\"" + picNode.getNodeName() + "\":\""
+ "Images/unknown.jpg" + "\"";
}
return result;
}
}
return null;
}
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
|
[
"you@example.com"
] |
you@example.com
|
f1db51624cd3f14795777a648abfbc42cc04a5c3
|
b5fbc5c882b6ac0949b409e6cb7722eca678079d
|
/SecondaryDirectory/src/com/example/directory/BaseOfAdapter.java
|
2be6347430ffc54a636bd256a00e75a8af389169
|
[] |
no_license
|
liwenzhi/csdnDemo
|
18f62f49889d5d0636f3e53b9eb068ac83aaff4a
|
de5278729c21edd5e75a2ca2049d2218d11b42a9
|
refs/heads/master
| 2021-01-20T13:04:31.088967
| 2017-05-16T12:48:43
| 2017-05-16T12:48:43
| 90,446,051
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,584
|
java
|
package com.example.directory;
import android.content.Context;
import android.widget.BaseAdapter;
import java.util.ArrayList;
import java.util.List;
/**
* 简单封装了BaseAdapter的适配器类
*
* 这是一个简化BaseAdapter适配器的工具类
* 这是使用的是定义一个泛型T,使用时传入什么数据,T就是什么数据
* 实际设计中除了getVIew方法外,其他的方法基本是差不多的
* 所以继承这个工具类后只要重写getView方法,就可以使用BaseAdapter了
*
*/
public abstract class BaseOfAdapter<T> extends BaseAdapter {
//定义集合数据
List<T> list = new ArrayList<T>();
//上下文
Context context;
//传入的是一个集合的数据的情况
public BaseOfAdapter(Context context, List<T> list) {
this.context = context;
this.list = list;
}
//传入的是一个数组数据的情况
//其实数组也是要转换为集合的数据,因为适配器只接受集合的数据
public BaseOfAdapter(Context context, T[] list) {
this.context = context;
for (T t : list) {
this.list.add(t);
}
}
//返回数据的总数
@Override
public int getCount() {
return list == null ? 0 : list.size();
}
//返回集合中某个游标值的对象
@Override
public T getItem(int position) {
return list == null ? null : list.get(position);
}
//返回选中的条目的游标值
@Override
public long getItemId(int position) {
return position;
}
}
|
[
"170426029@qq.com"
] |
170426029@qq.com
|
9e5e3abd6b3f05da5be73991019b96e25c4f40a9
|
402572a9fd73b0bded10754519439bbcaac1c220
|
/java/l2f/gameserver/model/entity/olympiad/OlympiadGameTask.java
|
b110f105204ae4ee2322ae9aa8f9c480585bc02f
|
[
"MIT"
] |
permissive
|
juninhorosa/L2MYTHRAS_FIXED
|
9e385979725378eb4d8b177393e16da8b1a97992
|
0cd8a44ca30946c3bc42672ae85187fbce1de313
|
refs/heads/main
| 2023-01-13T18:29:36.906415
| 2020-11-07T19:39:49
| 2020-11-07T19:39:49
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,246
|
java
|
package l2f.gameserver.model.entity.olympiad;
import java.util.concurrent.ScheduledFuture;
import l2f.commons.threading.RunnableImpl;
import l2f.gameserver.Config;
import l2f.gameserver.ThreadPoolManager;
import l2f.gameserver.network.serverpackets.SystemMessage;
import l2f.gameserver.network.serverpackets.components.SystemMsg;
import l2f.gameserver.utils.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class OlympiadGameTask extends RunnableImpl
{
private static final Logger _log = LoggerFactory.getLogger(OlympiadGameTask.class);
private final OlympiadGame _game;
private final BattleStatus _status;
private final int _count;
private final long _time;
private boolean _shoutGameStart = true;
private boolean _terminated = false;
public boolean isTerminated()
{
return _terminated;
}
/**
* Set this to false to disable the annoying Olympiad Manager NPC Shout to all players that the match has begun.
* @param value
*/
public void setShoutGameStart(boolean value)
{
_shoutGameStart = value;
}
public BattleStatus getStatus()
{
return _status;
}
public int getCount()
{
return _count;
}
public OlympiadGame getGame()
{
return _game;
}
public long getTime()
{
return _count;
}
public ScheduledFuture<?> shedule()
{
return ThreadPoolManager.getInstance().schedule(this, _time);
}
public OlympiadGameTask(OlympiadGame game, BattleStatus status, int count, long time)
{
_game = game;
_status = status;
_count = count;
_time = time;
}
@Override
public void runImpl()
{
if (_game == null || _terminated)
return;
OlympiadGameTask task = null;
int gameId = _game.getId();
try
{
if (!Olympiad.inCompPeriod())
return;
// Прерываем игру, если один из игроков не онлайн, и игра еще не прервана
if (!_game.checkPlayersOnline() && _status != BattleStatus.ValidateWinner && _status != BattleStatus.Ending)
{
Log.add("Player is offline for game " + gameId + ", status: " + _status, "olympiad");
_game.endGame(1, true);
return;
}
switch (_status)
{
case Begining:
{
task = new OlympiadGameTask(_game, BattleStatus.Begin_Countdown, Config.ALT_OLY_WAIT_TIME, 100);
break;
}
case Begin_Countdown:
{
_game.broadcastPacket(new SystemMessage(SystemMsg.YOU_WILL_BE_MOVED_TO_THE_OLYMPIAD_STADIUM_IN_S1_SECONDS).addNumber(_count), true, false);
switch (_count)
{
case 120:
task = new OlympiadGameTask(_game, BattleStatus.Begin_Countdown, 60, 60000);
break;
case 60:
task = new OlympiadGameTask(_game, BattleStatus.Begin_Countdown, 30, 30000);
break;
case 30:
task = new OlympiadGameTask(_game, BattleStatus.Begin_Countdown, 15, 15000);
break;
case 15:
task = new OlympiadGameTask(_game, BattleStatus.Begin_Countdown, 5, 10000);
break;
case 5:
task = new OlympiadGameTask(_game, BattleStatus.Begin_Countdown, 4, 1000);
break;
case 4:
task = new OlympiadGameTask(_game, BattleStatus.Begin_Countdown, 3, 1000);
break;
case 3:
task = new OlympiadGameTask(_game, BattleStatus.Begin_Countdown, 2, 1000);
break;
case 2:
task = new OlympiadGameTask(_game, BattleStatus.Begin_Countdown, 1, 1000);
break;
case 1:
task = new OlympiadGameTask(_game, BattleStatus.PortPlayers, 0, 1000);
break;
}
break;
}
case PortPlayers:
{
_game.portPlayersToArena();
if (_shoutGameStart)
_game.managerShout();
task = new OlympiadGameTask(_game, BattleStatus.Started, 60, 1000);
break;
}
case Started:
{
_game.preparePlayers();
_game.addBuffers();
_game.broadcastPacket(new SystemMessage(SystemMsg.THE_MATCH_WILL_START_IN_S1_SECONDS).addNumber(_count), true, true);
task = new OlympiadGameTask(_game, BattleStatus.Heal, 55, 5000);
break;
}
case Heal:
{
_game.heal();
task = new OlympiadGameTask(_game, BattleStatus.CountDown, 50, 5000);
break;
}
case CountDown:
{
_game.broadcastPacket(new SystemMessage(SystemMsg.THE_MATCH_WILL_START_IN_S1_SECONDS).addNumber(_count), true, true);
switch (_count)
{
case 50:
task = new OlympiadGameTask(_game, BattleStatus.CountDown, 40, 10000);
break;
case 40:
task = new OlympiadGameTask(_game, BattleStatus.CountDown, 30, 10000);
break;
case 30:
task = new OlympiadGameTask(_game, BattleStatus.CountDown, 20, 10000);
break;
case 20:
task = new OlympiadGameTask(_game, BattleStatus.CountDown, 10, 10000);
break;
case 10:
_game.openDoors();
task = new OlympiadGameTask(_game, BattleStatus.CountDown, 5, 5000);
break;
case 5:
task = new OlympiadGameTask(_game, BattleStatus.CountDown, 4, 1000);
break;
case 4:
task = new OlympiadGameTask(_game, BattleStatus.CountDown, 3, 1000);
break;
case 3:
task = new OlympiadGameTask(_game, BattleStatus.CountDown, 2, 1000);
break;
case 2:
task = new OlympiadGameTask(_game, BattleStatus.CountDown, 1, 1000);
break;
case 1:
task = new OlympiadGameTask(_game, BattleStatus.StartComp, 0, 1000);
break;
}
break;
}
case StartComp:
{
_game.deleteBuffers();
_game.startComp();
_game.broadcastPacket(SystemMsg.THE_MATCH_HAS_STARTED, true, true);
_game.broadcastInfo(null, null, false);
task = new OlympiadGameTask(_game, BattleStatus.InComp, 120, 180000); // 300 total
break;
}
case InComp:
{
if (_game.getState() == 0) // game finished
return;
_game.broadcastPacket(new SystemMessage(SystemMsg.THE_GAME_WILL_END_IN_S1_SECONDS_).addNumber(_count), true, true);
switch (_count)
{
case 120:
task = new OlympiadGameTask(_game, BattleStatus.InComp, 60, 60000);
break;
case 60:
task = new OlympiadGameTask(_game, BattleStatus.InComp, 30, 30000);
break;
case 30:
task = new OlympiadGameTask(_game, BattleStatus.InComp, 10, 20000);
break;
case 10:
task = new OlympiadGameTask(_game, BattleStatus.InComp, 5, 5000);
break;
case 5:
task = new OlympiadGameTask(_game, BattleStatus.ValidateWinner, 0, 5000);
break;
}
break;
}
case ValidateWinner:
{
try
{
_game.validateWinner(_count > 0);
}
catch(Exception e)
{
_log.error("Error on Olympiad Validate Winner", e);
}
task = new OlympiadGameTask(_game, BattleStatus.PortBack, Config.ALT_OLY_PORT_BACK_TIME, 100);
break;
}
case PortBack:
{
_game.broadcastPacket(new SystemMessage(SystemMsg.YOU_WILL_BE_MOVED_BACK_TO_TOWN_IN_S1_SECONDS).addNumber(_count), true, false);
switch (_count)
{
case 20:
task = new OlympiadGameTask(_game, BattleStatus.PortBack, 10, 10000);
break;
case 10:
task = new OlympiadGameTask(_game, BattleStatus.PortBack, 5, 5000);
break;
case 5:
task = new OlympiadGameTask(_game, BattleStatus.PortBack, 4, 1000);
break;
case 4:
task = new OlympiadGameTask(_game, BattleStatus.PortBack, 3, 1000);
break;
case 3:
task = new OlympiadGameTask(_game, BattleStatus.PortBack, 2, 1000);
break;
case 2:
task = new OlympiadGameTask(_game, BattleStatus.PortBack, 1, 1000);
break;
case 1:
task = new OlympiadGameTask(_game, BattleStatus.Ending, 0, 1000);
break;
}
break;
}
case Ending:
{
_game.collapse();
_terminated = true;
if (Olympiad._manager != null)
Olympiad._manager.freeOlympiadInstance(_game.getId());
return;
}
}
if (task == null)
{
Log.add("task == null for game " + gameId, "olympiad");
Thread.dumpStack();
_game.endGame(1, true);
return;
}
_game.sheduleTask(task);
}
catch(Exception e)
{
_log.error("Error on Olympiad Game Task", e);
_game.endGame(1, true);
}
}
}
|
[
"libera.libera@gmail.com"
] |
libera.libera@gmail.com
|
31f32502190123ef5e6f1b2e93c631552596ca81
|
1a1cef5f723ce412c7599eea68605e423e5603fc
|
/Java_middle_class/src/java_set.java
|
177e333af5d84e6f0c2b7163092e5d84544eef72
|
[] |
no_license
|
dahun428/login
|
def23e63c8c10b0b19631efd6d873adb40982759
|
2f3f591a3fc546e41efc8ee015b8cea3821e66c6
|
refs/heads/master
| 2020-12-06T03:15:55.229116
| 2020-01-19T22:00:21
| 2020-01-19T22:00:21
| 232,322,630
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 553
|
java
|
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
public class java_set {
public static void main(String[] args) {
Set<String> set1 = new HashSet<>();
boolean flag1 = set1.add("kang");
boolean flag2 = set1.add("kim");
boolean flag3 = set1.add("kang");
System.out.println(set1.size());
System.out.println(flag1);
System.out.println(flag2);
System.out.println(flag3);
Iterator<String> iter = set1.iterator();
while(iter.hasNext()) {
String str = iter.next();
System.out.println(str);
}
}
}
|
[
"rubcustomer@gmail.com"
] |
rubcustomer@gmail.com
|
d525ac68176850b739b8a1d03f9d50d46f9993ac
|
a363c46e7cbb080db2b3a69a70ebf912195e25c7
|
/ls-modules/ls-monitor/src/main/java/cn/lonsun/monitor/task/internal/dao/impl/MonitorHrefUseableDynamicDaoImpl.java
|
d917e70515e1fa073aae379e05ae221a1a23f1a7
|
[] |
no_license
|
pologood/excms
|
601646dd7ea4f58f8423da007413978192090f8d
|
e1c03f574d0ecbf0200aaffa7facf93841bab02c
|
refs/heads/master
| 2020-05-14T20:07:22.979151
| 2018-10-06T10:51:37
| 2018-10-06T10:51:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,529
|
java
|
package cn.lonsun.monitor.task.internal.dao.impl;
import cn.lonsun.core.base.dao.impl.MockDao;
import cn.lonsun.core.util.Pagination;
import cn.lonsun.monitor.task.internal.dao.IMonitorHrefUseableDynamicDao;
import cn.lonsun.monitor.task.internal.entity.MonitorHrefUseableDynamicEO;
import cn.lonsun.monitor.task.internal.entity.vo.HrefUseableQueryVO;
import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.stereotype.Repository;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* @author gu.fei
* @version 2017-09-28 9:23
*/
@Repository
public class MonitorHrefUseableDynamicDaoImpl extends MockDao<MonitorHrefUseableDynamicEO> implements IMonitorHrefUseableDynamicDao {
@Override
public Pagination getPage(HrefUseableQueryVO vo) {
Calendar calendar = Calendar.getInstance(); //得到日历
calendar.setTime(new Date());//把当前时间赋给日历
calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天
Date frontDate = calendar.getTime();
Map<String,Object> map = new HashMap<String, Object>();
StringBuilder hql = new StringBuilder("from MonitorHrefUseableDynamicEO");
hql.append(" where taskId=:taskId");
hql.append(" and monitorDate < :monitorDate");
hql.append(" and monitorDate >= :frontDate");
hql.append(" order by monitorDate desc");
map.put("taskId",vo.getTaskId());
map.put("monitorDate",vo.getDate());
map.put("frontDate",frontDate);
return this.getPagination(vo.getPageIndex(),vo.getPageSize(),hql.toString(),map);
}
@Override
public Long getHrefUseableDynamicCout(Long taskId, Date date) {
Calendar calendar = Calendar.getInstance(); //得到日历
calendar.setTime(new Date());//把当前时间赋给日历
calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天
Date frontDate = calendar.getTime();
System.out.println(DateFormatUtils.format(frontDate,"yyyy-MM-dd"));
Map<String,Object> map = new HashMap<String, Object>();
StringBuilder hql = new StringBuilder("from MonitorHrefUseableDynamicEO");
hql.append(" where taskId=:taskId");
hql.append(" and monitorDate < :monitorDate");
hql.append(" and monitorDate >= :frontDate");
map.put("taskId",taskId);
map.put("monitorDate",date);
map.put("frontDate",frontDate);
return this.getCount(hql.toString(),map);
}
}
|
[
"2885129077@qq.com"
] |
2885129077@qq.com
|
4309a36fe3966a37fac7743b49d1a871c403f6d2
|
137b087ef2383b8bc7148496ca985002fa615321
|
/src/main/java/org/dpi/creditsPeriod/CreditsPeriodService.java
|
110d696e85069d09936ec4a75bc443d02dcebc9b
|
[] |
no_license
|
moradaniel/humanResources
|
7b898c17b6fb6cc90bfc7c241c288dd53364ddfd
|
f39ed276d6d7b91b0bed5b7a8497650c68d9dd7b
|
refs/heads/master
| 2023-07-07T22:50:22.158010
| 2023-07-03T10:46:17
| 2023-07-03T10:46:17
| 11,310,851
| 0
| 0
| null | 2022-12-16T06:30:21
| 2013-07-10T12:04:35
|
HTML
|
UTF-8
|
Java
| false
| false
| 1,045
|
java
|
package org.dpi.creditsPeriod;
import java.util.Date;
import java.util.List;
import org.springframework.context.ApplicationContextAware;
import biz.janux.calendar.DateRange;
/**
* Used to create, save, retrieve, update and delete CreditsPeriod objects from
* persistent storage
*
*/
public interface CreditsPeriodService extends ApplicationContextAware
{
public List<CreditsPeriod> findAll();
public CreditsPeriod findById(Long id);
/**
* DateRange that represents the period of time representing a CreditsPeriod
* @param year
* @return
*/
public DateRange getDateRangeForYear(int year);
public boolean isDateWithinEjercicioAnual(Date date, int year);
public List<CreditsPeriod> find(CreditsPeriodQueryFilter creditsPeriodQueryFilter);
public void delete(CreditsPeriod employment);
public void save(final CreditsPeriod employment);
public void saveOrUpdate(final CreditsPeriod employment);
public CreditsPeriodDao getCreditsPeriodDao();
public CreditsPeriod getCurrentCreditsPeriod();
}
|
[
"moradaniel@gmail.com"
] |
moradaniel@gmail.com
|
4f40a4cec3ae65b171491beafe9c39d6f21103a0
|
d744201c7d53e62a527bb169ba7c8a90a451c093
|
/api/src/main/java/io/github/lxgaming/virtualinventory/api/inventory/ButtonType.java
|
6d7be1ed27dada420eccd5fd3c1db0c0d8cc5526
|
[
"Apache-2.0"
] |
permissive
|
LXGaming/VirtualInventory
|
1d2a507b7f8cbb1f9ea96e70422d2b9e90eca88c
|
dc8be1baae65317580634afdd179e76e298e4bad
|
refs/heads/master
| 2023-09-01T06:12:12.485546
| 2023-08-05T11:15:14
| 2023-08-05T11:15:14
| 190,357,114
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,129
|
java
|
/*
* Copyright 2019 Alex Thomson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.github.lxgaming.virtualinventory.api.inventory;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import org.spongepowered.api.CatalogType;
import org.spongepowered.api.util.annotation.CatalogedBy;
import org.spongepowered.api.util.annotation.NonnullByDefault;
import java.util.Objects;
@NonnullByDefault
@CatalogedBy(ButtonTypes.class)
public class ButtonType implements CatalogType {
private final String id;
private final String name;
ButtonType(String id, String name) {
this.id = Preconditions.checkNotNull(id);
this.name = Preconditions.checkNotNull(name);
}
@Override
public String getId() {
return this.id;
}
@Override
public String getName() {
return this.name;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("id", this.id)
.add("name", this.name)
.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
ButtonType buttonType = (ButtonType) obj;
return Objects.equals(this.id, buttonType.id)
&& Objects.equals(this.name, buttonType.name);
}
@Override
public int hashCode() {
return Objects.hash(this.id, this.name);
}
}
|
[
"LXGaming@users.noreply.github.com"
] |
LXGaming@users.noreply.github.com
|
3da390cae97eb199a6d3c6389d2e9c3aabd7b724
|
07bd89d994da04a94c84db8997a67ae118af7830
|
/软工三大作业 众包网站/summerCS_Phase_III/src/main/java/com/example/summer/dao/ProjectRankDao.java
|
f188d6b093da405317de41aba24bd4c41830fe10
|
[] |
no_license
|
pilibb0712/myHomework
|
61e48163972b0ca0c42c736636c46b07492c40da
|
5d013e35ee930f730418cad0a9af4cc3bf9ba0a2
|
refs/heads/master
| 2023-08-24T09:41:17.561232
| 2019-11-30T05:18:26
| 2019-11-30T05:18:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 345
|
java
|
package com.example.summer.dao;
import com.example.summer.domain.ProjectRankPO;
import java.util.ArrayList;
public interface ProjectRankDao {
boolean save(ProjectRankPO projectRank);
boolean update(ProjectRankPO projectRank);
ProjectRankPO queryProjectRankByProjectId(String projectId);
ArrayList<String> getAllProjectIds();
}
|
[
"1292155474@qq.com"
] |
1292155474@qq.com
|
ed740e758e51fd042d212d780fe3f64ee770113e
|
a0e5858528a288b97aa32fb0f2170d6ed9226885
|
/emp-nangang/micro/src/main/java/com/taiji/MicroEmpNangangApplication.java
|
fb00e0682c128c4be55a4434f53e4b1c9813d9bc
|
[] |
no_license
|
rauldoblem/nangang
|
f0a0f0c816c7de915c352cc467b2e6716c87a310
|
e48cadeaf5245c42b7e9a21f28903f4f4e8b6996
|
refs/heads/master
| 2020-08-11T04:01:12.891437
| 2019-06-25T13:42:57
| 2019-06-25T13:42:57
| 214,486,888
| 0
| 0
| null | 2019-10-11T16:51:17
| 2019-10-11T16:51:17
| null |
UTF-8
|
Java
| false
| false
| 667
|
java
|
package com.taiji;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
@EnableDiscoveryClient
@SpringCloudApplication
@EnableJpaAuditing
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class MicroEmpNangangApplication {
public static void main(String[] args){
SpringApplication.run(MicroEmpNangangApplication.class,args);
}
}
|
[
"18151950796@163.com"
] |
18151950796@163.com
|
752367a8a912f6d95136bbdd361f913fed96dc14
|
82a8f35c86c274cb23279314db60ab687d33a691
|
/app/src/main/java/com/duokan/reader/domain/cloud/C0890y.java
|
9ea5666140ceb99cf39dc0fdc5864b6621d127f4
|
[] |
no_license
|
QMSCount/DReader
|
42363f6187b907dedde81ab3b9991523cbf2786d
|
c1537eed7091e32a5e2e52c79360606f622684bc
|
refs/heads/master
| 2021-09-14T22:16:45.495176
| 2018-05-20T14:57:15
| 2018-05-20T14:57:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,262
|
java
|
package com.duokan.reader.domain.cloud;
/* renamed from: com.duokan.reader.domain.cloud.y */
class C0890y implements al {
/* renamed from: a */
final /* synthetic */ C0889x f4211a;
C0890y(C0889x c0889x) {
this.f4211a = c0889x;
}
/* renamed from: a */
public void mo1112a(DkCloudReadingInfo dkCloudReadingInfo, DkCloudReadingInfo dkCloudReadingInfo2, String str) {
this.f4211a.f4209d.mo1112a(dkCloudReadingInfo, dkCloudReadingInfo2, str);
}
/* renamed from: a */
public void mo1113a(DkCloudReadingInfo dkCloudReadingInfo, String str, String str2) {
this.f4211a.f4209d.mo1115b(dkCloudReadingInfo, str, str2);
}
/* renamed from: b */
public void mo1114b(DkCloudReadingInfo dkCloudReadingInfo, DkCloudReadingInfo dkCloudReadingInfo2, String str) {
this.f4211a.f4210e.m4997a(dkCloudReadingInfo2);
DkUserReadingNotesManager.m5136a().m5154a(dkCloudReadingInfo2.getCloudId(), this.f4211a.f4207b);
this.f4211a.f4209d.mo1114b(dkCloudReadingInfo, dkCloudReadingInfo2, str);
}
/* renamed from: b */
public void mo1115b(DkCloudReadingInfo dkCloudReadingInfo, String str, String str2) {
this.f4211a.f4209d.mo1115b(dkCloudReadingInfo, str, str2);
}
}
|
[
"lixiaohong@p2peye.com"
] |
lixiaohong@p2peye.com
|
26944bdc8e30cebecf705811c7497454f9f50718
|
821ed0666d39420d2da9362d090d67915d469cc5
|
/core/api/src/main/java/org/onosproject/net/topology/HopCountLinkWeight.java
|
1e0e66cc1720ffbb7780fe57f478694ca1cd237a
|
[
"Apache-2.0"
] |
permissive
|
LenkayHuang/Onos-PNC-for-PCEP
|
03b67dcdd280565169f2543029279750da0c6540
|
bd7d201aba89a713f5ba6ffb473aacff85e4d38c
|
refs/heads/master
| 2021-01-01T05:19:31.547809
| 2016-04-12T07:25:13
| 2016-04-12T07:25:13
| 56,041,394
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,190
|
java
|
package org.onosproject.net.topology;
import static org.onosproject.net.Link.State.ACTIVE;
import static org.onosproject.net.Link.Type.INDIRECT;
/**
* Link weight for measuring link cost as hop count with indirect links
* being as expensive as traversing the entire graph to assume the worst.
*/
public class HopCountLinkWeight implements LinkWeight {
private final int indirectLinkCost;
/**
* Creates a new hop-count weight.
*/
public HopCountLinkWeight() {
this.indirectLinkCost = Short.MAX_VALUE;
}
/**
* Creates a new hop-count weight with the specified cost of indirect links.
*
* @param indirectLinkCost indirect link cost
*/
public HopCountLinkWeight(int indirectLinkCost) {
this.indirectLinkCost = indirectLinkCost;
}
@Override
public double weight(TopologyEdge edge) {
// To force preference to use direct paths first, make indirect
// links as expensive as the linear vertex traversal.
return edge.link().state() ==
ACTIVE ? (edge.link().type() ==
INDIRECT ? indirectLinkCost : 1) : -1;
}
}
|
[
"826080529@qq.com"
] |
826080529@qq.com
|
a70aec079b0e49e198ccd0ffa8ad43ba57caa945
|
9fe800087ef8cc6e5b17fa00f944993b12696639
|
/contrib/rasterizertask/sources/org/apache/tools/ant/taskdefs/optional/RasterizerTaskSVGConverterController.java
|
0b15e5a40a53b7e32de4c5f6d0e7a229f70d1c56
|
[
"Apache-2.0"
] |
permissive
|
balabit-deps/balabit-os-7-batik
|
14b80a316321cbd2bc29b79a1754cc4099ce10a2
|
652608f9d210de2d918d6fb2146b84c0cc771842
|
refs/heads/master
| 2023-08-09T03:24:18.809678
| 2023-05-22T20:34:34
| 2023-05-27T08:21:21
| 158,242,898
| 0
| 0
|
Apache-2.0
| 2023-07-20T04:18:04
| 2018-11-19T15:03:51
|
Java
|
UTF-8
|
Java
| false
| false
| 3,877
|
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.tools.ant.taskdefs.optional;
// -- Batik classes ----------------------------------------------------------
import org.apache.batik.transcoder.Transcoder;
import org.apache.batik.apps.rasterizer.SVGConverterController;
import org.apache.batik.apps.rasterizer.SVGConverterSource;
// -- Ant classes ------------------------------------------------------------
import org.apache.tools.ant.Task;
// -- Java SDK classes -------------------------------------------------------
import java.io.File;
import java.util.Map;
import java.util.List;
/**
* Implements simple controller for the <code>SVGConverter</code> operation.
*
* <p>This is almost the same as the
* {@link org.apache.batik.apps.rasterizer.DefaultSVGConverterController DefaultSVGConverterController}
* except this produces error message when the conversion fails.</p>
*
* <p>See {@link SVGConverterController} for the method documentation.</p>
*
* @see SVGConverterController SVGConverterController
* @see org.apache.batik.apps.rasterizer.DefaultSVGConverterController DefaultSVGConverterController
*
* @author <a href="mailto:ruini@iki.fi">Henri Ruini</a>
* @version $Id: RasterizerTaskSVGConverterController.java 1733420 2016-03-03 07:41:59Z gadams $
*/
public class RasterizerTaskSVGConverterController implements SVGConverterController {
// -- Variables ----------------------------------------------------------
/** Ant task that is used to log messages. */
protected Task executingTask = null;
// -- Constructors -------------------------------------------------------
/**
* Don't allow public usage.
*/
protected RasterizerTaskSVGConverterController() {
}
/**
* Sets the given Ant task to receive log messages.
*
* @param task Ant task. The value can be <code>null</code> when log messages won't be written.
*/
public RasterizerTaskSVGConverterController(Task task) {
executingTask = task;
}
// -- Public interface ---------------------------------------------------
public boolean proceedWithComputedTask(Transcoder transcoder,
Map hints,
List sources,
List dest){
return true;
}
public boolean proceedWithSourceTranscoding(SVGConverterSource source,
File dest) {
return true;
}
public boolean proceedOnSourceTranscodingFailure(SVGConverterSource source,
File dest,
String errorCode){
if(executingTask != null) {
executingTask.log("Unable to rasterize image '"
+ source.getName() + "' to '"
+ dest.getAbsolutePath() + "': " + errorCode);
}
return true;
}
public void onSourceTranscodingSuccess(SVGConverterSource source,
File dest){
}
}
|
[
"testbot@balabit.com"
] |
testbot@balabit.com
|
01dcd4fc9b99079807c0c70d4eda027f13c4958c
|
11c721abff1c38dbfcdc050dc11e9e62d7ed3662
|
/surefire-integration-tests/src/test/resources/unicode-testnames/src/test/java/junit/twoTestCases/EscapeTest.java
|
69ea6e1883b621635f2e264623472465b6afd0a3
|
[
"Apache-2.0"
] |
permissive
|
DaGeRe/maven-surefire
|
4106549e59d8bd154ce0872726cc73a7585e8edb
|
45de58b12413df54d3dc7cd313f117930964504e
|
refs/heads/master
| 2022-03-09T15:41:34.644027
| 2017-10-11T15:29:09
| 2017-10-11T22:46:54
| 106,571,653
| 1
| 2
| null | 2017-10-11T15:20:17
| 2017-10-11T15:20:17
| null |
UTF-8
|
Java
| false
| false
| 2,136
|
java
|
package junit.twoTestCases;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class EscapeTest
extends TestCase
{
private boolean setUpCalled = false;
private static boolean tearDownCalled = false;
public EscapeTest( String name )
{
super( name );
}
public static Test suite()
{
TestSuite suite = new TestSuite();
Test test = new EscapeTest( "testSetUp" );
suite.addTest( test );
return new TestSetup( suite )
{
protected void setUp()
{
//oneTimeSetUp();
}
protected void tearDown()
{
oneTimeTearDown();
}
};
}
protected void setUp()
{
setUpCalled = true;
tearDownCalled = false;
System.out.println( "Called setUp" );
}
protected void tearDown()
{
setUpCalled = false;
tearDownCalled = true;
System.out.println( "Called tearDown" );
}
public void testSetUp()
{
assertTrue( "setUp was not called", setUpCalled );
}
public static void oneTimeTearDown()
{
assertTrue( "tearDown was not called", tearDownCalled );
}
}
|
[
"krosenvold@apache.org"
] |
krosenvold@apache.org
|
73b8a872493484a8949a56d77d737bcaf405c798
|
dd17d429daf7bb9c1f66fd48a03269df5e535447
|
/bit/algorithm/dp/LC77MinDistance.java
|
e1dc6d1d0cbde9d21a300dbcef7303f2918aae95
|
[] |
no_license
|
wangzilong2019/Algorithm
|
6e1b3f549c13ae171fa79f5899169e320cbbdcb1
|
43af25ae1c167e7ebe1d1be461eca57b52e93ab6
|
refs/heads/master
| 2022-12-01T19:17:21.206767
| 2022-11-23T13:33:19
| 2022-11-23T13:33:19
| 233,599,797
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,085
|
java
|
package bit.algorithm.dp;
import java.lang.management.ManagementFactory;
public class LC77MinDistance {
/**
* 给定两个单词word1和word2,请计算将word1转换为word2至少需要多少步操作。
* 你可以对一个单词执行以下3种操作:
* a)在单词中插入一个字符
* b)删除单词中的一个字符
* c)替换单词中的一个字符
*/
/**
* 动态规划:
* 俩个字符串右侧由三种对齐方式
* 第一种
* x1, x2, xn
* x1, x2
* 第二种
* x1, x2
* x1, x2, xn
* 第一种和第二种只需要删除一个字符,再加上之后的操作次次数即可
* 第三种
* x1, x2
* x1, x2
* 此时第三种由俩种可能,最后一个字符相同或是不同,此时只需要判断俩个字符相同还hi不同,然后再加上之后的即可
* @param word1 string字符串
* @param word2 string字符串
* @return int整型
*/
public int minDistance (String word1, String word2) {
// write code here
//记录俩个字符串的长度
int row = word1.length();
int col = word2.length();
//初始化数组
int[][] d = new int[row+1][col+1];
for (int j = 0; j <= col; j++ ) {
d[0][j] = j;
}
for (int i = 0; i <= row; i++) {
d[i][0] = i;
}
//动态规划求解
int diff;
for (int i = 1; i <= row; i++) {
for (int j = 1; j <= col; j++) {
//判断当前字符是否相同
if (word1.charAt(i-1) == word2.charAt(j-1)) {
diff = 0;
} else {
diff = 1;
}
//先取俩者最小值
int temp = Math.min(d[i-1][j] + 1, d[i][j-1] + 1);
//之后取三者最小值
d[i][j] = Math.min(temp, d[i-1][j-1] + diff);
}
}
return d[row][col];
}
}
|
[
"1428075063@qq.com"
] |
1428075063@qq.com
|
120f442a738bce5454d7850454edb55ed5821110
|
7df686982c9349761c6c1fca3f8fa8e4ef8d220f
|
/src/main/java/org/wildfly/extension/elytron/RoleDecoderDefinitions.java
|
c3965cd9bea2477645040f29569dbd53f8e6dbd1
|
[
"Apache-2.0"
] |
permissive
|
jtymel/elytron-subsystem
|
a186f4e09bb08482bc9d9cbd19f7d8ab22b2e016
|
0e45ff440267cb2edf9827e4155fe9f7955a7b07
|
refs/heads/master
| 2020-12-30T09:51:10.936466
| 2016-07-21T11:57:36
| 2016-07-21T11:57:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,846
|
java
|
/*
* JBoss, Home of Professional Open Source.
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* 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.wildfly.extension.elytron;
import static org.wildfly.extension.elytron.Capabilities.ROLE_DECODER_RUNTIME_CAPABILITY;
import static org.wildfly.extension.elytron.ElytronDefinition.commonDependencies;
import org.jboss.as.controller.AbstractAddStepHandler;
import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.OperationStepHandler;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.ResourceDefinition;
import org.jboss.as.controller.RestartParentWriteAttributeHandler;
import org.jboss.as.controller.SimpleAttributeDefinition;
import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
import org.jboss.as.controller.SimpleResourceDefinition;
import org.jboss.as.controller.capability.RuntimeCapability;
import org.jboss.as.controller.registry.AttributeAccess;
import org.jboss.as.controller.registry.ManagementResourceRegistration;
import org.jboss.as.controller.registry.OperationEntry;
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ModelType;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController.Mode;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
import org.wildfly.security.authz.RoleDecoder;
/**
* Container class for the {@link RoleDecoder} definitions.
*
* @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
*/
class RoleDecoderDefinitions {
static final SimpleAttributeDefinition ATTRIBUTE = new SimpleAttributeDefinitionBuilder(ElytronDescriptionConstants.ATTRIBUTE, ModelType.STRING, false)
.setAllowExpression(true)
.setMinSize(1)
.setFlags(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES)
.build();
static ResourceDefinition getEmptyRoleDecoderDefinition() {
return EmptyResourceDefinition.create(RoleDecoder.class, ElytronDescriptionConstants.EMPTY_ROLE_DECODER, ROLE_DECODER_RUNTIME_CAPABILITY, () -> RoleDecoder.EMPTY);
}
static ResourceDefinition getSimpleRoleDecoderDefinition() {
return new SimpleRoleDecoderDefinition();
}
private static class SimpleRoleDecoderDefinition extends SimpleResourceDefinition {
private static final AbstractAddStepHandler ADD = new SimpleRoleDecoderAddHandler();
private static final OperationStepHandler REMOVE = new TrivialCapabilityServiceRemoveHandler(ADD, ROLE_DECODER_RUNTIME_CAPABILITY);
SimpleRoleDecoderDefinition() {
super(new Parameters(PathElement.pathElement(ElytronDescriptionConstants.SIMPLE_ROLE_DECODER), ElytronExtension.getResourceDescriptionResolver(ElytronDescriptionConstants.SIMPLE_ROLE_DECODER))
.setAddHandler(ADD)
.setRemoveHandler(REMOVE)
.setAddRestartLevel(OperationEntry.Flag.RESTART_RESOURCE_SERVICES)
.setRemoveRestartLevel(OperationEntry.Flag.RESTART_RESOURCE_SERVICES)
.setCapabilities(ROLE_DECODER_RUNTIME_CAPABILITY));
}
@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
resourceRegistration.registerReadWriteAttribute(ATTRIBUTE, null, new WriteAttributeHandler(ElytronDescriptionConstants.SIMPLE_ROLE_DECODER, ATTRIBUTE));
}
}
private static class SimpleRoleDecoderAddHandler extends BaseAddHandler {
private SimpleRoleDecoderAddHandler() {
super(ROLE_DECODER_RUNTIME_CAPABILITY, ATTRIBUTE);
}
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
throws OperationFailedException {
ServiceTarget serviceTarget = context.getServiceTarget();
RuntimeCapability<Void> runtimeCapability = ROLE_DECODER_RUNTIME_CAPABILITY.fromBaseCapability(context.getCurrentAddressValue());
ServiceName roleDecoderName = runtimeCapability.getCapabilityServiceName(RoleDecoder.class);
final String attribute = ATTRIBUTE.resolveModelAttribute(context, model).asString();
TrivialService<RoleDecoder> roleDecoderService = new TrivialService<RoleDecoder>(() -> RoleDecoder.simple(attribute));
ServiceBuilder<RoleDecoder> roleDecoderBuilderBuilder = serviceTarget.addService(roleDecoderName, roleDecoderService);
commonDependencies(roleDecoderBuilderBuilder)
.setInitialMode(Mode.LAZY)
.install();
}
}
private static class WriteAttributeHandler extends RestartParentWriteAttributeHandler {
WriteAttributeHandler(String parentName, AttributeDefinition ... attributes) {
super(parentName, attributes);
}
@Override
protected ServiceName getParentServiceName(PathAddress pathAddress) {
return ROLE_DECODER_RUNTIME_CAPABILITY.fromBaseCapability(pathAddress.getLastElement().getValue()).getCapabilityServiceName(RoleDecoder.class);
}
}
}
|
[
"darran.lofthouse@jboss.com"
] |
darran.lofthouse@jboss.com
|
46238701d39de9bb4df6c2b64daeb89aeed5cf5c
|
3a1c2f01fc4388d187ae1b1a808aac3eb8f9d95f
|
/subsys/kafka/src/main/java/org/commonjava/indy/subsys/kafka/util/LogbackFormatter.java
|
730de9392ce3640dd15dba61831f3b15e600d8a3
|
[
"Apache-2.0"
] |
permissive
|
pombredanne/indy
|
57ee33893e3b81304efa967b0d821127304d06e2
|
957ac70c68ca36f9b40c5785a2f26972d2c09f71
|
refs/heads/master
| 2021-01-23T15:04:33.593448
| 2019-11-19T13:02:36
| 2019-11-19T13:02:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,569
|
java
|
/**
* Copyright (C) 2011-2019 Red Hat, Inc. (https://github.com/Commonjava/indy)
*
* 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.commonjava.indy.subsys.kafka.util;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.LoggingEvent;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.ConsoleAppender;
import ch.qos.logback.core.OutputStreamAppender;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Iterator;
/**
* Created by ruhan on 12/20/18.
*/
public class LogbackFormatter
{
private final Logger logger;
private OutputStreamAppender<ILoggingEvent> appender;
public LogbackFormatter( String loggerName )
{
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
logger = context.getLogger( loggerName );
Iterator<Appender<ILoggingEvent>> it = logger.iteratorForAppenders();
while ( it.hasNext() )
{
Appender a = it.next();
if ( a instanceof OutputStreamAppender )
{
appender = (OutputStreamAppender) a;
return;
}
}
}
public LogbackFormatter( String loggerName, String appenderName )
{
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
logger = context.getLogger( loggerName );
appender = (ConsoleAppender<ILoggingEvent>) logger.getAppender( appenderName );
}
public String format( String message ) throws IOException
{
if ( appender == null )
{
return message;
}
ILoggingEvent logEvent = new LoggingEvent( LogbackFormatter.class.getName(), logger, Level.INFO, message, null,
new Object[0] );
byte[] encode = appender.getEncoder().encode( logEvent );
return new String( encode );
}
}
|
[
"jdcasey@commonjava.org"
] |
jdcasey@commonjava.org
|
96f49738c1f404a051e1eee098609f530d47b371
|
bace31aab2aa164a0249c271f7cf7ba9a1503d04
|
/app/src/main/java/com/tiendas3b/almacen/db/dao/DecreaseMP.java
|
42f2a35906afbbb085b8f827dd65986cddfd19bf
|
[] |
no_license
|
opelayoa/Project
|
a8fab2a6f759f076fd52989e8917f2c02915096b
|
43788f12e3c7ea39a8bab8e35e85b74ff6c9f9fa
|
refs/heads/master
| 2020-04-10T07:33:17.768276
| 2019-01-04T22:02:31
| 2019-01-04T22:02:31
| 160,883,293
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,326
|
java
|
package com.tiendas3b.almacen.db.dao;
// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
// KEEP INCLUDES - put your custom includes here
// KEEP INCLUDES END
/**
* Entity mapped to table "DECREASE_MP".
*/
public class DecreaseMP {
private Long iclave;
private String description;
private Integer amount;
private Long type;
private Long obs;
private Long obsLog;
private Float cost;
private String obsStr;
private Integer odc;
// KEEP FIELDS - put your custom fields here
// KEEP FIELDS END
public DecreaseMP() {
}
public DecreaseMP(Long iclave, String description, Integer amount, Long type, Long obs, Long obsLog, Float cost, String obsStr, Integer odc) {
this.iclave = iclave;
this.description = description;
this.amount = amount;
this.type = type;
this.obs = obs;
this.obsLog = obsLog;
this.cost = cost;
this.obsStr = obsStr;
this.odc = odc;
}
public Long getIclave() {
return iclave;
}
public void setIclave(Long iclave) {
this.iclave = iclave;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getAmount() {
return amount;
}
public void setAmount(Integer amount) {
this.amount = amount;
}
public Long getType() {
return type;
}
public void setType(Long type) {
this.type = type;
}
public Long getObs() {
return obs;
}
public void setObs(Long obs) {
this.obs = obs;
}
public Long getObsLog() {
return obsLog;
}
public void setObsLog(Long obsLog) {
this.obsLog = obsLog;
}
public Float getCost() {
return cost;
}
public void setCost(Float cost) {
this.cost = cost;
}
public String getObsStr() {
return obsStr;
}
public void setObsStr(String obsStr) {
this.obsStr = obsStr;
}
public Integer getOdc() {
return odc;
}
public void setOdc(Integer odc) {
this.odc = odc;
}
// KEEP METHODS - put your custom methods here
// KEEP METHODS END
}
|
[
"od.pelayo@gmail.com"
] |
od.pelayo@gmail.com
|
399ad56ea1a4ca82124fc81261bcaea1ffe3def0
|
d71e879b3517cf4fccde29f7bf82cff69856cfcd
|
/ExtractedJars/RT_News_com.rt.mobile.english/javafiles/android/support/v4/view/ViewCompat$ViewCompatApi19Impl.java
|
65aaba7317e0e2b7266c1eb34cd60ba83ad55906
|
[
"MIT"
] |
permissive
|
Andreas237/AndroidPolicyAutomation
|
b8e949e072d08cf6c6166c3f15c9c63379b8f6ce
|
c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a
|
refs/heads/master
| 2020-04-10T02:14:08.789751
| 2019-05-16T19:29:11
| 2019-05-16T19:29:11
| 160,739,088
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,069
|
java
|
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) annotate safe
package android.support.v4.view;
import android.view.View;
// Referenced classes of package android.support.v4.view:
// ViewCompat
static class ViewCompat$ViewCompatApi19Impl extends ViewCompat$ViewCompatApi18Impl
{
public int getAccessibilityLiveRegion(View view)
{
return view.getAccessibilityLiveRegion();
// 0 0:aload_1
// 1 1:invokevirtual #22 <Method int View.getAccessibilityLiveRegion()>
// 2 4:ireturn
}
public boolean isAttachedToWindow(View view)
{
return view.isAttachedToWindow();
// 0 0:aload_1
// 1 1:invokevirtual #27 <Method boolean View.isAttachedToWindow()>
// 2 4:ireturn
}
public boolean isLaidOut(View view)
{
return view.isLaidOut();
// 0 0:aload_1
// 1 1:invokevirtual #30 <Method boolean View.isLaidOut()>
// 2 4:ireturn
}
public boolean isLayoutDirectionResolved(View view)
{
return view.isLayoutDirectionResolved();
// 0 0:aload_1
// 1 1:invokevirtual #33 <Method boolean View.isLayoutDirectionResolved()>
// 2 4:ireturn
}
public void setAccessibilityLiveRegion(View view, int i)
{
view.setAccessibilityLiveRegion(i);
// 0 0:aload_1
// 1 1:iload_2
// 2 2:invokevirtual #38 <Method void View.setAccessibilityLiveRegion(int)>
// 3 5:return
}
public void setImportantForAccessibility(View view, int i)
{
view.setImportantForAccessibility(i);
// 0 0:aload_1
// 1 1:iload_2
// 2 2:invokevirtual #41 <Method void View.setImportantForAccessibility(int)>
// 3 5:return
}
ViewCompat$ViewCompatApi19Impl()
{
// 0 0:aload_0
// 1 1:invokespecial #14 <Method void ViewCompat$ViewCompatApi18Impl()>
// 2 4:return
}
}
|
[
"silenta237@gmail.com"
] |
silenta237@gmail.com
|
6f504bb2c31dad105e6cb84d4132b1a83a2f4434
|
fdb2cbbd581af365ba381f59cee490c1b4b3b37c
|
/java/src/quartz_scheduler/com/quartz/smssendmt/model/TblSMSQueue.java
|
52f93f8c5f059629eec52097a0931717b3e59412
|
[] |
no_license
|
vuquangtin/frameworks
|
afbb6a024d7b5a77af1e1d4c204f929a9882bd37
|
b43f2f188fa5ee6fc692e0eeba839acb1c6a2c4d
|
refs/heads/master
| 2022-12-16T11:11:56.787032
| 2020-08-28T03:39:54
| 2020-08-28T03:39:54
| 233,235,428
| 0
| 1
| null | 2022-12-16T10:32:07
| 2020-01-11T13:23:36
|
Java
|
UTF-8
|
Java
| false
| false
| 1,506
|
java
|
package com.quartz.smssendmt.model;
import java.util.Date;
/**
*
*
* @author EMAIL:vuquangtin@gmail.com , tel:0377443333
* @version 1.0.0
* @see <a href="https://github.com/vuquangtin/frameworks">https://github.com/
* vuquangtin/frameworks</a>
*
*/
public class TblSMSQueue implements java.io.Serializable {
private long gid;
private String phone;
private String content;
private int status;
private Date createdAt;
private Date updatedAt;
public TblSMSQueue() {
}
public TblSMSQueue(String phone, String content, int status) {
this.phone = phone;
this.content = content;
this.status = status;
}
public long getGid() {
return gid;
}
public void setGid(long gid) {
this.gid = gid;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
}
|
[
"vuquangtin@gmail.com"
] |
vuquangtin@gmail.com
|
6dcd8900321cde538c546f8bd5a1832b7fe730f6
|
800b992074dcc5451ce10caf8a30efdec54e884d
|
/src/Ch_07/Video07_03/Start/FlowerRecord.java
|
9936747a19a16b77f70993871e7d6aaa8a32c56d
|
[] |
no_license
|
gauthierwakay/data-science-using-java
|
37fe2e9b139f8fc3c35cd1404246992da5c616d0
|
284b279b0ccdd58bbc0f4cf30c0d0b8a8749302b
|
refs/heads/master
| 2023-07-18T01:20:45.707587
| 2021-09-03T19:15:28
| 2021-09-03T19:15:28
| 402,875,471
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 902
|
java
|
package Ch_07.Video07_03.Start;
public class FlowerRecord {
public final Double sepalLength;
public final Double sepalWidth;
public final Double petalLength;
public final Double petalWidth;
public final String species;
public FlowerRecord(Double sepalLength, Double sepalWidth, Double petalLength, Double petalWidth, String species) {
this.sepalLength = sepalLength;
this.sepalWidth = sepalWidth;
this.petalLength = petalLength;
this.petalWidth = petalWidth;
this.species = species;
}
@Override
public String toString() {
return "FlowerRecord{" +
"sepalLength=" + sepalLength +
", sepalWidth=" + sepalWidth +
", petalLength=" + petalLength +
", petalWidth=" + petalWidth +
", species='" + species + '\'' +
'}';
}
}
|
[
"jet9seven@gmail.com"
] |
jet9seven@gmail.com
|
6dcf0e071b6ea5e9f6bd2bf4bfee61bb684e9bfc
|
dba87418d2286ce141d81deb947305a0eaf9824f
|
/sources/p052cz/msebera/android/httpclient/protocol/BasicHttpContext.java
|
c7f81fa58fc71e603994da05075d10947749aec8
|
[] |
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
| 2,153
|
java
|
package p052cz.msebera.android.httpclient.protocol;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import p052cz.msebera.android.httpclient.annotation.ThreadSafe;
import p052cz.msebera.android.httpclient.util.Args;
@ThreadSafe
/* renamed from: cz.msebera.android.httpclient.protocol.BasicHttpContext */
public class BasicHttpContext implements HttpContext {
private final Map<String, Object> map;
private final HttpContext parentContext;
public BasicHttpContext() {
this((HttpContext) null);
}
public BasicHttpContext(HttpContext httpContext) {
this.map = new ConcurrentHashMap();
this.parentContext = httpContext;
}
/* JADX WARNING: Code restructure failed: missing block: B:2:0x000d, code lost:
r1 = r2.parentContext;
*/
/* Code decompiled incorrectly, please refer to instructions dump. */
public java.lang.Object getAttribute(java.lang.String r3) {
/*
r2 = this;
java.lang.String r0 = "Id"
p052cz.msebera.android.httpclient.util.Args.notNull(r3, r0)
java.util.Map<java.lang.String, java.lang.Object> r0 = r2.map
java.lang.Object r0 = r0.get(r3)
if (r0 != 0) goto L_0x0015
cz.msebera.android.httpclient.protocol.HttpContext r1 = r2.parentContext
if (r1 == 0) goto L_0x0015
java.lang.Object r0 = r1.getAttribute(r3)
L_0x0015:
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: p052cz.msebera.android.httpclient.protocol.BasicHttpContext.getAttribute(java.lang.String):java.lang.Object");
}
public void setAttribute(String str, Object obj) {
Args.notNull(str, "Id");
if (obj != null) {
this.map.put(str, obj);
} else {
this.map.remove(str);
}
}
public Object removeAttribute(String str) {
Args.notNull(str, "Id");
return this.map.remove(str);
}
public void clear() {
this.map.clear();
}
public String toString() {
return this.map.toString();
}
}
|
[
"lucksonsurprice94@gmail.com"
] |
lucksonsurprice94@gmail.com
|
775a21cb903e075494f17073ef0754f2b4b9a2b8
|
b98f5be2877fc829ec9ea54132e46c4a9e8a9381
|
/src/main/java/com/concur/unity/profile/Profileable.java
|
f34e22019ad8f0a9abf90c2c74b3d1af0fedb4db
|
[] |
no_license
|
Jakegogo/unity
|
0a0b1710d722935ccc51a05e7037a1cdf9accc82
|
3e5c069e5caf8a1d05614e0a988ae35df0bb253c
|
refs/heads/master
| 2020-03-08T22:26:08.837785
| 2018-12-30T05:32:52
| 2018-12-30T05:32:52
| 128,430,717
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 225
|
java
|
/**
*
*/
package com.concur.unity.profile;
/**
* 性能分析接口
* <li>可输出性能分析结果的</li>
* @author Jake
*
*/
public interface Profileable {
/**
* 输出性能情况
*/
void profile();
}
|
[
"335923591@qq.com"
] |
335923591@qq.com
|
592b5e8571d5c719a018b6cd112404a85eadb180
|
f6c831b8b2e28be60dc3516aacd1062cd6ec02be
|
/src/test/java/cl/jalmenarez/store/web/rest/errors/ExceptionTranslatorIT.java
|
bcdf46c611bc0443e5e251ac089f99dbcb115173
|
[] |
no_license
|
jalmenarez/petstore
|
c2c6333a6c100759bb004311f760f7eb679b0a70
|
ece3d89a24ee67906cc7672bb2a12167e9259f14
|
refs/heads/master
| 2022-12-06T09:11:59.254635
| 2020-08-29T17:11:10
| 2020-08-29T17:11:10
| 291,314,471
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,018
|
java
|
package cl.jalmenarez.store.web.rest.errors;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import cl.jalmenarez.store.PetstoreApp;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.web.servlet.MockMvc;
/**
* Integration tests {@link ExceptionTranslator} controller advice.
*/
@WithMockUser
@AutoConfigureMockMvc
@SpringBootTest(classes = PetstoreApp.class)
public class ExceptionTranslatorIT {
@Autowired
private MockMvc mockMvc;
@Test
public void testMethodArgumentNotValid() throws Exception {
mockMvc
.perform(post("/api/exception-translator-test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION))
.andExpect(jsonPath("$.fieldErrors.[0].objectName").value("test"))
.andExpect(jsonPath("$.fieldErrors.[0].field").value("test"))
.andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull"));
}
@Test
public void testMissingServletRequestPartException() throws Exception {
mockMvc
.perform(get("/api/exception-translator-test/missing-servlet-request-part"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.400"));
}
@Test
public void testMissingServletRequestParameterException() throws Exception {
mockMvc
.perform(get("/api/exception-translator-test/missing-servlet-request-parameter"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.400"));
}
@Test
public void testAccessDenied() throws Exception {
mockMvc
.perform(get("/api/exception-translator-test/access-denied"))
.andExpect(status().isForbidden())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.403"))
.andExpect(jsonPath("$.detail").value("test access denied!"));
}
@Test
public void testUnauthorized() throws Exception {
mockMvc
.perform(get("/api/exception-translator-test/unauthorized"))
.andExpect(status().isUnauthorized())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.401"))
.andExpect(jsonPath("$.path").value("/api/exception-translator-test/unauthorized"))
.andExpect(jsonPath("$.detail").value("test authentication failed!"));
}
@Test
public void testMethodNotSupported() throws Exception {
mockMvc
.perform(post("/api/exception-translator-test/access-denied"))
.andExpect(status().isMethodNotAllowed())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.405"))
.andExpect(jsonPath("$.detail").value("Request method 'POST' not supported"));
}
@Test
public void testExceptionWithResponseStatus() throws Exception {
mockMvc
.perform(get("/api/exception-translator-test/response-status"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.400"))
.andExpect(jsonPath("$.title").value("test response status"));
}
@Test
public void testInternalServerError() throws Exception {
mockMvc
.perform(get("/api/exception-translator-test/internal-server-error"))
.andExpect(status().isInternalServerError())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.500"))
.andExpect(jsonPath("$.title").value("Internal Server Error"));
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
ea0783c0a14b544ba3a66f88804b1ee585676529
|
88b8fe5b9140d17d2c5a110d2c05c5a0574b1fa9
|
/sunyata-game-majiang-core/src/main/java/org/sunyata/game/majiang/core/service/yunfeng/table/src/org/yungege/mj/Program.java
|
83dbf8761c792a6eead6cc2c0f05117815b9528b
|
[] |
no_license
|
sunyata-projects/vertx-game
|
9c538000e5b1298eb8f178a1cdaac04724a8b68d
|
3f0a0874636b2dc8e681113421496e0cb0837f13
|
refs/heads/master
| 2021-09-26T18:07:59.892671
| 2017-12-14T12:23:26
| 2017-12-14T12:23:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,321
|
java
|
package org.sunyata.game.majiang.core.service.yunfeng.table.src.org.yungege.mj;
import java.util.HashSet;
import java.util.Random;
public class Program {
public static void print_cards(int[] cards) {
for (int i = 0; i < 9; ++i) {
System.out.print(cards[i]);
System.out.print(",");
}
System.out.println("");
for (int i = 9; i < 18; ++i) {
System.out.print(cards[i]);
System.out.print(",");
}
System.out.println("");
for (int i = 18; i < 27; ++i) {
System.out.print(cards[i]);
System.out.print(",");
}
System.out.println("");
for (int i = 27; i < 34; ++i) {
System.out.print(cards[i]);
System.out.print(",");
}
System.out.println("\n=========================================");
}
static HashSet<Integer> tested = new HashSet<Integer>();
static void check_hu(int[] cards, int max_gui_index) {
for (int i = 0; i < max_gui_index; ++i) {
if (cards[i] > 4)
return;
}
int num = 0;
for (int i = 0; i < 9; ++i) {
num = num * 10 + cards[i];
}
if (tested.contains(num)) {
return;
}
tested.add(num);
for (int i = 0; i < max_gui_index; ++i) {
if (!Hulib.getInstance().get_hu_info(cards, 0, 0)) {
System.out.print("测试失败 i=%d\n" + i);
print_cards(cards);
}
}
}
static void gen_auto_table_sub(int[] cards, int level) {
for (int i = 0; i < 32; ++i) {
int index = -1;
if (i <= 17) {
cards[i] += 3;
} else if (i <= 24) {
index = i - 18;
} else {
index = i - 16;
}
if (index >= 0) {
cards[index] += 1;
cards[index + 1] += 1;
cards[index + 2] += 1;
}
if (level == 4) {
check_hu(cards, 18);
} else {
gen_auto_table_sub(cards, level + 1);
}
if (i <= 17) {
cards[i] -= 3;
} else {
cards[index] -= 1;
cards[index + 1] -= 1;
cards[index + 2] -= 1;
}
}
}
public static void test1() {
System.out.println("测试两种花色\n");
int[] cards = { 0, 0, 0, 1, 1, 1, 0, 2, 0, /* 桶 */ 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 条 */ 0, 0, 0, 0, 0, 0, 0,0,0,/* 字 */ 0, 0, 0, 0, 0, 0, 0 };
gen_auto_table_sub(cards, 1);
// for (int i = 0; i < 18; ++i) {
// cards[i] = 2;
// System.out.print("将 ");
// System.out.println(i);
// gen_auto_table_sub(cards, 1);
// cards[i] = 0;
// }
}
static void test_one() {
TableMgr.getInstance().load();
int guiIndex = 33;
// 1筒,2筒,3筒,4筒,4筒,5筒,5筒,6筒,7筒,7筒,8筒,8筒,9筒,9筒
// int[] cards = { 1, 0, 0, 0, 0, 0, 0, 0, 0,/*桶*/ 1, 1, 1, 2, 1, 1, 2,
// 2, 2,
// /*条*/ 0, 0, 0, 0, 0, 0, 0, 0, 0,/*字*/ 0, 0, 0, 0, 0, 0, 0 };
int[] cards = {
0, 0, 0, 1, 1, 1, 0, 0, 0, /* 桶 */
1, 1, 1, 0, 0, 0, 0, 0, 0, /* 条 */
2, 0, 0, 0, 0, 0, 0, 0, 0, /* 字 */
0, 0, 0, 0, 0, 0, 0 };
System.out.println("测试1种,癞子:" + guiIndex);
print_cards(cards);
long start = System.currentTimeMillis();
if (!Hulib.getInstance().get_hu_info(cards, 34, guiIndex)) {
System.out.print("测试失败\n");
} else {
System.out.print("测试成功\n");
}
System.out.println("use:" + (System.currentTimeMillis() - start));
}
public static void main(String[] args) {
// ak_test();
test_one();
}
private static Random random = new Random();
private static void ak_test()
{
System.out.print("test hulib begin...\n");
TableMgr.getInstance().load();
int lose = 0;
int win = 0;
long start = System.currentTimeMillis();
for (int i = 0 ; i < 1000000 ; i++)
{
int[] cards = new int[34];
int cardNum = 0;
while (cardNum < 14)
{
if(cards[random.nextInt(cards.length)] < 4)
{
cards[random.nextInt(cards.length)]++;
cardNum++;
}
}
int guiIndex = random.nextInt(34);
// System.out.println("测试1种,癞子:" + guiIndex);
// print_cards(cards);
if (!Hulib.getInstance().get_hu_info(cards, 34, guiIndex)) {
// System.out.print("测试失败\n");
lose++;
} else {
// System.out.print("测试成功\n");
// System.out.println("测试1种,癞子:" + guiIndex);
// print_cards(cards);
win++;
}
}
System.out.println("1000000次,use:" + (System.currentTimeMillis() - start)+"ms,成功:"+win+"次,失败:"+lose+"次.");
// System.Console.ReadKey();
}
}
|
[
"licl.chevan@ourgame.com"
] |
licl.chevan@ourgame.com
|
e3c58b02b3c2c72faac4a8c3d98ffd2c7b003bfb
|
f63bb4535e8347ffc73025ed3c58b845eeefc9ce
|
/mall-portal/src/main/java/com/zscat/mall/portal/service/MemberAttentionService.java
|
558021af58c13e07b050ad868b70520b492321cc
|
[] |
no_license
|
442114004/mall-dubbo
|
ed1e6130ab0f14710fb975ac97ba0bf1e40564f9
|
1dfb2d6b262d19a859111d5451464be0b5a3d099
|
refs/heads/master
| 2020-04-27T16:11:43.405289
| 2019-03-08T05:31:41
| 2019-03-08T05:31:41
| 174,475,739
| 4
| 3
| null | 2019-03-08T05:37:56
| 2019-03-08T05:37:55
| null |
UTF-8
|
Java
| false
| false
| 507
|
java
|
package com.zscat.mall.portal.service;
import com.zscat.mall.portal.entity.MemberBrandAttention;
import java.util.List;
/**
* 会员关注Service
* Created by zscat on 2018/8/2.
*/
public interface MemberAttentionService {
/**
* 添加关注
*/
int add(MemberBrandAttention memberBrandAttention);
/**
* 取消关注
*/
int delete(Long memberId, Long brandId);
/**
* 获取用户关注列表
*/
List<MemberBrandAttention> list(Long memberId);
}
|
[
"zhuan.shen@rjfittime.com"
] |
zhuan.shen@rjfittime.com
|
0af5a48ce4f892c924fe5c25cfe4cfc01fdbbe54
|
097df92ce1bfc8a354680725c7d10f0d109b5b7d
|
/com/amazon/ws/emr/hadoop/fs/shaded/org/apache/http/client/methods/AbstractExecutionAwareRequest$1.java
|
b2c5a99a63c03e5299643d0555f4be37cd14a94a
|
[] |
no_license
|
cozos/emrfs-hadoop
|
7a1a1221ffc3aa8c25b1067cf07d3b46e39ab47f
|
ba5dfa631029cb5baac2f2972d2fdaca18dac422
|
refs/heads/master
| 2022-10-14T15:03:51.500050
| 2022-10-06T05:38:49
| 2022-10-06T05:38:49
| 233,979,996
| 2
| 2
| null | 2022-10-06T05:41:46
| 2020-01-15T02:24:16
|
Java
|
UTF-8
|
Java
| false
| false
| 760
|
java
|
package com.amazon.ws.emr.hadoop.fs.shaded.org.apache.http.client.methods;
import com.amazon.ws.emr.hadoop.fs.shaded.org.apache.http.concurrent.Cancellable;
import com.amazon.ws.emr.hadoop.fs.shaded.org.apache.http.conn.ClientConnectionRequest;
class AbstractExecutionAwareRequest$1
implements Cancellable
{
AbstractExecutionAwareRequest$1(AbstractExecutionAwareRequest paramAbstractExecutionAwareRequest, ClientConnectionRequest paramClientConnectionRequest) {}
public boolean cancel()
{
val$connRequest.abortRequest();
return true;
}
}
/* Location:
* Qualified Name: com.amazon.ws.emr.hadoop.fs.shaded.org.apache.http.client.methods.AbstractExecutionAwareRequest.1
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"Arwin.tio@adroll.com"
] |
Arwin.tio@adroll.com
|
ea6f8e176e3fd1f6a437ebc654387576b9812fb5
|
96670d2b28a3fb75d2f8258f31fc23d370af8a03
|
/reverse_engineered/sources/com/google/android/gms/maps/internal/IProjectionDelegate.java
|
bb7fee74800b51a9e972e2e9f1642c887210b2f7
|
[] |
no_license
|
P79N6A/speedx
|
81a25b63e4f98948e7de2e4254390cab5612dcbd
|
800b6158c7494b03f5c477a8cf2234139889578b
|
refs/heads/master
| 2020-05-30T18:43:52.613448
| 2019-06-02T07:57:10
| 2019-06-02T08:15:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,299
|
java
|
package com.google.android.gms.maps.internal;
import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;
import com.google.android.gms.dynamic.zzd;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.VisibleRegion;
public interface IProjectionDelegate extends IInterface {
public static abstract class zza extends Binder implements IProjectionDelegate {
private static class zza implements IProjectionDelegate {
private IBinder zzahn;
zza(IBinder iBinder) {
this.zzahn = iBinder;
}
public IBinder asBinder() {
return this.zzahn;
}
public LatLng fromScreenLocation(zzd zzd) throws RemoteException {
LatLng latLng = null;
Parcel obtain = Parcel.obtain();
Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.maps.internal.IProjectionDelegate");
obtain.writeStrongBinder(zzd != null ? zzd.asBinder() : null);
this.zzahn.transact(1, obtain, obtain2, 0);
obtain2.readException();
if (obtain2.readInt() != 0) {
latLng = (LatLng) LatLng.CREATOR.createFromParcel(obtain2);
}
obtain2.recycle();
obtain.recycle();
return latLng;
} catch (Throwable th) {
obtain2.recycle();
obtain.recycle();
}
}
public VisibleRegion getVisibleRegion() throws RemoteException {
Parcel obtain = Parcel.obtain();
Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.maps.internal.IProjectionDelegate");
this.zzahn.transact(3, obtain, obtain2, 0);
obtain2.readException();
VisibleRegion visibleRegion = obtain2.readInt() != 0 ? (VisibleRegion) VisibleRegion.CREATOR.createFromParcel(obtain2) : null;
obtain2.recycle();
obtain.recycle();
return visibleRegion;
} catch (Throwable th) {
obtain2.recycle();
obtain.recycle();
}
}
public zzd toScreenLocation(LatLng latLng) throws RemoteException {
Parcel obtain = Parcel.obtain();
Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.google.android.gms.maps.internal.IProjectionDelegate");
if (latLng != null) {
obtain.writeInt(1);
latLng.writeToParcel(obtain, 0);
} else {
obtain.writeInt(0);
}
this.zzahn.transact(2, obtain, obtain2, 0);
obtain2.readException();
zzd zzfc = com.google.android.gms.dynamic.zzd.zza.zzfc(obtain2.readStrongBinder());
return zzfc;
} finally {
obtain2.recycle();
obtain.recycle();
}
}
}
public static IProjectionDelegate zzil(IBinder iBinder) {
if (iBinder == null) {
return null;
}
IInterface queryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.maps.internal.IProjectionDelegate");
return (queryLocalInterface == null || !(queryLocalInterface instanceof IProjectionDelegate)) ? new zza(iBinder) : (IProjectionDelegate) queryLocalInterface;
}
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
IBinder iBinder = null;
switch (i) {
case 1:
parcel.enforceInterface("com.google.android.gms.maps.internal.IProjectionDelegate");
LatLng fromScreenLocation = fromScreenLocation(com.google.android.gms.dynamic.zzd.zza.zzfc(parcel.readStrongBinder()));
parcel2.writeNoException();
if (fromScreenLocation != null) {
parcel2.writeInt(1);
fromScreenLocation.writeToParcel(parcel2, 1);
} else {
parcel2.writeInt(0);
}
return true;
case 2:
parcel.enforceInterface("com.google.android.gms.maps.internal.IProjectionDelegate");
zzd toScreenLocation = toScreenLocation(parcel.readInt() != 0 ? (LatLng) LatLng.CREATOR.createFromParcel(parcel) : null);
parcel2.writeNoException();
if (toScreenLocation != null) {
iBinder = toScreenLocation.asBinder();
}
parcel2.writeStrongBinder(iBinder);
return true;
case 3:
parcel.enforceInterface("com.google.android.gms.maps.internal.IProjectionDelegate");
VisibleRegion visibleRegion = getVisibleRegion();
parcel2.writeNoException();
if (visibleRegion != null) {
parcel2.writeInt(1);
visibleRegion.writeToParcel(parcel2, 1);
} else {
parcel2.writeInt(0);
}
return true;
case 1598968902:
parcel2.writeString("com.google.android.gms.maps.internal.IProjectionDelegate");
return true;
default:
return super.onTransact(i, parcel, parcel2, i2);
}
}
}
LatLng fromScreenLocation(zzd zzd) throws RemoteException;
VisibleRegion getVisibleRegion() throws RemoteException;
zzd toScreenLocation(LatLng latLng) throws RemoteException;
}
|
[
"Gith1974"
] |
Gith1974
|
9bacaa756b25ad6fdb42b91a4fc3a3cd2f22bf6c
|
b13de6d76f3c6b8f0ab2786a07cc25f5badc21e0
|
/jsource/ideal/development/analyzers/parameter_target.java
|
c959c4531d5552ebb72cfb8b14bd25a47d551892
|
[
"BSD-3-Clause"
] |
permissive
|
mishadynin/ideal
|
c4e554538ae6eb711af739ec043640d66f305cae
|
a512796201e6e26ea750e31561e4c709b55cf268
|
refs/heads/master
| 2021-04-15T19:55:59.143341
| 2020-05-01T22:50:56
| 2020-05-01T22:50:56
| 249,295,173
| 0
| 0
|
BSD-3-Clause
| 2020-03-22T23:54:04
| 2020-03-22T23:54:04
| null |
UTF-8
|
Java
| false
| false
| 1,737
|
java
|
/*
* Copyright 2014-2020 The Ideal Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file or at
* https://developers.google.com/open-source/licenses/bsd
*/
package ideal.development.analyzers;
import ideal.library.elements.*;
import ideal.runtime.elements.*;
import ideal.development.elements.*;
import ideal.development.types.*;
import ideal.development.flavors.*;
import ideal.development.actions.*;
public class parameter_target extends debuggable implements action_target {
public final action_parameters parameters;
private final analysis_context the_context;
private type procedure_type;
public parameter_target(action_parameters parameters, analysis_context the_context) {
this.parameters = parameters;
this.the_context = the_context;
}
public int arity() {
return parameters.arity();
}
public type to_procedure_type() {
if (procedure_type == null) {
common_library library = common_library.get_instance();
list<abstract_value> parameter_list = new base_list<abstract_value>();
parameter_list.append(library.entity_type());
parameter_list.append_all(parameters.to_value_list());
procedure_type = library.procedure_type().bind_parameters(
new type_parameters(parameter_list)).get_flavored(flavors.DEFAULT_FLAVOR);
}
return procedure_type;
}
@Override
public boolean matches(abstract_value the_abstract_value) {
return analyzer_utilities.is_parametrizable(the_abstract_value, parameters.to_type_parameters(),
the_context);
}
@Override
public string to_string() {
return utilities.describe(this, parameters.to_value_string());
}
}
|
[
"dynin@google.com"
] |
dynin@google.com
|
d3e377cc2a53481c26ca62a8c40f7edfdfc4563f
|
dc723ba04d723b077a723bebb02813b8009f6e9e
|
/system/test/support/fake-old-platform/src/main/java/com/ssrn/fake_old_platform/StageOneClassificationSearchPageView.java
|
4b4d6ae3c6cfc8f66187c34b5bf76fff17858831
|
[] |
no_license
|
ngelsevier/preprint
|
e33247cb589d3de505f219d0242a3738d5455648
|
0a6a57bc962c29e277f105070977867280381d85
|
refs/heads/master
| 2020-03-20T23:42:53.825949
| 2018-06-19T08:06:36
| 2018-06-19T08:06:36
| 137,859,617
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 426
|
java
|
package com.ssrn.fake_old_platform;
import io.dropwizard.views.View;
public class StageOneClassificationSearchPageView extends View{
private final String abstractId;
protected StageOneClassificationSearchPageView(String abstractId) {
super("stage-one-classification-search-page.mustache");
this.abstractId = abstractId;
}
public String getAbstractId() {
return abstractId;
}
}
|
[
"r.ng@elsevier.com"
] |
r.ng@elsevier.com
|
75fc0723012982064b3f3a64299559eb1a565bf4
|
32b72e1dc8b6ee1be2e80bb70a03a021c83db550
|
/ast_results/jonasoreland_runnerup_/app/src/org/runnerup/tracker/filter/PersistentGpsLoggerListener.java
|
51b0d35ce869dd581f27d42a96661d60ebdd63ef
|
[] |
no_license
|
cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning
|
d90c41a17e88fcd99d543124eeb6e93f9133cb4a
|
0564143d92f8024ff5fa6b659c2baebf827582b1
|
refs/heads/master
| 2020-07-13T13:53:40.297493
| 2019-01-11T11:51:18
| 2019-01-11T11:51:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,632
|
java
|
// isComment
package org.runnerup.tracker.filter;
import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
import android.location.Location;
import org.runnerup.common.util.Constants;
import org.runnerup.tracker.LocationListenerBase;
public class isClassOrIsInterface extends LocationListenerBase implements Constants {
private final java.lang.Object isVariable;
private SQLiteDatabase isVariable;
private java.lang.String isVariable;
private ContentValues isVariable;
private final boolean isVariable;
public isConstructor(SQLiteDatabase isParameter, String isParameter, ContentValues isParameter, boolean isParameter) {
this.isFieldAccessExpr = new java.lang.Object();
this.isFieldAccessExpr = isNameExpr;
this.isFieldAccessExpr = isNameExpr;
this.isFieldAccessExpr = isNameExpr;
isMethod(isNameExpr);
}
public SQLiteDatabase isMethod() {
return isNameExpr;
}
public void isMethod(SQLiteDatabase isParameter) {
isNameExpr = isNameExpr;
}
public String isMethod() {
return isNameExpr;
}
public void isMethod(String isParameter) {
isNameExpr = isNameExpr;
}
public ContentValues isMethod() {
synchronized (isNameExpr) {
if (isNameExpr == null)
return null;
return new ContentValues(isNameExpr);
}
}
public void isMethod(ContentValues isParameter) {
synchronized (isNameExpr) {
if (isNameExpr == null)
isNameExpr = null;
else
isNameExpr = new ContentValues(isNameExpr);
}
}
public void isMethod(Location isParameter, Double isParameter, Long isParameter, Double isParameter, Integer isParameter, Float isParameter, Float isParameter, Float isParameter) {
ContentValues isVariable;
synchronized (isNameExpr) {
if (isNameExpr == null)
isNameExpr = new ContentValues();
else
isNameExpr = new ContentValues(isNameExpr);
}
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr.isMethod());
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr.isMethod());
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr.isMethod());
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr);
}
// isComment
if (isNameExpr.isMethod()) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr.isMethod());
}
if (this.isFieldAccessExpr) {
// isComment
if (isNameExpr.isMethod()) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr.isMethod());
}
if (isNameExpr.isMethod()) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr.isMethod());
}
if (isNameExpr.isMethod()) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr.isMethod());
}
// isComment
if (isNameExpr.isMethod() != null) {
int isVariable = isNameExpr.isMethod().isMethod("isStringConstant", -isIntegerConstant);
if (isNameExpr >= isIntegerConstant) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr);
}
}
// isComment
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr);
}
}
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr);
}
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr);
}
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr);
}
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr);
}
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr);
}
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr, null, isNameExpr);
}
}
}
|
[
"matheus@melsolucoes.net"
] |
matheus@melsolucoes.net
|
6d350fdd06af02e53bb22586c65dce3c64d4e334
|
e013ec787e57af5c8c798f5714d9f930b76dfd32
|
/Solutions/UVA Solutions/10655 - Contemplation! Algebra.java
|
0219b27bdcfb25c17e5834208d88c5a01d6717e5
|
[] |
no_license
|
omaryasser/Competitive-Programming
|
da66cb75bf6ed5495454d2f57333b02fe30a5b68
|
ba71b23ae3d0c4ef8bbdeff0cd12c3daca19d809
|
refs/heads/master
| 2021-04-29T00:39:29.663196
| 2019-02-19T04:20:56
| 2019-02-19T04:20:56
| 121,832,844
| 17
| 8
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,887
|
java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
StringBuilder sb = new StringBuilder();
while (true) {
StringTokenizer st = new StringTokenizer(sc.nextLine());
if (st.countTokens() < 3) break;
long p = Integer.parseInt(st.nextToken()) , q = Integer.parseInt(st.nextToken()) , n = Integer.parseInt(st.nextToken());
if (n == 0) sb.append(2 + "\n");
else if (n == 1) sb.append(p + "\n");
else {
long mat [][] = {{2 , p} , {1 , 1}};
long transform [][] = {{0 , - q} , {1 , p}};
sb.append(multiply(mat, matPow(transform, n - 1))[0][1] + "\n");
}
}
out.print(sb);
out.flush();
out.close();
}
static long[][] zero(int n, int m) {
return new long[n][m];
}
static long[][] identity(int n) { // Always square matrix
long[][] x = zero(n, n);
for (int i = 0; i < x.length; i++)
x[i][i]++;
return x;
}
static long matrixTrace(long[][] a) { // sumOfDigonal Values
long ret = 0;
for (int i = 0; i < a.length; i++)
ret += a[i][i];
return ret;
}
static long[][] rotate(long[][] v) { // rotate clockwise
long[][] r = zero(v[0].length, v.length);
for (int i = 0; i < r.length; i++) {
for (int j = 0; j < r.length; j++) {
r[j][v.length - 1 - i] = v[i][j];
}
}
return r;
}
static long[][] transpose(long[][] v) { // rotate clockwise
long[][] r = zero(v[0].length, v.length);
for (int i = 0; i < r.length; i++) {
for (int j = 0; j < r.length; j++) {
r[j][i] = v[i][j];
}
}
return r;
}
static long[][] reflect(long[][] v) { // Reflect Horizontally
long[][] r = zero(v.length, v[0].length);
for (int i = 0; i < r.length; i++) {
for (int k = 0; k < r[i].length; k++) {
r[i][v[0].length - 1 - k] = v[i][k];
}
}
return r;
}
static long[][] add(long[][] a, long[][] b) {
long[][] ret = zero(a.length, a[0].length);
for (int i = 0; i < a.length; i++) {
for (int j = 0; j < a[i].length; j++) {
ret[i][j] = a[i][j] + b[i][j];
}
}
return ret;
}
static long[][] addIdentity(long[][] a) {
for (int i = 0; i < a.length; i++) {
a[i][i]++;
}
return a;
}
static long[][] multiply(long[][] a, long[][] b) {
long[][] ret = zero(a.length, b[0].length);
// Optimizations here not to enter the last loop of a[i][k] = 0
// Also we can swtich last two loops if b[k][j] has more zeros
// for MOD optimization we use the following
for (int i = 0; i < a.length; ++i) {
for (int k = 0; k < a[0].length; ++k) {
for (int j = 0; j < b[0].length; ++j) {
ret[i][j] += a[i][k] * b[k][j];
}
}
}
return ret;
}
static long[][] matPow(long[][] a, long k) { // N^3 LOG
if (k == 0)
return identity(a.length);
if (k % 2 == 1) {
return multiply(a, matPow(a, k - 1));
}
return matPow(multiply(a, a), k >> 1);
}
static long[][] sumPows(long[][] a, long k) { // Log
if (k == 0) {
return zero(a.length, a.length);
}
if (k % 2 == 1) {
return multiply(a, addIdentity(sumPows(a, k - 1)));
}
return multiply(sumPows(a, k >> 1L), addIdentity(matPow(a, k >> 1L)));
}
static class Scanner {
StringTokenizer st;
BufferedReader br;
public Scanner(InputStream s) {
br = new BufferedReader(new InputStreamReader(s));
}
public String next() throws IOException {
while (st == null || !st.hasMoreTokens())
st = new StringTokenizer(br.readLine());
return st.nextToken();
}
public int nextInt() throws IOException {
return Integer.parseInt(next());
}
public long nextLong() throws IOException {
return Long.parseLong(next());
}
public String nextLine() throws IOException {
return br.readLine();
}
public double nextDouble() throws IOException {
String x = next();
StringBuilder sb = new StringBuilder("0");
double res = 0, f = 1;
boolean dec = false, neg = false;
int start = 0;
if (x.charAt(0) == '-') {
neg = true;
start++;
}
for (int i = start; i < x.length(); i++)
if (x.charAt(i) == '.') {
res = Long.parseLong(sb.toString());
sb = new StringBuilder("0");
dec = true;
} else {
sb.append(x.charAt(i));
if (dec)
f *= 10;
}
res += Long.parseLong(sb.toString()) / f;
return res * (neg ? -1 : 1);
}
public boolean ready() throws IOException {
return br.ready();
}
public boolean nextEmpty() throws IOException {
String s = nextLine();
st = new StringTokenizer(s);
return s.isEmpty();
}
}
}
|
[
"oyaraouf@gmail.com"
] |
oyaraouf@gmail.com
|
f12d99a3169f610d1c186b3645ff63ffcb5e67d8
|
963599f6f1f376ba94cbb504e8b324bcce5de7a3
|
/sources/okhttp3/Dns.java
|
e5897e2f6ebbb37db842cc5531e0fb8a5bac6492
|
[] |
no_license
|
NikiHard/cuddly-pancake
|
563718cb73fdc4b7b12c6233d9bf44f381dd6759
|
3a5aa80d25d12da08fd621dc3a15fbd536d0b3d4
|
refs/heads/main
| 2023-04-09T06:58:04.403056
| 2021-04-20T00:45:08
| 2021-04-20T00:45:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,778
|
java
|
package okhttp3;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;
import kotlin.Metadata;
@Metadata(mo51341bv = {1, 0, 3}, mo51342d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\bf\u0018\u0000 \u00072\u00020\u0001:\u0001\u0007J\u0016\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u00032\u0006\u0010\u0005\u001a\u00020\u0006H&\u0002\u0007\n\u0005\bF0\u0001¨\u0006\b"}, mo51343d2 = {"Lokhttp3/Dns;", "", "lookup", "", "Ljava/net/InetAddress;", "hostname", "", "Companion", "okhttp"}, mo51344k = 1, mo51345mv = {1, 1, 15})
/* compiled from: Dns.kt */
public interface Dns {
public static final Companion Companion = new Companion((DefaultConstructorMarker) null);
public static final Dns SYSTEM = new Dns$Companion$SYSTEM$1();
List<InetAddress> lookup(String str) throws UnknownHostException;
@Metadata(mo51341bv = {1, 0, 3}, mo51342d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0016\u0010\u0003\u001a\u00020\u00048\u0006X\u0004ø\u0001\u0000¢\u0006\u0002\n\u0000¨\u0006\u0001\u0002\u0007\n\u0005\bF0\u0001¨\u0006\u0005"}, mo51343d2 = {"Lokhttp3/Dns$Companion;", "", "()V", "SYSTEM", "Lokhttp3/Dns;", "okhttp"}, mo51344k = 1, mo51345mv = {1, 1, 15})
/* compiled from: Dns.kt */
public static final class Companion {
static final /* synthetic */ Companion $$INSTANCE = null;
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
}
|
[
"a.amirovv@mail.ru"
] |
a.amirovv@mail.ru
|
14eab757c6d347ad68b464289062e78dfc7354c5
|
1f7f98c232761caeb9c2aadb9e721bef39fe1a1c
|
/src/main/java/com/infoDiscover/infoAnalyse/service/restful/vo/MeasurableVO.java
|
5fdd4cfe3a9c75d3c9cb3182d587d746e9dc19b4
|
[] |
no_license
|
wangyingchu/Info-discover-analyse-Microservice_viewfunction
|
f8726b618ebfd343b60332866ccf6abbbf38ff34
|
591ed878e064343199669ad0eed11eb2122f0b61
|
refs/heads/master
| 2020-03-09T09:15:29.092936
| 2018-07-16T06:05:30
| 2018-07-16T06:05:30
| 128,708,660
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 635
|
java
|
package com.infoDiscover.infoAnalyse.service.restful.vo;
import java.util.List;
/**
* Created by wangychu on 3/6/17.
*/
public class MeasurableVO {
private List<PropertyVO> measurableProperties;
private String recordId;
public List<PropertyVO> getMeasurableProperties() {
return measurableProperties;
}
public void setMeasurableProperties(List<PropertyVO> measurableProperties) {
this.measurableProperties = measurableProperties;
}
public String getRecordId() {
return recordId;
}
public void setRecordId(String recordId) {
this.recordId = recordId;
}
}
|
[
"yingchuwang@gmail.com"
] |
yingchuwang@gmail.com
|
1b90f8b0f35ea88a4be6155893556f61c813074c
|
3ebaee3a565d5e514e5d56b44ebcee249ec1c243
|
/assetBank 3.77 decomplied fixed/src/java/com/bright/assetbank/usage/action/DeleteScheduledReportAction.java
|
4da7c21d964fad5c8e9eec0b0d87fb2e0a31ca1c
|
[] |
no_license
|
webchannel-dev/Java-Digital-Bank
|
89032eec70a1ef61eccbef6f775b683087bccd63
|
65d4de8f2c0ce48cb1d53130e295616772829679
|
refs/heads/master
| 2021-10-08T19:10:48.971587
| 2017-11-07T09:51:17
| 2017-11-07T09:51:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,154
|
java
|
/* */ package com.bright.assetbank.usage.action;
/* */
/* */ import com.bn2web.common.exception.Bn2Exception;
/* */ import com.bright.assetbank.usage.constant.UsageConstants;
/* */ import com.bright.assetbank.usage.form.ReportForm;
/* */ import com.bright.assetbank.usage.service.UsageReportManager;
/* */ import com.bright.framework.common.action.BTransactionAction;
/* */ import com.bright.framework.constant.FrameworkConstants;
/* */ import com.bright.framework.database.bean.DBTransaction;
/* */ import javax.servlet.http.HttpServletRequest;
/* */ import javax.servlet.http.HttpServletResponse;
/* */ import org.apache.struts.action.ActionForm;
/* */ import org.apache.struts.action.ActionForward;
/* */ import org.apache.struts.action.ActionMapping;
/* */
/* */ public class DeleteScheduledReportAction extends BTransactionAction
/* */ implements UsageConstants, FrameworkConstants
/* */ {
/* 44 */ private UsageReportManager m_usageReportManager = null;
/* */
/* */ public ActionForward execute(ActionMapping a_mapping, ActionForm a_form, HttpServletRequest a_request, HttpServletResponse a_response, DBTransaction a_dbTransaction)
/* */ throws Bn2Exception
/* */ {
/* 68 */ ActionForward afForward = null;
/* 69 */ ReportForm form = (ReportForm)a_form;
/* */
/* 72 */ long lReportId = Long.parseLong(a_request.getParameter("reportId").trim());
/* */
/* 75 */ this.m_usageReportManager.deleteScheduledReport(a_dbTransaction, lReportId);
/* */
/* 79 */ form.setScheduledReports(this.m_usageReportManager.getScheduledReports(a_dbTransaction));
/* */
/* 81 */ afForward = a_mapping.findForward("Success");
/* */
/* 83 */ return afForward;
/* */ }
/* */
/* */ public void setUsageReportManager(UsageReportManager a_usageReportManager)
/* */ {
/* 88 */ this.m_usageReportManager = a_usageReportManager;
/* */ }
/* */ }
/* Location: C:\Users\mamatha\Desktop\com.zip
* Qualified Name: com.bright.assetbank.usage.action.DeleteScheduledReportAction
* JD-Core Version: 0.6.0
*/
|
[
"42003122+code7885@users.noreply.github.com"
] |
42003122+code7885@users.noreply.github.com
|
3e3853600dc6e25afec799b7b0f62acceabab765
|
f0d301dfdf9c71e67e2d2d20e002e644aaa6971a
|
/Selenium/src/selenium_test_1101/Example08.java
|
b07fc7cfc8b1625614e1e962a8a64f08233cde3e
|
[] |
no_license
|
MinjiJo/BaekJoon_Online_Judge
|
c581ee388110d06be646a4ec60f664dba0328a6f
|
144b96e1c965fb87ef0f6e2e0619ac147d05a50b
|
refs/heads/master
| 2020-07-12T23:28:27.336793
| 2020-07-03T00:49:01
| 2020-07-03T00:49:01
| 204,933,410
| 0
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 3,164
|
java
|
package selenium_test_1101;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;
public class Example08 {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "D:\\seleniumlib\\chromedriver.exe");
for(int i=0; i<3; i++) {
WebDriver driver= new ChromeDriver();
driver.get("http://192.168.40.8:8088/Se_Web/ex3/NewFile5.html");
JavascriptExecutor jsexe=(JavascriptExecutor)driver;
WebElement id=driver.findElement(By.id("id"));
id.sendKeys("Q1234"+i);
jsexe.executeScript("idcheck()");
WebElement idbutton=driver.findElement(By.xpath("html/body/div/form/div/fieldset/input[2]"));
idbutton.click();
//driver.switchTo().parentFrame();
//getWindowHandle() : 현재 페이지의 고유 식별자를 가져옵니다.
// getWindowHandle()은 webDriver가 현재 제어하고 있는 페이지의 핸들을 가져옵니다. 이 핸들은 웹 페이지의 고유 식별자입니다.
// 동일한 URL인 경우에도 페이지를 열 때마다 다릅니다.
//getWindowHandles()는 웹 드라이버가 이해하는 모든 페이지에 대한 모든 핸들을 제공합니다.
//이들을 목록에 넣으면 열린 순서대로 나열됩니다.
String main=driver.getWindowHandle();
for(String web:driver.getWindowHandles()) {
if(!web.equals(main)) {
//팝업창으로 전환합니다.
driver.switchTo().window(web).close();
}
}
//메인창으로 전환합니다.
driver.switchTo().window(main);
WebElement pass=driver.findElement(By.id("pass"));
pass.sendKeys("1234");
WebElement jumin1=driver.findElement(By.id("jumin1"));
jumin1.sendKeys("600101");
WebElement jumin2=driver.findElement(By.id("jumin2"));
jumin2.sendKeys("1345824");
WebElement email=driver.findElement(By.id("email"));
email.sendKeys("Q1234");
Select sel=new Select(driver.findElement(By.id("sel")));
sel.selectByIndex(1);
//Select domain=new Select(driver.findElement(By.id("domain")));
//domain.sendKeys("naver.com");
List<WebElement> gender=driver.findElements(By.cssSelector("input[type='radio']"));
gender.get(0).click();
List<WebElement> hobby=driver.findElements(By.cssSelector("input[type='checkbox']"));
hobby.get(0).click();
hobby.get(1).click();
WebElement post1=driver.findElement(By.id("post1"));
post1.sendKeys("1234");
WebElement address=driver.findElement(By.id("address"));
address.sendKeys("서울시 종로구");
WebElement intro=driver.findElement(By.id("intro"));
intro.sendKeys("잘 부탁 드립니다.");
//함수 check()만 실행해서 submit 되지 않아요.
jsexe.executeScript("check()");
//submit 버튼을 클릭하면 action 페이지로 이동합니다.
WebElement sign=driver.findElement(By.cssSelector("button[class='signupbtn']"));
//WebElement sign=driver.findElement(By.className("signupbtn"));
sign.click();
driver.close();
}
}
}
|
[
"MinjiJo@users.noreply.github.com"
] |
MinjiJo@users.noreply.github.com
|
e7a067921cdce6fcc03d06c2d73a52bc2b5dc56c
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/34/34_9a0fd4115ab642b7a04316bd273a57d7b032aa96/Service/34_9a0fd4115ab642b7a04316bd273a57d7b032aa96_Service_s.java
|
d6ab36d80001893558389d76408346fa548d9ef6
|
[] |
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,912
|
java
|
package com.alagad.ant4cf;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import com.alagad.ant4cf.util.ConfigReader;
import com.alagad.ant4cf.util.Util;
public class Service extends Task {
private String component;
private String method;
private String property;
private ArrayList<Argument> arguments = new ArrayList<Argument>();
private ConfigReader config;
// The method executing the task
public void execute() throws BuildException {
config = new ConfigReader(getProject());
String result;
try{
result = runService();
} catch(Exception e){
throw new BuildException(e.getMessage());
}
// set the property
getProject().setProperty(this.property, result);
}
private String runService() throws IOException, Exception{
HttpClient client = new HttpClient();
String url = getComponentUrl();
PostMethod post = new PostMethod(url);
NameValuePair[] data = getArguments();
if(config.getDebug()){
for(int x = 0 ; x < data.length ; x++){
System.out.println(data[x].getName() + ": " + data[x].getValue());
}
}
post.setRequestBody(data);
int status = client.executeMethod(post);
String result;
if(status == 200){
InputStream in = post.getResponseBodyAsStream();
// dump the response.
result = Util.read(new InputStreamReader(in));
} else {
throw new Exception("HTTP Error: " + status + ", Detail: " + Util.read(new InputStreamReader(post.getResponseBodyAsStream())));
}
// disconnect
post.releaseConnection();
return result;
}
private NameValuePair[] getArguments(){
ArrayList<NameValuePair> args = new ArrayList<NameValuePair>();
args.add(new NameValuePair("adminPassword", this.config.getAdminPassword()));
if(this.config.getAdminUserId() != null){
args.add(new NameValuePair("adminUserId", this.config.getAdminUserId()));
}
args.add(new NameValuePair("method", this.method));
for(int x = 0 ; x < this.arguments.size() ; x++){
Argument argument = (Argument) this.arguments.get(x);
args.add(new NameValuePair(argument.getName(), argument.getValue()));
}
NameValuePair[] result = new NameValuePair[args.size()];
args.toArray(result);
return result;
}
private String getComponentUrl(){
String url = this.config.getAnt4cfUrl() + "/services/" + this.component.replace(".", "/") + ".cfc";
return url;
}
public Argument createArgument() {
Argument argument = new Argument();
this.arguments.add(argument);
return argument;
}
public void setComponent(String component){
this.component = component;
}
public void setMethod(String method){
this.method = method;
}
public void setProperty(String property){
this.property = property;
}
public class Argument extends Task {
private String name;
private String value;
public void setName(String name){
this.name = name;
}
public String getName(){
return this.name;
}
public void setValue(String value){
this.value = value;
}
public String getValue(){
return this.value;
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
a50261dd11ecb672e747df2fe4dcb8e51843d580
|
65fa70c2097fdb7a692be29a94b52a9e65cefb89
|
/webcollector/src/com/xyz/hayhay/db/JDBCConnection.java
|
c7c60f9e53889088a7c9564b64b38fb4116a734f
|
[] |
no_license
|
kientv80/webcollector
|
858a4349d46eb1d1d0c7b966f5e65277adf4c89f
|
0066aea3bd8ff11760438b315dfeb944bb2e6172
|
refs/heads/master
| 2021-01-19T18:30:53.825465
| 2017-10-17T16:56:41
| 2017-10-17T16:56:41
| 88,363,291
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,407
|
java
|
package com.xyz.hayhay.db;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
import org.apache.log4j.Logger;
public class JDBCConnection {
// private static ComboPooledDataSource connectionPool = new ComboPooledDataSource();
private static JDBCConnection instance;
Logger log = Logger.getLogger(JDBCConnection.class);
public static JDBCConnection getInstance(){
if(instance == null)
instance = new JDBCConnection();
return instance;
}
private JDBCConnection() {
// try {
// connectionPool.setDriverClass("com.mysql.jdbc.Driver");
// connectionPool.setJdbcUrl(ConfigurationHelper.getInstance().getValue("mysqlDB"));
// connectionPool.setUser(ConfigurationHelper.getInstance().getValue("dbuser"));
// connectionPool.setPassword(ConfigurationHelper.getInstance().getValue("dbpassword"));
// Properties p = new Properties();
// p.setProperty("useUnicode", "true");
// p.setProperty("characterEncoding", "utf-8");
// p.setProperty("user", ConfigurationHelper.getInstance().getValue("dbuser"));
// p.setProperty("password", ConfigurationHelper.getInstance().getValue("dbpassword"));
// p.setProperty("validationQuery","/* ping */ SELECT 1");
// p.setProperty("testWhileIdle","true");
// connectionPool.setProperties(p);
// connectionPool.setMaxPoolSize(50);
// connectionPool.setInitialPoolSize(10);
// connectionPool.setMaxIdleTime(50);
// connectionPool.setMaxStatementsPerConnection(10);
// } catch (PropertyVetoException e) {
// log.error("", e);
// }
}
public Connection getConnection() {
Connection conn = null;
try {
Properties p = new Properties();
p.setProperty("useUnicode", "true");
p.setProperty("autoReconnect", "true");
p.setProperty("characterEncoding", "utf-8");
p.put("connectTimeout", "5000");
p.setProperty("user", ConfigurationHelper.getInstance().getValue("dbuser"));
p.setProperty("password", ConfigurationHelper.getInstance().getValue("dbpassword"));
conn = DriverManager.getConnection(ConfigurationHelper.getInstance().getValue("mysqlDB"), p);
} catch (SQLException e) {
e.printStackTrace();
}
return conn;
/* try {
Connection conn = connectionPool.getConnection();
return conn;
} catch (SQLException e) {
log.error("", e);
}
return null;*/
}
}
|
[
"kientv@vng.com.vn"
] |
kientv@vng.com.vn
|
1372fd729c03e3e28e35b8f1409c8250efd25e59
|
8816bd99163d4adc357e76664a64be036b9be1c1
|
/AL-Game7/data/scripts/system/handlers/quest/sanctum/_80064EventMysteriousMission.java
|
94fa58ecaf30e0efbff80a7a89628d7cd2225e71
|
[] |
no_license
|
w4terbomb/SPP-AionGermany
|
274b250b7b7b73cdd70485aef84b3900c205a928
|
a77b4ef188c69f2bc3b850e021545f9ad77e66f3
|
refs/heads/master
| 2022-11-25T23:31:21.049612
| 2019-09-23T13:45:58
| 2019-09-23T13:45:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,052
|
java
|
/**
* This file is part of Aion-Lightning <aion-lightning.org>.
*
* Aion-Lightning is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Aion-Lightning 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 Aion-Lightning.
* If not, see <http://www.gnu.org/licenses/>.
*/
package quest.sanctum;
import com.aionemu.gameserver.model.DialogAction;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.questEngine.handlers.QuestHandler;
import com.aionemu.gameserver.questEngine.model.QuestEnv;
import com.aionemu.gameserver.questEngine.model.QuestState;
import com.aionemu.gameserver.questEngine.model.QuestStatus;
/**
* @author QuestGenerator by Mariella
*/
public class _80064EventMysteriousMission extends QuestHandler {
private final static int questId = 80064;
public _80064EventMysteriousMission() {
super(questId);
}
@Override
public void register() {
qe.registerQuestNpc(205475).addOnTalkEvent(questId); // Emeele
}
@Override
public boolean onLvlUpEvent(QuestEnv env) {
return defaultOnLvlUpEvent(env, 1000, true);
}
@Override
public boolean onDialogEvent(QuestEnv env) {
Player player = env.getPlayer();
QuestState qs = player.getQuestStateList().getQuestState(questId);
DialogAction dialog = env.getDialog();
int targetId = env.getTargetId();
if (qs == null) {
return false;
}
if (qs.getStatus() == QuestStatus.START) {
switch (targetId) {
case 205475: {
switch (dialog) {
default:
break;
}
break;
}
default:
break;
}
}
return false;
}
}
|
[
"conan_513@hotmail.com"
] |
conan_513@hotmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.