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
b363376d4d296d6df065523a432cf1e63bd49fd9
666395038e04da2d140e338a9e343f34d1009d80
/usertype.spi/src/main/java/org/jadira/usertype/spi/shared/AbstractUserTypeHibernateIntegrator.java
ddf88e7e60c951e07311d110b4fa932feae3c83e
[ "Apache-2.0" ]
permissive
olliefreeman/jadira
dc9410a5f45fa3998d66398b12af58ff5421d74a
cdd34a301e053958da3fec01595fcea0e25eb9e6
refs/heads/master
2021-01-15T12:28:27.366156
2015-09-26T01:59:38
2015-09-26T01:59:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,075
java
/* * Copyright 2011 Christopher Pheby * * 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.jadira.usertype.spi.shared; import org.hibernate.boot.Metadata; import org.hibernate.cfg.Configuration; import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.integrator.spi.Integrator; import org.hibernate.service.spi.SessionFactoryServiceRegistry; import org.hibernate.usertype.CompositeUserType; import org.hibernate.usertype.UserType; import org.jadira.usertype.spi.utils.runtime.JavaVersion; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.SQLException; import java.util.Properties; public abstract class AbstractUserTypeHibernateIntegrator implements Integrator { private static final String REGISTER_USERTYPES_KEY = "jadira.usertype.autoRegisterUserTypes"; private static final String DEFAULT_JAVAZONE_KEY = "jadira.usertype.javaZone"; private static final String DEFAULT_DATABASEZONE_KEY = "jadira.usertype.databaseZone"; private static final String DEFAULT_SEED_KEY = "jadira.usertype.seed"; private static final String DEFAULT_CURRENCYCODE_KEY = "jadira.usertype.currencyCode"; private static final String JDBC42_API_KEY = "jadira.usertype.useJdbc42Apis"; public void integrate(Configuration configuration, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) { try { ConfigurationHelper.setCurrentSessionFactory(sessionFactory); String isEnabled = configuration.getProperty(REGISTER_USERTYPES_KEY); String javaZone = configuration.getProperty(DEFAULT_JAVAZONE_KEY); String databaseZone = configuration.getProperty(DEFAULT_DATABASEZONE_KEY); String seed = configuration.getProperty(DEFAULT_SEED_KEY); String currencyCode = configuration.getProperty(DEFAULT_CURRENCYCODE_KEY); String jdbc42Apis = configuration.getProperty(JDBC42_API_KEY); configureDefaultProperties(sessionFactory, javaZone, databaseZone, seed, currencyCode, jdbc42Apis); if (isEnabled != null && Boolean.valueOf(isEnabled)) { autoRegisterUsertypes(configuration); } final boolean use42Api = use42Api(configuration, sessionFactory); ConfigurationHelper.setUse42Api(sessionFactory, use42Api); doIntegrate(configuration, sessionFactory, serviceRegistry); } finally { ConfigurationHelper.setCurrentSessionFactory(null); } } @SuppressWarnings("deprecation") private boolean use42Api(Configuration configuration, SessionFactoryImplementor sessionFactory) { String jdbc42Apis = configuration.getProperty(JDBC42_API_KEY); boolean use42Api; if (jdbc42Apis == null) { if (JavaVersion.getMajorVersion() >= 1 && JavaVersion.getMinorVersion() >= 8) { Connection conn = null; try { JdbcServices jdbcServices = sessionFactory.getServiceRegistry().getService(JdbcServices.class); conn = jdbcServices.getBootstrapJdbcConnectionAccess().obtainConnection(); DatabaseMetaData dmd = conn.getMetaData(); int driverMajorVersion = dmd.getDriverMajorVersion(); int driverMinorVersion = dmd.getDriverMinorVersion(); if (driverMajorVersion >= 5) { use42Api = true; } else if (driverMajorVersion >= 4 && driverMinorVersion >= 2) { use42Api = true; } else { use42Api = false; } } catch (SQLException e) { use42Api = false; } catch (NoSuchMethodError e) { // Occurs in Hibernate 4.2.12 use42Api = false; } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { // Ignore } } } } else { use42Api = false; } } else { use42Api = Boolean.parseBoolean(jdbc42Apis); } return use42Api; } private void autoRegisterUsertypes(Configuration configuration) { for(UserType next : getUserTypes()) { registerType(configuration, next); } for(CompositeUserType next : getCompositeUserTypes()) { registerType(configuration, next); } } private void configureDefaultProperties(SessionFactoryImplementor sessionFactory, String javaZone, String databaseZone, String seed, String currencyCode, String jdbc42Apis) { Properties properties = new Properties(); if (databaseZone != null) { properties.put("databaseZone", databaseZone); } if (javaZone != null) { properties.put("javaZone", javaZone); } if (seed != null) { properties.put("seed", seed); } if (currencyCode != null) { properties.put("currencyCode", currencyCode); } if (jdbc42Apis != null) { properties.put("jdbc42Apis", jdbc42Apis); } ConfigurationHelper.configureDefaultProperties(sessionFactory, properties); } private void registerType(Configuration configuration, CompositeUserType type) { String className = type.returnedClass().getName(); configuration.registerTypeOverride(type, new String[] {className}); } private void registerType(Configuration configuration, UserType type) { String className = type.returnedClass().getName(); configuration.registerTypeOverride(type, new String[] {className}); } /** * {@inheritDoc} */ @Override public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) { // no-op } /** * {@inheritDoc} */ @Override public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) { ConfigurationHelper.configureDefaultProperties(sessionFactory, null); } protected abstract CompositeUserType[] getCompositeUserTypes(); protected abstract UserType[] getUserTypes(); protected void doIntegrate(Configuration configuration, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) { } }
[ "chris@jadira.co.uk" ]
chris@jadira.co.uk
345ca6cd9e341d91c5cb6a53045152e3e2cbe4d9
183d057ee3f1255551c9f2bc6080dfcc23262639
/app/src/main/java/com/cliffex/videomaker/videoeditor/introvd/template/p203b/p204a/C4573d.java
baa4bf4b01216bb3a94798d6ea50bd4ebb04656e
[]
no_license
datcoind/VideoMaker-1
5567ff713f771b19154ba463469b97d18d0164ec
bcd6697db53b1e76ee510e6e805e46b24a4834f4
refs/heads/master
2023-03-19T20:33:16.016544
2019-09-27T13:55:07
2019-09-27T13:55:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,719
java
package com.introvd.template.p203b.p204a; import android.annotation.TargetApi; import android.app.Activity; import android.content.Context; import android.os.Handler; import android.os.Message; import android.view.View; import android.view.ViewTreeObserver; import android.view.ViewTreeObserver.OnGlobalLayoutListener; import android.view.WindowManager; import android.view.WindowManager.LayoutParams; import java.util.Queue; import java.util.concurrent.LinkedBlockingQueue; /* renamed from: com.introvd.template.b.a.d */ public class C4573d extends Handler { private final Queue<C4576e> bLu; private final LayoutParams bLv; /* renamed from: com.introvd.template.b.a.d$a */ private static class C4575a { /* access modifiers changed from: private */ public static final C4573d bLz = new C4573d(); } private C4573d() { this.bLu = new LinkedBlockingQueue(); this.bLv = new LayoutParams(); } /* renamed from: SD */ public static C4573d m11591SD() { return C4575a.bLz; } /* renamed from: SE */ private void m11592SE() { if (!this.bLu.isEmpty()) { C4576e eVar = (C4576e) this.bLu.poll(); while (eVar != null) { View anchorView = eVar.getAnchorView(); if (anchorView != null && !m11600ce(anchorView)) { break; } this.bLu.poll(); eVar = (C4576e) this.bLu.peek(); } if (eVar != null) { if (!eVar.isShowing()) { m11596a(eVar, 109528); } else { m11597a(eVar, 109527, m11593a(eVar)); } } } } /* renamed from: a */ private long m11593a(C4576e eVar) { return eVar.mo24856SM() + eVar.mo24855SL(); } /* access modifiers changed from: private */ /* renamed from: a */ public void m11596a(C4576e eVar, int i) { Message obtainMessage = obtainMessage(i); obtainMessage.obj = eVar; sendMessage(obtainMessage); } /* access modifiers changed from: private */ /* renamed from: a */ public void m11597a(C4576e eVar, int i, long j) { Message obtainMessage = obtainMessage(i); obtainMessage.obj = eVar; sendMessageDelayed(obtainMessage, j); } /* renamed from: b */ private void m11598b(final C4576e eVar) { if (!eVar.isShowing()) { final View contentView = eVar.getContentView(); if (!m11600ce(contentView)) { try { if (contentView.getParent() == null && !m11600ce(contentView)) { contentView.setVisibility(4); m11604h(eVar).addView(contentView, m11599c(eVar)); } contentView.requestLayout(); ViewTreeObserver viewTreeObserver = contentView.getViewTreeObserver(); if (viewTreeObserver != null) { viewTreeObserver.addOnGlobalLayoutListener(new OnGlobalLayoutListener() { @TargetApi(16) public void onGlobalLayout() { contentView.getViewTreeObserver().removeOnGlobalLayoutListener(this); C4573d.this.m11596a(eVar, 109529); if (!eVar.mo24858SO()) { C4573d.this.m11597a(eVar, 109530, eVar.mo24856SM() + eVar.mo24853SJ()); } } }); } } catch (Exception unused) { } } } } /* renamed from: c */ private LayoutParams m11599c(C4576e eVar) { if (eVar != null) { C4572c SN = eVar.mo24857SN(); this.bLv.x = SN.getX(); this.bLv.y = SN.getY(); this.bLv.type = 1002; this.bLv.format = 1; this.bLv.width = -1; this.bLv.gravity = 51; this.bLv.height = -2; this.bLv.token = eVar.getAnchorView().getWindowToken(); this.bLv.flags = eVar.mo24859SP(); return this.bLv; } throw new IllegalArgumentException("Toast can't be null"); } /* renamed from: ce */ private boolean m11600ce(View view) { boolean z = true; if (view == null) { return true; } Context context = view.getContext(); if (context instanceof Activity) { z = ((Activity) context).isFinishing(); } return z; } /* renamed from: d */ private void m11601d(C4576e eVar) { eVar.mo24851SH(); eVar.getContentView().setVisibility(0); } /* renamed from: f */ private void m11602f(C4576e eVar) { View contentView = eVar.getContentView(); if (contentView != null && contentView.getParent() != null) { m11604h(eVar).removeView(contentView); C4576e eVar2 = (C4576e) this.bLu.poll(); if (eVar2 != null) { eVar2.destroy(); } } } /* renamed from: g */ private void m11603g(C4576e eVar) { eVar.mo24852SI(); } /* renamed from: h */ private WindowManager m11604h(C4576e eVar) { return (WindowManager) eVar.getContext().getSystemService("window"); } /* renamed from: a */ public void mo24847a(C4576e eVar, boolean z) { if (this.bLu.size() < 1 || z) { this.bLu.add(eVar); m11592SE(); } } /* renamed from: e */ public void mo24848e(C4576e eVar) { View contentView = eVar.getContentView(); if (contentView != null && contentView.getParent() != null) { m11596a(eVar, 109531); m11597a(eVar, 109532, eVar.mo24854SK()); m11597a(eVar, 109527, eVar.mo24854SK()); } } public void handleMessage(Message message) { C4576e eVar = (C4576e) message.obj; switch (message.what) { case 109527: m11592SE(); return; case 109528: m11598b(eVar); return; case 109529: m11601d(eVar); return; case 109530: mo24848e(eVar); return; case 109531: m11603g(eVar); return; case 109532: m11602f(eVar); return; default: return; } } }
[ "bhagat.singh@cliffex.com" ]
bhagat.singh@cliffex.com
89791aae4c1fbd504d70b39ffec1f51ab6d4cb9f
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-ws/results/XRENDERING-418-19-9-Single_Objective_GGA-WeightedSum/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XWikiCommentHandler_ESTest_scaffolding.java
6ffff73e0be97f5cb524a6e2069a58a2b323c842
[ "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
475
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Tue Mar 31 05:03:42 UTC 2020 */ package org.xwiki.rendering.internal.parser.xhtml.wikimodel; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class XWikiCommentHandler_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
29a176b1ac65df0d9f1f0cd969904241786e8572
4d6c00789d5eb8118e6df6fc5bcd0f671bbcdd2d
/src/main/java/com/alipay/api/response/AlipayUserAgreementSignConfirmResponse.java
ba43f382adf75ee5d4ca2a71f0d016a6cb1fec25
[ "Apache-2.0" ]
permissive
weizai118/payment-alipay
042898e172ce7f1162a69c1dc445e69e53a1899c
e3c1ad17d96524e5f1c4ba6d0af5b9e8fce97ac1
refs/heads/master
2020-04-05T06:29:57.113650
2018-11-06T11:03:05
2018-11-06T11:03:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,784
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.user.agreement.sign.confirm response. * * @author auto create * @since 1.0, 2018-01-08 15:35:38 */ public class AlipayUserAgreementSignConfirmResponse extends AlipayResponse { private static final long serialVersionUID = 5434834418137376172L; /** * 支付宝系统中用以唯一标识用户签约记录的编号。 */ @ApiField("agreement_no") private String agreementNo; /** * 是否海外购汇身份。值:T/F */ @ApiField("forex_eligible") private String forexEligible; /** * 协议的当前状态。 1. TEMP:暂存,协议未生效过; 2. NORMAL:正常; 3. STOP:暂停。 */ @ApiField("status") private String status; /** * Sets agreement no. * * @param agreementNo the agreement no */ public void setAgreementNo(String agreementNo) { this.agreementNo = agreementNo; } /** * Gets agreement no. * * @return the agreement no */ public String getAgreementNo( ) { return this.agreementNo; } /** * Sets forex eligible. * * @param forexEligible the forex eligible */ public void setForexEligible(String forexEligible) { this.forexEligible = forexEligible; } /** * Gets forex eligible. * * @return the forex eligible */ public String getForexEligible( ) { return this.forexEligible; } /** * Sets status. * * @param status the status */ public void setStatus(String status) { this.status = status; } /** * Gets status. * * @return the status */ public String getStatus( ) { return this.status; } }
[ "hanley@thlws.com" ]
hanley@thlws.com
4c1791ace1538e5fd8a848db22db31358d32b05e
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/95/256.java
3efb87cc2d8eb7585ca4b5123d328d0000bcffee
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
676
java
package <missing>; public class GlobalMembers { public static int Main() { String s = new String(new char[250]); String t = new String(new char[250]); int i; s = new Scanner(System.in).nextLine(); t = new Scanner(System.in).nextLine(); for (i = 0;i < s.length();i++) { if (s.charAt(i) >= 65 && s.charAt(i) <= 92) { s.charAt(i) += 32; } } for (i = 0;i < t.length();i++) { if (t.charAt(i) >= 65 && t.charAt(i) <= 92) { t.charAt(i) += 32; } } if (strcmp(s,t) > 0) { System.out.print(">\n"); } else if (strcmp(s,t) < 0) { System.out.print("<\n"); } else { System.out.print("=\n"); } return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
bf17d74b81ab414109cec6b77dbaa14fb91f11f5
db3671948281979c425667f79fdb5dd61a683d60
/src/main/java/xyz/jetdrone/vertx/lambda/aws/event/APIGatewayProxyResponse.java
790c432b8776deedabb45029caa54f93f416f26e
[]
no_license
pmlopes/vertx-lambda-runtime
11b5b048bba2e1b6d3fefcfc60692c7a24b3f94f
89d44e18e57a5828d0e392943b372cbf600e7a0f
refs/heads/develop
2021-07-06T14:07:09.885054
2019-11-12T19:55:19
2019-11-12T19:55:19
193,095,258
2
1
null
2020-10-13T14:27:37
2019-06-21T12:35:45
Java
UTF-8
Java
false
false
1,453
java
package xyz.jetdrone.vertx.lambda.aws.event; import io.vertx.codegen.annotations.DataObject; import io.vertx.core.json.JsonObject; @DataObject(generateConverter = true) public class APIGatewayProxyResponse { public APIGatewayProxyResponse() {} public APIGatewayProxyResponse(JsonObject json) { APIGatewayProxyResponseConverter.fromJson(json, this); } public JsonObject toJson() { JsonObject json = new JsonObject(); APIGatewayProxyResponseConverter.toJson(this, json); return json; } private String body; private JsonObject headers; private Boolean isBase64Encoded; private Integer statusCode; public String getBody() { return body; } public APIGatewayProxyResponse setBody(String body) { this.body = body; return this; } public JsonObject getHeaders() { return headers; } public APIGatewayProxyResponse setHeaders(JsonObject headers) { this.headers = headers; return this; } public Boolean getIsBase64Encoded() { return isBase64Encoded; } public APIGatewayProxyResponse setIsBase64Encoded(Boolean isBase64Encoded) { this.isBase64Encoded = isBase64Encoded; return this; } public Integer getStatusCode() { return statusCode; } public APIGatewayProxyResponse setStatusCode(Integer statusCode) { this.statusCode = statusCode; return this; } @Override public String toString() { return toJson().encodePrettily(); } }
[ "pmlopes@gmail.com" ]
pmlopes@gmail.com
ad3062de9b7190b1d9899d967ee895e197a976b2
ecaf6ec5b5429928d41d23883e11e129729a7374
/cargo/map/src/main/java/org/qsardb/cargo/map/ReferencesCargo.java
05d49918446e03c96e757750856964b477503f28
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
qsardb/qsardb
615fa33241bcf792a80693dd7215b4d50d76347b
7e11747c5fd108d5aee31bc0dbfad26b48142351
refs/heads/master
2023-05-30T03:49:59.387275
2021-06-21T12:11:25
2021-06-21T12:11:25
7,729,841
4
0
BSD-3-Clause
2021-06-22T12:36:30
2013-01-21T09:43:11
Java
UTF-8
Java
false
false
895
java
/* * Copyright (c) 2009 University of Tartu */ package org.qsardb.cargo.map; import java.io.*; import java.util.*; import org.qsardb.model.*; public class ReferencesCargo extends MapCargo<Parameter> { protected ReferencesCargo(Descriptor descriptor){ super(ReferencesCargo.ID, descriptor); } protected ReferencesCargo(Prediction prediction){ super(ReferencesCargo.ID, prediction); } protected ReferencesCargo(Property property){ super(ReferencesCargo.ID, property); } @Override protected String keyName(){ return "Compound Id"; } @Override protected String valueName(){ return "BibTeX entry key(s)"; } public Map<String, String> loadReferences() throws IOException { return loadStringMap(); } public void storeReferences(Map<String, String> references) throws IOException { storeStringMap(references); } public static final String ID = "references"; }
[ "villu.ruusmann@gmail.com" ]
villu.ruusmann@gmail.com
1d53f6fa253a2c06646343e065001a6886fcd293
db22a3f5794985785a32e3d5f2aa317e028c2bff
/jgt-jgrassgears/src/test/java/org/jgrasstools/gears/TestFeatureUtils.java
77ca2300792026b95598c321be0f072a7831b196
[]
no_license
wuletawu/UBN_Adige_Project
b5aabe6ef5223f84a342eaadbcad977d1afaa478
85a0c12a999591c0c6ab0e22fea01b520691f6a4
refs/heads/master
2021-01-10T01:52:45.754382
2015-10-03T16:59:35
2015-10-03T16:59:35
43,604,571
1
1
null
null
null
null
UTF-8
Java
false
false
3,263
java
package org.jgrasstools.gears; import java.util.HashMap; import java.util.List; import org.geotools.coverage.grid.GridCoverage2D; import org.geotools.feature.simple.SimpleFeatureBuilder; import org.geotools.feature.simple.SimpleFeatureTypeBuilder; import org.geotools.referencing.crs.DefaultGeographicCRS; import org.jgrasstools.gears.utils.HMTestCase; import org.jgrasstools.gears.utils.HMTestMaps; import org.jgrasstools.gears.utils.RegionMap; import org.jgrasstools.gears.utils.coverage.CoverageUtilities; import org.jgrasstools.gears.utils.features.FeatureUtilities; import org.jgrasstools.gears.utils.geometry.GeometryUtilities; import org.opengis.feature.simple.SimpleFeature; import org.opengis.feature.simple.SimpleFeatureType; import org.opengis.referencing.crs.CoordinateReferenceSystem; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Envelope; import com.vividsolutions.jts.geom.Point; import com.vividsolutions.jts.geom.Polygon; /** * Test FeatureUtils. * * @author Andrea Antonello (www.hydrologis.com) */ public class TestFeatureUtils extends HMTestCase { @SuppressWarnings("nls") public void testFeatureUtils() throws Exception { SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder(); b.setName("typename"); b.setCRS(DefaultGeographicCRS.WGS84); b.add("the_geom", Point.class); b.add("AttrName", String.class); SimpleFeatureType type = b.buildFeatureType(); SimpleFeatureBuilder builder = new SimpleFeatureBuilder(type); Object[] values = new Object[]{GeometryUtilities.gf().createPoint(new Coordinate(0, 0)), "test"}; builder.addAll(values); SimpleFeature feature = builder.buildFeature(type.getTypeName()); Object attr = FeatureUtilities.getAttributeCaseChecked(feature, "attrname"); assertEquals("test", attr.toString()); attr = FeatureUtilities.getAttributeCaseChecked(feature, "attrnam"); assertNull(attr); } public void testGridCellGeoms() throws Exception { double[][] mapData = HMTestMaps.mapData; CoordinateReferenceSystem crs = HMTestMaps.getCrs(); HashMap<String, Double> envelopeParams = HMTestMaps.getEnvelopeparams(); GridCoverage2D inElev = CoverageUtilities.buildCoverage("elevation", mapData, envelopeParams, crs, true); //$NON-NLS-1$ RegionMap regionMap = CoverageUtilities.getRegionParamsFromGridCoverage(inElev); double east = regionMap.getEast(); double north = regionMap.getNorth(); double south = regionMap.getSouth(); int nCols = regionMap.getCols(); int nRows = regionMap.getRows(); List<Polygon> cellPolygons = FeatureUtilities.gridcoverageToCellPolygons(inElev); int size = nCols * nRows; assertEquals(size, cellPolygons.size()); Polygon polygon = cellPolygons.get(9); Envelope env = polygon.getEnvelopeInternal(); assertEquals(east, env.getMaxX(), DELTA); assertEquals(north, env.getMaxY(), DELTA); polygon = cellPolygons.get(size - 1); env = polygon.getEnvelopeInternal(); assertEquals(east, env.getMaxX(), DELTA); assertEquals(south, env.getMinY(), DELTA); } }
[ "wuletawu979@yahoo.com" ]
wuletawu979@yahoo.com
60427ddb053766322c69fc6dcb8182f523b92a5f
7ced6c0ed03f2f9345bbc06a09dbbcf5c8687619
/catering-basic-server/catering-admin/catering-admin-server/src/main/java/com/meiyuan/catering/admin/dao/CateringAdvertisingExtMapper.java
18cf71911bd7f3da55ddf146410fdc6898c8688d
[]
no_license
haorq/food-word
c14d5752c6492aed4a6a1410f9e0352479460da0
18a71259d77b4d96261dab8ed51ca1f109ab5c2f
refs/heads/master
2023-01-01T12:19:48.967366
2020-10-26T07:32:25
2020-10-26T07:32:25
307,292,398
1
0
null
null
null
null
UTF-8
Java
false
false
406
java
package com.meiyuan.catering.admin.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.meiyuan.catering.admin.entity.CateringAdvertisingExtEntity; import org.apache.ibatis.annotations.Mapper; /** * description: * * @author yy * @version 1.4.0 * @date 2020/9/2 15:57 */ @Mapper public interface CateringAdvertisingExtMapper extends BaseMapper<CateringAdvertisingExtEntity> { }
[ "386234736" ]
386234736
d0ad5ad52e6829b13def4a0ff0b072dba25b57b4
b4d21a82f6e960aa8218e9bddb6611a5c1f7e0d0
/web/src/main/java/com/hangjiang/action/config/JmsConfig.java
9ea5b59440b38972bc0a11701fb966d7285d0578
[]
no_license
jianghang/SpringBoot-Action
ed6a15b375071d84bca19721109d8337ba85bdb4
0759f866e57c88df1d7dac91dadc2070ffd90467
refs/heads/master
2021-01-20T13:07:42.344777
2017-12-14T08:32:27
2017-12-14T08:32:27
90,451,075
0
0
null
null
null
null
UTF-8
Java
false
false
1,788
java
package com.hangjiang.action.config; import org.apache.activemq.ActiveMQConnectionFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.jms.annotation.EnableJms; import org.springframework.jms.config.DefaultJmsListenerContainerFactory; import org.springframework.jms.core.JmsTemplate; import javax.jms.ConnectionFactory; /** * Created by jianghang on 2017/6/13. */ @Configuration @Profile("prod") @EnableJms public class JmsConfig { @Value("${jms.broker-url}") private String brokerUrl; @Value("${jms.user}") private String user; @Value("${jms.user}") private String password; @Bean public ConnectionFactory connectionFactory(){ ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory(); activeMQConnectionFactory.setBrokerURL(brokerUrl); activeMQConnectionFactory.setUserName(user); activeMQConnectionFactory.setPassword(password); return activeMQConnectionFactory; } @Bean public JmsTemplate jmsTemplate(){ return new JmsTemplate(connectionFactory()); } @Bean(name = "jmsQueueListenerCF") public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(){ DefaultJmsListenerContainerFactory jmsListenerContainerFactory = new DefaultJmsListenerContainerFactory(); jmsListenerContainerFactory.setConnectionFactory(connectionFactory()); jmsListenerContainerFactory.setConcurrency("3-10"); jmsListenerContainerFactory.setRecoveryInterval(3000L); return jmsListenerContainerFactory; } }
[ "664019848@qq.com" ]
664019848@qq.com
66dc65557b85cf0267b929a77a4582f9881ba1a4
17069154b30562aed84bc847d48223e94b038577
/minecraft/pixelmon/enums/EnumPokeballs.java
5485353e03700489c90f950e78adf118a5165244
[]
no_license
LethalInjection/Pixelmon
49ad0b5a36248624490cdf33ea6c00e09e31db27
e96b56bb8ea2b09cacac06c23e2a7822febf2ed9
refs/heads/master
2020-12-25T04:28:39.498852
2012-07-25T20:53:30
2012-07-25T20:53:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,142
java
package pixelmon.enums; import net.minecraft.src.Item; import net.minecraft.src.mod_Pixelmon; public enum EnumPokeballs { PokeBall(0, 1, "pokeball"), GreatBall(1, 1.5, "greatball"), UltraBall(2, 2, "ultraball"), MasterBall(3, 255, "masterball"); private EnumPokeballs(int index, double ballBonus, String filenamePrefix) { this.ballBonus = ballBonus; this.index = index; this.filenamePrefix = filenamePrefix; } private double ballBonus; private int index; private String filenamePrefix; public double getBallBonus() { return ballBonus; } public int getIndex(){ return index; } public Item getItem(){ if (index ==0) return mod_Pixelmon.pokeBall; if (index ==1) return mod_Pixelmon.greatBall; if (index ==2) return mod_Pixelmon.ultraBall; if (index ==3) return mod_Pixelmon.masterBall; return mod_Pixelmon.pokeBall; } public String getTexture() { return filenamePrefix + ".png"; } public String getFlashRedTexture() { return filenamePrefix + "_flashing.png"; } public String getCaptureTexture() { return filenamePrefix + "_captured.png"; } }
[ "malc.geddes@gmail.com" ]
malc.geddes@gmail.com
34c6f4a6dedcb898abb3638a9777e65d1ba09966
0f1f7332b8b06d3c9f61870eb2caed00aa529aaa
/ebean/tags/v2.6.1/src/main/java/com/avaje/ebeaninternal/server/deploy/parse/AnnotationClass.java
99de3dd822079c63ceb9e329bced996c8de6a0a1
[]
no_license
rbygrave/sourceforge-ebean
7e52e3ef439ed64eaf5ce48e0311e2625f7ee5ed
694274581a188be664614135baa3e4697d52d6fb
refs/heads/master
2020-06-19T10:29:37.011676
2019-12-17T22:09:29
2019-12-17T22:09:29
196,677,514
1
0
null
2019-12-17T22:07:13
2019-07-13T04:21:16
Java
UTF-8
Java
false
false
6,745
java
/** * Copyright (C) 2006 Robin Bygrave * * This file is part of Ebean. * * Ebean 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. * * Ebean 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 Ebean; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ package com.avaje.ebeaninternal.server.deploy.parse; import javax.persistence.Embeddable; import javax.persistence.Entity; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import com.avaje.ebean.annotation.CacheStrategy; import com.avaje.ebean.annotation.LdapDomain; import com.avaje.ebean.annotation.NamedUpdate; import com.avaje.ebean.annotation.NamedUpdates; import com.avaje.ebean.annotation.UpdateMode; import com.avaje.ebean.config.TableName; import com.avaje.ebeaninternal.server.core.ReferenceOptions; import com.avaje.ebeaninternal.server.deploy.DeployNamedQuery; import com.avaje.ebeaninternal.server.deploy.DeployNamedUpdate; import com.avaje.ebeaninternal.server.deploy.BeanDescriptor.EntityType; /** * Read the class level deployment annotations. */ public class AnnotationClass extends AnnotationParser { public AnnotationClass(DeployBeanInfo<?> info) { super(info); } /** * Read the class level deployment annotations. */ public void parse() { read(descriptor.getBeanType()); setTableName(); } /** * Set the table name if it has not already been set. */ private void setTableName() { if (descriptor.isBaseTableType()) { // default the TableName using NamingConvention. TableName tableName = namingConvention.getTableName(descriptor.getBeanType()); descriptor.setBaseTable(tableName); } } private String[] parseLdapObjectclasses(String objectclasses) { if (objectclasses == null || objectclasses.length() == 0){ return null; } return objectclasses.split(","); } private boolean isXmlElement(Class<?> cls) { XmlRootElement rootElement = cls.getAnnotation(XmlRootElement.class); if (rootElement != null){ return true; } XmlType xmlType = cls.getAnnotation(XmlType.class); if (xmlType != null){ return true; } return false; } private void read(Class<?> cls) { LdapDomain ldapDomain = cls.getAnnotation(LdapDomain.class); if (ldapDomain != null) { descriptor.setName(cls.getSimpleName()); descriptor.setEntityType(EntityType.LDAP); descriptor.setLdapBaseDn(ldapDomain.baseDn()); descriptor.setLdapObjectclasses(parseLdapObjectclasses(ldapDomain.objectclass())); } Entity entity = cls.getAnnotation(Entity.class); if (entity != null){ //checkDefaultConstructor(); if (entity.name().equals("")) { descriptor.setName(cls.getSimpleName()); } else { descriptor.setName(entity.name()); } } else if (isXmlElement(cls)) { descriptor.setName(cls.getSimpleName()); descriptor.setEntityType(EntityType.XMLELEMENT); } Embeddable embeddable = cls.getAnnotation(Embeddable.class); if (embeddable != null){ descriptor.setEntityType(EntityType.EMBEDDED); descriptor.setName("Embeddable:"+cls.getSimpleName()); } UpdateMode updateMode = cls.getAnnotation(UpdateMode.class); if (updateMode != null){ descriptor.setUpdateChangesOnly(updateMode.updateChangesOnly()); } NamedQueries namedQueries = cls.getAnnotation(NamedQueries.class); if (namedQueries != null){ readNamedQueries(namedQueries); } NamedQuery namedQuery = cls.getAnnotation(NamedQuery.class); if (namedQuery != null){ readNamedQuery(namedQuery); } NamedUpdates namedUpdates = cls.getAnnotation(NamedUpdates.class); if (namedUpdates != null){ readNamedUpdates(namedUpdates); } NamedUpdate namedUpdate = cls.getAnnotation(NamedUpdate.class); if (namedUpdate != null){ readNamedUpdate(namedUpdate); } CacheStrategy cacheStrategy = cls.getAnnotation(CacheStrategy.class); if (cacheStrategy != null){ readCacheStrategy(cacheStrategy); } } private void readCacheStrategy(CacheStrategy cacheStrategy){ boolean useCache = cacheStrategy.useBeanCache(); boolean readOnly = cacheStrategy.readOnly(); String warmingQuery = cacheStrategy.warmingQuery(); ReferenceOptions opt = new ReferenceOptions(useCache, readOnly, warmingQuery); descriptor.setReferenceOptions(opt); } private void readNamedQueries(NamedQueries namedQueries) { NamedQuery[] queries = namedQueries.value(); for (int i = 0; i < queries.length; i++) { readNamedQuery(queries[i]); } } private void readNamedQuery(NamedQuery namedQuery) { DeployNamedQuery q = new DeployNamedQuery(namedQuery); descriptor.add(q); } private void readNamedUpdates(NamedUpdates updates) { NamedUpdate[] updateArray = updates.value(); for (int i = 0; i < updateArray.length; i++) { readNamedUpdate(updateArray[i]); } } private void readNamedUpdate(NamedUpdate update) { DeployNamedUpdate upd = new DeployNamedUpdate(update); descriptor.add(upd); } // /** // * Check to see if the Entity bean has a default constructor. // * <p> // * If it does not then it is expected that this entity bean has an // * associated BeanFinder. // * </p> // */ // private void checkDefaultConstructor() { // // Class<?> beanType = descriptor.getBeanType(); // // Constructor<?> defaultConstructor; // try { // defaultConstructor = beanType.getConstructor((Class[]) null); // if (defaultConstructor == null) { // String m = "No default constructor on "+beanType; // throw new PersistenceException(m); // } // } catch (SecurityException e) { // String m = "Error checking for default constructor on "+beanType; // throw new PersistenceException(m, e); // // } catch (NoSuchMethodException e) { // String m = "No default constructor on "+beanType; // throw new PersistenceException(m); // } // } }
[ "208973+rbygrave@users.noreply.github.com" ]
208973+rbygrave@users.noreply.github.com
c857231a8d70dbbca9bf48fdbefbaddefde88de9
efb7efbbd6baa5951748dfbe4139e18c0c3608be
/sources/com/bitcoin/mwallet/core/interactors/CreateTxInteractor$sendBip70$1.java
4d9d74c0ea349328ccd829681f9b4cba152857e1
[]
no_license
blockparty-sh/600302-1_source_from_JADX
08b757291e7c7a593d7ec20c7c47236311e12196
b443bbcde6def10895756b67752bb1834a12650d
refs/heads/master
2020-12-31T22:17:36.845550
2020-02-07T23:09:42
2020-02-07T23:09:42
239,038,650
0
0
null
null
null
null
UTF-8
Java
false
false
3,021
java
package com.bitcoin.mwallet.core.interactors; import kotlin.Metadata; import kotlin.coroutines.Continuation; import kotlin.coroutines.jvm.internal.ContinuationImpl; import kotlin.coroutines.jvm.internal.DebugMetadata; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @Metadata(mo37403bv = {1, 0, 3}, mo37404d1 = {"\u0000,\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u0004\u0018\u00010\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u00072\f\u0010\b\u001a\b\u0012\u0004\u0012\u00020\n0\t2\f\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\r0\fH†@ø\u0001\u0000"}, mo37405d2 = {"sendBip70", "", "walletData", "Lcom/bitcoin/mwallet/app/flows/sendv2/entity/SendWalletData;", "utxoSelection", "Lcom/bitcoin/mwallet/core/models/tx/utxo/UtxoSelection;", "bip70Url", "", "bip70Outputs", "", "Lcom/bitcoin/mwallet/core/models/bip70payment/Bip70PaymentOutput;", "continuation", "Lkotlin/coroutines/Continuation;", "Lcom/bitcoin/mwallet/core/services/tx/Bip70BroadcastTxResponse;"}, mo37406k = 3, mo37407mv = {1, 1, 15}) @DebugMetadata(mo37999c = "com.bitcoin.mwallet.core.interactors.CreateTxInteractor", mo38000f = "CreateTxInteractor.kt", mo38001i = {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4}, mo38002l = {71, 72, 85, 86, 88}, mo38003m = "sendBip70", mo38004n = {"this", "walletData", "utxoSelection", "bip70Url", "bip70Outputs", "this", "walletData", "utxoSelection", "bip70Url", "bip70Outputs", "this", "walletData", "utxoSelection", "bip70Url", "bip70Outputs", "changeAddress", "sendRequest", "this", "walletData", "utxoSelection", "bip70Url", "bip70Outputs", "changeAddress", "sendRequest", "this", "walletData", "utxoSelection", "bip70Url", "bip70Outputs", "changeAddress", "sendRequest", "depositAddress"}, mo38005s = {"L$0", "L$1", "L$2", "L$3", "L$4", "L$0", "L$1", "L$2", "L$3", "L$4", "L$0", "L$1", "L$2", "L$3", "L$4", "L$5", "L$6", "L$0", "L$1", "L$2", "L$3", "L$4", "L$5", "L$6", "L$0", "L$1", "L$2", "L$3", "L$4", "L$5", "L$6", "L$7"}) /* compiled from: CreateTxInteractor.kt */ final class CreateTxInteractor$sendBip70$1 extends ContinuationImpl { Object L$0; Object L$1; Object L$2; Object L$3; Object L$4; Object L$5; Object L$6; Object L$7; int label; /* synthetic */ Object result; final /* synthetic */ CreateTxInteractor this$0; CreateTxInteractor$sendBip70$1(CreateTxInteractor createTxInteractor, Continuation continuation) { this.this$0 = createTxInteractor; super(continuation); } @Nullable public final Object invokeSuspend(@NotNull Object obj) { this.result = obj; this.label |= Integer.MIN_VALUE; return this.this$0.sendBip70(null, null, null, null, this); } }
[ "hello@blockparty.sh" ]
hello@blockparty.sh
d6141b7d64e6441cdce3fa683e9947e0058a99c9
e124c06aa37b93502a84f8931e1e792539883b9d
/JDiveLog/jdivelog/src/net/sf/jdivelog/gui/util/CheckboxRenderer.java
21d4af8505cf5969aca82b3c5da5d7f91d4dd1c8
[]
no_license
m-shayanshafi/FactRepositoryProjects
12d7b65505c1e0a8e0ec3577cf937a1e3d17c417
1d45d667b454064107d78213e8cd3ec795827b41
refs/heads/master
2020-06-13T12:04:53.891793
2016-12-02T11:30:49
2016-12-02T11:30:49
75,389,381
1
0
null
null
null
null
UTF-8
Java
false
false
2,280
java
/* * Project: JDiveLog: A Dive Logbook written in Java * File: CheckboxRenderer.java * * @author Pascal Pellmont <jdivelog@pellmont.dyndns.org> * * This file is part of JDiveLog. * JDiveLog is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * JDiveLog 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 JDiveLog; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sf.jdivelog.gui.util; import java.awt.Component; import javax.swing.JCheckBox; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.table.TableCellRenderer; /** * Table Cell Renderer for Checkboxes * * @author Pascal Pellmont <jdivelog@pellmont.dyndns.org> */ public class CheckboxRenderer extends JPanel implements TableCellRenderer { private static final long serialVersionUID = -6699696554251679774L; private final JCheckBox checkbox; public CheckboxRenderer() { checkbox = new JCheckBox(); add(checkbox); } /** * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int) */ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (isSelected) { setForeground(table.getSelectionForeground()); super.setBackground(table.getSelectionBackground()); } else { setForeground(table.getForeground()); setBackground(table.getBackground()); } // Select the current value if (value instanceof Boolean) { checkbox.setSelected((Boolean)value); } else { checkbox.setSelected(false); } return this; } }
[ "mshayanshafi@gmail.com" ]
mshayanshafi@gmail.com
5ebe8199d063cd7ac73e53c629584af71ce4a827
6afd06dafa2df5fb544f34183dad2b3720f220ef
/simple-samples/simple-db2/src-gen/org/sample/model/NewPerson.java
50caca2f4f3d95fd8a6a574432b64f50bec7187d
[]
no_license
asputa/sql-processor
20da89837afb3744fda3403b3f8a5233479e492b
bd00605cb22e7b41b6f30cf5cf13badb76bb06d7
refs/heads/master
2021-01-14T08:41:25.872730
2014-12-10T08:42:53
2014-12-10T08:42:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,079
java
package org.sample.model; import java.util.Date; import java.io.Serializable; public class NewPerson implements Serializable { private static final long serialVersionUID = 1L; public NewPerson() { } private Long newid; public Long getNewid() { return newid; } public void setNewid(Long newid) { this.newid = newid; } public NewPerson _setNewid(Long newid) { this.newid = newid; return this; } private Date dateOfBirth; public Date getDateOfBirth() { return dateOfBirth; } public void setDateOfBirth(Date dateOfBirth) { this.dateOfBirth = dateOfBirth; } public NewPerson _setDateOfBirth(Date dateOfBirth) { this.dateOfBirth = dateOfBirth; return this; } private String ssn; public String getSsn() { return ssn; } public void setSsn(String ssn) { this.ssn = ssn; } public NewPerson _setSsn(String ssn) { this.ssn = ssn; return this; } private String firstName; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public NewPerson _setFirstName(String firstName) { this.firstName = firstName; return this; } private String lastName; public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public NewPerson _setLastName(String lastName) { this.lastName = lastName; return this; } private String gender; public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public NewPerson _setGender(String gender) { this.gender = gender; return this; } @Override public String toString() { return "NewPerson [dateOfBirth=" + dateOfBirth + ", lastName=" + lastName + ", ssn=" + ssn + ", gender=" + gender + ", firstName=" + firstName + ", newid=" + newid + "]"; } public String toStringFull() { return "NewPerson [newid=" + newid + ", dateOfBirth=" + dateOfBirth + ", ssn=" + ssn + ", firstName=" + firstName + ", lastName=" + lastName + ", gender=" + gender + "]"; } }
[ "Vladimir.Hudec@gmail.com" ]
Vladimir.Hudec@gmail.com
05d6338ce52b37535e4f6ed95742eca1073d9f1f
d74149d5a5d3d023661507ad2583f945cdaf3209
/spring-boot-security/src/main/java/com/rainbow/tony/security/config/ShiroBaseConfig.java
a71dff9e6a0f71c9c3e54b4cabf0af4d32cf9111
[]
no_license
softPrisoner/tony-spring-boot
9363aee45a244b7bc544dcd161cffd236e117fd9
ea887f81938665840631231a78e91e0b4e1f8833
refs/heads/master
2022-06-28T02:46:57.086641
2020-07-22T07:28:12
2020-07-22T07:28:12
199,547,376
0
0
null
2022-06-17T22:20:00
2019-07-30T00:52:24
Java
UTF-8
Java
false
false
1,515
java
package com.rainbow.tony.security.config; import com.rainbow.tony.security.realm.UserRealm; import org.apache.shiro.mgt.RealmSecurityManager; import org.apache.shiro.spring.web.ShiroFilterFactoryBean; import org.apache.shiro.web.mgt.DefaultWebSecurityManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import java.util.LinkedHashMap; import java.util.Map; /** * @author tony * @describe shiroBaseConfig * @date 2019-09-02 */ @Configuration public class ShiroBaseConfig { public UserRealm getUserRealm() { return new UserRealm(); } public RealmSecurityManager getSecurityManager() { DefaultWebSecurityManager manager = new DefaultWebSecurityManager(); manager.setRealm(getUserRealm()); return manager; } @Bean public ShiroFilterFactoryBean shiroFilterFactoryBean() { //init filter bean ShiroFilterFactoryBean bean = new ShiroFilterFactoryBean(); bean.setSecurityManager(getSecurityManager()); //login page url bean.setLoginUrl("/v1/user/loginPre"); //success bean.setSuccessUrl("/v1/user/index"); //set unauthorized path bean.setUnauthorizedUrl("/404"); //通过map映射配置路径拦截映射 Map<String, String> map = new LinkedHashMap<>(); map.put("/login", "anon"); map.put("/**", "authc"); bean.setFilterChainDefinitionMap(map); return bean; } }
[ "wabslygzj@163.com" ]
wabslygzj@163.com
70f09d1cfcf31f1607862e68858f8fea91e8bb42
3b510e7c35a0d6d10131436f09fb81a3f9414c13
/randoop/src/test/java/randoop/test/symexamples/HeapArray.java
024dab50f976410c4583d58f605297c7edc6d471
[ "MIT", "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
Groostav/CMPT880-term-project
f9e680b5d54f6ff18ee2e21f091b0732bb831220
6120c4de0780aaea78870c3842be9a299b9e3100
refs/heads/master
2016-08-12T22:05:57.654319
2016-04-19T08:13:43
2016-04-19T08:13:43
55,188,786
0
1
null
null
null
null
UTF-8
Java
false
false
3,508
java
package randoop.test.symexamples; public class HeapArray { private int size; private Comparable[] array; public Object extractMax() { if ((((size == 0) && ++randoopCoverageInfo.branchTrue[0] != 0) || ++randoopCoverageInfo.branchFalse[0] == 0)) throw new IllegalArgumentException(); Object o = array[0]; array[0] = array[--size]; array[size] = null; heapifyDown(0); return o; } private void heapifyDown(int index) { int son; Comparable elm = array[index]; son = index * 2 + 1; if (((((son + 1 < size) && (array[son].compareTo(array[son + 1]) < 0)) && ++randoopCoverageInfo.branchTrue[1] != 0) || ++randoopCoverageInfo.branchFalse[1] == 0)) son = son + 1; while (((((son < size) && (elm.compareTo(array[son]) < 0)) && ++randoopCoverageInfo.branchTrue[4] != 0) || ++randoopCoverageInfo.branchFalse[4] == 0)) { array[index] = array[son]; index = son; son = son * 2 + 1; if (((((son + 1 < size) && (array[son].compareTo(array[son + 1]) < 0)) && ++randoopCoverageInfo.branchTrue[2] != 0) || ++randoopCoverageInfo.branchFalse[2] == 0)) son = son + 1; if ((((son >= size) && ++randoopCoverageInfo.branchTrue[3] != 0) || ++randoopCoverageInfo.branchFalse[3] == 0)) break; } array[index] = elm; } public boolean insert(Comparable element) { if ((((size >= array.length) && ++randoopCoverageInfo.branchTrue[6] != 0) || ++randoopCoverageInfo.branchFalse[6] == 0)) { Comparable temp[] = new Comparable[2 * array.length + 1]; for (int i = 0; (((i < size) && ++randoopCoverageInfo.branchTrue[5] != 0) || ++randoopCoverageInfo.branchFalse[5] == 0); i++) temp[i] = array[i]; array = temp; } array[size] = element; heapifyUp(size); size++; return true; } private void heapifyUp(int index) { while ((((index > 0 && array[(index - 1) / 2].compareTo(array[index]) < 0) && ++randoopCoverageInfo.branchTrue[7] != 0) || ++randoopCoverageInfo.branchFalse[7] == 0)) { Comparable t = array[index]; array[index] = array[(index - 1) / 2]; array[(index - 1) / 2] = t; index = (index - 1) / 2; } } public HeapArray() { array = new Integer[5]; } private static randoop.util.TestCoverageInfo randoopCoverageInfo = null; static { java.util.Map<String, java.util.Set<Integer>> methodToIndices = new java.util.LinkedHashMap<String, java.util.Set<Integer>>(); { java.util.Set<Integer> indexList = new java.util.LinkedHashSet<Integer>(); indexList.add(0); methodToIndices.put(" Object extractMax() ", indexList); } { java.util.Set<Integer> indexList = new java.util.LinkedHashSet<Integer>(); indexList.add(1); indexList.add(2); indexList.add(3); indexList.add(4); methodToIndices.put(" void heapifyDown(int index) ", indexList); } { java.util.Set<Integer> indexList = new java.util.LinkedHashSet<Integer>(); indexList.add(5); indexList.add(6); methodToIndices.put(" boolean insert(Comparable element) ", indexList); } { java.util.Set<Integer> indexList = new java.util.LinkedHashSet<Integer>(); indexList.add(7); methodToIndices.put(" void heapifyUp(int index) ", indexList); } randoopCoverageInfo = new randoop.util.TestCoverageInfo(8, methodToIndices); } }
[ "geoff_groos@msn.com" ]
geoff_groos@msn.com
b41e692baf02335aab562c3c87364fc2d969249a
edba8d09df4ba3e06b5bab3e1784d5bcd83fa386
/src/test/java/com/cinterview/security/SecurityUtilsUnitTest.java
48515d0bfa4e1b49c1d6238e7801cac156d6a9eb
[]
no_license
amrnablus/cinterviewfe
72ed01183203f3f381d4adca0ea7991618c287b6
005808b7b10300f19c8fa3ce84c2970340080e6e
refs/heads/master
2020-03-14T03:37:12.167794
2018-04-28T16:01:51
2018-04-28T16:01:51
131,423,880
0
0
null
null
null
null
UTF-8
Java
false
false
3,197
java
package com.cinterview.security; import org.junit.Test; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; import java.util.ArrayList; import java.util.Collection; import java.util.Optional; import static org.assertj.core.api.Assertions.assertThat; /** * Test class for the SecurityUtils utility class. * * @see SecurityUtils */ public class SecurityUtilsUnitTest { @Test public void testgetCurrentUserLogin() { SecurityContext securityContext = SecurityContextHolder.createEmptyContext(); securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("admin", "admin")); SecurityContextHolder.setContext(securityContext); Optional<String> login = SecurityUtils.getCurrentUserLogin(); assertThat(login).contains("admin"); } @Test public void testgetCurrentUserJWT() { SecurityContext securityContext = SecurityContextHolder.createEmptyContext(); securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("admin", "token")); SecurityContextHolder.setContext(securityContext); Optional<String> jwt = SecurityUtils.getCurrentUserJWT(); assertThat(jwt).contains("token"); } @Test public void testIsAuthenticated() { SecurityContext securityContext = SecurityContextHolder.createEmptyContext(); securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("admin", "admin")); SecurityContextHolder.setContext(securityContext); boolean isAuthenticated = SecurityUtils.isAuthenticated(); assertThat(isAuthenticated).isTrue(); } @Test public void testAnonymousIsNotAuthenticated() { SecurityContext securityContext = SecurityContextHolder.createEmptyContext(); Collection<GrantedAuthority> authorities = new ArrayList<>(); authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS)); securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("anonymous", "anonymous", authorities)); SecurityContextHolder.setContext(securityContext); boolean isAuthenticated = SecurityUtils.isAuthenticated(); assertThat(isAuthenticated).isFalse(); } @Test public void testIsCurrentUserInRole() { SecurityContext securityContext = SecurityContextHolder.createEmptyContext(); Collection<GrantedAuthority> authorities = new ArrayList<>(); authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.USER)); securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("user", "user", authorities)); SecurityContextHolder.setContext(securityContext); assertThat(SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.USER)).isTrue(); assertThat(SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.ADMIN)).isFalse(); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
d74b0e380950a8ea1d7993a33403a89c1246c1d4
5ed0ce6a5bf847ab1bcc99cb9b005e5bd1334067
/src/org/msgpack/template/ListTemplate.java
34d2ca26b0f061625d24b1ce1d233196c78bbae9
[]
no_license
nikitakoselev/Alpha2Sdk
10b0b83cba67d19d49191caa73e67c9f899664ad
ed2efdb5db0ea3a9271c9ebd351bf789b6ba0d37
refs/heads/master
2023-04-10T22:19:30.954805
2021-04-20T20:59:34
2021-04-20T20:59:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,709
java
package org.msgpack.template; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.msgpack.MessageTypeException; import org.msgpack.packer.Packer; import org.msgpack.unpacker.Unpacker; public class ListTemplate<E> extends AbstractTemplate<List<E>> { private Template<E> elementTemplate; public ListTemplate(Template<E> elementTemplate) { this.elementTemplate = elementTemplate; } public void write(Packer pk, List<E> target, boolean required) throws IOException { if (!(target instanceof List)) { if (target == null) { if (required) { throw new MessageTypeException("Attempted to write null"); } else { pk.writeNil(); } } else { throw new MessageTypeException("Target is not a List but " + target.getClass()); } } else { pk.writeArrayBegin(target.size()); Iterator i$ = target.iterator(); while(i$.hasNext()) { E e = i$.next(); this.elementTemplate.write(pk, e); } pk.writeArrayEnd(); } } public List<E> read(Unpacker u, List<E> to, boolean required) throws IOException { if (!required && u.trySkipNil()) { return null; } else { int n = u.readArrayBegin(); if (to == null) { to = new ArrayList(n); } else { ((List)to).clear(); } for(int i = 0; i < n; ++i) { E e = this.elementTemplate.read(u, (Object)null); ((List)to).add(e); } u.readArrayEnd(); return (List)to; } } }
[ "dave@davesnowdon.com" ]
dave@davesnowdon.com
f6b1a4b4ef4bc78b10b702840a0830a3e5b28442
43db367eb6ada48dd6d4aadd442fbf87e84fe752
/springjdbc-mysql/src/main/java/jbr/springjdbc/model/Product.java
6206dadd368405888f3db61460041b853a14aab2
[]
no_license
javabyranjith/spring-framework-jdbc
d1f725563d2cbd1996d6c6647e52089eb4ba203f
42efaac02b63f167eb792c874dc755aa51440081
refs/heads/master
2022-12-20T15:46:40.633711
2020-05-15T15:37:36
2020-05-15T15:37:36
65,965,998
1
2
null
2022-12-16T05:11:12
2016-08-18T04:49:06
TSQL
UTF-8
Java
false
false
382
java
package jbr.springjdbc.model; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; @Getter @Setter @AllArgsConstructor @NoArgsConstructor @ToString public class Product { private String id; private String name; private String category; private String description; private String price; }
[ "java2ranjith@gmail.com" ]
java2ranjith@gmail.com
3466863dad6f34626d98d4b52d3349b61ac1a1e8
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Spring/Spring4403.java
f3a9821cf6f15e63fe37c2226c7ce450b0c211d0
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
550
java
@Nullable public static Class<?> findAnnotationDeclaringClassForTypes(List<Class<? extends Annotation>> annotationTypes, @Nullable Class<?> clazz) { Assert.notEmpty(annotationTypes, "List of annotation types must not be empty"); if (clazz == null || Object.class == clazz) { return null; } for (Class<? extends Annotation> annotationType : annotationTypes) { if (isAnnotationDeclaredLocally(annotationType, clazz)) { return clazz; } } return findAnnotationDeclaringClassForTypes(annotationTypes, clazz.getSuperclass()); }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
cc8246e95624712dbcfeaa05345ebba5a51f65dc
56dac0b380b424bc298a3e6ae2eccfa8ea0c2443
/src/Sort/SortArrayByParity.java
d86efcb0391399c52562b7741349c0b56ec2d7e6
[]
no_license
LeeNJU/NewCode
5ec2c0a14522252f9452bd066880815393c62a31
3914afa6b4f5b4d39c99c8b782f041f432c953a6
refs/heads/master
2022-04-27T15:03:23.598790
2022-04-23T23:21:45
2022-04-23T23:21:45
127,383,774
0
0
null
null
null
null
UTF-8
Java
false
false
1,095
java
package Sort; //题目描述:给定一个非负整数数组,长度为偶数,一半元素为奇数,一半元素为偶数,对数组进行排序,使得所有偶数都对应偶数下标,所有奇数都对应奇数下标,例如[4,2,5,7],返回[4,5,2,7] // 可以有多种答案 //解法描述:遍历数组,找到第一个不符合条件的偶数和奇数,然后进行交换,然后继续遍历 public class SortArrayByParity { private void swap(int[] A, int i, int j) { int temp = A[i]; A[i] = A[j]; A[j] = temp; } public int[] sortArrayByParityII(int[] A) { int i = 0, j = 1, n = A.length; while (i < n && j < n) { // 找到不符合条件的偶数 while (i < n && A[i] % 2 == 0) { i += 2; } // 找到不符合条件的奇数 while (j < n && A[j] % 2 == 1) { j += 2; } // 交换 if (i < n && j < n) { swap(A, i, j); } } return A; } }
[ "haibli@paypal.com" ]
haibli@paypal.com
2b5f2e2d0ac48c3c21c8f8cff513471ba2e1464f
1bb2f686a89338f5ebe15e78dfde2fb4d4f3aa90
/codeworld-cloud-system/src/main/java/com/codeworld/fc/system/user/request/UserUpdateRequest.java
757e2985dc1f54fdb1d7ba079216ffb31133a003
[]
no_license
sang556/codeworld-cloud-shop-api
b3b2260d63e5ba03e7406024064f2b2625c8982a
c171e519dde543b4b4c84eb86209483c5a28d143
refs/heads/master
2023-09-02T06:52:36.471164
2021-10-28T09:12:58
2021-10-28T09:12:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,576
java
package com.codeworld.fc.system.user.request; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; /** * ClassName UserUpdateRequest * Description 用户修改信息 * Author Lenovo * Date 2020/8/15 * Version 1.0 **/ @Data @ApiModel("用户修改信息DTO") public class UserUpdateRequest { @ApiModelProperty("用户Id") @NotNull(message = "用户Id为空") private Long userId; @ApiModelProperty("用户名") @NotNull(message = "用户名为空") private String userName; @ApiModelProperty("用户邮箱") @Email(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$", message = "邮箱格式错误") @NotNull(message = "邮箱为空") private String userEmail; @ApiModelProperty("用户手机") @NotBlank(message = "用户手机为空") private String userPhone; @ApiModelProperty("用户状态") @NotNull(message = "状态为空") private Integer userStatus; @ApiModelProperty("用户类型") @NotNull(message = "类型为空") private Long roleType; @ApiModelProperty("用户部门") @NotNull(message = "用户部门为空") private Long deptIds; @ApiModelProperty("用户区域") @NotNull(message = "请选择用户区域") private String areaName; @ApiModelProperty("区域id") @NotNull(message = "请选择用户区域") private Long areaId; }
[ "1692454247@qq.com" ]
1692454247@qq.com
0a0571ec1c2c8ef02620a56278c33dee33019fe0
24ed7785dd6c50b35ae95e3cbcbc60e0ecf092ac
/src/main/java/br/com/guilhermealvessilve/academic/domain/student/vo/Email.java
2bec3792612a61236316089a2eca9cf046fa30f9
[]
no_license
CarlosEscouto/clean-architecture-quarkus
cdc0755a0b60176fac393502a6f5f0da17ff3db8
f858dadeaa7d010689f2094bd096801d9676c9d7
refs/heads/master
2022-11-11T11:26:11.937137
2020-06-23T20:32:10
2020-06-23T20:32:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,376
java
package br.com.guilhermealvessilve.academic.domain.student.vo; import lombok.EqualsAndHashCode; import lombok.Getter; import java.util.Objects; import java.util.regex.Pattern; @Getter @EqualsAndHashCode public class Email { private static final Pattern EMAIL_PATTERN; static { final String regex = "(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"" + "(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@" + "(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.)" + "{3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"; EMAIL_PATTERN = Pattern.compile(regex); } private final String address; public Email(final String address) { validate(address); this.address = address; } private void validate(String address) { if (!EMAIL_PATTERN.matcher(Objects.requireNonNull(address)) .matches()) { throw new IllegalArgumentException("Invalid email.address: " + address); } } @Override public String toString() { return address; } }
[ "guilherme_alves_silve@hotmail.com" ]
guilherme_alves_silve@hotmail.com
9def33f35cc8167b5239db39e3513ed9bf99c119
5a959164902dad87f927d040cb4b243d39b8ebe3
/qafe-mobile-gwt/src/main/java/com/qualogy/qafe/mgwt/server/ui/assembler/BarChartUIAssembler.java
5fe2e5f965a14f555540836ff6fd078fde96c538
[ "Apache-2.0" ]
permissive
JustusM/qafe-platform
0c8bc824d1faaa6021bc0742f26733bf78408606
0ef3b3d1539bcab16ecd6bfe5485d727606fecf1
refs/heads/master
2021-01-15T11:38:04.044561
2014-09-25T09:20:38
2014-09-25T09:20:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,788
java
/** * Copyright 2008-2014 Qualogy Solutions B.V. * * 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.qualogy.qafe.mgwt.server.ui.assembler; import java.util.ArrayList; import com.qualogy.qafe.bind.core.application.ApplicationContext; import com.qualogy.qafe.bind.domain.ApplicationMapping; import com.qualogy.qafe.bind.presentation.component.BarChart; import com.qualogy.qafe.bind.presentation.component.ChartItem; import com.qualogy.qafe.bind.presentation.component.Component; import com.qualogy.qafe.bind.presentation.component.Window; import com.qualogy.qafe.mgwt.client.vo.ui.BarChartGVO; import com.qualogy.qafe.mgwt.client.vo.ui.CategoryAxisGVO; import com.qualogy.qafe.mgwt.client.vo.ui.ChartItemGVO; import com.qualogy.qafe.mgwt.client.vo.ui.ComponentGVO; import com.qualogy.qafe.mgwt.client.vo.ui.LinearAxisGVO; import com.qualogy.qafe.mgwt.server.helper.UIAssemblerHelper; import com.qualogy.qafe.web.util.SessionContainer; public class BarChartUIAssembler implements UIAssembler { public ComponentGVO convert(Component component, Window currentWindow, ApplicationMapping applicationMapping, ApplicationContext context, SessionContainer ss) { ComponentGVO vo = null; if (component != null) { if (component instanceof BarChart) { BarChart c = (BarChart) component; BarChartGVO voTemp = new BarChartGVO(); UIAssemblerHelper.copyFields(c, currentWindow, voTemp, applicationMapping, context, ss); voTemp.setLegend(c.getLegend()); voTemp.setLinearAxis((LinearAxisGVO)ComponentUIAssembler.convert(c.getLinearAxis(), currentWindow, applicationMapping, context, ss)); if (c.getChartItems()!=null){ voTemp.setChartItems(new ArrayList<ChartItemGVO>()); for (ChartItem ci : c.getChartItems()) { ChartItemGVO ciGvo = (ChartItemGVO)ComponentUIAssembler.convert(ci, currentWindow, applicationMapping, context, ss); voTemp.getChartItems().add(ciGvo); } } voTemp.setCategoryAxis((CategoryAxisGVO) ComponentUIAssembler.convert(c.getCategoryAxis(), currentWindow, applicationMapping, context, ss)); vo = voTemp; } } return vo; } public String getStaticStyleName() { // TODO Auto-generated method stub return null; } }
[ "rkha@f87ad13a-6d31-43dd-9311-282d20640c02" ]
rkha@f87ad13a-6d31-43dd-9311-282d20640c02
39d30f16c32a20f6a706ae26dad29857418f4ea2
6edf6c315706e14dc6aef57788a2abea17da10a3
/com/planet_ink/marble_mud/core/exceptions/marblemudException.java
af1b1fc3cb0a3da40d121c023afc49e697b193c6
[]
no_license
Cocanuta/Marble
c88efd73c46bd152098f588ba1cdc123316df818
4306fbda39b5488dac465a221bf9d8da4cbf2235
refs/heads/master
2020-12-25T18:20:08.253300
2012-09-10T17:09:50
2012-09-10T17:09:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
904
java
package com.planet_ink.marble_mud.core.exceptions; import java.util.*; /* 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. */ public abstract class marblemudException extends Exception { private static final long serialVersionUID = 8932995125810826091L; public marblemudException(String s) { super(s,new Exception()); } public marblemudException(String s, Exception e) { super(s,e); } }
[ "Cocanuta@Gmail.com" ]
Cocanuta@Gmail.com
648c9a947bf24c5e513c4b1f855b1ffe3577381b
b36ef904af22fd77a9911c7a28cd9f50aca79abe
/designPattern/src/com/leosanqing/flyweight/BigCharFactory.java
eec31c6fa055a620b6ed69f0461b12ecb20afa21
[]
no_license
ldjWillow/Java-Notes-1
c8325551ef099eaa1bd0c919697950d827a53258
cce26d5727fee9b5a46c5c3558fc658a9b527580
refs/heads/master
2020-08-24T06:49:02.942645
2019-10-22T00:19:52
2019-10-22T00:19:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
942
java
package com.leosanqing.flyweight; import java.util.HashMap; /** * @Author: leosanqing * @Date: 2019-09-21 10:26 */ public class BigCharFactory { private HashMap<String,BigChar> pool = new HashMap<>(); private static BigCharFactory instance = null; private BigCharFactory(){} public static BigCharFactory getInstance(){ if (instance == null) { synchronized (BigCharFactory.class){ if (instance == null) { instance = new BigCharFactory(); } } } return instance; } // 使用 synchronized 可以防止 多线程情况下 new 出多个实例 public synchronized BigChar getBigChar(char charName){ BigChar bigChar = pool.get(charName+""); if (bigChar == null) { bigChar = new BigChar(charName); pool.put(charName+"",bigChar); } return bigChar; } }
[ "stormleo@qq.com" ]
stormleo@qq.com
b38c82b14b5806fd8a083cba2d9084f866d12da6
29d75cf1c8ffdd684870e753c0ed94e73b785260
/TXTr/src/main/java/nl/harmjanwestra/txtr/TXTr.java
4e71ce8cfb1e6b73acea1b94d7c273d18022763d
[]
no_license
DPCscience/harmjan
ad9bbd932f318cb3f6adaabdfc6cf56d6a6e4846
4ba45020ea30241a26f41cc6c8800fa3e4c79b51
refs/heads/master
2021-07-19T19:07:23.071559
2017-10-27T10:11:07
2017-10-27T10:11:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,566
java
package nl.harmjanwestra.txtr; import org.apache.commons.cli.*; import nl.harmjanwestra.utilities.legacy.genetica.io.Gpio; import nl.harmjanwestra.utilities.legacy.genetica.io.text.TextFile; import java.io.IOException; /** * Created by Harm-Jan on 02/01/16. */ public class TXTr { private static Options OPTIONS; static { OPTIONS = new Options(); Option option; option = Option.builder() .desc("Test GZipped file") .longOpt("testgz") .build(); OPTIONS.addOption(option); option = Option.builder() .desc("Split textfile by lines") .longOpt("split") .build(); OPTIONS.addOption(option); option = Option.builder() .desc("Multiple line hashtag delimited header") .longOpt("multilineheader") .build(); OPTIONS.addOption(option); option = Option.builder() .desc("Merge while skipping first line of all files except 1st") .longOpt("merge") .build(); OPTIONS.addOption(option); option = Option.builder("i") .desc("Input") .hasArg().required() .build(); OPTIONS.addOption(option); option = Option.builder() .longOpt("comma") .desc("input is comma separated (in stead of a single path with locations)") .build(); OPTIONS.addOption(option); option = Option.builder() .longOpt("pattern") .desc("input contains CHR pattern") .build(); OPTIONS.addOption(option); option = Option.builder("n") .desc("Nr lines for splitting") .hasArg() .build(); OPTIONS.addOption(option); option = Option.builder("o") .desc("Input") .hasArg().required() .build(); OPTIONS.addOption(option); } public static void main(String[] args) { TXTr t = new TXTr(); try { CommandLineParser parser = new DefaultParser(); final CommandLine cmd = parser.parse(OPTIONS, args, true); String input = ""; String output = ""; boolean commaseparated = false; if (cmd.hasOption("i")) { input = cmd.getOptionValue("i"); } if (cmd.hasOption("o")) { output = cmd.getOptionValue("o"); } if (cmd.hasOption("comma")) { commaseparated = true; } if (cmd.hasOption("testgz")) { try { t.testGZ(input); } catch (IOException e) { e.printStackTrace(); } } else if (cmd.hasOption("split")) { if (cmd.hasOption("n")) { try { int nrLines = Integer.parseInt(cmd.getOptionValue("n")); try { t.split(input, output, nrLines); } catch (IOException e) { e.printStackTrace(); } } catch (NumberFormatException e) { System.out.println(cmd.getOptionValue("n") + " is not an integer"); } } else { System.out.println("Use -n for --split"); printHelp(); } } else if (cmd.hasOption("merge")) { try { boolean multilineheader = false; if (cmd.hasOption("multilineheader")) { multilineheader = true; } t.mergeSkipHeader(input, output, multilineheader, commaseparated, cmd.hasOption("pattern")); } catch (IOException e) { e.printStackTrace(); } } } catch (ParseException e) { printHelp(); e.printStackTrace(); } } private void testGZ(String input) throws IOException { TextFile tf = new TextFile(input, TextFile.R); int ctr = 0; try { while (tf.readLine() != null) { tf.readLine(); ctr++; if (ctr % 1000 == 0) { System.out.print(ctr + " lines parsed...\r"); } } } catch (Exception e) { System.out.println("File failed at line "+ctr); e.printStackTrace(); } System.out.println(); tf.close(); } public static void printHelp() { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(" ", OPTIONS); System.exit(-1); } public void split(String file, String fileout, int lns) throws IOException { TextFile in = new TextFile(file, TextFile.R); int ctr = 0; int ctr2 = 1; String ln = in.readLine(); TextFile out = new TextFile(fileout + "-" + ctr2, TextFile.W); while (ln != null) { ln = in.readLine(); out.writeln(ln); ctr++; if (ctr % lns == 0) { out.close(); out = new TextFile(fileout + "-" + ctr2, TextFile.W); ctr2++; } } out.close(); in.close(); } public void mergeSkipHeader(String fileList, String output, boolean multilinehashtagheader, boolean commasep, boolean pattern) throws IOException { String[] files = null; if (pattern) { files = new String[22]; for (int i = 1; i < 23; i++) { files[i - 1] = fileList.replaceAll("CHR", "" + i); } } else if (commasep) { files = fileList.split(","); } else { TextFile tf1 = new TextFile(fileList, TextFile.R); files = tf1.readAsArray(); tf1.close(); } boolean headerwritten = false; TextFile out = new TextFile(output, TextFile.W); int fctr = 0; for (String file : files) { if (Gpio.exists(file)) { TextFile in = new TextFile(file, TextFile.R); String ln = in.readLine(); int lnctr = 0; while (ln != null) { if (multilinehashtagheader) { if (ln.startsWith("#")) { if (fctr == 0) { out.writeln(ln); } } else { out.writeln(ln); } } else { if (!headerwritten && lnctr == 0) { out.writeln(ln); headerwritten = true; } else if (lnctr > 0) { out.writeln(ln); } } ln = in.readLine(); lnctr++; } in.close(); fctr++; } else { System.out.println("Warning - could not find file: " + file); } } out.close(); } }
[ "westra.harmjan@outlook.com" ]
westra.harmjan@outlook.com
58ab164ec48dec5c75fc44cb23ec31b51339cc7e
96f7f6322c3e3a5f009dad9bce1e231b5a57a5e8
/LearnJavaMaster/src/PackOCP13GenericsAndCollections/projectGenerics/reduceExample/R05ReducersArraysVsList.java
c5e158c86131574671366b9ba1fd767b97176569
[]
no_license
weder96/javaaula21
09cb63a2e6f3fe7ac34f166315ae3024113a4dd3
8f4245a922eea74747644ad2f4a0f2b3396c319e
refs/heads/main
2023-08-23T10:47:43.216438
2021-10-27T21:46:45
2021-10-27T21:46:45
421,982,565
3
0
null
null
null
null
UTF-8
Java
false
false
540
java
package PackOCP13GenericsAndCollections.projectGenerics.reduceExample; import java.util.*; public class R05ReducersArraysVsList { public static void main(String[] args) { //Reduce Array to sum. int[] array = {30, 10, 20, 40}; int sum = Arrays.stream(array).reduce(0, (x, y) -> x + y); System.out.println("Sum of Array: "+ sum); //Reduce List to sum. List<Integer> list = Arrays.asList(30, 10, 20, 40); sum = list.stream().reduce(0, (x, y) -> x + y); System.out.println("Sum of List: "+ sum); } }
[ "weder96@gmail.com" ]
weder96@gmail.com
e4ca04ed67a7e80975cea0db01cfb048eccc227b
fba8af31d5d36d8a6cf0c341faed98b6cd5ec0cb
/src/main/java/com/alipay/api/domain/AlipayOverseasRemitResultFinishModel.java
8f3ec915e435520423f1cb089933b165e47df7cd
[ "Apache-2.0" ]
permissive
planesweep/alipay-sdk-java-all
b60ea1437e3377582bd08c61f942018891ce7762
637edbcc5ed137c2b55064521f24b675c3080e37
refs/heads/master
2020-12-12T09:23:19.133661
2020-01-09T11:04:31
2020-01-09T11:04:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,193
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 收到汇款的结果 * * @author auto create * @since 1.0, 2019-10-24 13:45:28 */ public class AlipayOverseasRemitResultFinishModel extends AlipayObject { private static final long serialVersionUID = 2446457451256115829L; /** * 汇款结果 */ @ApiField("biz_result_code") private String bizResultCode; /** * 汇款结果描述 */ @ApiField("biz_result_msg") private String bizResultMsg; /** * 失败 */ @ApiField("biz_result_status") private String bizResultStatus; /** * 完成时间 */ @ApiField("complete_time") private String completeTime; /** * 发端的单据号 */ @ApiField("external_biz_no") private String externalBizNo; /** * 接收端的mid */ @ApiField("receiver_mid") private String receiverMid; /** * 发端的mid */ @ApiField("sender_mid") private String senderMid; public String getBizResultCode() { return this.bizResultCode; } public void setBizResultCode(String bizResultCode) { this.bizResultCode = bizResultCode; } public String getBizResultMsg() { return this.bizResultMsg; } public void setBizResultMsg(String bizResultMsg) { this.bizResultMsg = bizResultMsg; } public String getBizResultStatus() { return this.bizResultStatus; } public void setBizResultStatus(String bizResultStatus) { this.bizResultStatus = bizResultStatus; } public String getCompleteTime() { return this.completeTime; } public void setCompleteTime(String completeTime) { this.completeTime = completeTime; } public String getExternalBizNo() { return this.externalBizNo; } public void setExternalBizNo(String externalBizNo) { this.externalBizNo = externalBizNo; } public String getReceiverMid() { return this.receiverMid; } public void setReceiverMid(String receiverMid) { this.receiverMid = receiverMid; } public String getSenderMid() { return this.senderMid; } public void setSenderMid(String senderMid) { this.senderMid = senderMid; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
7c3e0145f75e3aada8e5f0d1e8155ec7a56a86c4
6a0721e593fd7bda990385ea8afb20ead1bff0b8
/src/main/java/com/example/bddspring1586109102/DemoApplication.java
2c917342e14d87261f104108e3bf94470158b7eb
[]
no_license
cb-kubecd/bdd-spring-1586109102
6ee7aa56ffc37992cf2c9b2d9cdbdea0622c71a1
461a71f7d492a574630d37e6e5cbf5b5dea3a19b
refs/heads/master
2021-05-23T12:56:19.753008
2020-04-05T17:52:09
2020-04-05T17:52:09
253,296,825
0
0
null
null
null
null
UTF-8
Java
false
false
320
java
package com.example.bddspring1586109102; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
[ "jenkins-x-test@googlegroups.com" ]
jenkins-x-test@googlegroups.com
31cc28c2ccfa9ebb8c383f0da44f066bccfba85e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_51890408864e8e291d2c8320da638b094d31241a/DescriptorSemanticValidator/8_51890408864e8e291d2c8320da638b094d31241a_DescriptorSemanticValidator_s.java
f3b525b5b47a9c148465c5fc8479d2f3cf789754
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,696
java
package org.zend.php.zendserver.deployment.core.internal.validation; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.core.resources.IFile; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.zend.php.zendserver.deployment.core.DeploymentCore; import org.zend.php.zendserver.deployment.core.descriptor.DeploymentDescriptorPackage; import org.zend.php.zendserver.deployment.core.descriptor.IModelContainer; import org.zend.php.zendserver.deployment.core.descriptor.IModelObject; import org.zend.php.zendserver.deployment.core.internal.descriptor.Feature; public class DescriptorSemanticValidator { private Map<Feature, PropertyTester[]> testers; private IDocument document; private IFile file; public DescriptorSemanticValidator() { testers = new HashMap<Feature, PropertyTester[]>(); PropertyTester tester = new FieldNotEmptyTester(this); add(DeploymentDescriptorPackage.PKG_NAME, tester); add(DeploymentDescriptorPackage.VERSION_RELEASE, tester); add(DeploymentDescriptorPackage.APPDIR, tester); // may be empty but must exist add(DeploymentDescriptorPackage.ID, tester); add(DeploymentDescriptorPackage.DISPLAY, tester); add(DeploymentDescriptorPackage.TYPE, tester); add(DeploymentDescriptorPackage.DEPENDENCY_NAME, tester); add(DeploymentDescriptorPackage.VAR_NAME, tester); add(DeploymentDescriptorPackage.VALUE, tester); tester = new FileExistsTester(this, ValidationStatus.WARNING); add(DeploymentDescriptorPackage.EULA, tester); add(DeploymentDescriptorPackage.ICON, tester); // TODO consider mapping tester = new VersionTester(this); add(DeploymentDescriptorPackage.VERSION_API, tester); add(DeploymentDescriptorPackage.VERSION_RELEASE, tester); } protected void add(Feature feature, PropertyTester tester) { PropertyTester[] now = testers.get(feature); if (now == null) { testers.put(feature, new PropertyTester[] {tester}); } else { PropertyTester[] dest = new PropertyTester[now.length + 1]; System.arraycopy(now, 0, dest,0, now.length); dest[now.length] = tester; testers.put(feature, dest); } } private void validate(int objId, int objNo, IModelObject modelObj, List<ValidationStatus> statuses) { validateProperties(objId, objNo, modelObj, statuses); if (modelObj instanceof IModelContainer) { validate((IModelContainer) modelObj, statuses); } } private void validate(IModelContainer obj, List<ValidationStatus> statuses) { for (Feature f : obj.getChildNames()) { PropertyTester[] featureTests = testers.get(f); if (featureTests != null) { List<Object> children = obj.getChildren(f); for (PropertyTester pt : featureTests) { String msg = pt.test(f, children, obj); if (msg != null) { int offset = obj.getOffset(f); int line = 0; try { line = document.getLineOfOffset(offset) + 1; } catch (BadLocationException e) { // TODO Auto-generated catch block e.printStackTrace(); } statuses.add(new ValidationStatus(-1, -1, f.id, line, offset, offset, pt.severity, msg)); } } } if (f.type == IModelObject.class) { List<Object> children = obj.getChildren(f); for (int i = 0; i < children.size(); i++) { validate(f.id, i, (IModelObject) children.get(i), statuses); } } } } private void validateProperties(int objId, int objNo, IModelObject obj, List<ValidationStatus> statuses) { for (Feature f : obj.getPropertyNames()) { PropertyTester[] featureTests = testers.get(f); if (featureTests != null) { Object value = obj.get(f); for (PropertyTester pt: featureTests) { String msg = pt.test(f, value, obj); if (msg != null) { int offset = obj.getOffset(f); int line = 0; try { line = document.getLineOfOffset(offset) + 1; } catch (BadLocationException e) { DeploymentCore.log(e); } statuses.add(new ValidationStatus(objId, objNo, f.id, line, offset, offset, pt.severity, msg)); } } } } } public ValidationStatus[] validate(IModelObject descr, IDocument document) { this.document = document; List<ValidationStatus> statuses = new ArrayList<ValidationStatus>(); validate(-1, -1, descr, statuses); return statuses.toArray(new ValidationStatus[statuses.size()]); } public void setFile(IFile file) { this.file = file; } public IFile getFile() { return file; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
55fbc5e9f5933352234bc5fe4fdbf293d25d5e71
e6d8ca0907ff165feb22064ca9e1fc81adb09b95
/src/main/java/com/vmware/vim25/ProfileProfileStructureProperty.java
2d5b5aa3aa1b8e9b6b254298018ae82051891c40
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
incloudmanager/incloud-vijava
5821ada4226cb472c4e539643793bddeeb408726
f82ea6b5db9f87b118743d18c84256949755093c
refs/heads/inspur
2020-04-23T14:33:53.313358
2019-07-02T05:59:34
2019-07-02T05:59:34
171,236,085
0
1
BSD-3-Clause
2019-02-20T02:08:59
2019-02-18T07:32:26
Java
UTF-8
Java
false
false
2,399
java
/*================================================================================ Copyright (c) 2013 Steve Jin. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the names of copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================================================*/ package com.vmware.vim25; /** * @author Steve Jin (http://www.doublecloud.org) * @version 5.1 */ @SuppressWarnings("all") public class ProfileProfileStructureProperty extends DynamicData { public String propertyName; public boolean array; public ProfileProfileStructure element; public String getPropertyName() { return this.propertyName; } public boolean isArray() { return this.array; } public ProfileProfileStructure getElement() { return this.element; } public void setPropertyName(String propertyName) { this.propertyName=propertyName; } public void setArray(boolean array) { this.array=array; } public void setElement(ProfileProfileStructure element) { this.element=element; } }
[ "sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1" ]
sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1
84cfbc422660406a4b240ace71e4211518e40ba5
63990ae44ac4932f17801d051b2e6cec4abb8ad8
/bus-sensitive/src/main/java/org/aoju/bus/sensitive/provider/AbstractProvider.java
eb3e0752adb078d02acb9ca4edb8aa82ace9336b
[ "MIT" ]
permissive
xeon-ye/bus
2cca99406a540cf23153afee8c924433170b8ba5
6e927146074fe2d23f9c9f23433faad5f9e40347
refs/heads/master
2023-03-16T17:47:35.172996
2021-02-22T10:31:48
2021-02-22T10:31:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,988
java
/********************************************************************************* * * * The MIT License (MIT) * * * * Copyright (c) 2015-2021 aoju.org and other contributors. * * * * Permission is hereby granted, free of charge, to any person obtaining a copy * * of this software and associated documentation files (the "Software"), to deal * * in the Software without restriction, including without limitation the rights * * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included in * * all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * * THE SOFTWARE. * * * ********************************************************************************/ package org.aoju.bus.sensitive.provider; import org.aoju.bus.core.toolkit.StringKit; import org.aoju.bus.sensitive.Builder; /** * 脱敏策略 * * @author Kimi Liu * @version 6.2.0 * @since JDK 1.8+ */ public abstract class AbstractProvider implements StrategyProvider { /** * 自动模式 * * @param mode 脱敏模型 * @param rawVal 源字符 * @param shadow 遮挡字符 * @return the string */ public static String build(Builder.Mode mode, String rawVal, String shadow) { StringBuilder resultBuilder = new StringBuilder(); int length = rawVal.length(); if (mode == Builder.Mode.TAIL || mode == Builder.Mode.HEAD) { // 以1/2作为遮挡范围 int half = (int) Math.ceil(length / 2.0); boolean head = mode == Builder.Mode.HEAD; if (head) { resultBuilder.append(StringKit.repeat(shadow, half)) .append(rawVal, half, length); } else { resultBuilder.append(rawVal, 0, length - half) .append(StringKit.repeat(shadow, half)); } return resultBuilder.toString(); } // 仅有两个字符,不能采用遮挡中间的做法 if (length == 2) { return resultBuilder.append(rawVal, 0, 1) .append(shadow).toString(); } // 以一半字符被mask作为目标 int middle = Math.max((int) Math.ceil(length / 2.0), 1); // 计算首尾字符长度 int side = Math.max((int) Math.floor((length - middle) / 2.0), 1); // 修正中间被mask的长度 middle = length - side * 2; resultBuilder.append(rawVal, 0, side) .append(StringKit.repeat(shadow, middle)) .append(rawVal, side + middle, length); return resultBuilder.toString(); } /** * 手动模式 * * @param mode 脱敏模型 * @param fixedHeaderSize 固定头部长度 * @param fixedTailorSize 固定尾部长度 * @param rawVal 源字符 * @param shadow 遮挡字符 * @return the string */ public static String build(Builder.Mode mode, int fixedHeaderSize, int fixedTailorSize, String rawVal, String shadow) { StringBuilder resultBuilder = new StringBuilder(); int length = rawVal.length(); int maskLength; switch (mode) { case TAIL: if (length <= fixedHeaderSize) { return rawVal; } maskLength = length - fixedHeaderSize; resultBuilder.append(rawVal, 0, fixedHeaderSize) .append(StringKit.repeat(shadow, maskLength)); break; default: case HEAD: if (length <= fixedTailorSize) { return rawVal; } maskLength = length - fixedTailorSize; resultBuilder.append(StringKit.repeat(shadow, maskLength)) .append(rawVal.substring(maskLength)); break; case MIDDLE: int unmaskLength = fixedTailorSize + fixedHeaderSize; if (length <= unmaskLength) { return rawVal; } maskLength = length - unmaskLength; resultBuilder.append(rawVal, 0, fixedHeaderSize) .append(StringKit.repeat(shadow, maskLength)) .append(rawVal, fixedHeaderSize + maskLength, length); break; } return resultBuilder.toString(); } }
[ "839536@qq.com" ]
839536@qq.com
e0ca91f706ebe6172526cde96099a7aa2ae172c5
ab54078953c75189081b6f078f466030d504d11d
/getty-core/src/main/java/com/gettyio/core/util/CharsetUtil.java
60ffe4dcf02042c78b981134c9b2a24e59e1d4c0
[ "Apache-2.0" ]
permissive
Rekoe/getty
b36f73b5c69eb16cba10eb5410e808173ed86235
725e4df7d76c0d1e9458f9d626128e5713620160
refs/heads/master
2021-01-07T07:48:44.894287
2020-02-17T03:14:33
2020-02-17T03:14:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,840
java
/* * Copyright 2012 The Netty Project * * The Netty Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.gettyio.core.util; import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetEncoder; import java.nio.charset.CodingErrorAction; import java.util.HashMap; import java.util.Map; import static com.gettyio.core.util.ObjectUtil.checkNotNull; /** * A utility class that provides various common operations and constants * related with {@link Charset} and its relevant classes. */ public final class CharsetUtil { /** * 16-bit UTF (UCS Transformation Format) whose byte order is identified by * an optional byte-order mark */ public static final Charset UTF_16 = Charset.forName("UTF-16"); /** * 16-bit UTF (UCS Transformation Format) whose byte order is big-endian */ public static final Charset UTF_16BE = Charset.forName("UTF-16BE"); /** * 16-bit UTF (UCS Transformation Format) whose byte order is little-endian */ public static final Charset UTF_16LE = Charset.forName("UTF-16LE"); /** * 8-bit UTF (UCS Transformation Format) */ public static final Charset UTF_8 = Charset.forName("UTF-8"); /** * ISO Latin Alphabet No. 1, as known as <tt>ISO-LATIN-1</tt> */ public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1"); /** * 7-bit ASCII, as known as ISO646-US or the Basic Latin block of the * Unicode character set */ public static final Charset US_ASCII = Charset.forName("US-ASCII"); private static final Charset[] CHARSETS = new Charset[] { UTF_16, UTF_16BE, UTF_16LE, UTF_8, ISO_8859_1, US_ASCII }; public static Charset[] values() { return CHARSETS; } /** * @deprecated Use {@link #encoder(Charset)}. */ @Deprecated public static CharsetEncoder getEncoder(Charset charset) { return encoder(charset); } /** * Returns a new {@link CharsetEncoder} for the {@link Charset} with specified error actions. * * @param charset The specified charset * @param malformedInputAction The encoder's action for malformed-input errors * @param unmappableCharacterAction The encoder's action for unmappable-character errors * @return The encoder for the specified {@code charset} */ public static CharsetEncoder encoder(Charset charset, CodingErrorAction malformedInputAction, CodingErrorAction unmappableCharacterAction) { checkNotNull(charset, "charset"); CharsetEncoder e = charset.newEncoder(); e.onMalformedInput(malformedInputAction).onUnmappableCharacter(unmappableCharacterAction); return e; } /** * Returns a new {@link CharsetEncoder} for the {@link Charset} with the specified error action. * * @param charset The specified charset * @param codingErrorAction The encoder's action for malformed-input and unmappable-character errors * @return The encoder for the specified {@code charset} */ public static CharsetEncoder encoder(Charset charset, CodingErrorAction codingErrorAction) { return encoder(charset, codingErrorAction, codingErrorAction); } /** * Returns a cached thread-local {@link CharsetEncoder} for the specified {@link Charset}. * * @param charset The specified charset * @return The encoder for the specified {@code charset} */ public static CharsetEncoder encoder(Charset charset) { checkNotNull(charset, "charset"); Map<Charset, CharsetEncoder> map = new HashMap<>(); CharsetEncoder e = map.get(charset); if (e != null) { e.reset().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); return e; } e = encoder(charset, CodingErrorAction.REPLACE, CodingErrorAction.REPLACE); map.put(charset, e); return e; } /** * @deprecated Use {@link #decoder(Charset)}. */ @Deprecated public static CharsetDecoder getDecoder(Charset charset) { return decoder(charset); } /** * Returns a new {@link CharsetDecoder} for the {@link Charset} with specified error actions. * * @param charset The specified charset * @param malformedInputAction The decoder's action for malformed-input errors * @param unmappableCharacterAction The decoder's action for unmappable-character errors * @return The decoder for the specified {@code charset} */ public static CharsetDecoder decoder(Charset charset, CodingErrorAction malformedInputAction, CodingErrorAction unmappableCharacterAction) { checkNotNull(charset, "charset"); CharsetDecoder d = charset.newDecoder(); d.onMalformedInput(malformedInputAction).onUnmappableCharacter(unmappableCharacterAction); return d; } /** * Returns a new {@link CharsetDecoder} for the {@link Charset} with the specified error action. * * @param charset The specified charset * @param codingErrorAction The decoder's action for malformed-input and unmappable-character errors * @return The decoder for the specified {@code charset} */ public static CharsetDecoder decoder(Charset charset, CodingErrorAction codingErrorAction) { return decoder(charset, codingErrorAction, codingErrorAction); } /** * Returns a cached thread-local {@link CharsetDecoder} for the specified {@link Charset}. * * @param charset The specified charset * @return The decoder for the specified {@code charset} */ public static CharsetDecoder decoder(Charset charset) { checkNotNull(charset, "charset"); Map<Charset, CharsetDecoder> map = new HashMap<>(); CharsetDecoder d = map.get(charset); if (d != null) { d.reset().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); return d; } d = decoder(charset, CodingErrorAction.REPLACE, CodingErrorAction.REPLACE); map.put(charset, d); return d; } private CharsetUtil() { } }
[ "34082822+gogym@users.noreply.github.com" ]
34082822+gogym@users.noreply.github.com
7775653b8ecf7d1606f0053ee987ad79213d33c4
4abd603f82fdfa5f5503c212605f35979b77c406
/html/Programs/hw6-2-diff/r04945008-353-4/Diff.java
b11844fd1cff19f711537fde76f1a983fa0ba6d5
[]
no_license
dn070017/1042-PDSA
b23070f51946c8ac708d3ab9f447ab8185bd2a34
5e7d7b1b2c9d751a93de9725316aa3b8f59652e6
refs/heads/master
2020-03-20T12:13:43.229042
2018-06-15T01:00:48
2018-06-15T01:00:48
137,424,305
0
0
null
null
null
null
UTF-8
Java
false
false
4,864
java
import java.util.Arrays; import java.util.Comparator; public class Player implements Comparable<Player>{ private Card[] cards = new Card[5]; private String name; // DO NOT MODIFY THIS public Player(String name) { this.name = name; } // DO NOT MODIFY THIS public String getName() { return this.name; } // DO NOT MODIFY THIS public void setCards(Card[] cards) { this.cards = cards; } public int findPair() { Arrays.sort(this.cards); int[] count = new int[5]; for (int i = 0; i < 5; i++) {count[i]=0; for (int j = 0; j < 5; j++) { if(this.cards[i].getFace().equals(this.cards[j].getFace())) count[i]++; } } for(int i = 4; i < 0; i--){ if(count[i] == 3) return i; if(count[i] == 2) return i; } return 0; } public int getRank() { Arrays.sort(this.cards); int[] count = new int[5]; for (int i = 0; i < 5; i++) {count[i]=0; for (int j = 0; j < 5; j++) { if(this.cards[i].getFace().equals(this.cards[j].getFace())) count[i]++; } } if(count[2] == 3 && (count[0] == 2 || count[4] == 2)) return +15; //fullhouse if(this.cards[0].getSuit().equals(this.cards[1].getSuit()) && this.cards[0].getSuit().equals(this.cards[2].getSuit()) && this.cards[0].getSuit().equals(this.cards[3].getSuit()) && this.cards[0].getSuit().equals(this.cards[4].getSuit())) return +14; if(this.cards[0].getFace().equals(""10"") && this.cards[4].getFace().equals(""A"")) return +13; //10JQKA if(this.cards[0].getFace().equals(""9"") && this.cards[4].getFace().equals(""K"")) return +12; if(this.cards[0].getFace().equals(""8"") && this.cards[4].getFace().equals(""Q"")) return +11; if(this.cards[0].getFace().equals(""7"") && this.cards[4].getFace().equals(""J"")) return +10; if(this.cards[0].getFace().equals(""6"") && this.cards[4].getFace().equals(""10"")) return +9; if(this.cards[0].getFace().equals(""5"") && this.cards[4].getFace().equals(""9"")) return +8; if(this.cards[0].getFace().equals(""4"") && this.cards[4].getFace().equals(""8"")) return +7; if(this.cards[0].getFace().equals(""3"") && this.cards[4].getFace().equals(""7"")) return +6; if(this.cards[0].getFace().equals(""2"") && this.cards[4].getFace().equals(""6"")) return +5; if(this.cards[0].getFace().equals(""2"") && this.cards[4].getFace().equals(""A"")) return +4; //A2345 if(count[1] == 2 && count[3] == 2) return +3; //2 pair if(count[0] == 2 || count[1] == 2 || count[2] == 2 || count[3] == 2 || count[4] == 2) return +2; //1 pair return 1; //high card } // TODO public int compareTo(Player that) { . int a,b; Arrays.sort(this.cards); Arrays.sort(that.cards); if(this.getRank() < that.getRank()) return -1; if(this.getRank() > that.getRank()) return +1; if(this.getRank() == that.getRank()){ switch(this.getRank()){ case 15: a=this.findPair(); b=that.findPair(); if(this.cards[a].compareTo(that.cards[b]) == 1) return +1; if(this.cards[a].compareTo(that.cards[b]) == -1) return -1; return 0; case 4: if(this.cards[3].compareTo(that.cards[3]) == 1) return +1; if(this.cards[3].compareTo(that.cards[3]) == -1) return -1; return 0; case 3: a=this.findPair(); b=that.findPair(); if(this.cards[a].compareTo(that.cards[b]) == 1) return +1; if(this.cards[a].compareTo(that.cards[b]) == -1) return -1; return 0; case 2: a=this.findPair(); b=that.findPair(); if(this.cards[a].compareTo(that.cards[b]) == 1) return +1; if(this.cards[a].compareTo(that.cards[b]) == -1) return -1; return 0; default: if(this.cards[4].compareTo(that.cards[4]) == 1) return +1; if(this.cards[4].compareTo(that.cards[4]) == -1) return -1; return 0; } } return 0; } }
[ "dn070017@gmail.com" ]
dn070017@gmail.com
ffbc131133c8b8ad00a0de1ea5bac8cc0165b483
7f55ab2e5fe535472c07362cb4a1c04e3494aa16
/src/java/com/hzih/itp/platform/config/mina/code/RequestMessageEncoder.java
2819a97599f9b2cf9daac758214a5df97e48e146
[]
no_license
gholdzhang/itpplatform
7d492bd97e5faf08537fe6562c03d0230895cc4d
094a6fde8434056d8365a1d5a20a83750a19d503
refs/heads/master
2023-03-18T00:50:53.639747
2016-04-16T02:28:41
2016-04-16T02:28:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,085
java
package com.hzih.itp.platform.config.mina.code; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.codec.ProtocolEncoderOutput; import org.apache.mina.filter.codec.demux.MessageEncoder; /** * Created by IntelliJ IDEA. * User: bluesky * Date: 2009-4-10 * Time: 20:43:16 * To change this template use File | Settings | File Templates. */ public class RequestMessageEncoder implements MessageEncoder { public RequestMessageEncoder() { } public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception { RequestMessage mess = (RequestMessage) message; IoBuffer buff = IoBuffer.allocate(mess.getMsgLen() + 7); buff.setAutoExpand(true); buff.put(mess.getVersion()); buff.putShort(mess.getProtocolType()); buff.putInt(mess.getMsgLen()); if (mess.getMsgBody() != null) buff.put(mess.getMsgBody().toByteArray()); buff.flip(); mess.clean(); out.write(buff); } }
[ "465805947@QQ.com" ]
465805947@QQ.com
5a1dd9f0dfcbbca8d11cb822c093a1dc4e07caa3
62eb3c0b32011d43e3bd201d9007e18a75d92506
/src/test/java/com/cloudhopper/smpp/util/TlvUtilTest.java
65b7ebef9aacc4870c405c649f73972eee4ccb6a
[ "Apache-2.0" ]
permissive
bbanko/cloudhopper-smpp
0443bf29509dd350de34df245420219c45bfe0bb
5f5c1a92e8c42f588c9f379a8f2defb32f0021a1
refs/heads/master
2021-01-18T05:27:58.516132
2012-02-14T13:24:33
2012-02-14T13:24:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,388
java
/** * Copyright (C) 2011 Twitter, 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.cloudhopper.smpp.util; // third party imports import com.cloudhopper.commons.util.HexUtil; import com.cloudhopper.smpp.tlv.Tlv; import com.cloudhopper.smpp.tlv.TlvConvertException; import org.junit.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; // my imports /** * * @author joelauer (twitter: @jjlauer or <a href="http://twitter.com/jjlauer" target=window>http://twitter.com/jjlauer</a>) */ public class TlvUtilTest { private static final Logger logger = LoggerFactory.getLogger(TlvUtilTest.class); @Test public void createNullTerminatedStringTlv() throws Exception { Tlv tlv0 = null; // null string should just be 0x00 tlv0 = TlvUtil.createNullTerminatedStringTlv((short)0x0001, null, "ISO-8859-1"); Assert.assertEquals((short)0x0001, tlv0.getTag()); Assert.assertArrayEquals(HexUtil.toByteArray("00"), tlv0.getValue()); tlv0 = TlvUtil.createNullTerminatedStringTlv((short)0x0001, "", "ISO-8859-1"); Assert.assertEquals((short)0x0001, tlv0.getTag()); Assert.assertArrayEquals(HexUtil.toByteArray("00"), tlv0.getValue()); tlv0 = TlvUtil.createNullTerminatedStringTlv((short)0x0001, "a"); Assert.assertEquals((short)0x0001, tlv0.getTag()); Assert.assertArrayEquals(HexUtil.toByteArray("6100"), tlv0.getValue()); tlv0 = TlvUtil.createNullTerminatedStringTlv((short)0x0001, "c1net"); Assert.assertEquals((short)0x0001, tlv0.getTag()); Assert.assertArrayEquals(HexUtil.toByteArray("63316e657400"), tlv0.getValue()); } @Test public void createFixedLengthStringTlv() throws Exception { Tlv tlv0 = null; tlv0 = TlvUtil.createFixedLengthStringTlv((short)0x0001, null, 2, "ISO-8859-1"); Assert.assertEquals((short)0x0001, tlv0.getTag()); Assert.assertArrayEquals(HexUtil.toByteArray("0000"), tlv0.getValue()); tlv0 = TlvUtil.createFixedLengthStringTlv((short)0x0001, "", 2); Assert.assertEquals((short)0x0001, tlv0.getTag()); Assert.assertArrayEquals(HexUtil.toByteArray("0000"), tlv0.getValue()); tlv0 = TlvUtil.createFixedLengthStringTlv((short)0x0001, "1", 2, "ISO-8859-1"); Assert.assertEquals((short)0x0001, tlv0.getTag()); Assert.assertArrayEquals(HexUtil.toByteArray("3100"), tlv0.getValue()); tlv0 = TlvUtil.createFixedLengthStringTlv((short)0x0001, "12", 2); Assert.assertEquals((short)0x0001, tlv0.getTag()); Assert.assertArrayEquals(HexUtil.toByteArray("3132"), tlv0.getValue()); try { tlv0 = TlvUtil.createFixedLengthStringTlv((short)0x0001, "12", 1, "ISO-8859-1"); Assert.fail(); } catch (TlvConvertException e) { // correct behavior } } }
[ "joe@lauer.bz" ]
joe@lauer.bz
184afa0ed67c98649ad4d94dade7473d7369a95c
9d2809ee4669e3701884d334c227c68a24c5787f
/itemcenter/item-core/src/test/java/order/ItemSalesSkuCountTest.java
eb928f68a9d1133389ae61b54f9d8b1ce744cc8f
[]
no_license
vinfai/hy_project
5370367876fe6bcb4109f2af9391b9d817c320b5
8fd99f23cf83b1b3f7bec9560fbd2edc46621d0b
refs/heads/master
2021-01-19T00:58:26.436196
2017-03-01T16:47:22
2017-03-01T16:49:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,941
java
/*package order; import java.util.ArrayList; import java.util.List; import javax.annotation.Resource; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.mockuai.itemcenter.common.api.BaseRequest; import com.mockuai.itemcenter.common.api.ItemService; import com.mockuai.itemcenter.common.api.Response; import com.mockuai.itemcenter.common.constant.ActionEnum; import com.mockuai.itemcenter.common.domain.dto.ItemSalesSpuCountDTO; import com.mockuai.itemcenter.core.message.msg.PaySuccessMsg; @FixMethodOrder(MethodSorters.NAME_ASCENDING) @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:applicationContext.xml" }) public class ItemSalesSkuCountTest { @Resource private ItemService itemService; @SuppressWarnings({ "unused", "rawtypes" }) @Test public void itemSalesSkuTest() { com.mockuai.itemcenter.common.api.Request request = new BaseRequest(); PaySuccessMsg paySuccessMsg = new PaySuccessMsg(); List<ItemSalesSpuCountDTO> itemSalesSpuCountDTOs = new ArrayList<ItemSalesSpuCountDTO>(); ItemSalesSpuCountDTO itemSalesSpuCountDTO = new ItemSalesSpuCountDTO(); itemSalesSpuCountDTO.setBizCode("hanshu"); itemSalesSpuCountDTO.setItemId(222L); itemSalesSpuCountDTO.setSellerId(1841254L); itemSalesSpuCountDTO.setSpuSalesCount(1L); itemSalesSpuCountDTOs.add(itemSalesSpuCountDTO); paySuccessMsg.setAppKey("4f5508d72d9d78c9242bf1c867ac1063"); paySuccessMsg.setItemSalesSpuCountDTOs(itemSalesSpuCountDTOs); request.setParam("salesParam", "up"); request.setParam("appKey", "4f5508d72d9d78c9242bf1c867ac1063"); request.setCommand(ActionEnum.ITEM_SALESCOUNT.getActionName()); Response response = itemService.execute(request); } } */
[ "1147478866@qq.com" ]
1147478866@qq.com
bed39ba4cfe18d87ee2548882c06cd5fda175756
9a62169ace507c0be95adf3f86c849b0dc144c3e
/regress_for_doc/rule/HW_6_1_NM.java
552c8e8fddf4c32cabd7e67a31cc8060d0e40ec6
[]
no_license
13001090108/DTSEmbed_LSC
84b2e7edbf1c7f5162b19f06c892a5b42d3ad88e
38cc44c10304458e923a1a834faa6b0ca216c0e2
refs/heads/master
2020-04-02T05:27:57.577850
2018-10-22T06:28:28
2018-10-22T06:28:28
154,078,761
0
0
null
null
null
null
GB18030
Java
false
false
1,977
java
package rule; import java.util.Arrays; import java.util.Collection; import java.util.Set; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import softtest.fsm.c.FSMLoader; import softtest.fsm.c.FSMMachine; import softtest.fsmanalysis.c.FSMAnalysisVisitor; import softtest.interpro.c.InterContext; import softtest.symboltable.c.MethodNameDeclaration; import softtest.test.c.rules.ModelTestBase; @RunWith(Parameterized.class) public class HW_6_1_NM extends ModelTestBase{ public HW_6_1_NM(String source, String compiletype, String result) { super(source, compiletype, result); } @BeforeClass public static void setUpBaseChild() { fsmPath = "softtest/rules/gcc/rule/HW_6_1_NM-0.1.xml"; FSMMachine fsm = FSMLoader.loadXML(fsmPath); fsm.setType("fault"); //每次加入自动机前都清空一下原来的fsms FSMAnalysisVisitor.clearFSMS(); FSMAnalysisVisitor.addFSMS(fsm); //加载库函数摘要 LIB_SUMMARYS_PATH="gcc_lib/bo_summary.xml"; libManager.loadSingleLibFile(LIB_SUMMARYS_PATH); Set<MethodNameDeclaration> libDecls = libManager.compileLib(pre.getLibIncludes()); interContext = InterContext.getInstance(); interContext.addLibMethodDecl(libDecls); } @Parameters public static Collection<Object[]> testcaseAndResults() { return Arrays.asList(new Object[][] { ///////////////// 0 /////////////////// { "void f()" +"\n"+ "{" +"\n"+ " int* p=(int*)malloc(1);" +"\n"+ "}" , "gcc" , "HW_6_1_NM" , }, }); } }
[ "lishaochun@bupt.edu.cn" ]
lishaochun@bupt.edu.cn
1a16e538c48b4b809d7ef4fdf0a3ba4094f372a2
bb9e380d0629d97455dea76af0951a4aaab6b515
/src/main/java/model/LstmLayer.java
8588c95f5471b7f6c56b1d39ce48912ead0da364
[ "MIT" ]
permissive
wrmsr/RecurrentJava
0921eb343a20cac1043445ce50fe5d74e41e2f40
8fc5d36c0391c9c4daec345710d9ae6e80622089
refs/heads/master
2020-12-30T19:22:46.602544
2015-09-20T19:42:54
2015-09-20T19:42:54
42,278,914
0
0
null
2015-09-11T00:54:33
2015-09-11T00:54:32
null
UTF-8
Java
false
false
3,826
java
package model; import autodiff.Graph; import matrix.Matrix; import java.util.ArrayList; import java.util.List; import java.util.Random; public class LstmLayer implements Model { private static final long serialVersionUID = 1L; int inputDimension; int outputDimension; Matrix Wix, Wih, bi; Matrix Wfx, Wfh, bf; Matrix Wox, Woh, bo; Matrix Wcx, Wch, bc; Matrix hiddenContext; Matrix cellContext; Nonlinearity fInputGate = new SigmoidUnit(); Nonlinearity fForgetGate = new SigmoidUnit(); Nonlinearity fOutputGate = new SigmoidUnit(); Nonlinearity fCellInput = new TanhUnit(); Nonlinearity fCellOutput = new TanhUnit(); public LstmLayer(int inputDimension, int outputDimension, double initParamsStdDev, Random rng) { this.inputDimension = inputDimension; this.outputDimension = outputDimension; Wix = Matrix.rand(outputDimension, inputDimension, initParamsStdDev, rng); Wih = Matrix.rand(outputDimension, outputDimension, initParamsStdDev, rng); bi = new Matrix(outputDimension); Wfx = Matrix.rand(outputDimension, inputDimension, initParamsStdDev, rng); Wfh = Matrix.rand(outputDimension, outputDimension, initParamsStdDev, rng); //set forget bias to 1.0, as described here: http://jmlr.org/proceedings/papers/v37/jozefowicz15.pdf bf = Matrix.ones(outputDimension, 1); Wox = Matrix.rand(outputDimension, inputDimension, initParamsStdDev, rng); Woh = Matrix.rand(outputDimension, outputDimension, initParamsStdDev, rng); bo = new Matrix(outputDimension); Wcx = Matrix.rand(outputDimension, inputDimension, initParamsStdDev, rng); Wch = Matrix.rand(outputDimension, outputDimension, initParamsStdDev, rng); bc = new Matrix(outputDimension); } @Override public Matrix forward(Matrix input, Graph g) throws Exception { //input gate Matrix sum0 = g.mul(Wix, input); Matrix sum1 = g.mul(Wih, hiddenContext); Matrix inputGate = g.nonlin(fInputGate, g.add(g.add(sum0, sum1), bi)); //forget gate Matrix sum2 = g.mul(Wfx, input); Matrix sum3 = g.mul(Wfh, hiddenContext); Matrix forgetGate = g.nonlin(fForgetGate, g.add(g.add(sum2, sum3), bf)); //output gate Matrix sum4 = g.mul(Wox, input); Matrix sum5 = g.mul(Woh, hiddenContext); Matrix outputGate = g.nonlin(fOutputGate, g.add(g.add(sum4, sum5), bo)); //write operation on cells Matrix sum6 = g.mul(Wcx, input); Matrix sum7 = g.mul(Wch, hiddenContext); Matrix cellInput = g.nonlin(fCellInput, g.add(g.add(sum6, sum7), bc)); //compute new cell activation Matrix retainCell = g.elmul(forgetGate, cellContext); Matrix writeCell = g.elmul(inputGate, cellInput); Matrix cellAct = g.add(retainCell, writeCell); //compute hidden state as gated, saturated cell activations Matrix output = g.elmul(outputGate, g.nonlin(fCellOutput, cellAct)); //rollover activations for next iteration hiddenContext = output; cellContext = cellAct; return output; } @Override public void resetState() { hiddenContext = new Matrix(outputDimension); cellContext = new Matrix(outputDimension); } @Override public List<Matrix> getParameters() { List<Matrix> result = new ArrayList<>(); result.add(Wix); result.add(Wih); result.add(bi); result.add(Wfx); result.add(Wfh); result.add(bf); result.add(Wox); result.add(Woh); result.add(bo); result.add(Wcx); result.add(Wch); result.add(bc); return result; } }
[ "timwilloney@gmail.com" ]
timwilloney@gmail.com
1be40f7d4038fbe0238a624fa8ae42b969c4c7f0
c164d8f1a6068b871372bae8262609fd279d774c
/src/main/java/edu/uiowa/slis/VIVOISF/Concept/ConceptResearchAreaOf.java
501c14211542ba9c41513aa0891fdda868525422
[ "Apache-2.0" ]
permissive
eichmann/VIVOISF
ad0a299df177d303ec851ff2453cbcbd7cae1ef8
e80cd8b74915974fac7ebae8e5e7be8615355262
refs/heads/master
2020-03-19T03:44:27.662527
2018-06-03T22:44:58
2018-06-03T22:44:58
135,757,275
0
1
null
null
null
null
UTF-8
Java
false
false
1,002
java
package edu.uiowa.slis.VIVOISF.Concept; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspTagException; @SuppressWarnings("serial") public class ConceptResearchAreaOf extends edu.uiowa.slis.VIVOISF.TagLibSupport { static ConceptResearchAreaOf currentInstance = null; private static final Log log = LogFactory.getLog(ConceptResearchAreaOf.class); // object property public int doStartTag() throws JspException { try { ConceptResearchAreaOfIterator theConceptResearchAreaOfIterator = (ConceptResearchAreaOfIterator)findAncestorWithClass(this, ConceptResearchAreaOfIterator.class); pageContext.getOut().print(theConceptResearchAreaOfIterator.getResearchAreaOf()); } catch (Exception e) { log.error("Can't find enclosing Concept for researchAreaOf tag ", e); throw new JspTagException("Error: Can't find enclosing Concept for researchAreaOf tag "); } return SKIP_BODY; } }
[ "david-eichmann@uiowa.edu" ]
david-eichmann@uiowa.edu
5e0df232174837d52887c6b144dbac40be9ca008
eb55c18065d9148d589dd011ef6ceaea0d52dee4
/kenny-rest/src/main/java/com/kenny/laboratory/rest/GunsRestApplication.java
0c515e7dc1e8676bd2b3d5235969cfbda25c3e23
[ "Apache-2.0" ]
permissive
KennyJian/laboratory
0808fe1bb1f40db33ce74a2dd6b93ab9b89450f7
8c8e842c521cd11fa003b1dd88e23f91330a2376
refs/heads/master
2022-10-17T03:52:26.310237
2020-03-23T03:14:26
2020-03-23T03:14:26
158,225,747
5
1
NOASSERTION
2022-10-12T20:20:00
2018-11-19T13:15:58
Java
UTF-8
Java
false
false
333
java
package com.kenny.laboratory.rest; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class GunsRestApplication { public static void main(String[] args) { SpringApplication.run(GunsRestApplication.class, args); } }
[ "574337030@qq.com" ]
574337030@qq.com
2565b9db22dbc17e5d1fb46225a5fc001a3654cb
b143675957e73c177c1d0f65804eae669ab13d22
/src/main/java/org/onvif/ver10/schema/PTZNodeExtension.java
535b4f612c4d71c9b77b6d1f5f1da28c0765ca58
[ "MIT" ]
permissive
JoshLikesBeer/onvifjava
18e694730d8dafce9777cf511732bc4f2e3557c1
eee958bcc77c08e9e81dd31b84aeda346497f993
refs/heads/master
2020-03-17T18:45:50.895272
2019-09-16T15:39:49
2019-09-16T15:39:49
133,832,410
0
0
null
null
null
null
UTF-8
Java
false
false
3,629
java
// // Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-2 generiert // Siehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // �nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. // Generiert: 2014.02.04 um 12:22:03 PM CET // package org.onvif.ver10.schema; 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.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import org.w3c.dom.Element; /** * <p> * Java-Klasse f�r PTZNodeExtension complex type. * * <p> * Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist. * * <pre> * <complexType name="PTZNodeExtension"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/> * <element name="SupportedPresetTour" type="{http://www.onvif.org/ver10/schema}PTZPresetTourSupported" minOccurs="0"/> * <element name="Extension" type="{http://www.onvif.org/ver10/schema}PTZNodeExtension2" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PTZNodeExtension", propOrder = { "any", "supportedPresetTour", "extension" }) public class PTZNodeExtension { @XmlAnyElement(lax = true) protected List<java.lang.Object> any; @XmlElement(name = "SupportedPresetTour") protected PTZPresetTourSupported supportedPresetTour; @XmlElement(name = "Extension") protected PTZNodeExtension2 extension; /** * Gets the value of the any 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 any property. * * <p> * For example, to add a new item, do as follows: * * <pre> * getAny().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list {@link Element } {@link java.lang.Object } * * */ public List<java.lang.Object> getAny() { if (any == null) { any = new ArrayList<java.lang.Object>(); } return this.any; } /** * Ruft den Wert der supportedPresetTour-Eigenschaft ab. * * @return possible object is {@link PTZPresetTourSupported } * */ public PTZPresetTourSupported getSupportedPresetTour() { return supportedPresetTour; } /** * Legt den Wert der supportedPresetTour-Eigenschaft fest. * * @param value * allowed object is {@link PTZPresetTourSupported } * */ public void setSupportedPresetTour(PTZPresetTourSupported value) { this.supportedPresetTour = value; } /** * Ruft den Wert der extension-Eigenschaft ab. * * @return possible object is {@link PTZNodeExtension2 } * */ public PTZNodeExtension2 getExtension() { return extension; } /** * Legt den Wert der extension-Eigenschaft fest. * * @param value * allowed object is {@link PTZNodeExtension2 } * */ public void setExtension(PTZNodeExtension2 value) { this.extension = value; } }
[ "dmitry.druzhynin@gmail.com" ]
dmitry.druzhynin@gmail.com
628e7f8b8200e929b05b3f3435e38ed01818ea5c
13e443a64c99bf0028db2eb27224eb6406f6c1c2
/src/main/java/net/minecraft/entity/item/minecart/MinecartEntity.java
0479e98a93f60cc8cbe3bf63f8e072189baab9b4
[]
no_license
NicholasBlackburn1/Robo_Hacker
5a779679d643250676c1c075d6697b10e8a7a9c5
02506e742d30df6a255ba63b240773a08c40bd74
refs/heads/main
2023-06-19T14:37:19.499548
2021-05-10T15:08:28
2021-05-10T15:08:28
353,691,155
2
2
null
2021-04-02T14:16:50
2021-04-01T12:23:15
Java
UTF-8
Java
false
false
1,876
java
package net.minecraft.entity.item.minecart; import net.minecraft.entity.EntityType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.world.World; public class MinecartEntity extends AbstractMinecartEntity { public MinecartEntity(EntityType<?> type, World world) { super(type, world); } public MinecartEntity(World worldIn, double x, double y, double z) { super(EntityType.MINECART, worldIn, x, y, z); } public ActionResultType processInitialInteract(PlayerEntity player, Hand hand) { if (player.isSecondaryUseActive()) { return ActionResultType.PASS; } else if (this.isBeingRidden()) { return ActionResultType.PASS; } else if (!this.world.isRemote) { return player.startRiding(this) ? ActionResultType.CONSUME : ActionResultType.PASS; } else { return ActionResultType.SUCCESS; } } /** * Called every tick the minecart is on an activator rail. */ public void onActivatorRailPass(int x, int y, int z, boolean receivingPower) { if (receivingPower) { if (this.isBeingRidden()) { this.removePassengers(); } if (this.getRollingAmplitude() == 0) { this.setRollingDirection(-this.getRollingDirection()); this.setRollingAmplitude(10); this.setDamage(50.0F); this.markVelocityChanged(); } } } public AbstractMinecartEntity.Type getMinecartType() { return AbstractMinecartEntity.Type.RIDEABLE; } }
[ "nickblackburn02@gmail.com" ]
nickblackburn02@gmail.com
0cd0ddff9202b98c6f158f28a161a3a548040263
256a3596eb3a9c694d2015b173c51b4e20b82ae0
/DailyRhythmPortal/drp-wicket/src/test/java/com/bestbuy/bbym/ise/drp/common/HomePageTest.java
967fa2d69fc1370519c3fb33561d8c63c7f765fd
[]
no_license
sellasiyer/maven-drp
a8487325586bb6018d08a6cdb4078ce0ef5d5989
cbbab7027e1ee64cdaf9956a82c6ad964bb9ec86
refs/heads/master
2021-01-01T19:15:47.427243
2012-11-03T13:04:14
2012-11-03T13:04:14
5,146,773
0
0
null
null
null
null
UTF-8
Java
false
false
4,946
java
package com.bestbuy.bbym.ise.drp.common; import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.replay; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import java.util.ArrayList; import java.util.List; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.easymock.EasyMock; import org.junit.Test; import com.bestbuy.bbym.ise.drp.domain.RssCategory; import com.bestbuy.bbym.ise.drp.domain.RssCategoryFactory; import com.bestbuy.bbym.ise.drp.domain.RssItem; import com.bestbuy.bbym.ise.drp.domain.RssItemFactory; import com.bestbuy.bbym.ise.drp.service.RSSFeedService; import com.bestbuy.bbym.ise.drp.utils.DrpConstants; import com.bestbuy.bbym.ise.exception.IseExceptionCodeEnum; import com.bestbuy.bbym.ise.exception.ServiceException; /** * JUnit test for {@link HomePage}. */ public class HomePageTest extends BaseNavPageTest { private RSSFeedService rssFeedService; @Override public void setUp() { super.setUp(); rssFeedService = EasyMock.createMock(RSSFeedService.class); mockApplicationContext.putBean("rssFeedService", rssFeedService); } /** * Checks that all roles except {@link DrpConstants#DRP_BEAST} have access * to the page. */ @Override public void testPageAccess() { assertAccessAllowed(HomePage.class, DrpConstants.DRP_ADMIN, DrpConstants.DRP_MANAGER, DrpConstants.DRP_LEAD, DrpConstants.DRP_USER, DrpConstants.SHP_USER, DrpConstants.SHP_MANAGER, DrpConstants.DRP_TEAM); assertAccessDenied(HomePage.class, DrpConstants.DRP_BEAST); } /** * Tests rendering of page and presence of components. */ @Override public void testRenderMyPage() { List<RssCategory> rss = new ArrayList<RssCategory>(); rss.add(RssCategoryFactory.create()); try{ expect(rssFeedService.getBeastNewsRssFeed()).andReturn(rss); expect(rssFeedService.getBeastTickerRssFeed()).andReturn(rss); replay(rssFeedService); }catch(Exception e){ //Do Nothing } // start and render the test page tester.startPage(HomePage.class, new PageParameters()); // Check that the right page was rendered (no unexpected redirect or // intercept) tester.assertRenderedPage(HomePage.class); tester.assertNoErrorMessage(); assertNavigation(); tester.assertComponent("beastTicker", NewsTickerPanel.class); tester.assertComponent("newsCategoryListView", ListView.class); } /** * Tests contents of ticker. */ @Test public void testBeastTicker() throws Exception { List<RssCategory> rssCategories = new ArrayList<RssCategory>(); RssCategory displayedRssCategory = RssCategoryFactory.create(); List<RssItem> rssItems = new ArrayList<RssItem>(); RssItem displayedRssItem1 = RssItemFactory.create("Some RSS Item Text"); rssItems.add(displayedRssItem1); RssItem displayedRssItem2 = RssItemFactory.create("Some more RSS Item Text"); rssItems.add(displayedRssItem2); displayedRssCategory.setRssItemList(rssItems); rssCategories.add(displayedRssCategory); rssCategories.add(RssCategoryFactory.createWithNullTitle()); EasyMock.expect(rssFeedService.getBeastNewsRssFeed()).andReturn(rssCategories); EasyMock.replay(rssFeedService); HomePage page = (HomePage) tester.startPage(HomePage.class, new PageParameters()); assertNotNull(page.getNewsCategories()); assertEquals("Only one category should be displayed", 1, page.getNewsCategories().size()); assertSame("Incorrect category displayed", displayedRssCategory, page.getNewsCategories().get(0)); tester.assertListView("newsCategoryListView", page.getNewsCategories()); tester.assertComponent("newsCategoryListView:0:title", Label.class); tester.assertLabel("newsCategoryListView:0:title", displayedRssCategory.getTitle()); tester.assertComponent("newsCategoryListView:0:date", Label.class); tester.assertLabel("newsCategoryListView:0:date", "Last updated on " + displayedRssCategory.getLastUpdatedDate()); tester.assertComponent("newsCategoryListView:0:news", Label.class); tester.assertLabel("newsCategoryListView:0:news", displayedRssItem1.getFullText() + " " + displayedRssItem2.getFullText()); } /** * Test page display when {@link RSSFeedService} throws a * {@link ServiceException}. */ @Test public void testWithRSSFeedServiceServiceException() throws Exception { ServiceException serviceException = new ServiceException(IseExceptionCodeEnum.BusinessException); EasyMock.expect(rssFeedService.getBeastNewsRssFeed()).andThrow(serviceException); EasyMock.replay(rssFeedService); HomePage page = (HomePage) tester.startPage(HomePage.class, new PageParameters()); assertNull("No categories should be displayed", page.getNewsCategories()); } }
[ "sella.s.iyer@gmail.com" ]
sella.s.iyer@gmail.com
9634c54978dcd12c6788ab8b48a2adf4112015d7
414ebc48c256fccbefd35a3705be64879f4bd62c
/src/main/java/cn/mauth/account/common/domain/sys/SysAppInfo.java
7ea581db40df0daa90ad28f5a30e44737234e36d
[]
no_license
hzw123/account
46837f5125b3e470c26360867f5caf21ce996083
82126dde8e8e9f79364b92528958fe1274a5f889
refs/heads/master
2020-04-16T09:32:27.579322
2019-02-12T08:33:49
2019-02-12T08:33:49
165,467,854
0
0
null
null
null
null
UTF-8
Java
false
false
1,654
java
package cn.mauth.account.common.domain.sys; import cn.mauth.account.common.base.BaseEntity; import javax.persistence.*; import java.util.List; /** * 应用信息 */ @Entity public class SysAppInfo extends BaseEntity { private static final long serialVersionUID = 1L; @Column(unique = true,updatable = false,length = 30) private String name; @Column(length = 50) private String clientSecret; @Column(nullable = false) private Long userInfoId; private int sort; private int state; @Transient private int query; @Transient private List<SysServiceList> services; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClientSecret() { return clientSecret; } public void setClientSecret(String clientSecret) { this.clientSecret = clientSecret; } public Long getUserInfoId() { return userInfoId; } public void setUserInfoId(Long userInfoId) { this.userInfoId = userInfoId; } public int getSort() { return sort; } public void setSort(int sort) { this.sort = sort; } public int getState() { return state; } public void setState(int state) { this.state = state; } public int getQuery() { return query; } public void setQuery(int query) { this.query = query; } public List<SysServiceList> getServices() { return services; } public void setServices(List<SysServiceList> services) { this.services = services; } }
[ "1127835288@qq.com" ]
1127835288@qq.com
161273f0c571b277304a49a673af0163071e9814
cc32a64afed91f7186c009d3d1247370a904be1c
/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/client/ClientWithCustomTypeDstu3Test.java
f081a99a6acef4bdede1c37c57fba3d6b476b608
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
rmoult01/hapi_fhir_mir_1
5dc5966ce06738872d8e0ddb667d513df76bb3d1
93270786e2d30185c41987038f878943cd736e34
refs/heads/master
2021-07-20T15:58:24.384813
2017-10-30T14:36:18
2017-10-30T14:36:18
106,035,744
1
0
null
null
null
null
UTF-8
Java
false
false
7,676
java
package ca.uhn.fhir.rest.client; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.io.StringReader; import java.nio.charset.Charset; import java.util.List; import org.apache.commons.io.input.ReaderInputStream; import org.apache.http.HttpResponse; import org.apache.http.ProtocolVersion; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicStatusLine; import org.hl7.fhir.dstu3.model.Bundle; import org.hl7.fhir.dstu3.model.Organization; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseResource; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.rest.param.DateParam; import ca.uhn.fhir.rest.param.ParamPrefixEnum; import ca.uhn.fhir.rest.server.Constants; import ca.uhn.fhir.util.TestUtil; public class ClientWithCustomTypeDstu3Test { private static FhirContext ourCtx; private HttpClient myHttpClient; private HttpResponse myHttpResponse; @AfterClass public static void afterClassClearContext() { TestUtil.clearAllStaticFieldsForUnitTest(); } @Before public void before() { myHttpClient = mock(HttpClient.class, new ReturnsDeepStubs()); ourCtx.getRestfulClientFactory().setHttpClient(myHttpClient); ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER); myHttpResponse = mock(HttpResponse.class, new ReturnsDeepStubs()); } @Test public void testReadCustomType() throws Exception { IParser p = ourCtx.newXmlParser(); MyPatientWithExtensions response = new MyPatientWithExtensions(); response.addName().setFamily("FAMILY"); response.getStringExt().setValue("STRINGVAL"); response.getDateExt().setValueAsString("2011-01-02"); final String respString = p.encodeResourceToString(response); ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class); when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(myHttpResponse.getEntity().getContent()).thenAnswer(new Answer<ReaderInputStream>() { @Override public ReaderInputStream answer(InvocationOnMock theInvocation) throws Throwable { return new ReaderInputStream(new StringReader(respString), Charset.forName("UTF-8")); } }); IGenericClient client = ourCtx.newRestfulGenericClient("http://example.com/fhir"); //@formatter:off MyPatientWithExtensions value = client .read() .resource(MyPatientWithExtensions.class) .withId("123") .execute(); //@formatter:on HttpUriRequest request = capt.getAllValues().get(0); assertEquals("http://example.com/fhir/Patient/123", request.getURI().toASCIIString()); assertEquals("GET", request.getMethod()); assertEquals(1, value.getName().size()); assertEquals("FAMILY", value.getName().get(0).getFamily()); assertEquals("STRINGVAL", value.getStringExt().getValue()); assertEquals("2011-01-02", value.getDateExt().getValueAsString()); } @Test public void testSearchWithGenericReturnType() throws Exception { final Bundle bundle = new Bundle(); final ExtendedPatient patient = new ExtendedPatient(); patient.addIdentifier().setValue("PRP1660"); bundle.addEntry().setResource(patient); final Organization org = new Organization(); org.setName("FOO"); patient.getManagingOrganization().setResource(org); final FhirContext ctx = FhirContext.forDstu3(); ctx.setDefaultTypeForProfile(ExtendedPatient.HTTP_FOO_PROFILES_PROFILE, ExtendedPatient.class); ctx.getRestfulClientFactory().setHttpClient(myHttpClient); ctx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER); String msg = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle); ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class); when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); // httpResponse = new BasicHttpResponse(statusline, catalog, locale) when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); List<IBaseResource> response = client.getPatientByDobWithGenericResourceReturnType(new DateParam(ParamPrefixEnum.GREATERTHAN_OR_EQUALS, "2011-01-02")); assertEquals("http://foo/Patient?birthdate=ge2011-01-02", capt.getValue().getURI().toString()); ExtendedPatient patientResp = (ExtendedPatient) response.get(0); assertEquals("PRP1660", patientResp.getIdentifier().get(0).getValue()); } @Test public void testSearchWithGenericReturnType2() throws Exception { final Bundle bundle = new Bundle(); final ExtendedPatient patient = new ExtendedPatient(); patient.addIdentifier().setValue("PRP1660"); bundle.addEntry().setResource(patient); final Organization org = new Organization(); org.setName("FOO"); patient.getManagingOrganization().setResource(org); final FhirContext ctx = FhirContext.forDstu3(); ctx.setDefaultTypeForProfile(ExtendedPatient.HTTP_FOO_PROFILES_PROFILE, ExtendedPatient.class); ctx.getRestfulClientFactory().setHttpClient(myHttpClient); ctx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER); String msg = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle); ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class); when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")); when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8"))); // httpResponse = new BasicHttpResponse(statusline, catalog, locale) when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse); ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); List<IAnyResource> response = client.getPatientByDobWithGenericResourceReturnType2(new DateParam(ParamPrefixEnum.GREATERTHAN_OR_EQUALS, "2011-01-02")); assertEquals("http://foo/Patient?birthdate=ge2011-01-02", capt.getValue().getURI().toString()); ExtendedPatient patientResp = (ExtendedPatient) response.get(0); assertEquals("PRP1660", patientResp.getIdentifier().get(0).getValue()); } @BeforeClass public static void beforeClass() { ourCtx = FhirContext.forDstu3(); } }
[ "moultonr@mir.wustl.edu" ]
moultonr@mir.wustl.edu
55770590c3dfbfbbf89af6e5d03e8f95e4bcce59
da71f6a9b8a4949c8de43c738fa61730129bdf5e
/temp/src/minecraft/net/minecraft/src/WorldChunkManager.java
bc6933f1f1c956ecb4438f606bc0d4d8147c3e69
[]
no_license
nmg43/mcp70-src
1c7b8938178a08f70d3e21b02fe1c2f21c2a3329
030db5929c75f4096b12b1c5a8a2282aeea7545d
refs/heads/master
2020-12-30T09:57:42.156980
2012-09-09T20:59:42
2012-09-09T20:59:42
5,654,713
0
1
null
null
null
null
UTF-8
Java
false
false
6,821
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; import java.util.*; // Referenced classes of package net.minecraft.src: // BiomeCache, BiomeGenBase, GenLayer, World, // WorldInfo, IntCache, ChunkPosition, WorldType public class WorldChunkManager { private GenLayer field_76944_d; private GenLayer field_76945_e; private BiomeCache field_76942_f; private List field_76943_g; protected WorldChunkManager() { field_76942_f = new BiomeCache(this); field_76943_g = new ArrayList(); field_76943_g.add(BiomeGenBase.field_76767_f); field_76943_g.add(BiomeGenBase.field_76772_c); field_76943_g.add(BiomeGenBase.field_76768_g); field_76943_g.add(BiomeGenBase.field_76784_u); field_76943_g.add(BiomeGenBase.field_76785_t); field_76943_g.add(BiomeGenBase.field_76782_w); field_76943_g.add(BiomeGenBase.field_76792_x); } public WorldChunkManager(long p_i3751_1_, WorldType p_i3751_3_) { this(); GenLayer agenlayer[] = GenLayer.func_75901_a(p_i3751_1_, p_i3751_3_); field_76944_d = agenlayer[0]; field_76945_e = agenlayer[1]; } public WorldChunkManager(World p_i3752_1_) { this(p_i3752_1_.func_72905_C(), p_i3752_1_.func_72912_H().func_76067_t()); } public List func_76932_a() { return field_76943_g; } public BiomeGenBase func_76935_a(int p_76935_1_, int p_76935_2_) { return field_76942_f.func_76837_b(p_76935_1_, p_76935_2_); } public float[] func_76936_a(float p_76936_1_[], int p_76936_2_, int p_76936_3_, int p_76936_4_, int p_76936_5_) { IntCache.func_76446_a(); if(p_76936_1_ == null || p_76936_1_.length < p_76936_4_ * p_76936_5_) { p_76936_1_ = new float[p_76936_4_ * p_76936_5_]; } int ai[] = field_76945_e.func_75904_a(p_76936_2_, p_76936_3_, p_76936_4_, p_76936_5_); for(int i = 0; i < p_76936_4_ * p_76936_5_; i++) { float f = (float)BiomeGenBase.field_76773_a[ai[i]].func_76744_g() / 65536F; if(f > 1.0F) { f = 1.0F; } p_76936_1_[i] = f; } return p_76936_1_; } public float func_76939_a(float p_76939_1_, int p_76939_2_) { return p_76939_1_; } public float[] func_76934_b(float p_76934_1_[], int p_76934_2_, int p_76934_3_, int p_76934_4_, int p_76934_5_) { IntCache.func_76446_a(); if(p_76934_1_ == null || p_76934_1_.length < p_76934_4_ * p_76934_5_) { p_76934_1_ = new float[p_76934_4_ * p_76934_5_]; } int ai[] = field_76945_e.func_75904_a(p_76934_2_, p_76934_3_, p_76934_4_, p_76934_5_); for(int i = 0; i < p_76934_4_ * p_76934_5_; i++) { float f = (float)BiomeGenBase.field_76773_a[ai[i]].func_76734_h() / 65536F; if(f > 1.0F) { f = 1.0F; } p_76934_1_[i] = f; } return p_76934_1_; } public BiomeGenBase[] func_76937_a(BiomeGenBase p_76937_1_[], int p_76937_2_, int p_76937_3_, int p_76937_4_, int p_76937_5_) { IntCache.func_76446_a(); if(p_76937_1_ == null || p_76937_1_.length < p_76937_4_ * p_76937_5_) { p_76937_1_ = new BiomeGenBase[p_76937_4_ * p_76937_5_]; } int ai[] = field_76944_d.func_75904_a(p_76937_2_, p_76937_3_, p_76937_4_, p_76937_5_); for(int i = 0; i < p_76937_4_ * p_76937_5_; i++) { p_76937_1_[i] = BiomeGenBase.field_76773_a[ai[i]]; } return p_76937_1_; } public BiomeGenBase[] func_76933_b(BiomeGenBase p_76933_1_[], int p_76933_2_, int p_76933_3_, int p_76933_4_, int p_76933_5_) { return func_76931_a(p_76933_1_, p_76933_2_, p_76933_3_, p_76933_4_, p_76933_5_, true); } public BiomeGenBase[] func_76931_a(BiomeGenBase p_76931_1_[], int p_76931_2_, int p_76931_3_, int p_76931_4_, int p_76931_5_, boolean p_76931_6_) { IntCache.func_76446_a(); if(p_76931_1_ == null || p_76931_1_.length < p_76931_4_ * p_76931_5_) { p_76931_1_ = new BiomeGenBase[p_76931_4_ * p_76931_5_]; } if(p_76931_6_ && p_76931_4_ == 16 && p_76931_5_ == 16 && (p_76931_2_ & 0xf) == 0 && (p_76931_3_ & 0xf) == 0) { BiomeGenBase abiomegenbase[] = field_76942_f.func_76839_e(p_76931_2_, p_76931_3_); System.arraycopy(abiomegenbase, 0, p_76931_1_, 0, p_76931_4_ * p_76931_5_); return p_76931_1_; } int ai[] = field_76945_e.func_75904_a(p_76931_2_, p_76931_3_, p_76931_4_, p_76931_5_); for(int i = 0; i < p_76931_4_ * p_76931_5_; i++) { p_76931_1_[i] = BiomeGenBase.field_76773_a[ai[i]]; } return p_76931_1_; } public boolean func_76940_a(int p_76940_1_, int p_76940_2_, int p_76940_3_, List p_76940_4_) { int i = p_76940_1_ - p_76940_3_ >> 2; int j = p_76940_2_ - p_76940_3_ >> 2; int k = p_76940_1_ + p_76940_3_ >> 2; int l = p_76940_2_ + p_76940_3_ >> 2; int i1 = (k - i) + 1; int j1 = (l - j) + 1; int ai[] = field_76944_d.func_75904_a(i, j, i1, j1); for(int k1 = 0; k1 < i1 * j1; k1++) { BiomeGenBase biomegenbase = BiomeGenBase.field_76773_a[ai[k1]]; if(!p_76940_4_.contains(biomegenbase)) { return false; } } return true; } public ChunkPosition func_76941_a(int p_76941_1_, int p_76941_2_, int p_76941_3_, List p_76941_4_, Random p_76941_5_) { int i = p_76941_1_ - p_76941_3_ >> 2; int j = p_76941_2_ - p_76941_3_ >> 2; int k = p_76941_1_ + p_76941_3_ >> 2; int l = p_76941_2_ + p_76941_3_ >> 2; int i1 = (k - i) + 1; int j1 = (l - j) + 1; int ai[] = field_76944_d.func_75904_a(i, j, i1, j1); ChunkPosition chunkposition = null; int k1 = 0; for(int l1 = 0; l1 < ai.length; l1++) { int i2 = i + l1 % i1 << 2; int j2 = j + l1 / i1 << 2; BiomeGenBase biomegenbase = BiomeGenBase.field_76773_a[ai[l1]]; if(p_76941_4_.contains(biomegenbase) && (chunkposition == null || p_76941_5_.nextInt(k1 + 1) == 0)) { chunkposition = new ChunkPosition(i2, 0, j2); k1++; } } return chunkposition; } public void func_76938_b() { field_76942_f.func_76838_a(); } }
[ "nmg43@cornell.edu" ]
nmg43@cornell.edu
e3e67f0507a53e81faf14fab83d2582551e72bfe
038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad
/schemaOrgImpl/src/org/kyojo/schemaorg/m3n5/healthLifesci/impl/PRE_OP.java
d2dcf673fd89051101636992cd0ce28856b1d79c
[ "Apache-2.0" ]
permissive
nagaikenshin/schemaOrg
3dec1626781913930da5585884e3484e0b525aea
4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8
refs/heads/master
2021-06-25T04:52:49.995840
2019-05-12T06:22:37
2019-05-12T06:22:37
134,319,974
1
0
null
null
null
null
UTF-8
Java
false
false
1,455
java
package org.kyojo.schemaorg.m3n5.healthLifesci.impl; import java.util.ArrayList; import java.util.List; import org.kyojo.schemaorg.SimpleJsonBuilder; import org.kyojo.schemaorg.m3n5.core.DataType.Text; import org.kyojo.schemaorg.m3n5.core.impl.TEXT; import org.kyojo.schemaorg.m3n5.healthLifesci.Container; public class PRE_OP implements Container.PreOp { private static final long serialVersionUID = 1L; public List<Text> textList; public PRE_OP() { } public PRE_OP(String string) { this(new TEXT(string)); } public PRE_OP(Text text) { textList = new ArrayList<Text>(); textList.add(text); } @Override public Text getText() { if(textList != null && textList.size() > 0) { return textList.get(0); } else { return null; } } @Override public void setText(Text text) { if(textList == null) { textList = new ArrayList<>(); } if(textList.size() == 0) { textList.add(text); } else { textList.set(0, text); } } @Override public List<Text> getTextList() { return textList; } @Override public void setTextList(List<Text> textList) { this.textList = textList; } @Override public boolean hasText() { return textList != null && textList.size() > 0 && textList.get(0) != null; } @Override public String getNativeValue() { if(getText() == null) return null; return getText().getNativeValue(); } @Override public String toString() { return SimpleJsonBuilder.toJson(this); } }
[ "nagai@nagaikenshin.com" ]
nagai@nagaikenshin.com
d589ea3091ccdea5bb129c98ca11c2a730c27438
1e470ee537b142e209008dc2090f365381d136be
/src/main/java/io/github/acamsys/ebillsamplegenerator/web/rest/vm/LoggerVM.java
6cda80e55b049a9f97ea6b7bbbf221090dc56737
[]
no_license
BulkSecurityGeneratorProject/ebillsamplegenerator
483314dd1620dda9c4096dad5f0c1eb208f1f60b
b33409c32ea70e504ad604b997deab4376dc6303
refs/heads/master
2022-12-30T07:11:40.420677
2017-12-23T01:07:07
2017-12-23T01:07:07
296,595,403
0
0
null
2020-09-18T10:59:15
2020-09-18T10:59:14
null
UTF-8
Java
false
false
906
java
package io.github.acamsys.ebillsamplegenerator.web.rest.vm; import ch.qos.logback.classic.Logger; /** * View Model object for storing a Logback logger. */ public class LoggerVM { private String name; private String level; public LoggerVM(Logger logger) { this.name = logger.getName(); this.level = logger.getEffectiveLevel().toString(); } public LoggerVM() { // Empty public constructor used by Jackson. } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLevel() { return level; } public void setLevel(String level) { this.level = level; } @Override public String toString() { return "LoggerVM{" + "name='" + name + '\'' + ", level='" + level + '\'' + '}'; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
07f1d439bbaf84c818cef3ac81074a68eb7cf3f6
c26912f3375141bb2fb3c07357289f20d88bcf2d
/JavaAlgorithm/src/main/java/algo/tzashinorpu/SpecialSubject/Stack_Queue/mctFromLeafValues_1130.java
c63c16127605fb6e3dd59d4af0b69661ddecab8d
[ "MIT" ]
permissive
TzashiNorpu/Algorithm
2013b5781d0ac517f2857633c39aee7d2e64d240
bc9155c4daf08041041f84c2daa9cc89f82c2240
refs/heads/main
2023-07-08T06:30:50.080352
2023-06-28T10:01:58
2023-06-28T10:01:58
219,323,961
0
0
null
null
null
null
UTF-8
Java
false
false
2,918
java
package algo.tzashinorpu.SpecialSubject.Stack_Queue; import java.util.*; public class mctFromLeafValues_1130 { private int[][] dp; public int mctFromLeafValues_dp(int[] arr) { dp = new int[arr.length + 1][arr.length + 1]; for (int[] r : dp) Arrays.fill(r, -1); return helper(arr, 0, arr.length - 1); } public int helper(int[] arr, int l, int r) { if (dp[l][r] != -1) return dp[l][r]; if (l >= r) return 0; int res = Integer.MAX_VALUE; // 遍历所有的可能的树,得到所有的可能的树的非叶子节点的和,取其中最小的和 for (int i = l; i < r; i++) { int rootVal = max(arr, l, i) * max(arr, i + 1, r); int nonLeafNodeFromLeftSubtree = helper(arr, l, i); int nonLeafNodeFromRightSubtree = helper(arr, i + 1, r); res = Math.min(res, rootVal + nonLeafNodeFromLeftSubtree + nonLeafNodeFromRightSubtree); } dp[l][r] = res; return res; } public int mctFromLeafValues_greedy(int[] arr) { // 大节点应当尽量靠经树的根节点,大节点越靠上影响的节点数就越少 -> 小节点应该经尽量靠下 // 先找到最小的值去组装非叶子节点,然后这个值后续就不需要了,因为后续的非叶子节点都是需要左右子树的最大值 List<Integer> A = new ArrayList<>(); for (int d : arr) A.add(d); int res = 0; while (A.size() != 1) { int minIndex = A.indexOf(Collections.min(A)); if (minIndex > 0 && minIndex < A.size() - 1) // 最小值两边选更小的 res += A.get(minIndex) * Math.min(A.get(minIndex - 1), A.get(minIndex + 1)); else if (minIndex == 0) res += A.get(minIndex) * A.get(minIndex + 1); else res += A.get(minIndex) * A.get(minIndex - 1); A.remove(minIndex); } return res; } public int max(int[] arr, int l, int r) { int max = 0; for (int i = l; i <= r; i++) max = Math.max(max, arr[i]); return max; } // 贪心转单调栈 /* 问题本质: 10, 9, [3, 4], 5 10, 9, `12`, [4,5] 10, [9, 5], `12`, `20`, [10, 9], `45`, `12`, `20`, `90`,`45`, `12`, `20` = 90 + 45 + 12 + 20 = 167 */ public int mctFromLeafValues_stack(int[] A) { int res = 0; Stack<Integer> stack = new Stack<>(); stack.push(Integer.MAX_VALUE); for (int num : A) { while (stack.peek() <= num) { int mid = stack.pop(); res += mid * Math.min(stack.peek(), num); } stack.push(num); } while (stack.size() > 2) res += stack.pop() * stack.peek(); return res; } }
[ "tzashinorpu@gmail.com" ]
tzashinorpu@gmail.com
64c8636c959813960037d49c206820f0dfc2344b
d7d7b0c25a923a699ffa579e1bab546435443302
/NGServer/Model/src/main/java/nari/model/device/ResultSet.java
d1c0777a2f9debe57fe9bb70da6e6b52e923ef15
[]
no_license
github188/test-3
9cd2417319161a014df8b54aa68579843ade8885
92c8b20ba19185fca1e0293fe7208102b338a9ca
refs/heads/master
2020-03-15T09:36:37.329325
2017-12-18T02:40:21
2017-12-18T02:40:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
360
java
package nari.model.device; import java.util.Iterator; public interface ResultSet { public static final ResultSet NONE = new ResultSet(){ @Override public Device getSingle() { return null; } @Override public Iterator<Device> resultList() { return null; } }; public Device getSingle(); public Iterator<Device> resultList(); }
[ "645236219@qq.com" ]
645236219@qq.com
153a907c9867ce7338e8e8b351ef3f8ab901d604
000e9ddd9b77e93ccb8f1e38c1822951bba84fa9
/java/classes/com/facebook/imagepipeline/bitmaps/SimpleBitmapReleaser.java
289983b7940404262687268cc324bb24a31e64a0
[ "Apache-2.0" ]
permissive
Paladin1412/house
2bb7d591990c58bd7e8a9bf933481eb46901b3ed
b9e63db1a4975b614c422fed3b5b33ee57ea23fd
refs/heads/master
2021-09-17T03:37:48.576781
2018-06-27T12:39:38
2018-06-27T12:41:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
714
java
package com.facebook.imagepipeline.bitmaps; import android.graphics.Bitmap; import com.facebook.common.references.ResourceReleaser; public class SimpleBitmapReleaser implements ResourceReleaser<Bitmap> { private static SimpleBitmapReleaser sInstance; public static SimpleBitmapReleaser getInstance() { if (sInstance == null) { sInstance = new SimpleBitmapReleaser(); } return sInstance; } public void release(Bitmap paramBitmap) { paramBitmap.recycle(); } } /* Location: /Users/gaoht/Downloads/zirom/classes-dex2jar.jar!/com/facebook/imagepipeline/bitmaps/SimpleBitmapReleaser.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "ght163988@autonavi.com" ]
ght163988@autonavi.com
57bb13ac7ab00b26f31c2c3c4fa240d861146e7a
ca9371238f2f8fbec5f277b86c28472f0238b2fe
/src/mx/com/kubo/components/recaptcha/RecaptchaValidator.java
83952250c8c9eccbc51d4f8e59588ec9aefd578b
[]
no_license
ocg1/kubo.portal
64cb245c8736a1f8ec4010613e14a458a0d94881
ab022457d55a72df73455124d65b625b002c8ac2
refs/heads/master
2021-05-15T17:23:48.952576
2017-05-08T17:18:09
2017-05-08T17:18:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,046
java
package mx.com.kubo.components.recaptcha; import java.util.Date; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; import javax.servlet.http.HttpServletRequest; import net.tanesha.recaptcha.ReCaptchaImpl; import net.tanesha.recaptcha.ReCaptchaResponse; public class RecaptchaValidator implements Validator { public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest(); //request.getAsyncContext(); if (component instanceof RecaptchaComponent) { RecaptchaComponent c = (RecaptchaComponent)component; String remoteAddr = request.getRemoteAddr(); ReCaptchaImpl reCaptcha = new ReCaptchaImpl(); reCaptcha.setPrivateKey(c.getPrivateKey()); String challenge = request.getParameter("recaptcha_challenge_field"); String uresponse = request.getParameter("recaptcha_response_field"); System.out.println("*****************************************************************************************************************"); System.out.println("*****************************************************************************************************************"); System.out.println("*****************************************************************************************************************"); System.out.println("*****************************************************************************************************************"); System.out.println("*******************************************CAPTCHA_VALIDATOR*****************************************************"); System.out.println("*****************************************************************************************************************"); System.out.println("*****************************************************************************************************************"); System.out.println("*****************************************************************************************************************"); System.out.println("*****************************************************************************************************************"); Date d1 = new Date(); ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer(remoteAddr, challenge, uresponse); Date d2 = new Date(); Long t = d2.getTime() - d1.getTime(); System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); System.out.println("++++++++++++++++++++++++++++++++++++++++++REGRESANDO+DESPUES+DE++"+t+"+milisegundos++++++++++++++++++++++++++++++++++"); System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); if (!reCaptchaResponse.isValid()) { throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "¡Captcha incorrecto, vuelva a intentarlo!", "¡Captcha incorrecto vuelva a intentarlo!")); } } } }
[ "damian.tapia.nava@gmail.com" ]
damian.tapia.nava@gmail.com
e9d5d6a8afabb99f8b8b672c473879e0ecda2c81
a6caee5f3063416ba8237083909590176f87bae1
/src/main/java/com/montenegro/montenegrian/security/jwt/TokenProvider.java
b85708369492b90b19296deb0449e47d70d7328d
[]
no_license
alpercelerce/Montenegrian
b99555357750f0fecd7bb3a97da3d651ab9ae12e
06f2615db15e7e8ce8fa93bd7e6149d355bc2035
refs/heads/master
2021-07-07T04:41:36.281870
2017-10-04T15:32:01
2017-10-04T15:32:01
105,785,335
0
0
null
null
null
null
UTF-8
Java
false
false
4,052
java
package com.montenegro.montenegrian.security.jwt; import io.github.jhipster.config.JHipsterProperties; import java.util.*; import java.util.stream.Collectors; import javax.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.User; import org.springframework.stereotype.Component; import io.jsonwebtoken.*; @Component public class TokenProvider { private final Logger log = LoggerFactory.getLogger(TokenProvider.class); private static final String AUTHORITIES_KEY = "auth"; private String secretKey; private long tokenValidityInMilliseconds; private long tokenValidityInMillisecondsForRememberMe; private final JHipsterProperties jHipsterProperties; public TokenProvider(JHipsterProperties jHipsterProperties) { this.jHipsterProperties = jHipsterProperties; } @PostConstruct public void init() { this.secretKey = jHipsterProperties.getSecurity().getAuthentication().getJwt().getSecret(); this.tokenValidityInMilliseconds = 1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSeconds(); this.tokenValidityInMillisecondsForRememberMe = 1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSecondsForRememberMe(); } public String createToken(Authentication authentication, Boolean rememberMe) { String authorities = authentication.getAuthorities().stream() .map(GrantedAuthority::getAuthority) .collect(Collectors.joining(",")); long now = (new Date()).getTime(); Date validity; if (rememberMe) { validity = new Date(now + this.tokenValidityInMillisecondsForRememberMe); } else { validity = new Date(now + this.tokenValidityInMilliseconds); } return Jwts.builder() .setSubject(authentication.getName()) .claim(AUTHORITIES_KEY, authorities) .signWith(SignatureAlgorithm.HS512, secretKey) .setExpiration(validity) .compact(); } public Authentication getAuthentication(String token) { Claims claims = Jwts.parser() .setSigningKey(secretKey) .parseClaimsJws(token) .getBody(); Collection<? extends GrantedAuthority> authorities = Arrays.stream(claims.get(AUTHORITIES_KEY).toString().split(",")) .map(SimpleGrantedAuthority::new) .collect(Collectors.toList()); User principal = new User(claims.getSubject(), "", authorities); return new UsernamePasswordAuthenticationToken(principal, token, authorities); } public boolean validateToken(String authToken) { try { Jwts.parser().setSigningKey(secretKey).parseClaimsJws(authToken); return true; } catch (SignatureException e) { log.info("Invalid JWT signature."); log.trace("Invalid JWT signature trace: {}", e); } catch (MalformedJwtException e) { log.info("Invalid JWT token."); log.trace("Invalid JWT token trace: {}", e); } catch (ExpiredJwtException e) { log.info("Expired JWT token."); log.trace("Expired JWT token trace: {}", e); } catch (UnsupportedJwtException e) { log.info("Unsupported JWT token."); log.trace("Unsupported JWT token trace: {}", e); } catch (IllegalArgumentException e) { log.info("JWT token compact of handler are invalid."); log.trace("JWT token compact of handler are invalid trace: {}", e); } return false; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
c1ebaa1b4750c620749abd5673a84177b40545e6
d450b62e0cebfcfc592350192cd424009c347733
/jOOQ-test/examples/org/jooq/examples/sqlserver/adventureworks/dbo/tables/Awbuildversion.java
4323b23ec58bb37424383489d1614d56b219e62d
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
rtincar/jOOQ
9ccec69ff0d4af5217829413c1132a0d08acded8
d0304fdfa77c0a8fd79614f7ff72b558783ec6a8
refs/heads/master
2020-12-25T11:21:22.173304
2012-03-01T16:32:48
2012-03-01T16:32:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,707
java
/** * This class is generated by jOOQ */ package org.jooq.examples.sqlserver.adventureworks.dbo.tables; /** * This class is generated by jOOQ. */ public class Awbuildversion extends org.jooq.impl.UpdatableTableImpl<org.jooq.examples.sqlserver.adventureworks.dbo.tables.records.AwbuildversionRecord> { private static final long serialVersionUID = -1319738074; /** * The singleton instance of dbo.AWBuildVersion */ public static final org.jooq.examples.sqlserver.adventureworks.dbo.tables.Awbuildversion AWBUILDVERSION = new org.jooq.examples.sqlserver.adventureworks.dbo.tables.Awbuildversion(); /** * The class holding records for this type */ private static final java.lang.Class<org.jooq.examples.sqlserver.adventureworks.dbo.tables.records.AwbuildversionRecord> __RECORD_TYPE = org.jooq.examples.sqlserver.adventureworks.dbo.tables.records.AwbuildversionRecord.class; /** * The class holding records for this type */ @Override public java.lang.Class<org.jooq.examples.sqlserver.adventureworks.dbo.tables.records.AwbuildversionRecord> getRecordType() { return __RECORD_TYPE; } /** * An uncommented item * * PRIMARY KEY */ public final org.jooq.TableField<org.jooq.examples.sqlserver.adventureworks.dbo.tables.records.AwbuildversionRecord, java.lang.Byte> SYSTEMINFORMATIONID = createField("SystemInformationID", org.jooq.impl.SQLDataType.TINYINT, this); /** * An uncommented item */ public final org.jooq.TableField<org.jooq.examples.sqlserver.adventureworks.dbo.tables.records.AwbuildversionRecord, java.lang.String> DATABASE_VERSION = createField("Database Version", org.jooq.impl.SQLDataType.NVARCHAR, this); /** * An uncommented item */ public final org.jooq.TableField<org.jooq.examples.sqlserver.adventureworks.dbo.tables.records.AwbuildversionRecord, java.sql.Timestamp> VERSIONDATE = createField("VersionDate", org.jooq.impl.SQLDataType.TIMESTAMP, this); /** * An uncommented item */ public final org.jooq.TableField<org.jooq.examples.sqlserver.adventureworks.dbo.tables.records.AwbuildversionRecord, java.sql.Timestamp> MODIFIEDDATE = createField("ModifiedDate", org.jooq.impl.SQLDataType.TIMESTAMP, this); /** * No further instances allowed */ private Awbuildversion() { super("AWBuildVersion", org.jooq.examples.sqlserver.adventureworks.dbo.Dbo.DBO); } /** * No further instances allowed */ private Awbuildversion(java.lang.String alias) { super(alias, org.jooq.examples.sqlserver.adventureworks.dbo.Dbo.DBO, org.jooq.examples.sqlserver.adventureworks.dbo.tables.Awbuildversion.AWBUILDVERSION); } @Override public org.jooq.Identity<org.jooq.examples.sqlserver.adventureworks.dbo.tables.records.AwbuildversionRecord, java.lang.Byte> getIdentity() { return org.jooq.examples.sqlserver.adventureworks.dbo.Keys.IDENTITY_AWBUILDVERSION; } @Override public org.jooq.UniqueKey<org.jooq.examples.sqlserver.adventureworks.dbo.tables.records.AwbuildversionRecord> getMainKey() { return org.jooq.examples.sqlserver.adventureworks.dbo.Keys.PK_AWBUILDVERSION_SYSTEMINFORMATIONID; } @Override @SuppressWarnings("unchecked") public java.util.List<org.jooq.UniqueKey<org.jooq.examples.sqlserver.adventureworks.dbo.tables.records.AwbuildversionRecord>> getKeys() { return java.util.Arrays.<org.jooq.UniqueKey<org.jooq.examples.sqlserver.adventureworks.dbo.tables.records.AwbuildversionRecord>>asList(org.jooq.examples.sqlserver.adventureworks.dbo.Keys.PK_AWBUILDVERSION_SYSTEMINFORMATIONID); } @Override public org.jooq.examples.sqlserver.adventureworks.dbo.tables.Awbuildversion as(java.lang.String alias) { return new org.jooq.examples.sqlserver.adventureworks.dbo.tables.Awbuildversion(alias); } }
[ "lukas.eder@gmail.com" ]
lukas.eder@gmail.com
27137f4a2b13b6e56bd7ee561159d9cfca22f77d
b03c18e31efa93e06cc6bdc79e91d02022f32755
/src/org/ourgrid/portal/server/logic/executors/plugin/epanet/EpanetJobSubmissionExecutor.java
578ef1a15af98f58bde5d11aff6025417e899cb1
[]
no_license
OurGrid/portal
1f63f81e8aab1572eca0e683daccd7988454cb20
f306296cded8bbff7707ed106ac2c0f954c9153f
refs/heads/master
2020-06-04T20:24:29.032118
2013-09-19T19:02:10
2013-09-19T19:02:10
12,737,811
2
0
null
null
null
null
UTF-8
Java
false
false
7,504
java
package org.ourgrid.portal.server.logic.executors.plugin.epanet; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.ourgrid.common.specification.exception.JobSpecificationException; import org.ourgrid.common.specification.exception.TaskSpecificationException; import org.ourgrid.common.specification.job.IOBlock; import org.ourgrid.common.specification.job.IOEntry; import org.ourgrid.common.specification.job.JobSpecification; import org.ourgrid.common.specification.job.TaskSpecification; import org.ourgrid.portal.client.common.to.response.ResponseTO; import org.ourgrid.portal.client.common.to.service.ServiceTO; import org.ourgrid.portal.client.plugin.epanetgrid.gui.model.EpanetJobRequest; import org.ourgrid.portal.client.plugin.epanetgrid.to.model.EpanetInputFileTO; import org.ourgrid.portal.client.plugin.epanetgrid.to.response.EpanetJobSubmissionResponseTO; import org.ourgrid.portal.client.plugin.epanetgrid.to.service.EpanetJobSubmissionTO; import org.ourgrid.portal.server.exceptions.ExecutionException; import org.ourgrid.portal.server.logic.executors.JobSubmissionExecutor; import org.ourgrid.portal.server.logic.executors.plugin.epanet.io.ModificarMalhas; import org.ourgrid.portal.server.logic.executors.plugin.epanet.io.PerturbadorExecutor; import org.ourgrid.portal.server.logic.interfaces.OurGridPortalIF; import org.ourgrid.portal.server.messages.OurGridPortalServiceMessages; import org.ourgrid.portal.server.util.OurgridPortalProperties; public class EpanetJobSubmissionExecutor extends JobSubmissionExecutor { private final String FILE_SEPARATOR = System.getProperty("file.separator"); private Long uploadId; private File malhasFile; private File perturbacaoFile; public EpanetJobSubmissionExecutor(OurGridPortalIF portal) { super(portal); } @Override public void logTransaction(ServiceTO serviceTO) { // TODO Auto-generated method stub } @Override public ResponseTO execute(ServiceTO serviceTO) throws ExecutionException { EpanetJobSubmissionTO epanetJobSubmissionTO = (EpanetJobSubmissionTO) serviceTO; EpanetJobSubmissionResponseTO epanetJobSubmissionResponseTO = new EpanetJobSubmissionResponseTO(); initializeClient(); uploadId = epanetJobSubmissionTO.getUploadId(); String userLogin = epanetJobSubmissionTO.getUserLogin(); boolean emailNotification = epanetJobSubmissionTO.isEmailNotification(); EpanetInputFileTO inputFile = epanetJobSubmissionTO.getInputFile(); JobSpecification theJob = new JobSpecification(); try { theJob = compileInputs(inputFile, epanetJobSubmissionTO); } catch (JobSpecificationException e) { throw new ExecutionException(OurGridPortalServiceMessages.PORTAL_SERVICE_UNAVAIABLE_MSG); } catch (TaskSpecificationException e) { throw new ExecutionException(OurGridPortalServiceMessages.PORTAL_SERVICE_UNAVAIABLE_MSG); } catch (IOException e) { throw new ExecutionException(OurGridPortalServiceMessages.PORTAL_SERVICE_UNAVAIABLE_MSG); } Integer jobId = addJob(epanetJobSubmissionTO.getUserLogin(), theJob); epanetJobSubmissionResponseTO.setJobID(jobId); epanetJobSubmissionResponseTO.getJobIDs().add(jobId); addRequest(jobId, new EpanetJobRequest(jobId, uploadId, userLogin, emailNotification, inputFile)); reeschedule(); return epanetJobSubmissionResponseTO; } private String getFilesPath() { return getPortal().getDAOManager().getUploadDirName(uploadId); } public JobSpecification compileInputs(EpanetInputFileTO inputFile, EpanetJobSubmissionTO epanetJobSubmissionTO) throws JobSpecificationException, TaskSpecificationException, IOException, ExecutionException { String perturbacaoFilePath = getFilesPath() + FILE_SEPARATOR + "perturbacao"; List<TaskSpecification> taskList = new ArrayList<TaskSpecification>(); File perturbacao = new File(perturbacaoFilePath); if(!perturbacao.exists()) { perturbacao.mkdirs(); } File remoteFolder = new File(getFilesPath()); for (String fileName : remoteFolder.list()) { File file = new File(remoteFolder.getCanonicalPath() + FILE_SEPARATOR + fileName); if(file.getName().endsWith(".inp")) { setMalhasFile(file); } else if(file.getName().endsWith(".per")) { setPerturbacaoFile(file); } } System.out.println("vai criar perturbador..."); PerturbadorExecutor pe = new PerturbadorExecutor(getMalhasFile().getCanonicalPath()); pe.addPerturbacao(getPerturbacaoFile().getCanonicalPath()); System.out.println("Vai gerar perturbacao"); pe.geraPerturbacao(perturbacaoFilePath, "Malha-out-"); int count = 0; for (String malhaFiles : perturbacao.list()) { count++; ModificarMalhas modificar = new ModificarMalhas(perturbacao.getAbsolutePath() + FILE_SEPARATOR + malhaFiles, "resultados"+count+".txt"); modificar.modificar(); } int counter = 0; for (String malhaFiles : perturbacao.list()) { counter++; File malha = new File(perturbacao.getAbsolutePath() + FILE_SEPARATOR + malhaFiles); createJobSpecification(taskList, malha, "saida"+ counter+".txt", "Resultados"+ counter+".txt", remoteFolder.getAbsolutePath() + FILE_SEPARATOR + "output",counter); } return new JobSpecification("Epanet Job", "", taskList); } public void createJobSpecification(List<TaskSpecification> tasksList,File malha, String outputFileSaida, String outputFileResultado,String outputPath,int index) throws TaskSpecificationException, ExecutionException { String epanetPath = OurgridPortalProperties.getInstance().getProperty(OurgridPortalProperties.EPANET_PATH); File file = new File (epanetPath + FILE_SEPARATOR + "epanetgrid.tar.gz"); try { epanetPath = file.getCanonicalPath(); } catch (IOException e1) { throw new ExecutionException(OurGridPortalServiceMessages.PORTAL_SERVICE_UNAVAIABLE_MSG); } // create initBlock IOBlock initBlock = new IOBlock(); IOEntry epanetFile = new IOEntry("store", epanetPath, "epanetgrid.tar.gz"); IOEntry malhaFile = new IOEntry("put", malha.getAbsolutePath(), malha.getName()); initBlock.putEntry(epanetFile); initBlock.putEntry(malhaFile); //create remotExe String remoteExe = ""; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("tar xzvf $STORAGE/epanetgrid.tar.gz -C $PLAYPEN ; executa.sh "); stringBuilder.append(malha.getName()); stringBuilder.append(" "); stringBuilder.append("saida"); stringBuilder.append(index); stringBuilder.append(".txt"); stringBuilder.append(" "); stringBuilder.append("Resultados"); stringBuilder.append(index); stringBuilder.append(".txt"); remoteExe += stringBuilder.toString(); //create finalBlock IOBlock finalBlock = new IOBlock(); IOEntry finalEntrySaida = new IOEntry("get",outputFileSaida, outputPath + FILE_SEPARATOR + outputFileSaida ); IOEntry finalEntryResultado = new IOEntry("get",outputFileResultado, outputPath + FILE_SEPARATOR + outputFileResultado); finalBlock.putEntry(finalEntrySaida); finalBlock.putEntry(finalEntryResultado); TaskSpecification taskSpec = new TaskSpecification(initBlock, remoteExe, finalBlock, null); tasksList.add(taskSpec); } public File getMalhasFile() { return malhasFile; } public void setMalhasFile(File malhasFile) { this.malhasFile = malhasFile; } public File getPerturbacaoFile() { return perturbacaoFile; } public void setPerturbacaoFile(File perturbacaoFile) { this.perturbacaoFile = perturbacaoFile; } }
[ "abmargb@gmail.com" ]
abmargb@gmail.com
e9a8b06570d6cf7a6668b8786b7edaed565d3ed3
80403ec5838e300c53fcb96aeb84d409bdce1c0c
/server/modules/ms2/src/org/labkey/ms2/Spectrum.java
e4161f739fdb067c94955e1c7b51b83fb5189357
[]
no_license
scchess/LabKey
7e073656ea494026b0020ad7f9d9179f03d87b41
ce5f7a903c78c0d480002f738bccdbef97d6aeb9
refs/heads/master
2021-09-17T10:49:48.147439
2018-03-22T13:01:41
2018-03-22T13:01:41
126,447,224
0
1
null
null
null
null
UTF-8
Java
false
false
1,094
java
/* * Copyright (c) 2006-2016 LabKey Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.labkey.ms2; /** * User: adam * Date: May 10, 2006 * Time: 11:09:10 AM */ public interface Spectrum { float[] getX(); float[] getY(); int getCharge(); int getFraction(); int getRun(); double getPrecursorMass(); double getMZ(); double getScore(int index); Double getRetentionTime(); String getSequence(); String getTrimmedSequence(); String getNextAA(); String getPrevAA(); }
[ "klum@labkey.com" ]
klum@labkey.com
50cb3701010a6ab50f348d4db06150f58c65c72d
2958df3f24ae8a8667394b6ebb083ba6a9a1d36a
/Universal08Cloud/src/br/UFSC/GRIMA/capp/AgrupadorDeWorkingSteps.java
3d48255304c32a1c5b08bb355214eb06f056b40c
[]
no_license
igorbeninca/utevolux
27ac6af9a6d03f21d815c057f18524717b3d1c4d
3f602d9cf9f58d424c3ea458346a033724c9c912
refs/heads/master
2021-01-19T02:50:04.157218
2017-10-13T16:19:41
2017-10-13T16:19:41
51,842,805
0
0
null
null
null
null
UTF-8
Java
false
false
6,179
java
package br.UFSC.GRIMA.capp; import java.util.Vector; import br.UFSC.GRIMA.entidades.features.Feature; public class AgrupadorDeWorkingSteps { public Vector workingsteps; // vetor de ws de uma face *******??????? public Vector grupos = new Vector(); public AgrupadorDeWorkingSteps(Vector vetorWorkingstep) { this.workingsteps = vetorWorkingstep; this.grupos = this.agrupar(); this.imprimirDados(); } /** * * @param workingStepsDoBloco -> vetor de vetores das workinSteps de cada uma das faces * @return -> Vetor de vetores agrupados por camadas */ /*public Vector agruparCamadas(Vector workingStepsDoBloco) { Vector saida = new Vector(); for(int pointIndex = 0; pointIndex < workingStepsDoBloco.size(); pointIndex++) { Vector workingStepsFaceTmp = (Vector)workingStepsDoBloco.elementAt(pointIndex); Vector camadas = this.agruparPorCamadas(workingStepsFaceTmp); saida.add(camadas); } return saida; }*/ public Vector agrupar() { Vector saida = new Vector(); for (int i= 0; i < this.workingsteps.size(); i++) { Vector vTmp = (Vector)this.workingsteps.elementAt(i);//vetor de ws de uma face //System.out.println("Face------>>>" + new Face(pointIndex).getTipoString()); //saida.add(this.agruparFace(vTmp)); saida.add(this.agruparPorCamadas(vTmp)); } return saida; } /** * * @param vetorFace Vetor de Workingsteps de uma face * @return */ public Vector agruparFace(Vector vetorFace){ Vector saida = new Vector(); Vector tmp = new Vector(); for(int i = 0; i < vetorFace.size(); i++){ Workingstep wsTmp = (Workingstep)vetorFace.elementAt(i); Feature fTmp = (Feature)wsTmp.getFeature(); //System.out.println(fTmp.getDados()); --------> } //System.out.println("********** Workingsteps (Tamanho do vetor WS): " + vetorFace.size() + " ***********"); boolean terminou = false; while(!terminou){ /*for(vetorFace){ *procurar ws cuja br.UFSC.GRIMA.feature nao possui mae e nem anteriores -> garante q a br.UFSC.GRIMA.feature tem z == 0 * para cada ws encontrado deve-se criar um grupo de workingsteps * if(nao tem mae e naum tem anteriores){ * for(vetorFace){ * if(wstemp2.feature.getmae == wstmp.feature){ * adiciona o workingstep no grupo de workingsteps como filha * } * } * } * } */ for (int i = 0; i < vetorFace.size(); i++) { Workingstep wTmp = (Workingstep)vetorFace.elementAt(i); Feature fTmp = wTmp.getFeature(); if (fTmp.featureMae == null && fTmp.featuresAnteriores == null)//isto garante que esta em Z = 0 { GrupoDeWorkingSteps gws = new GrupoDeWorkingSteps(); gws.maes.add(wTmp); for (int j = 0; j < vetorFace.size(); j ++) { Workingstep wTmp2 = (Workingstep)vetorFace.elementAt(j); Feature fTmp2 = wTmp2.getFeature(); //System.out.println("%%%%%%%%%%" + fTmp2.featureMae); if(fTmp2.featureMae != null){ if(fTmp2.featureMae.equals(fTmp)) { gws.filhas.add(wTmp2); //System.out.println("gws.filhas: " + gws.filhas); } } } saida.add(gws); //System.out.println(gws.getDados()); } } terminou = true; } return saida; } public Vector agruparPorCamadas(Vector workingStep) { Vector saida = new Vector(); double zAtual = -1; boolean terminou = false; while (!terminou) { double zTmp = -1; for (int i = 0; i < workingStep.size(); i++) { Workingstep wsTmp = (Workingstep)workingStep.elementAt(i); Feature fTmp = wsTmp.getFeature(); if (zTmp == -1 && fTmp.getPosicaoZ() > zAtual) { zTmp = fTmp.getPosicaoZ(); } else if(fTmp.getPosicaoZ() < zTmp && fTmp.getPosicaoZ() > zAtual) { zTmp = fTmp.getPosicaoZ(); } } //System.out.println("Camada Z = " + zTmp); if(zTmp == -1){ terminou = true; } else{ zAtual = zTmp; Vector novo = new Vector(); for(int j = 0; j < workingStep.size(); j ++){ Workingstep wsTmp2 = (Workingstep)workingStep.elementAt(j); Feature fTmp2 = wsTmp2.getFeature(); if (fTmp2.getPosicaoZ() == zAtual) { novo.add(wsTmp2); } } saida.add(novo); // System.out.println("Sequencias possiveis:"); //this.gerarSequencias(novo.size()); //System.out.println("Tamanho do grupo: " + novo.size()); } } /*for(int pointIndex = 0; pointIndex < saida.size(); pointIndex++){ Vector camadaTmp = (Vector)saida.elementAt(pointIndex); System.out.println("Camada -> z= " + ((Workingstep)camadaTmp.elementAt(0)).getFeature().getPosicaoZ()); for(int j = 0; j < camadaTmp.size(); j++){ Workingstep wsTmp = (Workingstep)camadaTmp.elementAt(j); System.out.println(wsTmp.getDados()); } }*/ //this.gerarSequencias(saida.size()); //System.out.println("saida.size: " + saida.size()); return saida; } public void imprimirDados(){ //imprimir os dados do vetor de grupos System.out.println("\n"); System.out.println("======================================================="); System.out.println("== Dados do Agrupador de Workingsteps =="); System.out.println("======================================================="); for(int i = 0; i < this.grupos.size(); i++){ Vector camadasDaFaceI = (Vector)this.grupos.elementAt(i); System.out.printf("..:: Face #%d (possui %d camadas) ::..\n", i, camadasDaFaceI.size()); for(int j = 0; j < camadasDaFaceI.size(); j++){ Vector camadaJ = (Vector)camadasDaFaceI.elementAt(j); System.out.printf("\tCamada #%d (possui %d workingsteps)\n", j, camadaJ.size()); for(int k = 0; k < camadaJ.size(); k++){ Workingstep wsTmp = (Workingstep)camadaJ.elementAt(k); System.out.printf("\t\tWorkingstep #%d (%s)\n", k, wsTmp.getFeature().toString()); } System.out.println(""); } } System.out.println("======================================================="); } }
[ "pilarrmeister@gmail.com" ]
pilarrmeister@gmail.com
96a5b5567c4520883d5b14b653d6b01cb32f9264
e99b64391ba4876f409e4745637f5d85aec483e2
/android_framework/services/src/main/java/github/tornaco/android/thanos/services/app/view/ShowCurrentComponentViewR.java
9062625154fdbbb8be88eb46e5a3e259be650128
[]
no_license
511xy/Thanox
0a05a89b442ef041bd2189275a04e8b35ff66d93
e12b3bae4cefc193441ceabb632999807eebaaa9
refs/heads/master
2020-09-27T21:13:50.053676
2019-12-08T02:08:40
2019-12-08T02:08:40
226,610,955
1
0
null
2019-12-08T03:51:48
2019-12-08T03:51:47
null
UTF-8
Java
false
false
550
java
package github.tornaco.android.thanos.services.app.view; import android.content.ComponentName; import github.tornaco.android.thanos.core.util.AbstractSafeR; import lombok.Setter; public class ShowCurrentComponentViewR extends AbstractSafeR { @Setter private ComponentName name; @Setter private CurrentComponentView view; @Override public void runSafety() { if (name != null && view != null) { view.attach(); view.show(); view.setText(name.flattenToString()); } } }
[ "tornaco@163.com" ]
tornaco@163.com
d8412c624a89a5b3155c42891b7b46eea741c6cd
890506a96e6dfb3b1f53f6a950473b87ea584d4d
/20180422Exam/Skeleton/src/main/java/org/softuni/mostwanted/cotrollers/RaceController.java
c5b80afe6efc8dc8ed2b52e2c9cb2e6a6593ba3f
[ "MIT" ]
permissive
lapd87/SoftUniDatabasesFrameworksHibernateAndSpringData
9a05cb43b476faa38db05ec4e15e507697554fcc
2cfe33e8fc4ab8c8de7b6373f6164f97da76a10a
refs/heads/master
2020-03-13T04:40:39.707800
2018-04-25T07:34:38
2018-04-25T07:34:38
130,967,789
0
0
null
null
null
null
UTF-8
Java
false
false
1,546
java
package org.softuni.mostwanted.cotrollers; import org.softuni.mostwanted.domain.dto.importDtos.RaceXMLWrapperDto; import org.softuni.mostwanted.parser.interfaces.Parser; import org.softuni.mostwanted.services.race.RaceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; import javax.xml.bind.JAXBException; import java.io.IOException; /** * Created by IntelliJ IDEA. * User: LAPD * Date: 22.4.2018 г. * Time: 20:00 ч. */ @Controller public class RaceController { private final RaceService raceService; private final Parser parser; @Autowired public RaceController(RaceService raceService, @Qualifier("XMLParser") Parser parser) { this.raceService = raceService; this.parser = parser; } public String importDataFromXML(String xmlContent) { StringBuilder sb = new StringBuilder(); try { RaceXMLWrapperDto raceXMLWrapperDto = parser.read(RaceXMLWrapperDto.class, xmlContent); raceXMLWrapperDto.getRaceEntry().forEach(r -> { try { sb.append(this.raceService.create(r)) .append(System.lineSeparator()); } catch (IllegalArgumentException ignored) { } }); } catch (JAXBException | IOException e) { e.printStackTrace(); } return sb.toString(); } }
[ "mario87lapd@gmail.com" ]
mario87lapd@gmail.com
f869af78f43c4eafd7b55ac39731ef821f727a10
0493ffe947dad031c7b19145523eb39209e8059a
/OpenJdk8uTest/src/test/javax/management/Introspector/IsMethodTest.java
ff65c28c9768003e10ac25a369b454384c73bbf4
[]
no_license
thelinh95/Open_Jdk8u_Test
7612f1b63b5001d1df85c1df0d70627b123de80f
4df362a71e680dbd7dfbb28c8922e8f20373757a
refs/heads/master
2021-01-16T19:27:30.506632
2017-08-13T23:26:05
2017-08-13T23:26:05
100,169,775
0
1
null
null
null
null
UTF-8
Java
false
false
5,568
java
package test.javax.management.Introspector; /* * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * @test * @bug 4947001 4954369 4954409 4954410 * @summary Test that "Boolean isX()" and "int isX()" define operations * @author Eamonn McManus * @run clean IsMethodTest * @run build IsMethodTest * @run main IsMethodTest */ import javax.management.AttributeNotFoundException; import javax.management.MBeanAttributeInfo; import javax.management.MBeanInfo; import javax.management.MBeanOperationInfo; import javax.management.MBeanServer; import javax.management.MBeanServerFactory; import javax.management.ObjectName; import test.javax.management.*; /* This regression test covers a slew of bugs in Standard MBean reflection. Lots of corner cases were incorrect: In the MBeanInfo for a Standard MBean: - Boolean isX() defined an attribute as if it were boolean isX() - int isX() defined neither an attribute nor an operation When calling MBeanServer.getAttribute: - int get() and void getX() were considered attributes even though they were operations in MBeanInfo When calling MBeanServer.invoke: - Boolean isX() could not be called because it was (consistently with MBeanInfo) considered an attribute, not an operation */ public class IsMethodTest { public static void main(String[] args) throws Exception { System.out.println("Test that Boolean isX() and int isX() both " + "define operations not attributes"); MBeanServer mbs = MBeanServerFactory.createMBeanServer(); Object mb = new IsMethod(); ObjectName on = new ObjectName("a:b=c"); mbs.registerMBean(mb, on); MBeanInfo mbi = mbs.getMBeanInfo(on); boolean ok = true; MBeanAttributeInfo[] attrs = mbi.getAttributes(); if (attrs.length == 0) System.out.println("OK: MBean defines 0 attributes"); else { ok = false; System.out.println("TEST FAILS: MBean should define 0 attributes"); for (int i = 0; i < attrs.length; i++) { System.out.println(" " + attrs[i].getType() + " " + attrs[i].getName()); } } MBeanOperationInfo[] ops = mbi.getOperations(); if (ops.length == 4) System.out.println("OK: MBean defines 4 operations"); else { ok = false; System.out.println("TEST FAILS: MBean should define 4 operations"); } for (int i = 0; i < ops.length; i++) { System.out.println(" " + ops[i].getReturnType() + " " + ops[i].getName()); } final String[] bogusAttrNames = {"", "Lost", "Thingy", "Whatsit"}; for (int i = 0; i < bogusAttrNames.length; i++) { final String bogusAttrName = bogusAttrNames[i]; try { mbs.getAttribute(on, bogusAttrName); ok = false; System.out.println("TEST FAILS: getAttribute(\"" + bogusAttrName + "\") should not work"); } catch (AttributeNotFoundException e) { System.out.println("OK: getAttribute(" + bogusAttrName + ") got exception as expected"); } } final String[] opNames = {"get", "getLost", "isThingy", "isWhatsit"}; for (int i = 0; i < opNames.length; i++) { final String opName = opNames[i]; try { mbs.invoke(on, opName, new Object[0], new String[0]); System.out.println("OK: invoke(\"" + opName + "\") worked"); } catch (Exception e) { ok = false; System.out.println("TEST FAILS: invoke(" + opName + ") got exception: " + e); } } if (ok) System.out.println("Test passed"); else { System.out.println("TEST FAILED"); System.exit(1); } } public static interface IsMethodMBean { public int get(); public void getLost(); public Boolean isThingy(); public int isWhatsit(); } public static class IsMethod implements IsMethodMBean { public int get() { return 0; } public void getLost() { } public Boolean isThingy() { return Boolean.TRUE; } public int isWhatsit() { return 0; } } }
[ "truongthelinh95@gmail.com" ]
truongthelinh95@gmail.com
b9e35fd589551b8ac33811db477e9311e66f75d9
c6d93152ab18b0e282960b8ff224a52c88efb747
/huntkey/code/eureka-server/src/main/java/com/zhang/EurekaApplication.java
90693765c6c33abc278299955d7e94c67689036f
[]
no_license
BAT6188/company-database
adfe5d8b87b66cd51efd0355e131de164b69d3f9
40d0342345cadc51ca2555840e32339ca0c83f51
refs/heads/master
2023-05-23T22:18:22.702550
2018-12-25T00:58:15
2018-12-25T00:58:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
486
java
package com.zhang; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; /** * 启动类 * * @author Administrator * */ @SpringBootApplication @EnableEurekaServer // 表示注册Eurker Server到本地 public class EurekaApplication { public static void main(String[] args) { SpringApplication.run(EurekaApplication.class, args); } }
[ "729235023@qq.com" ]
729235023@qq.com
e931ccc58ba1791da2dcabf5c6419afc8faffb33
75d1f41d291ba9662b5abf12b5fd01a240f9cd5a
/xui_lib/src/main/java/com/xuexiang/xui/widget/textview/supertextview/BaseTextView.java
9647929e9f8515480b9640bcbd62f27c7dd07813
[ "Apache-2.0" ]
permissive
CrackerCat/XUI
4730ef38a46bf69e0cbf94ec5236fd4257b457b3
491d9f770fa74f51df6c50b8967810ae136ec2f1
refs/heads/master
2023-02-19T05:18:02.818052
2022-11-17T15:41:05
2022-11-17T15:41:05
239,412,037
0
1
Apache-2.0
2020-02-10T02:34:06
2020-02-10T02:34:06
null
UTF-8
Java
false
false
5,112
java
package com.xuexiang.xui.widget.textview.supertextview; import android.content.Context; import android.graphics.Typeface; import android.text.InputFilter; import android.text.TextUtils; import android.util.AttributeSet; import android.view.Gravity; import android.widget.LinearLayout; import android.widget.TextView; import io.github.inflationx.calligraphy3.HasTypeface; /** * 基础TextView * * @author xuexiang * @since 2019/1/14 下午10:09 */ public class BaseTextView extends LinearLayout implements HasTypeface { private Context mContext; private TextView mTopTextView, mCenterTextView, mBottomTextView; private LayoutParams mTopTVParams, mCenterTVParams, mBottomTVParams; public BaseTextView(Context context) { super(context); init(context); } public BaseTextView(Context context, AttributeSet attrs) { super(context, attrs); init(context); } public BaseTextView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context); } private void init(Context context) { this.setOrientation(VERTICAL); mContext = context; initView(); } private void initView() { initTopView(); initCenterView(); initBottomView(); } private void initTopView() { if (mTopTVParams == null) { mTopTVParams = getParams(mTopTVParams); } if (mTopTextView == null) { mTopTextView = initTextView(mTopTVParams, mTopTextView); } } private void initCenterView() { if (mCenterTVParams == null) { mCenterTVParams = getParams(mCenterTVParams); } if (mCenterTextView == null) { mCenterTextView = initTextView(mCenterTVParams, mCenterTextView); } } private void initBottomView() { if (mBottomTVParams == null) { mBottomTVParams = getParams(mBottomTVParams); } if (mBottomTextView == null) { mBottomTextView = initTextView(mBottomTVParams, mBottomTextView); } } private TextView initTextView(LayoutParams params, TextView textView) { textView = getTextView(textView, params); textView.setGravity(Gravity.CENTER); addView(textView); return textView; } /** * 初始化textView * * @param textView 对象 * @param layoutParams 对象 * @return 返回 */ public TextView getTextView(TextView textView, LayoutParams layoutParams) { if (textView == null) { textView = new TextView(mContext); textView.setLayoutParams(layoutParams); textView.setVisibility(GONE); } return textView; } /** * 初始化Params * * @param params 对象 * @return 返回 */ public LayoutParams getParams(LayoutParams params) { if (params == null) { params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); } return params; } private void setTextString(TextView textView, CharSequence textString) { textView.setText(textString); if (!TextUtils.isEmpty(textString)) { textView.setVisibility(VISIBLE); } } public void setTopTextString(CharSequence s) { setTextString(mTopTextView, s); } public void setCenterTextString(CharSequence s) { setTextString(mCenterTextView, s); } public void setBottomTextString(CharSequence s) { setTextString(mBottomTextView, s); } public TextView getTopTextView() { return mTopTextView; } public TextView getCenterTextView() { return mCenterTextView; } public TextView getBottomTextView() { return mBottomTextView; } public void setMaxEms(int topMaxEms, int centerMaxEms, int bottomMaxEms) { mTopTextView.setEllipsize(TextUtils.TruncateAt.END); mCenterTextView.setEllipsize(TextUtils.TruncateAt.END); mBottomTextView.setEllipsize(TextUtils.TruncateAt.END); mTopTextView.setFilters(new InputFilter[]{new InputFilter.LengthFilter(topMaxEms)}); mCenterTextView.setFilters(new InputFilter[]{new InputFilter.LengthFilter(centerMaxEms)}); mBottomTextView.setFilters(new InputFilter[]{new InputFilter.LengthFilter(bottomMaxEms)}); } public void setCenterSpaceHeight(int centerSpaceHeight) { mTopTVParams.setMargins(0, 0, 0, centerSpaceHeight / 2); mCenterTVParams.setMargins(0, centerSpaceHeight / 2, 0, centerSpaceHeight / 2); mBottomTVParams.setMargins(0, centerSpaceHeight / 2, 0, 0); } @Override public void setTypeface(Typeface typeface) { if (mTopTextView != null) { mTopTextView.setTypeface(typeface); } if (mCenterTextView != null) { mCenterTextView.setTypeface(typeface); } if (mBottomTextView != null) { mBottomTextView.setTypeface(typeface); } } }
[ "xuexiangjys@163.com" ]
xuexiangjys@163.com
66fedfc9f68419840f241c3e0621e631d43f67ab
d461286b8aa5d9606690892315a007062cb3e0f3
/src/main/java/com/ziaan/beta/FileDelete.java
139d9bad23346bd462fc64a1a271390dfb09ac11
[]
no_license
leemiran/NISE_DEV
f85b26c78aaa5ffadc62c0512332c9bdfe5813b6
6b618946945d8afa08826cb98b5359f295ff0c73
refs/heads/master
2020-08-07T05:04:38.474163
2019-10-10T01:55:33
2019-10-10T01:55:33
212,016,199
0
0
null
null
null
null
UHC
Java
false
false
2,254
java
// ********************************************************** // 1. 제 목: 파일 삭제 // 2. 프로그램명: FileDelete.java // 3. 개 요: // 4. 환 경: JDK 1.3 // 5. 버 젼: 0.1 // 6. 작 성: 2003. 10. 12 // 7. 수 정: // // ********************************************************** package com.ziaan.beta; import java.io.File; public class FileDelete { public FileDelete() { } public boolean allDelete(String v_realPath) { boolean delAllDir_success = false; boolean delFile_success = false; boolean delDir_success = false; boolean temp_success = false; File [] dirsAndFiles = null; int idx_point = 0; try { File delAllDir = new File(v_realPath); // 삭제할 폴더(하부폴더 및 파일을 포함한)의 File 객체 생성한다 dirsAndFiles = delAllDir.listFiles(); if ( dirsAndFiles != null ) { if(!(v_realPath.equals("/emc_backup/LMS/content/") || v_realPath.equals("/emc_backup/LMS/content") || v_realPath.equals("/emc_backup/LMS/dev_ROOT/content/") || v_realPath.equals("/emc_backup/LMS/dev_ROOT/content"))) { for ( int i = 0; i < dirsAndFiles.length; i++ ) { String dirAndFile = dirsAndFiles [i].toString(); idx_point = dirAndFile.indexOf("."); // 각 경로마다 제일 뒤의 .을 찾는다 (파일여부) if ( idx_point != -1) { // 파일이 존재한다면 먼저 파일 삭제 delFile_success = dirsAndFiles [i].delete(); // 해당 경로의 파일 삭제 } else { // 폴더 인 경우 temp_success = this.allDelete(dirAndFile); // 하위에 폴더 및 파일 존재 여부 확인 후 삭제 delDir_success = dirsAndFiles [i].delete(); // 해당 경로의 폴더 삭제 } } // delAllDir.delete(); // 마지막에 지정된 폴더까지 삭제 delAllDir_success = true; } } } catch (Exception ie ) { delAllDir_success = false; ie.printStackTrace(); } return delAllDir_success; } }
[ "knise@10.60.223.121" ]
knise@10.60.223.121
1a8eb00099f4f1413ea0bf2c7fa74095f9005e8c
5e6abc6bca67514b4889137d1517ecdefcf9683a
/Server/src/main/java/org/gielinor/game/world/map/zone/impl/KaramjaZone.java
f59b78776e5aca7d39b3607dfbe4a3fae6cc6c07
[]
no_license
dginovker/RS-2009-317
88e6d773d6fd6814b28bdb469f6855616c71fc26
9d285c186656ace48c2c67cc9e4fb4aeb84411a4
refs/heads/master
2022-12-22T18:47:47.487468
2019-09-20T21:24:34
2019-09-20T21:24:34
208,949,111
2
2
null
2022-12-15T23:55:43
2019-09-17T03:15:17
Java
UTF-8
Java
false
false
1,686
java
package org.gielinor.game.world.map.zone.impl; import org.gielinor.game.node.Node; import org.gielinor.game.node.entity.Entity; import org.gielinor.game.node.entity.player.Player; import org.gielinor.game.node.item.Item; import org.gielinor.game.world.map.zone.MapZone; /** * Represents the karamja zone area. * @author 'Vexia * @version 1.0 */ public final class KaramjaZone extends MapZone { /** * Represents the region ids. */ private static final int[] REGIONS = new int[]{ 11309, 11054, 11566, 11565, 11567, 11568, 11053, 11821, 11055, 11057, 11569, 11822, 11823, 11825, 11310, 11311, 11312, 11313, 11314, 11056, 11057, 11058, 10802, 10801 }; /** * Represents the karamjan rum item. */ private static final Item KARAMJAN_RUM = new Item(431); /** * Constructs a new {@code KaramjaZone} {@code Object}. */ public KaramjaZone() { super("karamja", true); } @Override public void configure() { for (int regionId : REGIONS) { registerRegion(regionId); } } @Override public boolean teleport(Entity entity, int type, Node node) { if (entity instanceof Player) { final Player p = ((Player) entity); int amt = p.getInventory().getCount(KARAMJAN_RUM); if (amt != 0) { p.getInventory().remove(new Item(KARAMJAN_RUM.getId(), amt)); p.getActionSender().sendMessage("During the trip you lose your rum to a sailor in a game of dice. Better luck next time!"); } } return super.teleport(entity, type, node); } }
[ "dcress01@uoguelph.ca" ]
dcress01@uoguelph.ca
b732ce55a20c996f0a902be9edbe1f2aec7b7194
c2fb6846d5b932928854cfd194d95c79c723f04c
/java_backup/java.jimut/jimut_class/anagrams.java
d159c15e0fdcda9a3e70baaab28cb746c1e722a2
[ "MIT" ]
permissive
Jimut123/code-backup
ef90ccec9fb6483bb6dae0aa6a1f1cc2b8802d59
8d4c16b9e960d352a7775786ea60290b29b30143
refs/heads/master
2022-12-07T04:10:59.604922
2021-04-28T10:22:19
2021-04-28T10:22:19
156,666,404
9
5
MIT
2022-12-02T20:27:22
2018-11-08T07:22:48
Jupyter Notebook
UTF-8
Java
false
false
1,566
java
import java.io.*; class anagrams { public static void main (String args[])throws IOException { InputStreamReader ab = new InputStreamReader (System.in); BufferedReader cd = new BufferedReader(ab); String n,m,g,k,x="",y=""; int i,j,l,lt; char h,h1; System.out.println("Enter the first word in capital letters"); n = cd.readLine(); System.out.println("Enter the second word in capital letters"); m = cd.readLine(); g = n; k =m; l = g.length(); lt = k.length(); for(i=65;i<90;i++) {//start of for loop h = (char)(i); for(j=0;j<l;j++) { h1 = g.charAt(j); if(h==h1) { x=x+h; } } } for(i=65;i<90;i++) { h = (char)(i); for(j=0;j<lt;j++) { h1 = k.charAt(j); if(h==h1) { y=y+h; } } } if(x.equals(y)) { System.out.println(m+" and "+n+" are annagram words"); } else { System.out.println(m+" and "+n+" are not annagram words"); } } }
[ "jimutbahanpal@yahoo.com" ]
jimutbahanpal@yahoo.com
8368d2c726fa11f1350ed7aad2e2b26006e27a4c
60ab345245921aea8cab939fd44679d758b0d093
/src/com/afunms/system/manage/SystemManager.java
8c9157ab7d1f74aaeb67d212b8cb6e8329ff9eba
[]
no_license
guogongzhou/afunms
405d56f7c5cad91d0a5e1fea5c9858f1358d0172
40127ef7aecdc7428a199b0e8cce30b27207fee8
refs/heads/master
2021-01-15T19:23:43.488074
2014-11-11T06:36:48
2014-11-11T06:36:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,518
java
package com.afunms.system.manage; import java.util.List; import com.afunms.common.base.BaseManager; import com.afunms.common.base.DaoInterface; import com.afunms.common.base.ErrorMessage; import com.afunms.common.base.ManagerInterface; import com.afunms.common.util.SessionConstant; import com.afunms.system.dao.DepartmentDao; import com.afunms.system.dao.FunctionDao; import com.afunms.system.model.Department; import com.afunms.system.model.Function; import com.afunms.system.model.User; import com.afunms.system.util.CreateRoleFunctionTable; public class SystemManager extends BaseManager implements ManagerInterface { public String execute(String action) { if (action.equals("list")) { User user = (User) session.getAttribute(SessionConstant.CURRENT_USER); Function root = null; FunctionDao functionDao = null; try { functionDao = new FunctionDao(); root = (Function) functionDao.findByID("70"); } catch (Exception e) { } finally { functionDao.close(); } CreateRoleFunctionTable crft = new CreateRoleFunctionTable(); List<Function> functionRoleList = crft.getRoleFunctionListByRoleId(String.valueOf(user.getRole())); List<Function> functionList = crft.getAllFuctionChildByRoot(root, functionRoleList); request.setAttribute("root", root); request.setAttribute("functionList", functionList); return "/system/manage/list.jsp"; } if (action.equals("ready_add")) { return "/system/department/add.jsp"; } if (action.equals("add")) { Department vo = new Department(); vo.setDept(getParaValue("dept")); vo.setMan(getParaValue("man")); vo.setTel(getParaValue("tel")); DaoInterface dao = new DepartmentDao(); setTarget("/dept.do?action=list"); return save(dao, vo); } if (action.equals("delete")) { DaoInterface dao = new DepartmentDao(); setTarget("/dept.do?action=list"); return delete(dao); } if (action.equals("update")) { Department vo = new Department(); vo.setId(getParaIntValue("id")); vo.setDept(getParaValue("dept")); vo.setMan(getParaValue("man")); vo.setTel(getParaValue("tel")); DaoInterface dao = new DepartmentDao(); setTarget("/dept.do?action=list"); return update(dao, vo); } if (action.equals("ready_edit")) { DaoInterface dao = new DepartmentDao(); setTarget("/system/department/edit.jsp"); return readyEdit(dao); } setErrorCode(ErrorMessage.ACTION_NO_FOUND); return null; } }
[ "happysoftware@foxmail.com" ]
happysoftware@foxmail.com
54f73d44a89ddd81df7073a31160b2a7245a4fc2
b39d7e1122ebe92759e86421bbcd0ad009eed1db
/sources/android/app/-$$Lambda$WallpaperManager$Globals$2yG7V1sbMECCnlFTLyjKWKqNoYI.java
f05d8829df55db4cd0d1c996136db8ad016d44eb
[]
no_license
AndSource/miuiframework
ac7185dedbabd5f619a4f8fc39bfe634d101dcef
cd456214274c046663aefce4d282bea0151f1f89
refs/heads/master
2022-03-31T11:09:50.399520
2020-01-02T09:49:07
2020-01-02T09:49:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
707
java
package android.app; import android.app.WallpaperManager.OnColorsChangedListener; import android.util.Pair; import java.util.function.Predicate; /* compiled from: lambda */ public final /* synthetic */ class -$$Lambda$WallpaperManager$Globals$2yG7V1sbMECCnlFTLyjKWKqNoYI implements Predicate { private final /* synthetic */ OnColorsChangedListener f$0; public /* synthetic */ -$$Lambda$WallpaperManager$Globals$2yG7V1sbMECCnlFTLyjKWKqNoYI(OnColorsChangedListener onColorsChangedListener) { this.f$0 = onColorsChangedListener; } public final boolean test(Object obj) { return Globals.lambda$removeOnColorsChangedListener$0(this.f$0, (Pair) obj); } }
[ "shivatejapeddi@gmail.com" ]
shivatejapeddi@gmail.com
85363dc33eaae9ba13c3025d67b0259d735bed6e
c3445da9eff3501684f1e22dd8709d01ff414a15
/LIS/sinosoft-parents/lis-business/src/main/java/com/sinosoft/utility/JdbcUrlBackUp.java
189ff298ce6030116c1cc673993c167742feb26e
[]
no_license
zhanght86/HSBC20171018
954403d25d24854dd426fa9224dfb578567ac212
c1095c58c0bdfa9d79668db9be4a250dd3f418c5
refs/heads/master
2021-05-07T03:30:31.905582
2017-11-08T08:54:46
2017-11-08T08:54:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,108
java
/** * Copyright (c) 2002 sinosoft Co. Ltd. * All right reserved. */ package com.sinosoft.utility; import org.apache.log4j.Logger; /** * <p> * ClassName: JdbcUrl * </p> * <p> * Description: 构建 Jdbc 的 url * </p> * <p> * Copyright: Copyright (c) 2002 * </p> * <p> * Company: sinosoft * </p> * * @author: HST * @version: 1.0 * @date: 2002-05-31 */ public class JdbcUrlBackUp { private static Logger logger = Logger.getLogger(JdbcUrlBackUp.class); // @Field private String DBType; private String IP; private String Port; private String DBName; private String ServerName; private String UserName; private String PassWord; // @Constructor public JdbcUrlBackUp() { // WebLogic连接池,其中MyPool为连接池的名称 // DBType = "WEBLOGICPOOL"; // DBName = "MyPool"; // DBType = "ORACLE"; // IP = "10.0.22.10"; // Port = "1521"; // DBName = "zkrtest"; // UserName = "suggest"; // PassWord = "suggest"; // DBType = "ORACLE"; // IP = "10.0.22.9"; // Port = "1529"; // DBName = "test"; // UserName = "lis6test"; // PassWord = "lis6test"; DBType = "ORACLE"; IP = "10.0.22.166"; Port = "1521"; DBName = "lis6"; UserName = "lis6update"; PassWord = "lis6update"; } // @Method public String getDBType() { return DBType; } public String getIP() { return IP; } public String getPort() { return Port; } public String getDBName() { return DBName; } public String getServerName() { return ServerName; } public String getUserName() { return UserName; } public String getPassWord() { return PassWord; } public void setDBType(String aDBType) { DBType = aDBType; } public void setIP(String aIP) { IP = aIP; } public void setPort(String aPort) { Port = aPort; } public void setDBName(String aDBName) { DBName = aDBName; } public void setServerName(String aServerName) { ServerName = aServerName; } public void setUser(String aUserName) { UserName = aUserName; } public void setPassWord(String aPassWord) { PassWord = aPassWord; } /** * 获取连接句柄 * * @return String */ public String getJdbcUrl() { // String sUrl = ""; StringBuffer sUrl = new StringBuffer(256); // Oracle连接句柄 if (DBType.trim().toUpperCase().equals("ORACLE")) { // sUrl = "jdbc:oracle:thin:@" + IP + ":" // + Port + ":" // + DBName; sUrl.append("jdbc:oracle:thin:@"); sUrl.append(IP); sUrl.append(":"); sUrl.append(Port); sUrl.append(":"); sUrl.append(DBName); } // InforMix连接句柄 if (DBType.trim().toUpperCase().equals("INFORMIX")) { // sUrl = "jdbc:informix-sqli://" + IP + ":" // + Port + "/" // + DBName + ":" // + "informixserver=" + ServerName + ";" // + "user=" + UserName + ";" // + "password=" + PassWord + ";"; sUrl.append("jdbc:informix-sqli://"); sUrl.append(IP); sUrl.append(":"); sUrl.append(Port); sUrl.append(DBName); sUrl.append(":"); sUrl.append("informixserver="); sUrl.append(ServerName); sUrl.append(";"); sUrl.append("user="); sUrl.append(UserName); sUrl.append(";"); sUrl.append("password="); sUrl.append(PassWord); sUrl.append(";"); } // SqlServer连接句柄 if (DBType.trim().toUpperCase().equals("SQLSERVER")) { // sUrl = "jdbc:inetdae:" + IP + ":" // + Port + "?sql7=true&database=" + DBName + "&charset=gbk"; sUrl.append("jdbc:inetdae:"); sUrl.append(IP); sUrl.append(":"); sUrl.append(Port); sUrl.append("?sql7=true&database="); sUrl.append(DBName); sUrl.append("&charset=gbk"); } // WebLogicPool连接句柄 if (DBType.trim().toUpperCase().equals("WEBLOGICPOOL")) { // sUrl = "jdbc:weblogic:pool:" + DBName; sUrl.append("jdbc:weblogic:pool:"); sUrl.append(DBName); } // DB2连接句柄 if (DBType.trim().toUpperCase().equals("DB2")) { // sUrl = "jdbc:db2://" + IP + ":" // + Port + "/" // + DBName; sUrl.append("jdbc:db2://"); sUrl.append(IP); sUrl.append(":"); sUrl.append(Port); sUrl.append("/"); sUrl.append(DBName); } return sUrl.toString(); } }
[ "dingzansh@sinosoft.com.cn" ]
dingzansh@sinosoft.com.cn
a8c92ab929385600a5b9e5ab168c20804e44ad64
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/mm/g/a/pv.java
714158bf8f43fe1782e341dead9c567e45851d42
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
597
java
package com.tencent.mm.g.a; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.sdk.b.b; public final class pv extends b { public pv.a cMa; public pv() { this((byte)0); } private pv(byte paramByte) { AppMethodBeat.i(80735); this.cMa = new pv.a(); this.xxG = false; this.callback = null; AppMethodBeat.o(80735); } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes5-dex2jar.jar * Qualified Name: com.tencent.mm.g.a.pv * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
6497cbf5363113cb6c48bf464203f870fce30a00
5cd9f54b9b4d1ece816d28c7193398621eed51a9
/impl/src/test/java/org/jboss/seam/solder/test/compat/visibility/AnnotatedTypeObserverExtension.java
43092aaf383c219aa616a16e22648451e1f8995f
[]
no_license
aslakknutsen/solder
ec9c8ef761912fe1a7e9c3dd73a047395bde9e22
76ebfc19be3fefa62b01e750269265145984e7f8
refs/heads/master
2021-01-16T20:45:35.559258
2011-03-24T23:03:35
2011-03-24T23:03:35
1,525,445
0
0
null
null
null
null
UTF-8
Java
false
false
1,499
java
/* * JBoss, Home of Professional Open Source * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual * contributors by the @authors tag. See the copyright.txt in the * distribution for a full listing of individual contributors. * * 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.jboss.seam.solder.test.compat.visibility; import java.util.ArrayList; import java.util.List; import javax.enterprise.event.Observes; import javax.enterprise.inject.spi.Extension; import javax.enterprise.inject.spi.ProcessAnnotatedType; public class AnnotatedTypeObserverExtension implements Extension { private List<Class<?>> observed; public AnnotatedTypeObserverExtension() { observed = new ArrayList<Class<?>>(); } public <X> void processAnnotatedType(@Observes ProcessAnnotatedType<X> event) { observed.add(event.getAnnotatedType().getJavaClass()); } public boolean observed(Class<?> c) { return observed.contains(c); } }
[ "dan.j.allen@gmail.com" ]
dan.j.allen@gmail.com
4ae3437202f609703f7b210496d5979e5dce9725
cae9c594e7dc920d17363c5731700088d30ef969
/src/interviewBit/math/Gcd.java
26ced3fc0be2e77e5af639747af0baae52618d4d
[]
no_license
tech-interview-prep/technical-interview-preparation
a0dd552838305d6995bf9e7dfb90f4571e2e2025
8b299d3e282452789f05b8d08135b5ff66c7b890
refs/heads/master
2022-02-08T09:28:35.889755
2022-02-06T22:20:48
2022-02-06T22:20:48
77,586,682
6
3
null
null
null
null
UTF-8
Java
false
false
458
java
package interviewBit.math; /** * Problem statement * * * Given 2 non negative integers m and n, find gcd(m, n) GCD of 2 integers m and n is defined as the greatest integer g such that g is a divisor of both m and n. Both m and n fit in a 32 bit signed integer. Example m : 6 n : 9 GCD(m, n) : 3 */ public class Gcd { public int gcd(int a, int b) { if(b == 0){ return a; } return gcd(b, a%b); } }
[ "bkoteshwarreddy+github@gmail.com" ]
bkoteshwarreddy+github@gmail.com
b23b90530d9dd0373c149374c424ec5d23872fa9
07abcad3885092aef8abe76e0d78c2296d7fcd1b
/twoFactorClient/src/ext/org/openTwoFactor/clientExt/com/thoughtworks/xstream/converters/basic/AbstractSingleValueConverter.java
48c6615efecb366515ff1fa6cd979f73b415da93
[]
no_license
mchyzer/openTwoFactor
df3acfc07f2f385999bd081eeaf2bfc937ee8ff0
6a62b59d176b13a1bc51a0b60a258cef7ea1012c
refs/heads/master
2023-08-28T19:06:16.817966
2023-08-14T17:30:34
2023-08-14T17:30:34
10,210,206
2
2
null
2021-06-04T01:00:06
2013-05-22T02:42:06
JavaScript
UTF-8
Java
false
false
1,949
java
/******************************************************************************* * Copyright 2012 Internet2 * * 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. ******************************************************************************/ /* * Copyright (C) 2006, 2007 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD * style license a copy of which has been included with this distribution in * the LICENSE.txt file. * * Created on 15. February 2006 by Mauro Talevi */ package org.openTwoFactor.clientExt.com.thoughtworks.xstream.converters.basic; import org.openTwoFactor.clientExt.com.thoughtworks.xstream.converters.SingleValueConverter; /** * Base abstract implementation of {@link org.openTwoFactor.clientExt.com.thoughtworks.xstream.converters.SingleValueConverter}. * <p/> * <p>Subclasses should implement methods canConvert(Class) and fromString(String) for the conversion.</p> * * @author Joe Walnes * @author J&ouml;rg Schaible * @author Mauro Talevi * @see org.openTwoFactor.clientExt.com.thoughtworks.xstream.converters.SingleValueConverter */ public abstract class AbstractSingleValueConverter implements SingleValueConverter { public abstract boolean canConvert(Class type); public String toString(Object obj) { return obj == null ? null : obj.toString(); } public abstract Object fromString(String str); }
[ "mchyzer@yahoo.com" ]
mchyzer@yahoo.com
78529f5af491feb2a61c9d3f57b261616f496815
a36dce4b6042356475ae2e0f05475bd6aed4391b
/2005/julypersistence2EJB/ejbModule/com/hps/july/persistence2/OfficeMemoPosHome.java
80ee6ee2ae64af973065bee60f162ea4bf61cdf2
[]
no_license
ildar66/WSAD_NRI
b21dbee82de5d119b0a507654d269832f19378bb
2a352f164c513967acf04d5e74f36167e836054f
refs/heads/master
2020-12-02T23:59:09.795209
2017-07-01T09:25:27
2017-07-01T09:25:27
95,954,234
0
1
null
null
null
null
UTF-8
Java
false
false
953
java
package com.hps.july.persistence2; /** * This is a Home interface for the Entity Bean */ public interface OfficeMemoPosHome extends javax.ejb.EJBHome { /** * * @return com.hps.july.persistence2.OfficeMemoPos * @param argIdpos int * @param argIdHeader int * @exception String The exception description. * @exception String The exception description. */ com.hps.july.persistence2.OfficeMemoPos create(int argIdpos, int argIdHeader) throws javax.ejb.CreateException, java.rmi.RemoteException; /** * findByPrimaryKey method comment * @return com.hps.july.persistence2.OfficeMemoPos * @param key com.hps.july.persistence2.OfficeMemoPosKey * @exception java.rmi.RemoteException The exception description. * @exception javax.ejb.FinderException The exception description. */ com.hps.july.persistence2.OfficeMemoPos findByPrimaryKey(com.hps.july.persistence2.OfficeMemoPosKey key) throws java.rmi.RemoteException, javax.ejb.FinderException; }
[ "ildar66@inbox.ru" ]
ildar66@inbox.ru
0153abc735a595f4755f62bcd01020afc16c56be
ffb51aa15e6e8d2f259843c783e66af7c0a85ff8
/src/java/com/tsp/sct/bo/InvocaWsNetCancela.java
c4a10022a4a6877f1e9acd2359af26fc12b0a776
[]
no_license
Karmaqueda/SGFENS_BAFAR-1
c9c9b0ffad3ac948b2a76ffbbd5916c1a8751c51
666f858fc49abafe7612600ac0fd468c54c37bfe
refs/heads/master
2021-01-18T16:09:08.520888
2016-08-01T18:49:40
2016-08-01T18:49:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,705
java
/* * To change this template, choose DateManage | Templates * and open the template in the editor. */ package com.tsp.sct.bo; import com.tsp.interconecta.ws.WsGenericResp; import com.tsp.interconecta.ws.dotnet.ArrayOfString; import com.tsp.interconecta.ws.dotnet.EnviaCFDI; import com.tsp.interconecta.ws.dotnet.EnviaCFDISoap; import com.tsp.interconecta.ws.dotnet.RespuestaCancelacion; import com.tsp.sct.util.DateManage; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.XMLGregorianCalendar; /** * * @author ISC César Ulises Martínez García */ public class InvocaWsNetCancela { /** * Constrcutor vacío */ public InvocaWsNetCancela() { } /** * M&eacute;todo que realiza la cancelaci&oacute;n de un XML realizando la * implementaci&oacute;n del WebService de .NET * @param rfcEmisor Es el rfc del Emisor de las facturas a cancelar. * @param fechaHora fecha y hora en que se realiza la llamada a cancelación, será reemplazada por el sistema del SAT * @param listaUUID Es la lista de UUID a cancelar y que pertenecen al mismo Emisor * @param certificadoCSD Arreglo de bytes del archivo .cer del Emisor que esta solicitando la cancelaci&oacute;n * @param privateKeyBase64 Es la llave privada .key del emisor codificada en base64 (Ver clase ...util.UtilSecurity.java) * @return RespuestaCancelacion */ /* public RespuestaCancelacion cancelar(String rfcEmisor, java.util.Date fechaHora, ArrayOfString listaUUID, byte[] certificadoCSD, String privateKeyBase64) throws DatatypeConfigurationException { RespuestaCancelacion respCancelaNet = null; XMLGregorianCalendar fechaHoraCancela = DateManage.dateToXMLGregorianCalendar(fechaHora); respCancelaNet = cancelarCFDICerKey(rfcEmisor, fechaHoraCancela, listaUUID, certificadoCSD, privateKeyBase64); return respCancelaNet; } private static RespuestaCancelacion cancelarCFDICerKey(java.lang.String rfcEmisor, javax.xml.datatype.XMLGregorianCalendar fechaHoraTimbre, com.tsp.interconecta.ws.dotnet.ArrayOfString uuid, byte[] bytesCer, java.lang.String keyBase64) { EnviaCFDI service = new EnviaCFDI(); EnviaCFDISoap port = service.getEnviaCFDISoap(); return port.cancelarCFDICerKey(rfcEmisor, fechaHoraTimbre, uuid, bytesCer, keyBase64); } public RespuestaCancelacion cancelarCFDIPeticionPreFormada(byte[] bytesXMLPeticionCancelacion) { EnviaCFDI service = new EnviaCFDI(); EnviaCFDISoap port = service.getEnviaCFDISoap(); return port.cancelarCFDIPeticionPreFormada(bytesXMLPeticionCancelacion); } * */ public WsGenericResp cancelaCFDI32(java.lang.String user, java.lang.String userPassword, byte[] certificadoEmisor, byte[] llavePrivadaEmisor, java.lang.String llavePrivadaEmisorPassword, java.lang.String xmlCFDI) { com.tsp.interconecta.ws.InterconectaWsService service = new com.tsp.interconecta.ws.InterconectaWsService(); com.tsp.interconecta.ws.InterconectaWs port = service.getInterconectaWsPort(); return port.cancelaCFDI32(user, userPassword, certificadoEmisor, llavePrivadaEmisor, llavePrivadaEmisorPassword, xmlCFDI); } public WsGenericResp cancelaCFDIxp(java.lang.String user, java.lang.String userPassword, java.lang.String xmlPeticionCancelacionSellada) { com.tsp.interconecta.ws.InterconectaWsService service = new com.tsp.interconecta.ws.InterconectaWsService(); com.tsp.interconecta.ws.InterconectaWs port = service.getInterconectaWsPort(); return port.cancelaCFDIxp(user, userPassword, xmlPeticionCancelacionSellada); } }
[ "ing.gloriapalmagonzalez@gmail.com" ]
ing.gloriapalmagonzalez@gmail.com
54f8601b4108423034e7dd5cbce6b8f1a8edcd1f
498dd2daff74247c83a698135e4fe728de93585a
/clients/google-api-services-content/v2/1.29.2/com/google/api/services/content/model/OrdersInStoreRefundLineItemRequest.java
5d4d3389d6549d6865310fe19aec2898016cec90
[ "Apache-2.0" ]
permissive
googleapis/google-api-java-client-services
0e2d474988d9b692c2404d444c248ea57b1f453d
eb359dd2ad555431c5bc7deaeafca11af08eee43
refs/heads/main
2023-08-23T00:17:30.601626
2023-08-20T02:16:12
2023-08-20T02:16:12
147,399,159
545
390
Apache-2.0
2023-09-14T02:14:14
2018-09-04T19:11:33
null
UTF-8
Java
false
false
6,864
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ /* * This code was generated by https://github.com/googleapis/google-api-java-client-services/ * Modify at your own risk. */ package com.google.api.services.content.model; /** * Model definition for OrdersInStoreRefundLineItemRequest. * * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the Content API for Shopping. For a detailed explanation * see: * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> * </p> * * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class OrdersInStoreRefundLineItemRequest extends com.google.api.client.json.GenericJson { /** * The amount that is refunded. Required. * The value may be {@code null}. */ @com.google.api.client.util.Key private Price amountPretax; /** * Tax amount that correspond to refund amount in amountPretax. Required. * The value may be {@code null}. */ @com.google.api.client.util.Key private Price amountTax; /** * The ID of the line item to return. Either lineItemId or productId is required. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String lineItemId; /** * The ID of the operation. Unique across all operations for a given order. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String operationId; /** * The ID of the product to return. This is the REST ID used in the products service. Either * lineItemId or productId is required. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String productId; /** * The quantity to return and refund. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.Long quantity; /** * The reason for the return. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String reason; /** * The explanation of the reason. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String reasonText; /** * The amount that is refunded. Required. * @return value or {@code null} for none */ public Price getAmountPretax() { return amountPretax; } /** * The amount that is refunded. Required. * @param amountPretax amountPretax or {@code null} for none */ public OrdersInStoreRefundLineItemRequest setAmountPretax(Price amountPretax) { this.amountPretax = amountPretax; return this; } /** * Tax amount that correspond to refund amount in amountPretax. Required. * @return value or {@code null} for none */ public Price getAmountTax() { return amountTax; } /** * Tax amount that correspond to refund amount in amountPretax. Required. * @param amountTax amountTax or {@code null} for none */ public OrdersInStoreRefundLineItemRequest setAmountTax(Price amountTax) { this.amountTax = amountTax; return this; } /** * The ID of the line item to return. Either lineItemId or productId is required. * @return value or {@code null} for none */ public java.lang.String getLineItemId() { return lineItemId; } /** * The ID of the line item to return. Either lineItemId or productId is required. * @param lineItemId lineItemId or {@code null} for none */ public OrdersInStoreRefundLineItemRequest setLineItemId(java.lang.String lineItemId) { this.lineItemId = lineItemId; return this; } /** * The ID of the operation. Unique across all operations for a given order. * @return value or {@code null} for none */ public java.lang.String getOperationId() { return operationId; } /** * The ID of the operation. Unique across all operations for a given order. * @param operationId operationId or {@code null} for none */ public OrdersInStoreRefundLineItemRequest setOperationId(java.lang.String operationId) { this.operationId = operationId; return this; } /** * The ID of the product to return. This is the REST ID used in the products service. Either * lineItemId or productId is required. * @return value or {@code null} for none */ public java.lang.String getProductId() { return productId; } /** * The ID of the product to return. This is the REST ID used in the products service. Either * lineItemId or productId is required. * @param productId productId or {@code null} for none */ public OrdersInStoreRefundLineItemRequest setProductId(java.lang.String productId) { this.productId = productId; return this; } /** * The quantity to return and refund. * @return value or {@code null} for none */ public java.lang.Long getQuantity() { return quantity; } /** * The quantity to return and refund. * @param quantity quantity or {@code null} for none */ public OrdersInStoreRefundLineItemRequest setQuantity(java.lang.Long quantity) { this.quantity = quantity; return this; } /** * The reason for the return. * @return value or {@code null} for none */ public java.lang.String getReason() { return reason; } /** * The reason for the return. * @param reason reason or {@code null} for none */ public OrdersInStoreRefundLineItemRequest setReason(java.lang.String reason) { this.reason = reason; return this; } /** * The explanation of the reason. * @return value or {@code null} for none */ public java.lang.String getReasonText() { return reasonText; } /** * The explanation of the reason. * @param reasonText reasonText or {@code null} for none */ public OrdersInStoreRefundLineItemRequest setReasonText(java.lang.String reasonText) { this.reasonText = reasonText; return this; } @Override public OrdersInStoreRefundLineItemRequest set(String fieldName, Object value) { return (OrdersInStoreRefundLineItemRequest) super.set(fieldName, value); } @Override public OrdersInStoreRefundLineItemRequest clone() { return (OrdersInStoreRefundLineItemRequest) super.clone(); } }
[ "chingor@google.com" ]
chingor@google.com
aa71897c0ac1f0dd35c7f1638f2ff5995c302272
30ce31989513fe03ca0736555adf6e8b80b1c093
/src/com/cisco/axl/api/_8/UpdateGatekeeperReq.java
29b1c4be909ebc78692e4b30e7d9e2c27a2daa72
[]
no_license
axenlarde/Woot
21374d0c29e9d6e0b6f0f91f2cbb455f2e2a875e
447728a2793f42530884bb0f3f388d33b3708bc1
refs/heads/master
2022-04-09T19:19:33.826592
2020-02-07T10:36:55
2020-02-07T10:36:55
115,440,477
4
1
null
null
null
null
UTF-8
Java
false
false
4,357
java
package com.cisco.axl.api._8; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for UpdateGatekeeperReq complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="UpdateGatekeeperReq"> * &lt;complexContent> * &lt;extension base="{http://www.cisco.com/AXL/API/8.5}NameAndGUIDRequest"> * &lt;sequence> * &lt;element name="newName" type="{http://www.cisco.com/AXL/API/8.5}UniqueString128" minOccurs="0"/> * &lt;element name="description" type="{http://www.cisco.com/AXL/API/8.5}String128" minOccurs="0"/> * &lt;element name="rrqTimeToLive" type="{http://www.cisco.com/AXL/API/8.5}XInteger" minOccurs="0"/> * &lt;element name="retryTimeout" type="{http://www.cisco.com/AXL/API/8.5}XInteger" minOccurs="0"/> * &lt;element name="enableDevice" type="{http://www.cisco.com/AXL/API/8.5}boolean" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "UpdateGatekeeperReq", propOrder = { "newName", "description", "rrqTimeToLive", "retryTimeout", "enableDevice" }) public class UpdateGatekeeperReq extends NameAndGUIDRequest { protected String newName; protected String description; @XmlElement(defaultValue = "60") protected String rrqTimeToLive; @XmlElement(defaultValue = "300") protected String retryTimeout; @XmlElement(defaultValue = "true") protected String enableDevice; /** * Gets the value of the newName property. * * @return * possible object is * {@link String } * */ public String getNewName() { return newName; } /** * Sets the value of the newName property. * * @param value * allowed object is * {@link String } * */ public void setNewName(String value) { this.newName = value; } /** * Gets the value of the description property. * * @return * possible object is * {@link String } * */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link String } * */ public void setDescription(String value) { this.description = value; } /** * Gets the value of the rrqTimeToLive property. * * @return * possible object is * {@link String } * */ public String getRrqTimeToLive() { return rrqTimeToLive; } /** * Sets the value of the rrqTimeToLive property. * * @param value * allowed object is * {@link String } * */ public void setRrqTimeToLive(String value) { this.rrqTimeToLive = value; } /** * Gets the value of the retryTimeout property. * * @return * possible object is * {@link String } * */ public String getRetryTimeout() { return retryTimeout; } /** * Sets the value of the retryTimeout property. * * @param value * allowed object is * {@link String } * */ public void setRetryTimeout(String value) { this.retryTimeout = value; } /** * Gets the value of the enableDevice property. * * @return * possible object is * {@link String } * */ public String getEnableDevice() { return enableDevice; } /** * Sets the value of the enableDevice property. * * @param value * allowed object is * {@link String } * */ public void setEnableDevice(String value) { this.enableDevice = value; } }
[ "Alexandre@NANALENO" ]
Alexandre@NANALENO
1da5bc42a6d5e035459e1ccdf54c8d5a1318d57b
7bda8a85375719c677d17591097cc3da69c85f95
/wzorce/WzorceProjektowe/src/factory/NY/NYPizzaStore.java
0adbb62fe3a231ed164028572fcba0b8151a7038
[]
no_license
tomekb82/WzorceProjektowe
5e95569ad1c824dcccab228a07706bb541617cf7
c546caf897d7041880d0adec6088f9184349f9f2
refs/heads/master
2020-04-10T21:12:28.627837
2016-12-05T17:48:37
2016-12-05T17:48:37
65,686,988
0
0
null
null
null
null
UTF-8
Java
false
false
773
java
package factory.NY; import factory.CheesePizza; import factory.PepperoniPizza; import factory.Pizza; import factory.PizzaStore; import factory.ingredients.PizzaIngredientFactory; /** * Created by tomek on 15.08.16. */ public class NYPizzaStore extends PizzaStore { @Override protected Pizza createPizza(String type) { Pizza pizza = null; PizzaIngredientFactory ingredientFactory = new NYPizzaIngredientFactory(); if(type.equals("cheese")){ pizza = new CheesePizza(ingredientFactory); pizza.setName("NY cheese pizza"); } else if(type.equals("pepperoni")){ pizza = new PepperoniPizza(ingredientFactory); pizza.setName("NY pepperoni pizza"); } return pizza; } }
[ "tomasz.belina@qualent.eu" ]
tomasz.belina@qualent.eu
0a6e9794b627625732a3c7ef219d058bc9715d30
63e0cd899972adbb117a17d8d40eef8fefb56d62
/android/android48_fragment/app/src/main/java/com/sc/android48_fragment/viewpager/ViewPagerAdapter.java
5c6b40beb9190ef3464ad4e93be64f64f0fd5ae9
[]
no_license
sherazc/playground
8b90e1f7b624a77a3f3e9cf5f71eecf984aa8180
7fe926d2564b12d96f237b253511dd7c2a302b64
refs/heads/master
2023-08-16T17:22:29.564713
2023-08-16T04:34:52
2023-08-16T04:34:52
87,116,642
2
1
null
2023-05-04T18:25:45
2017-04-03T20:15:15
PHP
UTF-8
Java
false
false
712
java
package com.sc.android48_fragment.viewpager; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import com.sc.android48_fragment.app.R; public class ViewPagerAdapter extends FragmentStatePagerAdapter { int[] images = {R.drawable.image1, R.drawable.image2, R.drawable.image3, R.drawable.image4,}; public ViewPagerAdapter(FragmentManager fragmentManager) { super(fragmentManager); } @Override public Fragment getItem(int position) { return Fragment04a.newInstance(position, images[position]); } @Override public int getCount() { return images.length; } }
[ "sheraz@mbp.com" ]
sheraz@mbp.com
b8efa99bbbbb262fb16efc03996a49424b81d2a2
e73025430f98612b4bce8faa13abdee1243bb9cd
/module03-examples/module03-question19/src/test/java/com/spring/professional/exam/tutorial/module03/question19/service/EmployeeServiceTest.java
91c7b345ebbc553035e8de771f175ae4a5ce578d
[]
no_license
a2ankitrai/spring-cert-code-examples
938ddb647518e735c0ddba3b3809f95ea58750b3
491718751129bb0c09cb7bc2608934f7aedb2e81
refs/heads/master
2023-03-29T22:16:25.459200
2021-03-31T06:32:13
2021-03-31T06:32:13
331,714,577
0
0
null
null
null
null
UTF-8
Java
false
false
1,058
java
package com.spring.professional.exam.tutorial.module03.question19.service; import com.spring.professional.exam.tutorial.module03.question19.Runner; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {Runner.class}) public class EmployeeServiceTest { @Autowired private EmployeeService employeeService; @Test @Transactional public void shouldRollbackTransaction() { employeeService.methodWithTransaction(); // ... } @Test @Transactional @Rollback(false) public void shouldNotRollbackTransaction() { employeeService.methodWithTransaction(); // ... } }
[ "ankit.rai@payconiq.com" ]
ankit.rai@payconiq.com
e3c50f1dd3837bb404688e4c0d5798771d3a010e
582b3b233d9c979323aabed1749d83d7b9fa0228
/loginsite/src/java/login/AllUserServ.java
5937d8a892a72477aaf3ac45a1ce9ba583315bab
[]
no_license
PadminiNancy/Hiberuts
227abd500c6732327d7db190056161f901c9c336
db7991ccd548b0bfb936f1f290d4e95137da6d0d
refs/heads/master
2020-04-13T00:02:42.708308
2018-12-22T19:23:18
2018-12-22T19:23:18
162,836,329
1
0
null
null
null
null
UTF-8
Java
false
false
3,152
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package login; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.*; import javax.servlet.RequestDispatcher; import org.hibernate.*; /** * * @author Nancy */ public class AllUserServ extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); SessionFactory sf = HibernateUtil.getSessionFactory(); Session session = sf.openSession(); Transaction tx = null; RequestDispatcher rd = null; try { tx = session.beginTransaction(); Query q = session.createQuery("From Users"); List l = q.list(); request.setAttribute("data",l); if(l!=null) { rd = request.getRequestDispatcher("allusers.jsp"); } else { rd = request.getRequestDispatcher("allusers.jsp?msg=not found"); } rd.forward(request, response); tx.commit(); session.close(); } catch (Exception e) { response.sendRedirect("error.jsp"); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "pdmnnancy@gmail.com" ]
pdmnnancy@gmail.com
04c785b6d885677494de83fe4afae302d6201f30
c1ae5fd52f2bddb16eef64201421d6a13be4c738
/SigmaSI final1/src/org/ucla/sigma/interfazdao/IServicioCardiologiaDAO.java
6d9defe9c3360ff884970ed7fa3e4c4916c7b47d
[]
no_license
albertdug/SIGMAJava
1ecbdf14c24d6d672976b8e3d825679d0bafc72d
03d6727283a10789902ffe68e7e8eab70442edfb
refs/heads/master
2016-09-05T19:33:43.373250
2015-07-16T02:11:11
2015-07-16T02:11:11
39,170,294
1
0
null
null
null
null
UTF-8
Java
false
false
152
java
package org.ucla.sigma.interfazdao; import org.ucla.sigma.daobase.IHibernateDAO; public interface IServicioCardiologiaDAO extends IHibernateDAO { }
[ "albertrdg@gmail.com" ]
albertrdg@gmail.com
e5e639ab902bb9a49cc1b4e3b4757e290f5d38ea
266f3f6ef409fcae71e1eb5a5b4dcff1556469a9
/src/main/java/com/restaurant/management/service/scrumboard/impl/BoardListServiceImpl.java
96b3fa5ef65bc964f6e6d252be4f67cd3db2fb14
[]
no_license
t-janicki/order-management-sytem
abc61573470c1f77ca083523f18b1baefafa1d73
d34a6ebe55e126e18c1ebff927a341405202b08a
refs/heads/master
2022-02-22T16:03:01.003768
2019-09-28T19:15:15
2019-09-28T19:15:15
168,579,843
0
0
null
null
null
null
UTF-8
Java
false
false
253
java
package com.restaurant.management.service.scrumboard.impl; import com.restaurant.management.service.scrumboard.BoardListService; import org.springframework.stereotype.Service; @Service public class BoardListServiceImpl implements BoardListService { }
[ "tjaygallery@gmail.com" ]
tjaygallery@gmail.com
97ffb503535ecacc032a2e306b0cd8e9e99cea94
99c7f5ba1aeb3912b9f32e43c16c31461df24d0c
/Homer/ComponentX10/src/com/jpeterson/x10/.svn/text-base/ControlError.java.svn-base
6a0791bd3586b1ffa2e062bd78cefcf88a6a92c2
[]
no_license
sepiroth887/KinectHomer
aaca831224e4278e1a43a440c5acab04c4f5bc74
397f18858fc93138ffcd204de6bbebbcb1194020
refs/heads/master
2020-03-28T19:21:19.684422
2012-04-20T06:32:44
2012-04-20T06:32:44
3,386,536
0
2
null
null
null
null
UTF-8
Java
false
false
1,502
/* * Copyright (C) 1999 Jesse E. Peterson * * 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * */ package com.jpeterson.x10; /** * Signals that an error has occurred. * * @see ControlException * @see Serialized Form * * @author Jesse Peterson <6/29/99> * @version 1.0 */ public class ControlError extends Error { /** * Empty constructor for <CODE>ControlException</CODE> with no detail * message. * * @author Jesse Peterson <6/29/99> */ public ControlError() { super(); } /** * Constructs a <CODE>ControlException</CODE> with a detail message. * * @param s the detail message * * @author Jesse Peterson <6/29/99> */ public ControlError(String s) { super(s); } }
[ "tha@cs.stir.ac.uk" ]
tha@cs.stir.ac.uk
8ab9ad9ae8e206f3ce733fa20751ca646d1f7834
a899bca4f0149aa8a8129ebdf5d3e45603ae31e9
/basex-core/src/main/java/org/basex/query/func/jobs/JobsList.java
df542c78526edac5f0bd88b086e428f0d198d455
[ "BSD-3-Clause" ]
permissive
jarped/basex
d66b81bebd976af8545472bbdf264509301b73e1
5edde5833db9a50e3a19f862464d7d6fb63c456a
refs/heads/master
2021-01-16T22:35:35.276429
2016-06-29T19:36:14
2016-06-29T19:36:14
62,297,675
0
0
null
2016-06-30T09:22:27
2016-06-30T09:22:27
null
UTF-8
Java
false
false
848
java
package org.basex.query.func.jobs; import java.util.*; import org.basex.core.jobs.*; import org.basex.query.*; import org.basex.query.func.*; import org.basex.query.iter.*; import org.basex.query.value.*; import org.basex.query.value.seq.*; import org.basex.util.list.*; /** * Function implementation. * * @author BaseX Team 2005-16, BSD License * @author Christian Gruen */ public final class JobsList extends StandardFunc { @Override public Value value(final QueryContext qc) throws QueryException { checkAdmin(qc); final Map<String, Job> jobs = qc.context.jobs.jobs; final TokenList list = new TokenList(jobs.size()); for(final String id : jobs.keySet()) list.add(id); return StrSeq.get(list); } @Override public Iter iter(final QueryContext qc) throws QueryException { return value(qc).iter(); } }
[ "christian.gruen@gmail.com" ]
christian.gruen@gmail.com
4245988cc1ddb6043770dd509a6f64729dab4031
3a1b8fb217ea11c3805fa55f0d5a9b7caebf7968
/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcDiscoveryResponse.java
b3f5022b62958fa52ffcc69c0d8548e975aab349
[ "Apache-2.0", "Unlicense" ]
permissive
isabella232/plc4x
ff343eabcd674a5dcb1e7c3b64f71d5aa93a6eba
adabb660a73a50d0cc396cccb09fa4ae61231225
refs/heads/develop
2023-08-27T14:09:35.983668
2021-10-06T19:01:43
2021-10-06T19:01:43
418,112,438
0
0
Apache-2.0
2021-10-17T12:04:53
2021-10-17T11:45:09
null
UTF-8
Java
false
false
2,435
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.plc4x.java.spi.messages; import com.fasterxml.jackson.annotation.*; import org.apache.plc4x.java.api.messages.*; import org.apache.plc4x.java.api.types.PlcResponseCode; import org.apache.plc4x.java.spi.generation.ParseException; import org.apache.plc4x.java.spi.generation.WriteBuffer; import org.apache.plc4x.java.spi.utils.Serializable; import java.util.*; @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, property = "className") public class DefaultPlcDiscoveryResponse implements PlcDiscoveryResponse, Serializable { private final PlcDiscoveryRequest request; private final PlcResponseCode responseCode; private final List<PlcDiscoveryItem> values; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) public DefaultPlcDiscoveryResponse(@JsonProperty("request") PlcDiscoveryRequest request, @JsonProperty("responseCode") PlcResponseCode responseCode, @JsonProperty("values") List<PlcDiscoveryItem> values) { this.request = request; this.responseCode = responseCode; this.values = values; } @Override public PlcDiscoveryRequest getRequest() { return request; } public PlcResponseCode getResponseCode() { return responseCode; } public List<PlcDiscoveryItem> getValues() { return values; } @Override public void serialize(WriteBuffer writeBuffer) throws ParseException { writeBuffer.pushContext("PlcDiscoveryResponse"); // TODO: Implement writeBuffer.popContext("PlcDiscoveryResponse"); } }
[ "christofer.dutz@c-ware.de" ]
christofer.dutz@c-ware.de
ecd84dc528f5538fa5ff20f397f9c80c4c70dfa0
104cda8eafe0617e2a5fa1e2b9f242d78370521b
/aliyun-java-sdk-hdr/src/main/java/com/aliyuncs/hdr/transform/v20170925/DescribeDrGatewaysResponseUnmarshaller.java
ab228f95f651055491609a410c4ed2d980485cc3
[ "Apache-2.0" ]
permissive
SanthosheG/aliyun-openapi-java-sdk
89f9b245c1bcdff8dac0866c36ff9a261aa40684
38a910b1a7f4bdb1b0dd29601a1450efb1220f79
refs/heads/master
2020-07-24T00:00:59.491294
2019-09-09T23:00:27
2019-09-11T04:29:56
207,744,099
2
0
NOASSERTION
2019-09-11T06:55:58
2019-09-11T06:55:58
null
UTF-8
Java
false
false
3,467
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.hdr.transform.v20170925; import java.util.ArrayList; import java.util.List; import com.aliyuncs.hdr.model.v20170925.DescribeDrGatewaysResponse; import com.aliyuncs.hdr.model.v20170925.DescribeDrGatewaysResponse.Gateway; import com.aliyuncs.transform.UnmarshallerContext; public class DescribeDrGatewaysResponseUnmarshaller { public static DescribeDrGatewaysResponse unmarshall(DescribeDrGatewaysResponse describeDrGatewaysResponse, UnmarshallerContext _ctx) { describeDrGatewaysResponse.setRequestId(_ctx.stringValue("DescribeDrGatewaysResponse.RequestId")); describeDrGatewaysResponse.setSuccess(_ctx.booleanValue("DescribeDrGatewaysResponse.Success")); describeDrGatewaysResponse.setCode(_ctx.stringValue("DescribeDrGatewaysResponse.Code")); describeDrGatewaysResponse.setMessage(_ctx.stringValue("DescribeDrGatewaysResponse.Message")); describeDrGatewaysResponse.setTotalCount(_ctx.integerValue("DescribeDrGatewaysResponse.TotalCount")); describeDrGatewaysResponse.setPageNumber(_ctx.integerValue("DescribeDrGatewaysResponse.PageNumber")); describeDrGatewaysResponse.setPageSize(_ctx.integerValue("DescribeDrGatewaysResponse.PageSize")); List<Gateway> drGateways = new ArrayList<Gateway>(); for (int i = 0; i < _ctx.lengthValue("DescribeDrGatewaysResponse.DrGateways.Length"); i++) { Gateway gateway = new Gateway(); gateway.setGatewayId(_ctx.stringValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].GatewayId")); gateway.setSiteId(_ctx.stringValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].SiteId")); gateway.setName(_ctx.stringValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].Name")); gateway.setDescription(_ctx.stringValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].Description")); gateway.setVersion(_ctx.stringValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].Version")); gateway.setIpAddress(_ctx.stringValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].IpAddress")); gateway.setGatewayClass(_ctx.stringValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].GatewayClass")); gateway.setStatus(_ctx.stringValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].Status")); gateway.setImageType(_ctx.stringValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].ImageType")); gateway.setUpstreamSpeed(_ctx.longValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].UpstreamSpeed")); gateway.setDownstreamSpeed(_ctx.longValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].DownstreamSpeed")); gateway.setOperations(_ctx.stringValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].Operations")); gateway.setCreatedTime(_ctx.longValue("DescribeDrGatewaysResponse.DrGateways["+ i +"].CreatedTime")); drGateways.add(gateway); } describeDrGatewaysResponse.setDrGateways(drGateways); return describeDrGatewaysResponse; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
1c5f0ba8d8bf7369fb19cf1970e7ad2c5378da9f
05e45581f8b3b147af2f42cff1b701654d7b61d2
/wuxi/landsale/trunk/landsale/common/src/main/java/cn/gtmap/landsale/common/model/OnePriceLog.java
72fd95a965c3e38f824a3c2ad4fbb958903afcbf
[]
no_license
TimfuDeng/gtfree-bank
581bdc0478e47e2303296b3b6921ae59f976208f
48106284af428a449f0a2ccbee1653b57b4bd120
refs/heads/master
2020-04-03T05:22:06.031843
2018-10-28T06:50:40
2018-10-28T06:50:40
155,043,209
0
2
null
null
null
null
UTF-8
Java
false
false
2,728
java
package cn.gtmap.landsale.common.model; import cn.gtmap.egovplat.core.support.hibernate.UUIDHexGenerator; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; import java.io.Serializable; import java.util.Date; /** * 一次报价竞买流程列表 * @author jiff on 14/12/24. */ @Entity @Table(name = "one_price_log") //@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class OnePriceLog implements Serializable { @Id @GeneratedValue(generator = "sort-uuid") @GenericGenerator(name = "sort-uuid", strategy = UUIDHexGenerator.TYPE) @Column(length = 50) private String id; @Column(length = 32) private String applyId; @Column(length = 50) private String transUserId; @Column private Long price; @Column private Date priceDate; @Column(length = 200) private String priceUnit; @Column private Date createDate; @Column(length = 50) private String transResourceId;//原来标的Id @Column private String extend1; @Column private String extend2; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getApplyId() { return applyId; } public void setApplyId(String applyId) { this.applyId = applyId; } public String getTransUserId() { return transUserId; } public void setTransUserId(String transUserId) { this.transUserId = transUserId; } public Long getPrice() { return price; } public void setPrice(Long price) { this.price = price; } public Date getPriceDate() { return priceDate; } public void setPriceDate(Date priceDate) { this.priceDate = priceDate; } public String getPriceUnit() { return priceUnit; } public void setPriceUnit(String priceUnit) { this.priceUnit = priceUnit; } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } public String getTransResourceId() { return transResourceId; } public void setTransResourceId(String transResourceId) { this.transResourceId = transResourceId; } public String getExtend1() { return extend1; } public void setExtend1(String extend1) { this.extend1 = extend1; } public String getExtend2() { return extend2; } public void setExtend2(String extend2) { this.extend2 = extend2; } }
[ "1337343005@qq.com" ]
1337343005@qq.com
3c7bf00b512a1d0e94977dd513a76ca7d272cc3f
09e03ba73062c62c1d3389cdecb94f68430cd82d
/base/config/src/main/java/org/artifactory/descriptor/repo/vcs/VcsArtifactoryProviderConfiguration.java
633987022511db7fa79d5073d757247ab317684b
[ "Apache-2.0" ]
permissive
alancnet/artifactory
1ee6183301b581e60f67691d7fa025b0fb44b118
7ac3ea76471a00543eaf60e82b554d8edd894c0f
refs/heads/master
2021-01-10T14:58:53.769805
2015-10-07T16:46:14
2015-10-07T16:46:14
43,829,862
3
6
null
2016-03-09T18:30:58
2015-10-07T16:38:51
Java
UTF-8
Java
false
false
1,123
java
/* * Artifactory is a binaries repository manager. * Copyright (C) 2012 JFrog Ltd. * * Artifactory 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 3 of the License, or * (at your option) any later version. * * Artifactory 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 Artifactory. If not, see <http://www.gnu.org/licenses/>. */ package org.artifactory.descriptor.repo.vcs; import java.util.HashMap; /** * Created by michaelp on 6/28/15. */ public class VcsArtifactoryProviderConfiguration extends AbstractVcsProviderConfiguration { public VcsArtifactoryProviderConfiguration() { super( "Artifactory", "", "{0}/{1}/{2}?ext={3}" ); } }
[ "github@alanc.net" ]
github@alanc.net
de2df82b6e5453a062060b494a484a5673f637de
437d14f4eea7ac24aa2ff487a8816848f5a4fbcd
/WebRTC-WebSocket/src/main/java/com/chachae/webrtc/service/impl/MessageForwardServiceImpl.java
e4828d91aed577c6c11253a5938059177de4b7a4
[ "Apache-2.0" ]
permissive
wujiuhsu/WebRTC-With-Socket
ea7740a5471fa1d75acaa28a5889f0987c947b0f
4cc7897a2c5570d730457b3068d11efbed892bb6
refs/heads/master
2022-12-13T17:58:17.966868
2020-09-12T06:55:01
2020-09-12T06:55:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,354
java
package com.chachae.webrtc.service.impl; import com.alibaba.fastjson.JSON; import com.chachae.webrtc.entity.ConnectionSystemUser; import com.chachae.webrtc.entity.Message; import com.chachae.webrtc.service.IMessageForwardService; import java.io.IOException; import java.util.Map; import java.util.Set; import org.springframework.stereotype.Service; import org.springframework.web.socket.TextMessage; import org.springframework.web.socket.WebSocketSession; /** * @author chachae * @version v1.0 * @date 2020/8/13 23:16 */ @Service public class MessageForwardServiceImpl implements IMessageForwardService { @Override public boolean sendMessageToOne(Message message, WebSocketSession session) { if (session == null || !session.isOpen()) { return false; } try { session.sendMessage(new TextMessage(JSON.toJSONString(message))); return true; } catch (IOException e) { e.printStackTrace(); return false; } } @Override public boolean sendMessageGroup(Message message, Set<ConnectionSystemUser> users, Map<String, WebSocketSession> socketMap) { for (ConnectionSystemUser user : users) { // 默认不发送给本人 if (!message.getUserId().equals(user.getUserId())) { this.sendMessageToOne(message, socketMap.get(user.getUserId())); } } return true; } }
[ "chenyuexin1998@gmail.com" ]
chenyuexin1998@gmail.com
105b7078303006f19b1381faa171adce21072ff7
f75795c2f3dc02ad8324b044ed57e5588c0a74cd
/client/src/main/java/lighthouse/subwindows/SendMoneyController.java
982b4dfd20229c4ac454b04613af8ab4bebf6e26
[ "Apache-2.0" ]
permissive
cgruber/lighthouse
fd9046c3f352fb386d1d768dd9de5897e7c0d4ec
8b20d491e2dfd2bedc60783532971aededd2c928
refs/heads/master
2021-01-21T03:55:20.154242
2014-09-22T12:52:20
2014-09-22T12:52:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,907
java
package lighthouse.subwindows; import com.google.bitcoin.core.*; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import javafx.event.ActionEvent; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextField; import lighthouse.Main; import lighthouse.controls.BitcoinAddressValidator; import org.spongycastle.crypto.params.KeyParameter; import javax.annotation.Nullable; import static com.google.common.base.Preconditions.checkState; import static lighthouse.utils.GuiUtils.*; public class SendMoneyController { public Button sendBtn; public Button cancelBtn; public TextField address; public Label titleLabel; public Main.OverlayUI overlayUI; private Wallet.SendResult sendResult; private KeyParameter aesKey; // Called by FXMLLoader public void initialize() { checkState(!Main.bitcoin.wallet().getBalance().isZero()); new BitcoinAddressValidator(Main.params, address, sendBtn); } public void cancel(ActionEvent event) { overlayUI.done(); } public void send(@Nullable ActionEvent event) { // Address exception cannot happen as we validated it beforehand. try { Address destination = new Address(Main.params, address.getText()); Wallet.SendRequest req = Wallet.SendRequest.emptyWallet(destination); req.aesKey = aesKey; sendResult = Main.bitcoin.wallet().sendCoins(req); Futures.addCallback(sendResult.broadcastComplete, new FutureCallback<Transaction>() { @Override public void onSuccess(Transaction result) { checkGuiThread(); overlayUI.done(); } @Override public void onFailure(Throwable t) { // We died trying to empty the wallet. crashAlert(t); } }); sendResult.tx.getConfidence().addEventListener((tx, reason) -> { if (reason == TransactionConfidence.Listener.ChangeReason.SEEN_PEERS) updateTitleForBroadcast(); }); sendBtn.setDisable(true); address.setDisable(true); updateTitleForBroadcast(); } catch (InsufficientMoneyException e) { informationalAlert("Could not empty the wallet", "You may have too little money left in the wallet to make a transaction."); overlayUI.done(); } catch (ECKey.KeyIsEncryptedException e) { askForPasswordAndRetry(); } catch (AddressFormatException e) { // Cannot happen because we already validated it when the text field changed. throw new RuntimeException(e); } } private void askForPasswordAndRetry() { Main.OverlayUI<WalletPasswordController> pwd = Main.instance.overlayUI("subwindows/wallet_password.fxml"); final String addressStr = address.getText(); pwd.controller.aesKeyProperty().addListener((observable, old, cur) -> { // We only get here if the user found the right password. If they don't or they cancel, we end up back on // the main UI screen. By now the send money screen is history so we must recreate it. checkGuiThread(); Main.OverlayUI<SendMoneyController> screen = Main.instance.overlayUI("subwindows/send_money.fxml"); screen.controller.aesKey = cur; screen.controller.address.setText(addressStr); screen.controller.send(null); }); } private void updateTitleForBroadcast() { final int peers = sendResult.tx.getConfidence().numBroadcastPeers(); titleLabel.setText(String.format("Broadcasting ... seen by %d peers", peers)); } }
[ "mike@plan99.net" ]
mike@plan99.net
e0d22a0bfe3cb883659181150a62b775a2f3db32
ec98409b6370cced7245530a47eaf9779bad5944
/spring-web/src/test/java/org/togglz/spring/test/proxy/ProxyFeatures.java
3238a89ba351c7c7934435b490a4e8530eb20908
[ "Apache-2.0" ]
permissive
Christopher-Hsieh/togglz
0cdcb687e4f9c7834055fddbc307c3c7d3f8d0e0
dbf3fc5e48d567e3e307e490f4985c48d1a4e7ca
refs/heads/master
2022-07-11T02:50:50.101452
2020-03-11T07:22:58
2020-03-11T07:22:58
265,479,488
1
0
Apache-2.0
2020-05-20T07:01:30
2020-05-20T07:01:29
null
UTF-8
Java
false
false
295
java
package org.togglz.spring.test.proxy; import org.togglz.core.Feature; import org.togglz.core.context.FeatureContext; public enum ProxyFeatures implements Feature { SERVICE_TOGGLE; public boolean isActive() { return FeatureContext.getFeatureManager().isActive(this); } }
[ "christian@kaltepoth.de" ]
christian@kaltepoth.de
23c1b8cc1209db8300e2e9dafa9d08fa300242f6
90dc46fc19ac304df278fa2695aa54f7e3e8baee
/src/core/lombok/Await.java
fb0e0a6b6b0df332698b7ddcd476f0636315b14b
[ "MIT" ]
permissive
framiere/lombok-pg
d57da74b3496eaafc5910257882831ab87626649
318f3f05fbdf2f0c9ce7d593512661d4c69ee96e
refs/heads/master
2020-04-08T14:11:28.489573
2011-12-16T16:25:24
2011-12-16T16:25:24
2,994,589
0
0
null
null
null
null
UTF-8
Java
false
false
2,699
java
/* * Copyright © 2010-2011 Philipp Eichhorn * * 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 lombok; import static java.lang.annotation.ElementType.*; import static java.lang.annotation.RetentionPolicy.SOURCE; import java.lang.annotation.*; /** * Lock Conditions * <pre> * void methodAnnotatedWithAwait() throws java.lang.InterruptedException { * this.&lt;LOCK_NAME&gt;.lock(); * try { * while (this.&lt;CONDITION_METHOD&gt;()) { * this.&lt;CONDITION_NAME&gt;.await(); * } * * // method body * * } finally { * this.&lt;LOCK_NAME&gt;.unlock(); * } * } * <pre> */ @Target(METHOD) @Retention(SOURCE) public @interface Await { /** * Name of the condition. * <p> * If no condition with the specified name exists a new {@link java.util.concurrent.locks.Condition Condition} * will be created, using this name. */ String conditionName(); /** * Specifies the place to put the await-block, default is {@link lombok.Position BEFORE}. * <p> * Supported positions: * <ul> * <li>{@link lombok.Position BEFORE} - before the method body</li> * <li>{@link lombok.Position AFTER} - after the method body</li> * </ul> */ Position pos() default lombok.Position.BEFORE; /** * Name of the lock, default is {@code $<CONDITION_NAME>Lock}. * <p> * If no lock with the specified name exists a new {@link java.util.concurrent.locks.Lock Lock} * will be created, using this name. */ String lockName() default ""; /** * Method to verify if the condition is met. * <p> * The method must return a {@code boolean} and may * not require any parameters. */ String conditionMethod(); }
[ "peichhor@web.de" ]
peichhor@web.de
d2bdde68492b399afa6bc237474b3e9c07c31ee4
d4c3659ac9ddb5e3c0010b326f3bcc7e33ce0bed
/ren-automation-ui/src/main/java/com/exigen/ren/main/modules/policy/common/metadata/common/IssueActionTabMetaData.java
03e7f7cba85e5cdea2063091906f7207f0a7f7a8
[]
no_license
NandiniDR29/regression-test
cbfdae60e8b462cf32485afb3df0d9504200d0e1
c4acbc3488195217f9d6a780130d2e5dfe01d6e5
refs/heads/master
2023-07-03T14:35:40.673146
2021-08-11T07:03:13
2021-08-11T07:03:13
369,527,619
0
0
null
null
null
null
UTF-8
Java
false
false
2,278
java
/* Copyright © 2016 EIS Group and/or one of its affiliates. All rights reserved. Unpublished work under U.S. copyright laws. CONFIDENTIAL AND TRADE SECRET INFORMATION. No portion of this work may be copied, distributed, modified, or incorporated into any other media without EIS Group prior written consent.*/ package com.exigen.ren.main.modules.policy.common.metadata.common; import com.exigen.istf.webdriver.controls.ComboBox; import com.exigen.istf.webdriver.controls.TextBox; import com.exigen.istf.webdriver.controls.composite.assets.metadata.AssetDescriptor; import com.exigen.istf.webdriver.controls.composite.assets.metadata.MetaData; public class IssueActionTabMetaData extends MetaData { public static final AssetDescriptor<ComboBox> METHOD_OF_DELIVERY = declare("Method Of Delivery", ComboBox.class); public static final AssetDescriptor<ComboBox> SEND_TO = declare("Send To", ComboBox.class); public static final AssetDescriptor<TextBox> CORPORATE_SPONSOR_EMAIL = declare("Corporate Sponsor Email", TextBox.class); public static final AssetDescriptor<TextBox> ISSUE_DATE = declare("Issue Date", TextBox.class); public static final AssetDescriptor<TextBox> BROKER_EMAIL = declare("Broker Email", TextBox.class); public static final AssetDescriptor<TextBox> INSURED_EMAIL = declare("Insured Email", TextBox.class); public static final AssetDescriptor<TextBox> ATTENTION_OF = declare("Attention of", TextBox.class); public static final AssetDescriptor<ComboBox> COUNTRY = declare("Country", ComboBox.class); public static final AssetDescriptor<TextBox> ZIP_POSTAL_CODE = declare("Zip/Postal Code", TextBox.class); public static final AssetDescriptor<TextBox> ADDRESS_LINE_1 = declare("Address Line 1", TextBox.class); public static final AssetDescriptor<TextBox> ADDRESS_LINE_2 = declare("Address Line 2", TextBox.class); public static final AssetDescriptor<TextBox> ADDRESS_LINE_3 = declare("Address Line 3", TextBox.class); public static final AssetDescriptor<TextBox> CITY = declare("City", TextBox.class); public static final AssetDescriptor<ComboBox> STATE_PROVINCE = declare("State / Province", ComboBox.class); public static final AssetDescriptor<TextBox> NOTES = declare("Notes", TextBox.class); }
[ "Nramachandra@previseit.com" ]
Nramachandra@previseit.com
93ecf46b187cc9775ad28d25780041a9cfd492ad
814169b683b88f1b7498f1edf530a8d1bec2971f
/mall-product/src/main/java/com/bootx/mall/product/dao/PaymentMethodDao.java
8c199b533df6323342ff596544d415f14a9fe66e
[]
no_license
springwindyike/mall-auth
fe7f216c7241d8fd9247344e40503f7bc79fe494
3995d258955ecc3efbccbb22ef4204d148ec3206
refs/heads/master
2022-10-20T15:12:19.329363
2020-07-05T13:04:29
2020-07-05T13:04:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
238
java
package com.bootx.mall.product.dao; import com.bootx.mall.product.entity.PaymentMethod; /** * Dao - 支付方式 * * @author BOOTX Team * @version 6.1 */ public interface PaymentMethodDao extends BaseDao<PaymentMethod, Long> { }
[ "a12345678" ]
a12345678
8a9e4a188e349679f7e00f68884fbf4ff53821fd
c2e064c99f627cbf8b5cb1447325a3e18c1e64be
/Spring Boot Security/security1/src/main/java/com/cos/security1/config/oauth/provider/OAuth2UserInfo.java
f245fb2462f101d129f94cfb2df6967bb7bf306c
[]
no_license
DongGeon0908/Spring-Boot
965ddf421ed9510a679eca5ffa655f2d4dc963e1
7d49c4c42b0cbbf9979bd9801e80b117f0517cb7
refs/heads/master
2023-07-28T02:09:16.336966
2021-09-15T13:09:45
2021-09-15T13:09:45
329,270,098
2
0
null
null
null
null
UTF-8
Java
false
false
173
java
package com.cos.security1.config.oauth.provider; public interface OAuth2UserInfo { String getProviderId(); String getProvider(); String getEmail(); String getName(); }
[ "wrjssmjdhappy@gmail.com" ]
wrjssmjdhappy@gmail.com
3f4601b674da27eb9a36c283c11bddc809f45bcb
15737a9f72a22320093520ce91bf075bf0057956
/gcp-function-http/src/main/java/io/micronaut/gcp/function/http/jackson/GoogleJacksonConfiguration.java
670fd5cd0bae8356f473f85f0012408f6e5b511c
[ "Apache-2.0" ]
permissive
viniciusccarvalho/micronaut-gcp
63c68385880248ee40c812d075ed3aa9194258e8
d08f1ec0ec22bbb87df15bdd08bc2ea97fc631ff
refs/heads/master
2023-01-23T13:47:32.637476
2020-11-19T15:44:20
2020-11-19T15:44:20
271,624,518
0
1
Apache-2.0
2023-01-23T00:02:37
2020-06-11T18:54:53
Java
UTF-8
Java
false
false
1,411
java
/* * Copyright 2017-2020 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.micronaut.gcp.function.http.jackson; import io.micronaut.context.event.BeanCreatedEvent; import io.micronaut.context.event.BeanCreatedEventListener; import io.micronaut.jackson.JacksonConfiguration; import javax.inject.Singleton; /** * Disables module scan for Jackson which is slow in function context. * * @author graemerocher * @since 1.2.0 */ @Singleton public class GoogleJacksonConfiguration implements BeanCreatedEventListener<JacksonConfiguration> { @Override public JacksonConfiguration onCreated(BeanCreatedEvent<JacksonConfiguration> event) { JacksonConfiguration jacksonConfiguration = event.getBean(); jacksonConfiguration.setModuleScan(false); jacksonConfiguration.setBeanIntrospectionModule(true); return jacksonConfiguration; } }
[ "graeme.rocher@gmail.com" ]
graeme.rocher@gmail.com
d3069c506eda7c25eb07a3c3e79affbdf309d9c4
be7a8e693a7eefcd5a66d24244e7204b8fa164ae
/practice/com.advantest.threadLearn/src/com/advantest/chapter1/t14/test/Run.java
771ff37b6b7921a76760da7864dfc6ca3e6815a2
[]
no_license
zhanglin2018/thread
b7e6619446c6e04fb9eb14e4e433d5552ec9d714
83512e06b481ca784cb108d1629ddeaf7662c568
refs/heads/master
2020-06-18T00:41:06.299062
2019-07-17T10:56:34
2019-07-17T10:56:34
196,112,877
0
0
null
null
null
null
UTF-8
Java
false
false
411
java
package com.advantest.chapter1.t14.test; import com.advantest.chapter1.t14.exthread.MyThread; public class Run { public static void main(String[] args) { try { MyThread thread = new MyThread(); thread.start(); Thread.sleep(2000); thread.interrupt(); } catch (InterruptedException e) { System.out.println("main catch"); e.printStackTrace(); } System.out.println("main end!"); } }
[ "lin.zhang@advantest.com" ]
lin.zhang@advantest.com