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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
caa841bccbf2273ea845886a49ab24466547cd8c
|
cf7e9fcaa002d7e3a2e4396831bf122fd1ac7bbc
|
/cards/src/main/java/org/rnd/jmagic/cards/Demystify.java
|
6bf6a0b6fc0b3ef8d6d8d25019edd2e0b3a37378
|
[] |
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
| 938
|
java
|
package org.rnd.jmagic.cards;
import static org.rnd.jmagic.Convenience.*;
import org.rnd.jmagic.engine.*;
import org.rnd.jmagic.engine.generators.*;
@Name("Demystify")
@Types({Type.INSTANT})
@ManaCost("W")
@Printings({@Printings.Printed(ex = Expansion.MAGIC_2012, r = Rarity.COMMON), @Printings.Printed(ex = Expansion.RISE_OF_THE_ELDRAZI, r = Rarity.COMMON), @Printings.Printed(ex = Expansion.TENTH_EDITION, r = Rarity.COMMON), @Printings.Printed(ex = Expansion.NINTH_EDITION, r = Rarity.COMMON), @Printings.Printed(ex = Expansion.EIGHTH_EDITION, r = Rarity.COMMON), @Printings.Printed(ex = Expansion.ONSLAUGHT, r = Rarity.COMMON)})
@ColorIdentity({Color.WHITE})
public final class Demystify extends Card
{
public Demystify(GameState state)
{
super(state);
Target target = this.addTarget(EnchantmentPermanents.instance(), "target enchantment");
this.addEffect(destroy(targetedBy(target), "Destroy target enchantment."));
}
}
|
[
"robyter@gmail"
] |
robyter@gmail
|
540210ea2623c934aa02cacd34908655b8c95640
|
180e78725121de49801e34de358c32cf7148b0a2
|
/dataset/protocol1/mapstruct/learning/6767/NullValueCheckStrategy.java
|
542d5a918ee8e694d0bd5374273df5f3922d127c
|
[] |
no_license
|
ASSERT-KTH/synthetic-checkstyle-error-dataset
|
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
|
40c057e1669584bfc6fecf789b5b2854660222f3
|
refs/heads/master
| 2023-03-18T12:50:55.410343
| 2019-01-25T09:54:39
| 2019-01-25T09:54:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,027
|
java
|
/*
* Copyright MapStruct Authors.
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct;
/**
* Strategy for dealing with null source values.
*
* <b>Note:</b> This strategy is not in effect when the a specific source presence check method is defined
* in the service provider interface (SPI).
*
* @author Sean Huang
*/
public enum NullValueCheckStrategy {
/**
* This option includes a null check. When:
* <br>
* <br>
* <ol>
* <li>a source value is directly assigned to a target</li> * <li>a source value assigned to a target by calling a type conversion on the target first</li>
* </ol>
* <br>
* <b>NOTE:</b> mapping methods (generated or hand written) are excluded from this null check. They are intended to
* handle a null source value as 'valid' input.
*
*/
ON_IMPLICIT_CONVERSION,
/**
* This option always includes a null check.
*/
ALWAYS;
}
|
[
"bloriot97@gmail.com"
] |
bloriot97@gmail.com
|
a408e18cebb11feae74a77ee079386c890f1c389
|
a3fe5db4cf9f5dc75b8331b1fe69de13e0549587
|
/activemq/security/SecurityAdminMBean.java
|
85d629fc69807242a296e8c0a04f3ed8c65cd40d
|
[] |
no_license
|
ShengtaoHou/software-recovery
|
7cd8e1a0aabadb808a0f00e5b0503a582c8d3c89
|
72a3dde6a0cba56f851c29008df94ae129a05d03
|
refs/heads/master
| 2020-09-26T08:25:54.952083
| 2019-12-11T07:32:57
| 2019-12-11T07:32:57
| 226,215,103
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 823
|
java
|
//
// Decompiled by Procyon v0.5.36
//
package org.apache.activemq.security;
public interface SecurityAdminMBean
{
public static final String OPERATION_READ = "read";
public static final String OPERATION_WRITE = "write";
public static final String OPERATION_ADMIN = "admin";
void addRole(final String p0);
void removeRole(final String p0);
void addUserRole(final String p0, final String p1);
void removeUserRole(final String p0, final String p1);
void addTopicRole(final String p0, final String p1, final String p2);
void removeTopicRole(final String p0, final String p1, final String p2);
void addQueueRole(final String p0, final String p1, final String p2);
void removeQueueRole(final String p0, final String p1, final String p2);
}
|
[
"shengtao@ShengtaoHous-MacBook-Pro.local"
] |
shengtao@ShengtaoHous-MacBook-Pro.local
|
132bc8943fcb916391a369f907a974b01fe83702
|
f766baf255197dd4c1561ae6858a67ad23dcda68
|
/app/src/main/java/com/tencent/mm/protocal/c/axc.java
|
5969c59412b37f71d42ebec1cac33b98dfeafb6f
|
[] |
no_license
|
jianghan200/wxsrc6.6.7
|
d83f3fbbb77235c7f2c8bc945fa3f09d9bac3849
|
eb6c56587cfca596f8c7095b0854cbbc78254178
|
refs/heads/master
| 2020-03-19T23:40:49.532494
| 2018-06-12T06:00:50
| 2018-06-12T06:00:50
| 137,015,278
| 4
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,244
|
java
|
package com.tencent.mm.protocal.c;
public final class axc
extends com.tencent.mm.bk.a
{
public int rko;
public int rth;
public int sai;
public String saj;
public String sal;
protected final int a(int paramInt, Object... paramVarArgs)
{
if (paramInt == 0)
{
paramVarArgs = (f.a.a.c.a)paramVarArgs[0];
paramVarArgs.fT(1, this.rko);
if (this.sal != null) {
paramVarArgs.g(3, this.sal);
}
paramVarArgs.fT(4, this.sai);
paramVarArgs.fT(5, this.rth);
if (this.saj != null) {
paramVarArgs.g(6, this.saj);
}
paramInt = 0;
}
int i;
do
{
return paramInt;
if (paramInt != 1) {
break;
}
i = f.a.a.a.fQ(1, this.rko) + 0;
paramInt = i;
if (this.sal != null) {
paramInt = i + f.a.a.b.b.a.h(3, this.sal);
}
i = paramInt + f.a.a.a.fQ(4, this.sai) + f.a.a.a.fQ(5, this.rth);
paramInt = i;
} while (this.saj == null);
return i + f.a.a.b.b.a.h(6, this.saj);
if (paramInt == 2)
{
paramVarArgs = new f.a.a.a.a((byte[])paramVarArgs[0], unknownTagHandler);
for (paramInt = com.tencent.mm.bk.a.a(paramVarArgs); paramInt > 0; paramInt = com.tencent.mm.bk.a.a(paramVarArgs)) {
if (!super.a(paramVarArgs, this, paramInt)) {
paramVarArgs.cJS();
}
}
return 0;
}
if (paramInt == 3)
{
f.a.a.a.a locala = (f.a.a.a.a)paramVarArgs[0];
axc localaxc = (axc)paramVarArgs[1];
switch (((Integer)paramVarArgs[2]).intValue())
{
case 2:
default:
return -1;
case 1:
localaxc.rko = locala.vHC.rY();
return 0;
case 3:
localaxc.sal = locala.vHC.readString();
return 0;
case 4:
localaxc.sai = locala.vHC.rY();
return 0;
case 5:
localaxc.rth = locala.vHC.rY();
return 0;
}
localaxc.saj = locala.vHC.readString();
return 0;
}
return -1;
}
}
/* Location: /Users/Han/Desktop/wxall/微信反编译/反编译 6.6.7/dex2jar-2.0/classes6-dex2jar.jar!/com/tencent/mm/protocal/c/axc.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"526687570@qq.com"
] |
526687570@qq.com
|
f0b3b3318f1f8a1429235e86c83a54be3206cc76
|
46ef04782c58b3ed1d5565f8ac0007732cddacde
|
/app/api.impl/src/org/modelio/api/impl/model/DefaultNameService.java
|
44944db86df6fb4ea13bcd37ee44349dd94b1975
|
[] |
no_license
|
daravi/modelio
|
844917412abc21e567ff1e9dd8b50250515d6f4b
|
1787c8a836f7e708a5734d8bb5b8a4f1a6008691
|
refs/heads/master
| 2020-05-26T17:14:03.996764
| 2019-05-23T21:30:10
| 2019-05-23T21:30:45
| 188,309,762
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,779
|
java
|
/*
* Copyright 2013-2018 Modeliosoft
*
* This file is part of Modelio.
*
* Modelio 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.
*
* Modelio 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 Modelio. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.modelio.api.impl.model;
import com.modeliosoft.modelio.javadesigner.annotations.objid;
import org.modelio.api.modelio.model.IDefaultNameService;
import org.modelio.metamodel.uml.infrastructure.ModelElement;
import org.modelio.vcore.model.api.IElementNamer;
@objid ("c6a85a4e-8e3f-4151-8ea3-32b8e29ce3d7")
public class DefaultNameService implements IDefaultNameService {
@objid ("f127d0bf-dc35-4882-b3ab-69617dba177b")
private IElementNamer elementNamer;
@objid ("d40d2f95-35ff-491d-9e79-1e5a905c5c95")
public DefaultNameService(IElementNamer elementNamer) {
this.elementNamer = elementNamer;
}
@objid ("2d1bb6b0-d0f4-4ea0-ae36-3e2c747ecad9")
@Override
public void setDefaultName(ModelElement element) {
element.setName(this.elementNamer.getUniqueName(element));
}
@objid ("29339318-a227-455b-9ab9-9fdfdf4c09bb")
@Override
public void setDefaultName(ModelElement element, String baseName) {
element.setName(this.elementNamer.getUniqueName(baseName, element));
}
}
|
[
"puya@motionmetrics.com"
] |
puya@motionmetrics.com
|
e1889a457d0c0450ecd1e8cfcd9a03e2fe433b69
|
0800c206efb883e15322f063b5c6668b1b1215ac
|
/ref/newrelic_rewriter/com/newrelic/javassist/tools/reflect/CompiledClass.java
|
4e6283ab5e7d22624315a7ba8f6bc420a9913100
|
[] |
no_license
|
PioneerLab/OpenAPM-Android
|
b125af273b53c2996f2f0cc9261bff7cdc6c6013
|
df42726ce7917ddd81135f27c0164a83e47b055c
|
refs/heads/master
| 2021-04-24T22:44:42.934592
| 2017-04-15T09:38:14
| 2017-04-15T09:38:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 203
|
java
|
//
// Decompiled by Procyon v0.5.30
//
package com.newrelic.javassist.tools.reflect;
class CompiledClass
{
public String classname;
public String metaobject;
public String classobject;
}
|
[
"maohongbin01@baidu.com"
] |
maohongbin01@baidu.com
|
31008fd1bfc1ea0f64abbbbce33fec197984d453
|
a422de59c29d077c512d66b538ff17d179cc077a
|
/hsi/hsi-ds/hsi-ds-api/src/main/java/com/gy/hsi/ds/common/utils/HttpClientHelper.java
|
f3de8e6cb1579153ff701d5de165fe0afbf86dc6
|
[] |
no_license
|
liveqmock/hsxt
|
c554e4ebfd891e4cc3d57e920d8a79ecc020b4dd
|
40bb7a1fe5c22cb5b4f1d700e5d16371a3a74c04
|
refs/heads/master
| 2020-03-28T14:09:31.939168
| 2018-09-12T10:20:46
| 2018-09-12T10:20:46
| 148,461,898
| 0
| 0
| null | 2018-09-12T10:19:11
| 2018-09-12T10:19:10
| null |
UTF-8
|
Java
| false
| false
| 5,790
|
java
|
/***************************************************************************
*
* This document contains confidential and proprietary information
* subject to non-disclosure agreements with GUIYI Technology, Ltd.
* This information shall not be distributed or copied without written
* permission from GUIYI technology, Ltd.
*
***************************************************************************/
package com.gy.hsi.ds.common.utils;
import java.io.IOException;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
/***************************************************************************
* <PRE>
* Project Name : hsi-ds-api
*
* Package Name : com.gy.hsi.ds.common.utils
*
* File Name : HttpClientHelper.java
*
* Creation Date : 2014-10-28
*
* Author : zhangysh
*
* Purpose : Http client
*
*
* History : none
*
* </PRE>
***************************************************************************/
public class HttpClientHelper {
/**
* 发送http post请求
*
* @param url
* @param params
* @return
* @throws Exception
*/
public static String doPost(String url, Map<String, String> params)
throws Exception {
// 创建默认的httpClient实例
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(url);
List<NameValuePair> formParams = new ArrayList<NameValuePair>(5);
Iterator<String> itor = params.keySet().iterator();
String key;
String value;
while (itor.hasNext()) {
key = itor.next();
value = params.get(key);
formParams.add(new BasicNameValuePair(key, value));
}
try {
httpPost.setEntity(new UrlEncodedFormEntity(formParams));
CloseableHttpResponse response = httpClient.execute(httpPost);
int statusCode = response.getStatusLine().getStatusCode();
if (HttpStatus.SC_OK == statusCode) {
return EntityUtils.toString(response.getEntity());
}
} catch (Exception e) {
} finally {
try {
httpClient.close();
} catch (IOException e) {
}
}
return "";
}
/**
* 发送http get请求
*
* @param url
* @param params
* @return
* @throws Exception
*/
public static String doGet(String url, Map<String, String> params)
throws Exception {
// 创建默认的httpClient实例
CloseableHttpClient httpClient = HttpClients.createDefault();
StringBuilder queryStr = new StringBuilder(url.endsWith("?") ? "" : "?");
Iterator<String> itor = params.keySet().iterator();
String key;
String value;
while (itor.hasNext()) {
key = itor.next();
value = params.get(key);
queryStr.append(key).append("=").append(value).append("&");
}
// 取得结尾的&符号
queryStr.replace(queryStr.length() - 1, queryStr.length(), "");
HttpGet httpGet = new HttpGet(url + queryStr.toString());
try {
CloseableHttpResponse response = httpClient.execute(httpGet);
int statusCode = response.getStatusLine().getStatusCode();
if (HttpStatus.SC_OK == statusCode) {
return EntityUtils.toString(response.getEntity());
}
} catch (Exception e) {
} finally {
try {
httpClient.close();
} catch (IOException e) {
}
}
return "";
}
/**
* 发送http get请求
*
* @param url
* @param queryString
* @return
* @throws Exception
*/
public static String doGet(String url, String queryString) {
if (!queryString.startsWith("?")) {
queryString = "?".concat(queryString);
}
// 创建默认的httpClient实例
CloseableHttpClient httpClient = HttpClients.createDefault();
try {
HttpGet httpGet = new HttpGet(url + queryString);
CloseableHttpResponse response = httpClient.execute(httpGet);
int statusCode = response.getStatusLine().getStatusCode();
if (HttpStatus.SC_OK == statusCode) {
return EntityUtils.toString(response.getEntity());
}
} catch (Exception e) {
} finally {
try {
httpClient.close();
} catch (IOException e) {
}
}
return "";
}
/**
* 发送http get请求
*
* @param url
* @param timeout
* @return
*/
public static boolean isSiteOk(String url, int timeout) {
RequestConfig reqConfig = RequestConfig.custom()
.setConnectTimeout(timeout)
.setConnectionRequestTimeout(timeout).setSocketTimeout(timeout)
.build();
PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager();
// connManager.setMaxTotal(this.maxConn);
// 创建默认的httpClient实例
CloseableHttpClient httpClient = HttpClientBuilder.create()
.setConnectionManager(connManager)
.setDefaultRequestConfig(reqConfig).build();
try {
HttpGet httpGet = new HttpGet(url);
CloseableHttpResponse response = httpClient.execute(httpGet);
int statusCode = response.getStatusLine().getStatusCode();
return (HttpStatus.SC_OK == statusCode);
} catch (SocketTimeoutException e) {
} catch (Exception e) {
} finally {
try {
httpClient.close();
} catch (IOException e) {
}
}
return false;
}
}
|
[
"864201042@qq.com"
] |
864201042@qq.com
|
f75b5f32092bf6f4b703f91f0227fbd448d2b569
|
0874d515fb8c23ae10bf140ee5336853bceafe0b
|
/l2j-universe-lindvior/Lindvior Source/gameserver/src/main/java/l2p/gameserver/skills/effects/EffectStun.java
|
378926772a7a0a9a345c196d31617932da9c6c73
|
[] |
no_license
|
NotorionN/l2j-universe
|
8dfe529c4c1ecf0010faead9e74a07d0bc7fa380
|
4d05cbd54f5586bf13e248e9c853068d941f8e57
|
refs/heads/master
| 2020-12-24T16:15:10.425510
| 2013-11-23T19:35:35
| 2013-11-23T19:35:35
| 37,354,291
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 833
|
java
|
package l2p.gameserver.skills.effects;
import l2p.commons.util.Rnd;
import l2p.gameserver.model.Effect;
import l2p.gameserver.stats.Env;
public final class EffectStun extends Effect {
public EffectStun(Env env, EffectTemplate template) {
super(env, template);
}
@Override
public boolean checkCondition() {
return Rnd.chance(_template.chance(100));
}
@Override
public void onStart() {
super.onStart();
_effected.startStunning();
_effected.abortAttack(true, true);
_effected.abortCast(true, true);
_effected.stopMove();
}
@Override
public void onExit() {
super.onExit();
_effected.stopStunning();
}
@Override
public boolean onActionTime() {
return false;
}
}
|
[
"jmendezsr@gmail.com"
] |
jmendezsr@gmail.com
|
2eab79e1c6fde77a895d5f41e72edec6d718252d
|
447520f40e82a060368a0802a391697bc00be96f
|
/apks/playstore_apps/com_grppl_android_shell_halifax/source/android/support/coreutils/R.java
|
1bcc1ae21b90b40a5c5834242f8ff0a0c6b83da6
|
[
"Apache-2.0"
] |
permissive
|
iantal/AndroidPermissions
|
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
|
d623b732734243590b5f004d167e542e2e2ae249
|
refs/heads/master
| 2023-07-19T01:29:26.689186
| 2019-09-30T19:01:42
| 2019-09-30T19:01:42
| 107,239,248
| 0
| 0
|
Apache-2.0
| 2023-07-16T07:41:38
| 2017-10-17T08:22:57
| null |
UTF-8
|
Java
| false
| false
| 7,371
|
java
|
package android.support.coreutils;
public final class R
{
public R() {}
public static final class attr
{
public static final int font = 2130968764;
public static final int fontProviderAuthority = 2130968768;
public static final int fontProviderCerts = 2130968769;
public static final int fontProviderFetchStrategy = 2130968770;
public static final int fontProviderFetchTimeout = 2130968771;
public static final int fontProviderPackage = 2130968772;
public static final int fontProviderQuery = 2130968773;
public static final int fontStyle = 2130968774;
public static final int fontWeight = 2130968775;
public attr() {}
}
public static final class bool
{
public static final int abc_action_bar_embed_tabs = 2131034112;
public bool() {}
}
public static final class color
{
public static final int notification_action_color_filter = 2131100212;
public static final int notification_icon_bg_color = 2131100215;
public static final int ripple_material_light = 2131100279;
public static final int secondary_text_default_material_light = 2131100287;
public color() {}
}
public static final class dimen
{
public static final int compat_button_inset_horizontal_material = 2131165402;
public static final int compat_button_inset_vertical_material = 2131165403;
public static final int compat_button_padding_horizontal_material = 2131165404;
public static final int compat_button_padding_vertical_material = 2131165405;
public static final int compat_control_corner_material = 2131165406;
public static final int notification_action_icon_size = 2131165825;
public static final int notification_action_text_size = 2131165826;
public static final int notification_big_circle_margin = 2131165827;
public static final int notification_content_margin_start = 2131165831;
public static final int notification_large_icon_height = 2131165835;
public static final int notification_large_icon_width = 2131165836;
public static final int notification_main_column_padding_top = 2131165837;
public static final int notification_media_narrow_margin = 2131165838;
public static final int notification_right_icon_size = 2131165839;
public static final int notification_right_side_padding_top = 2131165840;
public static final int notification_small_icon_background_padding = 2131165841;
public static final int notification_small_icon_size_as_large = 2131165842;
public static final int notification_subtext_size = 2131165844;
public static final int notification_top_pad = 2131165845;
public static final int notification_top_pad_large_text = 2131165846;
public dimen() {}
}
public static final class drawable
{
public static final int notification_action_background = 2131231194;
public static final int notification_bg = 2131231196;
public static final int notification_bg_low = 2131231197;
public static final int notification_bg_low_normal = 2131231198;
public static final int notification_bg_low_pressed = 2131231199;
public static final int notification_bg_normal = 2131231200;
public static final int notification_bg_normal_pressed = 2131231201;
public static final int notification_icon_background = 2131231204;
public static final int notification_template_icon_bg = 2131231205;
public static final int notification_template_icon_low_bg = 2131231206;
public static final int notification_tile_bg = 2131231207;
public static final int notify_panel_notification_icon_bg = 2131231208;
public drawable() {}
}
public static final class id
{
public static final int action_container = 2131361886;
public static final int action_divider = 2131361888;
public static final int action_image = 2131361889;
public static final int action_text = 2131361895;
public static final int actions = 2131361896;
public static final int async = 2131361949;
public static final int blocking = 2131361990;
public static final int chronometer = 2131362059;
public static final int forever = 2131362313;
public static final int icon = 2131362410;
public static final int icon_group = 2131362411;
public static final int info = 2131362503;
public static final int italic = 2131362533;
public static final int line1 = 2131362556;
public static final int line3 = 2131362557;
public static final int normal = 2131362822;
public static final int notification_background = 2131362828;
public static final int notification_main_column = 2131362829;
public static final int notification_main_column_container = 2131362830;
public static final int right_icon = 2131363160;
public static final int right_side = 2131363161;
public static final int text = 2131363358;
public static final int text2 = 2131363359;
public static final int time = 2131363373;
public static final int title = 2131363374;
public id() {}
}
public static final class integer
{
public static final int status_bar_notification_info_maxnum = 2131427393;
public integer() {}
}
public static final class layout
{
public static final int notification_action = 2131493189;
public static final int notification_action_tombstone = 2131493190;
public static final int notification_template_custom_big = 2131493197;
public static final int notification_template_icon_group = 2131493198;
public static final int notification_template_part_chronometer = 2131493202;
public static final int notification_template_part_time = 2131493203;
public layout() {}
}
public static final class string
{
public static final int status_bar_notification_info_overflow = 2131822779;
public string() {}
}
public static final class style
{
public static final int TextAppearance_Compat_Notification = 2131886603;
public static final int TextAppearance_Compat_Notification_Info = 2131886604;
public static final int TextAppearance_Compat_Notification_Line2 = 2131886606;
public static final int TextAppearance_Compat_Notification_Time = 2131886609;
public static final int TextAppearance_Compat_Notification_Title = 2131886611;
public static final int Widget_Compat_NotificationActionContainer = 2131886823;
public static final int Widget_Compat_NotificationActionText = 2131886824;
public style() {}
}
public static final class styleable
{
public static final int[] FontFamily = { 2130968768, 2130968769, 2130968770, 2130968771, 2130968772, 2130968773 };
public static final int[] FontFamilyFont = { 2130968764, 2130968774, 2130968775 };
public static final int FontFamilyFont_font = 0;
public static final int FontFamilyFont_fontStyle = 1;
public static final int FontFamilyFont_fontWeight = 2;
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public styleable() {}
}
}
|
[
"antal.micky@yahoo.com"
] |
antal.micky@yahoo.com
|
c9bf5cb5f6e51b9adc42896fe9e2bea77cbd4180
|
36779e6fbd26233be5e636e8cc01e27fa5e0366b
|
/LibrariesArgoUML_0_13_1/antlr-2.7.2/antlr/CppBlockFinishingInfo.java
|
cb0f094c2c545d035870727741ad7fe2e4238e05
|
[] |
no_license
|
BackupTheBerlios/ccl-plugin
|
0e01b1a010cb03cddc2528d41f14cca9a2858d37
|
9be0fac3a3c95c362b3defb956302976b55d7870
|
refs/heads/master
| 2016-09-06T15:22:47.637350
| 2003-07-12T18:48:29
| 2003-07-12T18:48:29
| 40,255,269
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 996
|
java
|
package antlr;
/* ANTLR Translator Generator
* Project led by Terence Parr at http://www.jGuru.com
* Software rights: http://www.antlr.org/RIGHTS.html
*
* $Id: CppBlockFinishingInfo.java,v 1.1 2003/07/12 18:39:47 layekers Exp $
*/
// C++ code generator by Pete Wells: pete@yamuna.demon.co.uk
class CppBlockFinishingInfo {
String postscript; // what to generate to terminate block
boolean generatedSwitch;// did block finish with "default:" of switch?
boolean generatedAnIf;
/** When generating an if or switch, end-of-token lookahead sets
* will become the else or default clause, don't generate an
* error clause in this case.
*/
boolean needAnErrorClause;
public CppBlockFinishingInfo() {
postscript=null;
generatedSwitch=false;
needAnErrorClause = true;
}
public CppBlockFinishingInfo(String ps, boolean genS, boolean generatedAnIf, boolean n) {
postscript = ps;
generatedSwitch = genS;
this.generatedAnIf = generatedAnIf;
needAnErrorClause = n;
}
}
|
[
"layekers"
] |
layekers
|
1a95e7fed88079b718b6f2b75b8271359e40c334
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/33/33_abcf5f0de311dccfbd46a03bf073c097ccc59c63/TransportUtil/33_abcf5f0de311dccfbd46a03bf073c097ccc59c63_TransportUtil_s.java
|
4abfc4657fc311d55cd71aa58c48a9aa4befd7ca
|
[] |
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,863
|
java
|
/*******************************************************************************
* Copyright (c) 2009 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
package org.eclipse.equinox.internal.p2.discovery.compatibility.util;
import java.io.*;
import java.net.URI;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.equinox.internal.p2.repository.AuthenticationFailedException;
import org.eclipse.equinox.internal.p2.repository.RepositoryTransport;
/**
* A utility for accessing web resources
*
* @author David Green
*/
public class TransportUtil {
/**
* Extend to process character content.
*
* @see TransportUtil#readResource(AbstractWebLocation, TextContentProcessor, IProgressMonitor)
*/
public interface TextContentProcessor {
public void process(Reader reader) throws IOException;
}
/**
* Download an HTTP-based resource
*
* @param target
* the target file to which the content is saved
* @param location
* the web location of the content
* @param monitor
* the monitor
* @throws IOException
* if a network or IO problem occurs
*/
public static void downloadResource(URI uri, File target, IProgressMonitor monitor) throws IOException {
OutputStream out = new BufferedOutputStream(new FileOutputStream(target));
try {
RepositoryTransport.getInstance().download(uri, out, monitor);
} finally {
out.close();
}
}
/**
* Read a web-based resource at the specified location using the given processor.
*
* @param location
* the web location of the content
* @param processor
* the processor that will handle content
* @param monitor
* the monitor
* @throws IOException
* if a network or IO problem occurs
* @throws CoreException
*/
public static void readResource(URI uri, TextContentProcessor processor, IProgressMonitor monitor) throws IOException, CoreException {
InputStream in = RepositoryTransport.getInstance().stream(uri, monitor);
try {
// FIXME how can the charset be determined?
BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); //$NON-NLS-1$
processor.process(reader);
} finally {
in.close();
}
}
/**
* Verify availability of resources at the given web locations. Normally this would be done using an HTTP HEAD.
*
* @param locations
* the locations of the resource to verify
* @param one
* indicate if only one of the resources must exist
* @param monitor
* the monitor
* @return true if the resource exists
* @throws CoreException
* @throws AuthenticationFailedException
*/
public static boolean verifyAvailability(List<? extends URI> locations, boolean one, IProgressMonitor monitor) throws IOException, CoreException {
if (locations.isEmpty() || locations.size() > 5) {
throw new IllegalArgumentException();
}
int countFound = 0;
for (URI location : locations) {
try {
RepositoryTransport.getInstance().getLastModified(location, monitor);
if (one) {
return true;
}
++countFound;
} catch (FileNotFoundException e) {
if (!one) {
return false;
}
continue;
}
}
return countFound == locations.size();
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
955211f4bb6bd15f33ba4f320b6609d73281cce6
|
75adc426717866b8c05b9d569610a7f23c50e639
|
/vertx-http/src/main/java/com/edgar/vertx/http/pump/Client.java
|
46c3b80e5f3f978ec3e25ef99a32caa5181bf847
|
[] |
no_license
|
edgar615/vertx-study
|
7466312e0deaee59361f7bf5d796061abc487643
|
ec004eccad3c6fe36050892c8858e8a6d5ca842f
|
refs/heads/master
| 2020-04-12T09:32:07.163244
| 2018-01-31T07:43:24
| 2018-01-31T07:43:24
| 53,409,712
| 4
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 811
|
java
|
package com.edgar.vertx.http.pump;
import com.edgar.util.vertx.runner.Runner;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.json.JsonObject;
/**
* Created by Edgar on 2016/3/15.
*
* @author Edgar Date 2016/3/15
*/
public class Client extends AbstractVerticle {
public static void main(String[] args) {
Runner.runExample(Client.class);
}
@Override
public void start() throws Exception {
//The server response is a WriteStream instance so you can pump to it from any ReadStream, e
// .g. AsyncFile, NetSocket, WebSocket or HttpServerRequest.
vertx.createHttpClient().put(8080, "localhost", "/", response -> {
response.bodyHandler(body -> System.out.println(body.toJsonObject().encodePrettily()));
}).end(new JsonObject().put("foo", "bar").encode());
}
}
|
[
"edgar615@gmail.com"
] |
edgar615@gmail.com
|
3564b94a658b52deec9695cbd2bf3eb3b9d785d6
|
a7038686c255f61cd72805f218d91b6efd2aca27
|
/src/test/java/com/github/cameltooling/lsp/internal/completion/camelapplicationproperties/CamelPropertiesComponentCompletionTest.java
|
11b8cb259797996315a78751d50d0ccbb2e5958b
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
blafond/camel-language-server
|
980341ebebe39a569cba8e1da19e5050968d84d3
|
ae9c40af04197428f7e1528e44cf20afca0004bd
|
refs/heads/master
| 2020-08-17T05:00:35.293014
| 2020-06-04T08:49:05
| 2020-06-04T13:25:29
| 215,611,857
| 0
| 0
|
Apache-2.0
| 2019-10-16T18:00:37
| 2019-10-16T18:00:37
| null |
UTF-8
|
Java
| false
| false
| 3,970
|
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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.cameltooling.lsp.internal.completion.camelapplicationproperties;
import static org.assertj.core.api.Assertions.assertThat;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import org.eclipse.lsp4j.CompletionItem;
import org.eclipse.lsp4j.CompletionList;
import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.Range;
import org.eclipse.lsp4j.TextDocumentItem;
import org.eclipse.lsp4j.TextEdit;
import org.eclipse.lsp4j.jsonrpc.messages.Either;
import org.junit.jupiter.api.Test;
import com.github.cameltooling.lsp.internal.AbstractCamelLanguageServerTest;
import com.github.cameltooling.lsp.internal.CamelLanguageServer;
public class CamelPropertiesComponentCompletionTest extends AbstractCamelLanguageServerTest {
@Test
public void testProvideCompletion() throws Exception {
CompletableFuture<Either<List<CompletionItem>, CompletionList>> completions = retrieveCompletion(new Position(0, 16));
assertThat(completions.get().getLeft()).contains(createExpectedCompletionItem());
}
@Test
public void testProvideCompletionFilteredWithBeginningTyped() throws Exception {
CompletableFuture<Either<List<CompletionItem>, CompletionList>> completions = retrieveCompletion(new Position(0, 20));
assertThat(completions.get().getLeft()).containsOnly(createExpectedCompletionItem());
}
@Test
public void testProvideCompletionNoCompletionAtWrongPosition() throws Exception {
CompletableFuture<Either<List<CompletionItem>, CompletionList>> completions = retrieveCompletion(new Position(0, 14));
assertThat(completions.get().getLeft()).isEmpty();
}
protected CompletableFuture<Either<List<CompletionItem>, CompletionList>> retrieveCompletion(Position position) throws URISyntaxException, InterruptedException, ExecutionException {
String fileName = "a.properties";
CamelLanguageServer camelLanguageServer = initializeLanguageServer(".properties", new TextDocumentItem(fileName, CamelLanguageServer.LANGUAGE_ID, 0, "camel.component.acomp"));
return getCompletionFor(camelLanguageServer, position, fileName);
}
protected CompletionItem createExpectedCompletionItem() {
CompletionItem expectedCompletionItem = new CompletionItem("acomponent");
expectedCompletionItem.setDocumentation("Description of my component.");
expectedCompletionItem.setDeprecated(false);
expectedCompletionItem.setTextEdit(new TextEdit(new Range(new Position(0, 16), new Position(0, 21)), "acomponent"));
return expectedCompletionItem;
}
@Override
protected Map<Object, Object> getInitializationOptions() {
String component = "{\n" +
" \"component\": {\n" +
" \"kind\": \"component\",\n" +
" \"scheme\": \"acomponent\",\n" +
" \"syntax\": \"acomponent:withsyntax\",\n" +
" \"description\": \"Description of my component.\",\n" +
" \"deprecated\": false\n" +
" },\n" +
" \"componentProperties\": {\n" +
" },\n" +
" \"properties\": {\n" +
" }\n" +
"}";
return createMapSettingsWithComponent(component);
}
}
|
[
"apupier@redhat.com"
] |
apupier@redhat.com
|
bafbfdaccdd61e221aaefdffd8c7dea6a15ba334
|
ea9deb97fbd3a5e0c87ac60449dbd659facb64db
|
/baseio-extend/src/main/java/com/generallycloud/nio/extend/plugin/jms/server/ConsumerQueue.java
|
9de79d9d09e20be52eb605b5e6426bb2a4a5646b
|
[] |
no_license
|
DONGXUE1/baseio
|
a16f44a1da7d66fcd7991ce601ec0886269251bb
|
0aaed42b625cc41e6f1b5c42f372b8c6006f045b
|
refs/heads/master
| 2021-01-13T09:26:58.125086
| 2017-10-24T14:15:55
| 2017-10-24T14:15:55
| 72,083,553
| 0
| 0
| null | 2016-10-27T07:41:18
| 2016-10-27T07:41:17
| null |
UTF-8
|
Java
| false
| false
| 296
|
java
|
package com.generallycloud.nio.extend.plugin.jms.server;
import java.util.List;
public interface ConsumerQueue {
public abstract int size();
public abstract void offer(Consumer consumer);
public abstract void remove(Consumer consumer);
public abstract List<Consumer> getSnapshot();
}
|
[
"8738115@qq.com"
] |
8738115@qq.com
|
ad79c48d59bff185ad8df9ed70cc1851f27521bc
|
deb6e605af137f4a3b7c19695cf3e582920df406
|
/src/string/problems/DuplicateWord.java
|
c19364de3a4e76bde1d00501a0941dc26acc4a2b
|
[] |
no_license
|
Jugham512/JavaMidterm-
|
4f1b97462c6764e45dd77444d83a42e7c77c3543
|
16c282836c3591a37202a6b1cb6e584ef8c1763d
|
refs/heads/master
| 2023-07-17T05:02:53.586197
| 2021-08-30T00:46:07
| 2021-08-30T00:46:07
| 400,006,056
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,188
|
java
|
package string.problems;
public class DuplicateWord {
public static void main(String[] args) {
/*
Write a java program to find the duplicate words and their number of occurrences in the string.
Also Find the average length of the words.
*/
String st = "Java is a programming Language. Java is also an Island of Indonesia. Java is widely used language";
int count;
st.toLowerCase();
String words[] = st.split(" ");
System.out.println("Duplicate Words are :");
for (int i = 0; i < words.length; i++) {
count = 1;
for (int j = i + 1; j < words.length; j++) {
if (words[i].equals(words[j])) {
count++;
words[j] = "0";
if (count > 1 && words[i] != "0")
for (int k = i + 1; k < words.length; k++) {
if (words[i].equals(words[k])) {
count++;
System.out.println(words[i]);
}
}
}
}
}
}
}
|
[
"="
] |
=
|
aa1487c7f098c46c24b47718e4b6d42c6e640061
|
d988416113114b32c3281178ccef34359b35f3f0
|
/app/src/main/java/th/co/thiensurat/toss_installer/utils/helper/ItemTouchHelperViewHolder.java
|
8f840e791282219ab7457cf7b2e887b5f200f6de
|
[] |
no_license
|
tsrmobile/Toss_Installer
|
722a62512ad83994bbc2f508e782d3f672b8caec
|
e9bc0212dc330121b80744393e7d9848eb5563a0
|
refs/heads/master
| 2021-09-15T10:14:07.607379
| 2018-05-30T09:52:01
| 2018-05-30T09:52:03
| 111,386,906
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,307
|
java
|
/*
* Copyright (C) 2015 Paul Burke
*
* 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 th.co.thiensurat.toss_installer.utils.helper;
import android.support.v7.widget.helper.ItemTouchHelper;
/**
* Interface to notify an item ViewHolder of relevant callbacks from {@link
* ItemTouchHelper.Callback}.
*
* @author Paul Burke (ipaulpro)
*/
public interface ItemTouchHelperViewHolder {
/**
* Called when the {@link ItemTouchHelper} first registers an item as being moved or swiped.
* Implementations should update the item view to indicate it's active state.
*/
void onItemSelected();
/**
* Called when the {@link ItemTouchHelper} has completed the move or swipe, and the active item
* state should be cleared.
*/
void onItemClear();
}
|
[
"teerayut.k@thiensurat.co.th"
] |
teerayut.k@thiensurat.co.th
|
f388f3e09ac0c044b10d7c60d95e3d06f62c0975
|
7c1430c53b4d66ad0e96dd9fc7465a5826fdfb77
|
/uims-support/src/cn/edu/sdu/uims/graph/GraphConstants.java
|
85f6bd867eb8233b0fadf489dca17673747257c5
|
[] |
no_license
|
wang3624270/online-learning-server
|
ef97fb676485f2bfdd4b479235b05a95ad62f841
|
2d81920fef594a2d0ac482efd76669c8d95561f1
|
refs/heads/master
| 2020-03-20T04:33:38.305236
| 2019-05-22T06:31:05
| 2019-05-22T06:31:05
| 137,187,026
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,051
|
java
|
package cn.edu.sdu.uims.graph;
public interface GraphConstants {
int GRAPH_SELECT_STATUS_NO = 0;
int GRAPH_SELECT_STATUS_VECTOR = 1;
int GRAPH_SELECT_STATUS_BOUND = 2;
int GRAPH_SELECT_STATUS_INNER = 3;
int GRAPH_SELECT_STATUS_OUTER = 4;
int GRAPH_SELECT_STATUS_VECTOR_LEFTTOP = 11; // 表示选中左上角顶点
int GRAPH_SELECT_STATUS_VECTOR_RIGHTTOP = 12;// 表示选中左下角顶点
int GRAPH_SELECT_STATUS_VECTOR_LEFTBOTTOM = 13; // 表示选中右上角顶点
int GRAPH_SELECT_STATUS_VECTOR_RIGHTBOTTOM = 14; // 表示选中右下角顶点
String GRAPH_TYPE_BASIC = "B";
String GRAPH_TYPE_GENERAL = "G";
String GRAPH_TYPE_COMPLICATED = "C";
String GRAPH_COLOR_RED = "colorRed";
String GRAPH_COLOR_BLUE = "colorBlue";
String GRAPH_COLOR_GREEN = "colorGreen";
String GRAPH_COLOR_BLACK = "colorBlack";
String GRAPH_COLOR_WRITE = "colorWhite";
String GRAPH_COLOR_GRAY = "colorGray";
String GRAPH_COLOR_SELECTION = "colorRed";
float MIN_BOUND = 5;
// List points = new ArrayList(); // 存放原element的点的信息
}
|
[
"3624270@qq.com"
] |
3624270@qq.com
|
5a6e2281ba4d8dd1a0d5bf91a3a3669bd17389a0
|
16bfe4d91fa6d8c7cd1dce4db0d409e9c3ddc2af
|
/raj/graph/GraphValidTree.java
|
53d7d71ce27e7751aef0e89d1bfa5290628f398b
|
[] |
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
| 3,593
|
java
|
package com.raj.graph;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
/**
*
* @author Raj
*
* Given n nodes labeled from 0 to n - 1 and a list of undirected edges
* (each edge is a pair of nodes), check if these edges form a valid
* tree.
*/
public class GraphValidTree {
public static boolean validTreeBfs(int n, int[][] edges) {
Map<Integer, Set<Integer>> map = new HashMap<>();
// construct graph
for (int[] edge : edges) {
map.compute(edge[0], (key, value) -> {
if (null == value) {
value = new HashSet<>();
}
value.add(edge[1]);
return value;
});
map.compute(edge[1], (key, value) -> {
if (null == value) {
value = new HashSet<>();
}
value.add(edge[0]);
return value;
});
}
Set<Integer> visited = new HashSet<>();
Queue<Integer> queue = new LinkedList<>();
queue.offer(map.keySet().iterator().next());
while (!queue.isEmpty()) {
int cur = queue.poll();
if (visited.contains(cur))
return false;
visited.add(cur);
if (map.containsKey(cur)) {
for (int neighbour : map.get(cur)) {
if (!visited.contains(neighbour)) {
queue.offer(neighbour);
}
}
}
}
for (int i = 0; i < n; i++) {
if (!visited.contains(i)) {
return false;
}
}
return true;
}
public static boolean validTreeDfs(int n, int[][] edges) {
Map<Integer, Set<Integer>> map = new HashMap<>();
// construct graph
for (int[] edge : edges) {
map.compute(edge[0], (key, value) -> {
if (null == value) {
value = new HashSet<>();
}
value.add(edge[1]);
return value;
});
map.compute(edge[1], (key, value) -> {
if (null == value) {
value = new HashSet<>();
}
value.add(edge[0]);
return value;
});
}
Set<Integer> visited = new HashSet<>();
if (!dfs(map.keySet().iterator().next(), -1, visited, map)) {
return false;
}
for (int i = 0; i < n; i++) {
if (!visited.contains(i)) {
return false;
}
}
return true;
}
private static boolean dfs(int cur, int parent, Set<Integer> visited, Map<Integer, Set<Integer>> map) {
if (visited.contains(cur))
return false;
visited.add(cur);
if (map.containsKey(cur)) {
for (int neighbour : map.get(cur)) {
if (parent == neighbour)
continue;
if (!dfs(neighbour, cur, visited, map)) {
return false;
}
}
}
return true;
}
// Time : O(V), Space : O(V)
public static boolean validTreeUnionFind(int n, int[][] edges) {
if (n == 0 || edges.length == 0)
return true;
DisjointSet ds = new DisjointSet();
for (int i = 0; i < n; i++) {
ds.makeSet(i);
}
for (int[] edge : edges) {
long parent1 = ds.findSet(edge[0]);
long parent2 = ds.findSet(edge[1]);
if (parent1 == parent2)
return false;
ds.union(parent1, parent2);
}
return true;
}
public static void main(String[] args) {
int edges[][] = { { 0, 1 }, { 1, 2 }, { 0, 3 }, { 3, 4 }, { 4, 5 }, { 5, 1 } };
int edges2[][] = { { 0, 1 }, { 1, 2 }, { 0, 3 }, { 3, 4 }, { 4, 5 } };
boolean result = false;
result = validTreeUnionFind(6, edges);
System.out.println(result);
result = validTreeUnionFind(6, edges2);
System.out.println(result);
result = validTreeDfs(6, edges);
System.out.println(result);
result = validTreeDfs(6, edges2);
System.out.println(result);
result = validTreeBfs(6, edges);
System.out.println(result);
result = validTreeBfs(6, edges2);
System.out.println(result);
}
}
|
[
"passionatecoderraj@gmail.com"
] |
passionatecoderraj@gmail.com
|
2f0bfb29d13e21d55396287d880d9f7498360d97
|
58df55b0daff8c1892c00369f02bf4bf41804576
|
/src/qk.java
|
e7396345780942646058e49ab247f724b27cf4ed
|
[] |
no_license
|
gafesinremedio/com.google.android.gm
|
0b0689f869a2a1161535b19c77b4b520af295174
|
278118754ea2a262fd3b5960ef9780c658b1ce7b
|
refs/heads/master
| 2020-05-04T15:52:52.660697
| 2016-07-21T03:39:17
| 2016-07-21T03:39:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,532
|
java
|
import android.os.Build.VERSION;
import android.view.MotionEvent;
public final class qk
{
static final qp a = new ql();
static
{
if (Build.VERSION.SDK_INT >= 12)
{
a = new qo();
return;
}
if (Build.VERSION.SDK_INT >= 9)
{
a = new qn();
return;
}
if (Build.VERSION.SDK_INT >= 5)
{
a = new qm();
return;
}
}
public static int a(MotionEvent paramMotionEvent)
{
return paramMotionEvent.getAction() & 0xFF;
}
public static int a(MotionEvent paramMotionEvent, int paramInt)
{
return a.a(paramMotionEvent, paramInt);
}
public static int b(MotionEvent paramMotionEvent)
{
return (paramMotionEvent.getAction() & 0xFF00) >> 8;
}
public static int b(MotionEvent paramMotionEvent, int paramInt)
{
return a.b(paramMotionEvent, paramInt);
}
public static float c(MotionEvent paramMotionEvent, int paramInt)
{
return a.c(paramMotionEvent, paramInt);
}
public static int c(MotionEvent paramMotionEvent)
{
return a.a(paramMotionEvent);
}
public static float d(MotionEvent paramMotionEvent, int paramInt)
{
return a.d(paramMotionEvent, paramInt);
}
public static int d(MotionEvent paramMotionEvent)
{
return a.b(paramMotionEvent);
}
public static float e(MotionEvent paramMotionEvent, int paramInt)
{
return a.e(paramMotionEvent, paramInt);
}
}
/* Location:
* Qualified Name: qk
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"reverseengineeringer@hackeradmin.com"
] |
reverseengineeringer@hackeradmin.com
|
de6724e3c3c224069d4140662f7dcda9162ef55d
|
2402c850da81ed2d6dcf6f97d1aa69c4c3a6be31
|
/okay-ad/ad-service/ad-service-sponsor/src/main/java/com/okay/ad/entity/Creative.java
|
51c73798e1a8fd7965c0fe0988009d4eca554522
|
[] |
no_license
|
Pamgo/spring-sourceStudy
|
4e48ddde8fdf0f27287028d502745fe310dc14f7
|
ef787796d4ccdcab2c7891c58411445c1ffaf815
|
refs/heads/master
| 2022-12-23T01:44:20.833824
| 2019-06-03T13:12:04
| 2019-06-03T13:12:04
| 145,417,608
| 0
| 0
| null | 2022-12-16T08:53:36
| 2018-08-20T12:55:32
|
Java
|
UTF-8
|
Java
| false
| false
| 1,661
|
java
|
package com.okay.ad.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.Date;
/**
* 创意
* Created by OKali on 2019/1/19.
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "ad_creative")
public class Creative {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", nullable = false)
private Long id;
@Basic
@Column(name = "name", nullable = false)
private String name;
@Basic
@Column(name = "type", nullable = false)
private Integer type;
/**物料类型,比如图片可以是bmp,jpg等*/
@Basic
@Column(name = "material_type", nullable = false)
private Integer materialType;
@Basic
@Column(name = "height", nullable = false)
private Integer height;
@Basic
@Column(name = "width", nullable = false)
private Integer width;
/**物料大小*/
@Basic
@Column(name = "size", nullable = false)
private Long size;
/**持续时长,只有视频不为0*/
@Basic
@Column(name = "duration", nullable = false)
private Integer duration;
/**审核状态*/
@Basic
@Column(name = "audit_status", nullable = false)
private Integer auditStatus;
@Basic
@Column(name = "user_id", nullable = false)
private Long userId;
@Basic
@Column(name = "url", nullable = false)
private String url;
@Basic
@Column(name = "create_time", nullable = false)
private Date createTime;
@Basic
@Column(name = "update_time", nullable = false)
private Date updateTime;
}
|
[
"pamgogdpyc@163.com"
] |
pamgogdpyc@163.com
|
00c2da4af4f2a0f6838d8b9d7d9b727c33cda167
|
8bf67e3dde92e88447c607f9a1a2665778918e7d
|
/cloud-biz-core/src/main/java/com/qweib/cloud/biz/system/service/ws/SysThorderWebService.java
|
5b6e162a4a06f3057e02c45a537e81354476195d
|
[] |
no_license
|
yeshenggen532432/test02
|
1f87235ba8822bd460f7c997dd977c3e68371898
|
52279089299a010f99c60bc6656476d68f19050f
|
refs/heads/master
| 2022-12-11T01:38:24.097948
| 2020-09-07T06:36:51
| 2020-09-07T06:36:51
| 293,404,392
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,034
|
java
|
package com.qweib.cloud.biz.system.service.ws;
import com.qweib.cloud.biz.system.service.plat.SysDeptmempowerService;
import com.qweib.cloud.core.domain.OnlineUser;
import com.qweib.cloud.core.domain.SysThorder;
import com.qweib.cloud.core.domain.SysThorderDetail;
import com.qweib.cloud.core.exception.ServiceException;
import com.qweib.cloud.repository.SysThorderWebDao;
import com.qweib.cloud.utils.Page;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class SysThorderWebService {
@Resource
private SysThorderWebDao thorderWebDao;
@Resource
private SysDeptmempowerService deptmempowerService;
public int addThorder(SysThorder thorder,List<SysThorderDetail> detail,String database) {
try {
this.thorderWebDao.addThorder(thorder, database);
int id=this.thorderWebDao.getAutoId();
for(SysThorderDetail orderDetail:detail){
orderDetail.setOrderId(id);
this.thorderWebDao.addThorderDetail(orderDetail, database);
}
return id;
} catch (Exception e) {
throw new ServiceException(e);
}
}
public void updateThorder(SysThorder thorder,List<SysThorderDetail> detail,String database) {
try {
this.thorderWebDao.updateThorder(thorder, database);
this.thorderWebDao.deleteThorderDetail(database, thorder.getId());
for(SysThorderDetail orderDetail:detail){
orderDetail.setOrderId(thorder.getId());
this.thorderWebDao.addThorderDetail(orderDetail, database);
}
} catch (Exception e) {
throw new ServiceException(e);
}
}
public SysThorder queryThorderOne(String database,Integer mid,Integer cid,String oddate){
try {
return this.thorderWebDao.queryThorderOne(database, mid, cid,oddate);
} catch (Exception e) {
throw new ServiceException(e);
}
}
public SysThorder queryThorderOne2(String database,Integer id){
try {
return this.thorderWebDao.queryThorderOne2(database, id);
} catch (Exception e) {
throw new ServiceException(e);
}
}
public List<SysThorderDetail> queryThorderDetail(String database,Integer orderId){
try {
return this.thorderWebDao.queryThorderDetail(database, orderId);
} catch (Exception e) {
throw new ServiceException(e);
}
}
// ----------------------------订货下单------------------------------
public Page queryDhorder(OnlineUser user, String dataTp,Integer page,Integer limit,String kmNm,String sdate,String edate,String mids){
try {
String datasource = user.getDatabase();
Integer memberId = user.getMemId();
Map<String, Object> map = deptmempowerService.getPowerDept(dataTp, memberId, datasource);
return this.thorderWebDao.queryDhorder(datasource, map, page, limit,kmNm,sdate,edate,mids);
} catch (Exception e) {
throw new ServiceException(e);
}
}
public int queryOrderDetailCount(String database,Integer orderId){
try {
return this.thorderWebDao.queryOrderDetailCount(database, orderId);
} catch (Exception e) {
throw new ServiceException(e);
}
}
}
|
[
"1617683532@qq.com"
] |
1617683532@qq.com
|
86bd904ecd9a3daf1eb4ebe9f79230e7fb45a7ff
|
33c9d42d6bea6d10fc99dd868c4f45cc0e9432ec
|
/Fence/fence-core/src/main/java/com/abner/fence/web/SessionContext.java
|
8f2a9709e6d46808da1feb2742fc3694d95838a8
|
[] |
no_license
|
Jorik2015/fence
|
1bb7ec08bd28ad68f6232891b7cfee25a902c411
|
6d8261aaad27f9cd8fd5f14973c260b98a6a1f93
|
refs/heads/master
| 2021-01-10T16:39:26.633049
| 2012-08-13T13:28:30
| 2012-08-13T13:28:30
| 45,328,232
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,784
|
java
|
/**
* This software is under the license of GNU Lesser General Public License(LGPL).
* You may obtain a copy of the License at
* http://www.gnu.org/copyleft/lesser.html.
*/
package com.abner.fence.web;
import java.util.HashMap;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
/**
* @author abner
*
*/
public class SessionContext implements Context {
private final static String KEY = "_sessionContext";
int maxKeyIndex = 0;
private final Map<Object, Object> cachedData = new HashMap<Object, Object>();
private SessionContext() {
}
synchronized public static SessionContext instance() {
return instance(FacesContext.getCurrentInstance());
}
synchronized public static SessionContext instance(FacesContext facesContext) {
return instance((HttpServletRequest) facesContext.getExternalContext().getRequest());
}
synchronized public static SessionContext instance(HttpServletRequest request) {
SessionContext inst = (SessionContext) request.getSession().getAttribute(KEY);
if (inst == null) {
inst = new SessionContext();
request.getSession().setAttribute(KEY, inst);
}
return inst;
}
synchronized public Object get(Object key) {
if (key == null)
return null;
return cachedData.get(key);
}
synchronized public void put(Object key, Object value) {
cachedData.put(key, value);
}
synchronized public void remove(Object key) {
cachedData.remove(key);
}
public void reset() {
cachedData.clear();
}
synchronized public String genUniqueKey(String prefix) {
String key;
maxKeyIndex++;
while (cachedData.containsKey((key = prefix + maxKeyIndex)))
maxKeyIndex++;
return key;
}
}
|
[
"wu.arron@gmail.com"
] |
wu.arron@gmail.com
|
d0ee261fa54794e2dd6c33fbcddb95bb78c48f2e
|
229d4a691ec92a494a3416ae71c12dcfe59fa38f
|
/src/main/java/com/mainul/fleetapp/model/User.java
|
46b4ea0d73ee09b0b47492c2d9ca248cd1d1da2e
|
[] |
no_license
|
maainul/fleet-app
|
16fda52305fb71b967cda1db43fefebcee07ff50
|
f9971c1c866169c8d13dd20e5f21556a100a9713
|
refs/heads/main
| 2023-04-08T17:01:51.048866
| 2021-03-31T17:22:21
| 2021-03-31T17:22:21
| 349,564,845
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 753
|
java
|
package com.mainul.fleetapp.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class User {
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Id
private int id;
private String username;
private String password;
}
|
[
"mainul080@yahoo.com"
] |
mainul080@yahoo.com
|
8b1047b8b5847717cf8f0d24ae3ca73dede0baa7
|
f1ffe21b3c5887596c15e0a124141e0644425c6a
|
/app/src/main/java/com/example/nikechallenge/main/ResultViewModel.java
|
94bb56bfa60fca475bc7c2e79ab2ae8891c057ce
|
[] |
no_license
|
abdultanveer/Nikechallenge
|
9bdb1d1f0a311144a134c96c8ec68544e9de2774
|
dca9ef2ee1e8c7f7a4772c3fd56f63d28ca576c0
|
refs/heads/master
| 2020-07-06T15:38:21.844900
| 2019-08-22T10:03:36
| 2019-08-22T10:03:36
| 203,069,692
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,389
|
java
|
package com.example.nikechallenge.main;
import android.util.Log;
import android.view.View;
import android.widget.ProgressBar;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.example.nikechallenge.data.SearchResponse;
import com.example.nikechallenge.data.SearchResult;
import com.example.nikechallenge.data.source.remote.ApiClient;
import com.example.nikechallenge.data.source.remote.ApiInterface;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class ResultViewModel extends ViewModel {
private static final String TAG = ResultViewModel.class.getSimpleName();
ProgressBar progressBar;
String searchTerm;
//this is the data that we will fetch asynchronously
private MutableLiveData<List<SearchResult>> resultList;
public ResultViewModel(ProgressBar mpProgressBar, String mParam) {
progressBar = mpProgressBar;
searchTerm = mParam;
}
//we will call this method to get the data
public LiveData<List<SearchResult>> getListSearchResults() {
//if the list is null
if (resultList == null) {
resultList = new MutableLiveData<List<SearchResult>>();
//we will load it asynchronously from server in this method
loadResults(searchTerm);
}
//finally we will return the list
return resultList;
}
//This method is using Retrofit to get the JSON data from URL
private void loadResults(String msearchTerm) {
ApiInterface apiService =
ApiClient.getClient().create(ApiInterface.class);
Call<SearchResponse> call = apiService.getListSearchResults(msearchTerm);
call.enqueue(new Callback<SearchResponse>() {
@Override
public void onResponse(Call<SearchResponse> call, Response<SearchResponse> response) {
progressBar.setVisibility(View.GONE);
Log.i(TAG,"responseitem="+response.body().getResults().get(0).getDefination());
resultList.setValue(response.body().getResults());
}
@Override
public void onFailure(Call<SearchResponse> call, Throwable t) {
Log.i(TAG,"url ="+call.request().url().toString());
}
});
}
}
|
[
"abdul.tanveer@gmail.com"
] |
abdul.tanveer@gmail.com
|
cf3c6571212fb2693c1457fcb064ccabe295e962
|
9b01ffa3db998c4bca312fd28aa977f370c212e4
|
/app/src/streamB/java/com/loki/singlemoduleapp/stub/SampleClass3596.java
|
113e76da387d99e9c0615205c979e5b05b0cd4c1
|
[] |
no_license
|
SergiiGrechukha/SingleModuleApp
|
932488a197cb0936785caf0e73f592ceaa842f46
|
b7fefea9f83fd55dbbb96b506c931cc530a4818a
|
refs/heads/master
| 2022-05-13T17:15:21.445747
| 2017-07-30T09:55:36
| 2017-07-30T09:56:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 256
|
java
|
package stub;
public class SampleClass3596 {
private SampleClass3597 sampleClass;
public SampleClass3596(){
sampleClass = new SampleClass3597();
}
public String getClassName() {
return sampleClass.getClassName();
}
}
|
[
"sergey.grechukha@gmail.com"
] |
sergey.grechukha@gmail.com
|
2b85ba51bb61aef28acfebd87a555e66d97d53df
|
7033053710cf2fd800e11ad609e9abbb57f1f17e
|
/cardayProject/carday-microservice/carday-api-service/src/test/java/com/cmdt/carday/microservice/api/DepartmentApiTest.java
|
31f3b0ee070f14f7c7da5b74eb525b2628f01018
|
[] |
no_license
|
chocoai/cardayforfjga
|
731080f72c367c7d3b8e7844a1c3cd034cc11ee6
|
91d7c8314f44024825747e12a60324ffc3d43afb
|
refs/heads/master
| 2020-04-29T02:14:07.834535
| 2018-04-02T09:51:07
| 2018-04-02T09:51:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,145
|
java
|
package com.cmdt.carday.microservice.api;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.cmdt.carday.microservice.model.request.department.DepartmentCreateDto;
import com.cmdt.carday.microservice.model.request.department.DepartmentCreditModel;
import com.cmdt.carday.microservice.model.request.department.DepartmentDeleteDto;
import com.cmdt.carday.microservice.model.request.department.DepartmentPageDto;
import com.cmdt.carday.microservice.model.request.department.DepartmentUpdateDto;
@AutoConfigureMockMvc
@AutoConfigureRestDocs(outputDir = "target/generated-snippets")
@RunWith(SpringRunner.class)
@SpringBootTest
public class DepartmentApiTest extends BaseApiTest {
@Test
public void showListTest() throws Exception{
runGet("/department/list/4", null);
}
@Test
public void showTreeTest() throws Exception{
runGet("/department/tree/4", null);
}
@Test
public void showTreeByOrgIdTest() throws Exception{
runGet("/department/treeByOrgId/46", null);
}
@Test
public void findOrganizationByOrgIdTest() throws Exception{
runGet("/department/findOrganizationByOrgId/2", null);
}
@Test
public void appendChildShowOrganizationByParentIdTest() throws Exception{
runGet("/department/appendChild/show/2", null);
}
@Test
public void createDepartmentTest() throws Exception{
DepartmentCreateDto dto = new DepartmentCreateDto();
dto.setName("子研发部");
dto.setParentId(2L);
runPost("/department/create", dto);
}
@Test
public void updateOrganizationTest() throws Exception{
Random r = new Random();
DepartmentUpdateDto dto = new DepartmentUpdateDto();
dto.setName("子研发部"+r.nextInt());
dto.setParentId(2L);
dto.setId(5221l);
runPut("/department/update", dto);
}
@Test
public void deleteDepartmentTest() throws Exception{
DepartmentDeleteDto dto = new DepartmentDeleteDto();
dto.setId(5222l);
runDelete("/department/delete", dto);
}
@Test
public void listDirectChildrenWithCountTest() throws Exception{
DepartmentPageDto dto = new DepartmentPageDto();
dto.setCurrentPage(1);
dto.setNumPerPage(10);
dto.setUserId(4l);
runPost("/department/listDirectChildrenWithCount", dto);
}
@Test
public void findTreeCreditByOrgIdTest() throws Exception{
runGet("/department/findTreeCreditByOrgId/2", null);
}
@Test
public void updateCreditTest() throws Exception{
List<DepartmentCreditModel> modelList = new ArrayList<>();
DepartmentCreditModel model = new DepartmentCreditModel();
model.setAvailableCredit(99.9);
model.setLimitedCredit(12.5);
model.setOrgId(5221l);
modelList.add(model);
runPut("/department/updateCredit", modelList);
}
@Test
public void findOrgByIdTest() throws Exception{
runGet("/department/findOrgById/2", null);
}
}
|
[
"xiaoxing.zhou@cm-dt.com"
] |
xiaoxing.zhou@cm-dt.com
|
a6eb9652f28f89694a4cd39568465a07fe82482f
|
44e5a256fef6f99e87b5649527944678091d8bb7
|
/main/boofcv-ip/src/test/java/boofcv/abst/filter/convolve/TestGenericConvolveDown.java
|
b0f48ba0992679f4cfe25f378e7deace1f4219e5
|
[
"LicenseRef-scancode-takuya-ooura",
"Apache-2.0"
] |
permissive
|
lessthanoptimal/BoofCV
|
3aa27e99056ce3c42814fddb013d6404bd9bdcad
|
24adbeee4fc1371face00b4c5cacb99c0398de55
|
refs/heads/SNAPSHOT
| 2023-09-01T11:14:56.219779
| 2023-08-31T14:16:30
| 2023-08-31T14:16:30
| 1,635,932
| 955
| 264
| null | 2023-09-10T02:12:28
| 2011-04-19T14:51:10
|
Java
|
UTF-8
|
Java
| false
| false
| 1,071
|
java
|
/*
* Copyright (c) 2023, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* 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 boofcv.abst.filter.convolve;
import boofcv.testing.BoofStandardJUnit;
import org.junit.jupiter.api.Test;
public class TestGenericConvolveDown extends BoofStandardJUnit {
/**
* No test is provided here since {@link boofcv.abst.filter.convolve.TestFactoryConvolveDown} already does an exhaustive test
* of this class.
*/
@Test void emptyTest() {
// intentionally empty
}
}
|
[
"peter.abeles@gmail.com"
] |
peter.abeles@gmail.com
|
de83e4fc63f0491b574b80bc75ae7d46b83f08e2
|
473b76b1043df2f09214f8c335d4359d3a8151e0
|
/benchmark/bigclonebenchdata_completed/22930145.java
|
bf781059e4d190d7192759b471afcfd6ff31bcd5
|
[] |
no_license
|
whatafree/JCoffee
|
08dc47f79f8369af32e755de01c52d9a8479d44c
|
fa7194635a5bd48259d325e5b0a190780a53c55f
|
refs/heads/master
| 2022-11-16T01:58:04.254688
| 2020-07-13T20:11:17
| 2020-07-13T20:11:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 992
|
java
|
import java.io.UncheckedIOException;
class c22930145 {
public MyHelperClass url;
private long getLastModification() {
try {
MyHelperClass connection = new MyHelperClass();
if (connection == null) connection = url.openConnection();
// MyHelperClass connection = new MyHelperClass();
return(long)(Object) connection.getLastModified();
} catch (UncheckedIOException e) {
MyHelperClass LOG = new MyHelperClass();
LOG.warn("URL could not be opened: " + e.getMessage(),(IOException)(Object) e);
return 0;
}
}
}
// Code below this line has been added to remove errors
class MyHelperClass {
public MyHelperClass getLastModified(){ return null; }
public MyHelperClass openConnection(){ return null; }
public MyHelperClass warn(String o0, IOException o1){ return null; }}
class IOException extends Exception{
public IOException(String errorMessage) { super(errorMessage); }
}
|
[
"piyush16066@iiitd.ac.in"
] |
piyush16066@iiitd.ac.in
|
ba6b3fc6b16fb6dd513706af5003bc084d144939
|
31f609157ae46137cf96ce49e217ce7ae0008b1e
|
/bin/ext-commerce/commercefacades/testsrc/de/hybris/platform/commercefacades/product/converters/populator/ProductPromotionsPopulatorTest.java
|
248074fc9a3c7166cb88492d6b231d45525236ad
|
[] |
no_license
|
natakolesnikova/hybrisCustomization
|
91d56e964f96373781f91f4e2e7ca417297e1aad
|
b6f18503d406b65924c21eb6a414eb70d16d878c
|
refs/heads/master
| 2020-05-23T07:16:39.311703
| 2019-05-15T15:08:38
| 2019-05-15T15:08:38
| 186,672,599
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,882
|
java
|
/*
* [y] hybris Platform
*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package de.hybris.platform.commercefacades.product.converters.populator;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import de.hybris.bootstrap.annotations.UnitTest;
import de.hybris.platform.basecommerce.model.site.BaseSiteModel;
import de.hybris.platform.commercefacades.product.data.ProductData;
import de.hybris.platform.commercefacades.product.data.PromotionData;
import de.hybris.platform.core.model.product.ProductModel;
import de.hybris.platform.promotions.PromotionsService;
import de.hybris.platform.promotions.model.AbstractPromotionModel;
import de.hybris.platform.promotions.model.PromotionGroupModel;
import de.hybris.platform.servicelayer.dto.converter.Converter;
import de.hybris.platform.servicelayer.model.ModelService;
import de.hybris.platform.servicelayer.time.TimeService;
import de.hybris.platform.site.BaseSiteService;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang.time.DateUtils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
/**
* Test suite for {@link ProductPromotionsPopulator}
*/
@UnitTest
public class ProductPromotionsPopulatorTest
{
@Mock
private PromotionsService promotionsService;
@Mock
private Converter<AbstractPromotionModel, PromotionData> promotionsConverter;
@Mock
private TimeService timeService;
@Mock
private ModelService modelService;
@Mock
private BaseSiteService baseSiteService;
private ProductPromotionsPopulator productPromotionsPopulator;
@Before
public void setUp()
{
MockitoAnnotations.initMocks(this);
productPromotionsPopulator = new ProductPromotionsPopulator();
productPromotionsPopulator.setModelService(modelService);
productPromotionsPopulator.setTimeService(timeService);
productPromotionsPopulator.setPromotionsConverter(promotionsConverter);
productPromotionsPopulator.setPromotionsService(promotionsService);
productPromotionsPopulator.setBaseSiteService(baseSiteService);
}
@Test
public void testPopulate()
{
final ProductModel source = mock(ProductModel.class);
final PromotionGroupModel defaultPromotionGroup = mock(PromotionGroupModel.class);
final Date currentDate = DateUtils.round(new Date(), Calendar.MINUTE);
final AbstractPromotionModel abstractPromotionModel = mock(AbstractPromotionModel.class);
final PromotionData promotionData = mock(PromotionData.class);
final BaseSiteModel baseSiteModel = mock(BaseSiteModel.class);
given(timeService.getCurrentTime()).willReturn(currentDate);
given(baseSiteService.getCurrentBaseSite()).willReturn(baseSiteModel);
given(baseSiteModel.getDefaultPromotionGroup()).willReturn(defaultPromotionGroup);
Mockito
.<List<? extends AbstractPromotionModel>> when(promotionsService
.getAbstractProductPromotions(Collections.singletonList(defaultPromotionGroup), source, true, currentDate))
.thenReturn(Collections.singletonList(abstractPromotionModel));
given(promotionsConverter.convertAll(Collections.singletonList(abstractPromotionModel)))
.willReturn(Collections.singletonList(promotionData));
final ProductData result = new ProductData();
productPromotionsPopulator.populate(source, result);
Assert.assertEquals(1, result.getPotentialPromotions().size());
Assert.assertEquals(promotionData, result.getPotentialPromotions().iterator().next());
}
}
|
[
"nataliia@spadoom.com"
] |
nataliia@spadoom.com
|
73cadf0eb881b5f7ba0a13cda443a077717ba59e
|
c9e51564babf7de532fb65886b7ac435a4c03446
|
/src/main/java/com/gestankbratwurst/ferocore/modules/racemodule/RecipeViewGUI.java
|
497d3433057d4f5d1a1d28933c9a187cfc1cdad7
|
[] |
no_license
|
Projekt-Sidusgames/FeroCore
|
0a1ab30440f55b11019a955bbfd85d9372f4aa26
|
ed291a741cf04dd6a9f30e39f2f810057230aee8
|
refs/heads/master
| 2023-03-10T01:06:59.819138
| 2021-02-27T09:27:37
| 2021-02-27T09:27:37
| 340,214,490
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,294
|
java
|
package com.gestankbratwurst.ferocore.modules.racemodule;
import com.gestankbratwurst.ferocore.modules.customrecipes.CustomShapedRecipe;
import com.gestankbratwurst.ferocore.resourcepack.skins.Model;
import com.gestankbratwurst.ferocore.util.common.UtilPlayer;
import com.gestankbratwurst.ferocore.util.items.ItemBuilder;
import lombok.RequiredArgsConstructor;
import net.crytec.inventoryapi.SmartInventory;
import net.crytec.inventoryapi.api.ClickableItem;
import net.crytec.inventoryapi.api.InventoryContent;
import net.crytec.inventoryapi.api.InventoryProvider;
import net.crytec.inventoryapi.api.SlotPos;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
/*******************************************************
* Copyright (C) Gestankbratwurst suotokka@gmail.com
*
* This file is part of FeroCore and was created at the 22.02.2021
*
* FeroCore can not be copied and/or distributed without the express
* permission of the owner.
*
*/
@RequiredArgsConstructor
public class RecipeViewGUI implements InventoryProvider {
public static void open(final Player player, final CustomShapedRecipe recipe) {
SmartInventory.builder().title("Rezept Ansicht").size(5).provider(new RecipeViewGUI(recipe)).build().open(player);
}
private final CustomShapedRecipe recipe;
@Override
public void init(final Player player, final InventoryContent content) {
final ItemStack[] matrix = this.recipe.getCraftingMatrix();
for (int x = 0; x < 3; x++) {
for (int y = 0; y < 3; y++) {
content.set(SlotPos.of(y + 1, x + 2), ClickableItem.empty(matrix[x + y * 3]));
}
}
content.set(SlotPos.of(2, 6), ClickableItem.empty(this.recipe.getHandle().getResult()));
content.set(SlotPos.of(4, 0), this.getBackIcon());
content.set(SlotPos.of(4, 4), ClickableItem.empty(new ItemBuilder(Model.RECIPE_VIEW_UI.getItem()).name(" ").build()));
}
private ClickableItem getBackIcon() {
final ItemStack icon = new ItemBuilder(Model.DOUBLE_GRAY_ARROW_LEFT.getItem()).name("§eZurück").build();
return ClickableItem.of(icon, event -> {
final Player player = (Player) event.getWhoClicked();
UtilPlayer.playSound(player, Sound.UI_BUTTON_CLICK);
RecipeSelectionGUI.open(player);
});
}
}
|
[
"unconfigured@null.spigotmc.org"
] |
unconfigured@null.spigotmc.org
|
f88b693c961856fedcc55b1f723c9ec0d9992ac1
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/4/4_ee698e98325ee5fa3c4892e645fae0ad0d318d0b/HTMLBaseFontElementTest/4_ee698e98325ee5fa3c4892e645fae0ad0d318d0b_HTMLBaseFontElementTest_t.java
|
449a86ea36934550816373f1721052df040f2ca3
|
[] |
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
| 5,644
|
java
|
/*
* Copyright (c) 2002-2013 Gargoyle Software 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 com.gargoylesoftware.htmlunit.javascript.host.html;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.gargoylesoftware.htmlunit.BrowserRunner;
import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts;
import com.gargoylesoftware.htmlunit.BrowserRunner.Browser;
import com.gargoylesoftware.htmlunit.BrowserRunner.NotYetImplemented;
import com.gargoylesoftware.htmlunit.WebDriverTestCase;
/**
* Tests for {@link HTMLBaseFontElement}.
* @version $Revision$
* @author Ronald Brill
*/
@RunWith(BrowserRunner.class)
public class HTMLBaseFontElementTest extends WebDriverTestCase {
/**
* @throws Exception if an error occurs
*/
@Test
@NotYetImplemented(Browser.FF3_6)
@Alerts(DEFAULT = { "[object HTMLSpanElement]", "undefined", "undefined", "undefined" },
FF3_6 = { "[object HTMLBaseFontElement]", "", "-1", "" },
IE = { "[object]", "", "3", "" })
public void defaults() throws Exception {
final String html =
"<html>\n"
+ " <head>\n"
+ " <basefont id='base' />\n"
+ " <script>\n"
+ " function test() {\n"
+ " var base = document.getElementById('base');\n"
+ " alert(base);\n"
+ " alert(base.face);\n"
+ " alert(base.size);\n"
+ " alert(base.color);\n"
+ " }\n"
+ " </script>\n"
+ " </head>\n"
+ " <body onload='test()'>foo</body>\n"
+ "</html>";
loadPageWithAlerts2(html);
}
/**
* @throws Exception if an error occurs
*/
@Test
@NotYetImplemented({ Browser.FF10, Browser.FF17 })
@Alerts(DEFAULT = { "undefined", "42" },
FF3_6 = { "4", "42" },
IE = { "4", "42" })
public void size() throws Exception {
final String html =
"<html>\n"
+ " <head>\n"
+ " <basefont id='base' color='red' face='swiss' size='4' />\n"
+ " <script>\n"
+ " function test() {\n"
+ " var base = document.getElementById('base');\n"
+ " alert(base.size);\n"
+ " try {\n"
+ " base.size=42;\n"
+ " alert(base.size);\n"
+ " } catch(e) {\n"
+ " alert('exception');\n"
+ " }\n"
+ " }\n"
+ " </script>\n"
+ " </head>\n"
+ " <body onload='test()'>foo</body>\n"
+ "</html>";
loadPageWithAlerts2(html);
}
/**
* @throws Exception if an error occurs
*/
@Test
@NotYetImplemented({ Browser.FF10, Browser.FF17 })
@Alerts(DEFAULT = { "undefined", "helvetica" },
FF3_6 = { "swiss", "helvetica" },
IE = { "swiss", "helvetica" })
public void face() throws Exception {
final String html =
"<html>\n"
+ " <head>\n"
+ " <basefont id='base' color='red' face='swiss' size='5' />\n"
+ " <script>\n"
+ " function test() {\n"
+ " var base = document.getElementById('base');\n"
+ " alert(base.face);\n"
+ " try {\n"
+ " base.face='helvetica';\n"
+ " alert(base.face);\n"
+ " } catch(e) {\n"
+ " alert('exception');\n"
+ " }\n"
+ " }\n"
+ " </script>\n"
+ " </head>\n"
+ " <body onload='test()'>foo</body>\n"
+ "</html>";
loadPageWithAlerts2(html);
}
/**
* @throws Exception if an error occurs
*/
@Test
@NotYetImplemented({ Browser.FF10, Browser.FF17, Browser.IE })
@Alerts(DEFAULT = { "undefined", "blue" },
FF3_6 = { "red", "blue" },
IE = { "#ff0000", "#0000ff" })
public void color() throws Exception {
final String html =
"<html>\n"
+ " <head>\n"
+ " <basefont id='base' color='red' face='swiss' size='4' />\n"
+ " <script>\n"
+ " function test() {\n"
+ " var base = document.getElementById('base');\n"
+ " alert(base.color);\n"
+ " try {\n"
+ " base.color='blue';\n"
+ " alert(base.color);\n"
+ " } catch(e) {\n"
+ " alert('exception');\n"
+ " }\n"
+ " }\n"
+ " </script>\n"
+ " </head>\n"
+ " <body onload='test()'>foo</body>\n"
+ "</html>";
loadPageWithAlerts2(html);
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
1fd8c02686e308fbadc62c786274a3fc791a69a4
|
9926a6a4ac88171c98b07b848f5861728fd18239
|
/.history/assignment8_20211031192419.java
|
8701045698a648032f8b7d5c1263378d143a2ef7
|
[] |
no_license
|
magikflowz/JavaAssignments
|
4dadee2f0f23d581f94c998680ab188c1247013c
|
a4f01f60cedd08dd216841ba98fadac9c09bbe76
|
refs/heads/master
| 2023-08-28T13:08:43.877417
| 2021-11-02T10:47:55
| 2021-11-02T10:47:55
| 423,601,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,368
|
java
|
/* Programming Assignment 8. CSET 1200.
* University of Toledo.
* Instructor: Jared Oluoch, Ph.D.
* Due Date: Sunday October 31, 2021 at 11:59 PM.
* Total Points:20
*/
/* Your program must compile and run to get credit.
* If your program does not compile, you may get 0.
* If you copy from your classmate, both of you get 0.
* If you copy from a website, you get 0.
* Your program must have the following information at the top.
# Name : Your First and Last Name
# Class: CSET 1200
# Instructor: Dr. Jared Oluoch
# Programming Assignment: 8
# Date: MMDDYY
# Summary: A brief description of what the program does.
# You must put this line as a comment at the top of your Java source file.
“This code is my own work. I did not get any help from any online source
such as chegg.com; from a classmate, or any other person other than the instructor
or TA for this course. I understand that getting outside help from this course
other than from the instructor or TA will result in a grade of 0 in this
assignment and other disciplinary actions for academic dishonesty.â€
*/
import java.io.*;
import java.util.*;
public class assignment8{
public static void Single(String Name, int Income){
double tax = 0;
if(Income >=0 && Income <= 9750){
tax = .1;
}
if(Income >= 9701 && Income <=39475){
tax = .12;
}
if(Income >= 39476 && Income <= 82200){
tax = .22;
}
if(Income >= 82201 && Income <= 160725){
tax = .24;
}
if(Income >= 160726 && Income <= 204100){
tax = .32;
}
if(Income >= 204101 && Income <= 510300){
tax = .35;
}
if(Income >= 510301){
tax = .37;
}
tax = (Income/100)*tax;
System.out.print(Name +", the federal income tax for an annual salary of "+Income+" for single status "+tax);
}
public static void headofHousehold(String Name, int Income){
double tax = 0;
if(Income >= 0 && Income <= 13850){
tax = .1;
}
if(Income >= 13851 && Income <= 52850){
tax = .12;
}
if(Income >= 52851 && Income <= 84200){
tax = .22;
}
if(Income >= 84201 && Income <= 160700){
tax = .24;
}
if(Income >= 160701 && Income <= 204100){
tax = .32;
}
if(Income >= 204101 && Income <= 510300){
tax = .35;
}
if(Income >= 510301){
tax = .37;
}
tax = (Income/100)*tax;
System.out.print(Name +", the federal income tax for an annual salary of " +Income+" for single status "+tax);
}
public String marriedJointly(String Name, int Income){
double tax = 0;
if(Income >=0 && Income<=19400){
tax = .1;
}
if(Income >= 19401 && Income <= 78950){
tax = .12;
}
if(Income >= 78951 && Income <= 168400){
tax = .22;
}
if(Income >= 168401 && Income <= 321450){
tax = .24;
}
if(Income >= 321451 && Income<=408200){
tax = .32;
}
if(Income >= 408201 && Income<=612350){
tax = .35;
}
if(Income >= 612351){
tax = .37;
}
tax = (Income/100)*tax;
System.out.print(Name +", the federal income tax for an annual salary of "+Income+" for single status "+tax);
}
public String marriedSeparately(String Name, int Income){
double tax = 0;
if(Income >=0 && Income <= 9700){
tax = .1;
}
if(Income >= 9701 && Income <= 39475){
tax = .12;
}
if(Income >= 39476 && Income <= 84200){
tax = .22;
}
if(Income >= 84201 && Income <= 160725){
tax = .24;
}
if(Income >= 160726 && Income <= 204100){
tax = .32;
}
if(Income >= 204101 && Income <= 306175){
tax = .35;
}
if(Income >= 306176){
tax = .37;
}
tax = (Income/100)*tax;
return (Name+", the federal income tax for an annual salary of "+Income+" for a married separate status filer is "+tax);
}
public static void main(String[] args){
Scanner keyboard = new Scanner(System.in);
String Name;
int Income;
String Status;
System.out.print("What is your name: ");
Name = keyboard.next();
System.out.print("What is annual income: ");
Income = keyboard.nextInt();
System.out.print("Enter 0 - Single, '\n' 2 - head of household '\n' 3 - married filling jointly '\n' 4 - married filling '\n' Enter your option: ");
Status = keyboard.next();
if(Status.equals("0")){
System.out.println("test complete");
Single(Name, Income);
}
else if (Status.equals("2")){
headofHousehold(Name, Income);
}
else if(Status.equals("3")){
taxinfo2.marriedJointly(Name, Income);
}
else if(Status.equals("4")){
taxinfo2.marriedSeparately(Name, Income);
}
}
}
|
[
"75277480+ImNotMagik@users.noreply.github.com"
] |
75277480+ImNotMagik@users.noreply.github.com
|
290794aa29d5141f613fc0a7ade0082ede8f7aba
|
e108d65747c07078ae7be6dcd6369ac359d098d7
|
/com/google/common/collect/Interners.java
|
c3d89ac76dc9c1d470f6635298f9643dcb339f19
|
[
"MIT"
] |
permissive
|
kelu124/pyS3
|
50f30b51483bf8f9581427d2a424e239cfce5604
|
86eb139d971921418d6a62af79f2868f9c7704d5
|
refs/heads/master
| 2020-03-13T01:51:42.054846
| 2018-04-24T21:03:03
| 2018-04-24T21:03:03
| 130,913,008
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,542
|
java
|
package com.google.common.collect;
import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Equivalence;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import java.util.concurrent.ConcurrentMap;
@GwtIncompatible
@Beta
public final class Interners {
private static class InternerFunction<E> implements Function<E, E> {
private final Interner<E> interner;
public InternerFunction(Interner<E> interner) {
this.interner = interner;
}
public E apply(E input) {
return this.interner.intern(input);
}
public int hashCode() {
return this.interner.hashCode();
}
public boolean equals(Object other) {
if (!(other instanceof InternerFunction)) {
return false;
}
return this.interner.equals(((InternerFunction) other).interner);
}
}
private static class WeakInterner<E> implements Interner<E> {
private final MapMakerInternalMap<E, Dummy, ?, ?> map;
private enum Dummy {
VALUE
}
private WeakInterner() {
this.map = new MapMaker().weakKeys().keyEquivalence(Equivalence.equals()).makeCustomMap();
}
public E intern(E sample) {
do {
InternalEntry<E, Dummy, ?> entry = this.map.getEntry(sample);
if (entry != null) {
E canonical = entry.getKey();
if (canonical != null) {
return canonical;
}
}
} while (((Dummy) this.map.putIfAbsent(sample, Dummy.VALUE)) != null);
return sample;
}
}
private Interners() {
}
public static <E> Interner<E> newStrongInterner() {
final ConcurrentMap<E, E> map = new MapMaker().makeMap();
return new Interner<E>() {
public E intern(E sample) {
E canonical = map.putIfAbsent(Preconditions.checkNotNull(sample), sample);
return canonical == null ? sample : canonical;
}
};
}
@GwtIncompatible("java.lang.ref.WeakReference")
public static <E> Interner<E> newWeakInterner() {
return new WeakInterner();
}
public static <E> Function<E, E> asFunction(Interner<E> interner) {
return new InternerFunction((Interner) Preconditions.checkNotNull(interner));
}
}
|
[
"kelu124@gmail.com"
] |
kelu124@gmail.com
|
61226fad6e30b4e1d2759ae5a8a898b03173f6b1
|
426beb604e3a11f995712b90cd0d63d114b49568
|
/Team2_Model2 MVC_BitMarket/src/kr/or/bit/service/admin/PurchaseList.java
|
4a47f493be6acec70b26432241c7d7d201c2e211
|
[] |
no_license
|
taepd/2_team2
|
07e564d7a2007b0bb9694ae7903ebc6039c63dcc
|
1bce84cc87bcf396b6660b58fa9e5a49e33d23b4
|
refs/heads/master
| 2021-05-19T04:00:10.163305
| 2020-10-18T11:41:30
| 2020-10-18T11:41:30
| 251,519,126
| 2
| 1
| null | 2020-04-30T09:15:32
| 2020-03-31T06:29:49
|
CSS
|
UTF-8
|
Java
| false
| false
| 2,095
|
java
|
package kr.or.bit.service.admin;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import kr.or.bit.action.Action;
import kr.or.bit.action.ActionForward;
import kr.or.bit.dao.Bitdao;
import kr.or.bit.dto.Board;
import kr.or.bit.dto.BoardCt_Join;
import kr.or.bit.dto.Notice;
public class PurchaseList implements Action{
@Override
public ActionForward execute(HttpServletRequest request, HttpServletResponse response) {
ActionForward forward = null;
String ps = request.getParameter("ps"); //pagesize
String cp = request.getParameter("cp"); //current page
String searchContent = request.getParameter("searchContent");
String ctname = request.getParameter("ctname");
//List 페이지 처음 호출 ...
if(ps == null || ps.trim().equals("")){
//default 값 설정
ps = "5"; //5개씩
}
if(cp == null || cp.trim().equals("")){
//default 값 설정
cp = "1"; // 1번째 페이지 보겠다
}
int pagesize = Integer.parseInt(ps);
int cpage = Integer.parseInt(cp);
int pagecount=0;
try {
Bitdao dao = new Bitdao();
List<BoardCt_Join> purchaselist = dao.getBoardSearchList(cpage, pagesize, searchContent, ctname);
request.setAttribute("purchaselist", purchaselist);
int totalpurchasecount = dao.getTotalBoardCount();
if(totalpurchasecount % pagesize == 0){
pagecount = totalpurchasecount / pagesize; // 20 << 100/5
}else{
pagecount = (totalpurchasecount / pagesize) + 1;
}
request.setAttribute("searchContent", searchContent);
request.setAttribute("ctname", ctname);
request.setAttribute("pagesize", pagesize);
request.setAttribute("cpage", cpage);
request.setAttribute("pagecount", pagecount);
request.setAttribute("totalpurchasecount", totalpurchasecount);
forward = new ActionForward();
forward.setRedirect(false); //forward
forward.setPath("/WEB-INF/views/admin/PurchaseList.jsp");
}catch (Exception e) {
System.out.println(e.getMessage());
}
return forward;
}
}
|
[
"taepd1@gmail.com"
] |
taepd1@gmail.com
|
0d90a535f76425b12b2a1a44bf6136f9b3796934
|
95aafb88dd041c1bf41a500179507a9e4a82de8a
|
/src/main/java/ch/unil/doplab/geodabs/motif/BruteForce.java
|
ad78f3eec30c769bcf2385371c27aaa9bbfd13e4
|
[] |
no_license
|
geoHeil/geodabs
|
f109ed4374989419a76d41942d20836fac234b04
|
8b698c19a72868a99979c97368efb960c9b130f0
|
refs/heads/master
| 2020-06-11T20:06:33.910603
| 2019-01-17T12:57:28
| 2019-01-17T12:57:28
| 194,070,100
| 1
| 0
| null | 2019-06-27T09:56:45
| 2019-06-27T09:56:45
| null |
UTF-8
|
Java
| false
| false
| 1,112
|
java
|
package ch.unil.doplab.geodabs.motif;
import ch.unil.doplab.geodabs.distance.DFD;
import ch.unil.doplab.geodabs.model.Point;
import static ch.unil.doplab.geodabs.distance.DFD.distance;
import java.util.Arrays;
public class BruteForce {
public static MotifPair execute(Point[] ta, Point[] tb, int e) {
final int s = ta.length;
final int t = tb.length;
double bsf = Double.MAX_VALUE;
MotifPair bpair = null;
for (int i = 0; i <= s - e; i++) {
for (int j = 0; j <= t - e; j++) {
for (int ie = i + e; ie <= s; ie++) {
for (int je = j + e; je <= t; je++) {
Point[] ps = Arrays.copyOfRange(ta, i, ie);
Point[] qs = Arrays.copyOfRange(tb, j, je);
double d = DFD.distance(ps, qs);
if (d < bsf) {
bsf = d;
bpair = new MotifPair(i, j, ie, je, bsf);
}
}
}
}
}
return bpair;
}
}
|
[
"bchapuis@gmail.com"
] |
bchapuis@gmail.com
|
df448eb23c11467e4022b2eba0b5008bce74ee2a
|
ac09a467d9981f67d346d1a9035d98f234ce38d5
|
/leetcode/src/main/java/org/leetcode/problems/_000125_ValidPalindrome.java
|
c12a37de60e1112778e7322db53f282fb8aa96ff
|
[] |
no_license
|
AlexKokoz/leetcode
|
03c9749c97c846c4018295008095ac86ae4951ee
|
9449593df72d86dadc4c470f1f9698e066632859
|
refs/heads/master
| 2023-02-23T13:56:38.978851
| 2023-02-12T21:21:54
| 2023-02-12T21:21:54
| 232,152,255
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 670
|
java
|
package org.leetcode.problems;
/**
*
* EASY
*
* @author Alexandros Kokozidis
*
*/
public class _000125_ValidPalindrome {
public boolean isPalindrome(String s) {
int n = s.length();
int lo = 0;
int hi = n - 1;
while (lo < hi) {
while (lo < n && !isAlphanumeric(s.charAt(lo)))
lo++;
while (hi >= 0 && !isAlphanumeric(s.charAt(hi)))
hi--;
if (lo >= hi)
break;
if (Character.toLowerCase(s.charAt(lo)) != Character.toLowerCase(s.charAt(hi)))
return false;
hi--;
lo++;
}
return true;
}
static boolean isAlphanumeric(char c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9');
}
}
|
[
"alexandros.kokozidis@gmail.com"
] |
alexandros.kokozidis@gmail.com
|
ce413d70332c15551ab63a4ef7e7bdaef70085e0
|
fec4c1754adce762b5c4b1cba85ad057e0e4744a
|
/jf-base/src/main/java/com/jf/entity/CashTransferExtExample.java
|
7c3200dd87c0bec5caf02b5517edd7e917d1123e
|
[] |
no_license
|
sengeiou/workspace_xg
|
140b923bd301ff72ca4ae41bc83820123b2a822e
|
540a44d550bb33da9980d491d5c3fd0a26e3107d
|
refs/heads/master
| 2022-11-30T05:28:35.447286
| 2020-08-19T02:30:25
| 2020-08-19T02:30:25
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,244
|
java
|
package com.jf.entity;
import com.jf.common.ext.query.QueryObject;
import com.jf.common.ext.util.StrKit;
public class CashTransferExtExample extends CashTransferExample{
private QueryObject queryObject;
public QueryObject getQueryObject() {
if(queryObject == null) queryObject = new QueryObject();
return queryObject;
}
public CashTransferExtExample fill(){
if(queryObject == null) return this;
if(StrKit.notBlank(queryObject.getSortString())){
setOrderByClause(queryObject.getSortString());
}
if(queryObject.getLimitSize() > 0){
setLimitStart(0);
setLimitSize(queryObject.getLimitSize());
}
return this;
}
public CashTransferExtExample fillPage(){
if(queryObject == null) queryObject = new QueryObject();
if(StrKit.notBlank(queryObject.getSortString())){
setOrderByClause(queryObject.getSortString());
}
setLimitStart(queryObject.getLimitStart());
setLimitSize(queryObject.getPageSize());
return this;
}
@Override
public CashTransferExtCriteria createCriteria() {
CashTransferExtCriteria criteria = new CashTransferExtCriteria();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
public class CashTransferExtCriteria extends Criteria{
}
}
|
[
"397716215@qq.com"
] |
397716215@qq.com
|
63e08a70c8c478c3bcb56154263d9ca09039afb0
|
b279780df79ff2269333ee0dbed046ba02a5aa59
|
/IOT-Guide-Custom-Protocol/src/main/java/iot/technology/custom/protocol/PacketCodec.java
|
51b3b3024e7ef37e548db63934b688c83bc0ad98
|
[
"Apache-2.0"
] |
permissive
|
rogerwangzy/IOT-Technical-Guide
|
3093ae7482a6bf1b744f8a2a7d92097b6df53771
|
7e76946a5c4887514707f827308de86d243c8497
|
refs/heads/master
| 2022-11-24T20:15:54.871068
| 2020-07-28T09:37:29
| 2020-07-28T09:37:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,473
|
java
|
package iot.technology.custom.protocol;
import io.netty.buffer.ByteBuf;
import iot.technology.custom.encryption.Encryption;
import iot.technology.custom.encryption.impl.NotEncryption;
import java.util.HashMap;
import java.util.Map;
/**
* @author james mu
* @date 2020/7/27 13:45
*/
public class PacketCodec {
public static final byte MAGIC_NUMBER1 = (byte) 0x23;
public static final byte MAGIC_NUMBER2 = (byte) 0x23;
public static final byte VER = (byte) 0x01;
public static final PacketCodec INSTANCE = new PacketCodec();
private final Map<Byte, Class<? extends Packet>> packetTypeMap;
private final Map<Byte, Encryption> serializerMap;
private PacketCodec() {
packetTypeMap = new HashMap<>();
serializerMap = new HashMap<>();
Encryption encryption = new NotEncryption();
serializerMap.put(encryption.getEncryptionAlgorithm(), encryption);
}
public void encode(ByteBuf byteBuf, Packet packet) {
byte[] bytes = Encryption.DEFAULT.encrypt(packet);
byteBuf.writeByte(MAGIC_NUMBER1);
byteBuf.writeByte(MAGIC_NUMBER2);
byteBuf.writeByte(packet.getCommand());
byteBuf.writeBytes(packet.getVin());
byteBuf.writeByte(packet.getSwv());
byteBuf.writeByte(Encryption.DEFAULT.getEncryptionAlgorithm());
byteBuf.writeShort(bytes.length);
byteBuf.writeBytes(bytes);
byteBuf.writeByte(VER);
}
public Packet decode(ByteBuf byteBuf) {
byteBuf.skipBytes(2);
byte command = byteBuf.readByte();
byte[] vinByte = new byte[17];
byteBuf.readBytes(vinByte);
byte swv = byteBuf.readByte();
byte enm = byteBuf.readByte();
short length = byteBuf.readShort();
byte[] bytes = new byte[length];
byteBuf.readBytes(bytes);
byte ver = byteBuf.readByte();
Class<? extends Packet> requestType = getRequestType(command);
Encryption encryption = getEncryption(enm);
if (requestType != null && encryption != null) {
Packet packet = encryption.decrypt(requestType, bytes);
packet.setVin(vinByte);
return packet;
}
return null;
}
private Encryption getEncryption(byte encryptionAlgorithm) {
return serializerMap.get(encryptionAlgorithm);
}
private Class<? extends Packet> getRequestType(byte command) {
return packetTypeMap.get(command);
}
}
|
[
"lovewsic@gmail.com"
] |
lovewsic@gmail.com
|
20cee2064839bedc79d54ac91c998b3d072004e2
|
8501e286832a36ed033b4220fb5e281f4b57e585
|
/Sample9_4_加载obj文件中的纹理坐标/app/src/main/java/com/bn/Sample9_4/MatrixState.java
|
8bf22dc44b29bfaaba73ab5c9d9af9eebdb2bf02
|
[] |
no_license
|
CatDroid/OpenGLES3xGame
|
f8b2e88dffdbac67078c04f166f2fc42cf92cc67
|
6e066ceeb238836c623135871674337b4a8b4992
|
refs/heads/master
| 2021-05-16T15:30:08.674603
| 2020-12-20T09:32:28
| 2020-12-20T09:32:28
| 119,228,042
| 24
| 9
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,126
|
java
|
package com.bn.Sample9_4;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.util.*;
import android.opengl.Matrix;
//存储系统矩阵状态的类
public class MatrixState
{
private static float[] mProjMatrix = new float[16];//4x4矩阵 投影用
private static float[] mVMatrix = new float[16];//摄像机位置朝向9参数矩阵
private static float[] currMatrix;//当前变换矩阵
public static float[] lightLocation=new float[]{0,0,0};//定位光光源位置
public static FloatBuffer cameraFB;
public static FloatBuffer lightPositionFB;
public static Stack<float[]> mStack=new Stack<float[]>();//保护变换矩阵的栈
public static void setInitStack()//获取不变换初始矩阵
{
currMatrix=new float[16];
Matrix.setRotateM(currMatrix, 0, 0, 1, 0, 0);
}
public static void pushMatrix()//保护变换矩阵
{
mStack.push(currMatrix.clone());
}
public static void popMatrix()//恢复变换矩阵
{
currMatrix=mStack.pop();
}
public static void translate(float x,float y,float z)//设置沿xyz轴移动
{
Matrix.translateM(currMatrix, 0, x, y, z);
}
public static void rotate(float angle,float x,float y,float z)//设置绕xyz轴移动
{
Matrix.rotateM(currMatrix,0,angle,x,y,z);
}
//设置摄像机
public static void setCamera
(
float cx, //摄像机位置x
float cy, //摄像机位置y
float cz, //摄像机位置z
float tx, //摄像机目标点x
float ty, //摄像机目标点y
float tz, //摄像机目标点z
float upx, //摄像机UP向量X分量
float upy, //摄像机UP向量Y分量
float upz //摄像机UP向量Z分量
)
{
Matrix.setLookAtM
(
mVMatrix,
0,
cx,
cy,
cz,
tx,
ty,
tz,
upx,
upy,
upz
);
float[] cameraLocation=new float[3];//摄像机位置
cameraLocation[0]=cx;
cameraLocation[1]=cy;
cameraLocation[2]=cz;
ByteBuffer llbb = ByteBuffer.allocateDirect(3*4);
llbb.order(ByteOrder.nativeOrder());//设置字节顺序
cameraFB=llbb.asFloatBuffer();
cameraFB.put(cameraLocation);
cameraFB.position(0);
}
//设置透视投影参数
public static void setProjectFrustum
(
float left, //near面的left
float right, //near面的right
float bottom, //near面的bottom
float top, //near面的top
float near, //near面距离
float far //far面距离
)
{
Matrix.frustumM(mProjMatrix, 0, left, right, bottom, top, near, far);
}
//设置正交投影参数
public static void setProjectOrtho
(
float left, //near面的left
float right, //near面的right
float bottom, //near面的bottom
float top, //near面的top
float near, //near面距离
float far //far面距离
)
{
Matrix.orthoM(mProjMatrix, 0, left, right, bottom, top, near, far);
}
//获取具体物体的总变换矩阵
public static float[] getFinalMatrix()
{
float[] mMVPMatrix=new float[16];
Matrix.multiplyMM(mMVPMatrix, 0, mVMatrix, 0, currMatrix, 0);
Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mMVPMatrix, 0);
return mMVPMatrix;
}
//获取具体物体的变换矩阵
public static float[] getMMatrix()
{
return currMatrix;
}
//设置灯光位置的方法
public static void setLightLocation(float x,float y,float z)
{
lightLocation[0]=x;
lightLocation[1]=y;
lightLocation[2]=z;
ByteBuffer llbb = ByteBuffer.allocateDirect(3*4);
llbb.order(ByteOrder.nativeOrder());//设置字节顺序
lightPositionFB=llbb.asFloatBuffer();
lightPositionFB.put(lightLocation);
lightPositionFB.position(0);
}
}
|
[
"1198432354@qq.com"
] |
1198432354@qq.com
|
d9696a2f082d85a77dc78ac2dbe89fb11d7bbdf9
|
0ba4738b6cac011b9e8cf1fd4c5c04adb5ef5d2a
|
/model/src/designModel/creationtype/prototype/improve/Sheep.java
|
354176fb399b262292f8623f1f39f7d630c0959c
|
[] |
no_license
|
17551085204/designPattern
|
b662089fab8ffea6ac7963bcfebb52afb6ff0b98
|
09ee3596fc3c823d0b12ffc45c1560eb976ce718
|
refs/heads/main
| 2023-01-30T14:03:42.686979
| 2020-12-18T09:52:07
| 2020-12-18T09:52:07
| 317,772,066
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,428
|
java
|
/*
@Author:南柯一梦
@Contact:2890241339@qq.com
@Date:2020/12/10
*/
package designModel.creationtype.prototype.improve;
//import java.util.Scanner;
public class Sheep implements Cloneable {
private String name;
private int age;
private String color;
private String address="蒙古羊";
public Sheep friend;
public Sheep(String name, int age, String color) {
this.name = name;
this.age = age;
this.color = color;
}
// 克隆该实例,使用默认的克隆方法
@Override
protected Object clone() {
Sheep sheep=null;
try {
sheep=(Sheep)super.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return sheep;
}
@Override
public String toString() {
return "Sheep{" +
"name='" + name + '\'' +
", age=" + age +
", color='" + color + '\'' +
", address='" + address + '\'' +
'}';
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}
|
[
"2890241339@qq.com"
] |
2890241339@qq.com
|
51f126ca60c08a22b0be926fa0e09081ef928012
|
b0296d820c0400440232152485a0b3dff3e943be
|
/GTAS/GridTalk/src/Client/com/gridnode/gtas/client/web/download/EditGridDocumentAction.java
|
ada3122d9398f2f859bcd4b42edd751f9821dae9
|
[] |
no_license
|
andytanoko/4.2.x_integration
|
74536c8933a98373b0118eeac66678b72b00aa8e
|
984842d92abaa797a19bd0f002ec45c9c37da288
|
refs/heads/master
| 2021-01-10T13:46:58.824451
| 2015-09-23T10:41:25
| 2015-09-23T10:41:25
| 46,325,977
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,818
|
java
|
/**
* This software is the proprietary information of GridNode Pte Ltd.
* Use is subjected to license terms.
*
* Copyright 2001-2002 (C) GridNode Pte Ltd. All Rights Reserved.
*
* File: EditGridDocumentAction.java
*
****************************************************************************
* Date Author Changes
****************************************************************************
* 2003-07-23 Daniel D'Cotta Created (GridForm 2.0 intergration)
* Nov 24 2005 Neo Sok Lay Specify use of Xerces parser implementation to parse doc
* Feb 12 2007 Neo Sok Lay Remove attempt to connect to GAIA.
*/
package com.gridnode.gtas.client.web.download;
import java.io.File;
import java.io.IOException;
import java.io.StringReader;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import com.gridnode.gtas.client.GTClientException;
import com.gridnode.gtas.client.utils.StaticUtils;
import com.gridnode.gtas.client.web.IRequestKeys;
import com.gridnode.gtas.client.web.StaticWebUtils;
import com.gridnode.gtas.client.web.strutsbase.ActionContext;
import com.gridnode.gtas.client.web.strutsbase.GTActionBase;
import com.gridnode.pdip.framework.file.access.FileAccess;
public class EditGridDocumentAction extends GTActionBase
{
protected static final Log _log = LogFactory.getLog(EditGridDocumentAction.class); // 20031209 DDJ
protected static final String DOWNLOAD_MAPPING = "download";
protected static final String SAVE_GRID_DOCUMENT_MAPPING = "saveGridDocument";
public ActionForward execute( ActionMapping mapping,
ActionForm actionForm,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
try
{
ActionContext actionContext = new ActionContext(mapping,actionForm,request,response);
actionContext.setLog(_log);
EditGridDocumentAForm form = (EditGridDocumentAForm)actionForm;
validateFormState(form);
/*NSL20070212
String domain = form.getDomain();
String filePath = form.getFilePath();
String gridDocId = form.getGridDocId();
File file = getFile(domain, filePath);
String root = getRoot(file); */
ActionForward actionForward = null;
/*
try
{
// check if managed to obtain GAIA project name
if(StaticUtils.stringEmpty(root))
{
throw new GTClientException("Unable to retrieve GridForm project of document"); // 20040108 DDJ
}
// check if GAIA can handle the document
GAIAClient gaiaClient = new GAIAClient();
boolean isProjectAvailable = gaiaClient.isProjectAvailable(root);
if(!isProjectAvailable)
{
throw new UnsupportedOperationException("GridForm does not support root: " + root);
}
// upload the file to GAIA
String filename = StaticUtils.extractFilename(filePath);
String desc = filename + " (GTAS GridDocument Id: " + gridDocId + ")";
int gaiaDocId = gaiaClient.uploadDocument(file, desc);
// construct the return URL
// note: currently GAIA appends "http://" to the url
String saveGridDocumentUrl = request.getServerName() + ":" +
request.getServerPort() +
response.encodeURL(request.getContextPath() + mapping.findForward(SAVE_GRID_DOCUMENT_MAPPING).getPath());
saveGridDocumentUrl = StaticWebUtils.addParameterToURL(saveGridDocumentUrl, IRequestKeys.GRID_DOC_ID, gridDocId);
saveGridDocumentUrl = StaticWebUtils.addParameterToURL(saveGridDocumentUrl, IRequestKeys.GAIA_DOC_ID, gaiaDocId + "");
if(_log.isDebugEnabled())
{
_log.debug("saveGridDocumentUrl=" + saveGridDocumentUrl);
}
// redirect to the URL given by GAIA
String gaiaDocUrl = gaiaClient.getUrl(gaiaDocId, saveGridDocumentUrl);
actionForward = new ActionForward(gaiaDocUrl, true);
}
catch(Throwable t)
{
if(_log.isErrorEnabled())
{
_log.error("Caught error trying to view using GridForm, using default viewer", t);
}*/
actionForward = mapping.findForward(DOWNLOAD_MAPPING);
/*}*/
return actionForward;
}
catch(Throwable t)
{
throw new GTClientException("Error executing EditGridDocumentAction",t);
}
}
protected void validateFormState(EditGridDocumentAForm form)
throws IllegalStateException
{
if(StaticUtils.stringEmpty(form.getDomain()))
throw new IllegalStateException("domain is undefined");
if(StaticUtils.stringEmpty(form.getFilePath()))
throw new IllegalStateException("filePath is undefined");
if(StaticUtils.stringEmpty(form.getGridDocId()))
throw new IllegalStateException("gridDocId is undefined");
if(StaticUtils.primitiveLongValue(form.getGridDocId()) <= 0)
throw new IllegalStateException("gridDocId is not a valid value");
}
// return the file specified
protected File getFile(String domain, String filePath)
{
FileAccess fileAccess = new FileAccess(domain);
File file = fileAccess.getFile(filePath);
if(file == null)
{
throw new NullPointerException("FileAccess.getFile(" + filePath + ") returned null");
}
return file;
}
// return the root element
protected String getRoot(File file)
{
String root = null;
try
{
Document document = null;
//DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
//NSL20051124
DocumentBuilderFactory dbf = new org.apache.xerces.jaxp.DocumentBuilderFactoryImpl();
/*
DocumentBuilderFactory dbf;
ClassLoader oldLoader = null;
String oldFactory = System.getProperty("javax.xml.parsers.DocumentBuilderFactory");
try
{
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
oldLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
dbf = DocumentBuilderFactory.newInstance();
}
finally
{
if (oldLoader != null)
Thread.currentThread().setContextClassLoader(oldLoader);
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", oldFactory);
}*/
DocumentBuilder db = dbf.newDocumentBuilder();
db.setEntityResolver(new DummyResolver());
document = db.parse(file);
Node rootNode = document.getDocumentElement();
root = rootNode.getNodeName();
}
catch(Exception ex)
{
if(_log.isErrorEnabled())
{
_log.error("Error extracting root element", ex);
}
}
return root;
}
protected class DummyResolver implements EntityResolver
{
public DummyResolver()
{
}
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException, IOException
{
if(_log.isDebugEnabled())
{
_log.debug("Returning 'null' for resolveEntity(" + publicId + ", " + systemId + ")");
}
return new InputSource(new StringReader(""));
}
}
}
|
[
"muhamadnazir@gmail.com"
] |
muhamadnazir@gmail.com
|
6792e3f16a69fe3c1fe44e55e2e87ab32fa4d218
|
d5d40e6b214ee15b0b63f87bba2220aef64c0a4c
|
/net.sf.smbt.i2c.thingm/src-model/net/sf/smbt/commands/impl/FadeToHSBColorCmdImpl.java
|
68191b35816473cd57c96259e3313613f88f8c7e
|
[] |
no_license
|
lucascraft/ubiquisense
|
adb2cc6cc2615bd8440d825be9a4bf59a854799b
|
70c4a0c0790c3b37346c2e7117190802e5441ba5
|
refs/heads/master
| 2021-01-10T21:48:42.021551
| 2015-08-13T21:17:34
| 2015-08-13T21:17:34
| 37,203,783
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 892
|
java
|
/**
* <copyright>
* </copyright>
*
* $Id: FadeToHSBColorCmdImpl.java,v 1.1 2008/12/28 12:32:54 lucascraft Exp $
*/
package net.sf.smbt.commands.impl;
import net.sf.smbt.commands.CommandsPackage;
import net.sf.smbt.commands.FadeToHSBColorCmd;
import org.eclipse.emf.ecore.EClass;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Fade To HSB Color Cmd</b></em>'.
* <!-- end-user-doc -->
* <p>
* </p>
*
* @generated
*/
public class FadeToHSBColorCmdImpl extends BlinkMCmdImpl implements FadeToHSBColorCmd {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected FadeToHSBColorCmdImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return CommandsPackage.Literals.FADE_TO_HSB_COLOR_CMD;
}
} //FadeToHSBColorCmdImpl
|
[
"lucas.bigeardel@gmail.com"
] |
lucas.bigeardel@gmail.com
|
bff344ceb2feb6a0aadda2e5c242ee369ea1297e
|
64abfc0130cfa0aeb85c2c0a7d2f95037a80271f
|
/ECO_EmployeeManagement-portlet/docroot/WEB-INF/src/vn/com/ecopharma/emp/bean/LocaleKeyBean.java
|
0b619a129176771ff320070883b268bb297426cd
|
[] |
no_license
|
taotran/eco
|
8c962eb918ad4675b535d775f7b8af99cfaab31b
|
22620bc21ceb8da83e06c402cfa7bd5a0ea05cee
|
refs/heads/master
| 2021-01-10T02:48:29.194619
| 2016-04-14T11:00:58
| 2016-04-14T11:00:58
| 44,424,693
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,288
|
java
|
package vn.com.ecopharma.emp.bean;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import org.apache.commons.lang3.StringUtils;
import vn.com.ecopharma.emp.enumeration.DisciplineType;
import vn.com.ecopharma.emp.enumeration.ResignationType;
import vn.com.ecopharma.emp.enumeration.VacationLeaveType;
/**
* @author TaoTran
*
*/
@ManagedBean
@RequestScoped
public class LocaleKeyBean implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
public String getDisciplineTypeKey(String type) {
if (StringUtils.EMPTY.equals(type))
return StringUtils.EMPTY;
DisciplineType disciplineType = DisciplineType.valueOf(type);
return disciplineType.getLocalizedString();
}
public String getLeaveTypeKey(String type) {
if (StringUtils.EMPTY.equals(type))
return StringUtils.EMPTY;
type = type.replaceAll(" ", "_");
VacationLeaveType typeEnum = VacationLeaveType.valueOf(type);
return typeEnum.getLocalizedString();
}
public String getResignedTypeKey(String type) {
if (StringUtils.EMPTY.equals(type))
return StringUtils.EMPTY;
type = type.replaceAll(" ", "_");
ResignationType typeEnum = ResignationType.valueOf(type);
return typeEnum.getLocalizedString();
}
}
|
[
"tao.tranv@gmail.com"
] |
tao.tranv@gmail.com
|
91545d4dfa442060c3b333f083aecab65071a4f9
|
d90bc68346a2a786b01266e577dd23b0ff3387f2
|
/fs/src/test/org/jnode/test/fs/driver/context/FloppyDriverContext.java
|
e3062156562a5db4560eecfe73ff447d77bbaed5
|
[] |
no_license
|
flesire/jnode.mirror
|
aa2930923e998e7fbd9a48564c40edadfddb8cc7
|
2fae7f6b392a8ace3840e09635d3cc0105e4f335
|
refs/heads/master
| 2021-01-23T03:48:46.788908
| 2013-09-06T14:23:31
| 2013-09-06T14:23:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,574
|
java
|
/*
* $Id: FloppyDriverContext.java 5957 2013-02-17 21:12:34Z lsantha $
*
* Copyright (C) 2003-2013 JNode.org
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; If not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.jnode.test.fs.driver.context;
import java.io.IOException;
import javax.naming.NamingException;
import org.jmock.MockObjectTestCase;
import org.jnode.driver.DeviceFinder;
import org.jnode.driver.block.floppy.FloppyControllerFinder;
import org.jnode.driver.block.floppy.FloppyDeviceToDriverMapper;
import org.jnode.driver.block.floppy.FloppyDriver;
import org.jnode.driver.block.floppy.support.FloppyDriverUtils;
import org.jnode.test.fs.driver.BlockDeviceAPIContext;
import org.jnode.test.fs.driver.factories.MockFloppyDeviceFactory;
import org.jnode.test.fs.driver.stubs.StubDeviceManager;
import org.jnode.test.support.TestConfig;
public class FloppyDriverContext extends BlockDeviceAPIContext {
public FloppyDriverContext() {
super("FloppyDriver");
}
public void init(TestConfig config, MockObjectTestCase testCase) throws Exception {
super.init(config, testCase);
// set the current testCase for our factory
MockFloppyDeviceFactory factory;
try {
factory = (MockFloppyDeviceFactory)
FloppyDriverUtils.getFloppyDeviceFactory();
} catch (NamingException ex) {
throw (IOException) new IOException().initCause(ex);
}
factory.setTestCase(testCase);
DeviceFinder deviceFinder = new FloppyControllerFinder();
StubDeviceManager.INSTANCE.removeAll();
StubDeviceManager.INSTANCE.add(deviceFinder, new FloppyDeviceToDriverMapper());
FloppyDriver driver = (FloppyDriver) findDriver(deviceFinder, "fd0");
log.debug("findDriver->" + driver);
init(null, driver, null);
}
}
|
[
"galatnm@gmail.com"
] |
galatnm@gmail.com
|
a804493d559ab49f9e2743edda6e708526b17c31
|
2f7b585bc87c88e46747c969f49b86706e05cfa6
|
/iefas-ws/src/main/java/hk/oro/iefas/ws/system/service/DashboardInfoService.java
|
252aced9b97d50bbeb83c4c000b5a258b07869bc
|
[] |
no_license
|
peterso05168/oro
|
3fd5ee3e86838215b02b73e8c5a536ba2bb7c525
|
6ca20e6dc77d4716df29873c110eb68abbacbdbd
|
refs/heads/master
| 2020-03-21T17:10:58.381531
| 2018-06-27T02:19:08
| 2018-06-27T02:19:08
| 138,818,244
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 414
|
java
|
/**
*
*/
package hk.oro.iefas.ws.system.service;
import java.util.List;
import hk.oro.iefas.domain.system.dto.DashboardInfoDTO;
/**
* @version $Revision: 2040 $ $Date: 2018-04-12 14:37:25 +0800 (週四, 12 四月 2018) $
* @author $Author: marvel.ma $
*/
public interface DashboardInfoService {
void generateDashboardInfo(Integer postId);
List<DashboardInfoDTO> findByPostId(Integer postId);
}
|
[
"peterso05168@gmail.com"
] |
peterso05168@gmail.com
|
5e62744d010531a39e1aa8a394c8e3b04fa3a76a
|
e307eba673d1568c33ddc1bce02dede4386f1a22
|
/kafka-utility/src/main/java/poc/kafka/serialization/PersonSerializer.java
|
8b40a8f8e8dc0b2a463032626c41be706133cbb5
|
[] |
no_license
|
ashishb888/kafka-poc
|
28e74866364b54c06eae13875ab34a0a8f360b9c
|
9c0ec9fdf34424a099651cdedd261842b9157634
|
refs/heads/master
| 2020-07-10T00:25:05.515156
| 2020-03-04T06:14:52
| 2020-03-04T06:14:52
| 204,118,651
| 2
| 1
| null | 2023-09-05T22:02:03
| 2019-08-24T06:30:13
|
Java
|
UTF-8
|
Java
| false
| false
| 569
|
java
|
package poc.kafka.serialization;
import org.apache.kafka.common.errors.SerializationException;
import org.apache.kafka.common.serialization.Serializer;
import org.springframework.util.SerializationUtils;
import poc.kafka.domain.Person;
public class PersonSerializer implements Serializer<Person> {
@Override
public byte[] serialize(String topic, Person data) {
if (data == null)
return null;
try {
return SerializationUtils.serialize(data);
} catch (Exception e) {
throw new SerializationException("Error while serializing object", e);
}
}
}
|
[
"ashish.bhosle008@gmail.com"
] |
ashish.bhosle008@gmail.com
|
151b2c2b2e3727a3e0f09a0de78c50fefbf699b5
|
3bbc76ba8b88899eee1908dd1c87ad431ef21a3c
|
/azure-mgmt-appservice/src/main/java/com/microsoft/azure/management/appservice/implementation/AppSettingImpl.java
|
9f18b7f5933aad5c4bfba3fd7dae2020e8aa0791
|
[
"MIT"
] |
permissive
|
rsbth/azure-sdk-for-java
|
b937c21e91480401348cda6d5d7b025c3fbc306a
|
a5358dd58b629e3443399b76823ae72315c8b0f8
|
refs/heads/master
| 2020-06-09T08:28:21.573111
| 2016-12-09T01:28:41
| 2016-12-09T01:28:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 954
|
java
|
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.management.appservice.implementation;
import com.microsoft.azure.management.apigeneration.LangDefinition;
import com.microsoft.azure.management.appservice.AppSetting;
/**
* An immutable client-side representation of an app setting on a web app.
*/
@LangDefinition
class AppSettingImpl implements AppSetting {
private String key;
private String value;
private boolean sticky;
AppSettingImpl(String key, String value, boolean sticky) {
this.key = key;
this.value = value;
this.sticky = sticky;
}
@Override
public String key() {
return key;
}
@Override
public String value() {
return value;
}
@Override
public boolean sticky() {
return sticky;
}
}
|
[
"jianghaolu@users.noreply.github.com"
] |
jianghaolu@users.noreply.github.com
|
09981f870f47c8b4df83103a842420467ea7ab24
|
504293c8c94c1874b9b67265a114fc39d9fbad57
|
/springboot/springboot-validation/src/main/java/vip/xjdai/validation/increase/NotNullIncreaseValidator.java
|
58593ee98d62b1f77a2048bb824c992aa3a57882
|
[] |
no_license
|
mrh167/Springboot
|
b57a3f28019776a272c09bed6919838c185600bc
|
b64e9453699cdbb595831b23085b7fef7deeaf04
|
refs/heads/master
| 2023-04-14T03:35:00.176499
| 2020-12-19T07:15:59
| 2020-12-19T07:15:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 819
|
java
|
package vip.xjdai.validation.increase;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.SneakyThrows;
import org.hibernate.validator.internal.constraintvalidators.bv.NotNullValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.NotNull;
@EqualsAndHashCode(callSuper = true)
@Data
public class NotNullIncreaseValidator extends NotNullValidator {
private NotNull notNull;
public void initialize(NotNull notNull) {
this.notNull = notNull;
}
@SneakyThrows
@Override
public boolean isValid(Object object, ConstraintValidatorContext constraintValidatorContext) {
boolean valid = super.isValid(object, constraintValidatorContext);
if (valid) {
return valid;
}
return false;
}
}
|
[
"597186288@qq.com"
] |
597186288@qq.com
|
f7029f59cfd877a5619ec48983725d224b88ed9e
|
47dfb6e837ceb60f960a57c1cb4494cc16b3068c
|
/src/ecstc/Log.java
|
43a45407c092e1229773c858fae21203218b5c6a
|
[] |
no_license
|
grouptheory/ecstc
|
72dbce39cd8bbf90ea49b323fdd4dd9c5341a61f
|
5f1abedbc7536e9e80ed0c7354b6433676fc7de7
|
refs/heads/master
| 2020-03-16T23:33:15.218919
| 2018-05-11T19:48:12
| 2018-05-11T19:48:12
| 133,082,196
| 2
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,044
|
java
|
package ecstc;
import edu.uci.ics.jung.graph.*;
import java.util.*;
/**
* Class to produce output log
*
* @version $$
* @author Bilal Khan
*/
public class Log {
public static class Level implements Comparable {
private int _value;
Level(int v) {
_value = v;
}
public int compareTo(Object obj) {
Level other = (Level)obj;
if (this._value < other._value) return -1;
else if (this._value > other._value) return +1;
else return 0;
}
public String toString() {
if (_value==1) return "DEBUG";
else if (_value==2) return "INFO";
else if (_value==3) return "WARN";
else if (_value==4) return "ERROR";
else return "FATAL";
}
}
public static final Level DEBUG = new Level(1);
public static final Level INFO = new Level(2);
public static final Level WARN = new Level(3);
public static final Level ERROR = new Level(4);
public static final Level FATAL = new Level(5);
public static final Level DEFAULT_LEVEL = INFO;
private static final int KEYLENGTH = 10;
private static final HashMap _key2level = new HashMap();
public static void setLevel(Object key, Level lev) {
_key2level.put(key, lev);
}
public static Level getLevel(Object key) {
Level setting = (Level)_key2level.get(key);
if (setting==null) {
setting = DEFAULT_LEVEL;
}
return setting;
}
public static void diag(Object key, Level lev, String s) {
Level setting = getLevel(key);
if (key instanceof String) {
String skey = (String)key;
int index = skey.lastIndexOf(".");
if (index >= 0) {
skey = skey.substring(index+1);
}
int len = skey.length();
while (len < KEYLENGTH) {
skey = skey+" ";
len = skey.length();
}
if (len > KEYLENGTH) {
skey = skey.substring(0, KEYLENGTH);
}
else {
}
key = skey;
}
if (setting.compareTo(lev) <= 0) {
System.out.println(key+" ("+lev+") "+"\t"+s);
if (lev.compareTo(FATAL)==0) {
System.exit(-1);
}
}
}
}
|
[
"grouptheory@gmail.com"
] |
grouptheory@gmail.com
|
094d26380eef0e79c2d508b02a1456072e29b9bd
|
da5a2d2050ac529a19e14a8ea3f9f21714cc2b5d
|
/app/src/main/java/com/google/android/gms/internal/zzcb.java
|
29ddf0be96f6cd7b2c0126629f3c5c3d241070e7
|
[] |
no_license
|
F0rth/Izly
|
851bf22e53ea720fd03f03269d015efd7d8de5a4
|
89af45cedfc38e370a64c9fa341815070cdf49d6
|
refs/heads/master
| 2021-07-17T15:39:25.947444
| 2017-10-21T10:05:58
| 2017-10-21T10:05:58
| 108,004,099
| 1
| 1
| null | 2017-10-23T15:51:00
| 2017-10-23T15:51:00
| null |
UTF-8
|
Java
| false
| false
| 3,976
|
java
|
package com.google.android.gms.internal;
import android.text.TextUtils;
import com.google.android.gms.ads.internal.zzr;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@zzhb
public class zzcb {
private final Object zzpV = new Object();
private final Map<String, String> zzxA = new LinkedHashMap();
private String zzxB;
private zzbz zzxC;
private zzcb zzxD;
boolean zzxi;
private final List<zzbz> zzxz = new LinkedList();
public zzcb(boolean z, String str, String str2) {
this.zzxi = z;
this.zzxA.put("action", str);
this.zzxA.put("ad_format", str2);
}
public void zzN(String str) {
if (this.zzxi) {
synchronized (this.zzpV) {
this.zzxB = str;
}
}
}
public boolean zza(zzbz com_google_android_gms_internal_zzbz, long j, String... strArr) {
synchronized (this.zzpV) {
for (String com_google_android_gms_internal_zzbz2 : strArr) {
this.zzxz.add(new zzbz(j, com_google_android_gms_internal_zzbz2, com_google_android_gms_internal_zzbz));
}
}
return true;
}
public boolean zza(zzbz com_google_android_gms_internal_zzbz, String... strArr) {
return (!this.zzxi || com_google_android_gms_internal_zzbz == null) ? false : zza(com_google_android_gms_internal_zzbz, zzr.zzbG().elapsedRealtime(), strArr);
}
public zzbz zzb(long j) {
return !this.zzxi ? null : new zzbz(j, null, null);
}
public void zzc(zzcb com_google_android_gms_internal_zzcb) {
synchronized (this.zzpV) {
this.zzxD = com_google_android_gms_internal_zzcb;
}
}
public void zzc(String str, String str2) {
if (this.zzxi && !TextUtils.isEmpty(str2)) {
zzbv zzhb = zzr.zzbF().zzhb();
if (zzhb != null) {
synchronized (this.zzpV) {
zzhb.zzL(str).zza(this.zzxA, str, str2);
}
}
}
}
public zzbz zzdB() {
return zzb(zzr.zzbG().elapsedRealtime());
}
public void zzdC() {
synchronized (this.zzpV) {
this.zzxC = zzdB();
}
}
public String zzdD() {
String stringBuilder;
StringBuilder stringBuilder2 = new StringBuilder();
synchronized (this.zzpV) {
for (zzbz com_google_android_gms_internal_zzbz : this.zzxz) {
long time = com_google_android_gms_internal_zzbz.getTime();
String zzdy = com_google_android_gms_internal_zzbz.zzdy();
zzbz com_google_android_gms_internal_zzbz2 = com_google_android_gms_internal_zzbz2.zzdz();
if (com_google_android_gms_internal_zzbz2 != null && time > 0) {
stringBuilder2.append(zzdy).append('.').append(time - com_google_android_gms_internal_zzbz2.getTime()).append(',');
}
}
this.zzxz.clear();
if (!TextUtils.isEmpty(this.zzxB)) {
stringBuilder2.append(this.zzxB);
} else if (stringBuilder2.length() > 0) {
stringBuilder2.setLength(stringBuilder2.length() - 1);
}
stringBuilder = stringBuilder2.toString();
}
return stringBuilder;
}
public zzbz zzdE() {
zzbz com_google_android_gms_internal_zzbz;
synchronized (this.zzpV) {
com_google_android_gms_internal_zzbz = this.zzxC;
}
return com_google_android_gms_internal_zzbz;
}
Map<String, String> zzn() {
Map<String, String> map;
synchronized (this.zzpV) {
zzbv zzhb = zzr.zzbF().zzhb();
if (zzhb == null || this.zzxD == null) {
map = this.zzxA;
} else {
map = zzhb.zza(this.zzxA, this.zzxD.zzn());
}
}
return map;
}
}
|
[
"baptiste.robert@sigma.se"
] |
baptiste.robert@sigma.se
|
b8e58745fc6cddb0fe4dbf1d15d9b74efcdf6016
|
4170b2dda4107b4987267cd99489ed9bc7654026
|
/src/com/concurrency_in_practice/part_2_structuring_concurrent_applications/chap06_task_execution/Chapt06_TaskExecution.java
|
6a44c09e124f36b2b5fd9af3cf516219014a557d
|
[] |
no_license
|
aifoss/java-concurrency-in-practice
|
a15fbae905925046bde9b5ed8866fe73e73b2b9a
|
d17ecbdb110fb61abc08fe693b953b9b1538638e
|
refs/heads/master
| 2020-04-07T22:23:36.385842
| 2018-11-23T22:34:19
| 2018-11-23T22:34:19
| 158,768,362
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 631
|
java
|
package com.concurrency_in_practice.part_2_structuring_concurrent_applications.chap06_task_execution;
/**
* Created by sofia on 5/27/17.
*/
/**
* Chapter 6. Task Execution
*
* Most concurrent applications are organized around the execution of tasks: abstract, discrete units of work.
* Dividing the work of an application into tasks simplifies program organization,
* facilitates error recovery by providing natural transaction boundaries,
* and promotes concurrency by providing a natural structure for parallelizing work.
*/
public class Chapt06_TaskExecution {
public static void main(String[] args) {
}
}
|
[
"sathenikos@gmail.com"
] |
sathenikos@gmail.com
|
43c30f6e1800c1e923203bc144fa5f43bc58d82f
|
af0d1cb2999d25ecf6e5e854138bbc6f62d326c7
|
/src/main/java/ci/projetSociaux/repository/OdkMenageRepository.java
|
5fc2ca91da3fa93187c827a3813f3f59f6390108
|
[] |
no_license
|
syliGaye/ProjetSocial_Dev_2019
|
48deee4f5d870de22a939bc313c496c26be4fee4
|
8ce08aa7cd53ee8de531063371f2ea71d4c5d81a
|
refs/heads/master
| 2023-04-01T00:45:21.665087
| 2019-05-27T12:24:50
| 2019-05-27T12:24:50
| 187,012,842
| 0
| 0
| null | 2023-03-27T22:16:32
| 2019-05-16T11:19:00
|
Java
|
UTF-8
|
Java
| false
| false
| 446
|
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ci.projetSociaux.repository;
import ci.projetSociaux.entity.OdkMenage;
import org.springframework.data.jpa.repository.JpaRepository;
/**
*
* @author soumabkar
*/
public interface OdkMenageRepository extends JpaRepository<OdkMenage, String>{
}
|
[
"sylvestregaye@gmail.com"
] |
sylvestregaye@gmail.com
|
434e7c8daeee6f30ae6f490f167faf8ba5d21240
|
e60317495de8a9be2d2aab1f58604e9c64a99de8
|
/JpaAula5/src/br/edu/unitri/DTO/Consultas/ConsultaLetraM.java
|
681e868d0546f383f2f42ef0676ff8192a8a1c64
|
[] |
no_license
|
marcosfba/JAVA
|
4a6803cb0be5305ff8b0614bdff11da63afbf479
|
0924dca56739c261c5106a142d99d2805027f0b6
|
refs/heads/master
| 2021-01-10T07:54:32.491292
| 2015-08-03T11:19:39
| 2015-08-03T11:19:39
| 36,016,878
| 0
| 1
| null | null | null | null |
ISO-8859-10
|
Java
| false
| false
| 1,923
|
java
|
/**
*
*/
package br.edu.unitri.DTO.Consultas;
import java.io.Serializable;
import br.edu.unitri.model.Colunas;
/**
* @author marcos.fernando
*
*/
public class ConsultaLetraM implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Colunas(nome = "Nome do Empregado", size = 175)
private String nomeEmpregado;
@Colunas(nome = "Nš Departamento", size = 175)
private String numDepartamento;
@Colunas(nome = "Nome do Departamento", size = 175)
private String nomeDepartamento;
@Colunas(nome = "Nš Projeto", size = 175)
private String nomeProjeto;
public ConsultaLetraM() {
super();
}
public ConsultaLetraM(String nomeEmpregado, String numDepartamento,
String nomeDepartamento, String nomeProjeto) {
super();
this.nomeEmpregado = nomeEmpregado;
this.numDepartamento = numDepartamento;
this.nomeDepartamento = nomeDepartamento;
this.nomeProjeto = nomeProjeto;
}
public String getNomeEmpregado() {
return nomeEmpregado;
}
public void setNomeEmpregado(String nomeEmpregado) {
this.nomeEmpregado = nomeEmpregado;
}
public String getNumDepartamento() {
return numDepartamento;
}
public void setNumDepartamento(String numDepartamento) {
this.numDepartamento = numDepartamento;
}
public String getNomeDepartamento() {
return nomeDepartamento;
}
public void setNomeDepartamento(String nomeDepartamento) {
this.nomeDepartamento = nomeDepartamento;
}
public String getNomeProjeto() {
return nomeProjeto;
}
public void setNomeProjeto(String nomeProjeto) {
this.nomeProjeto = nomeProjeto;
}
@Override
public String toString() {
return "ConsultaLetraM [nomeEmpregado=" + nomeEmpregado
+ ", numDepartamento=" + numDepartamento
+ ", nomeDepartamento=" + nomeDepartamento + ", nomeProjeto="
+ nomeProjeto + "]";
}
}
|
[
"marcosfba.algar@gmail.com"
] |
marcosfba.algar@gmail.com
|
6617ca70f0c15f1c363182a8ae41ecb5615ba98c
|
f613e3518af1eb979511adbb07ef047df0db69f8
|
/Mybatis_04_DynamicSQL/src/com/yeqifu/mybatis/bean/Employee.java
|
98dcc301393ac379cae0eedff0aaa60bf74a2181
|
[] |
no_license
|
yeqifu/Mybatis2
|
01201f51d5ac521f897cc7a2fc78f8aa86c0bf93
|
f48fe39c825e0d51b669b40e8f7e16f3aaf8f011
|
refs/heads/master
| 2022-12-23T02:29:00.728125
| 2020-09-20T08:48:54
| 2020-09-20T08:48:54
| 295,286,065
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,380
|
java
|
package com.yeqifu.mybatis.bean;
public class Employee {
private Integer Id;
private String lastName;
private String gender;
private String email;
private Department department;
public Employee() {
super();
}
public Employee(Integer id, String lastName, String gender, String email) {
super();
Id = id;
this.lastName = lastName;
this.gender = gender;
this.email = email;
}
public Employee(Integer id, String lastName, String gender, String email,Department department) {
super();
Id = id;
this.lastName = lastName;
this.gender = gender;
this.email = email;
this.department = department;
}
public Integer getId() {
return Id;
}
public void setId(Integer id) {
Id = id;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Department getDepartment() {
return department;
}
public void setDepartment(Department department) {
this.department = department;
}
@Override
public String toString() {
return "Employee [Id=" + Id + ", lastName=" + lastName + ", gender=" + gender + ", email=" + email
+"]";
}
}
|
[
"1784525940@qq.com"
] |
1784525940@qq.com
|
0e4d2f018f423a7ac1e73b6015bd08d46d9d1448
|
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
|
/crash-reproduction-ws/results/XRENDERING-418-34-24-Single_Objective_GGA-WeightedSum/org/xwiki/rendering/wikimodel/xhtml/XhtmlParser_ESTest.java
|
abc5982217898c9e40ebc2452053400b2b9befc8
|
[
"MIT",
"CC-BY-4.0"
] |
permissive
|
STAMP-project/Botsing-basic-block-coverage-application
|
6c1095c6be945adc0be2b63bbec44f0014972793
|
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
|
refs/heads/master
| 2022-07-28T23:05:55.253779
| 2022-04-20T13:54:11
| 2022-04-20T13:54:11
| 285,771,370
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 564
|
java
|
/*
* This file was automatically generated by EvoSuite
* Tue Mar 31 06:37:09 UTC 2020
*/
package org.xwiki.rendering.wikimodel.xhtml;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class XhtmlParser_ESTest extends XhtmlParser_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
a76db43e6904ff7d0774046d9bcf4aa9fbead4e0
|
ab98581b2cda55e55c855d0c8089cfe03a264f1d
|
/thrift/compiler/test/fixtures/complex-union/gen-java/ValUnion.java
|
7a2b7ad02672edb4d075207b3b9a046b59be1d5b
|
[
"Apache-2.0"
] |
permissive
|
malmerey/fbthrift
|
ceb4ac8e4c8ac97534e072f043d283ba121e3778
|
2984cccced9aa5f430598974b6256fcca73e500a
|
refs/heads/master
| 2020-06-12T01:11:47.779381
| 2019-06-27T16:49:45
| 2019-06-27T16:53:04
| 194,147,059
| 0
| 0
|
Apache-2.0
| 2019-06-27T18:48:31
| 2019-06-27T18:48:30
| null |
UTF-8
|
Java
| false
| false
| 7,788
|
java
|
/**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import java.util.BitSet;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.facebook.thrift.*;
import com.facebook.thrift.async.*;
import com.facebook.thrift.meta_data.*;
import com.facebook.thrift.server.*;
import com.facebook.thrift.transport.*;
import com.facebook.thrift.protocol.*;
@SuppressWarnings({ "unused", "serial", "unchecked" })
public class ValUnion extends TUnion<ValUnion> implements Comparable<ValUnion> {
public static boolean DEFAULT_PRETTY_PRINT = true;
private static final TStruct STRUCT_DESC = new TStruct("ValUnion");
private static final TField V1_FIELD_DESC = new TField("v1", TType.STRUCT, (short)1);
private static final TField V2_FIELD_DESC = new TField("v2", TType.STRUCT, (short)2);
public static final int V1 = 1;
public static final int V2 = 2;
public static final Map<Integer, FieldMetaData> metaDataMap;
static {
Map<Integer, FieldMetaData> tmpMetaDataMap = new HashMap<Integer, FieldMetaData>();
tmpMetaDataMap.put(V1, new FieldMetaData("v1", TFieldRequirementType.DEFAULT,
new StructMetaData(TType.STRUCT, Val.class)));
tmpMetaDataMap.put(V2, new FieldMetaData("v2", TFieldRequirementType.DEFAULT,
new StructMetaData(TType.STRUCT, Val.class)));
metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap);
}
public ValUnion() {
super();
}
public ValUnion(int setField, Object value) {
super(setField, value);
}
public ValUnion(ValUnion other) {
super(other);
}
public ValUnion deepCopy() {
return new ValUnion(this);
}
public static ValUnion v1(Val value) {
ValUnion x = new ValUnion();
x.setV1(value);
return x;
}
public static ValUnion v2(Val value) {
ValUnion x = new ValUnion();
x.setV2(value);
return x;
}
@Override
protected void checkType(short setField, Object value) throws ClassCastException {
switch (setField) {
case V1:
if (value instanceof Val) {
break;
}
throw new ClassCastException("Was expecting value of type Val for field 'v1', but got " + value.getClass().getSimpleName());
case V2:
if (value instanceof Val) {
break;
}
throw new ClassCastException("Was expecting value of type Val for field 'v2', but got " + value.getClass().getSimpleName());
default:
throw new IllegalArgumentException("Unknown field id " + setField);
}
}
@Override
public void read(TProtocol iprot) throws TException {
setField_ = 0;
value_ = null;
iprot.readStructBegin(metaDataMap);
TField field = iprot.readFieldBegin();
if (field.type != TType.STOP)
{
value_ = readValue(iprot, field);
if (value_ != null)
{
switch (field.id) {
case V1:
if (field.type == V1_FIELD_DESC.type) {
setField_ = field.id;
}
break;
case V2:
if (field.type == V2_FIELD_DESC.type) {
setField_ = field.id;
}
break;
}
}
iprot.readFieldEnd();
iprot.readFieldBegin();
iprot.readFieldEnd();
}
iprot.readStructEnd();
}
@Override
protected Object readValue(TProtocol iprot, TField field) throws TException {
switch (field.id) {
case V1:
if (field.type == V1_FIELD_DESC.type) {
Val v1;
v1 = new Val();
v1.read(iprot);
return v1;
} else {
TProtocolUtil.skip(iprot, field.type);
return null;
}
case V2:
if (field.type == V2_FIELD_DESC.type) {
Val v2;
v2 = new Val();
v2.read(iprot);
return v2;
} else {
TProtocolUtil.skip(iprot, field.type);
return null;
}
default:
TProtocolUtil.skip(iprot, field.type);
return null;
}
}
@Override
protected void writeValue(TProtocol oprot, short setField, Object value) throws TException {
switch (setField) {
case V1:
Val v1 = (Val)getFieldValue();
v1.write(oprot);
return;
case V2:
Val v2 = (Val)getFieldValue();
v2.write(oprot);
return;
default:
throw new IllegalStateException("Cannot write union with unknown field " + setField);
}
}
@Override
protected TField getFieldDesc(int setField) {
switch (setField) {
case V1:
return V1_FIELD_DESC;
case V2:
return V2_FIELD_DESC;
default:
throw new IllegalArgumentException("Unknown field id " + setField);
}
}
@Override
protected TStruct getStructDesc() {
return STRUCT_DESC;
}
public Val getV1() {
if (getSetField() == V1) {
return (Val)getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'v1' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setV1(Val value) {
if (value == null) throw new NullPointerException();
setField_ = V1;
value_ = value;
}
public Val getV2() {
if (getSetField() == V2) {
return (Val)getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'v2' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setV2(Val value) {
if (value == null) throw new NullPointerException();
setField_ = V2;
value_ = value;
}
public boolean equals(Object other) {
if (other instanceof ValUnion) {
return equals((ValUnion)other);
} else {
return false;
}
}
public boolean equals(ValUnion other) {
return equalsNobinaryImpl(other);
}
@Override
public int compareTo(ValUnion other) {
return compareToImpl(other);
}
/**
* If you'd like this to perform more respectably, use the hashcode generator option.
*/
@Override
public int hashCode() {
return 0;
}
@Override
public String toString() {
return toString(DEFAULT_PRETTY_PRINT);
}
@Override
public String toString(boolean prettyPrint) {
return toString(1, prettyPrint);
}
@Override
public String toString(int indent, boolean prettyPrint) {
String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : "";
String newLine = prettyPrint ? "\n" : "";
String space = prettyPrint ? " " : "";
StringBuilder sb = new StringBuilder("ValUnion");
sb.append(space);
sb.append("(");
sb.append(newLine);
boolean first = true;
// Only print this field if it is the set field
if (getSetField() == V1)
{
sb.append(indentStr);
sb.append("v1");
sb.append(space);
sb.append(":").append(space);
if (this.getV1() == null) {
sb.append("null");
} else {
sb.append(TBaseHelper.toString(this.getV1(), indent + 1, prettyPrint));
}
first = false;
}
// Only print this field if it is the set field
if (getSetField() == V2)
{
if (!first) sb.append("," + newLine);
sb.append(indentStr);
sb.append("v2");
sb.append(space);
sb.append(":").append(space);
if (this.getV2() == null) {
sb.append("null");
} else {
sb.append(TBaseHelper.toString(this.getV2(), indent + 1, prettyPrint));
}
first = false;
}
sb.append(newLine + TBaseHelper.reduceIndent(indentStr));
sb.append(")");
return sb.toString();
}
}
|
[
"facebook-github-bot@users.noreply.github.com"
] |
facebook-github-bot@users.noreply.github.com
|
523d155437dd6381f2e96625adf2d0435a2b4dee
|
7b5a744665462c985652bd05685b823a0c6d64f6
|
/zttx-tradecore/src/main/java/com/zttx/web/module/common/mapper/ProductCountMapper.java
|
b4e011b754add5c55dd8c126c3edc7553def23aa
|
[] |
no_license
|
isoundy000/zttx-trading
|
d8a7de3d846e1cc2eb0b193c31d45d36b04f7372
|
1eee959fcf1d460fe06dfcb7c79c218bcb6f5872
|
refs/heads/master
| 2021-01-14T01:07:42.580121
| 2016-01-10T04:12:40
| 2016-01-10T04:12:40
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 978
|
java
|
/*
* Copyright 2015 Zttx, Inc. All rights reserved. 8637.com
* PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.zttx.web.module.common.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.zttx.sdk.annotation.MyBatisDao;
import com.zttx.sdk.core.GenericMapper;
import com.zttx.web.module.common.entity.ProductCount;
/**
* 产品计数信息 持久层接口
* <p>File:ProductCountDao.java </p>
* <p>Title: ProductCountDao </p>
* <p>Description:ProductCountDao </p>
* <p>Copyright: Copyright (c) May 26, 2015</p>
* <p>Company: 8637.com</p>
* @author Playguy
* @version 1.0
*/
@MyBatisDao
public interface ProductCountMapper extends GenericMapper<ProductCount>
{
/**
* 最前一个小时类变更过的所有产品统计信息
*
* @param past
* @param now
* @return {@link List}
*/
List<String> getProductCountMaps(@Param("past") Long past, @Param("now") Long now);
}
|
[
"ngds@maybedeMacBook-Air.local"
] |
ngds@maybedeMacBook-Air.local
|
2aa2ffe62b8380cfdd2a9b6fbeba44c5e91a7e0f
|
9623f83defac3911b4780bc408634c078da73387
|
/powercraft/src/common/net/minecraft/src/StructureVillageStart.java
|
a16b2fc0cd3e02e6243168a9776805a4fe8c9823
|
[] |
no_license
|
BlearStudio/powercraft-legacy
|
42b839393223494748e8b5d05acdaf59f18bd6c6
|
014e9d4d71bd99823cf63d4fbdb65c1b83fde1f8
|
refs/heads/master
| 2021-01-21T21:18:55.774908
| 2015-04-06T20:45:25
| 2015-04-06T20:45:25
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,977
|
java
|
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Random;
class StructureVillageStart extends StructureStart
{
private boolean hasMoreThanTwoComponents = false;
public StructureVillageStart(World par1World, Random par2Random, int par3, int par4, int par5)
{
ArrayList var6 = StructureVillagePieces.getStructureVillageWeightedPieceList(par2Random, par5);
ComponentVillageStartPiece var7 = new ComponentVillageStartPiece(par1World.getWorldChunkManager(), 0, par2Random, (par3 << 4) + 2, (par4 << 4) + 2, var6, par5);
this.components.add(var7);
var7.buildComponent(var7, this.components, par2Random);
ArrayList var8 = var7.field_74930_j;
ArrayList var9 = var7.field_74932_i;
int var10;
while (!var8.isEmpty() || !var9.isEmpty())
{
StructureComponent var11;
if (var8.isEmpty())
{
var10 = par2Random.nextInt(var9.size());
var11 = (StructureComponent)var9.remove(var10);
var11.buildComponent(var7, this.components, par2Random);
}
else
{
var10 = par2Random.nextInt(var8.size());
var11 = (StructureComponent)var8.remove(var10);
var11.buildComponent(var7, this.components, par2Random);
}
}
this.updateBoundingBox();
var10 = 0;
Iterator var13 = this.components.iterator();
while (var13.hasNext())
{
StructureComponent var12 = (StructureComponent)var13.next();
if (!(var12 instanceof ComponentVillageRoadPiece))
{
++var10;
}
}
this.hasMoreThanTwoComponents = var10 > 2;
}
public boolean isSizeableStructure()
{
return this.hasMoreThanTwoComponents;
}
}
|
[
"rapus95@gmail.com@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c"
] |
rapus95@gmail.com@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c
|
e9d3a3ed99736acf0aa12661f8644f607f8c5a05
|
5302e92f8226dff1273ea9c9b3cb01c5fd00660e
|
/src/main/java/com/yyl/config/spring/MyClassLoader.java
|
ce79bf8e7300973069150e27c75868618d17d554
|
[] |
no_license
|
yylstudy/spring
|
7d0a6df572479e6c2bd971cbf49c11f969cc4a4a
|
4fa6915399b52dda9b5c875098235f1296e6b0a4
|
refs/heads/master
| 2021-08-09T14:24:08.915349
| 2020-12-21T06:02:17
| 2020-12-21T06:02:17
| 147,061,104
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 309
|
java
|
package com.yyl.config.spring;
import java.net.URL;
import java.net.URLClassLoader;
/**
* 自定义ClassLoader
* @Author: yyl
* @Date: 2019/3/11 14:22
*/
public class MyClassLoader extends URLClassLoader {
public MyClassLoader(ClassLoader parent, URL... urls) {
super(urls, parent);
}
}
|
[
"1594818954@qq.com"
] |
1594818954@qq.com
|
13ff699e4a63d94b2d31fc1d7e5ee05f0467a3f1
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/7/7_e665620b0166f8386be70537ea7898510ceed4fa/ExchangeRatesFragment/7_e665620b0166f8386be70537ea7898510ceed4fa_ExchangeRatesFragment_t.java
|
25c7a17ab77b16467f2a230e8d519148b0865f65
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 8,088
|
java
|
/*
* Copyright 2011-2013 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.schildbach.wallet.ui;
import java.math.BigInteger;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.database.Cursor;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
import android.support.v4.widget.CursorAdapter;
import android.support.v4.widget.ResourceCursorAdapter;
import android.view.View;
import android.widget.BaseAdapter;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockListFragment;
import com.actionbarsherlock.view.ActionMode;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import com.google.bitcoin.core.Utils;
import com.google.bitcoin.core.Wallet;
import com.google.bitcoin.core.Wallet.BalanceType;
import de.schildbach.wallet.Constants;
import de.schildbach.wallet.ExchangeRatesProvider;
import de.schildbach.wallet.ExchangeRatesProvider.ExchangeRate;
import de.schildbach.wallet.WalletApplication;
import de.schildbach.wallet.util.ThrottelingWalletChangeListener;
import de.schildbach.wallet.util.WalletUtils;
import de.schildbach.wallet_test.R;
/**
* @author Andreas Schildbach
*/
public final class ExchangeRatesFragment extends SherlockListFragment implements LoaderManager.LoaderCallbacks<Cursor>,
OnSharedPreferenceChangeListener
{
private AbstractWalletActivity activity;
private WalletApplication application;
private SharedPreferences prefs;
private LoaderManager loaderManager;
private CursorAdapter adapter;
private BigInteger balance;
private String defaultCurrency;
private final ThrottelingWalletChangeListener walletChangeListener = new ThrottelingWalletChangeListener()
{
@Override
public void onThrotteledWalletChanged()
{
updateView();
}
};
@Override
public void onAttach(final Activity activity)
{
super.onAttach(activity);
this.activity = (AbstractWalletActivity) activity;
this.application = (WalletApplication) activity.getApplication();
this.prefs = PreferenceManager.getDefaultSharedPreferences(activity);
this.loaderManager = getLoaderManager();
}
@Override
public void onCreate(final Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
final Wallet wallet = application.getWallet();
wallet.addEventListener(walletChangeListener);
}
@Override
public void onActivityCreated(final Bundle savedInstanceState)
{
super.onActivityCreated(savedInstanceState);
setEmptyText(getString(R.string.exchange_rates_fragment_empty_text));
adapter = new ResourceCursorAdapter(activity, R.layout.exchange_rate_row, null, true)
{
@Override
public void bindView(final View view, final Context context, final Cursor cursor)
{
final ExchangeRate exchangeRate = ExchangeRatesProvider.getExchangeRate(cursor);
final boolean isDefaultCurrency = exchangeRate.currencyCode.equals(defaultCurrency);
view.setBackgroundResource(isDefaultCurrency ? R.color.bg_less_bright : R.color.bg_bright);
final View defaultView = view.findViewById(R.id.exchange_rate_row_default);
defaultView.setVisibility(isDefaultCurrency ? View.VISIBLE : View.INVISIBLE);
final TextView currencyCodeView = (TextView) view.findViewById(R.id.exchange_rate_row_currency_code);
currencyCodeView.setText(exchangeRate.currencyCode);
final CurrencyTextView rateView = (CurrencyTextView) view.findViewById(R.id.exchange_rate_row_rate);
rateView.setPrecision(Constants.LOCAL_PRECISION);
rateView.setAmount(WalletUtils.localValue(Utils.COIN, exchangeRate.rate));
final CurrencyTextView walletView = (CurrencyTextView) view.findViewById(R.id.exchange_rate_row_balance);
walletView.setPrecision(Constants.LOCAL_PRECISION);
walletView.setAmount(WalletUtils.localValue(balance, exchangeRate.rate));
walletView.setStrikeThru(Constants.TEST);
walletView.setTextColor(getResources().getColor(R.color.fg_less_significant));
}
};
setListAdapter(adapter);
loaderManager.initLoader(0, null, this);
}
@Override
public void onResume()
{
super.onResume();
defaultCurrency = prefs.getString(Constants.PREFS_KEY_EXCHANGE_CURRENCY, Constants.DEFAULT_EXCHANGE_CURRENCY);
prefs.registerOnSharedPreferenceChangeListener(this);
updateView();
}
@Override
public void onPause()
{
prefs.unregisterOnSharedPreferenceChangeListener(this);
super.onPause();
}
@Override
public void onDestroy()
{
application.getWallet().removeEventListener(walletChangeListener);
walletChangeListener.removeCallbacks();
super.onDestroy();
}
@Override
public void onListItemClick(final ListView l, final View v, final int position, final long id)
{
final Cursor cursor = (Cursor) adapter.getItem(position);
final ExchangeRate exchangeRate = ExchangeRatesProvider.getExchangeRate(cursor);
activity.startActionMode(new ActionMode.Callback()
{
public boolean onCreateActionMode(final ActionMode mode, final Menu menu)
{
final MenuInflater inflater = mode.getMenuInflater();
inflater.inflate(R.menu.exchange_rates_context, menu);
return true;
}
public boolean onPrepareActionMode(final ActionMode mode, final Menu menu)
{
mode.setTitle(exchangeRate.currencyCode);
mode.setSubtitle(getString(R.string.exchange_rates_fragment_source, exchangeRate.source));
return true;
}
public boolean onActionItemClicked(final ActionMode mode, final MenuItem item)
{
switch (item.getItemId())
{
case R.id.exchange_rates_context_set_as_default:
handleSetAsDefault(exchangeRate.currencyCode);
mode.finish();
return true;
}
return false;
}
public void onDestroyActionMode(final ActionMode mode)
{
}
private void handleSetAsDefault(final String currencyCode)
{
prefs.edit().putString(Constants.PREFS_KEY_EXCHANGE_CURRENCY, currencyCode).commit();
}
});
}
public void onSharedPreferenceChanged(final SharedPreferences sharedPreferences, final String key)
{
if (Constants.PREFS_KEY_EXCHANGE_CURRENCY.equals(key))
{
defaultCurrency = prefs.getString(Constants.PREFS_KEY_EXCHANGE_CURRENCY, Constants.DEFAULT_EXCHANGE_CURRENCY);
updateView();
}
}
private void updateView()
{
balance = application.getWallet().getBalance(BalanceType.ESTIMATED);
final ListAdapter adapter = getListAdapter();
if (adapter != null)
((BaseAdapter) adapter).notifyDataSetChanged();
}
public Loader<Cursor> onCreateLoader(final int id, final Bundle args)
{
return new CursorLoader(activity, ExchangeRatesProvider.contentUri(activity.getPackageName()), null, null, null, null);
}
public void onLoadFinished(final Loader<Cursor> loader, final Cursor data)
{
adapter.swapCursor(data);
}
public void onLoaderReset(final Loader<Cursor> loader)
{
adapter.swapCursor(null);
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
fb3c77ca2e9660481adf501a7ac4c97b5d21e190
|
319b6fac5f0e8872bdc569b11c9adde66e8eefef
|
/src/main/java/com/bhuwan/spring/di/autowire/annotation/inject/Client.java
|
69ca9ca3024f8d8f91109e36acf50c5c3e6756bb
|
[] |
no_license
|
bhuwang/spring_playground
|
2613a40706d424bee44a6cb9db76c75538483319
|
5a2a8bbbdcb43310e6d177e49d06eed61cb0c2e1
|
refs/heads/master
| 2021-01-20T21:01:01.238271
| 2016-06-13T04:25:47
| 2016-06-13T04:25:47
| 60,771,327
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 482
|
java
|
/**
*
*/
package com.bhuwan.spring.di.autowire.annotation.inject;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* @author bhuwan
*
*/
public class Client {
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("autowire_annotation_inject.xml");
Car c = (Car) context.getBean("car");
c.printData();
}
}
|
[
"bhuwangautam@lftechnology.com"
] |
bhuwangautam@lftechnology.com
|
8f15439110b3dd9c681e2c0bd27b43051ce6a182
|
9b9dd4b68f21e57d219fb3af422e76be7fc7a7ee
|
/src/main/java/org/lanternpowered/server/block/provider/property/PropertyProviderCollections.java
|
4efe67f546fface18c278818a002494568928ae4
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
Mosaplex/Lantern
|
3cf754db3a3e0240ecd1d6070074cf0d097f729c
|
7f536b5b0d06a05dfeb62d2873664c42ee28f91f
|
refs/heads/master
| 2021-03-21T11:02:08.501286
| 2019-07-02T15:49:13
| 2019-07-02T15:49:13
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,844
|
java
|
/*
* This file is part of LanternServer, licensed under the MIT License (MIT).
*
* Copyright (c) LanternPowered <https://www.lanternpowered.org>
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the Software), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.lanternpowered.server.block.provider.property;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.blastResistance;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.flammable;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.gravityAffected;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.hardness;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.lightEmission;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.matter;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.passable;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.replaceable;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.solidCube;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.solidMaterial;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.solidSide;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.statisticsTracked;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.surrogateBlock;
import static org.lanternpowered.server.block.provider.property.PropertyProviders.unbreakable;
import org.spongepowered.api.data.property.block.MatterProperty;
/**
* Some presents of {@link PropertyProviderCollection}s that can be
* shared across block types.
*/
public final class PropertyProviderCollections {
public static final PropertyProviderCollection DEFAULT = PropertyProviderCollection.builder()
.add(matter(MatterProperty.Matter.SOLID))
.add(flammable(false))
.add(hardness(1.0))
.add(blastResistance(5.0))
.add(lightEmission(0))
.add(passable(false))
.add(gravityAffected(false))
.add(unbreakable(false))
.add(replaceable(false))
.add(surrogateBlock(false))
.add(statisticsTracked(true))
.add(solidMaterial(true))
.build();
public static final PropertyProviderCollection PASSABLE = PropertyProviderCollection.builder()
.add(passable(true))
.add(solidCube(false))
.add(solidSide(false))
.add(solidMaterial(false))
.build();
public static final PropertyProviderCollection UNBREAKABLE = PropertyProviderCollection.builder()
.add(unbreakable(true))
.add(hardness(-1.0))
.add(blastResistance(6000000.0))
.add(statisticsTracked(false))
.build();
public static final PropertyProviderCollection INSTANT_BROKEN = PropertyProviderCollection.builder()
.add(hardness(0.0))
.add(blastResistance(0.0))
.build();
public static final PropertyProviderCollection DEFAULT_GAS = DEFAULT.toBuilder()
.add(matter(MatterProperty.Matter.GAS))
.add(solidMaterial(false))
.add(replaceable(true))
.add(PASSABLE)
.build();
public static final PropertyProviderCollection DEFAULT_LIQUID = DEFAULT.toBuilder()
.add(matter(MatterProperty.Matter.LIQUID))
.add(solidMaterial(false))
.add(replaceable(true))
.add(PASSABLE)
.build();
private PropertyProviderCollections() {
}
}
|
[
"seppevolkaerts@hotmail.com"
] |
seppevolkaerts@hotmail.com
|
93d27546c14c27cbb442af1f25c062c3bc2db27d
|
5e7bc3cbaceaba8be2cb9de951198c5283844173
|
/components/data/MongodbData/src/main/java/com/fast/dev/data/mongo/config/converts/Decimal128ToBigDecimalConverter.java
|
ebb5c375ffab9eadd83dcb0e799c1bed15018e58
|
[] |
no_license
|
lianshufeng/Fast
|
abbb162db05b4b0ece3db60a7eea0c38c686462a
|
0b29400c2ec88db033729e9dd645db9aa792d06f
|
refs/heads/master
| 2022-07-08T23:30:13.190635
| 2021-05-26T05:41:10
| 2021-05-26T05:41:10
| 130,854,753
| 9
| 1
| null | 2022-06-25T07:26:27
| 2018-04-24T12:58:53
|
Java
|
UTF-8
|
Java
| false
| false
| 596
|
java
|
package com.fast.dev.data.mongo.config.converts;
import org.bson.types.Decimal128;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.convert.ReadingConverter;
import org.springframework.data.convert.WritingConverter;
import java.math.BigDecimal;
@ReadingConverter
@WritingConverter
public class Decimal128ToBigDecimalConverter implements Converter<Decimal128, BigDecimal> {
public BigDecimal convert(Decimal128 decimal128) {
return decimal128.bigDecimalValue();
}
}
|
[
"251708339@qq.com"
] |
251708339@qq.com
|
b18f2825a550ed991a57735a90af9b32d1f5e4fe
|
7f20b1bddf9f48108a43a9922433b141fac66a6d
|
/core3/impl/tags/impl-parent-3.0.0-alpha8/editor-impl/src/main/java/org/cytoscape/editor/internal/SIFInterpreterTaskFactory.java
|
a16bb3e59bce2d4a8dedb5440a05d48bb0f17f58
|
[] |
no_license
|
ahdahddl/cytoscape
|
bf783d44cddda313a5b3563ea746b07f38173022
|
a3df8f63dba4ec49942027c91ecac6efa920c195
|
refs/heads/master
| 2020-06-26T16:48:19.791722
| 2013-08-28T04:08:31
| 2013-08-28T04:08:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 393
|
java
|
package org.cytoscape.editor.internal;
import org.cytoscape.view.model.CyNetworkView;
import org.cytoscape.task.AbstractNetworkViewTaskFactory;
import org.cytoscape.work.TaskIterator;
public class SIFInterpreterTaskFactory extends AbstractNetworkViewTaskFactory {
public TaskIterator createTaskIterator(CyNetworkView view) {
return new TaskIterator(new SIFInterpreterTask(view));
}
}
|
[
"mes@0ecc0d97-ab19-0410-9704-bfe1a75892f5"
] |
mes@0ecc0d97-ab19-0410-9704-bfe1a75892f5
|
bbe0b64eac08d5832c13cf1e4296db06204b2f5b
|
863acb02a064a0fc66811688a67ce3511f1b81af
|
/sources/p005cm/aptoide/p006pt/home/apps/C3561Lb.java
|
89a8a6d875f3492bf81ef3b10f000a6ea031d315
|
[
"MIT"
] |
permissive
|
Game-Designing/Custom-Football-Game
|
98d33eb0c04ca2c48620aa4a763b91bc9c1b7915
|
47283462b2066ad5c53b3c901182e7ae62a34fc8
|
refs/heads/master
| 2020-08-04T00:02:04.876780
| 2019-10-06T06:55:08
| 2019-10-06T06:55:08
| 211,914,568
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 526
|
java
|
package p005cm.aptoide.p006pt.home.apps;
import p005cm.aptoide.p006pt.presenter.View.LifecycleEvent;
import p026rx.p027b.C0132p;
/* renamed from: cm.aptoide.pt.home.apps.Lb */
/* compiled from: lambda */
public final /* synthetic */ class C3561Lb implements C0132p {
/* renamed from: a */
public static final /* synthetic */ C3561Lb f6944a = new C3561Lb();
private /* synthetic */ C3561Lb() {
}
public final Object call(Object obj) {
return AppsPresenter.m8333q((LifecycleEvent) obj);
}
}
|
[
"tusharchoudhary0003@gmail.com"
] |
tusharchoudhary0003@gmail.com
|
e6c9cfb62ffbdda8e570945f9874f6924089bf22
|
5ff89b7046345aebe64d71d0a283e5eb3b954067
|
/poreskauprava/src/main/java/rs/edu/raf/poreskauprava/domain/dto/rate/interest/InterestRateRequestDTO.java
|
c4a197608e4624c02414f096b5c65e330d2e640a
|
[] |
no_license
|
igoricelic/university_frontend
|
a8f993aa5c2c5261f151caf7d7bdfc4d94bcdd25
|
d88cc2a10eead771f03e07ac64dae6d69cc8c8a8
|
refs/heads/master
| 2021-06-06T12:54:31.975183
| 2019-05-30T22:18:13
| 2019-05-30T22:18:13
| 156,462,663
| 0
| 0
| null | 2021-06-04T01:59:12
| 2018-11-06T23:32:02
|
Java
|
UTF-8
|
Java
| false
| false
| 342
|
java
|
package rs.edu.raf.poreskauprava.domain.dto.rate.interest;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class InterestRateRequestDTO {
private Long id;
private int year;
private double percentage;
}
|
[
"igoricelic@outlook.com"
] |
igoricelic@outlook.com
|
a6d5812a28108ca03b2939e6d309687abae03012
|
5923c5f7eeec75bf81d3f150a95dfa84e089447f
|
/HocOOP_Enum/src/kyna/vn/model/SinhVien.java
|
8f41c89fde6caa9c27caf6d1dcbf3aaacd7cff49
|
[] |
no_license
|
taidangit/laptrinhjava-tranduythanh
|
100b0cd6e325d40bf2f1bb7c71ef68aedb400e70
|
8af741164f7b51b2467e316841003474c5fe20f0
|
refs/heads/master
| 2020-11-24T21:42:18.675103
| 2019-12-16T09:41:13
| 2019-12-16T09:42:40
| 228,351,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 922
|
java
|
package kyna.vn.model;
public class SinhVien {
private int ma;
private String ten;
private double diemTB;
private XepLoai loai;
public SinhVien(int ma, String ten, double diemTB) {
super();
this.ma = ma;
this.ten = ten;
this.diemTB = diemTB;
this.loai= getLoai();
}
public int getMa() {
return ma;
}
public void setMa(int ma) {
this.ma = ma;
}
public String getTen() {
return ten;
}
public void setTen(String ten) {
this.ten = ten;
}
public double getDiemTB() {
return diemTB;
}
public void setDiemTB(double diemTB) {
this.diemTB = diemTB;
}
public XepLoai getLoai() {
if(this.diemTB>=8) {
loai=XepLoai.Gioi;
} else if(this.diemTB>=6.5) {
loai=XepLoai.Kha;
} else if(this.diemTB>=5) {
loai=XepLoai.TrungBinh;
} else {
loai=XepLoai.Yeu;
}
return loai;
}
@Override
public String toString() {
return ma+"-"+ten+"-"+diemTB+"=>"+loai.description();
}
}
|
[
"dangphattai92@gmail.com"
] |
dangphattai92@gmail.com
|
4596065efa438221ed95dc19850c41a330eec793
|
377e2482b6ac2f0264f85e8ba8d506c449abca78
|
/src/test/java/com/mayh/blog/UnitTest.java
|
9590803ac57fb7d018b72322b579277dd017b7e2
|
[] |
no_license
|
ITrover/MyBlog
|
432a623a9dcd433d127feb6392a6635f9717a827
|
2224c22047707df9964825b05917135b867979f5
|
refs/heads/master
| 2022-07-14T09:18:49.858616
| 2019-12-03T13:27:05
| 2019-12-03T13:27:05
| 220,793,792
| 4
| 1
| null | 2022-06-21T02:22:03
| 2019-11-10T13:26:28
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 2,279
|
java
|
package com.mayh.blog;
import com.mayh.blog.po.Comment;
import com.mayh.blog.service.CommentService;
import com.mayh.blog.service.CommentServiceImpl;
import com.mayh.blog.utils.MarkdownUtil;
import com.mayh.blog.utils.TitleExtract;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;
import javax.swing.*;
import java.util.List;
@SpringBootTest
public class UnitTest {
@Autowired
private CommentService commentService;
@Test
public void test() {
String s = MarkdownUtil.markdown2Html("找出必要信息,拆分成小的信息列表(原子性数据),使易于查询\n" +
"\n" +
"原子性数据 #规则一 具有原子性数据的列中不会有多个类型相同的值 #规则二 具有原子性数据的表中不会有多个储存同类型的列\n" +
"\n" +
"#第一范式1NF FIRST NORMAL FORM 使用主键 人造主键 自然主键 规则 1.主键独一无 二。 2.创建记录时必须插入主键的值,主键不能为NULL。 3.主键不可以更改。\n" +
"\n" +
"#取得原来建表的SQL语句 SHOW CREATE TABLE MY_TABLE; //会有反撇号 SQL用于辨别列名,可以直接使用 #SHOW 的作用 SHOW COLUMNS FROM tablename //查看所有列 SHOW CRATE DATABASE databasename SHOW INDEX FROM tablename SHOW WARNINGS //取得确切的警告内容\n" +
"\n" +
"#添加主键 PRIMARY KEY (列名)\n" +
"\n" +
"#自动递增 AUTO_INCREMENT\n" +
"\n" +
"#ALTER ALTER TABLE tablename ADD COLUMN ......... //用于为现有的表添加新的列");
System.out.println(s);
}
@Test
public void test01() {
String s = "[wang[li]";
String[] split = s.split("\\[|\\]");
for (int i = 0; i < split.length; i++) {
System.out.println(split[i]);
}
}
@Test
public void CommentMethod() {
}
}
|
[
"1172610139@qq.com"
] |
1172610139@qq.com
|
df810ae8e41fc2b17edb3e47768690af0b8ebc77
|
17d8ee15e180b01846c8cb95605ee5afa152dcc8
|
/app/src/main/java/net/msonic/testsyncdata/sync/SyncService.java
|
db52148b1b250520516d0cdeb30c45a21167665e
|
[] |
no_license
|
mzegarras/SyncDataAndroid
|
25b891fefc798ba2afbf8f718b8512c067b08b4e
|
5a435eae2095c65efbd054c37543526d82f6bf2c
|
refs/heads/master
| 2021-01-10T06:56:31.499190
| 2016-02-28T15:27:54
| 2016-02-28T15:27:54
| 51,570,068
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 829
|
java
|
package net.msonic.testsyncdata.sync;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;
import net.msonic.testsyncdata.CustomApplication;
import net.msonic.testsyncdata.sync.adapters.SyncAdapter;
import javax.inject.Inject;
/**
* Created by User01 on 25/02/2016.
*/
public class SyncService extends Service {
@Inject
SyncAdapter syncAdapter;
// Object to use as a thread-safe lock
private static final Object syncAdapterLock = new Object();
@Override
public void onCreate() {
super.onCreate();
((CustomApplication) getApplication()).getDiComponent().inject(this);
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
return syncAdapter.getSyncAdapterBinder();
}
}
|
[
"mzegarra@gmail.com"
] |
mzegarra@gmail.com
|
1536b09715e91301a9e01a2a6a760c92b5b4b6e4
|
6cc9ab5ae97de3bc9298737baeddd0c80ca16661
|
/src/main/java/mariculture/core/helpers/MirrorHelper.java
|
dce5f61f1647f0878554f447c18988a09beca796
|
[
"MIT"
] |
permissive
|
mymagadsl/Mariculture
|
099f89aa75cec949a2d247e037cf4c36f856d197
|
4ac1db6828d078e5fcc55538663917edfe567b4f
|
refs/heads/master
| 2021-01-15T15:16:12.670933
| 2014-02-27T12:16:30
| 2014-02-27T12:16:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,075
|
java
|
package mariculture.core.helpers;
import org.apache.logging.log4j.Level;
import mariculture.core.handlers.LogHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
public class MirrorHelper {
private static final MirrorHelper INSTANCE = new MirrorHelper();
public static MirrorHelper instance() {
return INSTANCE;
}
public ItemStack[] get(EntityPlayer player) {
if (!player.worldObj.isRemote) {
NBTTagCompound loader = player.getEntityData().getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG);
NBTTagList nbttaglist = loader.getTagList("mirrorContents", 10);
if (nbttaglist != null) {
ItemStack[] mirrorContents = new ItemStack[4];
for (int i = 0; i < nbttaglist.tagCount(); i++) {
NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.getCompoundTagAt(i);
byte byte0 = nbttagcompound1.getByte("Slot");
if (byte0 >= 0 && byte0 < mirrorContents.length) {
mirrorContents[byte0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
}
}
return mirrorContents;
}
}
return new ItemStack[4];
}
public void save(EntityPlayer player, ItemStack[] mirrorContents) {
if (!player.worldObj.isRemote) {
try {
NBTTagList nbttaglist = new NBTTagList();
for (int i = 0; i < 3; i++) {
if (mirrorContents[i] != null) {
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.setByte("Slot", (byte) i);
mirrorContents[i].writeToNBT(nbttagcompound1);
nbttaglist.appendTag(nbttagcompound1);
}
}
if (!player.getEntityData().hasKey(EntityPlayer.PERSISTED_NBT_TAG)) {
player.getEntityData().setTag(EntityPlayer.PERSISTED_NBT_TAG, new NBTTagCompound());
}
player.getEntityData().getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG).setTag("mirrorContents", nbttaglist);
} catch (Exception e) {
LogHandler.log(Level.WARN, "Mariculture had trouble saving Mirror Contents for " + player.getDisplayName());
}
}
}
}
|
[
"joshjackwildman@gmail.com"
] |
joshjackwildman@gmail.com
|
921d999a8d109c03ce85c8339e94bcaa6c351475
|
6811fd178ae01659b5d207b59edbe32acfed45cc
|
/jira-project/jira-components/jira-core/src/main/java/com/atlassian/jira/web/filters/gzip/JiraGzipFilter.java
|
ab3868ea59978685ec78db420385e76a9dbf722f
|
[] |
no_license
|
xiezhifeng/mysource
|
540b09a1e3c62614fca819610841ddb73b12326e
|
44f29e397a6a2da9340a79b8a3f61b3d51e331d1
|
refs/heads/master
| 2023-04-14T00:55:23.536578
| 2018-04-19T11:08:38
| 2018-04-19T11:08:38
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,633
|
java
|
/*
* Copyright (c) 2002-2007
* All rights reserved.
*/
package com.atlassian.jira.web.filters.gzip;
import java.io.IOException;
import com.atlassian.gzipfilter.GzipFilter;
import com.atlassian.gzipfilter.integration.GzipFilterIntegration;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.config.properties.APKeys;
import org.apache.log4j.Logger;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import static com.atlassian.jira.config.CoreFeatures.ON_DEMAND;
public class JiraGzipFilter extends GzipFilter
{
private static final Logger log = Logger.getLogger(JiraGzipFilter.class);
private static final String ALREADY_FILTERED = GzipFilter.class.getName() + "_already_filtered";
public JiraGzipFilter()
{
super(createGzipIntegration());
}
@Override
public void doFilter(final ServletRequest req, final ServletResponse res, final FilterChain chain)
throws IOException, ServletException
{
/**
*
* JRADEV-21029 : when an error occurs, there is made an internal redirection but request stays the same.
*
* This behaviour causes a situation when request is already marked as filtered with gzip filter, but response
* content is actually not gzipped.
* From the browser point of view it looks like corrupted content (header "Content-Encoding: gzip"
* with plain-text content )
*
* Here we are detecting that an error occured and un-marking filter as applied
*
*/
//
if ( req.getAttribute("javax.servlet.error.request_uri") != null && req.getAttribute(ALREADY_FILTERED) != null){
req.setAttribute(ALREADY_FILTERED, null);
}
super.doFilter(req, res, chain);
}
private static GzipFilterIntegration createGzipIntegration()
{
if (ON_DEMAND.isSystemPropertyEnabled())
{
return new JiraOnDemandGzipFilterIntegration();
}
return new JiraGzipFilterIntegration();
}
private static class JiraGzipFilterIntegration implements GzipFilterIntegration
{
public boolean useGzip()
{
try
{
// normally we would use GzipCompression here, but if we do that then we end up deadlocking inside
// ComponentAccessor when a web request comes in and JIRA is being restarted after XML import. sooooo,
// instead we do a bit of copy & paste to achieve the same effect.
//
// basically I fought the ComponentAccessor and the ComponentAccessor won.
return ComponentAccessor.getApplicationProperties().getOption(APKeys.JIRA_OPTION_WEB_USEGZIP);
}
catch (RuntimeException e)
{
log.debug("Cannot get application properties, defaulting to no GZip compression");
return false;
}
}
public String getResponseEncoding(HttpServletRequest httpServletRequest)
{
return ComponentAccessor.getApplicationProperties().getEncoding();
}
}
/**
* Forces GZIP to off in OnDemand: the content will be GZIPed by our proxy before it leave DC.
*/
private static class JiraOnDemandGzipFilterIntegration extends JiraGzipFilterIntegration
{
@Override
public boolean useGzip()
{
return false;
}
}
}
|
[
"moink635@gmail.com"
] |
moink635@gmail.com
|
9197ef8a6df02754b951f305b68df9298a7748a7
|
5741045375dcbbafcf7288d65a11c44de2e56484
|
/reddit-decompilada/com/instabug/survey/cache/SurveysCacheManager.java
|
f4a25676e554338aab6a2f24b6ff5c8dfa753b67
|
[] |
no_license
|
miarevalo10/ReporteReddit
|
18dd19bcec46c42ff933bb330ba65280615c281c
|
a0db5538e85e9a081bf268cb1590f0eeb113ed77
|
refs/heads/master
| 2020-03-16T17:42:34.840154
| 2018-05-11T10:16:04
| 2018-05-11T10:16:04
| 132,843,706
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,970
|
java
|
package com.instabug.survey.cache;
import com.instabug.library.internal.storage.cache.Cache;
import com.instabug.library.internal.storage.cache.CacheManager;
import com.instabug.library.internal.storage.cache.CacheManager.KeyExtractor;
import com.instabug.library.internal.storage.cache.InMemoryCache;
import com.instabug.library.util.InstabugSDKLogger;
import com.instabug.survey.p027a.C1413c;
import java.util.ArrayList;
import java.util.List;
public class SurveysCacheManager {
public static final String SURVEYS_DISK_CACHE_FILE_NAME = "/surveys.cache";
public static final String SURVEYS_DISK_CACHE_KEY = "surveys_disk_cache";
public static final String SURVEYS_MEMORY_CACHE_KEY = "surveys_memory_cache";
static class C14151 extends KeyExtractor<Long, C1413c> {
C14151() {
}
public final /* synthetic */ Object extractKey(Object obj) {
return Long.valueOf(((C1413c) obj).f15571a);
}
}
static class C14162 extends KeyExtractor<String, C1413c> {
C14162() {
}
public final /* synthetic */ Object extractKey(Object obj) {
return String.valueOf(((C1413c) obj).f15571a);
}
}
public static InMemoryCache<Long, C1413c> getCache() throws IllegalArgumentException {
if (!CacheManager.getInstance().cacheExists(SURVEYS_MEMORY_CACHE_KEY)) {
StringBuilder stringBuilder = new StringBuilder("In-memory Surveys cache not found, loading it from disk ");
stringBuilder.append(CacheManager.getInstance().getCache(SURVEYS_MEMORY_CACHE_KEY));
InstabugSDKLogger.m8356d(SurveysCacheManager.class, stringBuilder.toString());
CacheManager.getInstance().migrateCache(SURVEYS_DISK_CACHE_KEY, SURVEYS_MEMORY_CACHE_KEY, new C14151());
Cache cache = CacheManager.getInstance().getCache(SURVEYS_MEMORY_CACHE_KEY);
if (cache != null) {
StringBuilder stringBuilder2 = new StringBuilder("In-memory Surveys cache restored from disk, ");
stringBuilder2.append(cache.size());
stringBuilder2.append(" elements restored");
InstabugSDKLogger.m8356d(SurveysCacheManager.class, stringBuilder2.toString());
}
}
InstabugSDKLogger.m8356d(SurveysCacheManager.class, "In-memory Surveys cache found");
return (InMemoryCache) CacheManager.getInstance().getCache(SURVEYS_MEMORY_CACHE_KEY);
}
public static void saveCacheToDisk() {
Cache cache = CacheManager.getInstance().getCache(SURVEYS_DISK_CACHE_KEY);
Cache cache2 = CacheManager.getInstance().getCache(SURVEYS_MEMORY_CACHE_KEY);
if (cache != null && cache2 != null) {
CacheManager.getInstance().migrateCache(cache2, cache, new C14162());
}
}
public static void addSurvey(C1413c c1413c) {
InMemoryCache cache = getCache();
if (cache != null) {
cache.put(Long.valueOf(c1413c.f15571a), c1413c);
}
}
public static void addSurveys(List<C1413c> list) {
for (C1413c addSurvey : list) {
addSurvey(addSurvey);
}
}
public static List<C1413c> getSurveys() {
InMemoryCache cache = getCache();
if (cache != null) {
return cache.getValues();
}
return new ArrayList();
}
public static List<C1413c> getNotAnsweredSurveys() {
List<C1413c> arrayList = new ArrayList();
InMemoryCache cache = getCache();
if (cache != null) {
for (C1413c c1413c : cache.getValues()) {
if ((c1413c.f15572b == null || String.valueOf(c1413c.f15572b).equals("null")) && !c1413c.f15578h) {
arrayList.add(c1413c);
StringBuilder stringBuilder = new StringBuilder("survey id: ");
stringBuilder.append(c1413c.f15571a);
InstabugSDKLogger.m8356d(SurveysCacheManager.class, stringBuilder.toString());
}
}
}
StringBuilder stringBuilder2 = new StringBuilder("NotAnsweredSurveys size: ");
stringBuilder2.append(arrayList.size());
InstabugSDKLogger.m8356d(SurveysCacheManager.class, stringBuilder2.toString());
return arrayList;
}
public static List<C1413c> getAnsweredAndNotSubmittedSurveys() {
List<C1413c> arrayList = new ArrayList();
InMemoryCache cache = getCache();
if (cache != null) {
List<C1413c> values = cache.getValues();
StringBuilder stringBuilder = new StringBuilder("size: ");
stringBuilder.append(values.size());
InstabugSDKLogger.m8356d(SurveysCacheManager.class, stringBuilder.toString());
for (C1413c c1413c : values) {
if (c1413c.f15578h && !c1413c.f15579i) {
arrayList.add(c1413c);
}
}
}
return arrayList;
}
}
|
[
"mi.arevalo10@uniandes.edu.co"
] |
mi.arevalo10@uniandes.edu.co
|
c835be40310d40525e5dff4dc0abad5c98be581c
|
e0d52bbf5d1b657afb07795bf456e8e680302980
|
/Educ/DesignPattern-Facade/src/first/History.java
|
8f2b5c9de6eb974b597c987c5e883e436777391e
|
[] |
no_license
|
youp911/modelibra
|
acc391da16ab6b14616cd7bda094506a05414b0f
|
00387bd9f1f82df3b7d844650e5a57d2060a2ec7
|
refs/heads/master
| 2021-01-25T09:59:19.388394
| 2011-11-24T21:46:26
| 2011-11-24T21:46:26
| 42,008,889
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 926
|
java
|
package first;
import java.util.ArrayList;
public class History implements IHistory {
private ArrayList<IAction> actions = new ArrayList<IAction>();
private int cursor = 0;
public void add(IAction action) {
if (!actions.contains(action)) {
removeRightOfCursor();
actions.add(action);
moveCursorForward();
}
}
public boolean undo() {
boolean undone = false;
if (actions.size() > 0) {
moveCursorBackward();
Action action = (Action) actions.get(cursor);
if (action.getStatus().equals("executed") && action.undo()) {
undone = true;
}
}
return undone;
}
private void removeRightOfCursor() {
for (int i = actions.size() - 1; i >= cursor; i--) {
actions.remove(i);
}
}
private void moveCursorForward() {
cursor++;
}
private void moveCursorBackward() {
if (cursor == 0) {
return;
} else {
cursor--;
}
}
}
|
[
"dzenanr@c25eb2fc-9753-11de-83f8-39e71e4dc75d"
] |
dzenanr@c25eb2fc-9753-11de-83f8-39e71e4dc75d
|
300c5dc7562757ebdf00ce40ebe3ef45798ecd16
|
8a8254c83cc2ec2c401f9820f78892cf5ff41384
|
/baseline/Travel-Mate/Android/app/src/main/java/baseline/io/github/project_travel_mate/roompersistence/ViewModelFactory.java
|
cb00add2dfb1e7bfff80ea653620316d2487fbe9
|
[
"MIT"
] |
permissive
|
VU-Thesis-2019-2020-Wesley-Shann/subjects
|
46884bc6f0f9621be2ab3c4b05629e3f6d3364a0
|
14a6d6bb9740232e99e7c20f0ba4ddde3e54ad88
|
refs/heads/master
| 2022-12-03T05:52:23.309727
| 2020-08-19T12:18:54
| 2020-08-19T12:18:54
| 261,718,101
| 0
| 0
| null | 2020-07-11T12:19:07
| 2020-05-06T09:54:05
|
Java
|
UTF-8
|
Java
| false
| false
| 761
|
java
|
package baseline.io.github.project_travel_mate.roompersistence;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import androidx.annotation.NonNull;
/**
* Factory for ViewModels
*/
public class ViewModelFactory implements ViewModelProvider.Factory {
private final ChecklistDataSource mDataSource;
public ViewModelFactory(ChecklistDataSource dataSource) {
mDataSource = dataSource;
}
@NonNull
@Override
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
if (modelClass.isAssignableFrom(ChecklistViewModel.class)) {
return (T) new ChecklistViewModel(mDataSource);
}
throw new IllegalArgumentException("Unknown ViewModel class");
}
}
|
[
"sshann95@outlook.com"
] |
sshann95@outlook.com
|
8a8b1c06ec9acbeb93edca377bf428e5383db45f
|
c57a87dbf4d0f2b51ad3c22f40c5a88c79e828ce
|
/MyAide/okhttputils/src/main/java/com/zhy/http/okhttp/log/LoggerInterceptor.java
|
1e647d9706dfd2cfd28a4e66f6632a6a5246f173
|
[
"Apache-2.0"
] |
permissive
|
a616707902/aide
|
bc46aebfa8a4882ba218e31d7764ff43d1a6cf8b
|
c7ee14aa939cc88c67eedf9409d3fbf688148a0a
|
refs/heads/master
| 2021-01-20T00:47:08.915471
| 2017-10-16T01:13:17
| 2017-10-16T01:13:17
| 89,188,299
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,226
|
java
|
package com.zhy.http.okhttp.log;
import android.text.TextUtils;
import android.util.Log;
import java.io.IOException;
import okhttp3.Headers;
import okhttp3.Interceptor;
import okhttp3.MediaType;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
import okio.Buffer;
/**
* Created by zhy on 16/3/1.
*/
public class LoggerInterceptor implements Interceptor
{
public static final String TAG = "OkHttpUtils";
private String tag;
private boolean showResponse;
public LoggerInterceptor(String tag, boolean showResponse)
{
if (TextUtils.isEmpty(tag))
{
tag = TAG;
}
this.showResponse = showResponse;
this.tag = tag;
}
public LoggerInterceptor(String tag)
{
this(tag, false);
}
@Override
public Response intercept(Chain chain) throws IOException
{
Request request = chain.request();
logForRequest(request);
Response response = chain.proceed(request);
return logForResponse(response);
}
private Response logForResponse(Response response)
{
try
{
//===>response log
Log.e(tag, "========response'log=======");
Response.Builder builder = response.newBuilder();
Response clone = builder.build();
Log.e(tag, "url : " + clone.request().url());
Log.e(tag, "code : " + clone.code());
Log.e(tag, "protocol : " + clone.protocol());
if (!TextUtils.isEmpty(clone.message()))
Log.e(tag, "message : " + clone.message());
if (showResponse)
{
ResponseBody body = clone.body();
if (body != null)
{
MediaType mediaType = body.contentType();
if (mediaType != null)
{
Log.e(tag, "responseBody's contentType : " + mediaType.toString());
if (isText(mediaType))
{
String resp = body.string();
Log.e(tag, "responseBody's content : " + resp);
body = ResponseBody.create(mediaType, resp);
return response.newBuilder().body(body).build();
} else
{
Log.e(tag, "responseBody's content : " + " maybe [file part] , too large too print , ignored!");
}
}
}
}
Log.e(tag, "========response'log=======end");
} catch (Exception e)
{
// e.printStackTrace();
}
return response;
}
private void logForRequest(Request request)
{
try
{
String url = request.url().toString();
Headers headers = request.headers();
Log.e(tag, "========request'log=======");
Log.e(tag, "method : " + request.method());
Log.e(tag, "url : " + url);
if (headers != null && headers.size() > 0)
{
Log.e(tag, "headers : " + headers.toString());
}
RequestBody requestBody = request.body();
if (requestBody != null)
{
MediaType mediaType = requestBody.contentType();
if (mediaType != null)
{
Log.e(tag, "requestBody's contentType : " + mediaType.toString());
if (isText(mediaType))
{
Log.e(tag, "requestBody's content : " + bodyToString(request));
} else
{
Log.e(tag, "requestBody's content : " + " maybe [file part] , too large too print , ignored!");
}
}
}
Log.e(tag, "========request'log=======end");
} catch (Exception e)
{
// e.printStackTrace();
}
}
private boolean isText(MediaType mediaType)
{
if (mediaType.type() != null && mediaType.type().equals("text"))
{
return true;
}
if (mediaType.subtype() != null)
{
if (mediaType.subtype().equals("json") ||
mediaType.subtype().equals("xml") ||
mediaType.subtype().equals("html") ||
mediaType.subtype().equals("webviewhtml")
)
return true;
}
return false;
}
private String bodyToString(final Request request)
{
try
{
final Request copy = request.newBuilder().build();
final Buffer buffer = new Buffer();
copy.body().writeTo(buffer);
return buffer.readUtf8();
} catch (final IOException e)
{
return "something error when show requestBody.";
}
}
}
|
[
"616707902@qq.com"
] |
616707902@qq.com
|
b2c94c0fc983042fbffc982ecc0702eb108d0133
|
a4971405f6dc5cd4b872737cc4632fbedd8ba255
|
/src/com/stimasoft/obiectivecva/adapters/AutoCompleteBenefAdapter.java
|
9d1d92641dc66948981d905d2d43a92302a8ceb2
|
[] |
no_license
|
florin-b/OCVPRD
|
c5c92eb4971938bed35deeeed4811cacae1060dd
|
23e1b9655bd4d2d7e5cb4a346fb295f0292bca7a
|
refs/heads/master
| 2020-07-08T10:33:04.752801
| 2017-03-16T09:29:11
| 2017-03-16T09:29:11
| 66,371,129
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,510
|
java
|
package com.stimasoft.obiectivecva.adapters;
import android.content.Context;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import java.util.List;
/**
* Feeds suggestion information to the beneficiary AutoCompleteTextViews
*/
public class AutoCompleteBenefAdapter extends ArrayAdapter<Pair<Integer, String>> {
public AutoCompleteBenefAdapter(Context context, int resource, List<Pair<Integer, String>> objects) {
super(context, resource, objects);
}
@Override
public View getView(int pos, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(parent.getContext())
.inflate(android.R.layout.simple_dropdown_item_1line, parent, false);
}
TextView nameText = (TextView) convertView.findViewById(android.R.id.text1);
nameText.setText(getItem(pos).second);
return convertView;
}
@Override
public View getDropDownView(int position, View convertView,
ViewGroup parent) {
if (convertView == null) {
convertView = View.inflate(getContext(), android.R.layout.simple_dropdown_item_1line, null);
}
TextView label = (TextView) convertView.findViewById(android.R.id.text1);
label.setText(getItem(position).first);
return label;
}
}
|
[
"gflorinb@yahoo.com"
] |
gflorinb@yahoo.com
|
7015bf2078538f7f8ef87a99f306b59d366c6889
|
42010a3ef8277262c2b9248103af0e4742c96741
|
/src/main/java/part1/_3_bags_queues_and_stacks/InfixToPostfix.java
|
22ff62d6d0ec6e99e406bc302a1edc9f00f6f273
|
[] |
no_license
|
Duelist256/Algorithms4
|
012cb9700bdacb885a463e5c160f957221269a0c
|
ce1863f48b0a558659d9379283057492a7279468
|
refs/heads/master
| 2021-01-22T01:06:12.111703
| 2019-10-10T20:57:57
| 2019-10-10T20:57:57
| 102,199,683
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,769
|
java
|
package part1._3_bags_queues_and_stacks;
import edu.princeton.cs.algs4.Stack;
/**
* 1.3.10 Write a filter InfixToPostfix that converts an arithmetic expression from infix
* to postfix.
**/
public class InfixToPostfix {
public static void main(String[] args) {
System.out.println(convert("1*(2+3*4)+5"));
System.out.println(convert("1*2^3+4"));
System.out.println(convert("1-2+3"));
System.out.println(convert("1*(2+3)"));
System.out.println(convert("1+2*3"));
}
public static String convert(String s) {
String newString = "";
Stack<Character> stack = new Stack<>();
for (int i = 0; i < s.length(); i++) {
char ch = s.charAt(i);
if (Character.isDigit(ch)) {
newString += ch;
}
if (ch == '(') {
stack.push(ch);
}
if (ch == ')') {
while (stack.peek() != '(') {
newString += stack.pop();
}
stack.pop();
}
if (ch == '*' || ch == '/' || ch == '+' || ch == '-' || ch == '^') {
while (!stack.isEmpty() && getPrecendence(ch) <= getPrecendence(stack.peek())) {
newString += stack.pop();
}
stack.push(ch);
}
}
while (!stack.isEmpty()) {
newString += stack.pop();
}
return newString;
}
private static int getPrecendence(char ch) {
if (ch == '^') {
return 2;
}
if (ch == '*' || ch == '/') {
return 1;
}
if (ch == '+' || ch == '-') {
return 0;
}
return -1;
}
}
|
[
"selykov.iw@yandex.ru"
] |
selykov.iw@yandex.ru
|
fc4efa087008fd04ac0132ad233ccf9c8ec62464
|
7e1511cdceeec0c0aad2b9b916431fc39bc71d9b
|
/flakiness-predicter/input_data/original_tests/doanduyhai-Achilles/nonFlakyMethods/info.archinnov.achilles.persistence.PersistenceManagerFactoryTest-should_deserialize_from_json.java
|
43b4e759a9e2d2bf5db7d2b4361a62e2dd32aa5d
|
[
"BSD-3-Clause"
] |
permissive
|
Taher-Ghaleb/FlakeFlagger
|
6fd7c95d2710632fd093346ce787fd70923a1435
|
45f3d4bc5b790a80daeb4d28ec84f5e46433e060
|
refs/heads/main
| 2023-07-14T16:57:24.507743
| 2021-08-26T14:50:16
| 2021-08-26T14:50:16
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 622
|
java
|
@Test public void should_deserialize_from_json() throws Exception {
pmf.configContext=configContext;
ObjectMapper mapper=new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
when(configContext.getMapperFor(CompleteBean.class)).thenReturn(mapper);
final CompleteBean actual=pmf.deserializeJson(CompleteBean.class,"{\"id\":10,\"name\":\"name\"}");
assertThat(actual.getId()).isEqualTo(10L);
assertThat(actual.getName()).isEqualTo("name");
assertThat(actual.getFriends()).isNull();
assertThat(actual.getFollowers()).isNull();
assertThat(actual.getPreferences()).isNull();
}
|
[
"aalsha2@masonlive.gmu.edu"
] |
aalsha2@masonlive.gmu.edu
|
9f23a3407303f200e0c889ad0640b807e1fbb53d
|
44ce357ee9ca8df2f399f7e0fcdf385b7b34c245
|
/src/main/java/org/apache/commons/math3/analysis/function/Expm1.java
|
44f0a852877198880b0c7fba6f58cf5b28903eab
|
[] |
no_license
|
silas1037/SkEye
|
a8712f273e1cadd69e0be7d993963016df227cb5
|
ed0ede814ee665317dab3209b8a33e38df24a340
|
refs/heads/master
| 2023-01-20T20:25:00.940114
| 2020-11-29T04:01:05
| 2020-11-29T04:01:05
| 315,267,911
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,166
|
java
|
package org.apache.commons.math3.analysis.function;
import org.apache.commons.math3.analysis.DifferentiableUnivariateFunction;
import org.apache.commons.math3.analysis.FunctionUtils;
import org.apache.commons.math3.analysis.UnivariateFunction;
import org.apache.commons.math3.analysis.differentiation.DerivativeStructure;
import org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction;
import org.apache.commons.math3.util.FastMath;
public class Expm1 implements UnivariateDifferentiableFunction, DifferentiableUnivariateFunction {
@Override // org.apache.commons.math3.analysis.UnivariateFunction
public double value(double x) {
return FastMath.expm1(x);
}
@Override // org.apache.commons.math3.analysis.DifferentiableUnivariateFunction
@Deprecated
public UnivariateFunction derivative() {
return FunctionUtils.toDifferentiableUnivariateFunction(this).derivative();
}
@Override // org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction
public DerivativeStructure value(DerivativeStructure t) {
return t.expm1();
}
}
|
[
"silas1037@163.com"
] |
silas1037@163.com
|
186bb06c07556a7e5a58f4c88d67816446f1bc33
|
ade60a0cd4d5ce7ce7d3ecc0ca9e1c599219705c
|
/studyappfuse/core/src/main/java/org/yy/dao/hibernate/RoleDaoHibernate.java
|
457bddbf7df5e603474741548d694547023d954d
|
[
"Apache-2.0"
] |
permissive
|
yyitsz/myjavastudio
|
bc7d21ed8ece3eccc07cb0fbc6bbad0be04a7f60
|
f5563d45c36d1a0b0a7ce1f5a360ff6017f068e8
|
refs/heads/master
| 2021-06-11T23:04:43.228001
| 2017-03-24T10:05:27
| 2017-03-24T10:05:27
| 17,080,356
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,083
|
java
|
package org.yy.dao.hibernate;
import org.yy.dao.RoleDao;
import org.yy.model.Role;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* This class interacts with Spring's HibernateTemplate to save/delete and
* retrieve Role objects.
*
* @author <a href="mailto:bwnoll@gmail.com">Bryan Noll</a>
*/
@Repository
public class RoleDaoHibernate extends GenericDaoHibernate<Role, Long> implements RoleDao {
/**
* Constructor to create a Generics-based version using Role as the entity
*/
public RoleDaoHibernate() {
super(Role.class);
}
/**
* {@inheritDoc}
*/
public Role getRoleByName(String rolename) {
List roles = getHibernateTemplate().find("from Role where name=?", rolename);
if (roles.isEmpty()) {
return null;
} else {
return (Role) roles.get(0);
}
}
/**
* {@inheritDoc}
*/
public void removeRole(String rolename) {
Object role = getRoleByName(rolename);
getHibernateTemplate().delete(role);
}
}
|
[
"yyitsz@163.com"
] |
yyitsz@163.com
|
ff600866ad54143d3e86355da0a8e78aa2eaae50
|
e0ce8cb64702eccce7f6940d283bc93e8f632745
|
/tags/1.1/src/org/jajim/modelo/conversaciones/ParticipantesListener.java
|
304e3d2b5cb02b5ff00ae7ce53b899dd491f7dd6
|
[] |
no_license
|
BackupTheBerlios/jajim-svn
|
5842b35027d995358e605fbd2c5b61dc2b6f7e80
|
7fa2082094decb25e7765aaaebd611c418676f07
|
refs/heads/master
| 2021-01-01T17:56:36.627562
| 2013-12-06T20:16:30
| 2013-12-06T20:16:30
| 40,748,648
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,222
|
java
|
/*
Jabber client.
Copyright (C) 2010 Florencio Cañizal Calles
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.jajim.modelo.conversaciones;
import java.util.Observable;
import java.util.Observer;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.util.StringUtils;
/**
* @author Florencio Cañizal Calles
* @version 1.1
* Clase oyente que escucha los eventos de adición a un chat multiusurario proce
* dentes del servidor.
*/
public class ParticipantesListener extends Observable implements PacketListener{
private String nickPropio;
private String nick;
private String usuario;
/**
* Constructor de la clase. Iniciliza las variables necesarias.
* @param observador El observador que será notificado de los eventos produci
* dos.
*/
public ParticipantesListener(Observer observador){
this.addObserver(observador);
}
/**
* Método que se ejecuta cuando se recibe un paquete que informa de que un
* usuario se ha conectado a nuestro chat multiusuario.
* @param packet El paquete que confirma el evento.
*/
@Override
public void processPacket(Packet packet){
// Recuperar el nick del usuario
usuario = packet.getFrom();
nick = StringUtils.parseResource(usuario);
// Si es nuestro nick abortar la operación.
if(nick.compareTo(nickPropio) == 0) {
return;
}
// Si el paquete no es de desconexión.
if(packet.toString().compareTo("unavailable") != 0){
// Notificar a los oyentes que un usuario se ha añadido a la sala.
this.setChanged();
this.notifyObservers(EventosConversacionEnumeracion.participanteAñadido);
}else{
// Notificar a los oyentes que un usuario se ha desconectado de la sala.
this.setChanged();
this.notifyObservers(EventosConversacionEnumeracion.participanteDesconectado);
}
}
/**
* Método que actualiza el valor del atributo nickPropio.
* @param nickPropio El nuevo valor para el atributo.
*/
public void setNickPropio(String nickPropio){
this.nickPropio = nickPropio;
}
/**
* Retorna el valor del atributo nick.
* @return El valor del atributo nick.
*/
public String getNick(){
return nick;
}
/**
* Retorna el valor del atributo usuario.
* @return El valor del atributo usuario.
*/
public String getUsuario(){
return usuario;
}
}
|
[
"npi83@66271abf-8d89-0410-bfa2-80b8d0f357ea"
] |
npi83@66271abf-8d89-0410-bfa2-80b8d0f357ea
|
3b808e7e1c644f2ffaa1a60120f459f289271bfc
|
d11080f6d8f7cd69d6630af2a31be7f0b37941ec
|
/app/src/main/java/com/v/imagecache/Cache/MemoryCacheUtil.java
|
96e3e34914dc5ed7c60b5cc5ebd6ec0887f59cae
|
[] |
no_license
|
zhangqifan1/ImageCache
|
5411db753ff3618619fabb5a7a24a5cdd821b016
|
9e5123fc570c8c6a2efb98046251e9cfa1ef90d0
|
refs/heads/master
| 2021-05-06T21:03:37.331860
| 2017-11-29T06:12:36
| 2017-11-29T06:12:36
| 112,434,655
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,400
|
java
|
package com.v.imagecache.Cache;
import android.graphics.Bitmap;
import android.util.LruCache;
import java.util.LinkedHashMap;
/**
* Created by Administrator on 2017/11/28.
*/
public class MemoryCacheUtil {
private LruCache<String,Bitmap> mLruCache;
public MemoryCacheUtil() {
//获取最大的可用内存
long maxMemory = Runtime.getRuntime().maxMemory()/8;
mLruCache=new LruCache<String, Bitmap>((int) maxMemory){
@Override
protected int sizeOf(String key, Bitmap value) {
//重写此方法来衡量每张图片的大小 默认返回图片数量
int byteCount = value.getByteCount();
return byteCount;
}
};
}
/**
* 通过url从内存中获取图片
* @param url
*/
public Bitmap getBitmapFromMemory(String url){
Bitmap bitmap = mLruCache.get(url);
return bitmap;
}
/**
* 设置Bitmap到内存
* @param url
* @param bitmap
*/
public void setBitmapToMemory(String url,Bitmap bitmap){
//集合中没有 那就放进去
if(getBitmapFromMemory(url)==null){
mLruCache.put(url,bitmap);
}
}
/**
* 从缓存中删除指定的Key
* @param key
*/
public void removeBitmapFromMemory(String key){
mLruCache.remove(key);
}
}
|
[
"852780161@qq.com"
] |
852780161@qq.com
|
b77748f1adad54bfd95fbffda3217191c948dded
|
cbc61ffb33570a1bc55bb1e754510192b0366de2
|
/ole-app/olefs/src/main/java/org/kuali/ole/pdp/util/PdpPaymentDetailQuestionCallback.java
|
f9423c14e004c6df2a2b719b42681c84ed80e9f1
|
[
"ECL-2.0"
] |
permissive
|
VU-libtech/OLE-INST
|
42b3656d145a50deeb22f496f6f430f1d55283cb
|
9f5efae4dfaf810fa671c6ac6670a6051303b43d
|
refs/heads/master
| 2021-07-08T11:01:19.692655
| 2015-05-15T14:40:50
| 2015-05-15T14:40:50
| 24,459,494
| 1
| 0
|
ECL-2.0
| 2021-04-26T17:01:11
| 2014-09-25T13:40:33
|
Java
|
UTF-8
|
Java
| false
| false
| 1,319
|
java
|
/*
* Copyright 2008 The Kuali Foundation
*
* Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
*
* 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.kuali.ole.pdp.util;
import org.kuali.rice.kim.api.identity.Person;
/**
* PDP PaymentDetail Question Callback defines a callback method for post processing handling in the question interface.
*/
public interface PdpPaymentDetailQuestionCallback {
/**
* Hooks for performing different actions on payment detail after a question has been performed.
*
* @param paymentDetailId the id of the payment
* @param note a note from the user
* @param user the user that perfoms the action
* @return true if succesful, false otherwise
*/
public boolean doPostQuestion(int paymentDetailId, String note, Person user);
}
|
[
"david.lacy@villanova.edu"
] |
david.lacy@villanova.edu
|
0d3b9fbd821d21f1173b52ee7b7f49b8e8f8ad29
|
e3241b8f3744d0488aaafd9a5dfbc211de1a0b27
|
/src/main/java/cdot/ccsp/utils/SecurityModeAnnc.java
|
eecd0627965b03ca1fbb3843e45d5a37fcf8c6ad
|
[] |
no_license
|
jaswantIISC/Example1
|
2fb6b8bebddded529f45cc464018f4daa342542c
|
f99d4cd5c8619bfe4b9430aa6a8a2728ac1ff0c5
|
refs/heads/master
| 2022-11-10T19:03:08.931915
| 2020-07-08T09:49:06
| 2020-07-08T09:49:06
| 278,051,509
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,674
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.12.17 at 02:51:19 PM IST
//
package cdot.ccsp.utils;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlList;
import javax.xml.bind.annotation.XmlType;
import cdot.onem2m.resource.xsd.AnnouncedFlexContainerResource;
import cdot.onem2m.resource.xsd.ChildResourceRef;
import cdot.onem2m.resource.xsd.Subscription;
/**
* <p>Java class for securityModeAnnc complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="securityModeAnnc">
* <complexContent>
* <extension base="{http://www.onem2m.org/xml/protocols}announcedFlexContainerResource">
* <sequence>
* <element name="currentSecurityMode" type="{http://www.onem2m.org/xml/protocols/homedomain}enumSecurityMode" minOccurs="0"/>
* <element name="securityModes" minOccurs="0">
* <simpleType>
* <list itemType="{http://www.onem2m.org/xml/protocols/homedomain}enumSecurityMode" />
* </simpleType>
* </element>
* <choice minOccurs="0">
* <element name="childResource" type="{http://www.onem2m.org/xml/protocols}childResourceRef" maxOccurs="unbounded"/>
* <choice maxOccurs="unbounded">
* <element ref="{http://www.onem2m.org/xml/protocols}subscription"/>
* </choice>
* </choice>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "securityModeAnnc", propOrder = {
"currentSecurityMode",
"securityModes",
"childResource",
"subscription"
})
public class SecurityModeAnnc
extends AnnouncedFlexContainerResource
{
protected BigInteger currentSecurityMode;
@XmlList
protected List<BigInteger> securityModes;
protected List<ChildResourceRef> childResource;
@XmlElement(namespace = "http://www.onem2m.org/xml/protocols")
protected List<Subscription> subscription;
/**
* Gets the value of the currentSecurityMode property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getCurrentSecurityMode() {
return currentSecurityMode;
}
/**
* Sets the value of the currentSecurityMode property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setCurrentSecurityMode(BigInteger value) {
this.currentSecurityMode = value;
}
/**
* Gets the value of the securityModes property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the securityModes property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSecurityModes().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link BigInteger }
*
*
*/
public List<BigInteger> getSecurityModes() {
if (securityModes == null) {
securityModes = new ArrayList<BigInteger>();
}
return this.securityModes;
}
/**
* Gets the value of the childResource property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the childResource property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getChildResource().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ChildResourceRef }
*
*
*/
public List<ChildResourceRef> getChildResource() {
if (childResource == null) {
childResource = new ArrayList<ChildResourceRef>();
}
return this.childResource;
}
/**
* Gets the value of the subscription property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the subscription property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSubscription().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Subscription }
*
*
*/
public List<Subscription> getSubscription() {
if (subscription == null) {
subscription = new ArrayList<Subscription>();
}
return this.subscription;
}
}
|
[
"jaswant.meena10@gmail.com"
] |
jaswant.meena10@gmail.com
|
05557b003e00bf9e40302ed7ca4237938150a94b
|
0deffdd02bc1a330a7f06d5366ba693b2fd10e61
|
/BOOT_CAMP_PROJECTS/Deevanshu/StructsDemo1/src/com/info/model1/Item.java
|
31212a616530096f91d105b3f0f93df25e9c0b25
|
[] |
no_license
|
deevanshu07/Projects
|
77adb903575de9563a324a294c04c88e50dfffeb
|
6c49672b3b1eda8b16327b56114560140b087e38
|
refs/heads/master
| 2021-04-27T21:52:13.560590
| 2018-04-26T15:35:21
| 2018-04-26T15:35:21
| 122,406,211
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 675
|
java
|
package com.info.model1;
public class Item
{
private int itemId;
private String itemName;
private String itemDesc;
public Item(int itemId, String itemName, String itemDesc)
{
super();
this.itemId = itemId;
this.itemName = itemName;
this.itemDesc = itemDesc;
}
public String getItemDesc()
{
return itemDesc;
}
public int getItemId()
{
return itemId;
}
public String getItemName()
{
return itemName;
}
public void setItemDesc(String itemDesc)
{
this.itemDesc = itemDesc;
}
public void setItemId(int itemId)
{
this.itemId = itemId;
}
public void setItemName(String itemName)
{
this.itemName = itemName;
}
}
|
[
"deevanshumahajan07@gmail.com"
] |
deevanshumahajan07@gmail.com
|
fe34bb220e32a9da00a41171e2bf8f48198f27ff
|
dfc4e17f1251540d13b51e189192415136ed8b24
|
/opscloud-domain/src/main/java/com/baiyi/opscloud/domain/generator/opscloud/AliyunLog.java
|
16e82bca8b3e26637f3194e3d98b6a61de6ff6e0
|
[
"Apache-2.0"
] |
permissive
|
ixrjog/opscloud4
|
c397df0777d235f177519466cc7626178c46710e
|
941c6fde279bf57a24889737828e44d552cdaa14
|
refs/heads/master
| 2023-09-06T02:24:47.441021
| 2023-08-29T10:30:01
| 2023-08-29T10:30:01
| 136,586,249
| 351
| 119
|
Apache-2.0
| 2023-07-25T08:18:48
| 2018-06-08T07:54:42
|
Java
|
UTF-8
|
Java
| false
| false
| 727
|
java
|
package com.baiyi.opscloud.domain.generator.opscloud;
import lombok.Data;
import javax.persistence.*;
import java.util.Date;
@Data
@Table(name = "aliyun_log")
public class AliyunLog {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 数据源实例id
*/
@Column(name = "datasource_instance_id")
private Integer datasourceInstanceId;
private String project;
private String logstore;
private String config;
private String comment;
@Column(name = "create_time", insertable = false, updatable = false)
private Date createTime;
@Column(name = "update_time", insertable = false, updatable = false)
private Date updateTime;
}
|
[
"ixrjog@qq.com"
] |
ixrjog@qq.com
|
89682871caa432fc8c4d74cb26508d1b040a8d83
|
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
|
/com.tencent.mm/classes.jar/com/tencent/mm/ui/widget/MMEditText$d.java
|
9ff92f2b43f8e815ffe4213d9ee94318e06c3513
|
[] |
no_license
|
tsuzcx/qq_apk
|
0d5e792c3c7351ab781957bac465c55c505caf61
|
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
|
refs/heads/main
| 2022-07-02T10:32:11.651957
| 2022-02-01T12:41:38
| 2022-02-01T12:41:38
| 453,860,108
| 36
| 9
| null | 2022-01-31T09:46:26
| 2022-01-31T02:43:22
|
Java
|
UTF-8
|
Java
| false
| false
| 316
|
java
|
package com.tencent.mm.ui.widget;
public abstract interface MMEditText$d
{
public abstract boolean awK(int paramInt);
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes4.jar
* Qualified Name: com.tencent.mm.ui.widget.MMEditText.d
* JD-Core Version: 0.7.0.1
*/
|
[
"98632993+tsuzcx@users.noreply.github.com"
] |
98632993+tsuzcx@users.noreply.github.com
|
d982bd5555c64f63809d4a670d7729f644e977ad
|
d8a3409ddfef26fdcf2a7f8676ffa05639a0a09e
|
/src/main/java/org/fife/util/FlatUtil.java
|
a9bf3aee7bd3fa6f7a557f9dceead6d19383f49f
|
[] |
no_license
|
Abneco/FifeCommon
|
125c0a27776314d2a5eb6c364627e2414a6ac53b
|
e0712e2bbffa49d8d5df6ccc1f04024d862f5d06
|
refs/heads/master
| 2023-08-27T06:12:25.552302
| 2021-10-27T02:57:06
| 2021-10-27T02:57:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,756
|
java
|
/*
* http://fifesoft.com/rtext
* Licensed under a modified BSD license.
* See the included license file for details.
*/
package org.fife.util;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
/**
* Utility methods to make FifeCommon mesh better with FlatLaf.
*
* @author Robert Futrell
* @version 1.0
*/
public final class FlatUtil {
/**
* Private constructor to prevent instantiation.
*/
private FlatUtil() {
// Do nothing
}
/**
* Returns whether the currently installed LookAndFeel is a FlatLaf variant.
*
* @return Whether the currently installed LookAndFeel is a FlatLaf variant.
* @see #isFlatLookAndFeel(String)
*/
public static boolean isFlatLafInstalled() {
return isFlatLookAndFeel(UIManager.getLookAndFeel());
}
/**
* Returns whether a LookAndFeel is Flat.
*
* @param laf The LookAndFeel. If this is {@code null}, {@code false} is
* returned.
* @return Whether the LaF is a FlatLaf variant.
* @see #isFlatLafInstalled()
*/
public static boolean isFlatLookAndFeel(LookAndFeel laf) {
return laf != null && isFlatLookAndFeel(laf.getClass().getSimpleName());
}
/**
* Returns whether a LookAndFeel is Flat.
*
* @param laf The class name of the LookAndFeel. If this is {@code null},
* {@code null} is returned.
* @return Whether the LaF is a FlatLaf variant.
* @see #isFlatLafInstalled()
*/
public static boolean isFlatLookAndFeel(String laf) {
return laf != null && laf.contains("Flat");
}
/**
* Returns whether the specified UI is a FlatLaf UI.
*
* @param ui The UI to check.
* @return Whether it's a FlatLaf UI.
*/
public static boolean isFlatUI(ComponentUI ui) {
return ui.getClass().getSimpleName().contains("Flat");
}
}
|
[
"robert.e.futrell@gmail.com"
] |
robert.e.futrell@gmail.com
|
9f2b05a5c5c3c7a99a0534322281eb7914a7c348
|
914e4faa8f66d9c3012c11b557d8e6e92e19beb5
|
/vaadin-context-menu-flow-parent/vaadin-context-menu-flow-integration-tests/src/test/java/com/vaadin/flow/component/contextmenu/it/PreserveOnRefreshIT.java
|
d74ddd810734c3b5ea3b301c304797815abf7ab1
|
[
"Apache-2.0"
] |
permissive
|
nohecastellanos/flow-components
|
0bbe97f966f1f8af62f97a2ac9d9a7f35e4669c4
|
92cd7f21536efb34ae8ffe0a1636c0f11ab3dee1
|
refs/heads/master
| 2023-08-11T14:09:11.871892
| 2021-10-08T17:59:17
| 2021-10-08T17:59:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,338
|
java
|
/*
* Copyright 2000-2019 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.vaadin.flow.component.contextmenu.it;
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import com.vaadin.flow.testutil.TestPath;
/**
* @author Vaadin Ltd
*/
@TestPath("vaadin-context-menu/preserve-on-refresh")
public class PreserveOnRefreshIT extends AbstractContextMenuIT {
@Test
public void autoAttachedContextMenuWithPreserveOnRefresh_refresh_noClientErrors_menuRendered() {
open();
waitForElementPresent(By.id("target"));
getDriver().navigate().refresh();
waitForElementPresent(By.id("target"));
checkLogsForErrors();
rightClickOn("target");
Assert.assertArrayEquals(new String[] { "foo" }, getMenuItemCaptions());
}
}
|
[
"manolo@vaadin.com"
] |
manolo@vaadin.com
|
33a285a8eaf6ab6ead6ec86eaa4e5a9dedbeed25
|
afb4cf30e328c78efc7adad573a4e4a1870754b6
|
/High School/Classes/Computer Science 1/src/Triforce.java
|
28543469efa52404b4813bf7c6e449fb4a993541
|
[
"Apache-2.0"
] |
permissive
|
mmcclain117/School-Code
|
5c404aaa9b95df136ba382dff79cb7d44e56b4bc
|
aa9c501d42fc51fa9a66f53c65b875408a40ea0c
|
refs/heads/main
| 2023-01-21T00:27:18.669866
| 2020-11-29T21:32:52
| 2020-11-29T21:32:52
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,067
|
java
|
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import static java.lang.Math.random;
import javax.swing.JFrame;
import javax.swing.JPanel;
/**
*
* @author Master
*/
class Tri extends JPanel {
@Override
public void paintComponent(Graphics g) {
int x = 100;
int y = 50;
for (int i = 0; i <= 10; i++) {
for (int ii = 0; ii <= 10; ii++) {
g.setColor(Color.blue);
fillTriforce(g, x, y);
x += 125;
y += 0;
}
x = 0;
y += 100;
}
}
private Color randomColor() {
int r = (int) (random() * 256);
int G = (int) (random() * 256);
int b = (int) (random() * 256);
return new Color(r, G, b);
}
private void fillTriforce(Graphics g, int x, int y) {
int xPoints[] = {x + 0, x + 25, x + 0, x + 25, x - 50, x + 0, x - 100};
int yPoints[] = {y + 0, y + 100, y + 100, y + 50, y + 50, y + 100, y + 100};
g.fillPolygon(xPoints, yPoints, xPoints.length);
}
}
/**
* ************************************************************
* The code below is needed to create the Graphics window. You should not modify
* or delete any of the code.
* ***********************************************************
*/
public class Triforce {
public static void main(String[] args) {
//This is a necessary in order to create the frame window
javax.swing.SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
start();
}
});
}
public static void start() {
//Sets up the frame
JFrame frame = new JFrame("Graphics");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Adds the graphics panel and sets the size
frame.setSize(new Dimension(800, 600));
frame.getContentPane().add(new Tri(), BorderLayout.CENTER);
frame.setVisible(true);
}
}
|
[
"codingmace@gmail.com"
] |
codingmace@gmail.com
|
ded228911ba04dc6c1e7b188ef40ae0769a0d7fd
|
d85028f6a7c72c6e6daa1dd9c855d4720fc8b655
|
/gnu/trove/impl/hash/TShortByteHash.java
|
eea8c988133c42521c37ac2a273c26cf3a48f0bb
|
[] |
no_license
|
RavenLeaks/Aegis-src-cfr
|
85fb34c2b9437adf1631b103f555baca6353e5d5
|
9815c07b0468cbba8d1efbfe7643351b36665115
|
refs/heads/master
| 2022-10-13T02:09:08.049217
| 2020-06-09T15:31:27
| 2020-06-09T15:31:27
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,227
|
java
|
/*
* Decompiled with CFR <Could not determine version>.
*/
package gnu.trove.impl.hash;
import gnu.trove.impl.HashFunctions;
import gnu.trove.impl.hash.TPrimitiveHash;
import gnu.trove.procedure.TShortProcedure;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
public abstract class TShortByteHash
extends TPrimitiveHash {
static final long serialVersionUID = 1L;
public transient short[] _set;
protected short no_entry_key;
protected byte no_entry_value;
protected boolean consumeFreeSlot;
public TShortByteHash() {
this.no_entry_key = 0;
this.no_entry_value = 0;
}
public TShortByteHash(int initialCapacity) {
super((int)initialCapacity);
this.no_entry_key = 0;
this.no_entry_value = 0;
}
public TShortByteHash(int initialCapacity, float loadFactor) {
super((int)initialCapacity, (float)loadFactor);
this.no_entry_key = 0;
this.no_entry_value = 0;
}
public TShortByteHash(int initialCapacity, float loadFactor, short no_entry_key, byte no_entry_value) {
super((int)initialCapacity, (float)loadFactor);
this.no_entry_key = no_entry_key;
this.no_entry_value = no_entry_value;
}
public short getNoEntryKey() {
return this.no_entry_key;
}
public byte getNoEntryValue() {
return this.no_entry_value;
}
@Override
protected int setUp(int initialCapacity) {
int capacity = super.setUp((int)initialCapacity);
this._set = new short[capacity];
return capacity;
}
public boolean contains(short val) {
if (this.index((short)val) < 0) return false;
return true;
}
public boolean forEach(TShortProcedure procedure) {
byte[] states = this._states;
short[] set = this._set;
int i = set.length;
do {
if (i-- <= 0) return true;
} while (states[i] != 1 || procedure.execute((short)set[i]));
return false;
}
@Override
protected void removeAt(int index) {
this._set[index] = this.no_entry_key;
super.removeAt((int)index);
}
protected int index(short key) {
byte[] states = this._states;
short[] set = this._set;
int length = states.length;
int hash = HashFunctions.hash((int)key) & Integer.MAX_VALUE;
int index = hash % length;
byte state = states[index];
if (state == 0) {
return -1;
}
if (state != 1) return this.indexRehashed((short)key, (int)index, (int)hash, (byte)state);
if (set[index] != key) return this.indexRehashed((short)key, (int)index, (int)hash, (byte)state);
return index;
}
int indexRehashed(short key, int index, int hash, byte state) {
int length = this._set.length;
int probe = 1 + hash % (length - 2);
int loopIndex = index;
do {
if ((index -= probe) < 0) {
index += length;
}
if ((state = this._states[index]) == 0) {
return -1;
}
if (key != this._set[index] || state == 2) continue;
return index;
} while (index != loopIndex);
return -1;
}
protected int insertKey(short val) {
int hash = HashFunctions.hash((int)val) & Integer.MAX_VALUE;
int index = hash % this._states.length;
byte state = this._states[index];
this.consumeFreeSlot = false;
if (state == 0) {
this.consumeFreeSlot = true;
this.insertKeyAt((int)index, (short)val);
return index;
}
if (state != 1) return this.insertKeyRehash((short)val, (int)index, (int)hash, (byte)state);
if (this._set[index] != val) return this.insertKeyRehash((short)val, (int)index, (int)hash, (byte)state);
return -index - 1;
}
int insertKeyRehash(short val, int index, int hash, byte state) {
int length = this._set.length;
int probe = 1 + hash % (length - 2);
int loopIndex = index;
int firstRemoved = -1;
do {
if (state == 2 && firstRemoved == -1) {
firstRemoved = index;
}
if ((index -= probe) < 0) {
index += length;
}
if ((state = this._states[index]) == 0) {
if (firstRemoved != -1) {
this.insertKeyAt((int)firstRemoved, (short)val);
return firstRemoved;
}
this.consumeFreeSlot = true;
this.insertKeyAt((int)index, (short)val);
return index;
}
if (state != 1 || this._set[index] != val) continue;
return -index - 1;
} while (index != loopIndex);
if (firstRemoved == -1) throw new IllegalStateException((String)"No free or removed slots available. Key set full?!!");
this.insertKeyAt((int)firstRemoved, (short)val);
return firstRemoved;
}
void insertKeyAt(int index, short val) {
this._set[index] = val;
this._states[index] = 1;
}
protected int XinsertKey(short key) {
byte[] states = this._states;
short[] set = this._set;
int length = states.length;
int hash = HashFunctions.hash((int)key) & Integer.MAX_VALUE;
int index = hash % length;
byte state = states[index];
this.consumeFreeSlot = false;
if (state == 0) {
this.consumeFreeSlot = true;
set[index] = key;
states[index] = 1;
return index;
}
if (state == 1 && set[index] == key) {
return -index - 1;
}
int probe = 1 + hash % (length - 2);
if (state != 2) {
do {
if ((index -= probe) >= 0) continue;
index += length;
} while ((state = states[index]) == 1 && set[index] != key);
}
if (state == 2) {
int firstRemoved = index;
while (state != 0 && (state == 2 || set[index] != key)) {
if ((index -= probe) < 0) {
index += length;
}
state = states[index];
}
if (state == 1) {
return -index - 1;
}
set[index] = key;
states[index] = 1;
return firstRemoved;
}
if (state == 1) {
return -index - 1;
}
this.consumeFreeSlot = true;
set[index] = key;
states[index] = 1;
return index;
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeByte((int)0);
super.writeExternal((ObjectOutput)out);
out.writeShort((int)this.no_entry_key);
out.writeByte((int)this.no_entry_value);
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
in.readByte();
super.readExternal((ObjectInput)in);
this.no_entry_key = in.readShort();
this.no_entry_value = in.readByte();
}
}
|
[
"emlin2021@gmail.com"
] |
emlin2021@gmail.com
|
e99d8f9d501a56c7c95d0365cb317a9845318911
|
6df097c5c36bbfd49d2941800da4ba4c6f0220e5
|
/easycache-client/src/main/java/com/easycache/sqlclient/log/IMDGLog.java
|
04ed25707c074d96b476504892cf8368de49e62a
|
[] |
no_license
|
JiangYongPlus/easycache
|
cd625afb27dc5dd20c1709727e89a6e5218b2d74
|
93e6bae20dcfa97ae9c57b9581c75e5a055cd831
|
refs/heads/master
| 2021-01-10T16:37:41.790505
| 2016-01-27T02:41:34
| 2016-01-27T02:41:34
| 50,475,643
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 906
|
java
|
package com.easycache.sqlclient.log;
public class IMDGLog {
public static boolean flag = false;
public static void print(String str) {
if (flag) {
System.out.println("IMDG log: " + str);
}
}
public static void funcLog(String str) {
if (flag) {
System.out.println("function: " + str + " is executed!");
}
}
public static void rstFuncLog(String str) {
if (flag) {
System.out.println("---IMDGResultSet function: " + str + " is executed!---");
}
}
public static void stmtFuncLog(String str) {
if (flag) {
System.out.println("---Statement function: " + str + " is executed!---");
}
}
public static void showPstSql(String sql) {
if (flag) {
System.out.println("---preparedstatement sql is: " + sql + "----");
}
}
public static void showStmtSql(String sql) {
if (flag) {
System.out.println("--statement sql is: " + sql + "----");
}
}
}
|
[
"jiangyongplus@gmail.com"
] |
jiangyongplus@gmail.com
|
fc532e116c2fc58c063501f44ab95f5cff29462b
|
a938c8162313da137e94d6a9d223d1ec8db5a5ca
|
/NicadOutputFile_maven/Clone Pairs 34/Nicad_maven67.java
|
8e5a829664a1b139fbbc820b6f1a68b374b26aec
|
[] |
no_license
|
ryosuke-ku/Nicad_ScrapinG
|
a94a61574dc17585047624b827639196b23b8e21
|
62200621eb293d7a8953ef6e18a7e0f2019ecc48
|
refs/heads/master
| 2020-06-29T22:03:44.189953
| 2019-08-05T13:17:57
| 2019-08-05T13:17:57
| 200,636,057
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,136
|
java
|
//79:maven/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java
//None
public class Nicad_maven67
{
protected void mergePlugin_Dependencies( Plugin target, Plugin source, boolean sourceDominant,
Map<Object, Object> context )
{
List<Dependency> src = source.getDependencies();
if ( !src.isEmpty() )
{
List<Dependency> tgt = target.getDependencies();
Map<Object, Dependency> merged = new LinkedHashMap<>( ( src.size() + tgt.size() ) * 2 );
for ( Dependency element : tgt )
{
Object key = getDependencyKey( element );
merged.put( key, element );
}
for ( Dependency element : src )
{
Object key = getDependencyKey( element );
if ( sourceDominant || !merged.containsKey( key ) )
{
merged.put( key, element );
}
}
target.setDependencies( new ArrayList<>( merged.values() ) );
}
}
|
[
"naist1020@gmail.com"
] |
naist1020@gmail.com
|
c3ef73853d562129d72362105df5e5f1654aa5b0
|
8eddcbc327fda219a9b826c504aa62ad40b698ef
|
/src/main/java/requious/compat/jei/slot/FluidSlot.java
|
5fa66f4fe5a8ca293f0a7385fd7ad6dc7ad8cd35
|
[
"MIT"
] |
permissive
|
DaedalusGame/RequiousFrakto
|
ef192ef3c58adace1c4cf3a210fdc7b063437104
|
f7b9c590dc461cc4cd359d68eb3f46a4960970a2
|
refs/heads/master
| 2021-06-25T00:51:56.411684
| 2021-02-27T01:46:42
| 2021-02-27T01:46:42
| 203,609,005
| 10
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,007
|
java
|
package requious.compat.jei.slot;
import mezz.jei.api.ingredients.VanillaTypes;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
import requious.Requious;
import requious.compat.jei.IngredientCollector;
import requious.compat.jei.JEISlot;
import requious.util.Misc;
import java.util.ArrayList;
import java.util.List;
public class FluidSlot extends JEISlot {
public List<FluidStack> fluids = new ArrayList<>();
public FillNormalizer normalizer = new FillNormalizer();
public FluidSlot(int x, int y, String group) {
super(x, y, group);
}
@Override
public boolean isFilled() {
return !fluids.isEmpty();
}
@Override
public void resetFill() {
super.resetFill();
fluids.clear();
}
public void addFluid(FluidStack fluid) {
fluids.add(fluid);
normalizer.add(fluid.amount);
}
@Override
public JEISlot copy() {
FluidSlot fluidSlot = new FluidSlot(x,y,group);
fluidSlot.normalizer = normalizer;
return fluidSlot;
}
@Override
public void getIngredients(IngredientCollector collector) {
for (FluidStack fluid : fluids) {
if(isInput())
collector.addInput(VanillaTypes.FLUID,fluid);
else
collector.addOutput(VanillaTypes.FLUID,fluid);
}
}
@Override
public void render(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
minecraft.getTextureManager().bindTexture(new ResourceLocation(Requious.MODID,"textures/gui/assembly_slots.png"));
Misc.drawTexturedModalRect(x*18,y*18, 18, 0, 18,18);
}
public static class FillNormalizer {
int highestFill;
public void add(int amount) {
if(amount > highestFill)
highestFill = amount;
}
public int get() {
return highestFill;
}
}
}
|
[
"bordlistian@hotmail.de"
] |
bordlistian@hotmail.de
|
f5895772ef0633509b17c24696b6fa79d3501616
|
0ae199a25f8e0959734f11071a282ee7a0169e2d
|
/utils/misc/src/test/java/org/onlab/util/FrequencyTest.java
|
793804430b4465ed5016014027bc1415d9afa53b
|
[
"Apache-2.0"
] |
permissive
|
lishuai12/onosfw-L3
|
314d2bc79424d09dcd8f46a4c467bd36cfa9bf1b
|
e60902ba8da7de3816f6b999492bec2d51dd677d
|
refs/heads/master
| 2021-01-10T08:09:56.279267
| 2015-11-06T02:49:00
| 2015-11-06T02:49:00
| 45,652,234
| 0
| 1
| null | 2016-03-10T22:30:45
| 2015-11-06T01:49:10
|
Java
|
UTF-8
|
Java
| false
| false
| 3,562
|
java
|
/*
* Copyright 2015 Open Networking Laboratory
*
* 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.onlab.util;
import com.google.common.testing.EqualsTester;
import org.junit.Test;
import org.onlab.junit.ImmutableClassChecker;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.lessThan;
public class FrequencyTest {
private final Frequency frequency1 = Frequency.ofMHz(1000);
private final Frequency sameFrequency1 = Frequency.ofMHz(1000);
private final Frequency frequency2 = Frequency.ofGHz(1000);
private final Frequency sameFrequency2 = Frequency.ofGHz(1000);
private final Frequency moreSameFrequency2 = Frequency.ofTHz(1);
private final Frequency frequency3 = Frequency.ofTHz(193.1);
private final Frequency sameFrequency3 = Frequency.ofGHz(193100);
/**
* Tests immutability of Frequency.
*/
@Test
public void testImmutability() {
ImmutableClassChecker.assertThatClassIsImmutable(Frequency.class);
}
/**
* Tests equality of Frequency instances.
*/
@Test
public void testEquality() {
new EqualsTester()
.addEqualityGroup(frequency1, sameFrequency1)
.addEqualityGroup(frequency2, sameFrequency2, moreSameFrequency2)
.addEqualityGroup(frequency3, sameFrequency3)
.testEquals();
}
/**
* Tests the first object is less than the second object.
*/
@Test
public void testLessThan() {
assertThat(frequency1, is(lessThan(frequency2)));
assertThat(frequency1.isLessThan(frequency2), is(true));
}
@Test
public void testGreaterThan() {
assertThat(frequency2, is(greaterThan(frequency1)));
assertThat(frequency2.isGreaterThan(frequency1), is(true));
}
/**
* Tests add operation of two Frequencies.
*/
@Test
public void testAdd() {
Frequency low = Frequency.ofMHz(100);
Frequency high = Frequency.ofGHz(1);
Frequency expected = Frequency.ofMHz(1100);
assertThat(low.add(high), is(expected));
}
/**
* Tests subtract operation of two Frequencies.
*/
@Test
public void testSubtract() {
Frequency high = Frequency.ofGHz(1);
Frequency low = Frequency.ofMHz(100);
Frequency expected = Frequency.ofMHz(900);
assertThat(high.subtract(low), is(expected));
}
/**
* Tests multiply operation of Frequency.
*/
@Test
public void testMultiply() {
Frequency frequency = Frequency.ofMHz(1000);
long factor = 5;
Frequency expected = Frequency.ofGHz(5);
assertThat(frequency.multiply(5), is(expected));
}
}
|
[
"lishuai12@huawei.com"
] |
lishuai12@huawei.com
|
d28ddd23e308225cc55378267b788f9236f7a1ff
|
071c5d507a7b211e7a614225b40b8da2c4fe308d
|
/src/main/java/com/ea/elasticsearch/model/Record.java
|
d127f66c8a6c170e3e62416e54d49000991ea5ae
|
[] |
no_license
|
Ferdiando/elasticsearch-master
|
fc559595c90fd68593207ad5e8b9daf248dd1abb
|
27e28e87be3b22805ac835ab45fa4d9ef75a8942
|
refs/heads/master
| 2020-04-29T20:59:06.351425
| 2019-03-19T01:34:47
| 2019-03-19T01:34:47
| 176,399,174
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 766
|
java
|
package com.ea.elasticsearch.model;
/**
* 抓取记录
*/
public class Record {
private String msg;
private String nickName;
private String date;
private String source;
private int status;
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
|
[
"huyang3868@163.com"
] |
huyang3868@163.com
|
47428dd93f44ffd7e9844a7a4cf3d57ffbcb59b0
|
1d9536408950a0a6ebb637c20492657bfe8af94c
|
/code_forces/EDU/Binary_Search/Step_1/Closest_to_the_Left_B_Pr.java
|
47bceb91df539f6f03dd1972ebe5a90523b303f6
|
[] |
no_license
|
atish1999/Testing_knowledge
|
2d5c5b9b53afb3d560454056b35850d1cb87aae1
|
b31dc0e185458c576737a888549d838a091c1939
|
refs/heads/master
| 2023-07-16T03:24:32.236832
| 2021-09-04T02:16:21
| 2021-09-04T02:16:21
| 302,491,537
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,708
|
java
|
package code_forces.EDU.Binary_Search.Step_1;
import java.util.*;
import java.io.*;
public class Closest_to_the_Left_B_Pr {
public static void main(String[] args) throws java.lang.Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer s = new StringTokenizer(br.readLine());
int n=Integer.parseInt(s.nextToken()),k=Integer.parseInt(s.nextToken());
int a[]=new int[n];
s = new StringTokenizer(br.readLine());
for(int i=0; i<n; i++) a[i]=Integer.parseInt(s.nextToken());
s = new StringTokenizer(br.readLine());
while(k-->0) {
int target=Integer.parseInt(s.nextToken());
int l=-1;//a[l]<=x //closest to the left
int r=n;//a[r]>x
while(l+1<r) {
int m=(l+r)>>>1;
if(a[m]<=target) l=m;
else r=m;
}
// if all the elements are greater than x then l would be -1.
System.out.println(l+1);
}
}
static void solve1()throws java.lang.Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer s = new StringTokenizer(br.readLine());
int n=Integer.parseInt(s.nextToken()),k=Integer.parseInt(s.nextToken());
int a[]=new int[n];
s = new StringTokenizer(br.readLine());
for(int i=0; i<n; i++) a[i]=Integer.parseInt(s.nextToken());
s = new StringTokenizer(br.readLine());
while(k-->0) {
int target=Integer.parseInt(s.nextToken());
int x=Arrays.binarySearch(a, target);
if(x<0) {x*=-1;--x;}
else {
for(int i=x; i<n-1; i++) {
if(a[i]==a[i+1]) ++x;
else break;
}
++x;//because we have to print 1-based indexing...
}
System.out.println(x);
}
}
}
|
[
"atishnaskar1999@gmail.com"
] |
atishnaskar1999@gmail.com
|
c51848e0fe50cb32ceed8695d56ed0aa72357ad4
|
f088370f47cb3e39072384fe913c2c49a799806e
|
/src/main/java/config/RedisConstants.java
|
6ae5fc054a1d44966a94963dbbcb5fec9ee8ec42
|
[] |
no_license
|
ShawyerPeng/JedisUtil
|
6b0ab2af13ecef120490f4360fdd1ffa246dfc73
|
f57704e0916d8101ad88f351587b0d537dcd69f4
|
refs/heads/master
| 2021-08-24T01:30:34.553396
| 2017-12-07T13:13:25
| 2017-12-07T13:13:25
| 113,449,686
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 822
|
java
|
package config;
/**
* Redis 常量类
*/
public class RedisConstants {
/**
* redis 默认配置 配置文件名
*/
public static final String DEFALUT_REDIS_FILE_NAME = "redis.properties";
/**
* redis 默认配置 端口
*/
public static final int DEFAULT_REDIS_PORT = 6379;
/**
* redis 默认配置 最大连接数
*/
public static final int DEFAULT_REDIS_POOL_MAX = 10;
/**
* redis 默认配置 每次连接数增加数
*/
public static final int DEFAULT_REDIS_POOL_IDLE = 1;
/**
* redis 默认配置 连接超时时间
*/
public static final int DEFAULT_REDIS_TRY_TIMEOUT = 10000;
/**
* redis 默认配置 临时队列名
*/
public static final String DEFAULT_REDIS_TEMP_QUEUE_TIMEP_NAME = "tmp_queue";
}
|
[
"patrickyateschn@gmail.com"
] |
patrickyateschn@gmail.com
|
3048495a4d0e343afb22918ee1bd22c2637d92c2
|
5739149dee8b3d8b773cfa5ec175d7dbd7ce0605
|
/droolsjbpm-tools-master.zip_expanded/droolsjbpm-tools-master/drools-eclipse/org.kie.eclipse/src/main/java/org/kie/eclipse/preferences/AbstractRuntimeDialog.java
|
5d3834b4bf577db925d145316f7fb7215679ac20
|
[
"Apache-2.0"
] |
permissive
|
menty44/impbackuptwo
|
4e925114f40f78fa31ac157a3ceb0f1196d3e08d
|
aeb389d1e000975b90e2923c465a5e746b0587da
|
refs/heads/master
| 2021-01-22T02:28:42.397040
| 2017-02-06T05:56:26
| 2017-02-06T05:56:26
| 81,052,684
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,061
|
java
|
/*
* Copyright 2010 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.kie.eclipse.preferences;
import java.io.File;
import java.util.List;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.kie.eclipse.runtime.IRuntime;
import org.kie.eclipse.runtime.IRuntimeManager;
public abstract class AbstractRuntimeDialog extends Dialog {
private IRuntimeManager runtimeManager;
private IRuntime runtime;
private Text nameText;
private Text pathText;
private Text versionText;
private List<IRuntime> runtimes;
private Listener textModifyListener = new Listener() {
public void handleEvent(Event e) {
boolean valid = validate();
getButton(IDialogConstants.OK_ID).setEnabled(valid);
}
};
public AbstractRuntimeDialog(Shell parent, List<IRuntime> runtimes) {
super(parent);
setBlockOnOpen(true);
this.runtimes = runtimes;
this.runtimeManager = getRuntimeManager();
setShellStyle(getShellStyle() | SWT.RESIZE);
}
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 3;
composite.setLayout(gridLayout);
Label label = new Label(composite, SWT.WRAP);
label.setFont(composite.getFont());
label.setText("Either select an existing Drools Runtime on your file system or create a new one.");
GridData gridData = new GridData();
gridData.horizontalSpan = 3;
gridData.widthHint = 450;
label.setLayoutData(gridData);
Label nameLabel = new Label(composite, SWT.NONE);
nameLabel.setText("Name:");
nameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
nameText.setText(runtime == null || runtime.getName() == null ? "" : runtime.getName());
nameText.addListener(SWT.Modify, textModifyListener);
gridData = new GridData();
gridData.horizontalSpan = 2;
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalAlignment = GridData.FILL;
nameText.setLayoutData(gridData);
label = new Label(composite, SWT.NONE);
label.setText("Path:");
pathText = new Text(composite, SWT.SINGLE | SWT.BORDER);
pathText.setText(runtime == null || runtime.getPath() == null ? "" : runtime.getPath());
pathText.addListener(SWT.Modify, textModifyListener);
gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalAlignment = GridData.FILL;
pathText.setLayoutData(gridData);
Button selectButton = new Button(composite, SWT.PUSH | SWT.LEFT);
selectButton.setText("Browse...");
gridData = new GridData();
selectButton.setLayoutData(gridData);
selectButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
browse();
}
public void widgetDefaultSelected(SelectionEvent e) {
}
});
Label versionLabel = new Label(composite, SWT.NONE);
versionLabel.setText("Version:");
versionText = new Text(composite, SWT.SINGLE | SWT.BORDER);
versionText.setText(runtime == null || runtime.getName() == null ? "" : runtime.getVersion());
versionText.addListener(SWT.Modify, textModifyListener);
gridData = new GridData();
gridData.horizontalSpan = 2;
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalAlignment = GridData.FILL;
versionText.setLayoutData(gridData);
Button createButton = new Button(composite, SWT.PUSH | SWT.LEFT);
String name = runtimeManager.getBundleRuntimeName();
createButton.setText("Create a new " + name + "...");
gridData = new GridData();
gridData.horizontalSpan = 2;
createButton.setLayoutData(gridData);
createButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
createRuntime();
}
public void widgetDefaultSelected(SelectionEvent e) {
}
});
return composite;
}
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
getButton(IDialogConstants.OK_ID).setEnabled(false);
}
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText("Drools Runtime");
}
protected Point getInitialSize() {
return new Point(500, 250);
}
public void setRuntime(IRuntime runtime) {
this.runtime = runtime;
}
private boolean validate() {
String name = nameText.getText();
if (name == null || "".equals(name.trim())) {
return false;
}
if (runtime == null || !name.equals(runtime.getName())) {
for (IRuntime runtime: runtimes) {
if (name.equals(runtime.getName())) {
return false;
}
}
}
String location = pathText.getText();
if (location != null) {
File file = new File(location);
if (file.exists() && file.isDirectory()) {
return true;
}
}
return false;
}
private void browse() {
String selectedDirectory = null;
String dirName = pathText.getText();
DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.setMessage("Select the Drools runtime directory.");
dialog.setFilterPath(dirName);
selectedDirectory = dialog.open();
if (selectedDirectory != null) {
pathText.setText(selectedDirectory);
}
}
private void createRuntime() {
DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.setMessage("Select the new Drools 6 runtime directory.");
String selectedDirectory = dialog.open();
if (selectedDirectory != null) {
IRuntime rt = runtimeManager.createBundleRuntime(selectedDirectory);
nameText.setText(rt.getName());
pathText.setText(rt.getPath());
versionText.setText(rt.getVersion());
}
}
public IRuntime getResult() {
return runtime;
}
protected void okPressed() {
runtime = getRuntimeManager().createNewRuntime();
runtime.setName(nameText.getText());
runtime.setPath(pathText.getText());
runtime.setVersion(versionText.getText());
super.okPressed();
}
abstract protected IRuntimeManager getRuntimeManager();
}
|
[
"fred.oluoch@impalapay.com"
] |
fred.oluoch@impalapay.com
|
1c3b5c23637527d8aba49a33ec0dff2148d994b0
|
f7463a562aef1fbd6b56d45b6a3d94108fb8d501
|
/RigitalApp.api/src/main/java/co/edu/uniandes/csw/grupo/softwaresalas/master/logic/api/_ISoftwareSalasMasterLogicService.java
|
eada0583a0e0b34416d67ac26c994edca84e93f0
|
[] |
no_license
|
paotoya757/Rigital---production-repo
|
7d17058a4a342862924d89260da0fef2566ad0eb
|
e51899e6f00c37dc441bdad602871fcbfe44f984
|
refs/heads/master
| 2021-01-13T01:31:24.431190
| 2014-12-02T06:42:55
| 2014-12-02T06:42:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,843
|
java
|
/* ========================================================================
* Copyright 2014 grupo
*
* Licensed under the MIT, The MIT License (MIT)
* Copyright (c) 2014 grupo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
* ========================================================================
Source generated by CrudMaker version 1.0.0.201410152247
*/
package co.edu.uniandes.csw.grupo.softwaresalas.master.logic.api;
import co.edu.uniandes.csw.grupo.softwaresalas.master.logic.dto.SoftwareSalasMasterDTO;
public interface _ISoftwareSalasMasterLogicService {
public SoftwareSalasMasterDTO createMasterSoftwareSalas(SoftwareSalasMasterDTO detail);
public void updateMasterSoftwareSalas(SoftwareSalasMasterDTO detail);
public void deleteMasterSoftwareSalas(Long id);
public SoftwareSalasMasterDTO getMasterSoftwareSalas(Long id);
}
|
[
"pa.otoya757@uniandes.edu.co"
] |
pa.otoya757@uniandes.edu.co
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.