blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
0fb3eac8c0d43facb919e7a94578243b322fff32
340f49565f421ca1868e96a5e640318eb2f0fada
/src/main/java/SnakeGame.java
f5fac60b34a4ea45a92a4ef3ffeb507ba32ee3f6
[]
no_license
dustinroepsch/SimpleSnakeCpre184x
190d9108633bf031249818a4616d31a58edf0dba
e702f462dd6550ca01d0721c053caec5ed2a3b2a
refs/heads/master
2021-07-06T04:52:45.156525
2017-10-01T08:46:53
2017-10-01T08:46:53
105,402,894
0
0
null
null
null
null
UTF-8
Java
false
false
3,091
java
import java.util.Random; import processing.core.PApplet; public class SnakeGame { // width and height based on nokia public static final int GRID_HEIGHT = 50; public static final int GRID_WIDTH = 70; private enum GridCell { APPLE, WALL, EMPTY } private GridCell[][] grid; private Random random; private GridPosition appleLocation; private Snake snake; public SnakeGame() { random = new Random(); snake = new Snake(GRID_HEIGHT / 2, GRID_WIDTH / 2); initializeGrid(); placeApple(); } private void placeApple() { do { appleLocation = new GridPosition(random.nextInt(GRID_HEIGHT), random.nextInt(GRID_WIDTH)); } while (grid[appleLocation.row][appleLocation.col] == GridCell.WALL); grid[appleLocation.row][appleLocation.col] = GridCell.APPLE; } private void initializeGrid() { grid = new GridCell[GRID_HEIGHT][GRID_WIDTH]; for (int row = 0; row < GRID_HEIGHT; row++) { for (int col = 0; col < GRID_WIDTH; col++) { grid[row][col] = GridCell.EMPTY; // place walls if (row == 0 || col == 0 || row == GRID_HEIGHT - 1 || col == GRID_WIDTH - 1) { grid[row][col] = GridCell.WALL; } } } } public void renderGrid(PApplet pApplet) { pApplet.colorMode(PApplet.RGB); for (int row = 0; row < GRID_HEIGHT; row++) { for (int col = 0; col < GRID_WIDTH; col++) { int color; switch (grid[row][col]) { case APPLE: color = pApplet.color(0xED, 0x6B, 0x86); // light red break; case WALL: color = pApplet.color(0x61, 0x70, 0x7D); // blackish break; default: case EMPTY: color = pApplet.color(0x6C, 0xD4, 0xFF); // light blue break; } pApplet.stroke(color); pApplet.fill(color); pApplet.rect( col * Main.SCALE_FACTOR, row * Main.SCALE_FACTOR, Main.SCALE_FACTOR, Main.SCALE_FACTOR); } } } // color for snake so i don't forget 40F99B public void render(PApplet pApplet) { renderGrid(pApplet); snake.move(); if (snake.isCollidingWith(appleLocation)) { snake.grow(); removeApple(); placeApple(); } if (snake.isCollidingWithSelf() || isWall(snake.getHead())) { Main.lose(); } snake.render(pApplet); } private boolean isWall(GridPosition head) { return grid[head.row][head.col] == GridCell.WALL; } private void removeApple() { grid[appleLocation.row][appleLocation.col] = GridCell.EMPTY; appleLocation = null; } public void keyPressed(int key) { switch (key) { case PApplet.UP: snake.setDirection(Direction.NORTH); break; case PApplet.DOWN: snake.setDirection(Direction.SOUTH); break; case PApplet.LEFT: snake.setDirection(Direction.WEST); break; case PApplet.RIGHT: snake.setDirection(Direction.EAST); break; default: System.out.println("Unused keycode: " + key); } } }
[ "dustinryan-roepsch@desktop-kl9b8b2.student.iastate.edu" ]
dustinryan-roepsch@desktop-kl9b8b2.student.iastate.edu
7ce0dfc1b4529d2ef6d139c1b4477509d0c3b107
7884ee9eefe884eba1a8db0722c556729647d23a
/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/JavaCompilerFieldValuesParser.java
a56ce83b5c5941e1b253e2135aa83b9c202fa022
[ "Apache-2.0" ]
permissive
1030907690/spring-boot-2.0.4.RELEASE
c050d74e3b89c3edc6bdef3993153b8aec265ff4
0426c9aa8f6767b4e8e584c957439c8d373aae30
refs/heads/master
2023-01-23T01:33:09.576021
2022-05-07T08:42:42
2022-05-07T08:42:42
165,577,620
1
0
Apache-2.0
2022-12-27T14:52:43
2019-01-14T01:48:13
Java
UTF-8
Java
false
false
6,301
java
/* * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.configurationprocessor.fieldvalues.javac; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import javax.annotation.processing.ProcessingEnvironment; import javax.lang.model.element.Modifier; import javax.lang.model.element.TypeElement; import org.springframework.boot.configurationprocessor.fieldvalues.FieldValuesParser; /** * {@link FieldValuesParser} implementation for the standard Java compiler. * * @author Phillip Webb * @author Stephane Nicoll * @since 1.2.0 */ public class JavaCompilerFieldValuesParser implements FieldValuesParser { private final Trees trees; public JavaCompilerFieldValuesParser(ProcessingEnvironment env) throws Exception { this.trees = Trees.instance(env); } @Override public Map<String, Object> getFieldValues(TypeElement element) throws Exception { Tree tree = this.trees.getTree(element); if (tree != null) { FieldCollector fieldCollector = new FieldCollector(); tree.accept(fieldCollector); return fieldCollector.getFieldValues(); } return Collections.emptyMap(); } /** * {@link TreeVisitor} to collect fields. */ private static class FieldCollector implements TreeVisitor { private static final Map<String, Class<?>> WRAPPER_TYPES; static { Map<String, Class<?>> types = new HashMap<>(); types.put("boolean", Boolean.class); types.put(Boolean.class.getName(), Boolean.class); types.put("byte", Byte.class); types.put(Byte.class.getName(), Byte.class); types.put("short", Short.class); types.put(Short.class.getName(), Short.class); types.put("int", Integer.class); types.put(Integer.class.getName(), Integer.class); types.put("long", Long.class); types.put(Long.class.getName(), Long.class); WRAPPER_TYPES = Collections.unmodifiableMap(types); } private static final Map<Class<?>, Object> DEFAULT_TYPE_VALUES; static { Map<Class<?>, Object> values = new HashMap<>(); values.put(Boolean.class, false); values.put(Byte.class, (byte) 0); values.put(Short.class, (short) 0); values.put(Integer.class, 0); values.put(Long.class, (long) 0); DEFAULT_TYPE_VALUES = Collections.unmodifiableMap(values); } private static final Map<String, Object> WELL_KNOWN_STATIC_FINALS; static { Map<String, Object> values = new HashMap<>(); values.put("Boolean.TRUE", true); values.put("Boolean.FALSE", false); values.put("StandardCharsets.ISO_8859_1", "ISO-8859-1"); values.put("StandardCharsets.UTF_8", "UTF-8"); values.put("StandardCharsets.UTF_16", "UTF-16"); values.put("StandardCharsets.US_ASCII", "US-ASCII"); WELL_KNOWN_STATIC_FINALS = Collections.unmodifiableMap(values); } private static final String DURATION_OF = "Duration.of"; private static final Map<String, String> DURATION_SUFFIX; static { Map<String, String> values = new HashMap<>(); values.put("Nanos", "ns"); values.put("Millis", "ms"); values.put("Seconds", "s"); values.put("Minutes", "m"); values.put("Hours", "h"); values.put("Days", "d"); DURATION_SUFFIX = Collections.unmodifiableMap(values); } private final Map<String, Object> fieldValues = new HashMap<>(); private final Map<String, Object> staticFinals = new HashMap<>(); @Override public void visitVariable(VariableTree variable) throws Exception { Set<Modifier> flags = variable.getModifierFlags(); if (flags.contains(Modifier.STATIC) && flags.contains(Modifier.FINAL)) { this.staticFinals.put(variable.getName(), getValue(variable)); } if (!flags.contains(Modifier.FINAL)) { this.fieldValues.put(variable.getName(), getValue(variable)); } } private Object getValue(VariableTree variable) throws Exception { ExpressionTree initializer = variable.getInitializer(); Class<?> wrapperType = WRAPPER_TYPES.get(variable.getType()); Object defaultValue = DEFAULT_TYPE_VALUES.get(wrapperType); if (initializer != null) { return getValue(initializer, defaultValue); } return defaultValue; } private Object getValue(ExpressionTree expression, Object defaultValue) throws Exception { Object literalValue = expression.getLiteralValue(); if (literalValue != null) { return literalValue; } Object factoryValue = expression.getFactoryValue(); if (factoryValue != null) { return getFactoryValue(expression, factoryValue); } List<? extends ExpressionTree> arrayValues = expression.getArrayExpression(); if (arrayValues != null) { Object[] result = new Object[arrayValues.size()]; for (int i = 0; i < arrayValues.size(); i++) { Object value = getValue(arrayValues.get(i), null); if (value == null) { // One of the elements could not be resolved return defaultValue; } result[i] = value; } return result; } if (expression.getKind().equals("IDENTIFIER")) { return this.staticFinals.get(expression.toString()); } if (expression.getKind().equals("MEMBER_SELECT")) { return WELL_KNOWN_STATIC_FINALS.get(expression.toString()); } return defaultValue; } private Object getFactoryValue(ExpressionTree expression, Object factoryValue) { Object instance = expression.getInstance(); if (instance != null && instance.toString().startsWith(DURATION_OF)) { String type = instance.toString(); type = type.substring(DURATION_OF.length(), type.indexOf('(')); String suffix = DURATION_SUFFIX.get(type); return (suffix != null) ? factoryValue + suffix : null; } return factoryValue; } public Map<String, Object> getFieldValues() { return this.fieldValues; } } }
[ "1030907690@qq.com" ]
1030907690@qq.com
14b490c2879dd90bae2bce449711cf09fa1f1d7a
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Lang/61/org/apache/commons/lang/NumberUtils_createBigDecimal_377.java
3b8d12b917b6a1a8fd862ac7a090b50bbbf25078
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
1,348
java
org apach common lang extra function java number class author href mailto bayard generationjava henri yandel author href mailto rand mcneeli yahoo rand neeli mcneeli author stephen colebourn author href mailto steve downei netfolio steve downei author eric pugh author phil steitz version deprec move org apach common lang math class remov common lang number util numberutil convert code string code code big decim bigdecim code param val code string code convert convert code big decim bigdecim code number format except numberformatexcept convert big decim bigdecim creat big decim createbigdecim string val big decim bigdecim big decim bigdecim val
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
66191a7819e5d1f710dd9a2af4caf20b913f90d1
3d2f54980f89fd6c53a0e0c79dac958b6d28647d
/src/androidTest/java/com/inqbarna/inqorm/ApplicationTest.java
17e5a65563fdd526a7f550bb80b32f1f92e9b478
[]
no_license
InQBarna/ORMLiteWrapper
4561ea31d9f79b30dec4b51b1cd813e6f4d88763
8935ad9a72ba197448351b88e5405c683e585204
refs/heads/master
2023-09-02T03:00:56.459714
2021-11-02T13:51:30
2021-11-02T13:51:30
423,861,617
0
0
null
null
null
null
UTF-8
Java
false
false
350
java
package com.inqbarna.inqorm; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "david.garcia@inqbarna.com" ]
david.garcia@inqbarna.com
9f6b752675643dd70b52e114bed6ca6081628715
6745f46be3f9145a61b4aa0545d8173add98e9bd
/wa/starter/src/test/java/org/apache/syncope/wa/starter/SyncopeWAServiceRegistryTest.java
1919008d9624554c725c63a38b8212fb089002ec
[ "Apache-2.0" ]
permissive
gulixciurli/syncope
0860e84b635fd220cdc583b83d333c306bd6e29e
97fad264948214b11f0707179877dac8977da5ea
refs/heads/main
2023-06-17T23:43:17.197896
2021-07-04T18:49:58
2021-07-04T18:49:58
382,308,673
0
1
Apache-2.0
2021-07-02T10:30:46
2021-07-02T10:17:38
Java
UTF-8
Java
false
false
9,157
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.syncope.wa.starter; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Collection; import java.util.List; import java.util.Map; import org.apache.syncope.client.lib.SyncopeClient; import org.apache.syncope.common.lib.Attr; import org.apache.syncope.common.lib.policy.AccessPolicyTO; import org.apache.syncope.common.lib.policy.DefaultAttrReleasePolicyConf; import org.apache.syncope.common.lib.policy.DefaultAccessPolicyConf; import org.apache.syncope.common.lib.policy.DefaultAuthPolicyConf; import org.apache.syncope.common.lib.to.OIDCRPClientAppTO; import org.apache.syncope.common.lib.to.SAML2SPClientAppTO; import org.apache.syncope.common.lib.types.OIDCGrantType; import org.apache.syncope.common.lib.types.OIDCResponseType; import org.apache.syncope.common.lib.types.OIDCSubjectType; import org.apache.syncope.common.lib.types.SAML2SPNameId; import org.apache.syncope.common.lib.wa.WAClientApp; import org.apache.syncope.common.rest.api.service.wa.WAClientAppService; import org.apache.syncope.wa.bootstrap.WARestClient; import org.apereo.cas.services.AnyAuthenticationHandlerRegisteredServiceAuthenticationPolicyCriteria; import org.apereo.cas.services.ChainingAttributeReleasePolicy; import org.apereo.cas.services.OidcRegisteredService; import org.apereo.cas.services.RegisteredService; import org.apereo.cas.services.ReturnAllowedAttributeReleasePolicy; import org.apereo.cas.services.ServicesManager; import org.apereo.cas.support.saml.services.SamlRegisteredService; import org.apereo.cas.util.RandomUtils; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; public class SyncopeWAServiceRegistryTest extends AbstractTest { @Autowired private WARestClient wARestClient; @Autowired private ServicesManager servicesManager; private static OIDCRPClientAppTO buildOIDCRP() { OIDCRPClientAppTO oidcrpTO = new OIDCRPClientAppTO(); oidcrpTO.setName("ExampleRP_" + getUUIDString()); oidcrpTO.setClientAppId(RandomUtils.nextLong()); oidcrpTO.setDescription("Example OIDC RP application"); oidcrpTO.setClientId("clientId_" + getUUIDString()); oidcrpTO.setClientSecret("secret"); oidcrpTO.getRedirectUris().addAll(List.of("uri1", "uri2")); oidcrpTO.setSubjectType(OIDCSubjectType.PUBLIC); oidcrpTO.getSupportedGrantTypes().add(OIDCGrantType.password); oidcrpTO.getSupportedResponseTypes().add(OIDCResponseType.CODE); return oidcrpTO; } protected SAML2SPClientAppTO buildSAML2SP() { SAML2SPClientAppTO saml2spto = new SAML2SPClientAppTO(); saml2spto.setName("ExampleSAML2SP_" + getUUIDString()); saml2spto.setClientAppId(RandomUtils.nextLong()); saml2spto.setDescription("Example SAML 2.0 service provider"); saml2spto.setEntityId("SAML2SPEntityId_" + getUUIDString()); saml2spto.setMetadataLocation("file:./test.xml"); saml2spto.setRequiredNameIdFormat(SAML2SPNameId.EMAIL_ADDRESS); saml2spto.setEncryptionOptional(true); saml2spto.setEncryptAssertions(true); return saml2spto; } private static void addAttributes( final boolean withReleaseAttributes, final boolean withAttrReleasePolicy, final WAClientApp waClientApp) { DefaultAuthPolicyConf authPolicyConf = new DefaultAuthPolicyConf(); authPolicyConf.setTryAll(true); authPolicyConf.getAuthModules().add("TestAuthModule"); waClientApp.setAuthPolicyConf(authPolicyConf); if (withReleaseAttributes) { waClientApp.getReleaseAttrs().putAll(Map.of("uid", "username", "cn", "fullname")); } AccessPolicyTO accessPolicy = new AccessPolicyTO(); accessPolicy.setEnabled(true); DefaultAccessPolicyConf accessPolicyConf = new DefaultAccessPolicyConf(); accessPolicyConf.getRequiredAttrs().add(new Attr.Builder("cn").values("admin", "Admin", "TheAdmin").build()); accessPolicy.setConf(accessPolicyConf); waClientApp.setAccessPolicy(accessPolicy); if (withAttrReleasePolicy) { DefaultAttrReleasePolicyConf attrReleasePolicyConf = new DefaultAttrReleasePolicyConf(); attrReleasePolicyConf.getAllowedAttrs().add("cn"); waClientApp.setAttrReleasePolicyConf(attrReleasePolicyConf); } } @Test public void addClientApp() { // 1. start with no client apps defined on mocked Core SyncopeClient syncopeClient = wARestClient.getSyncopeClient(); assertNotNull(syncopeClient); SyncopeCoreTestingServer.APPS.clear(); WAClientAppService service = syncopeClient.getService(WAClientAppService.class); assertTrue(service.list().isEmpty()); // 2. add one client app on mocked Core, nothing on WA yet WAClientApp waClientApp = new WAClientApp(); waClientApp.setClientAppTO(buildOIDCRP()); Long clientAppId = waClientApp.getClientAppTO().getClientAppId(); addAttributes(true, true, waClientApp); SyncopeCoreTestingServer.APPS.add(waClientApp); List<WAClientApp> apps = service.list(); assertEquals(1, apps.size()); assertNotNull(servicesManager.findServiceBy(clientAppId)); // 3. trigger client app refresh Collection<RegisteredService> load = servicesManager.load(); assertEquals(3, load.size()); // 4. look for the service created above RegisteredService found = servicesManager.findServiceBy(clientAppId); assertNotNull(found); assertTrue(found instanceof OidcRegisteredService); OidcRegisteredService oidc = OidcRegisteredService.class.cast(found); OIDCRPClientAppTO oidcrpto = OIDCRPClientAppTO.class.cast(waClientApp.getClientAppTO()); assertEquals("uri1|uri2", oidc.getServiceId()); assertEquals(oidcrpto.getClientId(), oidc.getClientId()); assertEquals(oidcrpto.getClientSecret(), oidc.getClientSecret()); assertTrue(oidc.getAuthenticationPolicy().getRequiredAuthenticationHandlers().contains("TestAuthModule")); assertTrue(((AnyAuthenticationHandlerRegisteredServiceAuthenticationPolicyCriteria) oidc. getAuthenticationPolicy().getCriteria()).isTryAll()); assertTrue(oidc.getAttributeReleasePolicy() instanceof ChainingAttributeReleasePolicy); // 5. more client with different attributes waClientApp = new WAClientApp(); waClientApp.setClientAppTO(buildSAML2SP()); clientAppId = waClientApp.getClientAppTO().getClientAppId(); addAttributes(false, true, waClientApp); SyncopeCoreTestingServer.APPS.add(waClientApp); apps = service.list(); assertEquals(2, apps.size()); load = servicesManager.load(); assertEquals(4, load.size()); found = servicesManager.findServiceBy(clientAppId); assertTrue(found instanceof SamlRegisteredService); SamlRegisteredService saml = SamlRegisteredService.class.cast(found); SAML2SPClientAppTO samlspto = SAML2SPClientAppTO.class.cast(waClientApp.getClientAppTO()); assertEquals(samlspto.getMetadataLocation(), saml.getMetadataLocation()); assertEquals(samlspto.getEntityId(), saml.getServiceId()); assertTrue(saml.getAuthenticationPolicy().getRequiredAuthenticationHandlers().contains("TestAuthModule")); assertNotNull(found.getAccessStrategy()); assertTrue(saml.getAttributeReleasePolicy() instanceof ReturnAllowedAttributeReleasePolicy); waClientApp = new WAClientApp(); waClientApp.setClientAppTO(buildSAML2SP()); clientAppId = waClientApp.getClientAppTO().getClientAppId(); addAttributes(false, false, waClientApp); SyncopeCoreTestingServer.APPS.add(waClientApp); apps = service.list(); assertEquals(3, apps.size()); load = servicesManager.load(); assertEquals(5, load.size()); found = servicesManager.findServiceBy(clientAppId); assertTrue(found.getAttributeReleasePolicy() instanceof ReturnAllowedAttributeReleasePolicy); } }
[ "scricchiola.7@icloud.com" ]
scricchiola.7@icloud.com
4b08d8e336b063ff0c0f86a8b570dd56ebfa35d0
95827ae768c30f0f9e74bfdb04575c959d0385e4
/firstTryTemplate/src/parseTree/package-info.java
959c7c68422fe438e5b6b8076ff33960bc6d4b97
[]
no_license
Guldenbart/MA
9887f367a1e6378b1265ef6b193260fef0480c56
d9b724dea13c8e1efef8f46c0a61296c1eade336
refs/heads/master
2020-04-12T03:12:47.166454
2017-03-08T22:51:41
2017-03-08T22:51:41
45,265,776
0
0
null
null
null
null
UTF-8
Java
false
false
72
java
/** * */ /** * @author Daniel Fritz * */ package parseTree;
[ "dafritz@htwg-konstanz.de" ]
dafritz@htwg-konstanz.de
a29ba9d7c531df6d1885d68db94a0ea46cd2cf84
447d68942c3f13beca2d211fe790be04c9952b2c
/demos/kirin-hello-world/common/core/src/main/java/com/futureplatforms/kirinhello/modules/TestModule.java
eb41598360daa6d27553b89d4b58caf4ab1a76c8
[ "Apache-2.0" ]
permissive
futureplatforms/Kirin
ce75a153046756ea76a235233b7fc3429a7fa96c
26944c5f2db50e6e4f814c1e75758e58d9b296ce
refs/heads/master
2023-03-21T20:07:20.728656
2017-07-11T21:15:45
2017-07-11T21:15:45
18,794,259
16
2
null
2016-04-14T08:23:58
2014-04-15T09:18:58
Java
UTF-8
Java
false
false
2,181
java
package com.futureplatforms.kirinhello.modules; import java.util.Map; import org.timepedia.exporter.client.Export; import org.timepedia.exporter.client.ExportPackage; import com.futureplatforms.kirin.KirinModule; import com.futureplatforms.kirin.dependencies.StaticDependencies; import com.futureplatforms.kirin.dependencies.StaticDependencies.LogDelegate; import com.futureplatforms.kirin.dependencies.StaticDependencies.NetworkDelegate; import com.futureplatforms.kirin.dependencies.StaticDependencies.NetworkDelegate.HttpVerb; import com.futureplatforms.kirin.dependencies.StaticDependencies.NetworkDelegate.NetworkResponse; import com.futureplatforms.kirin.dependencies.json.JSONArray; import com.futureplatforms.kirin.dependencies.json.JSONDelegate; import com.futureplatforms.kirinhello.modules.natives.TestModuleNative; import com.google.gwt.core.client.GWT; @Export(value = "TestModule", all = true) @ExportPackage("screens") public class TestModule extends KirinModule<TestModuleNative> { public TestModule() { super((TestModuleNative) GWT.create(TestModuleNative.class)); } public void testyMethod(String str, int i) { getNativeObject().testyNativeMethod("Hello from kirin!!!! " + str + ", " + i); final StaticDependencies deps = StaticDependencies.getInstance(); deps.getLogDelegate().log("Logging via the logging delegate"); NetworkDelegate net = deps.getNetworkDelegate(); net.doHttp(HttpVerb.GET, "http://proxocube-devtest.appspot.com/proxo/dev_data/lineup/0", new NetworkResponse() { public void onSuccess(int res, String result, Map<String, String> headers) { LogDelegate log = deps.getLogDelegate(); log.log("Network SUCCESS :: " + result); JSONDelegate json = StaticDependencies.getInstance().getJsonDelegate(); JSONArray arr = json.getJSONArray(result); log.log("found array with " + arr.length() + " elements"); } public void onFail(String code) { deps.getLogDelegate().log("Network FAIL :: " + code); } }); } }
[ "douglas.hoskins@futureplatforms.com" ]
douglas.hoskins@futureplatforms.com
0ef5e54cc3669486c49e05d8c0f91b9a3c214ed9
05ff282b5fd9cf4a70d4f832cceebde941672916
/app/src/main/java/com/eip/roucou_c/spred/Entities/ResultEntity.java
841f3ac61325dae167a1b760d87df92ac308bbf5
[]
no_license
SpredCo/spred-android
5d16e871e8373b2b0ab13491edad01b0bedfaab6
f52bb2810880c1ff1d4aaa14a6dd1fc7ef9ed102
refs/heads/master
2020-12-03T06:30:10.339780
2017-01-05T01:47:35
2017-01-05T01:47:35
68,802,772
1
0
null
null
null
null
UTF-8
Java
false
false
349
java
package com.eip.roucou_c.spred.Entities; import com.google.gson.annotations.SerializedName; import java.io.Serializable; /** * Created by roucou_c on 19/12/2016. */ public class ResultEntity implements Serializable { @SerializedName("result") private boolean _result; public boolean get_result() { return _result; } }
[ "clement.roucour@epitech.eu" ]
clement.roucour@epitech.eu
8ba5cd8d55f8b8ac4401c1ce400beb3f529f7637
fb7cfbc4a914ba3f27344a3fe85db601a21dd57e
/app/src/main/java/com/yj/robust/ui/fragment/HomeSeckill/HomeSeckillFrag.java
902f5282567df73ae38b72b058bb513bfb62bff9
[]
no_license
zhouxiang130/Robust
f163d68a2e00bee72a985ee6cebe37a8131e2c0d
fb1faf755d4dd6aab267960a95bf9aea00d8c6b0
refs/heads/master
2020-07-14T15:16:51.019563
2019-09-08T13:00:10
2019-09-08T13:00:10
205,341,732
0
0
null
null
null
null
UTF-8
Java
false
false
12,667
java
package com.yj.robust.ui.fragment.HomeSeckill; import android.content.Intent; import android.os.Handler; import android.os.Message; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.View; import android.widget.ImageView; import com.google.gson.Gson; import com.jcodecraeer.xrecyclerview.ProgressStyle; import com.jcodecraeer.xrecyclerview.XRecyclerView; import com.yj.robust.R; import com.yj.robust.base.LazyLoadFragment; import com.yj.robust.base.URLBuilder; import com.yj.robust.model.SeckillEntity; import com.yj.robust.ui.MainActivity; import com.yj.robust.ui.adapter.HomeSeckillActivityAdapters; import com.yj.robust.util.IntentUtils; import com.yj.robust.util.LogUtils; import com.yj.robust.util.ToastUtils; import com.yj.robust.util.Utils; import com.yj.robust.widget.ProgressLayout; import com.zhy.http.okhttp.OkHttpUtils; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import butterknife.BindView; import butterknife.OnClick; import okhttp3.Call; import okhttp3.Response; /** * Created by Suo on 2018/3/24. */ public class HomeSeckillFrag extends LazyLoadFragment { @BindView(R.id.xrecyclerView) XRecyclerView mRecyclerView; @BindView(R.id.progress_layout) ProgressLayout mProgressLayout; @BindView(R.id.home_seckill_iv_top) ImageView ivTop; HomeSeckillActivityAdapters mAdapter; LinearLayoutManager layoutManager; private List<SeckillEntity.SeckillData.SeckillList> mList; private String newDate; private int pageNum = 1; private int flag; private MyThread myThread; private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case 1: break; } super.handleMessage(msg); } }; public static HomeSeckillFrag instant(int flag) { HomeSeckillFrag fragment = new HomeSeckillFrag(); fragment.flag = flag; return fragment; } @Override protected int setContentView() { return R.layout.fragment_home_seckill; } @Override protected void initView() { mList = new ArrayList<>(); layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false); mRecyclerView.setLayoutManager(layoutManager); mRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader); mRecyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallClipRotate); mAdapter = new HomeSeckillActivityAdapters(getActivity(), mList, flag); mRecyclerView.setAdapter(mAdapter); mAdapter.setOnItemClickListener(new HomeSeckillActivityAdapters.ProfitDetialClickListener() { @Override public void onItemClick(View view, int postion) { // if (flag == 0) { // Log.e(TAG, "onItemClick: " + postion); // } else { IntentUtils.IntentToGoodsDetial(getActivity(), mList.get(postion - 2).getProduct_id()); // } } }); mRecyclerView.setLoadingListener(new XRecyclerView.LoadingListener() { @Override public void onRefresh() { pageNum = 1; new Handler().postDelayed(new Runnable() { public void run() { doRefreshData(); } }, 500); //refresh data here } @Override public void onLoadMore() { pageNum++; new Handler().postDelayed(new Runnable() { public void run() { mRecyclerView.setPullRefreshEnabled(false); doRequestData(); } }, 500); } }); mRecyclerView.refresh(); } @Override protected void initData() { mRecyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { if (layoutManager.findLastVisibleItemPosition() > 5) { ivTop.setVisibility(View.VISIBLE); } else { ivTop.setVisibility(View.GONE); } super.onScrolled(recyclerView, dx, dy); } }); } @Override protected void lazyLoad() { } @OnClick({R.id.home_seckill_iv_top, R.id.home_seckill_iv_cart}) public void onClick(View view) { switch (view.getId()) { case R.id.home_seckill_iv_top: mRecyclerView.smoothScrollToPosition(0); break; case R.id.home_seckill_iv_cart: if (mUtils.isLogin()) { Intent intent = new Intent(getActivity(), MainActivity.class); intent.putExtra("page", "2"); startActivity(intent); } else { IntentUtils.IntentToLogin(getActivity()); } break; } } private void doRefreshData() { mProgressLayout.showContent(); Map<String, String> map = new HashMap<>(); map.put("pageNum", pageNum + ""); map.put("limitType", flag + ""); LogUtils.i("传输的值" + URLBuilder.format(map)); OkHttpUtils.post().url(URLBuilder.URLBaseHeader + "/phone/homePage/timeLimit.act") .addParams("data", URLBuilder.format(map)) .tag(this).build().execute(new Utils.MyResultCallback<SeckillEntity>() { @Override public SeckillEntity parseNetworkResponse(Response response) throws Exception { String json = response.body().string().trim(); LogUtils.i("json的值。" + json); return new Gson().fromJson(json, SeckillEntity.class); } @Override public void onResponse(SeckillEntity response) { if (response != null && response.getCode().equals(response.HTTP_OK)) { //@TODO 获取秒杀数据之后 将顶部图片的URL 发送广播 Intent broadcastIntent = new Intent(); broadcastIntent.setAction("COM.EXAMPLE.BANNER.IMAGEVIEW.URL"); broadcastIntent.putExtra("BANNER_IMAGE_URL", response.getData().getImg()); getActivity().sendBroadcast(broadcastIntent); if (response.getData() != null && response.getData().getTimeLimitList().size() != 0) { mList.clear(); mList.addAll(response.getData().getTimeLimitList()); if (flag == 0) { newDate = response.getData().getNewDate(); dealWithTimer(); } mAdapter.notifyDataSetChanged(); mProgressLayout.showContent(); } else { mProgressLayout.showNone(new View.OnClickListener() { @Override public void onClick(View view) { } }); } } else { LogUtils.i("返回错误了" + response.getMsg() + response.getCode()); mProgressLayout.showNetError(new View.OnClickListener() { @Override public void onClick(View view) { if (mList != null && !mList.isEmpty()) { mList.clear(); mAdapter.notifyDataSetChanged(); } mRecyclerView.refresh(); } }); } mRecyclerView.setPullRefreshEnabled(true); mRecyclerView.refreshComplete(); } @Override public void onError(Call call, Exception e) { super.onError(call, e); LogUtils.i("网络故障了" + e); mRecyclerView.refreshComplete(); mRecyclerView.setPullRefreshEnabled(true); if (call.isCanceled()) { call.cancel(); } else { mProgressLayout.showNetError(new View.OnClickListener() { @Override public void onClick(View view) { if (mList != null && !mList.isEmpty()) { mList.clear(); mAdapter.notifyDataSetChanged(); } mRecyclerView.refresh(); } }); } } }); } private void doRequestData() { Map<String, String> map = new HashMap<>(); map.put("pageNum", pageNum + ""); map.put("limitType", flag + ""); LogUtils.i("传输的值" + URLBuilder.format(map)); OkHttpUtils.post().url(URLBuilder.URLBaseHeader + "/phone/homePage/timeLimit.act") .addParams("data", URLBuilder.format(map)) .tag(this).build().execute(new Utils.MyResultCallback<SeckillEntity>() { @Override public SeckillEntity parseNetworkResponse(Response response) throws Exception { String json = response.body().string().trim(); LogUtils.i("json的值。" + json); return new Gson().fromJson(json, SeckillEntity.class); } @Override public void onResponse(SeckillEntity response) { if (response != null && response.getCode().equals(response.HTTP_OK)) { if (response.getData() != null) { if (response.getData().getTimeLimitList().size() != 0) { mList.addAll(response.getData().getTimeLimitList()); if (flag == 0) { newDate = response.getData().getNewDate(); dealWithTimer(); } mAdapter.notifyDataSetChanged(); mRecyclerView.loadMoreComplete(); } else if (response.getData().getTimeLimitList().size() == 0) { mRecyclerView.setNoMore(true); pageNum--; } } mProgressLayout.showContent(); } else { ToastUtils.showToast(getActivity(), "网络异常"); pageNum--; mRecyclerView.loadMoreComplete(); } mRecyclerView.setPullRefreshEnabled(true); } @Override public void onError(Call call, Exception e) { super.onError(call, e); mRecyclerView.loadMoreComplete(); mRecyclerView.setPullRefreshEnabled(true); if (call.isCanceled()) { LogUtils.i("我进入到加载更多cancel了"); call.cancel(); } else if (pageNum != 1) { LogUtils.i("加载更多的Log"); ToastUtils.showToast(getActivity(), "网络故障,请稍后再试"); pageNum--; } // disMissDialog(); } }); } class MyThread extends Thread { //用来停止线程 boolean endThread; List<SeckillEntity.SeckillData.SeckillList> mRecommendActivitiesList; public MyThread(List<SeckillEntity.SeckillData.SeckillList> mRecommendActivitiesList) { this.mRecommendActivitiesList = mRecommendActivitiesList; } @Override public void run() { while (!endThread) { try { //线程每秒钟执行一次 Thread.sleep(1000); //遍历商品列表 for (int i = 0; i < mRecommendActivitiesList.size(); i++) { //拿到每件商品的时间差,转化为具体的多少天多少小时多少分多少秒 //并保存在商品time这个属性内 long counttime = mRecommendActivitiesList.get(i).getTime(); long days = counttime / (1000 * 60 * 60 * 24); long hours = (counttime - days * (1000 * 60 * 60 * 24)) / (1000 * 60 * 60); long hours_ = hours + days * 24; long minutes = (counttime - days * (1000 * 60 * 60 * 24) - hours * (1000 * 60 * 60)) / (1000 * 60); long second = (counttime - days * (1000 * 60 * 60 * 24) - hours * (1000 * 60 * 60) - minutes * (1000 * 60)) / 1000; //并保存在商品time这个属性内 String finaltime = days + "天" + hours + "时" + minutes + "分" + second + "秒"; Log.i(TAG, "run: " + finaltime); mRecommendActivitiesList.get(i).setFinalTime(finaltime); mRecommendActivitiesList.get(i).setHours((int) hours_); mRecommendActivitiesList.get(i).setMin((int) minutes); mRecommendActivitiesList.get(i).setSec((int) second); //如果时间差大于1秒钟,将每件商品的时间差减去一秒钟, // 并保存在每件商品的counttime属性内 if (counttime > 1000) { mRecommendActivitiesList.get(i).setTime(counttime - 1000); } } Message message = new Message(); message.what = 1; //发送信息给handler handler.sendMessage(message); } catch (Exception e) { } } } } public void dealWithTimer() { if (mList == null || mList.size() == 0) { return; } for (int i = 0; i < mList.size(); i++) { long counttime = getTime(newDate, mList.get(i).getProduct_timeEnd()); long days = counttime / (1000 * 60 * 60 * 24); long hours = (counttime - days * (1000 * 60 * 60 * 24)) / (1000 * 60 * 60); long hours_ = hours + days * 24; long minutes = (counttime - days * (1000 * 60 * 60 * 24) - hours * (1000 * 60 * 60)) / (1000 * 60); long second = (counttime - days * (1000 * 60 * 60 * 24) - hours * (1000 * 60 * 60) - minutes * (1000 * 60)) / 1000; //并保存在商品time这个属性内 String finaltime = days + "天" + hours + "时" + minutes + "分" + second + "秒"; mList.get(i).setHours((int) hours_); mList.get(i).setMin((int) minutes); mList.get(i).setSec((int) second); mList.get(i).setFinalTime(finaltime); mList.get(i).setTime(counttime); } myThread = new MyThread(mList); myThread.start(); } public long getTime(String serverTime, String startTime) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); long diff = 0; try { Date now = format.parse(serverTime); Date end = format.parse(startTime); diff = end.getTime() - now.getTime(); } catch (Exception e) { } return diff; } @Override public void onDestroy() { if (myThread != null) { myThread.endThread = true; myThread = null; } super.onDestroy(); } }
[ "1141681281@qq.com" ]
1141681281@qq.com
1df8f29a4dde288617541337345594ebbb7fc1fd
3990e9a1277b5396aca5b0d70250eba2f4528212
/moretv-member-base/src/main/java/cn/whaley/moretv/member/base/config/ErrorConfig.java
12bc5101cd924d067b4df67d1887b148fd21375c
[]
no_license
AppSecAI-TEST/moretv-member-parent
cfbec136728f2ea530eb62b292453ecfe9b8b77e
e180ed9a103fdfe3f63053e1d0afe08d56f9f830
refs/heads/master
2021-01-16T11:38:36.714830
2017-06-28T18:41:35
2017-06-28T18:41:35
100,001,331
0
1
null
2017-08-11T06:54:22
2017-08-11T06:54:22
null
UTF-8
Java
false
false
1,052
java
package cn.whaley.moretv.member.base.config; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.web.*; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.DispatcherServlet; import javax.servlet.Servlet; /** * Created by Bob Jiang on 2017/4/6. */ @Configuration @ConditionalOnWebApplication @ConditionalOnClass({Servlet.class, DispatcherServlet.class}) @AutoConfigureBefore(WebMvcAutoConfiguration.class) @EnableConfigurationProperties(ResourceProperties.class) public class ErrorConfig { @Bean public HttpErrorHandler httpErrorHandler(ErrorAttributes errorAttributes) { return new HttpErrorHandler(errorAttributes); } }
[ "jiang.wen@whaley.cn" ]
jiang.wen@whaley.cn
dbe7c783dc1f63b737d0247b8b7cde624db50e95
6cb22981f2f6e83886b437065e9f41b97c5c94d4
/src/Guerrero.java
a1c873663641ce924e05eddd36d848d22152690c
[]
no_license
mfernandez1305/progra2_examen1
741f27eaf994ec83d4185eda49545b2b677a19b4
0fd6f8d49d32f456955dce4fb0dc41b4a2be8ae4
refs/heads/master
2021-01-25T06:36:40.236832
2014-08-19T14:24:19
2014-08-19T14:24:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
203
java
public class Guerrero extends Personaje{ Guerrero(int vida, int ataque){ super(vida, ataque); personajes_creados=personajes_creados+1; } void poder_Especial(){ vida=vida/2; ataque=ataque*2; } }
[ "alumno@localhost.localdomain" ]
alumno@localhost.localdomain
106b611aa14c46abacf42c8b36f7d75c3b94830e
e2eeb655af76fe04ef82b3dbfcfbaf5eb268a390
/Practica5/P5_Ej3/src/p5_ej3/ProductoFinanciero.java
8e680517484e3a7968c74325216ef8742f757354
[]
no_license
santii810/Practicas_PROII
375dbeaaf16dde234ea30562442269ac60083b87
caa3d1ea98c7de58747a6582299305b0e441b450
refs/heads/master
2021-01-22T02:48:44.389550
2017-05-29T08:47:13
2017-05-29T08:47:13
81,073,906
0
0
null
null
null
null
UTF-8
Java
false
false
973
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package p5_ej3; /** * * @author santi */ /** * Representa cualquier producto financiero */ abstract class ProductoFinanciero { /** * El saldo del producto */ protected double saldo; /* El beneficio o gasto del producto */ private double interes; public ProductoFinanciero(double s, double i) { saldo = s; interes = i; } /** * @return Devuelve el saldo asociado al producto */ public double getSaldo() { return saldo; } /** * @return Devuelve el interés asociado al producto */ public double getInteres() { return interes; } @Override public String toString() { return String.format("Saldo: %.2f (interés: %.2f)", getSaldo(), getInteres()); } }
[ "santii810@hotmail.com" ]
santii810@hotmail.com
697e244102d420716098e3dd8c62c05965a997df
ae6b36ea0c1e5e8a5f52a59db155b698e1d6b558
/src/main/java/com/github/fge/jsonschema/keyword/digest/NullDigester.java
d1d6f59da7bdf45badf0d8fbfbd9956b3cd32a77
[]
no_license
erwink/json-schema-validator
5eeae39fb95ead27131c689a22757dc3d97d00b1
dce5c64379e455488c60f8f59cfbe7ba99fbb5f8
refs/heads/master
2020-12-25T17:14:45.268780
2013-02-08T14:00:32
2013-02-08T14:00:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,209
java
/* * Copyright (c) 2013, Francis Galiegue <fgaliegue@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the Lesser GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Lesser GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.github.fge.jsonschema.keyword.digest; import com.fasterxml.jackson.databind.JsonNode; import com.github.fge.jsonschema.util.NodeType; public final class NullDigester extends AbstractDigester { public NullDigester(final String keyword, final NodeType first, final NodeType... other) { super(keyword, first, other); } @Override public JsonNode digest(final JsonNode schema) { return FACTORY.nullNode(); } }
[ "fgaliegue@gmail.com" ]
fgaliegue@gmail.com
c6384d3127495b7138374659ac8dd594ac0df65b
3da4ee6382bc16eb698c7789ace5597710af051c
/src/main/java/com/likeacat/eventsGeoPositioning/repository/RoleRepository.java
cc00a29db7a7bb3cd00601a3612bec731df3d71c
[]
no_license
L1keACat/events-geo-positioning
d37574fa7256b68d76421bfb6b3b61da0e0d5724
88811043dde903332a02532f72b5ead61ef2a072
refs/heads/master
2020-05-20T13:51:04.377994
2019-05-28T19:14:31
2019-05-28T19:14:31
185,508,029
0
0
null
null
null
null
UTF-8
Java
false
false
286
java
package com.likeacat.eventsGeoPositioning.repository; import com.likeacat.eventsGeoPositioning.model.Role; import org.springframework.data.mongodb.repository.MongoRepository; public interface RoleRepository extends MongoRepository<Role, String> { Role findByRole(String role); }
[ "36240624+L1keACat@users.noreply.github.com" ]
36240624+L1keACat@users.noreply.github.com
e49695c0acbd8f71f6be951254f1bbcbe7acd967
8ce4de62e379a89c8a12c75e7314588924230081
/intro/src/main/java/Java_SE01_2.java
5e265f12264c1013cb32742be8925cade91d4f6f
[]
no_license
mmgeorg/JavaFundamentals
e828d51a3694648fb93c2b415ff73b568b856749
fe50cb5b99e6420fe16be400fa659751475cf281
refs/heads/master
2021-06-07T03:49:27.148716
2016-10-13T19:17:27
2016-10-13T19:17:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
657
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Java_SE01_2 { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Input epsilon"); double e = Double.parseDouble(reader.readLine()); double a; int i = 1; do { a = fun(i); i++; System.out.println(a); } while (a > e); System.out.println(i - 1); } private static Double fun(int num) { return 1 / Math.pow(num + 1, 2); } }
[ "mmgeorg02@gmail.com" ]
mmgeorg02@gmail.com
21dd7471215ac1461b6b6d04beb7d5d0a6fbfb9f
420c54f80bab1bdd5094712235032d5db0ac3056
/app/src/main/java/com/test/custom/mydemos/utils/MyUtils.java
9f425015723caed7717425f313d9c1095de8b44f
[]
no_license
chengw32/MyDemos
9d01dada2b3c0c5a991de29022273856c8aa2254
27e9cb9cbaa30c2a6e446e56dd287296745afc61
refs/heads/master
2021-01-21T17:56:40.743327
2017-11-24T10:02:32
2017-11-24T10:02:32
92,000,410
0
0
null
null
null
null
UTF-8
Java
false
false
706
java
package com.test.custom.mydemos.utils; /** * Author 陈国武 * Time 2017/8/8. * Des: */ public class MyUtils { /** * Des:拼音首字母大写 * Author:陈国武 * Time:2017/8/8 9:31 */ public static String upFirstLetter(String str){ char[] ch = str.toCharArray(); if(ch[0] >= 'a' && ch[0] <= 'z'){ ch[0] = (char)(ch[0] - 32); } return new String(ch); } public static String appendStr(Object... str){ StringBuffer sb = new StringBuffer(); for (Object item:str){ sb.append(item); sb.append("\n"); } return sb.toString(); } }
[ "718339098@qq.com" ]
718339098@qq.com
de2d5f972126c5c3faf29e71aef36ab8d7a5cc34
11c3d54d621a9adf17d9a2d16215aaf2f189403d
/src/main/java/com/johnnyhuang/mixer/dto/MixRequestDTO.java
a7d9e8ac52ffe75ae3d4ebc0873230ac00de0150
[]
no_license
jhuang10/gemini-jobcoin
2b1efbeeaab3fd0061b0a425adff0d8764501916
bac8d18488173c74022c99731c7da1c248dd7e90
refs/heads/master
2023-07-26T01:45:52.291054
2021-08-25T01:39:44
2021-08-25T01:39:44
399,632,409
0
0
null
null
null
null
UTF-8
Java
false
false
598
java
package com.johnnyhuang.mixer.dto; import com.johnnyhuang.mixer.domain.models.Address; import com.johnnyhuang.mixer.domain.models.MixRequest; import lombok.*; import java.util.List; import java.util.stream.Collectors; @EqualsAndHashCode @ToString @NoArgsConstructor @AllArgsConstructor @Getter @Setter public class MixRequestDTO { private List<String> destinations; public MixRequest toMixRequest() { List<Address> destinationAddresses = destinations.stream().map(Address::new).collect(Collectors.toList()); return new MixRequest(destinationAddresses); } }
[ "johnnyhuang@Johnnys-MacBook-Pro-2.local" ]
johnnyhuang@Johnnys-MacBook-Pro-2.local
71a2357bdc37d4cf38d01c1a4afd03c2119999f8
dce2371c1f3c0ac271ccbbf2fe499b2b12df4cda
/src/main/java/net/mcreator/blocktesting/block/SnowySakuraContainer1Block.java
6dd986c4b8c69c9e45ea8bb39c4eb70bed7277bd
[]
no_license
ChrisCraddock/Crates-and-Containers
1b20304b72618e89b2c4083858366d2726ee0adc
5d7af4b399ad93f662e96d0282a3d05dafdb1160
refs/heads/master
2023-08-24T17:39:59.738030
2021-10-29T09:20:15
2021-10-29T09:20:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,467
java
package net.mcreator.blocktesting.block; import net.minecraftforge.registries.ObjectHolder; import net.minecraftforge.items.wrapper.SidedInvWrapper; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.fml.network.NetworkHooks; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.ToolType; import net.minecraft.world.World; import net.minecraft.world.IBlockReader; import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.Rotation; import net.minecraft.util.NonNullList; import net.minecraft.util.Mirror; import net.minecraft.util.Hand; import net.minecraft.util.Direction; import net.minecraft.util.ActionResultType; import net.minecraft.tileentity.TileEntityType; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.LockableLootTileEntity; import net.minecraft.state.StateContainer; import net.minecraft.state.DirectionProperty; import net.minecraft.network.play.server.SUpdateTileEntityPacket; import net.minecraft.network.PacketBuffer; import net.minecraft.network.NetworkManager; import net.minecraft.nbt.CompoundNBT; import net.minecraft.loot.LootContext; import net.minecraft.item.ItemStack; import net.minecraft.item.Item; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItem; import net.minecraft.inventory.container.INamedContainerProvider; import net.minecraft.inventory.container.Container; import net.minecraft.inventory.ItemStackHelper; import net.minecraft.inventory.InventoryHelper; import net.minecraft.inventory.ISidedInventory; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.block.material.Material; import net.minecraft.block.SoundType; import net.minecraft.block.DirectionalBlock; import net.minecraft.block.BlockState; import net.minecraft.block.Block; import net.mcreator.blocktesting.itemgroup.SnowContainers32x32ItemGroup; import net.mcreator.blocktesting.gui.WhiteContainerEndsGUIGui; import net.mcreator.blocktesting.BlocktestingModElements; import javax.annotation.Nullable; import java.util.stream.IntStream; import java.util.List; import java.util.Collections; import io.netty.buffer.Unpooled; @BlocktestingModElements.ModElement.Tag public class SnowySakuraContainer1Block extends BlocktestingModElements.ModElement { @ObjectHolder("blocktesting:snowy_sakura_container_1") public static final Block block = null; @ObjectHolder("blocktesting:snowy_sakura_container_1") public static final TileEntityType<CustomTileEntity> tileEntityType = null; public SnowySakuraContainer1Block(BlocktestingModElements instance) { super(instance, 78); FMLJavaModLoadingContext.get().getModEventBus().register(new TileEntityRegisterHandler()); } @Override public void initElements() { elements.blocks.add(() -> new CustomBlock()); elements.items.add( () -> new BlockItem(block, new Item.Properties().group(SnowContainers32x32ItemGroup.tab)).setRegistryName(block.getRegistryName())); } private static class TileEntityRegisterHandler { @SubscribeEvent public void registerTileEntity(RegistryEvent.Register<TileEntityType<?>> event) { event.getRegistry() .register(TileEntityType.Builder.create(CustomTileEntity::new, block).build(null).setRegistryName("snowy_sakura_container_1")); } } public static class CustomBlock extends Block { public static final DirectionProperty FACING = DirectionalBlock.FACING; public CustomBlock() { super(Block.Properties.create(Material.IRON).sound(SoundType.METAL).hardnessAndResistance(6f, 10f).setLightLevel(s -> 0).harvestLevel(2) .harvestTool(ToolType.PICKAXE).setRequiresTool()); this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH)); setRegistryName("snowy_sakura_container_1"); } @Override public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { return 15; } @Override protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { builder.add(FACING); } public BlockState rotate(BlockState state, Rotation rot) { return state.with(FACING, rot.rotate(state.get(FACING))); } public BlockState mirror(BlockState state, Mirror mirrorIn) { return state.rotate(mirrorIn.toRotation(state.get(FACING))); } @Override public BlockState getStateForPlacement(BlockItemUseContext context) { ; return this.getDefaultState().with(FACING, context.getNearestLookingDirection().getOpposite()); } @Override public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) { List<ItemStack> dropsOriginal = super.getDrops(state, builder); if (!dropsOriginal.isEmpty()) return dropsOriginal; return Collections.singletonList(new ItemStack(this, 1)); } @Override public ActionResultType onBlockActivated(BlockState blockstate, World world, BlockPos pos, PlayerEntity entity, Hand hand, BlockRayTraceResult hit) { super.onBlockActivated(blockstate, world, pos, entity, hand, hit); int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); if (entity instanceof ServerPlayerEntity) { NetworkHooks.openGui((ServerPlayerEntity) entity, new INamedContainerProvider() { @Override public ITextComponent getDisplayName() { return new StringTextComponent("Snow Sakura Container 1"); } @Override public Container createMenu(int id, PlayerInventory inventory, PlayerEntity player) { return new WhiteContainerEndsGUIGui.GuiContainerMod(id, inventory, new PacketBuffer(Unpooled.buffer()).writeBlockPos(new BlockPos(x, y, z))); } }, new BlockPos(x, y, z)); } return ActionResultType.SUCCESS; } @Override public INamedContainerProvider getContainer(BlockState state, World worldIn, BlockPos pos) { TileEntity tileEntity = worldIn.getTileEntity(pos); return tileEntity instanceof INamedContainerProvider ? (INamedContainerProvider) tileEntity : null; } @Override public boolean hasTileEntity(BlockState state) { return true; } @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { return new CustomTileEntity(); } @Override public boolean eventReceived(BlockState state, World world, BlockPos pos, int eventID, int eventParam) { super.eventReceived(state, world, pos, eventID, eventParam); TileEntity tileentity = world.getTileEntity(pos); return tileentity == null ? false : tileentity.receiveClientEvent(eventID, eventParam); } @Override public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) { if (state.getBlock() != newState.getBlock()) { TileEntity tileentity = world.getTileEntity(pos); if (tileentity instanceof CustomTileEntity) { InventoryHelper.dropInventoryItems(world, pos, (CustomTileEntity) tileentity); world.updateComparatorOutputLevel(pos, this); } super.onReplaced(state, world, pos, newState, isMoving); } } @Override public boolean hasComparatorInputOverride(BlockState state) { return true; } @Override public int getComparatorInputOverride(BlockState blockState, World world, BlockPos pos) { TileEntity tileentity = world.getTileEntity(pos); if (tileentity instanceof CustomTileEntity) return Container.calcRedstoneFromInventory((CustomTileEntity) tileentity); else return 0; } } public static class CustomTileEntity extends LockableLootTileEntity implements ISidedInventory { private NonNullList<ItemStack> stacks = NonNullList.<ItemStack>withSize(60, ItemStack.EMPTY); protected CustomTileEntity() { super(tileEntityType); } @Override public void read(BlockState blockState, CompoundNBT compound) { super.read(blockState, compound); if (!this.checkLootAndRead(compound)) { this.stacks = NonNullList.withSize(this.getSizeInventory(), ItemStack.EMPTY); } ItemStackHelper.loadAllItems(compound, this.stacks); } @Override public CompoundNBT write(CompoundNBT compound) { super.write(compound); if (!this.checkLootAndWrite(compound)) { ItemStackHelper.saveAllItems(compound, this.stacks); } return compound; } @Override public SUpdateTileEntityPacket getUpdatePacket() { return new SUpdateTileEntityPacket(this.pos, 0, this.getUpdateTag()); } @Override public CompoundNBT getUpdateTag() { return this.write(new CompoundNBT()); } @Override public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { this.read(this.getBlockState(), pkt.getNbtCompound()); } @Override public int getSizeInventory() { return stacks.size(); } @Override public boolean isEmpty() { for (ItemStack itemstack : this.stacks) if (!itemstack.isEmpty()) return false; return true; } @Override public ITextComponent getDefaultName() { return new StringTextComponent("snowy_sakura_container_1"); } @Override public int getInventoryStackLimit() { return 64; } @Override public Container createMenu(int id, PlayerInventory player) { return new WhiteContainerEndsGUIGui.GuiContainerMod(id, player, new PacketBuffer(Unpooled.buffer()).writeBlockPos(this.getPos())); } @Override public ITextComponent getDisplayName() { return new StringTextComponent("Snow Sakura Container 1"); } @Override protected NonNullList<ItemStack> getItems() { return this.stacks; } @Override protected void setItems(NonNullList<ItemStack> stacks) { this.stacks = stacks; } @Override public boolean isItemValidForSlot(int index, ItemStack stack) { return true; } @Override public int[] getSlotsForFace(Direction side) { return IntStream.range(0, this.getSizeInventory()).toArray(); } @Override public boolean canInsertItem(int index, ItemStack stack, @Nullable Direction direction) { return this.isItemValidForSlot(index, stack); } @Override public boolean canExtractItem(int index, ItemStack stack, Direction direction) { return true; } private final LazyOptional<? extends IItemHandler>[] handlers = SidedInvWrapper.create(this, Direction.values()); @Override public <T> LazyOptional<T> getCapability(Capability<T> capability, @Nullable Direction facing) { if (!this.removed && facing != null && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return handlers[facing.ordinal()].cast(); return super.getCapability(capability, facing); } @Override public void remove() { super.remove(); for (LazyOptional<? extends IItemHandler> handler : handlers) handler.invalidate(); } } }
[ "30630937+ChrisCraddock@users.noreply.github.com" ]
30630937+ChrisCraddock@users.noreply.github.com
5a2a2c05512ce6c9517e6bdbf873be01b16ba086
c3a78a28ea12b598b7287a804a099529a0910337
/src/main/java/ar/com/telecom/gemp/domain/TipoObra.java
d5a72c91ac03b3ff35332e8d26e500288fbaf24c
[]
no_license
Palopezg/gemp
80be9ad7766167e7507a97ee024b1b792e76a0b5
c582b440489e198b99510bd1164c93d5b51721ad
refs/heads/master
2023-04-22T18:25:26.038545
2020-11-16T13:13:40
2020-11-16T13:13:40
288,794,038
0
1
null
2021-03-16T15:30:58
2020-08-19T17:24:33
TypeScript
UTF-8
Java
false
false
2,048
java
package ar.com.telecom.gemp.domain; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import javax.persistence.*; import java.io.Serializable; /** * A TipoObra. */ @Entity @Table(name = "tipo_obra") public class TipoObra implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator") @SequenceGenerator(name = "sequenceGenerator") private Long id; @Column(name = "descripcion") private String descripcion; @ManyToOne @JsonIgnoreProperties(value = "tipoObras", allowSetters = true) private Segmento segmento; // jhipster-needle-entity-add-field - JHipster will add fields here public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getDescripcion() { return descripcion; } public TipoObra descripcion(String descripcion) { this.descripcion = descripcion; return this; } public void setDescripcion(String descripcion) { this.descripcion = descripcion; } public Segmento getSegmento() { return segmento; } public TipoObra segmento(Segmento segmento) { this.segmento = segmento; return this; } public void setSegmento(Segmento segmento) { this.segmento = segmento; } // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof TipoObra)) { return false; } return id != null && id.equals(((TipoObra) o).id); } @Override public int hashCode() { return 31; } // prettier-ignore @Override public String toString() { return "TipoObra{" + "id=" + getId() + ", descripcion='" + getDescripcion() + "'" + "}"; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
7a6d4a7cfb0a849a31d613c000f2a116626f8183
723fdd73f91ade76c44f3b47a87995358dd8d02e
/cps/gui/tools/FileChooser.java
31d06da396baeec8dec7a712a197b85fe4c8d03b
[]
no_license
erosten/TimeSheets
578a0cd4b4722e93006e944d9578db7765638866
556b511c3b7b80a60154cdd0c48685a52d0f1132
refs/heads/master
2020-03-27T08:16:10.178781
2018-09-09T23:00:43
2018-09-09T23:00:43
146,234,523
0
0
null
2018-08-27T02:15:56
2018-08-27T02:02:28
Java
UTF-8
Java
false
false
3,826
java
package cps.gui.tools; /* * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of Oracle or the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import java.awt.BorderLayout; import java.io.File; import javax.swing.JFileChooser; import javax.swing.JPanel; //automatically opens a dialogue box where you can choose a file and it is brought into the program public class FileChooser extends JPanel { File chosenFile = null; private static final long serialVersionUID = -2039017963853534543L; /** * Returns a directory File object chosen by the user. This class will open a file directory * window and prompt the user to choose a directory File */ public FileChooser() { super(new BorderLayout()); // Create a file chooser final JFileChooser fc = new JFileChooser(); // Uncomment one of the following lines to try a different // file selection mode. The first allows just directories // to be selected (and, at least in the Java look and feel, // shown). The second allows both files and directories // to be selected. If you leave these lines commented out, // then the default mode (FILES_ONLY) will be used. // fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); // fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); final int returnVal = fc.showOpenDialog(FileChooser.this); if (returnVal == JFileChooser.APPROVE_OPTION) { // do anything with file chosen this.chosenFile = fc.getSelectedFile(); // String prog_dir_path = program_directory.getAbsolutePath(); // Employees.WORKING_DIR = program_directory.getAbsolutePath(); // String program_file_path = System.getProperty("java.class.path") // + System.getProperty("file.separator") + "Properties.properties"; // Properties prop = new Properties(); // prop.setProperty("WORKING_DIR", prog_dir_path); // FileOutputStream out = new FileOutputStream(program_file_path); // prop.store(out, "WORKING DIR = " + prog_dir_path); // System.out.println(program_file_path); // out.close(); } else if (returnVal == JFileChooser.CANCEL_OPTION) { System.out.println("User cancelled.."); } else { System.out.println("Something went wrong [FileChooser].."); } } public File getFile() { return this.chosenFile; } }
[ "erikrrosten@gmail.com" ]
erikrrosten@gmail.com
0cabdce29aedf06c94db66be0cb40c6cf130f6cc
ad90430e47537523bbd5498997567a96b6da7e9c
/Tuition-With-Jung-Request-Params/tuition-service/src/main/java/com/trilogyed/tuitionservice/repository/TuitionRepository.java
3411b042636a7471a2d182585491e54e386e6e99
[]
no_license
dcdi22/java-examples
909c18e7d9e5909aa27f87a6ae6bb4482e9bdebc
12c04f78f837de99e2ad2a775275d2a2807bc365
refs/heads/master
2022-07-06T02:00:09.795917
2020-01-28T17:09:41
2020-01-28T17:09:41
236,787,858
1
0
null
2022-06-21T02:42:45
2020-01-28T16:57:14
Java
UTF-8
Java
false
false
366
java
package com.trilogyed.tuitionservice.repository; import com.trilogyed.tuitionservice.model.BaseTuition; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface TuitionRepository extends JpaRepository<BaseTuition, String> { BaseTuition getBaseTuitionByMajor(String major); }
[ "dcdion22@gmail.com" ]
dcdion22@gmail.com
f414fefd1ec774d26c5daf6b4aa5c0fe35ae090d
ad01d3afcadd5b163ecf8ba60ba556ea268b4827
/amuedrp/trunk/LibMS/src/java/com/myapp/struts/circulation/OpacCheckOutDoc.java
dcfaa6f25e59c3f9f3f6eea27438254292590a5a
[]
no_license
ynsingh/repos
64a82c103f0033480945fcbb567b599629c4eb1b
829ad133367014619860932c146c208e10bb71e0
refs/heads/master
2022-04-18T11:39:24.803073
2020-04-08T09:39:43
2020-04-08T09:39:43
254,699,274
1
2
null
null
null
null
UTF-8
Java
false
false
2,125
java
package com.myapp.struts.circulation; import com.myapp.struts.admin.*; public class OpacCheckOutDoc { private String memid; private String memname; private String accession_no; private String document_id; private String call_no; private String title; private String author; /** * @return the memid */ public String getMemid() { return memid; } /** * @param memid the memid to set */ public void setMemid(String memid) { this.memid = memid; } /** * @return the memname */ public String getMemname() { return memname; } /** * @param memname the memname to set */ public void setMemname(String memname) { this.memname = memname; } /** * @return the accession_no */ public String getAccession_no() { return accession_no; } /** * @param accession_no the accession_no to set */ public void setAccession_no(String accession_no) { this.accession_no = accession_no; } /** * @return the document_id */ public String getDocument_id() { return document_id; } /** * @param document_id the document_id to set */ public void setDocument_id(String document_id) { this.document_id = document_id; } /** * @return the call_no */ public String getCall_no() { return call_no; } /** * @param call_no the call_no to set */ public void setCall_no(String call_no) { this.call_no = call_no; } /** * @return the title */ public String getTitle() { return title; } /** * @param title the title to set */ public void setTitle(String title) { this.title = title; } /** * @return the author */ public String getAuthor() { return author; } /** * @param author the author to set */ public void setAuthor(String author) { this.author = author; } }
[ "ynsingh@0c22728b-0eb9-4c4e-a44d-29de7e55569f" ]
ynsingh@0c22728b-0eb9-4c4e-a44d-29de7e55569f
c824499ca1c153b5fe71d107d5c16a97ed0c1152
96afa4311680103110615b2649046c443981a1f5
/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/registry/cache/RefreshableMicroserviceCacheTest.java
0486e009b674ba35197149201ffa20e129799c24
[ "Apache-2.0" ]
permissive
xdj1995/servicecomb-java-chassis
c510b3655d3a7bab9768b50dafcfc988ee9e4138
cf7afb3b1a04db7141d9730fc8070e3e4f026af1
refs/heads/master
2022-04-14T19:34:12.451842
2020-04-16T08:18:52
2020-04-17T00:44:20
256,423,454
1
0
Apache-2.0
2020-04-17T06:41:37
2020-04-17T06:41:36
null
UTF-8
Java
false
false
14,967
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.servicecomb.serviceregistry.registry.cache; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.function.Function; import org.apache.servicecomb.foundation.common.Holder; import org.apache.servicecomb.serviceregistry.api.registry.Microservice; import org.apache.servicecomb.serviceregistry.api.registry.MicroserviceInstance; import org.apache.servicecomb.serviceregistry.api.response.FindInstancesResponse; import org.apache.servicecomb.serviceregistry.client.ServiceRegistryClient; import org.apache.servicecomb.serviceregistry.client.http.MicroserviceInstances; import org.apache.servicecomb.serviceregistry.consumer.MicroserviceInstancePing; import org.apache.servicecomb.serviceregistry.registry.cache.MicroserviceCache.MicroserviceCacheStatus; import org.apache.servicecomb.serviceregistry.task.event.SafeModeChangeEvent; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import mockit.Mock; import mockit.MockUp; public class RefreshableMicroserviceCacheTest { private Holder<Function<Object[], MicroserviceInstances>> findServiceInstancesOprHolder = new Holder<>(); private ServiceRegistryClient srClient; private RefreshableMicroserviceCache microserviceCache; private List<MicroserviceInstance> pulledInstances = new ArrayList<>(); private Microservice consumerService; @Before public void setUp() throws Exception { srClient = new MockUp<ServiceRegistryClient>() { @Mock MicroserviceInstances findServiceInstances(String consumerId, String appId, String serviceName, String versionRule, String revision) { return findServiceInstancesOprHolder.value .apply(new Object[] {consumerId, appId, serviceName, versionRule, revision}); } }.getMockInstance(); consumerService = new Microservice(); consumerService.setServiceId("consumerId"); microserviceCache = new RefreshableMicroserviceCache( consumerService, MicroserviceCacheKey.builder().env("env").appId("app").serviceName("svc").build(), srClient, false); findServiceInstancesOprHolder.value = params -> { MicroserviceInstances microserviceInstances = new MicroserviceInstances(); microserviceInstances.setNeedRefresh(true); microserviceInstances.setRevision("rev0"); microserviceInstances.setMicroserviceNotExist(false); FindInstancesResponse instancesResponse = new FindInstancesResponse(); instancesResponse.setInstances(pulledInstances); microserviceInstances.setInstancesResponse(instancesResponse); return microserviceInstances; }; } @Test public void forceRefresh() { MicroserviceInstance microserviceInstance = new MicroserviceInstance(); microserviceInstance.setInstanceId("instanceId00"); ArrayList<MicroserviceInstance> instances = new ArrayList<>(); instances.add(microserviceInstance); findServiceInstancesOprHolder.value = params -> { Assert.assertEquals("consumerId", params[0]); Assert.assertEquals("app", params[1]); Assert.assertEquals("svc", params[2]); Assert.assertEquals("0.0.0.0+", params[3]); Assert.assertNull(params[4]); MicroserviceInstances microserviceInstances = new MicroserviceInstances(); microserviceInstances.setNeedRefresh(true); microserviceInstances.setRevision("rev2"); microserviceInstances.setMicroserviceNotExist(false); FindInstancesResponse instancesResponse = new FindInstancesResponse(); instancesResponse.setInstances(instances); microserviceInstances.setInstancesResponse(instancesResponse); return microserviceInstances; }; microserviceCache.revisionId = "rev"; microserviceCache.forceRefresh(); Assert.assertEquals(MicroserviceCacheStatus.REFRESHED, microserviceCache.getStatus()); List<MicroserviceInstance> cachedInstances = microserviceCache.getInstances(); Assert.assertEquals(1, cachedInstances.size()); MicroserviceInstance instance = cachedInstances.iterator().next(); Assert.assertEquals("instanceId00", instance.getInstanceId()); Assert.assertEquals("rev2", microserviceCache.getRevisionId()); } @Test public void refresh() { ArrayList<MicroserviceInstance> instances = new ArrayList<>(); findServiceInstancesOprHolder.value = params -> { Assert.assertEquals("consumerId", params[0]); Assert.assertEquals("app", params[1]); Assert.assertEquals("svc", params[2]); Assert.assertEquals("0.0.0.0+", params[3]); Assert.assertNull(params[4]); MicroserviceInstances microserviceInstances = new MicroserviceInstances(); microserviceInstances.setNeedRefresh(true); microserviceInstances.setRevision("rev0"); microserviceInstances.setMicroserviceNotExist(false); FindInstancesResponse instancesResponse = new FindInstancesResponse(); instancesResponse.setInstances(instances); microserviceInstances.setInstancesResponse(instancesResponse); return microserviceInstances; }; // at the beginning, no instances in cache List<MicroserviceInstance> cachedInstances = microserviceCache.getInstances(); Assert.assertEquals(0, cachedInstances.size()); Assert.assertNull(microserviceCache.getRevisionId()); // find 1 instance from sc MicroserviceInstance microserviceInstance = new MicroserviceInstance(); instances.add(microserviceInstance); microserviceInstance.setInstanceId("instanceId00"); microserviceCache.refresh(); Assert.assertEquals(MicroserviceCacheStatus.REFRESHED, microserviceCache.getStatus()); cachedInstances = microserviceCache.getInstances(); Assert.assertEquals(1, cachedInstances.size()); MicroserviceInstance instance = cachedInstances.iterator().next(); Assert.assertEquals("instanceId00", instance.getInstanceId()); Assert.assertEquals("rev0", microserviceCache.getRevisionId()); // 2nd time, find 2 instances, one of them is the old instance MicroserviceInstance microserviceInstance1 = new MicroserviceInstance(); instances.add(microserviceInstance1); microserviceInstance1.setInstanceId("instanceId01"); findServiceInstancesOprHolder.value = params -> { Assert.assertEquals("consumerId", params[0]); Assert.assertEquals("app", params[1]); Assert.assertEquals("svc", params[2]); Assert.assertEquals("0.0.0.0+", params[3]); Assert.assertEquals("rev0", params[4]); MicroserviceInstances microserviceInstances = new MicroserviceInstances(); microserviceInstances.setNeedRefresh(true); microserviceInstances.setRevision("rev1"); microserviceInstances.setMicroserviceNotExist(false); FindInstancesResponse instancesResponse = new FindInstancesResponse(); instancesResponse.setInstances(instances); microserviceInstances.setInstancesResponse(instancesResponse); return microserviceInstances; }; microserviceCache.refresh(); Assert.assertEquals(MicroserviceCacheStatus.REFRESHED, microserviceCache.getStatus()); cachedInstances = microserviceCache.getInstances(); Assert.assertEquals(2, cachedInstances.size()); Assert.assertEquals("instanceId00", cachedInstances.get(0).getInstanceId()); Assert.assertEquals("instanceId01", cachedInstances.get(1).getInstanceId()); } @Test public void refresh_service_error() { findServiceInstancesOprHolder.value = params -> null; List<MicroserviceInstance> oldInstanceList = microserviceCache.getInstances(); microserviceCache.refresh(); Assert.assertEquals(MicroserviceCacheStatus.CLIENT_ERROR, microserviceCache.getStatus()); Assert.assertSame(oldInstanceList, microserviceCache.getInstances()); } @Test public void refresh_service_not_exist() { findServiceInstancesOprHolder.value = params -> { MicroserviceInstances microserviceInstances = new MicroserviceInstances(); microserviceInstances.setMicroserviceNotExist(true); return microserviceInstances; }; List<MicroserviceInstance> oldInstanceList = microserviceCache.getInstances(); microserviceCache.refresh(); Assert.assertEquals(MicroserviceCacheStatus.SERVICE_NOT_FOUND, microserviceCache.getStatus()); Assert.assertSame(oldInstanceList, microserviceCache.getInstances()); } @Test public void refresh_service_no_change() { findServiceInstancesOprHolder.value = params -> { MicroserviceInstances microserviceInstances = new MicroserviceInstances(); microserviceInstances.setMicroserviceNotExist(false); microserviceInstances.setNeedRefresh(false); return microserviceInstances; }; List<MicroserviceInstance> oldInstanceList = microserviceCache.getInstances(); microserviceCache.refresh(); Assert.assertEquals(MicroserviceCacheStatus.NO_CHANGE, microserviceCache.getStatus()); Assert.assertSame(oldInstanceList, microserviceCache.getInstances()); } @Test public void refresh_error_in_setInstances() { microserviceCache = new RefreshableMicroserviceCache( consumerService, MicroserviceCacheKey.builder().env("env").appId("app").serviceName("svc").build(), srClient, false) { @Override protected Set<MicroserviceInstance> mergeInstances(List<MicroserviceInstance> pulledInstances) { throw new IllegalStateException("a mock exception"); } }; List<MicroserviceInstance> oldInstanceList = microserviceCache.getInstances(); Assert.assertEquals(MicroserviceCacheStatus.INIT, microserviceCache.getStatus()); microserviceCache.refresh(); Assert.assertEquals(MicroserviceCacheStatus.SETTING_CACHE_ERROR, microserviceCache.getStatus()); List<MicroserviceInstance> newInstanceList = microserviceCache.getInstances(); Assert.assertEquals(0, newInstanceList.size()); Assert.assertSame(oldInstanceList, newInstanceList); } @Test public void refresh_safe_mode() { microserviceCache.instances = new ArrayList<>(); MicroserviceInstance instance0 = new MicroserviceInstance(); instance0.setInstanceId("instanceId0"); microserviceCache.instances.add(instance0); pulledInstances = new ArrayList<>(); MicroserviceInstance instance1 = new MicroserviceInstance(); instance1.setInstanceId("instanceId1"); pulledInstances.add(instance1); microserviceCache.refresh(); Assert.assertEquals(MicroserviceCacheStatus.REFRESHED, microserviceCache.getStatus()); Assert.assertEquals(1, microserviceCache.getInstances().size()); Assert.assertEquals("instanceId1", microserviceCache.getInstances().get(0).getInstanceId()); // enter safe mode microserviceCache.onSafeModeChanged(new SafeModeChangeEvent(true)); pulledInstances = new ArrayList<>(); MicroserviceInstance instance2 = new MicroserviceInstance(); instance2.setInstanceId("instanceId2"); pulledInstances.add(instance2); microserviceCache.refresh(); Assert.assertEquals(MicroserviceCacheStatus.REFRESHED, microserviceCache.getStatus()); Assert.assertEquals(2, microserviceCache.getInstances().size()); Assert.assertEquals("instanceId2", microserviceCache.getInstances().get(0).getInstanceId()); Assert.assertEquals("instanceId1", microserviceCache.getInstances().get(1).getInstanceId()); // exit safe mode microserviceCache.onSafeModeChanged(new SafeModeChangeEvent(false)); pulledInstances = new ArrayList<>(); MicroserviceInstance instance3 = new MicroserviceInstance(); instance3.setInstanceId("instanceId3"); pulledInstances.add(instance3); microserviceCache.refresh(); Assert.assertEquals(MicroserviceCacheStatus.REFRESHED, microserviceCache.getStatus()); Assert.assertEquals(1, microserviceCache.getInstances().size()); Assert.assertEquals("instanceId3", microserviceCache.getInstances().get(0).getInstanceId()); } @Test public void refresh_empty_instance_protection_disabled() { microserviceCache.instances = new ArrayList<>(); MicroserviceInstance instance0 = new MicroserviceInstance(); instance0.setInstanceId("instanceId0"); microserviceCache.instances.add(instance0); pulledInstances = new ArrayList<>(); microserviceCache.refresh(); Assert.assertEquals(MicroserviceCacheStatus.REFRESHED, microserviceCache.getStatus()); Assert.assertEquals(0, microserviceCache.getInstances().size()); } @Test public void refresh_empty_instance_protection_enabled() { microserviceCache.setEmptyInstanceProtectionEnabled(true); microserviceCache.instancePing = new MicroserviceInstancePing() { @Override public int getOrder() { return 0; } @Override public boolean ping(MicroserviceInstance instance) { return true; } }; microserviceCache.instances = new ArrayList<>(); MicroserviceInstance instance0 = new MicroserviceInstance(); instance0.setInstanceId("instanceId0"); microserviceCache.instances.add(instance0); pulledInstances = new ArrayList<>(); microserviceCache.refresh(); Assert.assertEquals(MicroserviceCacheStatus.REFRESHED, microserviceCache.getStatus()); Assert.assertEquals(1, microserviceCache.getInstances().size()); Assert.assertEquals("instanceId0", microserviceCache.getInstances().get(0).getInstanceId()); } @Test public void set_consumer_service_id() { Holder<Integer> assertCounter = new Holder<>(0); Function<Object[], MicroserviceInstances> preservedLogic = findServiceInstancesOprHolder.value; findServiceInstancesOprHolder.value = params -> { Assert.assertEquals("consumerId", params[0]); assertCounter.value++; return preservedLogic.apply(params); }; microserviceCache.refresh(); consumerService.setServiceId("consumerId2"); findServiceInstancesOprHolder.value = params -> { Assert.assertEquals("consumerId2", params[0]); assertCounter.value++; return preservedLogic.apply(params); }; microserviceCache.refresh(); Assert.assertEquals(Integer.valueOf(2), assertCounter.value); } }
[ "yhs0092@163.com" ]
yhs0092@163.com
e41f3689aa34d3a144d44d1ee89c28f25aff1488
156fd97b222512abd90a759de302e509637a234b
/server/src/test/java/com/tripco/t07/planner/TestPlace.java
c493e5e98b225286c80103bcdfaf5764b5f40f69
[]
no_license
sifi727/TripCo
d4baaa6a516fd097b1104fe87863e9f521cd37b8
ea2806e4addd48e459ae1ab977cf24a71b2ee4d2
refs/heads/master
2023-03-22T19:24:26.426383
2021-03-20T00:19:50
2021-03-20T00:19:50
349,584,122
0
0
null
null
null
null
UTF-8
Java
false
false
693
java
package com.tripco.t07.planner; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import java.util.ArrayList; import java.util.Collections; import static org.junit.Assert.*; /* This class contains tests for the Trip class. */ @RunWith(JUnit4.class) public class TestPlace { Place place; // Setup to be done before every test in TestPlan @Before public void initialize() { place = new Place(); place.id = "dnvr"; place.name="Denver"; } @Test public void testPlace() { String id = "dnvr"; String name = "Denver"; assertEquals(place.id, id); assertEquals(place.name,name); } }
[ "andy.dolan.dev@gmail.com" ]
andy.dolan.dev@gmail.com
92f48f467ac1743f4e2bc99933f8b6b9e1840afc
09448e1297e30545cd95e475992e94ca391a8f92
/app/src/main/java/Network/Utility.java
50bb867ebb3893cd2b6e066991b8837fe4a9cce7
[ "Apache-2.0" ]
permissive
engineerWithoutCode/coolweather
917c5b6c628aa7c0fca4d5c04f0cf6f9e6eea9b2
f9274a42323fd134fc711cd64ff879e6b04f44b4
refs/heads/master
2020-03-31T15:36:49.538066
2018-10-20T03:07:23
2018-10-20T03:07:23
152,343,685
0
0
null
null
null
null
UTF-8
Java
false
false
3,253
java
package Network; import android.text.TextUtils; import android.util.Log; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import org.json.JSONArray; import org.json.JSONObject; import db.City; import db.County; import db.Province; import gson.Weather; public class Utility { public static boolean handleProvinceResponse(String response){ if (!TextUtils.isEmpty(response)){ try{ JSONArray allProvince = new JSONArray(response); for(int i=0;i<allProvince.length();i++){ JSONObject provinceObject = allProvince.getJSONObject(i); Province province = new Province(); province.setProvinceName(provinceObject.getString("name")); province.setProvinceCode(provinceObject.getInt("id")); province.save(); } return true; }catch (Exception e){ e.printStackTrace(); } } return false; } public static boolean handleCityResponse(String response,int provinceId){ if (!TextUtils.isEmpty(response)){ try{ JSONArray allCities = new JSONArray(response); for(int i=0;i<allCities.length();i++){ JSONObject cityObject = allCities.getJSONObject(i); City city = new City(); city.setCityName(cityObject.getString("name")); city.setCityCode(cityObject.getInt("id")); city.setProvinceId(provinceId); city.save(); } return true; }catch (Exception e){ e.printStackTrace(); } } return false; } public static boolean handleCountyResponse(String response,int cityId){ if (!TextUtils.isEmpty(response)){ try{ JSONArray allCounties = new JSONArray(response); for (int i=0;i<allCounties.length();i++){ JSONObject countyObject =allCounties.getJSONObject(i); County county = new County(); county.setCountyName(countyObject.getString("name")); county.setWeatherId(countyObject.getString("weather_id")); county.setCityId(cityId); county.save(); } return true; }catch (Exception e){ e.printStackTrace(); } } return false; } //处理天气 public static Weather handleWeatherResponse(String response){ if (response != null){ Log.d("请求返回的数据:",response.toString()); }else{ Log.d("请求返回的数据:","null"); } try{ JSONObject jsonObject = new JSONObject(response); JSONArray jsonArray = jsonObject.getJSONArray("HeWeather"); String weatherContent = jsonArray.getJSONObject(0).toString(); return new Gson().fromJson(weatherContent,Weather.class); }catch (Exception e){ e.printStackTrace(); } return null; } }
[ "oo" ]
oo
d2a4b34b63b859322b25ff2a85503329efb3479f
8ec69fe6574ce6cb40ad97801a8299000581c869
/projects/batfish/src/batfish/grammar/flatjuniper/ConfigurationBuilder.java
7d4f1a1b6d59f95916966f2b936ce6b1010a8e47
[ "Apache-2.0" ]
permissive
karthikBG/batfish
f7e1c7a16b11f6f9d84d236022bed47144575fea
db62d4eb904df1893420ad9a9929f37d5b487560
refs/heads/master
2021-01-18T16:00:49.231078
2014-12-10T03:21:04
2014-12-10T03:21:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
62,609
java
package batfish.grammar.flatjuniper; import java.util.Arrays; import java.util.List; import java.util.Set; import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.tree.ErrorNode; import org.antlr.v4.runtime.tree.TerminalNode; import batfish.grammar.BatfishCombinedParser; import batfish.grammar.ParseTreePrettyPrinter; import batfish.grammar.cisco.CiscoGrammar; import batfish.grammar.flatjuniper.FlatJuniperGrammarParser.*; import batfish.representation.juniper.JuniperVendorConfiguration; public class ConfigurationBuilder extends FlatJuniperGrammarParserBaseListener { private JuniperVendorConfiguration _configuration; private JuniperVendorConfiguration _masterConfiguration; private BatfishCombinedParser<?, ?> _parser; private Set<String> _rulesWithSuppressedWarnings; private boolean _set; private String _text; private List<String> _warnings; public ConfigurationBuilder(BatfishCombinedParser<?, ?> parser, String text, Set<String> rulesWithSuppressedWarnings, List<String> warnings) { _parser = parser; _text = text; _rulesWithSuppressedWarnings = rulesWithSuppressedWarnings; _warnings = warnings; _masterConfiguration = new JuniperVendorConfiguration(); _configuration = _masterConfiguration; } @Override public void enterBfi6t_unicast(Bfi6t_unicastContext ctx) { // TODO Auto-generated method stub } @Override public void enterBfi6t_unicast_tail(Bfi6t_unicast_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterBfi6ut_prefix_limit(Bfi6ut_prefix_limitContext ctx) { // TODO Auto-generated method stub } @Override public void enterBfit_flow(Bfit_flowContext ctx) { // TODO Auto-generated method stub } @Override public void enterBfit_unicast(Bfit_unicastContext ctx) { // TODO Auto-generated method stub } @Override public void enterBfit_unicast_tail(Bfit_unicast_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterBfiut_prefix_limit(Bfiut_prefix_limitContext ctx) { // TODO Auto-generated method stub } @Override public void enterBft_inet(Bft_inetContext ctx) { // TODO Auto-generated method stub } @Override public void enterBft_inet_tail(Bft_inet_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterBft_inet6(Bft_inet6Context ctx) { // TODO Auto-generated method stub } @Override public void enterBft_inet6_tail(Bft_inet6_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_advertise_inactive(Bt_advertise_inactiveContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_cluster(Bt_clusterContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_common(Bt_commonContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_description(Bt_descriptionContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_export(Bt_exportContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_family(Bt_familyContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_family_tail(Bt_family_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_group(Bt_groupContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_group_header(Bt_group_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_group_tail(Bt_group_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_import(Bt_importContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_local_address(Bt_local_addressContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_local_as(Bt_local_asContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_multipath(Bt_multipathContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_neighbor(Bt_neighborContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_neighbor_header(Bt_neighbor_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_neighbor_tail(Bt_neighbor_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_null(Bt_nullContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_path_selection(Bt_path_selectionContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_path_selection_tail(Bt_path_selection_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_peer_as(Bt_peer_asContext ctx) { // TODO Auto-generated method stub } @Override public void enterBt_type(Bt_typeContext ctx) { // TODO Auto-generated method stub } @Override public void enterColort_apply_groups(Colort_apply_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void enterColort_color(Colort_colorContext ctx) { // TODO Auto-generated method stub } @Override public void enterCt_members(Ct_membersContext ctx) { // TODO Auto-generated method stub } @Override public void enterDeactivate_line(Deactivate_lineContext ctx) { // TODO Auto-generated method stub } @Override public void enterDirection(DirectionContext ctx) { // TODO Auto-generated method stub } @Override public void enterEveryRule(ParserRuleContext arg0) { // TODO Auto-generated method stub } @Override public void enterFamily(FamilyContext ctx) { // TODO Auto-generated method stub } @Override public void enterFamt_inet(Famt_inetContext ctx) { // TODO Auto-generated method stub } @Override public void enterFamt_inet_tail(Famt_inet_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterFamt_inet6(Famt_inet6Context ctx) { // TODO Auto-generated method stub } @Override public void enterFamt_mpls(Famt_mplsContext ctx) { todo(ctx); } @Override public void enterFamt_mpls_tail(Famt_mpls_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterFilter(FilterContext ctx) { // TODO Auto-generated method stub } @Override public void enterFilter_header(Filter_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterFilter_tail(Filter_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterFlat_juniper_configuration( Flat_juniper_configurationContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_as_path(Fromt_as_pathContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_color(Fromt_colorContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_community(Fromt_communityContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_family(Fromt_familyContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_interface(Fromt_interfaceContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_policy(Fromt_policyContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_prefix_list(Fromt_prefix_listContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_protocol(Fromt_protocolContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_route_filter(Fromt_route_filterContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_route_filter_header( Fromt_route_filter_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_route_filter_tail(Fromt_route_filter_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_source_address_filter( Fromt_source_address_filterContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_source_address_filter_header( Fromt_source_address_filter_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterFromt_tag(Fromt_tagContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_address(Fwfromt_addressContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_destination_address( Fwfromt_destination_addressContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_destination_port(Fwfromt_destination_portContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_dscp(Fwfromt_dscpContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_exp(Fwfromt_expContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_icmp_code(Fwfromt_icmp_codeContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_icmp_type(Fwfromt_icmp_typeContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_next_header(Fwfromt_next_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_port(Fwfromt_portContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_prefix_list(Fwfromt_prefix_listContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_protocol(Fwfromt_protocolContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_source_address(Fwfromt_source_addressContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_source_port(Fwfromt_source_portContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_source_prefix_list( Fwfromt_source_prefix_listContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_tcp_established(Fwfromt_tcp_establishedContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwfromt_tcp_flags(Fwfromt_tcp_flagsContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwft_interface_specific(Fwft_interface_specificContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwft_term(Fwft_termContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwft_term_header(Fwft_term_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwft_term_tail(Fwft_term_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwt_family(Fwt_familyContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwt_family_header(Fwt_family_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwt_family_tail(Fwt_family_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwt_filter(Fwt_filterContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwt_filter_header(Fwt_filter_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwt_filter_tail(Fwt_filter_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwt_null(Fwt_nullContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwthent_accept(Fwthent_acceptContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwthent_discard(Fwthent_discardContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwthent_null(Fwthent_nullContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwthent_reject(Fwthent_rejectContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwtt_from(Fwtt_fromContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwtt_from_tail(Fwtt_from_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwtt_then(Fwtt_thenContext ctx) { // TODO Auto-generated method stub } @Override public void enterFwtt_then_tail(Fwtt_then_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterIcmp_code(Icmp_codeContext ctx) { // TODO Auto-generated method stub } @Override public void enterIcmp_type(Icmp_typeContext ctx) { // TODO Auto-generated method stub } @Override public void enterIfamt_address(Ifamt_addressContext ctx) { // TODO Auto-generated method stub } @Override public void enterIfamt_filter(Ifamt_filterContext ctx) { assert Boolean.TRUE; } @Override public void enterIfamt_no_redirects(Ifamt_no_redirectsContext ctx) { // TODO Auto-generated method stub } @Override public void enterIt_apply_groups(It_apply_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void enterIt_description(It_descriptionContext ctx) { // TODO Auto-generated method stub } @Override public void enterIt_disable(It_disableContext ctx) { // TODO Auto-generated method stub } @Override public void enterIt_mtu(It_mtuContext ctx) { // TODO Auto-generated method stub } @Override public void enterIt_null(It_nullContext ctx) { // TODO Auto-generated method stub } @Override public void enterIt_unit(It_unitContext ctx) { // TODO Auto-generated method stub } @Override public void enterIt_unit_header(It_unit_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterIt_unit_tail(It_unit_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterIt_vlan_tagging(It_vlan_taggingContext ctx) { // TODO Auto-generated method stub } @Override public void enterMet_metric(Met_metricContext ctx) { // TODO Auto-generated method stub } @Override public void enterMet_metric2(Met_metric2Context ctx) { // TODO Auto-generated method stub } @Override public void enterMetrict_constant(Metrict_constantContext ctx) { // TODO Auto-generated method stub } @Override public void enterMetrict_expression(Metrict_expressionContext ctx) { // TODO Auto-generated method stub } @Override public void enterMetrict_expression_tail(Metrict_expression_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterMfamt_filter(Mfamt_filterContext ctx) { // TODO Auto-generated method stub } @Override public void enterMfamt_maximum_labels(Mfamt_maximum_labelsContext ctx) { // TODO Auto-generated method stub } @Override public void enterPe_conjunction(Pe_conjunctionContext ctx) { // TODO Auto-generated method stub } @Override public void enterPe_disjunction(Pe_disjunctionContext ctx) { // TODO Auto-generated method stub } @Override public void enterPe_nested(Pe_nestedContext ctx) { // TODO Auto-generated method stub } @Override public void enterPlt_apply_path(Plt_apply_pathContext ctx) { // TODO Auto-generated method stub } @Override public void enterPlt_network(Plt_networkContext ctx) { // TODO Auto-generated method stub } @Override public void enterPlt_network6(Plt_network6Context ctx) { // TODO Auto-generated method stub } @Override public void enterPolicy_expression(Policy_expressionContext ctx) { // TODO Auto-generated method stub } @Override public void enterPort(PortContext ctx) { // TODO Auto-generated method stub } @Override public void enterPot_as_path(Pot_as_pathContext ctx) { // TODO Auto-generated method stub } @Override public void enterPot_as_path_header(Pot_as_path_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterPot_as_path_tail(Pot_as_path_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterPot_community(Pot_communityContext ctx) { // TODO Auto-generated method stub } @Override public void enterPot_community_header(Pot_community_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterPot_community_tail(Pot_community_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterPot_policy_statement(Pot_policy_statementContext ctx) { // TODO Auto-generated method stub } @Override public void enterPot_policy_statement_header( Pot_policy_statement_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterPot_policy_statement_tail( Pot_policy_statement_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterPot_prefix_list(Pot_prefix_listContext ctx) { // TODO Auto-generated method stub } @Override public void enterPot_prefix_list_header(Pot_prefix_list_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterPot_prefix_list_tail(Pot_prefix_list_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterPrefix_length_range(Prefix_length_rangeContext ctx) { // TODO Auto-generated method stub } @Override public void enterProtocol(ProtocolContext ctx) { // TODO Auto-generated method stub } @Override public void enterPst_always_compare_med(Pst_always_compare_medContext ctx) { // TODO Auto-generated method stub } @Override public void enterPst_term(Pst_termContext ctx) { // TODO Auto-generated method stub } @Override public void enterPst_term_header(Pst_term_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterPst_term_tail(Pst_term_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterRange(RangeContext ctx) { // TODO Auto-generated method stub } @Override public void enterRft_exact(Rft_exactContext ctx) { // TODO Auto-generated method stub } @Override public void enterRft_orlonger(Rft_orlongerContext ctx) { // TODO Auto-generated method stub } @Override public void enterRft_prefix_length_range(Rft_prefix_length_rangeContext ctx) { // TODO Auto-generated method stub } @Override public void enterRft_upto(Rft_uptoContext ctx) { // TODO Auto-generated method stub } @Override public void enterRgt_import_rib(Rgt_import_ribContext ctx) { // TODO Auto-generated method stub } @Override public void enterRibt_static(Ribt_staticContext ctx) { // TODO Auto-generated method stub } @Override public void enterRit_apply_groups(Rit_apply_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void enterRit_common(Rit_commonContext ctx) { // TODO Auto-generated method stub } @Override public void enterRit_named_routing_instance( Rit_named_routing_instanceContext ctx) { if (_set) { String name; if (ctx.name != null) { name = ctx.name.getText(); } else { name = ctx.WILDCARD().getText(); } _configuration = _masterConfiguration.getRoutingInstances().get(name); if (_configuration == null) { _configuration = new JuniperVendorConfiguration(); _masterConfiguration.getRoutingInstances() .put(name, _configuration); } } } @Override public void enterRit_named_routing_instance_tail( Rit_named_routing_instance_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterRit_routing_options(Rit_routing_optionsContext ctx) { // TODO Auto-generated method stub } @Override public void enterRot_aggregate(Rot_aggregateContext ctx) { // TODO Auto-generated method stub } @Override public void enterRot_autonomous_system(Rot_autonomous_systemContext ctx) { // TODO Auto-generated method stub } @Override public void enterRot_martians(Rot_martiansContext ctx) { // TODO Auto-generated method stub } @Override public void enterRot_null(Rot_nullContext ctx) { // TODO Auto-generated method stub } @Override public void enterRot_rib(Rot_ribContext ctx) { // TODO Auto-generated method stub } @Override public void enterRot_rib_groups(Rot_rib_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void enterRot_rib_groups_header(Rot_rib_groups_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterRot_rib_groups_tail(Rot_rib_groups_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterRot_rib_header(Rot_rib_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterRot_rib_tail(Rot_rib_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterRot_router_id(Rot_router_idContext ctx) { // TODO Auto-generated method stub } @Override public void enterRot_static(Rot_staticContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_apply_groups(S_apply_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_description(S_descriptionContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_firewall(S_firewallContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_firewall_tail(S_firewall_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_groups(S_groupsContext ctx) { assert Boolean.TRUE; } @Override public void enterS_groups_named(S_groups_namedContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_groups_tail(S_groups_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_interfaces(S_interfacesContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_interfaces_header(S_interfaces_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_interfaces_tail(S_interfaces_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_null(S_nullContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_policy_options(S_policy_optionsContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_policy_options_tail(S_policy_options_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_protocols(S_protocolsContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_protocols_bgp(S_protocols_bgpContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_protocols_bgp_tail(S_protocols_bgp_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_protocols_isis(S_protocols_isisContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_protocols_mpls(S_protocols_mplsContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_protocols_null(S_protocols_nullContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_protocols_ospf(S_protocols_ospfContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_protocols_tail(S_protocols_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_routing_instances(S_routing_instancesContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_routing_instances_header( S_routing_instances_headerContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_routing_instances_tail(S_routing_instances_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_routing_options(S_routing_optionsContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_routing_options_tail(S_routing_options_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_system(S_systemContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_system_tail(S_system_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterS_version(S_versionContext ctx) { // TODO Auto-generated method stub } @Override public void enterSet_line(Set_lineContext ctx) { _set = true; } @Override public void enterSet_line_tail(Set_line_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterSt_null(St_nullContext ctx) { // TODO Auto-generated method stub } @Override public void enterStatement(StatementContext ctx) { // TODO Auto-generated method stub } @Override public void enterSubrange(SubrangeContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_accept(Tht_acceptContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_as_path_prepend(Tht_as_path_prependContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_color(Tht_colorContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_color_tail(Tht_color_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_community_add(Tht_community_addContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_community_delete(Tht_community_deleteContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_community_set(Tht_community_setContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_cos_next_hop_map(Tht_cos_next_hop_mapContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_default_action_accept( Tht_default_action_acceptContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_default_action_reject( Tht_default_action_rejectContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_local_preference(Tht_local_preferenceContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_metric(Tht_metricContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_metric_tail(Tht_metric_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_next_hop(Tht_next_hopContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_next_policy(Tht_next_policyContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_next_term(Tht_next_termContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_null(Tht_nullContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_origin(Tht_originContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_reject(Tht_rejectContext ctx) { // TODO Auto-generated method stub } @Override public void enterTht_tag(Tht_tagContext ctx) { // TODO Auto-generated method stub } @Override public void enterTt_apply_groups(Tt_apply_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void enterTt_from(Tt_fromContext ctx) { // TODO Auto-generated method stub } @Override public void enterTt_from_tail(Tt_from_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterTt_then(Tt_thenContext ctx) { // TODO Auto-generated method stub } @Override public void enterTt_then_tail(Tt_then_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterUt_description(Ut_descriptionContext ctx) { // TODO Auto-generated method stub } @Override public void enterUt_family(Ut_familyContext ctx) { // TODO Auto-generated method stub } @Override public void enterUt_family_tail(Ut_family_tailContext ctx) { // TODO Auto-generated method stub } @Override public void enterUt_null(Ut_nullContext ctx) { // TODO Auto-generated method stub } @Override public void enterUt_vlan_id(Ut_vlan_idContext ctx) { // TODO Auto-generated method stub } @Override public void enterVariable(VariableContext ctx) { // TODO Auto-generated method stub } @Override public void exitBfi6t_unicast(Bfi6t_unicastContext ctx) { // TODO Auto-generated method stub } @Override public void exitBfi6t_unicast_tail(Bfi6t_unicast_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitBfi6ut_prefix_limit(Bfi6ut_prefix_limitContext ctx) { // TODO Auto-generated method stub } @Override public void exitBfit_flow(Bfit_flowContext ctx) { // TODO Auto-generated method stub } @Override public void exitBfit_unicast(Bfit_unicastContext ctx) { // TODO Auto-generated method stub } @Override public void exitBfit_unicast_tail(Bfit_unicast_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitBfiut_prefix_limit(Bfiut_prefix_limitContext ctx) { // TODO Auto-generated method stub } @Override public void exitBft_inet(Bft_inetContext ctx) { // TODO Auto-generated method stub } @Override public void exitBft_inet_tail(Bft_inet_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitBft_inet6(Bft_inet6Context ctx) { // TODO Auto-generated method stub } @Override public void exitBft_inet6_tail(Bft_inet6_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_advertise_inactive(Bt_advertise_inactiveContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_cluster(Bt_clusterContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_common(Bt_commonContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_description(Bt_descriptionContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_export(Bt_exportContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_family(Bt_familyContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_family_tail(Bt_family_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_group(Bt_groupContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_group_header(Bt_group_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_group_tail(Bt_group_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_import(Bt_importContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_local_address(Bt_local_addressContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_local_as(Bt_local_asContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_multipath(Bt_multipathContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_neighbor(Bt_neighborContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_neighbor_header(Bt_neighbor_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_neighbor_tail(Bt_neighbor_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_null(Bt_nullContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_path_selection(Bt_path_selectionContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_path_selection_tail(Bt_path_selection_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_peer_as(Bt_peer_asContext ctx) { // TODO Auto-generated method stub } @Override public void exitBt_type(Bt_typeContext ctx) { // TODO Auto-generated method stub } @Override public void exitColort_apply_groups(Colort_apply_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void exitColort_color(Colort_colorContext ctx) { // TODO Auto-generated method stub } @Override public void exitCt_members(Ct_membersContext ctx) { // TODO Auto-generated method stub } @Override public void exitDeactivate_line(Deactivate_lineContext ctx) { // TODO Auto-generated method stub } @Override public void exitDirection(DirectionContext ctx) { // TODO Auto-generated method stub } @Override public void exitEveryRule(ParserRuleContext arg0) { // TODO Auto-generated method stub } @Override public void exitFamily(FamilyContext ctx) { // TODO Auto-generated method stub } @Override public void exitFamt_inet(Famt_inetContext ctx) { // TODO Auto-generated method stub } @Override public void exitFamt_inet_tail(Famt_inet_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitFamt_inet6(Famt_inet6Context ctx) { // TODO Auto-generated method stub } @Override public void exitFamt_mpls(Famt_mplsContext ctx) { // TODO Auto-generated method stub } @Override public void exitFamt_mpls_tail(Famt_mpls_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitFilter(FilterContext ctx) { // TODO Auto-generated method stub } @Override public void exitFilter_header(Filter_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitFilter_tail(Filter_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitFlat_juniper_configuration( Flat_juniper_configurationContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_as_path(Fromt_as_pathContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_color(Fromt_colorContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_community(Fromt_communityContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_family(Fromt_familyContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_interface(Fromt_interfaceContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_policy(Fromt_policyContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_prefix_list(Fromt_prefix_listContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_protocol(Fromt_protocolContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_route_filter(Fromt_route_filterContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_route_filter_header( Fromt_route_filter_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_route_filter_tail(Fromt_route_filter_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_source_address_filter( Fromt_source_address_filterContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_source_address_filter_header( Fromt_source_address_filter_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitFromt_tag(Fromt_tagContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_address(Fwfromt_addressContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_destination_address( Fwfromt_destination_addressContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_destination_port(Fwfromt_destination_portContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_dscp(Fwfromt_dscpContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_exp(Fwfromt_expContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_icmp_code(Fwfromt_icmp_codeContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_icmp_type(Fwfromt_icmp_typeContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_next_header(Fwfromt_next_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_port(Fwfromt_portContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_prefix_list(Fwfromt_prefix_listContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_protocol(Fwfromt_protocolContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_source_address(Fwfromt_source_addressContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_source_port(Fwfromt_source_portContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_source_prefix_list( Fwfromt_source_prefix_listContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_tcp_established(Fwfromt_tcp_establishedContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwfromt_tcp_flags(Fwfromt_tcp_flagsContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwft_interface_specific(Fwft_interface_specificContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwft_term(Fwft_termContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwft_term_header(Fwft_term_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwft_term_tail(Fwft_term_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwt_family(Fwt_familyContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwt_family_header(Fwt_family_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwt_family_tail(Fwt_family_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwt_filter(Fwt_filterContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwt_filter_header(Fwt_filter_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwt_filter_tail(Fwt_filter_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwt_null(Fwt_nullContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwthent_accept(Fwthent_acceptContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwthent_discard(Fwthent_discardContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwthent_null(Fwthent_nullContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwthent_reject(Fwthent_rejectContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwtt_from(Fwtt_fromContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwtt_from_tail(Fwtt_from_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwtt_then(Fwtt_thenContext ctx) { // TODO Auto-generated method stub } @Override public void exitFwtt_then_tail(Fwtt_then_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitIcmp_code(Icmp_codeContext ctx) { // TODO Auto-generated method stub } @Override public void exitIcmp_type(Icmp_typeContext ctx) { // TODO Auto-generated method stub } @Override public void exitIfamt_address(Ifamt_addressContext ctx) { // TODO Auto-generated method stub } @Override public void exitIfamt_filter(Ifamt_filterContext ctx) { // TODO Auto-generated method stub } @Override public void exitIfamt_no_redirects(Ifamt_no_redirectsContext ctx) { // TODO Auto-generated method stub } @Override public void exitIt_apply_groups(It_apply_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void exitIt_description(It_descriptionContext ctx) { // TODO Auto-generated method stub } @Override public void exitIt_disable(It_disableContext ctx) { // TODO Auto-generated method stub } @Override public void exitIt_mtu(It_mtuContext ctx) { // TODO Auto-generated method stub } @Override public void exitIt_null(It_nullContext ctx) { // TODO Auto-generated method stub } @Override public void exitIt_unit(It_unitContext ctx) { // TODO Auto-generated method stub } @Override public void exitIt_unit_header(It_unit_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitIt_unit_tail(It_unit_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitIt_vlan_tagging(It_vlan_taggingContext ctx) { // TODO Auto-generated method stub } @Override public void exitMet_metric(Met_metricContext ctx) { // TODO Auto-generated method stub } @Override public void exitMet_metric2(Met_metric2Context ctx) { // TODO Auto-generated method stub } @Override public void exitMetrict_constant(Metrict_constantContext ctx) { // TODO Auto-generated method stub } @Override public void exitMetrict_expression(Metrict_expressionContext ctx) { // TODO Auto-generated method stub } @Override public void exitMetrict_expression_tail(Metrict_expression_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitMfamt_filter(Mfamt_filterContext ctx) { // TODO Auto-generated method stub } @Override public void exitMfamt_maximum_labels(Mfamt_maximum_labelsContext ctx) { // TODO Auto-generated method stub } @Override public void exitPe_conjunction(Pe_conjunctionContext ctx) { // TODO Auto-generated method stub } @Override public void exitPe_disjunction(Pe_disjunctionContext ctx) { // TODO Auto-generated method stub } @Override public void exitPe_nested(Pe_nestedContext ctx) { // TODO Auto-generated method stub } @Override public void exitPlt_apply_path(Plt_apply_pathContext ctx) { // TODO Auto-generated method stub } @Override public void exitPlt_network(Plt_networkContext ctx) { // TODO Auto-generated method stub } @Override public void exitPlt_network6(Plt_network6Context ctx) { // TODO Auto-generated method stub } @Override public void exitPolicy_expression(Policy_expressionContext ctx) { // TODO Auto-generated method stub } @Override public void exitPort(PortContext ctx) { // TODO Auto-generated method stub } @Override public void exitPot_as_path(Pot_as_pathContext ctx) { // TODO Auto-generated method stub } @Override public void exitPot_as_path_header(Pot_as_path_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitPot_as_path_tail(Pot_as_path_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitPot_community(Pot_communityContext ctx) { // TODO Auto-generated method stub } @Override public void exitPot_community_header(Pot_community_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitPot_community_tail(Pot_community_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitPot_policy_statement(Pot_policy_statementContext ctx) { // TODO Auto-generated method stub } @Override public void exitPot_policy_statement_header( Pot_policy_statement_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitPot_policy_statement_tail( Pot_policy_statement_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitPot_prefix_list(Pot_prefix_listContext ctx) { // TODO Auto-generated method stub } @Override public void exitPot_prefix_list_header(Pot_prefix_list_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitPot_prefix_list_tail(Pot_prefix_list_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitPrefix_length_range(Prefix_length_rangeContext ctx) { // TODO Auto-generated method stub } @Override public void exitProtocol(ProtocolContext ctx) { // TODO Auto-generated method stub } @Override public void exitPst_always_compare_med(Pst_always_compare_medContext ctx) { // TODO Auto-generated method stub } @Override public void exitPst_term(Pst_termContext ctx) { // TODO Auto-generated method stub } @Override public void exitPst_term_header(Pst_term_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitPst_term_tail(Pst_term_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitRange(RangeContext ctx) { // TODO Auto-generated method stub } @Override public void exitRft_exact(Rft_exactContext ctx) { // TODO Auto-generated method stub } @Override public void exitRft_orlonger(Rft_orlongerContext ctx) { // TODO Auto-generated method stub } @Override public void exitRft_prefix_length_range(Rft_prefix_length_rangeContext ctx) { // TODO Auto-generated method stub } @Override public void exitRft_upto(Rft_uptoContext ctx) { // TODO Auto-generated method stub } @Override public void exitRgt_import_rib(Rgt_import_ribContext ctx) { // TODO Auto-generated method stub } @Override public void exitRibt_static(Ribt_staticContext ctx) { // TODO Auto-generated method stub } @Override public void exitRit_apply_groups(Rit_apply_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void exitRit_common(Rit_commonContext ctx) { // TODO Auto-generated method stub } @Override public void exitRit_named_routing_instance( Rit_named_routing_instanceContext ctx) { _configuration = _masterConfiguration; } @Override public void exitRit_named_routing_instance_tail( Rit_named_routing_instance_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitRit_routing_options(Rit_routing_optionsContext ctx) { // TODO Auto-generated method stub } @Override public void exitRot_aggregate(Rot_aggregateContext ctx) { // TODO Auto-generated method stub } @Override public void exitRot_autonomous_system(Rot_autonomous_systemContext ctx) { // TODO Auto-generated method stub } @Override public void exitRot_martians(Rot_martiansContext ctx) { // TODO Auto-generated method stub } @Override public void exitRot_null(Rot_nullContext ctx) { // TODO Auto-generated method stub } @Override public void exitRot_rib(Rot_ribContext ctx) { // TODO Auto-generated method stub } @Override public void exitRot_rib_groups(Rot_rib_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void exitRot_rib_groups_header(Rot_rib_groups_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitRot_rib_groups_tail(Rot_rib_groups_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitRot_rib_header(Rot_rib_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitRot_rib_tail(Rot_rib_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitRot_router_id(Rot_router_idContext ctx) { // TODO Auto-generated method stub } @Override public void exitRot_static(Rot_staticContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_apply_groups(S_apply_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_description(S_descriptionContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_firewall(S_firewallContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_firewall_tail(S_firewall_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_groups(S_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_groups_named(S_groups_namedContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_groups_tail(S_groups_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_interfaces(S_interfacesContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_interfaces_header(S_interfaces_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_interfaces_tail(S_interfaces_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_null(S_nullContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_policy_options(S_policy_optionsContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_policy_options_tail(S_policy_options_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_protocols(S_protocolsContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_protocols_bgp(S_protocols_bgpContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_protocols_bgp_tail(S_protocols_bgp_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_protocols_isis(S_protocols_isisContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_protocols_mpls(S_protocols_mplsContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_protocols_null(S_protocols_nullContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_protocols_ospf(S_protocols_ospfContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_protocols_tail(S_protocols_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_routing_instances(S_routing_instancesContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_routing_instances_header( S_routing_instances_headerContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_routing_instances_tail(S_routing_instances_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_routing_options(S_routing_optionsContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_routing_options_tail(S_routing_options_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_system(S_systemContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_system_tail(S_system_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitS_version(S_versionContext ctx) { // TODO Auto-generated method stub } @Override public void exitSet_line(Set_lineContext ctx) { _set = false; } @Override public void exitSet_line_tail(Set_line_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitSt_host_name(St_host_nameContext ctx) { if (_set) { String hostname = ctx.variable().getText(); _configuration.setHostname(hostname); } } @Override public void exitSt_null(St_nullContext ctx) { // TODO Auto-generated method stub } @Override public void exitStatement(StatementContext ctx) { // TODO Auto-generated method stub } @Override public void exitSubrange(SubrangeContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_accept(Tht_acceptContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_as_path_prepend(Tht_as_path_prependContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_color(Tht_colorContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_color_tail(Tht_color_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_community_add(Tht_community_addContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_community_delete(Tht_community_deleteContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_community_set(Tht_community_setContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_cos_next_hop_map(Tht_cos_next_hop_mapContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_default_action_accept( Tht_default_action_acceptContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_default_action_reject( Tht_default_action_rejectContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_local_preference(Tht_local_preferenceContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_metric(Tht_metricContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_metric_tail(Tht_metric_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_next_hop(Tht_next_hopContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_next_policy(Tht_next_policyContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_next_term(Tht_next_termContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_null(Tht_nullContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_origin(Tht_originContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_reject(Tht_rejectContext ctx) { // TODO Auto-generated method stub } @Override public void exitTht_tag(Tht_tagContext ctx) { // TODO Auto-generated method stub } @Override public void exitTt_apply_groups(Tt_apply_groupsContext ctx) { // TODO Auto-generated method stub } @Override public void exitTt_from(Tt_fromContext ctx) { // TODO Auto-generated method stub } @Override public void exitTt_from_tail(Tt_from_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitTt_then(Tt_thenContext ctx) { // TODO Auto-generated method stub } @Override public void exitTt_then_tail(Tt_then_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitUt_description(Ut_descriptionContext ctx) { // TODO Auto-generated method stub } @Override public void exitUt_family(Ut_familyContext ctx) { // TODO Auto-generated method stub } @Override public void exitUt_family_tail(Ut_family_tailContext ctx) { // TODO Auto-generated method stub } @Override public void exitUt_null(Ut_nullContext ctx) { // TODO Auto-generated method stub } @Override public void exitUt_vlan_id(Ut_vlan_idContext ctx) { // TODO Auto-generated method stub } @Override public void exitVariable(VariableContext ctx) { // TODO Auto-generated method stub } public JuniperVendorConfiguration getConfiguration() { return _masterConfiguration; } private void todo(ParserRuleContext ctx) { todo(ctx, "Unknown"); } private void todo(ParserRuleContext ctx, String reason) { String ruleName = _parser.getParser().getRuleNames()[ctx.getRuleIndex()]; if (_rulesWithSuppressedWarnings.contains(ruleName)) { return; } String prefix = "WARNING " + (_warnings.size() + 1) + ": "; StringBuilder sb = new StringBuilder(); List<String> ruleNames = Arrays.asList(CiscoGrammar.ruleNames); String ruleStack = ctx.toString(ruleNames); sb.append(prefix + "Missing implementation for top (leftmost) parser rule in stack: '" + ruleStack + "'.\n"); sb.append(prefix + "Reason: " + reason + "\n"); sb.append(prefix + "Rule context follows:\n"); int start = ctx.start.getStartIndex(); int startLine = ctx.start.getLine(); int end = ctx.stop.getStopIndex(); String ruleText = _text.substring(start, end + 1); String[] ruleTextLines = ruleText.split("\\n"); for (int line = startLine, i = 0; i < ruleTextLines.length; line++, i++) { String contextPrefix = prefix + " line " + line + ": "; sb.append(contextPrefix + ruleTextLines[i] + "\n"); } sb.append(prefix + "Parse tree follows:\n"); String parseTreePrefix = prefix + "PARSE TREE: "; String parseTreeText = ParseTreePrettyPrinter.print(ctx, _parser); String[] parseTreeLines = parseTreeText.split("\n"); for (String parseTreeLine : parseTreeLines) { sb.append(parseTreePrefix + parseTreeLine + "\n"); } _warnings.add(sb.toString()); } @Override public void visitErrorNode(ErrorNode arg0) { // TODO Auto-generated method stub } @Override public void visitTerminal(TerminalNode arg0) { // TODO Auto-generated method stub } }
[ "arifogel@ucla.edu" ]
arifogel@ucla.edu
6ffde7a25f8934fdc1c0195738dacb8c28cda7b5
70462cef7c215e195a08afdaf6af8dbe32cba7fb
/src/main/java/com/it/epolice/agent/exception/SendFileException.java
a72d2b543f3151a39876d0c882a8f9bda72066c7
[]
no_license
wldandan/it-agent
b1eb242b948dd104f85c508012ac257d65acb62f
f2ee9827339ffa84eac09bec6d93dbc0036e84be
refs/heads/master
2021-01-22T19:49:52.690499
2014-04-04T11:55:23
2014-04-04T11:55:23
17,801,476
1
0
null
null
null
null
UTF-8
Java
false
false
213
java
package com.it.epolice.agent.exception; public class SendFileException extends Exception { private static final long serialVersionUID = -3887099323132567442L; public SendFileException(Throwable t) { } }
[ "xjtu_hfdang@163.com" ]
xjtu_hfdang@163.com
b6ac35909126418d2bde5d1ea79201304057428f
c8bdd605975cb2cf91fddc9777ff4bfbf814d7a5
/src/main/java/com/wap/musichub/dto/PlaylistDto.java
23ca7923b708f237971451d44cbbd7fa78c247ee
[ "Apache-2.0" ]
permissive
pknu-wap/Musichub
af824792ba9df0202cc65ef5ee7a152fc9fcf636
eecc2324ef484ced617ac0b8662d8b379e8938d7
refs/heads/main
2023-06-03T23:30:26.985807
2021-06-28T03:43:48
2021-06-28T03:43:48
352,877,683
0
0
Apache-2.0
2021-06-27T22:02:15
2021-03-30T05:11:57
JavaScript
UTF-8
Java
false
false
1,366
java
package com.wap.musichub.dto; import com.wap.musichub.domain.entity.PlaylistEntity; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.ToString; import java.time.LocalDateTime; // DTO : Data Transfer Object // dto는 Controller <-> Service <-> Repository 간에 필요한 데이터를 캡슐화한 데이터 전달 객체입니다. // DB에서 데이터를 얻어 Service나 Controller 등으터 보낼 때 사용하는 객체를 말한다. // // https://gmlwjd9405.github.io/2018/12/25/difference-dao-dto-entity.html @Data @NoArgsConstructor public class PlaylistDto { private Long id; private String title; private String writer; private LocalDateTime createDate; private LocalDateTime modifiedDate; public PlaylistEntity toPlaylistEntity(){ PlaylistEntity playlistEntity = PlaylistEntity.builder() .id(id) .title(title) .writer(writer) .build(); return playlistEntity; } @Builder public PlaylistDto(Long id, String title, String writer, LocalDateTime createDate, LocalDateTime modifiedDate) { this.id = id; this.title = title; this.writer = writer; this.createDate = createDate; this.modifiedDate = modifiedDate; } }
[ "yoonda5898@gmail.com" ]
yoonda5898@gmail.com
e817233d4af1c7253f7acd53f60b9e1180283185
6f356af61b6a00bbd3064882ad16f77b814edecc
/product-app/src/main/java/cn/stylefeng/guns/cloud/product/service/Impl/GunsCouponProductServiceImpl.java
c2403e6b76cb9baaca703d992c01ab6158447438
[]
no_license
xwb666666/sp_server
7ebc34b0ea991aca0786520207fedfa69ac17de2
a8ed11913586cafa80778d0e9900b55bfc540e2b
refs/heads/master
2023-06-25T07:41:48.280132
2021-05-31T01:36:03
2021-05-31T01:37:30
387,706,227
0
0
null
null
null
null
UTF-8
Java
false
false
539
java
package cn.stylefeng.guns.cloud.product.service.Impl; import cn.stylefeng.guns.cloud.product.mapper.GunsCouponProductMapper; import cn.stylefeng.guns.cloud.product.model.api.GunsCouponProduct; import cn.stylefeng.guns.cloud.product.service.GunsCouponProductService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @Service public class GunsCouponProductServiceImpl extends ServiceImpl<GunsCouponProductMapper, GunsCouponProduct> implements GunsCouponProductService { }
[ "15316314665@163.com" ]
15316314665@163.com
a241f648a0f6a91025073a370569577e0aac379a
adfc518a40bae0e7e0ef08700de231869cdc9e07
/src/main/java/zes/base/privacy/PrivacyHwpFileFilter.java
8994e33a804e68907e0158343395f7dff7555f43
[ "Apache-2.0" ]
permissive
tenbirds/OPENWORKS-3.0
49d28a2f9f9c9243b8f652de1d6bc97118956053
d9ea72589854380d7ad95a1df7e5397ad6d726a6
refs/heads/master
2020-04-10T02:49:18.841692
2018-12-07T03:40:00
2018-12-07T03:40:00
160,753,369
0
1
null
null
null
null
UTF-8
Java
false
false
1,680
java
/* * Copyright (c) 2012 ZES Inc. All rights reserved. This software is the * confidential and proprietary information of ZES Inc. You shall not disclose * such Confidential Information and shall use it only in accordance with the * terms of the license agreement you entered into with ZES Inc. * (http://www.zesinc.co.kr/) */ package zes.base.privacy; import java.io.File; import java.io.FileInputStream; /** * 한글과컴퓨터 HWP 파일(hwp 확장자)에 대한 개인정보 포함여부를 확인한다. * * <pre> * << 개정이력(Modification Information) >> * * 수정일 수정자 수정내용 * -------------- -------- ------------------------------- * * * 2013. 06. 04. 방기배 개인정보 필터링 * </pre> */ public class PrivacyHwpFileFilter extends AbstractPrivacyFilter implements PrivacyFilter { public PrivacyHwpFileFilter(File file) throws Exception { this.file = file; } /* * HWP 파일내에서 개인정보를 포함한 값이 있는지 여부를 확인 * @see * zes.base.privacy.PrivacyFilter#doFilter(java.lang.String) */ @Override public boolean doFilter() { FileInputStream fileInput = null; try { fileInput = new FileInputStream(this.file); return doPrivacyCheck(""); } catch (Exception e) { logger.error("HWP(.hwp) File search Failed", e); return false; } finally { if(fileInput != null) { try { fileInput.close(); } catch (Exception e) {} } } } }
[ "tenbirds@gmail.com" ]
tenbirds@gmail.com
387f4307ffb6c5f172671a32bdb3c1d9d7364c21
171422713ed4ab27af5d795d7e715881a5587a06
/JSP/20201105/src/aa/bb/cc/bean/Member.java
24544a56c4d3b5227d25e7560597ce968fdd319d
[]
no_license
skrua3608/20201113
b84f532e9526fba407ac2a8da003e9f93c489254
b5d9f3956a5e616f95aa7fd3935f2a77268cdd7e
refs/heads/master
2023-01-09T04:37:36.122197
2020-11-13T06:09:57
2020-11-13T06:09:57
312,485,602
0
0
null
null
null
null
UTF-8
Java
false
false
1,962
java
package aa.bb.cc.bean; public class Member { String pname; String pgender; String pid; String ppwd; String pcpwd; String paddr; String pphone; String pemail; String phobby; //alt + shift + s + r getter setter //alt + shift + s + o 생성자 //alt + shift + s + s toString 함수 생성 @Override public String toString() { return "Member [pname=" + pname + ", pgender=" + pgender + ", pid=" + pid + ", ppwd=" + ppwd + ", pcpwd=" + pcpwd + ", paddr=" + paddr + ", pphone=" + pphone + ", pemail=" + pemail + ", phobby=" + phobby + "]"; } public String getPname() { return pname; } public void setPname(String pname) { this.pname = pname; } public String getPgender() { return pgender; } public void setPgender(String pgender) { this.pgender = pgender; } public String getPid() { return pid; } public void setPid(String pid) { this.pid = pid; } public String getPpwd() { return ppwd; } public void setPpwd(String ppwd) { this.ppwd = ppwd; } public String getPcpwd() { return pcpwd; } public void setPcpwd(String pcpwd) { this.pcpwd = pcpwd; } public String getPaddr() { return paddr; } public void setPaddr(String paddr) { this.paddr = paddr; } public String getPphone() { return pphone; } public void setPphone(String pphone) { this.pphone = pphone; } public String getPemail() { return pemail; } public void setPemail(String pemail) { this.pemail = pemail; } public String getPhobby() { return phobby; } public void setPhobby(String phobby) { this.phobby = phobby; } public Member() {} public Member(String pname, String pgender, String pid, String ppwd, String pcpwd, String paddr, String pphone, String pemail, String phobby) { super(); this.pname = pname; this.pgender = pgender; this.pid = pid; this.ppwd = ppwd; this.pcpwd = pcpwd; this.paddr = paddr; this.pphone = pphone; this.pemail = pemail; this.phobby = phobby; } }
[ "skrua465@naver.com" ]
skrua465@naver.com
8e5bad9316105ffc3298fd39a8e31bee1863e8cc
b1d46d20de3352b7ab145b11374a0b32a9d53b20
/chapter15_day01/src/main/java/chapter15_day01/errorExample/CodeGroup.java
adbece1e0166a89fbd2707a90d9d7f16a1fa2a46
[]
no_license
KnewHow/studyDesignPatterns
5f6cd3561b7263b04e3c407e94cd4b84d8a4b19c
c7254b1172019494a8de9f70c2af23cb5fedba2a
refs/heads/master
2021-01-01T04:28:34.693674
2017-08-17T11:32:19
2017-08-17T11:32:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
482
java
package chapter15_day01.errorExample; public class CodeGroup extends Group { @Override public void find() { System.out.println("find code group"); } @Override public void add() { System.out.println("add some codes"); } @Override public void delete() { System.out.println("delete some codes"); } @Override public void change() { System.out.println("change some codes"); } @Override public void plan() { System.out.println("exeute listing codes"); } }
[ "=" ]
=
388ed46a380c4f6f223ef441fe021c5c9f39e36a
cd15ce2d8839bac329ee86d9701590bce28d46f2
/swf-plugin-collab/src/main/java/com/venky/swf/plugins/collab/db/model/participants/admin/CompanyRelationShip.java
c054857d478a95dd9f985637098400830d10c4f2
[ "MIT" ]
permissive
jovi-siddharth/swf-all
8b345b74004ca50137d98ce9e231b8c4dd31b350
74472348bc014f7bf76ac5c6554023901c518363
refs/heads/master
2023-07-28T00:52:39.193876
2021-08-11T10:18:32
2021-08-11T10:18:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
469
java
package com.venky.swf.plugins.collab.db.model.participants.admin; import com.venky.swf.db.annotations.column.pm.PARTICIPANT; import com.venky.swf.db.model.Model; public interface CompanyRelationShip extends Model { @PARTICIPANT public Long getCustomerId(); public void setCustomerId(Long id); public Company getCustomer(); @PARTICIPANT public Long getVendorId(); public void setVendorId(Long id); public Company getVendor(); }
[ "venkatramanm@gmail.com" ]
venkatramanm@gmail.com
c14513eab59e2bd2d31ce7021aabf9d5075511e2
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/3/3_1358ff130f0a9a1080f1bdee962f4e197e8d6285/StringUtil/3_1358ff130f0a9a1080f1bdee962f4e197e8d6285_StringUtil_t.java
b33afe10f2ee98de64e5157b650c8b4267ece52f
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,925
java
package net.pms.util; import static org.apache.commons.lang3.StringUtils.isBlank; public class StringUtil { private static final int[] MULTIPLIER = new int[] {1, 60, 3600, 24*3600}; public static final String ASS_TIME_FORMAT = "%01d:%02d:%02.2f"; public static final String SRT_TIME_FORMAT = "%02d:%02d:%02.3f"; public static final String SEC_TIME_FORMAT = "%02d:%02d:%02d"; /** * Appends "&lt;<u>tag</u> " to the StringBuilder. This is a typical HTML/DIDL/XML tag opening. * @param sb String to append the tag beginning to. * @param tag String that represents the tag */ public static void openTag(StringBuilder sb, String tag) { sb.append("&lt;"); sb.append(tag); } /** * Appends the closing symbol &gt; to the StringBuilder. This is a typical HTML/DIDL/XML tag closing. * @param sb String to append the ending character of a tag. */ public static void endTag(StringBuilder sb) { sb.append("&gt;"); } /** * Appends "&lt;/<u>tag</u>&gt;" to the StringBuilder. This is a typical closing HTML/DIDL/XML tag. * @param sb * @param tag */ public static void closeTag(StringBuilder sb, String tag) { sb.append("&lt;/"); sb.append(tag); sb.append("&gt;"); } public static void addAttribute(StringBuilder sb, String attribute, Object value) { sb.append(" "); sb.append(attribute); sb.append("=\""); sb.append(value); sb.append("\""); } public static void addXMLTagAndAttribute(StringBuilder sb, String tag, Object value) { sb.append("&lt;"); sb.append(tag); sb.append("&gt;"); sb.append(value); sb.append("&lt;/"); sb.append(tag); sb.append("&gt;"); } /** * Does basic transformations between characters and their HTML representation with ampersands. * @param s String to be encoded * @return Encoded String */ public static String encodeXML(String s) { s = s.replace("&", "&amp;"); s = s.replace("<", "&lt;"); s = s.replace(">", "&gt;"); s = s.replace("\"", "&quot;"); s = s.replace("'", "&apos;"); s = s.replace("&", "&amp;"); return s; } /** * Converts a URL string to a more canonical form * @param url String to be converted * @return Converted String. */ public static String convertURLToFileName(String url) { url = url.replace('/', '\u00b5'); url = url.replace('\\', '\u00b5'); url = url.replace(':', '\u00b5'); url = url.replace('?', '\u00b5'); url = url.replace('*', '\u00b5'); url = url.replace('|', '\u00b5'); url = url.replace('<', '\u00b5'); url = url.replace('>', '\u00b5'); return url; } /** * Parse as double, or if it's not just one number, handles {hour}:{minute}:{seconds} * * @param time * @return */ public static double convertStringToTime(String time) throws IllegalArgumentException { if (isBlank(time)) { throw new IllegalArgumentException("time String should not be blank."); } try { return Double.parseDouble(time); } catch (NumberFormatException e) { String[] arrs = time.split(":"); double value, sum = 0; for (int i = 0; i < arrs.length; i++) { String tmp = arrs[arrs.length - i - 1]; value = Double.parseDouble(tmp.replace(",",".")); sum += value * MULTIPLIER[i]; } return sum; } } /** * Converts time to string. * * @param d time in double. * @param timeFormat Format string e.g. "%02d:%02d:%02d" or use predefined constants * ASS_TIME_FORMAT, SRT_TIME_FORMAT, SEC_TIME_FORMAT. * * @return Converted String. */ public static String convertTimeToString(double d, String timeFormat) { double s = d % 60; int h = (int) (d / 3600); int m = ((int) (d / 60)) % 60; if (timeFormat.equals(SRT_TIME_FORMAT)) { return String.format(timeFormat, h, m, s).replaceAll("\\.", ","); } return String.format(timeFormat, h, m, s); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
8968ae858420820171fd867d1ae7c95c735f64ff
44ae72b0b9fbe590973cce99281a2451a107605d
/src/main/java/com/aulapabloramon/av001/SpringootAv001Application.java
4c791e23d571d2b3b4c775bae0b052922e2cf02d
[]
no_license
Cireid/Av1-Spring-Boot
968e93dc087d0ca4d552af6273fc9ed4b83195c4
6ec87285cbd44b68ce902c35569b10f481ae8a04
refs/heads/master
2021-04-15T17:09:44.505737
2018-03-22T12:20:16
2018-03-22T12:20:16
126,329,522
1
0
null
null
null
null
UTF-8
Java
false
false
332
java
package com.aulapabloramon.av001; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringootAv001Application { public static void main(String[] args) { SpringApplication.run(SpringootAv001Application.class, args); } }
[ "gabrieldieric@gmail.com" ]
gabrieldieric@gmail.com
29d066d668d76dd110477c2bd33b83061fd03614
f7da5f735de5c7bc13c7e5f00a57d9a61a35b360
/java/DeepClone.java
4886c4ce05fe402bc01cd54bcf36b5fcd2ee84b1
[]
no_license
soichisumi/YoyoLibrary
185a38523cf078935dce21e0b77a9e354b19d3fe
1ad78cf111a8945044ec55402229a9b4d05c5e3f
refs/heads/master
2021-06-21T08:47:16.105882
2017-08-16T21:41:10
2017-08-16T21:41:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,534
java
public final class DeepClone { private DeepClone(){} public static <X> X deepClone(final X input) { if (input == null) { return input; } else if (input instanceof Map<?, ?>) { return (X) deepCloneMap((Map<?, ?>) input); } else if (input instanceof Collection<?>) { return (X) deepCloneCollection((Collection<?>) input); } else if (input instanceof Object[]) { return (X) deepCloneObjectArray((Object[]) input); } else if (input.getClass().isArray()) { return (X) clonePrimitiveArray((Object) input); } return input; } private static Object clonePrimitiveArray(final Object input) { final int length = Array.getLength(input); final Object copy = Array.newInstance(input.getClass().getComponentType(), length); // deep clone not necessary, primitives are immutable System.arraycopy(input, 0, copy, 0, length); return copy; } private static <E> E[] deepCloneObjectArray(final E[] input) { final E[] clone = (E[]) Array.newInstance(input.getClass().getComponentType(), input.length); for (int i = 0; i < input.length; i++) { clone[i] = deepClone(input[i]); } return clone; } private static <E> Collection<E> deepCloneCollection(final Collection<E> input) { Collection<E> clone; // this is of course far from comprehensive. extend this as needed if (input instanceof LinkedList<?>) { clone = new LinkedList<E>(); } else if (input instanceof SortedSet<?>) { clone = new TreeSet<E>(); } else if (input instanceof Set) { clone = new HashSet<E>(); } else { clone = new ArrayList<E>(); } for (E item : input) { clone.add(deepClone(item)); } return clone; } private static <K, V> Map<K, V> deepCloneMap(final Map<K, V> map) { Map<K, V> clone; // this is of course far from comprehensive. extend this as needed if (map instanceof LinkedHashMap<?, ?>) { clone = new LinkedHashMap<K, V>(); } else if (map instanceof TreeMap<?, ?>) { clone = new TreeMap<K, V>(); } else { clone = new HashMap<K, V>(); } for (Entry<K, V> entry : map.entrySet()) { clone.put(deepClone(entry.getKey()), deepClone(entry.getValue())); } return clone; } }
[ "yoyoyousei2016@gmail.com" ]
yoyoyousei2016@gmail.com
7271289e0972be7f067ee7ee87786a5c9b417584
0b49c59dd9a3a60a1cdf3a908e00510d4953d06d
/app/src/main/java/com/example/fazlay/hackathon/ActivityFour.java
4ebf42c7a63882db0044884249889c59ba22467e
[]
no_license
monowaranjum/school-monitoring-system-care
98f7da087153fc978b1ba940202d34a8b5344f00
c7102d42babb814195acfb6ac8486f082a91f75a
refs/heads/master
2023-05-29T12:52:18.193040
2018-09-04T15:16:33
2018-09-04T15:16:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
345
java
package com.example.fazlay.hackathon; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; public class ActivityFour extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_four); } }
[ "iatahmid1117@gmail.com" ]
iatahmid1117@gmail.com
7d36c69a66a09bae50e50b63c607a8774a83d2f7
a280aa9ac69d3834dc00219e9a4ba07996dfb4dd
/regularexpress/home/weilaidb/work/app/hadoop-2.7.3-src/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/reduce/IntSumReducer.java
78906556af2561eecdd9edca2165ec38141694aa
[]
no_license
weilaidb/PythonExample
b2cc6c514816a0e1bfb7c0cbd5045cf87bd28466
798bf1bdfdf7594f528788c4df02f79f0f7827ce
refs/heads/master
2021-01-12T13:56:19.346041
2017-07-22T16:30:33
2017-07-22T16:30:33
68,925,741
4
2
null
null
null
null
UTF-8
Java
false
false
415
java
package org.apache.hadoop.mapreduce.lib.reduce; import java.io.IOException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.mapreduce.Reducer; @InterfaceAudience.Public @InterfaceStability.Stable public class IntSumReducer<Key> extends Reducer<Key,IntWritable, Key,IntWritable>
[ "weilaidb@localhost.localdomain" ]
weilaidb@localhost.localdomain
ea287904c7f75c7e0e66e9245b22a396f02869a1
f04b8d210d04d4b14acf20774dc352a92b3ec2a1
/TMP/src/main/java/com/intalio/bpms/tmpservice/UIFWServiceSkeleton.java
2195c11f462e89bb990b66b86259523659e718b2
[]
no_license
sandeepreddy602/TMP-Java
f812553c1f132bd961ff5d916753ccbbe6051b12
b2ed10acbf247122aa7de36a82b876ea6bff4bcd
refs/heads/master
2020-03-30T13:42:17.205317
2012-01-17T13:30:45
2012-01-17T13:30:45
3,197,178
1
1
null
null
null
null
UTF-8
Java
false
false
3,458
java
/** * UIFWServiceSkeleton.java * * This file was auto-generated from WSDL * by the Apache Axis2 version: 1.6.1 Built on : Aug 31, 2011 (12:22:40 CEST) */ package com.intalio.bpms.tmpservice; import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; import org.apache.axis2.AxisFault; import org.intalio.tempo.workflow.auth.AuthException; import org.intalio.tempo.workflow.tms.AccessDeniedException; import org.intalio.tempo.workflow.tms.TMSException; import org.intalio.tempo.workflow.tms.UnavailableAttachmentException; import org.intalio.tempo.workflow.tms.UnavailableTaskException; import org.intalio.tempo.workflow.tms.server.TMSConstants; import org.intalio.tempo.workflow.util.xml.InvalidInputFormatException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.intalio.bpms.dao.BpelDao; /** * UIFWServiceSkeleton java skeleton for the axisService */ public class UIFWServiceSkeleton { private Logger _log = LoggerFactory.getLogger(UIFWServiceSkeleton.class); private static final OMFactory OM_FACTORY = OMAbstractFactory.getOMFactory(); TaskManagerProcess _taskManagerProcess; /** * Auto generated method signature * * @param revokeTaskRequest * @return revokeTaskResponse */ public com.intalio.bpms.workflow.ib4p_20051115.RevokeTaskResponse revokeTask( com.intalio.bpms.workflow.ib4p_20051115.RevokeTaskRequest revokeTaskRequest) { try { _taskManagerProcess = BpelDao.getTMP(revokeTaskRequest.getTaskId()); return _taskManagerProcess.revokeTask(revokeTaskRequest); } catch (TMSException e) { _log.error(e.getMessage(), e); } return null; } /** * Auto generated method signature * * @param claimTaskRequest * @return claimTaskResponse * @throws TMSException */ public com.intalio.bpms.workflow.ib4p_20051115.ClaimTaskResponse claimTask( com.intalio.bpms.workflow.ib4p_20051115.ClaimTaskRequest claimTaskRequest) throws TMSException { _taskManagerProcess = BpelDao.getTMP(claimTaskRequest.getTaskId()); return _taskManagerProcess.claimTask(claimTaskRequest); } /** * Auto generated method signature * * @param completeTaskRequest * @return response * @throws AxisFault */ public com.intalio.bpms.workflow.ib4p_20051115.Response completeTask( com.intalio.bpms.workflow.ib4p_20051115.CompleteTaskRequest completeTaskRequest) { //TODO get this instance from the database probabaly using taskId try { _taskManagerProcess = BpelDao.getTMP(completeTaskRequest.getTaskMetaData().getTaskId()); return _taskManagerProcess.completeTask(completeTaskRequest); } catch (Exception e) { _log.error(e.getMessage(), e); } return null; } /** * Auto generated method signature * * @param skipTaskRequest * @return response0 */ public com.intalio.bpms.workflow.ib4p_20051115.Response skipTask( com.intalio.bpms.workflow.ib4p_20051115.SkipTaskRequest skipTaskRequest) { try { _taskManagerProcess = BpelDao.getTMP(skipTaskRequest.getTaskId()); return _taskManagerProcess.skipTask(skipTaskRequest); } catch (TMSException e) { _log.error(e.getMessage(), e); } return null; } }
[ "reddy602.sandeep@gmail.com" ]
reddy602.sandeep@gmail.com
7bdd8e5d6921ae50a430df978dc87be29e3ccd86
7b947f70cfdb0464c5eca96b67e9b8a821663b21
/hbr-server/src/main/java/com/oneminuut/hbr/service/HospitalService.java
24c16134cfbc840cd274f5412771484ee03c59c5
[]
no_license
niteshgarg/hbr
14fd195c63254937e322c80761d30e0a81d193d0
440ff4dbebc90719b7ed2920e0950957a8c15d5d
refs/heads/master
2021-01-10T20:06:47.530517
2015-02-24T11:23:04
2015-02-24T11:23:04
29,578,116
0
0
null
null
null
null
UTF-8
Java
false
false
904
java
package com.oneminuut.hbr.service; import java.util.Date; import java.util.List; import com.oneminuut.hbr.dao.domain.Bed; import com.oneminuut.hbr.dao.domain.BedReservation; import com.oneminuut.hbr.dao.domain.Hospital; import com.oneminuut.hbr.dao.domain.Specialism; import com.oneminuut.hbr.dto.HospitalDTO; public interface HospitalService { public List<Hospital> getAllHospitals(); public HospitalDTO getHospital(long id); public List<Bed> getBedsForUnit(long id); public List<BedReservation> getReservationsForBed(long id, Date date); public BedReservation getBedReservationForDate(long id, Date endDate, Date startDate); public void saveBedReservation(BedReservation bedReservation); public Bed getBed(long bedId); public List<Specialism> getSpecialismForHospital(long id); public Specialism getSpecialism(long id); public BedReservation getBedReservation(long id); }
[ "niteshgarg@qainfotech.com" ]
niteshgarg@qainfotech.com
560b39a20fa8c58f9bb8505862384e76d01a6434
cc953f667e11f32d4119ac827d9378ed477b7706
/backend-servers/tms-server/src/main/java/com/stosz/tms/web/ShippingController.java
0925ea1e70eb23f6c0e68a0233d2b1c6c0aea1b0
[]
no_license
ttggaa/erp
e20ed03ecf6965da95c9fc472d505ae8ef4f3902
167f5d60d085d016b08452083f172df654a7c5c5
refs/heads/master
2020-04-22T12:03:43.913915
2018-12-05T16:16:11
2018-12-05T16:16:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,880
java
package com.stosz.tms.web; import com.google.common.primitives.Ints; import com.google.errorprone.annotations.RestrictedApi; import com.stosz.plat.common.RestResult; import com.stosz.plat.common.ThreadLocalUtils; import com.stosz.plat.common.UserDto; import com.stosz.plat.web.AbstractController; import com.stosz.tms.enums.HandlerTypeEnum; import com.stosz.tms.model.Shipping; import com.stosz.tms.service.ShippingService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @RestController @RequestMapping("/tms/shipping") public class ShippingController extends AbstractController { private final Logger logger = LoggerFactory.getLogger(getClass()); @Resource private ShippingService shippingService; @RequestMapping(method = RequestMethod.GET) public RestResult selectShippingList(@RequestParam(name = "name", required = false) String name, @RequestParam(name = "page", required = true, defaultValue = "1") Integer page, @RequestParam(name = "limit", required = true, defaultValue = "10") Integer limit) { RestResult restResult = new RestResult(); restResult.setCode(RestResult.OK); int start = (page == null || page <= 0) ? 0 : (page - 1) * limit; limit = (limit == null) ? 10 : limit; Shipping shipping = new Shipping(); if (name != null) shipping.setShippingName(name); int shippingCount = shippingService.getShippingCount(shipping); restResult.setTotal(shippingCount); if (shippingCount == 0) { return restResult; } List<Shipping> shippingList = shippingService.getShippingList(name, start, limit); restResult.setDesc("查询成功"); restResult.setItem(shippingList); return restResult; } /** * 添加物流商 * @return */ @RequestMapping(method = RequestMethod.POST) public RestResult addShipping(Shipping shipping) { Assert.notNull(shipping.getShippingName(), "物流商名称不能为空!"); Assert.notNull(shipping.getShippingCode(), "物流商代码不能为空!"); UserDto user = ThreadLocalUtils.getUser(); shipping.setCreator(user.getLastName()); shipping.setCreatorId(user.getId()); RestResult restResult = new RestResult(); shippingService.addShipping(shipping); restResult.setCode(RestResult.NOTICE); restResult.setDesc("新增物流商成功"); return restResult; } /** * 修改物流商 * @return */ @RequestMapping(method = RequestMethod.PUT, value = "edit") public RestResult editShipping(@ModelAttribute Shipping shipping) { Assert.notNull(shipping.getId(), "id不能为空!"); Assert.notNull(shipping.getShippingName(), "商户名称不能为空!"); UserDto user = ThreadLocalUtils.getUser(); shipping.setModifier(user.getLastName()); shipping.setModifierId(user.getId()); shippingService.editShipping(shipping); RestResult restResult = new RestResult(); restResult.setCode(RestResult.NOTICE); restResult.setDesc("更新物流商成功"); return restResult; } /** * 获取所有的shippingCode列表 * @return */ @RequestMapping(method = RequestMethod.GET, value = "codeList") public RestResult getShippingCodeList() { HandlerTypeEnum[] values = HandlerTypeEnum.values(); List<Map<String, Object>> codeMapList = new ArrayList<>(); for (HandlerTypeEnum typeEnum : values) { if (typeEnum.isVisible()) { Map<String, Object> codeMap = new HashMap<>(); codeMap.put("code", typeEnum.code()); codeMap.put("name", typeEnum.display()); codeMapList.add(codeMap); } } RestResult restResult = new RestResult(); restResult.setCode(RestResult.OK); restResult.setItem(codeMapList); return restResult; } }
[ "714106661@qq.com" ]
714106661@qq.com
8dcaf51be6e97f6d8052fdea008fd2fae338f260
5e27bd862c7314efe1e875eb72af17d9810b7a51
/itsm-ddtalk/src/main/java/com/yum/itsm/ddtalk/busi/service/VendorInfoService.java
2abf647de0fae52685c54a393f65f2f01437671e
[]
no_license
wangshanfeng/POC
af739eb949d54084a8778620754e5891d6c59d41
4759576af43f787f8b10dc0bfc182876ccffb00b
refs/heads/master
2021-01-19T16:01:29.367210
2017-04-14T04:43:11
2017-04-14T04:43:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
288
java
package com.yum.itsm.ddtalk.busi.service; import java.util.List; import com.yum.itsm.ddtalk.busi.entity.SupProjectGroup; public interface VendorInfoService { List<SupProjectGroup> getDeptsFromDDTalk(); List<SupProjectGroup> getDeptsFromDB(); void updateSupProjectGroupInfo(); }
[ "bzhang@hpe.com" ]
bzhang@hpe.com
59d81dd50007fc8672bda8507c9ee3f11cf504a8
8f35755579c230fa76e72f7fa1f5440fbf416313
/src/soft/zzti/edu/cn/ruxuebaodian/sharesdk/PlatformGridView.java
088f0ba3b4ee8a0dfde25f89bcc452d684cc79fd
[]
no_license
skyfish97/zhao
4df120413e5b9f7903e23e834f862237643417bb
27be998574d870ef8bc3a263f03c740e4e1d6b5b
refs/heads/master
2021-01-10T04:12:55.390522
2015-11-14T10:54:10
2015-11-14T10:54:10
45,583,196
0
0
null
null
null
null
UTF-8
Java
false
false
13,773
java
/* * Offical Website:http://www.ShareSDK.cn * Support QQ: 4006852216 * Offical Wechat Account:ShareSDK (We will inform you our updated news at the first time by Wechat, if we release a new version. If you get any problem, you can also contact us with Wechat, we will reply you within 24 hours.) * * Copyright (c) 2013 ShareSDK.cn. All rights reserved. */ package soft.zzti.edu.cn.ruxuebaodian.sharesdk; import static cn.sharesdk.framework.utils.R.getBitmapRes; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import m.framework.ui.widget.viewpager.ViewPagerAdapter; import m.framework.ui.widget.viewpager.ViewPagerClassic; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Build; import android.os.Handler.Callback; import android.os.Message; import android.util.AttributeSet; import android.util.TypedValue; import android.view.Gravity; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.ImageView.ScaleType; import android.widget.LinearLayout; import android.widget.TextView; import cn.sharesdk.framework.Platform; import cn.sharesdk.framework.ShareSDK; import cn.sharesdk.framework.utils.UIHandler; /** platform logo list gridview */ public class PlatformGridView extends LinearLayout implements OnClickListener, Callback { private static final int MSG_PLATFORM_LIST_GOT = 1; // grids in each line private int LINE_PER_PAGE; // lines in each page private int COLUMN_PER_LINE; // grids in each page private int PAGE_SIZE; // grids container private ViewPagerClassic pager; // indicators private ImageView[] points; private Bitmap grayPoint; private Bitmap whitePoint; // Determine whether don't jump editpage and share directly private boolean silent; // platforms private Platform[] platformList; // data to share private HashMap<String, Object> reqData; private OnekeyShare parent; private ArrayList<CustomerLogo> customers; public PlatformGridView(Context context) { super(context); init(context); } public PlatformGridView(Context context, AttributeSet attrs) { super(context, attrs); init(context); } private void init(final Context context) { calPageSize(); setOrientation(VERTICAL); pager = new ViewPagerClassic(context); disableOverScrollMode(pager); pager.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); addView(pager); // in order to have a better UI effect, opening a thread request the list of platforms new Thread(){ public void run() { platformList = ShareSDK.getPlatformList(context); if (platformList == null) { platformList = new Platform[0]; } UIHandler.sendEmptyMessage(MSG_PLATFORM_LIST_GOT, PlatformGridView.this); } }.start(); } private void calPageSize() { float scrW = cn.sharesdk.framework.utils.R.getScreenWidth(getContext()); float scrH = cn.sharesdk.framework.utils.R.getScreenHeight(getContext()); float whR = scrW / scrH; if (whR < 0.6) { COLUMN_PER_LINE = 3; LINE_PER_PAGE = 3; } else if (whR < 0.75) { COLUMN_PER_LINE = 3; LINE_PER_PAGE = 2; } else { LINE_PER_PAGE = 1; if (whR >= 1.75) { COLUMN_PER_LINE = 6; } else if (whR >= 1.5) { COLUMN_PER_LINE = 5; } else if (whR >= 1.3) { COLUMN_PER_LINE = 4; } else { COLUMN_PER_LINE = 3; } } PAGE_SIZE = COLUMN_PER_LINE * LINE_PER_PAGE; } public boolean handleMessage(Message msg) { switch (msg.what) { case MSG_PLATFORM_LIST_GOT: { afterPlatformListGot(); } break; } return false; } // initializes the girdview of platforms public void afterPlatformListGot() { PlatformAdapter adapter = new PlatformAdapter(this); pager.setAdapter(adapter); int pageCount = 0; if (platformList != null) { int cusSize = customers == null ? 0 : customers.size(); int platSize = platformList == null ? 0 : platformList.length; int size = platSize + cusSize; pageCount = size / PAGE_SIZE; if (size % PAGE_SIZE > 0) { pageCount++; } } points = new ImageView[pageCount]; if (points.length <= 0) { return; } Context context = getContext(); LinearLayout llPoints = new LinearLayout(context); // if the total number of pages exceeds 1, we set the page indicators llPoints.setVisibility(pageCount > 1 ? View.VISIBLE: View.GONE); LayoutParams lpLl = new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lpLl.gravity = Gravity.CENTER_HORIZONTAL; llPoints.setLayoutParams(lpLl); addView(llPoints); int dp_5 = cn.sharesdk.framework.utils.R.dipToPx(context, 5); int resId = getBitmapRes(getContext(), "gray_point"); if (resId > 0) { grayPoint = BitmapFactory.decodeResource(getResources(), resId); } resId = getBitmapRes(getContext(), "white_point"); if (resId > 0) { whitePoint = BitmapFactory.decodeResource(getResources(), resId); } for (int i = 0; i < pageCount; i++) { points[i] = new ImageView(context); points[i].setScaleType(ScaleType.CENTER_INSIDE); points[i].setImageBitmap(grayPoint); LayoutParams lpIv = new LayoutParams(dp_5, dp_5); lpIv.setMargins(dp_5, dp_5, dp_5, 0); points[i].setLayoutParams(lpIv); llPoints.addView(points[i]); } int curPage = pager.getCurrentScreen(); points[curPage].setImageBitmap(whitePoint); } /** after the screen rotates, this method will be called to refresh the list of gridviews */ public void onConfigurationChanged() { int curFirst = pager.getCurrentScreen() * PAGE_SIZE; calPageSize(); int newPage = curFirst / PAGE_SIZE; removeViewAt(1); afterPlatformListGot(); pager.setCurrentScreen(newPage); } public void setData(HashMap<String, Object> data, boolean silent) { reqData = data; this.silent = silent; } /** Set the Click event of the custom icon */ public void setCustomerLogos(ArrayList<CustomerLogo> customers) { this.customers = customers; } /** Sets the callback page sharing operations */ public void setParent(OnekeyShare parent) { this.parent = parent; } public void onClick(View v) { Platform plat = (Platform) v.getTag(); if (plat != null) { if (silent) { HashMap<Platform, HashMap<String, Object>> shareData = new HashMap<Platform, HashMap<String,Object>>(); shareData.put(plat, reqData); parent.share(shareData); return; } String name = plat.getName(); reqData.put("platform", name); // EditPage don't support Wechat, google+, QQ, pinterest, short message and email, // these performs always share directly if (ShareCore.isUseClientToShare(getContext(), name)) { HashMap<Platform, HashMap<String, Object>> shareData = new HashMap<Platform, HashMap<String,Object>>(); shareData.put(plat, reqData); parent.share(shareData); return; } // jump in editpage to share EditPage page = new EditPage(); page.setShareData(reqData); page.setParent(parent); if ("true".equals(String.valueOf(reqData.get("dialogMode")))) { page.setDialogMode(); } page.show(parent.getContext(), null); parent.finish(); } } // Disable the flashing effect when viewpages sliding to left/right edge private void disableOverScrollMode(View view) { if (Build.VERSION.SDK_INT < 9) { return; } try { Method m = View.class.getMethod("setOverScrollMode", new Class[] { Integer.TYPE }); m.setAccessible(true); m.invoke(view, new Object[] { Integer.valueOf(2) }); } catch (Throwable t) { t.printStackTrace(); } } /** gridview adapter */ private static class PlatformAdapter extends ViewPagerAdapter { private GridView[] girds; private List<Object> logos; private OnClickListener callback; private int lines; private PlatformGridView platformGridView; public PlatformAdapter(PlatformGridView platformGridView) { this.platformGridView = platformGridView; logos = new ArrayList<Object>(); Platform[] platforms = platformGridView.platformList; if (platforms != null) { logos.addAll(Arrays.asList(platforms)); } ArrayList<CustomerLogo> customers = platformGridView.customers; if (customers != null) { logos.addAll(customers); } this.callback = platformGridView; girds = null; if (logos != null) { int size = logos.size(); int PAGE_SIZE = platformGridView.PAGE_SIZE; int pageCount = size / PAGE_SIZE; if (size % PAGE_SIZE > 0) { pageCount++; } girds = new GridView[pageCount]; } } public int getCount() { return girds == null ? 0 : girds.length; } public View getView(int position, ViewGroup parent) { if (girds[position] == null) { int pageSize = platformGridView.PAGE_SIZE; int curSize = pageSize * position; int listSize = logos == null ? 0 : logos.size(); if (curSize + pageSize > listSize) { pageSize = listSize - curSize; } Object[] gridBean = new Object[pageSize]; for (int i = 0; i < pageSize; i++) { gridBean[i] = logos.get(curSize + i); } if (position == 0) { int COLUMN_PER_LINE = platformGridView.COLUMN_PER_LINE; lines = gridBean.length / COLUMN_PER_LINE; if (gridBean.length % COLUMN_PER_LINE > 0) { lines++; } } girds[position] = new GridView(this); girds[position].setData(lines, gridBean); } return girds[position]; } /** This method will be called after sliding the gridview */ public void onScreenChange(int currentScreen, int lastScreen) { ImageView[] points = platformGridView.points; for (int i = 0; i < points.length; i++) { points[i].setImageBitmap(platformGridView.grayPoint); } points[currentScreen].setImageBitmap(platformGridView.whitePoint); } } /** a simple gridview */ private static class GridView extends LinearLayout { private Object[] beans; private OnClickListener callback; private int lines; private PlatformAdapter platformAdapter; public GridView(PlatformAdapter platformAdapter) { super(platformAdapter.platformGridView.getContext()); this.platformAdapter = platformAdapter; this.callback = platformAdapter.callback; } public void setData(int lines, Object[] beans) { this.lines = lines; this.beans = beans; init(); } private void init() { int dp_5 = cn.sharesdk.framework.utils.R.dipToPx(getContext(), 5); setPadding(0, dp_5, 0, dp_5); setOrientation(VERTICAL); int size = beans == null ? 0 : beans.length; int COLUMN_PER_LINE = platformAdapter.platformGridView.COLUMN_PER_LINE; int lineSize = size / COLUMN_PER_LINE; if (size % COLUMN_PER_LINE > 0) { lineSize++; } LayoutParams lp = new LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); lp.weight = 1; for (int i = 0; i < lines; i++) { LinearLayout llLine = new LinearLayout(getContext()); llLine.setLayoutParams(lp); llLine.setPadding(dp_5, 0, dp_5, 0); addView(llLine); if (i >= lineSize) { continue; } for (int j = 0; j < COLUMN_PER_LINE; j++) { final int index = i * COLUMN_PER_LINE + j; if (index >= size) { LinearLayout llItem = new LinearLayout(getContext()); llItem.setLayoutParams(lp); llLine.addView(llItem); continue; } final LinearLayout llItem = getView(index, callback, getContext()); llItem.setTag(beans[index]); llItem.setLayoutParams(lp); llLine.addView(llItem); } } } private LinearLayout getView(int position, OnClickListener ocL, Context context) { Bitmap logo; String label; OnClickListener listener; if (beans[position] instanceof Platform) { logo = getIcon((Platform) beans[position]); label = getName((Platform) beans[position]); listener = ocL; } else { logo = ((CustomerLogo) beans[position]).logo; label = ((CustomerLogo) beans[position]).label; listener = ((CustomerLogo) beans[position]).listener; } LinearLayout ll = new LinearLayout(context); ll.setOrientation(LinearLayout.VERTICAL); ImageView iv = new ImageView(context); int dp_5 = cn.sharesdk.framework.utils.R.dipToPx(context, 5); iv.setPadding(dp_5, dp_5, dp_5, dp_5); iv.setScaleType(ScaleType.CENTER_INSIDE); LayoutParams lpIv = new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lpIv.setMargins(dp_5, dp_5, dp_5, dp_5); lpIv.gravity = Gravity.CENTER_HORIZONTAL; iv.setLayoutParams(lpIv); iv.setImageBitmap(logo); ll.addView(iv); TextView tv = new TextView(context); tv.setTextColor(0xffffffff); tv.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); tv.setSingleLine(); tv.setIncludeFontPadding(false); LayoutParams lpTv = new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lpTv.gravity = Gravity.CENTER_HORIZONTAL; lpTv.weight = 1; lpTv.setMargins(dp_5, 0, dp_5, dp_5); tv.setLayoutParams(lpTv); tv.setText(label); ll.addView(tv); ll.setOnClickListener(listener); return ll; } private Bitmap getIcon(Platform plat) { if (plat == null) { return null; } String name = plat.getName(); if (name == null) { return null; } String resName = "logo_" + plat.getName(); int resId = getBitmapRes(getContext(), resName); return BitmapFactory.decodeResource(getResources(), resId); } private String getName(Platform plat) { if (plat == null) { return ""; } String name = plat.getName(); if (name == null) { return ""; } int resId = cn.sharesdk.framework.utils.R.getStringRes(getContext(), plat.getName()); return getContext().getString(resId); } } }
[ "2294357961@qq.com" ]
2294357961@qq.com
51078795b40a7b41acf3ae196d7b417a88efaf1d
4e92957390893fb9fb36dc5ac8f903d9d21a593e
/src/main/java/br/com/kolin/automattor/exception/NoResultsForSearchException.java
8d96e95749b934dcdeab862db2b77462c6bcf728
[]
no_license
VitorMarques/automattor
9071d63512687bd06be12a8fdd4ce3bab8ac5954
268c5671a0aed5bfea140206d195d638036f2f4f
refs/heads/master
2022-06-08T14:28:25.410876
2020-05-09T02:39:26
2020-05-09T02:39:26
184,304,783
0
0
null
null
null
null
UTF-8
Java
false
false
338
java
package br.com.kolin.automattor.exception; public class NoResultsForSearchException extends RuntimeException { private static final long serialVersionUID = -7280209225723855022L; public NoResultsForSearchException() { } public NoResultsForSearchException(String message) { super(message); } }
[ "vitormarques.sa@gmail.com" ]
vitormarques.sa@gmail.com
5f744a6c7b86d3646cc020274c63120a566ec110
03285ea7ca33a873a398252be050cb811bbe4515
/src/test/java/br/inforsystem/web/rest/errors/ExceptionTranslatorIntTest.java
630e73e928960ef760e97868d5df43ffd900856d
[]
no_license
feelipecb10/inforSystem
297ad83fbcb5efaf52c7967ba00c385c8b059bd9
f5c41ea4909cd5dd5404d54cacbc9d1659aa53a2
refs/heads/master
2022-12-23T18:27:56.749869
2020-09-26T17:00:19
2020-09-26T17:00:19
298,853,428
0
0
null
null
null
null
UTF-8
Java
false
false
6,495
java
package br.inforsystem.web.rest.errors; import br.inforsystem.InforsystemApp; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.zalando.problem.spring.web.advice.MediaTypes; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** * Test class for the ExceptionTranslator controller advice. * * @see ExceptionTranslator */ @RunWith(SpringRunner.class) @SpringBootTest(classes = InforsystemApp.class) public class ExceptionTranslatorIntTest { @Autowired private ExceptionTranslatorTestController controller; @Autowired private ExceptionTranslator exceptionTranslator; @Autowired private MappingJackson2HttpMessageConverter jacksonMessageConverter; private MockMvc mockMvc; @Before public void setup() { mockMvc = MockMvcBuilders.standaloneSetup(controller) .setControllerAdvice(exceptionTranslator) .setMessageConverters(jacksonMessageConverter) .build(); } @Test public void testConcurrencyFailure() throws Exception { mockMvc.perform(get("/test/concurrency-failure")) .andExpect(status().isConflict()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_CONCURRENCY_FAILURE)); } @Test public void testMethodArgumentNotValid() throws Exception { mockMvc.perform(post("/test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION)) .andExpect(jsonPath("$.fieldErrors.[0].objectName").value("testDTO")) .andExpect(jsonPath("$.fieldErrors.[0].field").value("test")) .andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull")); } @Test public void testParameterizedError() throws Exception { mockMvc.perform(get("/test/parameterized-error")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("test parameterized error")) .andExpect(jsonPath("$.params.param0").value("param0_value")) .andExpect(jsonPath("$.params.param1").value("param1_value")); } @Test public void testParameterizedError2() throws Exception { mockMvc.perform(get("/test/parameterized-error2")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("test parameterized error")) .andExpect(jsonPath("$.params.foo").value("foo_value")) .andExpect(jsonPath("$.params.bar").value("bar_value")); } @Test public void testMissingServletRequestPartException() throws Exception { mockMvc.perform(get("/test/missing-servlet-request-part")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.400")); } @Test public void testMissingServletRequestParameterException() throws Exception { mockMvc.perform(get("/test/missing-servlet-request-parameter")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.400")); } @Test public void testAccessDenied() throws Exception { mockMvc.perform(get("/test/access-denied")) .andExpect(status().isForbidden()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.403")) .andExpect(jsonPath("$.detail").value("test access denied!")); } @Test public void testUnauthorized() throws Exception { mockMvc.perform(get("/test/unauthorized")) .andExpect(status().isUnauthorized()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.401")) .andExpect(jsonPath("$.path").value("/test/unauthorized")) .andExpect(jsonPath("$.detail").value("test authentication failed!")); } @Test public void testMethodNotSupported() throws Exception { mockMvc.perform(post("/test/access-denied")) .andExpect(status().isMethodNotAllowed()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.405")) .andExpect(jsonPath("$.detail").value("Request method 'POST' not supported")); } @Test public void testExceptionWithResponseStatus() throws Exception { mockMvc.perform(get("/test/response-status")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.400")) .andExpect(jsonPath("$.title").value("test response status")); } @Test public void testInternalServerError() throws Exception { mockMvc.perform(get("/test/internal-server-error")) .andExpect(status().isInternalServerError()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.500")) .andExpect(jsonPath("$.title").value("Internal Server Error")); } }
[ "feelipecb10@gmail.com" ]
feelipecb10@gmail.com
89ea3d0a03c9a86807fa92879b5b39ed1e2ff335
0e1295ec79b1e1cfc81c8221c72d20c6b4614103
/demo-mybatis/src/main/java/com/demo/repository/BlogRepository.java
9cfaf5be806f02eb699fae8137d403fe0d1c0657
[]
no_license
maikec/demo
bbacc9531b82da53ab9b0e950babf2856fb40190
8e1978fcbabd1c604d3cb1a6b482263b9093d19f
refs/heads/master
2022-07-13T13:06:57.609792
2019-11-27T16:07:16
2019-11-27T16:07:16
218,920,370
0
0
null
2022-06-21T02:11:15
2019-11-01T05:40:50
Java
UTF-8
Java
false
false
1,633
java
package com.demo.repository; import com.demo.annotation.Column; import com.demo.mapper.BaseMapper; import com.demo.mapper.BlogMapper; import com.demo.po.Blog; import lombok.NoArgsConstructor; import lombok.Setter; import org.apache.ibatis.jdbc.SQL; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.type.Alias; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; /** * 说明 * @author maikec * @date 2019/11/8 */ @NoArgsConstructor public class BlogRepository<PO extends Blog> implements BlogMapper<Blog>, BaseMapper { @Setter private SqlSessionFactory sqlSessionFactory; public BlogRepository(SqlSessionFactory sqlSessionFactory){ this.sqlSessionFactory = sqlSessionFactory; } @Override public Blog selectBlogById(Integer id) { return sqlSessionFactory.openSession(true) .getMapper(BlogMapper.class).selectBlogById(id); } @Override public Blog selectBlog(Integer id) { return null; } @Override public Integer insertBlog(Blog blog) { return null; } @Override public Integer insertBlogWithoutId(Blog blog) { return null; } @Override public Integer deleteBlog(Integer id) { return null; } @Override public Integer insertBlog() { return null; } public String insert(){ return new SQL().INSERT_INTO("blog") .VALUES("name","name") .VALUES("type","1").toString(); } }
[ "a6259272" ]
a6259272
f5772786874543cc76dac01a16c056f6c087681a
3920d17adf2315b60bd106818f437a96ac902a08
/src/siddhant/Whileloop.java
165a3f1b0f31e34de92550c3d6401a80fadc222d
[]
no_license
gaurav-4uk/JAVATechnoMar2021
882f4925f2a27f11698ef8a5a8c7b9b5e01a792b
6bb08f38a6212bed883a746be8290c171b40e717
refs/heads/main
2023-05-16T22:32:43.176457
2021-06-05T17:16:49
2021-06-05T17:16:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,021
java
package siddhant; public class Whileloop{ int start; int end; void Evennumbers(int a){ end = a; start = 10; while(start<=a){ if(start%2==0){ System.out.println("\n The even numbers are : " +start); } start++; } } void Divisiblefive(int b){ end = b; start = 10; while(start<=b){ if(start%5==0){ System.out.println("\n The numbers divisible by 5 are : " +start); } start++; } } void Fivethree(int c){ end = c; start = 5; while(start<=c){ if(start%5== 0 && start%3 == 0){ System.out.println("\n The numbers divisible by five and three are : " +start); } start++; } } void Seventhirteen(int d){ end = d; start = 5; while(start<=d){ if(start%7==0 || start%13==0){ System.out.println("\n The numbers divisible by seven or thirteen are : " +start); } start++; } } public static void main(String[]args){ Whileloop wp = new Whileloop(); wp.Evennumbers(15); wp.Divisiblefive(30); wp.Fivethree(18); wp.Seventhirteen(40); } }
[ "siddhu.dixit212@gmail.com" ]
siddhu.dixit212@gmail.com
99a49469c2c3e7b2358a4e9707d940c8b1724959
839cb9b2e8aef1e238dce09412432d2805b96948
/src/main/java/com/lotzy/sample/ws/HomeController.java
d3f54e0cb426d482f2258fc8e020cbbed41d6f58
[]
no_license
sac10nikam/springboot-oidc-openam
2254f243221033c1ff74a56d6bff581ee2e1d0a3
252a0f04039eadddde6e1c550f3838b8911c728a
refs/heads/master
2021-02-14T12:42:09.753785
2019-07-09T10:32:04
2019-07-09T10:32:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
922
java
package com.lotzy.sample.ws; import java.security.Principal; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; /** * <pre> * Title: HomeController class * Description: RestController implementation * </pre> * * @author Lotzy * @version 1.0 */ @RestController public class HomeController { /** * Simple REST method without params * @return String representing the greeting */ @RequestMapping(value="/greet", method=RequestMethod.GET) public ResponseEntity<String> greet() { String greeting = "Hello world!"; return new ResponseEntity<String>(greeting, HttpStatus.OK); } @RequestMapping("/user") public Principal user(Principal principal) { return principal; } }
[ "mr.lotzy@gmail.com" ]
mr.lotzy@gmail.com
6da190ac770061d42890d53ec45e334a22daa467
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdas/applicationModule/src/main/java/applicationModulepackageJava18/Foo25.java
80249dbd5d70074a78ea4e8d631f1c3bc94d3583
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
346
java
package applicationModulepackageJava18; public class Foo25 { public void foo0() { new applicationModulepackageJava18.Foo24().foo5(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
e411decdaaa183f91bbdaf89b7b94ace05bbc31f
439bb1562cf3f1adeabdc94172c585e2dec2e524
/src/org/jivesoftware/smackx/jingle/ContentNegotiator.java
a358cd400831ea7b09589669f38da8d9771317b7
[ "Apache-2.0" ]
permissive
prashant31191/walachat
20521aaa87ba0e9a472a1299f482c076e7dfd381
8fb8e3a9c078a7641c5c9d186a266092ef1bf0b8
refs/heads/master
2021-01-24T05:19:44.728997
2013-10-12T03:00:26
2013-10-12T03:00:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,842
java
package org.jivesoftware.smackx.jingle; import java.util.ArrayList; import java.util.List; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smackx.jingle.listeners.JingleListener; import org.jivesoftware.smackx.jingle.listeners.JingleSessionListener; import org.jivesoftware.smackx.jingle.media.JingleMediaManager; import org.jivesoftware.smackx.jingle.media.JingleMediaSession; import org.jivesoftware.smackx.jingle.media.MediaNegotiator; import org.jivesoftware.smackx.jingle.media.PayloadType; import org.jivesoftware.smackx.jingle.nat.JingleTransportManager; import org.jivesoftware.smackx.jingle.nat.TransportCandidate; import org.jivesoftware.smackx.jingle.nat.TransportNegotiator; import org.jivesoftware.smackx.packet.Jingle; import org.jivesoftware.smackx.packet.JingleContent; /** * @author Jeff Williams */ public class ContentNegotiator extends JingleNegotiator { public static final String INITIATOR = "initiator"; public static final String RESPONDER = "responder"; private final List<TransportNegotiator> transportNegotiators; private MediaNegotiator mediaNeg; // The description... private TransportNegotiator transNeg; // and transport negotiators private JingleTransportManager jingleTransportManager; private final String creator; private final String name; private JingleMediaSession jingleMediaSession = null; public ContentNegotiator(JingleSession session, String inCreator, String inName) { super(session); creator = inCreator; name = inName; transportNegotiators = new ArrayList<TransportNegotiator>(); } public void addTransportNegotiator(TransportNegotiator transportNegotiator) { transportNegotiators.add(transportNegotiator); } /** * Prepare to close the media manager. */ @Override public void close() { destroyMediaNegotiator(); destroyTransportNegotiator(); } /** * Destroy the jmf negotiator. */ protected void destroyMediaNegotiator() { if (mediaNeg != null) { mediaNeg.close(); mediaNeg = null; } } /** * Destroy the transport negotiator. */ protected void destroyTransportNegotiator() { if (transNeg != null) { transNeg.close(); transNeg = null; } } @Override public List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException { final List<IQ> responses = new ArrayList<IQ>(); // First only process IQ packets that contain <content> stanzas that // match this media manager. if (iq != null) { if (iq.getType().equals(IQ.Type.ERROR)) { // Process errors // TODO getState().eventError(iq); } else if (iq.getType().equals(IQ.Type.RESULT)) { // Process ACKs if (isExpectedId(iq.getPacketID())) { removeExpectedId(iq.getPacketID()); } } else if (iq instanceof Jingle) { final Jingle jingle = (Jingle) iq; // There are 1 or more <content> sections in a Jingle packet. // Find out which <content> section belongs to this content // negotiator, and // then dispatch the Jingle packet to the media and transport // negotiators. for (final JingleContent jingleContent : jingle .getContentsList()) { if (jingleContent.getName().equals(name)) { if (mediaNeg != null) { responses.addAll(mediaNeg.dispatchIncomingPacket( iq, id)); } if (transNeg != null) { responses.addAll(transNeg.dispatchIncomingPacket( iq, id)); } } } } } return responses; } /** * Called from above when starting a new session. */ @Override protected void doStart() { final JingleContent result = new JingleContent(creator, name); // result.setDescription(mediaNeg.start()); // result.addJingleTransport(transNeg.start()); // // return result; mediaNeg.start(); transNeg.start(); } public String getCreator() { return creator; } public JingleContent getJingleContent() { final JingleContent result = new JingleContent(creator, name); // PayloadType.Audio bestCommonAudioPt = // getMediaNegotiator().getBestCommonAudioPt(); // TransportCandidate bestRemoteCandidate = // getTransportNegotiator().getBestRemoteCandidate(); // // // Ok, send a packet saying that we accept this session // // with the audio payload type and the transport // // candidate // result.setDescription(new JingleDescription.Audio(new // PayloadType(bestCommonAudioPt))); // result.addJingleTransport(this.getTransportNegotiator().getJingleTransport(bestRemoteCandidate)); if (mediaNeg != null) { result.setDescription(mediaNeg.getJingleDescription()); } if (transNeg != null) { result.addJingleTransport(transNeg.getJingleTransport()); } return result; } /** * Get the JingleMediaSession of this Jingle Session * * @return the JingleMediaSession */ public JingleMediaSession getJingleMediaSession() { return jingleMediaSession; } /** * Obtain the description negotiator for this session * * @return the description negotiator */ public MediaNegotiator getMediaNegotiator() { return mediaNeg; } public String getName() { return name; } /** * The negotiator state for the ContentNegotiators is a special case. It is * a roll-up of the sub-negotiator states. */ @Override public JingleNegotiatorState getNegotiatorState() { JingleNegotiatorState result = JingleNegotiatorState.PENDING; if ((mediaNeg != null) && (transNeg != null)) { if ((mediaNeg.getNegotiatorState() == JingleNegotiatorState.SUCCEEDED) || (transNeg.getNegotiatorState() == JingleNegotiatorState.SUCCEEDED)) { result = JingleNegotiatorState.SUCCEEDED; } if ((mediaNeg.getNegotiatorState() == JingleNegotiatorState.FAILED) || (transNeg.getNegotiatorState() == JingleNegotiatorState.FAILED)) { result = JingleNegotiatorState.FAILED; } } // Store the state (to make it easier to know when debugging.) setNegotiatorState(result); return result; } /** * @return */ public JingleTransportManager getTransportManager() { return jingleTransportManager; } /** * Obtain the transport negotiator for this session. * * @return the transport negotiator instance */ public TransportNegotiator getTransportNegotiator() { return transNeg; } /** * Return true if the transport and content negotiators have finished */ public boolean isFullyEstablished() { boolean result = true; final MediaNegotiator mediaNeg = getMediaNegotiator(); if ((mediaNeg == null) || (!mediaNeg.isFullyEstablished())) { result = false; } final TransportNegotiator transNeg = getTransportNegotiator(); if ((transNeg == null) || (!transNeg.isFullyEstablished())) { result = false; } return result; } /** * @param jingleTransportManager */ public void setJingleTransportManager( JingleTransportManager jingleTransportManager) { this.jingleTransportManager = jingleTransportManager; } /** * Set the jmf negotiator. * * @param mediaNeg * the description negotiator to set */ protected void setMediaNegotiator(MediaNegotiator mediaNeg) { destroyMediaNegotiator(); this.mediaNeg = mediaNeg; } /** * Set TransportNegociator * * @param transNeg * the transNeg to set */ protected void setTransportNegotiator(TransportNegotiator transNeg) { destroyTransportNegotiator(); this.transNeg = transNeg; } /** * Stop a Jingle media session. */ public void stopJingleMediaSession() { if (jingleMediaSession != null) { jingleMediaSession.stopTrasmit(); jingleMediaSession.stopReceive(); } } public void triggerContentEstablished() { final PayloadType bestCommonAudioPt = getMediaNegotiator() .getBestCommonAudioPt(); final TransportCandidate bestRemoteCandidate = getTransportNegotiator() .getBestRemoteCandidate(); final TransportCandidate acceptedLocalCandidate = getTransportNegotiator() .getAcceptedLocalCandidate(); // Trigger the session established flag triggerContentEstablished(bestCommonAudioPt, bestRemoteCandidate, acceptedLocalCandidate); } /** * Trigger a session established event. */ private void triggerContentEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc) { // Let the session know that we've established a content/media segment. final JingleSession session = getSession(); if (session != null) { final List<JingleListener> listeners = session.getListenersList(); for (final JingleListener li : listeners) { if (li instanceof JingleSessionListener) { final JingleSessionListener sli = (JingleSessionListener) li; sli.sessionEstablished(pt, rc, lc, session); } } } // Create a media session for each media manager in the session. if (mediaNeg.getMediaManager() != null) { rc.removeCandidateEcho(); lc.removeCandidateEcho(); jingleMediaSession = getMediaNegotiator().getMediaManager() .createMediaSession(pt, rc, lc, session); jingleMediaSession.addMediaReceivedListener(session); if (jingleMediaSession != null) { jingleMediaSession.startTrasmit(); jingleMediaSession.startReceive(); for (final TransportCandidate candidate : getTransportNegotiator() .getOfferedCandidates()) { candidate.removeCandidateEcho(); } } final JingleMediaManager mediaManager = getMediaNegotiator() .getMediaManager(); getSession().addJingleMediaSession(mediaManager.getName(), jingleMediaSession); } } }
[ "wlanjie888@gmail.com" ]
wlanjie888@gmail.com
0a89075ff24c4583f376e51a21bb479825c441b6
a88404e860f9e81f175d80c51b8e735fa499c93c
/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/SidType.java
8d15d54fbbb352a7ed921464d103e2996f2dc6e3
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
sabri0/hapi-fhir
4a53409d31b7f40afe088aa0ee8b946860b8372d
c7798fee4880ee8ffc9ed2e42c29c3b8f6753a1c
refs/heads/master
2020-06-07T20:02:33.258075
2019-06-18T09:40:00
2019-06-18T09:40:00
193,081,738
2
0
Apache-2.0
2019-06-21T10:46:17
2019-06-21T10:46:17
null
UTF-8
Java
false
false
1,734
java
/* Copyright (c) 2011+, HL7, Inc All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of HL7 nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.hl7.fhir.instance.model; public class SidType extends UriType { private static final long serialVersionUID = 5486832330986493589L; public String fhirType() { return "sid"; } }
[ "jamesagnew@gmail.com" ]
jamesagnew@gmail.com
7e61aa39c3e22f957d7c549073848f8453523074
8f7b1695ad256cffb22094ed62ec398f27c624b8
/src/main/java/com/techshard/graphql/service/OwnerVehicleService.java
b26b8fe77d9c5ebab7f01b1824d8cc22c6a07432
[ "MIT" ]
permissive
lawrencegrey/GraphQLCRUDImplementation
85cad2995b7a5c3200b0e238fbb6b88d530bca9b
081ebb9c2e6d0277d2e94da09662d9f1e3d3a5ce
refs/heads/master
2022-12-11T17:15:20.169875
2020-08-30T18:29:52
2020-08-30T18:29:52
291,526,170
0
0
null
null
null
null
UTF-8
Java
false
false
1,962
java
package com.techshard.graphql.service; import com.techshard.graphql.dao.entity.OwnerVehicle; import com.techshard.graphql.dao.repository.OwnerVehicleRepository; import org.springframework.boot.autoconfigure.data.web.SpringDataWebProperties.Sort; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; @Service public class OwnerVehicleService { private final OwnerVehicleRepository ownerVehicleRepository ; public OwnerVehicleService( final OwnerVehicleRepository ownerRepository ) { this.ownerVehicleRepository = ownerRepository ; } @Transactional public OwnerVehicle createOwnerVehicle(final int vehicleId, final int nameId) { final OwnerVehicle OwnerVehicle = new OwnerVehicle(); OwnerVehicle.setOwnerId(nameId); OwnerVehicle.setVehicleId(vehicleId); return this.ownerVehicleRepository.save(OwnerVehicle); } @Transactional public OwnerVehicle deleteOwnerVehicle(final int id) { OwnerVehicle ownervehicle = this.ownerVehicleRepository.findOwnerVehicleById(id); this.ownerVehicleRepository.delete(ownervehicle); return ownervehicle; } @Transactional(readOnly = true) public List<OwnerVehicle> getAllOwnerVehicles() { return this.ownerVehicleRepository.findAll().stream().collect(Collectors.toList()); } @Transactional(readOnly = true) public List<OwnerVehicle> getVehicleByOwner(final int ownerid) { return this.ownerVehicleRepository.findByOwnerIdOrderByVehicleBrandNameAsc(ownerid).stream().collect(Collectors.toList()); } @Transactional(readOnly = true) public Optional<OwnerVehicle> getOwnerVehicle(final int id) { return this.ownerVehicleRepository.findById(id); } }
[ "lawrencegrey.0125@gmail.com" ]
lawrencegrey.0125@gmail.com
276d524f40084dd37ba918f28ead0c7b327f93a0
70c510f9fc12429dab2b0d09ecc6fcee1ef497f9
/src/main/java/de/blau/android/easyedit/LongClickActionModeCallback.java
f8fbd8b034a5b764662c8bb3a1bbd8a12c3ce55f
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
johnjohndoe/osmeditor4android
e57130e7867a64a98de1c19e30bf7d44c1f855ab
e67144ed96b83c3b139f2576080f648e60d62a24
refs/heads/master
2021-12-21T14:33:02.563987
2021-12-03T12:24:39
2021-12-03T12:24:39
32,481,956
0
0
null
null
null
null
UTF-8
Java
false
false
18,978
java
package de.blau.android.easyedit; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.TreeMap; import android.content.Intent; import android.location.LocationManager; import android.speech.RecognizerIntent; import android.util.Log; import android.view.ContextMenu; import android.view.Menu; import android.view.MenuItem; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.view.ActionMode; import de.blau.android.App; import de.blau.android.Logic; import de.blau.android.Main; import de.blau.android.R; import de.blau.android.address.Address; import de.blau.android.dialogs.GnssPositionInfo; import de.blau.android.exception.OsmIllegalOperationException; import de.blau.android.nsi.Names.NameAndTags; import de.blau.android.osm.Node; import de.blau.android.osm.OsmElement; import de.blau.android.osm.OsmElement.ElementType; import de.blau.android.osm.Result; import de.blau.android.osm.StorageDelegator; import de.blau.android.osm.Tags; import de.blau.android.osm.Way; import de.blau.android.prefs.Preferences; import de.blau.android.presets.Preset; import de.blau.android.presets.Preset.PresetElement; import de.blau.android.presets.Preset.PresetItem; import de.blau.android.presets.PresetFixedField; import de.blau.android.tasks.NoteFragment; import de.blau.android.util.ElementSearch; import de.blau.android.util.IntCoordinates; import de.blau.android.util.SearchIndexUtils; import de.blau.android.util.Snack; import de.blau.android.util.ThemeUtils; import de.blau.android.util.Util; import de.blau.android.voice.Commands; public class LongClickActionModeCallback extends EasyEditActionModeCallback implements android.view.MenuItem.OnMenuItemClickListener { private static final String DEBUG_TAG = "LongClickActionMode..."; private static final int MENUITEM_OSB = 1; private static final int MENUITEM_NEWNODEWAY = 2; private static final int MENUITEM_SPLITWAY = 3; private static final int MENUITEM_PASTE = 4; private static final int MENUITEM_NEWNODE_GPS = 5; private static final int MENUITEM_NEWNODE_ADDRESS = 6; private static final int MENUITEM_NEWNODE_PRESET = 7; private static final int MENUITEM_NEWNODE_VOICE = 9; private float startX; private float startY; private int startLon; private int startLat; private float x; private float y; private List<OsmElement> clickedNodes; private List<Way> clickedNonClosedWays; /** * Construct a callback for when a long click has occurred * * @param manager the EasyEditManager instance * @param x screen x coordinate * @param y screen y coordinate */ public LongClickActionModeCallback(EasyEditManager manager, float x, float y) { super(manager); this.x = x; this.y = y; clickedNodes = logic.getClickedNodes(x, y); clickedNonClosedWays = logic.getClickedWays(false, x, y); // } @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { helpTopic = R.string.help_longclick; super.onCreateActionMode(mode, menu); mode.setTitle(R.string.menu_add); mode.setSubtitle(null); // show crosshairs logic.showCrosshairs(x, y); startX = x; startY = y; startLon = logic.xToLonE7(x); startLat = logic.yToLatE7(y); return true; } @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { menu = replaceMenu(menu, mode, this); super.onPrepareActionMode(mode, menu); menu.clear(); menuUtil.reset(); Preferences prefs = new Preferences(main); if (prefs.voiceCommandsEnabled()) { menu.add(Menu.NONE, MENUITEM_NEWNODE_VOICE, Menu.NONE, R.string.menu_voice_commands).setIcon(ThemeUtils.getResIdFromAttribute(main, R.attr.mic)) .setEnabled(main.isConnectedOrConnecting()); } menu.add(Menu.NONE, MENUITEM_NEWNODE_ADDRESS, Menu.NONE, R.string.tag_menu_address) .setIcon(ThemeUtils.getResIdFromAttribute(main, R.attr.menu_address)); menu.add(Menu.NONE, MENUITEM_NEWNODE_PRESET, Menu.NONE, R.string.tag_menu_preset).setIcon(ThemeUtils.getResIdFromAttribute(main, R.attr.menu_preset)); menu.add(Menu.NONE, MENUITEM_OSB, Menu.NONE, R.string.openstreetbug_new_bug).setIcon(ThemeUtils.getResIdFromAttribute(main, R.attr.menu_bug)); if ((clickedNonClosedWays != null && !clickedNonClosedWays.isEmpty()) && (clickedNodes == null || clickedNodes.isEmpty())) { menu.add(Menu.NONE, MENUITEM_SPLITWAY, Menu.NONE, R.string.menu_split).setIcon(ThemeUtils.getResIdFromAttribute(main, R.attr.menu_split)); } menu.add(Menu.NONE, MENUITEM_NEWNODEWAY, Menu.NONE, R.string.openstreetbug_new_nodeway) .setIcon(ThemeUtils.getResIdFromAttribute(main, R.attr.menu_append)); if (!logic.clipboardIsEmpty()) { menu.add(Menu.NONE, MENUITEM_PASTE, Menu.NONE, R.string.menu_paste).setIcon(ThemeUtils.getResIdFromAttribute(main, R.attr.menu_paste)); } // check if GPS is enabled if (((LocationManager) main.getSystemService(android.content.Context.LOCATION_SERVICE)).isProviderEnabled(LocationManager.GPS_PROVIDER)) { menu.add(Menu.NONE, MENUITEM_NEWNODE_GPS, Menu.NONE, R.string.menu_newnode_gps).setIcon(ThemeUtils.getResIdFromAttribute(main, R.attr.menu_gps)); } menu.add(GROUP_BASE, MENUITEM_HELP, Menu.CATEGORY_SYSTEM | 10, R.string.menu_help).setIcon(ThemeUtils.getResIdFromAttribute(main, R.attr.menu_help)); arrangeMenu(menu); return true; } /** * if we get a short click go to path creation mode */ @Override public boolean handleClick(float x, float y) { PathCreationActionModeCallback pcamc = new PathCreationActionModeCallback(manager, logic.lonE7ToX(startLon), logic.latE7ToY(startLat)); main.startSupportActionMode(pcamc); pcamc.handleClick(x, y); logic.hideCrosshairs(); return true; } @Override public boolean onCreateContextMenu(ContextMenu menu) { if (clickedNonClosedWays != null && !clickedNonClosedWays.isEmpty()) { menu.setHeaderTitle(R.string.split_context_title); int id = 0; menu.add(Menu.NONE, id++, Menu.NONE, R.string.split_all_ways).setOnMenuItemClickListener(this); for (Way w : clickedNonClosedWays) { menu.add(Menu.NONE, id++, Menu.NONE, w.getDescription(main)).setOnMenuItemClickListener(this); } return true; } return false; } @Override public boolean onMenuItemClick(MenuItem item) { int itemId = item.getItemId(); final List<Way> ways = new ArrayList<>(); if (itemId == 0) { ways.addAll(clickedNonClosedWays); } else { ways.add(clickedNonClosedWays.get(itemId - 1)); } try { Node splitPosition = logic.performAddOnWay(main, ways, startX, startY, false); if (splitPosition != null) { splitSafe(ways, () -> { for (Way way : ways) { if (way.hasNode(splitPosition)) { List<Result> result = logic.performSplit(main, way, logic.getSelectedNode()); checkSplitResult(way, result); } } manager.finish(); }); } } catch (OsmIllegalOperationException e) { Snack.barError(main, e.getLocalizedMessage()); Log.d(DEBUG_TAG, "Caught exception " + e); manager.finish(); } return false; } @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { super.onActionItemClicked(mode, item); switch (item.getItemId()) { case MENUITEM_OSB: mode.finish(); de.blau.android.layer.tasks.MapOverlay layer = main.getMap().getTaskLayer(); if (layer == null) { Snack.toastTopError(main, R.string.toast_task_layer_disabled); } else { NoteFragment.showDialog(main, logic.makeNewNote(x, y)); logic.hideCrosshairs(); } return true; case MENUITEM_NEWNODEWAY: main.startSupportActionMode(new PathCreationActionModeCallback(manager, x, y)); logic.hideCrosshairs(); return true; case MENUITEM_SPLITWAY: if (clickedNonClosedWays.size() > 1) { manager.showContextMenu(); } else { Way way = clickedNonClosedWays.get(0); try { List<Way> ways = Util.wrapInList(way); Node node = logic.performAddOnWay(main, ways, startX, startY, false); if (node != null) { splitSafe(ways, () -> { List<Result> result = logic.performSplit(main, way, node); checkSplitResult(way, result); manager.finish(); }); } } catch (OsmIllegalOperationException e) { Snack.barError(main, e.getLocalizedMessage()); Log.d(DEBUG_TAG, "Caught exception " + e); manager.finish(); } } return true; case MENUITEM_NEWNODE_ADDRESS: case MENUITEM_NEWNODE_PRESET: logic.hideCrosshairs(); try { logic.setSelectedNode(null); logic.performAdd(main, x, y); } catch (OsmIllegalOperationException e1) { Snack.barError(main, e1.getLocalizedMessage()); Log.d(DEBUG_TAG, "Caught exception " + e1); } Node lastSelectedNode = logic.getSelectedNode(); if (lastSelectedNode != null) { main.startSupportActionMode(new NodeSelectionActionModeCallback(manager, lastSelectedNode)); // show preset screen or add addresses main.performTagEdit(lastSelectedNode, null, item.getItemId() == MENUITEM_NEWNODE_ADDRESS, item.getItemId() == MENUITEM_NEWNODE_PRESET); } return true; case MENUITEM_PASTE: List<OsmElement> elements = App.getLogic().pasteFromClipboard(main, x, y); logic.hideCrosshairs(); if (elements != null && !elements.isEmpty()) { if (elements.size() > 1) { manager.finish(); App.getLogic().setSelection(elements); manager.editElements(); } else { manager.editElement(elements.get(0)); } } else { manager.finish(); } return true; case MENUITEM_NEWNODE_GPS: logic.hideCrosshairs(); logic.setSelectedNode(null); GnssPositionInfo.showDialog(main, main.getTracker()); return true; case MENUITEM_NEWNODE_VOICE: logic.hideCrosshairs(); logic.setSelectedNode(null); Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); try { main.startActivityForResult(intent, Main.VOICE_RECOGNITION_REQUEST_CODE); } catch (Exception ex) { Log.d(DEBUG_TAG, "Caught exception " + ex); Snack.barError(main, R.string.toast_no_voice_recognition); logic.showCrosshairs(startX, startY); } return true; default: Log.e(DEBUG_TAG, "Unknown menu item"); break; } return false; } /** * Path creation action mode is ending */ @Override public void onDestroyActionMode(ActionMode mode) { logic.setSelectedNode(null); super.onDestroyActionMode(mode); } /** * Handle the result from starting an activity via an Intent * * This is currently only used for experimental voice commands * * FIXME This is still very hackish with lots of code duplication * * @param requestCode the Intent request code * @param resultCode the Intent result code * @param data any Intent data */ void handleActivityResult(final int requestCode, final int resultCode, final Intent data) { if (requestCode == Main.VOICE_RECOGNITION_REQUEST_CODE) { ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS); // StorageDelegator storageDelegator = App.getDelegator(); for (String v : matches) { String[] words = v.split("\\s+", 2); if (words.length > 0) { // String first = words[0]; try { int number = Integer.parseInt(first); // worked if there is a further word(s) simply add it/them Snack.barInfoShort(main, +number + (words.length == 2 ? words[1] : "")); Node node = logic.performAddNode(main, startLon, startLat); if (node != null) { Map<String, String> tags = new TreeMap<>(node.getTags()); tags.put(Tags.KEY_ADDR_HOUSENUMBER, Integer.toString(number) + (words.length == 3 ? words[2] : "")); tags.put(Commands.SOURCE_ORIGINAL_TEXT, v); Map<String, List<String>> map = Address.predictAddressTags(main, Node.NAME, node.getOsmId(), new ElementSearch(new IntCoordinates(node.getLon(), node.getLat()), true), Util.getListMap(tags), Address.NO_HYSTERESIS); tags = Address.multiValueToSingle(map); logic.setTags(main, node, tags); main.startSupportActionMode(new NodeSelectionActionModeCallback(manager, node)); return; } } catch (NumberFormatException ex) { // ok wasn't a number, just ignore } catch (OsmIllegalOperationException e) { // FIXME something went seriously wrong Log.e(DEBUG_TAG, "handleActivityResult got exception " + e.getMessage()); } List<PresetElement> presetItems = SearchIndexUtils.searchInPresets(main, first, ElementType.NODE, 2, 1, null); if (presetItems != null && presetItems.size() == 1) { Node node = addNode(logic.performAddNode(main, startLon, startLat), words.length == 2 ? words[1] : null, (PresetItem) presetItems.get(0), logic, v); if (node != null) { main.startSupportActionMode(new NodeSelectionActionModeCallback(manager, node)); return; } } // search in names NameAndTags nt = SearchIndexUtils.searchInNames(main, v, 2); if (nt != null) { HashMap<String, String> map = new HashMap<>(); map.putAll(nt.getTags()); PresetItem pi = Preset.findBestMatch(App.getCurrentPresets(main), map, null); if (pi != null) { Node node = addNode(logic.performAddNode(main, startLon, startLat), nt.getName(), pi, logic, v); if (node != null) { // set tags from name suggestions Map<String, String> tags = new TreeMap<>(node.getTags()); for (Entry<String, String> entry : map.entrySet()) { tags.put(entry.getKey(), entry.getValue()); } storageDelegator.setTags(node, tags); // note doesn't create a new undo checkpoint, // performAddNode has already done that main.startSupportActionMode(new NodeSelectionActionModeCallback(manager, node)); return; } } } } } logic.showCrosshairs(startX, startY); // re-show the cross hairs nothing found/something went wrong } } /** * Add a Node using a PresetItem and select it * * @param node an existing Node * @param name a name or null * @param pi the PresetITem * @param logic the current instance of Logic * @param original the source string used to create the Node * @return the Node or null */ @Nullable Node addNode(@NonNull Node node, @Nullable String name, @NonNull PresetItem pi, @NonNull Logic logic, @NonNull String original) { try { Snack.barInfo(main, pi.getName() + (name != null ? " name: " + name : "")); TreeMap<String, String> tags = new TreeMap<>(node.getTags()); for (Entry<String, PresetFixedField> tag : pi.getFixedTags().entrySet()) { PresetFixedField field = tag.getValue(); tags.put(tag.getKey(), field.getValue().getValue()); } if (name != null) { tags.put(Tags.KEY_NAME, name); } tags.put(Commands.SOURCE_ORIGINAL_TEXT, original); logic.setTags(main, node, tags); logic.setSelectedNode(node); return node; } catch (OsmIllegalOperationException e) { Log.e(DEBUG_TAG, "addNode got exception " + e.getMessage()); Snack.barError(main, e.getLocalizedMessage()); return null; } } @Override public boolean processShortcut(Character c) { if (c == Util.getShortCut(main, R.string.shortcut_paste)) { logic.pasteFromClipboard(main, startX, startY); logic.hideCrosshairs(); manager.finish(); return true; } return false; } }
[ "simon@poole.ch" ]
simon@poole.ch
42d12d331cb75e11f120baf685fb10dfbecefd18
7e2896f96796fd0328f31964d7073a1d891d49e4
/spring-test/src/main/java/com/moheqionglin/aop/warnning4/CustomAop.java
d7a75f20cb27b20bbdab68b6ed73a68dd44e6175
[]
no_license
moheqionglin/spring-demo
bfc48f24396d9f83714a179e951eab0562ff1621
e1a0cc05bc807b2ba92d28498a2f5231c652165c
refs/heads/master
2023-03-18T15:53:41.406310
2022-04-27T15:57:41
2022-04-27T15:57:41
138,487,811
6
1
null
2023-03-08T17:33:45
2018-06-24T14:17:22
Java
UTF-8
Java
false
false
778
java
package com.moheqionglin.aop.warnning4; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; /** * @author wanli.zhou * @description * @time 12/12/2018 9:15 PM */ @Aspect @Component public class CustomAop { private Logger log = LoggerFactory.getLogger(this.getClass()); @Around("execution(* com.moheqionglin.aop.warnning4.biz.*.*(..))") public Object process(ProceedingJoinPoint joinPoint) throws Throwable { log.info(">> AOP before method "); Object proceed = joinPoint.proceed(); log.info(">> AOP After method "); return proceed; } }
[ "" ]
62e04fd3d7a530a613bcb6b3b36a7c0ca2ff80b3
3ec45313838c78fb175d16ba05c6a9140a790c9b
/Scratch/XSLTTestClient/src/de/tudresden/inf/rn/mobilis/xslttest/client/proxy/impl/XSLTTestDistributer.java
4030d2440850fc75901fd6275b91d2156785c505
[]
no_license
pschwede/sporteventanalyser
bb4546f1e7f62acc4ea0f43781aea64f62bd09c5
594782dfa28d1ec9300792245c282206d2601842
refs/heads/master
2021-01-23T07:35:02.532986
2013-08-14T17:41:52
2013-08-14T17:41:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,043
java
package de.tudresden.inf.rn.mobilis.xslttest.client.proxy.impl; import java.util.concurrent.ConcurrentHashMap; import org.jivesoftware.smack.XMPPConnection; import de.tudresden.inf.rn.mobilis.xmpp.beans.XMPPBean; import de.tudresden.inf.rn.mobilis.xslttest.client.proxy.IXMPPCallback; import de.tudresden.inf.rn.mobilis.xslttest.client.proxy.IXSLTTestOutgoing; import de.tudresden.inf.rn.mobilis.xslttest.client.proxy.xmpp.BeanIQAdapter; import de.tudresden.inf.rn.mobilis.xslttest.client.proxy.xmpp.BeanProviderAdapter; public abstract class XSLTTestDistributer implements IXSLTTestOutgoing { /** * The <code>XMPPConnection</code> which is used to send/receive IQs */ protected XMPPConnection connection; /** * The <code>HashMap</code> which is used to store the awaiting callbacks */ private ConcurrentHashMap<String, IXMPPCallback<? extends XMPPBean>> _awaitingCallbacks = new ConcurrentHashMap<String, IXMPPCallback<? extends XMPPBean>>(); @Override public void sendXMPPBean(XMPPBean out, IXMPPCallback<? extends XMPPBean> callback) { // Put callback into _awaitingCallbacks _awaitingCallbacks.put(out.getId(), callback); // Send Bean sendXMPPBean(out); } @Override public void sendXMPPBean(XMPPBean out) { // Check if connected if (connection.isConnected()) { // Set From-JID out.setFrom(connection.getUser()); // Finally send connection.sendPacket(new BeanIQAdapter(out)); } } /** * Register an XMPPBean as prototype * * @param prototype * a basic instance of the XMPPBean */ protected void registerXMPPBean(XMPPBean prototype) { // add XMPPBean to service provider to enable it in XMPP (new BeanProviderAdapter(prototype)).addToProviderManager(); } /** * Connect to XMPP-Server * * @param server * @param port * @param service * @return */ public abstract boolean connect(String server, int port, String service); /** * Try to login into XMPP-Server and update presence * * @param username * @param password * @param ressource * @param toJID * @param distributer * @return */ public abstract boolean performLogin(String username, String password, String ressource, String toJID); /** * Disconnect from XMPP-Server */ public abstract void disconnect(); /** * Retrieves the <code>IXMPPCallback</code> which is linked to this * packetID. This method will return null, if there does not exist an * <code>IXMPPCallback</code> for this packetID. * * @param packetID * the packetID whose <code>IXMPPCallback</code> should be * returned * @return the registered <code>IXMPPCallback</code> for this packetID or * <code>null</code> if there is no <code>IXMPPCallback</code> * registered */ public IXMPPCallback<? extends XMPPBean> releaseAwaitingCallback( String packetID) { return _awaitingCallbacks.remove(packetID); } /** * Register all XMBBBeans labeled as XMPP extensions */ protected abstract void registerXMPPExtensions(); }
[ "patrick.tempel@live.de" ]
patrick.tempel@live.de
1d9a548c1b039ccfc2eb9793c048bab733a4e2dd
f61e496b07dd44479dc68e6fe6fcb0c0029c76f5
/GameJavaFX/src/main/java/models/JsonMessageGameData.java
d07e30d60f69239eba9b2102bc2bd2402056d420
[ "MIT" ]
permissive
MarselAhmetov/ITIS-2c
fe9798557449abe0a8b3ea9842c67ffa8126806e
c1e9f9ddd0c88a74e91acd64c284635064d7b597
refs/heads/master
2023-04-28T04:30:33.607835
2020-06-15T19:25:34
2020-06-15T19:25:34
227,993,092
0
0
MIT
2023-04-17T19:48:18
2019-12-14T08:51:14
Java
UTF-8
Java
false
false
618
java
package models; import models.gameModels.GameData; public class JsonMessageGameData { private String header; private GameData payload; public JsonMessageGameData() { } public JsonMessageGameData(String header, GameData payload) { this.header = header; this.payload = payload; } public String getHeader() { return header; } public void setHeader(String header) { this.header = header; } public GameData getPayload() { return payload; } public void setPayload(GameData payload) { this.payload = payload; } }
[ "marsel5027@gmail.com" ]
marsel5027@gmail.com
26c32744597d0c807ccf2ffca106d258359f1a11
b157a3f73bf10aa46cbfe29a6aa77c66c31cd5f4
/medical_beauty/src/main/java/com/meirengu/medical/vo/BrandVo.java
dc15bfdf20afc369db6067544570f4f727dd13e2
[]
no_license
JasonZhangSx/meirengu
dd53faa9e5a06f03e561c23b5806d9104e9e0bab
bf06289a1f3b3645db320b7b68dd6299e3a391ab
refs/heads/master
2021-01-19T18:46:43.082074
2017-08-21T04:22:04
2017-08-21T04:22:04
101,160,314
0
0
null
null
null
null
UTF-8
Java
false
false
791
java
package com.meirengu.medical.vo; import com.meirengu.medical.model.Brand; /** * Author: haoyang.Yu * Create Date: 2017/1/10 14:28. * 品牌表扩展类 */ public class BrandVo extends Brand { //起始位置 private int pageStart; //结束位置 private int pageEnd; public int getPageStart() { return pageStart; } public void setPageStart(int pageStart) { this.pageStart = pageStart; } public int getPageEnd() { return pageEnd; } public void setPageEnd(int pageEnd) { this.pageEnd = pageEnd; } @Override public String toString() { return "BrandVo{" + "pageStart=" + pageStart + ", pageEnd=" + pageEnd + "} " + super.toString(); } }
[ "15011331617@163.com" ]
15011331617@163.com
af7bf048c155fff50510c82f0bf846ece1d43608
d4d41a80c51c74d9cb42867e2d99919cb89bc18c
/src/main/java/fr/jayrex/hub/command/HCMD.java
9a359cfca835eca43c0151924871f20b5c3c21db
[]
no_license
HugoDu3/Hub
207fe19106b6e2b38046a9e6c5667d1531bdd171
642a1c2db2cfbcae97c1b369e199a2315ce8fb1f
refs/heads/main
2023-01-24T13:28:54.266379
2020-12-05T16:46:42
2020-12-05T16:46:42
318,838,854
0
0
null
null
null
null
UTF-8
Java
false
false
1,168
java
package fr.jayrex.hub; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.plugin.Command; public class HCMD extends Command { public HCMD() { super("rh", "hub.admin", new String[] { "hub" }); } @SuppressWarnings("deprecation") public void execute(CommandSender sender, String[] args) { ProxiedPlayer p = (ProxiedPlayer)sender; if (args.length == 0) { p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cUsage> /hub reload")); } else if (args.length == 1) { if (args[0].equalsIgnoreCase("reload")) { Main.getInstance().saveConfig(); Main.getInstance().loadConfig(); p.sendMessage( ChatColor.translateAlternateColorCodes('&', "&cReload du fichier config.yml avec succès!")); } else { p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cUtilisation> /hub reload")); } } else { p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cUtilisation> /hub reload")); } } }
[ "benkhalil100@yahoo.ca" ]
benkhalil100@yahoo.ca
2874e09169931436e07467ce1b824c4cecf353cf
ae18108bf30ddbf4c6ebbdb798a9b24059ce237f
/Assignment-TicketReservation/src/main/java/com/bluemapletach/app/model/UserDetails.java
1400f25f17d6ea1372c916e816209bfc6b94b869
[]
no_license
santhoshmohanrk/AppleGroup-Santhosh-Spring-JEE-
9c3134e24578f142fbcbba45c58cb11579a87554
a3228b05a20e56f0e2bb29e41cd1238a6bd9c992
refs/heads/master
2021-01-18T02:42:00.979078
2015-12-23T04:38:14
2015-12-23T04:38:14
46,985,137
0
0
null
2015-11-27T14:44:39
2015-11-27T14:44:38
null
UTF-8
Java
false
false
3,021
java
package com.bluemapletach.app.model; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class UserDetails { private int userid; private String username; private String password; private String email; private String firstname; private String lastname; private String address; private String createdby; private String updateby; private int roleid = 1; private int roleid1; public int getUserid() { return userid; } public void setUserid(int userid) { this.userid = userid; } public int getRoleid1() { return roleid1; } public void setRoleid1(int roleid1) { this.roleid1 = roleid1; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getFirstname() { return firstname; } public void setFirstname(String firstname) { this.firstname = firstname; } public String getLastname() { return lastname; } public void setLastname(String lastname) { this.lastname = lastname; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getCreatedby() { return createdby; } public void setCreatedby(String createdby) { this.createdby = createdby; } public String getUpdateby() { return updateby; } public void setUpdateby(String updateby) { this.updateby = updateby; } public int getRoleid() { return roleid; } public void setRoleid(int roleid) { this.roleid = roleid; } public Date getToday() { return today; } public void setToday(Date today) { this.today = today; } public SimpleDateFormat getFormatter() { return formatter; } public void setFormatter(SimpleDateFormat formatter) { this.formatter = formatter; } Date today = Calendar.getInstance().getTime(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-hh.mm.ss"); private String date = formatter.format(today); public String getDate() { return date; } public void setDate(String date) { this.date = date; } private String msg; public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } @Override public String toString() { return "UserDetails [userid=" + userid + ", username=" + username + ", password=" + password + ", email=" + email + ", firstname=" + firstname + ", lastname=" + lastname + ", address=" + address + ", createdby=" + createdby + ", updateby=" + updateby + ", roleid=" + roleid + ", roleid1=" + roleid1 + ", date=" + date + ", msg=" + msg + "]"; } }
[ "santhosh@bluemapletech.com" ]
santhosh@bluemapletech.com
1fdc13ebd94b1f39fd7a60d49943072baaccc176
7130e47450bd80f35c7213c88a737e639d329e6f
/wxxr-mobile-ui/src/main/java/com/wxxr/mobile/core/tx/impl/XidFactory.java
4426d21059e09ca3a2f18488589aed8783fe215f
[]
no_license
wxynick/framework
983be31104b360008a2d36565bc82d74b82804fc
93b5fe0c3e40ad434325b1755d0b1be5255977ac
refs/heads/master
2016-09-06T18:33:32.119410
2014-04-04T11:52:21
2014-04-04T11:52:21
9,125,521
0
1
null
null
null
null
UTF-8
Java
false
false
7,434
java
/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software 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 software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package com.wxxr.mobile.core.tx.impl; import java.net.InetAddress; import java.net.UnknownHostException; import com.wxxr.javax.transaction.Xid; /** * XidFactory.java * * * Created: Sat Jun 15 19:01:18 2002 * * @author <a href="mailto:d_jencks@users.sourceforge.net">David Jencks</a> * @version * * @jmx.mbean */ public class XidFactory { /** * The default value of baseGlobalId is the host name of this host, * followed by a slash. * * This is used for building globally unique transaction identifiers. * It would be safer to use the IP address, but a host name is better * for humans to read and will do for now. * This must be set individually if multiple jboss instances are * running on the same machine. */ private String baseGlobalId; /** * The next transaction id to use on this host. */ private long globalIdNumber = 0; /** * The variable <code>pad</code> says whether the byte[] should be their * maximum 64 byte length or the minimum. * The max length is required for Oracle.. */ private boolean pad = false; /** * The variable <code>noBranchQualifier</code> is the 1 or 64 byte zero * array used for initial xids. */ private byte[] noBranchQualifier = new byte[1]; // len > 0, per the XA spec /** * This field stores the byte reprsentation of baseGlobalId * to avoid the expensive getBytes() call on this String object * when we create a new Xid, which we do VERY often! */ private byte[] baseGlobalIdBytes; public XidFactory() { try { baseGlobalId = InetAddress.getLocalHost().getHostName(); // Ensure room for 14 digits of serial no. if (baseGlobalId.length() > Xid.MAXGTRIDSIZE - 15) baseGlobalId = baseGlobalId.substring(0, Xid.MAXGTRIDSIZE - 15); baseGlobalId = baseGlobalId + "/"; } catch (UnknownHostException e) { baseGlobalId = "localhost/"; } baseGlobalIdBytes = baseGlobalId.getBytes(); } /** * mbean get-set pair for field BaseGlobalId * Get the value of BaseGlobalId * @return value of BaseGlobalId * * @jmx:managed-attribute */ public String getBaseGlobalId() { return baseGlobalId; } /** * Set the value of BaseGlobalId * @param BaseGlobalId Value to assign to BaseGlobalId * * @jmx:managed-attribute */ public void setBaseGlobalId(final String baseGlobalId) { this.baseGlobalId = baseGlobalId; baseGlobalIdBytes = baseGlobalId.getBytes(); } /** * mbean get-set pair for field globalIdNumber * Get the value of globalIdNumber * @return value of globalIdNumber * * @jmx:managed-attribute */ public synchronized long getGlobalIdNumber() { return globalIdNumber; } /** * Set the value of globalIdNumber * @param globalIdNumber Value to assign to globalIdNumber * * @jmx:managed-attribute */ public synchronized void setGlobalIdNumber(final long globalIdNumber) { this.globalIdNumber = globalIdNumber; } /** * mbean get-set pair for field pad * Get the value of pad * @return value of pad * * @jmx:managed-attribute */ public boolean isPad() { return pad; } /** * Set the value of pad * @param pad Value to assign to pad * * @jmx:managed-attribute */ public void setPad(boolean pad) { this.pad = pad; if (pad) noBranchQualifier = new byte[Xid.MAXBQUALSIZE]; else noBranchQualifier = new byte[1]; // length > 0, per the XA spec } /** * mbean get-set pair for field instance * Get the value of instance * @return value of instance * * @jmx:managed-attribute */ public XidFactory getInstance() { return this; } /** * Describe <code>newXid</code> method here. * * @return a <code>XidImpl</code> value * @jmx.managed-operation */ public XidImpl newXid() { long localId = getNextId(); String id = Long.toString(localId); int len = pad?Xid.MAXGTRIDSIZE:id.length()+baseGlobalIdBytes.length; byte[] globalId = new byte[len]; System.arraycopy(baseGlobalIdBytes, 0, globalId, 0, baseGlobalIdBytes.length); // this method is deprecated, but does exactly what we need in a very fast way // the default conversion from String.getBytes() is way too expensive id.getBytes(0, id.length(), globalId, baseGlobalIdBytes.length); return new XidImpl(globalId, noBranchQualifier, (int)localId, localId); } /** * Describe <code>newBranch</code> method here. * * @param xid a <code>XidImpl</code> value * @param branchIdNum a <code>long</code> value * @return a <code>XidImpl</code> value * @jmx.managed-operation */ public XidImpl newBranch(XidImpl xid, long branchIdNum) { String id = Long.toString(branchIdNum); int len = pad?Xid.MAXBQUALSIZE:id.length(); byte[] branchId = new byte[len]; // this method is deprecated, but does exactly what we need in a very fast way // the default conversion from String.getBytes() is way too expensive id.getBytes(0, id.length(), branchId, 0); return new XidImpl(xid, branchId); } /** * Extracts the local id contained in a global id. * * @param globalId a global id * @return the local id extracted from the global id * @jmx:managed-operation */ public long extractLocalIdFrom(byte[] globalId) { int i, start; int len = globalId.length; for (i = 0; globalId[i++] != (byte)'/'; ) ; start = i; while (i < len && globalId[i] != 0) i++; String globalIdNumber = new String(globalId, 0, start, i - start); return Long.parseLong(globalIdNumber); } /** * Describe <code>toString</code> method here. * * @param xid a <code>Xid</code> value * @return a <code>String</code> value * @jmx.managed-operation */ public String toString(Xid xid) { if (xid instanceof XidImpl) return XidImpl.toString(xid); else return xid.toString(); } private synchronized long getNextId() { return ++globalIdNumber; } }
[ "" ]
ef1c8121808d47308e5b26b81d9dabef8e3725ce
1ef6b484a2274f79c83bda2f7d9460c2d52f1cec
/app/src/main/java/Controller/GestureAction.java
2ca5930d6b4db20a1d3453b75963be8090b2d880
[]
no_license
eruditesilver/HKUSTLabyrinth
64fbe1ce8dc331493fc44143b74df39072bf82c9
06e5fd2877bf22adf8a9c0f7ca98938874733e29
refs/heads/master
2021-01-21T14:01:30.220456
2016-05-21T15:17:37
2016-05-21T15:17:37
54,040,889
5
0
null
null
null
null
UTF-8
Java
false
false
179
java
package Controller; public interface GestureAction { public void onLeftSwipe(); public void onRightSwipe(); public void onDownSwipe(); public void onUpSwipe(); }
[ "sfwongac@connect.ust.hk" ]
sfwongac@connect.ust.hk
222711a5d24f41a0808f3bb0b590771d0c33e889
f6502770237add479e2fe907677ebf3f0b714c28
/src/main/java/com/echostream/orangebot/dto/telegram/ContactDto.java
9c1d479c20b9c8ed8671464b8da5bc4e002bffbb
[]
no_license
Echostream/orangebot
1923ac7410ce65280175dffe3132f5d613b9ce1e
621bcb93f067ef286fe969a71904f65c87d9674f
refs/heads/master
2022-06-26T19:36:59.151707
2020-07-02T02:49:56
2020-07-02T02:49:56
202,794,864
0
0
null
2022-06-21T01:41:13
2019-08-16T20:25:29
Java
UTF-8
Java
false
false
658
java
package com.echostream.orangebot.dto.telegram; import lombok.Data; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.NotNull; @Data public class ContactDto { @NotNull @ApiModelProperty("Contact's phone number") private String phoneNumber; @NotNull @ApiModelProperty("Contact's first name") private String firstName; @ApiModelProperty("Contact's last name") private String lastName; @ApiModelProperty("Contact's user identifier in Telegram") private Integer userId; @ApiModelProperty("Additional data about the contact in the form of a vCard") private String vcard; }
[ "haoran.wan@shihengtech.com" ]
haoran.wan@shihengtech.com
59de59442cae13838f177ef2dfdc7b00ce2f76bc
6da2c339c65ec50e396b9be0ca5adf7edd81916a
/TerrorChat/src/terrorchat/TerrorTable.java
d12a0a7d0adb58aa1c1a0b689df8fef3d302b27d
[]
no_license
41a91/FriendlyChat
59a52dc4776893ff64c61c1d39fff8e2dd8fa576
5cf00b85d33c5f3383dc425ab32b22a6fe217b42
refs/heads/master
2020-03-10T09:52:50.862080
2018-05-03T22:38:25
2018-05-03T22:38:25
129,320,657
0
0
null
null
null
null
UTF-8
Java
false
false
783
java
package terrorchat; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableCellRenderer; public class TerrorTable extends JTable{ public TerrorTable() { DefaultTableModel model = new DefaultTableModel(); this.setModel(model); String[] columnNames = {"To", "From", "Subject", "Date", "Read"}; BoldRenderer br = new BoldRenderer(); model.setColumnIdentifiers(columnNames); } @Override public TableCellRenderer getCellRenderer(int row, int col) { if(col==4) { BoldRenderer br = new BoldRenderer(); return br; } else { return super.getCellRenderer(row, col); } } }
[ "moorhem@msjmath.loc" ]
moorhem@msjmath.loc
8f3043cfe9647e6a1cdb6f2e72d0e779d54f7476
f00731f674329cad907035c34d705242b4a70e8d
/app/src/main/java/com/spoonart/kamusslang/utils/SimpleObserver.java
bbc42768b4dfa16b74b2a45b456bf720a5b1c607
[]
no_license
spoonart1/dictionary
c21eeacf8cea370ad3634cc392ea3c6a96b00811
e27cf1966aac9401169e0ca95448368b8226710c
refs/heads/master
2020-05-31T23:44:57.020293
2017-06-12T04:02:21
2017-06-12T04:02:21
94,054,100
0
0
null
null
null
null
UTF-8
Java
false
false
464
java
package com.spoonart.kamusslang.utils; import android.util.Log; import rx.Observer; import rx.observers.Observers; /** * Created by lafran on 4/14/17. */ public class SimpleObserver<T> implements Observer<T> { @Override public void onCompleted() { } @Override public void onError(Throwable e) { Log.e("Error Simple Observer: " , "MSG : "+e.getLocalizedMessage() + " | Error code: "+e.hashCode()); } @Override public void onNext(T t) { } }
[ "myveryfran@gmail.com" ]
myveryfran@gmail.com
9e279c685d7c26097542725c1ba109155ad7d4d0
29a6a4c62fb7928cc5145ffa49b337a634fe4722
/ThreadTest2/src/edu/just/syn/ThreadA1.java
03b79bd3630d50bbe73d730084ac4ded3d95018a
[]
no_license
LuWenhe/ThreadTest
b5cdd5d1722c6011c2de7f3e267a8cf811a86d2a
5d9cef87329ddd29e1c1fedd43b3217bbdbc0a92
refs/heads/master
2020-04-02T04:16:53.060198
2018-12-07T16:31:57
2018-12-07T16:31:57
154,009,361
0
0
null
null
null
null
UTF-8
Java
false
false
1,408
java
package edu.just.syn; class ThreadB1 extends Thread { private HashSelPrivateNum numRef; public ThreadB1(HashSelPrivateNum numRef) { this.numRef = numRef; } @Override public void run() { try { numRef.addI("thread b"); } catch (InterruptedException e) { e.printStackTrace(); } } } public class ThreadA1 extends Thread { private HashSelPrivateNum numRef; public ThreadA1(HashSelPrivateNum numRef) { this.numRef = numRef; } @Override public void run() { try { numRef.addI("thread a"); } catch (InterruptedException e) { e.printStackTrace(); } } /** * 多个线程访问多个对象,该实例创建了 2 个 HashSelPrivateNum 类的对象,就产生了 2 个对象锁 * 当线程 Thread A1 执行 synchronized 方法 addI(),便持有该方法所属对象 numRef1 的锁 * 此时线程 B 并不用等待,而是持有对象 numRef2 的锁。此时方法是异步执行的 * */ public static void main(String[] args) { HashSelPrivateNum numRef1 = new HashSelPrivateNum(); HashSelPrivateNum numRef2 = new HashSelPrivateNum(); ThreadA1 threadA1 = new ThreadA1(numRef1); threadA1.start(); ThreadB1 threadB1 = new ThreadB1(numRef2); threadB1.start(); } }
[ "luwenhe12345@126.com" ]
luwenhe12345@126.com
a3c40068669492157f289f39389618610ad0f82b
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/10/10_dd1c14278dd4a25a35b60c85d02818d712872b20/GML/10_dd1c14278dd4a25a35b60c85d02818d712872b20_GML_s.java
6de3c5bf2b5958be0e2fb0e133b96d44a7e55f91
[]
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
34,016
java
package org.geotools; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import javax.xml.namespace.QName; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; import net.opengis.wfs.FeatureCollectionType; import net.opengis.wfs.WfsFactory; import org.eclipse.xsd.XSDComplexTypeDefinition; import org.eclipse.xsd.XSDCompositor; import org.eclipse.xsd.XSDDerivationMethod; import org.eclipse.xsd.XSDElementDeclaration; import org.eclipse.xsd.XSDFactory; import org.eclipse.xsd.XSDForm; import org.eclipse.xsd.XSDImport; import org.eclipse.xsd.XSDModelGroup; import org.eclipse.xsd.XSDParticle; import org.eclipse.xsd.XSDSchema; import org.eclipse.xsd.XSDTypeDefinition; import org.eclipse.xsd.util.XSDConstants; import org.eclipse.xsd.util.XSDResourceImpl; import org.geotools.data.DataUtilities; import org.geotools.data.simple.SimpleFeatureCollection; import org.geotools.data.simple.SimpleFeatureIterator; import org.geotools.feature.AttributeTypeBuilder; import org.geotools.feature.DefaultFeatureCollection; import org.geotools.feature.FeatureCollections; import org.geotools.feature.NameImpl; import org.geotools.feature.simple.SimpleFeatureBuilder; import org.geotools.feature.simple.SimpleFeatureTypeBuilder; import org.geotools.feature.type.SchemaImpl; import org.geotools.gml.producer.FeatureTransformer; import org.geotools.gtxml.GTXML; import org.geotools.referencing.CRS; import org.geotools.xml.Configuration; import org.geotools.xml.Encoder; import org.geotools.xml.Parser; import org.geotools.xml.ParserDelegate; import org.geotools.xml.StreamingParser; import org.geotools.xml.XSD; import org.geotools.xml.XSDParserDelegate; import org.geotools.xs.XS; import org.geotools.xs.XSConfiguration; import org.geotools.xs.XSSchema; import org.opengis.feature.simple.SimpleFeature; import org.opengis.feature.simple.SimpleFeatureType; import org.opengis.feature.type.AttributeDescriptor; import org.opengis.feature.type.AttributeType; import org.opengis.feature.type.ComplexType; import org.opengis.feature.type.FeatureType; import org.opengis.feature.type.Name; import org.opengis.feature.type.PropertyDescriptor; import org.opengis.feature.type.Schema; import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.xml.sax.SAXException; import com.vividsolutions.jts.geom.Geometry; /** * UtilityClass for encoding GML content. * <p> * This utility class uses a range of GeoTools technologies as required; if you would like finer * grain control over the encoding process please review the source code of this class and take your * own measures. * <p> */ public class GML { /** Version of encoder to use */ public static enum Version { GML2, GML3, WFS1_0, WFS1_1 } private Charset encoding = Charset.forName("UTF-8"); private URL baseURL; /** GML Configuration to use */ private Configuration gmlConfiguration; private String gmlNamespace; private String gmlLocation; /** * Schema or profile used to map between Java classes and XML elements. */ private List<Schema> schemaList = new ArrayList<Schema>(); String prefix = null; String namespace = null; private final Version version; private boolean legacy; private CoordinateReferenceSystem crs; /** * Construct a GML utility class to work with the indicated version of GML. * <p> * Note that when working with GML2 you need to supply additional information prior to use (in * order to indicate where for XSD file is located). * * @param version * Version of GML to use */ public GML(Version version) { this.version = version; init(); } /** * Engage legacy support for GML2. * <p> * The GML2 support for FeatureTransformer is much faster then that provided by the GTXML * parser/encoder. This speed is at the expense of getting the up front configuration exactly * correct (something you can only tell when parsing the produced result!). Setting this value * to false will use the same GMLConfiguration employed when parsing and has less risk of * producing invalid content. * * @param legacy */ public void setLegacy(boolean legacy) { this.legacy = legacy; } /** * Set the target namespace for the encoding. * * @param prefix * @param namespace */ public void setNamespace(String prefix, String namespace) { this.prefix = prefix; this.namespace = namespace; } /** * Set the encoding to use. * * @param encoding */ public void setEncoding(Charset encoding) { this.encoding = encoding; } /** * Base URL to use when encoding */ public void setBaseURL(URL baseURL) { this.baseURL = baseURL; } /** * Coordinate reference system to use when decoding. * <p> * In a few cases (such as decoding a SimpleFeatureType) the file format does not include the * required CooridinateReferenceSystem and you are asked to supply it. * * @param crs */ public void setCoordinateReferenceSystem(CoordinateReferenceSystem crs) { this.crs = crs; } /** * Set up out of the box configuration for GML encoding. * <ul> * <li>GML2</li> * <li>GML3</li> * </ul> * The following are not avialable yet: * <ul> * <li>gml3.2 - not yet available</li> * <li>wfs1.0 - not yet available</li> * <li>wfs1.1 - not yet available</li> * </ul> * * @param version */ protected void init() { List<Schema> schemas = new ArrayList<Schema>(); schemas.add(new XSSchema().profile()); // encoding of common java types Schema hack = new SchemaImpl(XS.NAMESPACE); AttributeTypeBuilder builder = new AttributeTypeBuilder(); builder.setName("date"); builder.setBinding(Date.class); hack.put(new NameImpl(XS.DATETIME), builder.buildType()); schemas.add(hack); // GML 2 // if (Version.GML2 == version) { gmlNamespace = org.geotools.gml2.GML.NAMESPACE; gmlLocation = "gml/2.1.2/feature.xsd"; gmlConfiguration = new org.geotools.gml2.GMLConfiguration(); schemas.add(new org.geotools.gml2.GMLSchema().profile()); } if (Version.WFS1_0 == version) { gmlNamespace = org.geotools.gml2.GML.NAMESPACE; gmlLocation = "gml/2.1.2/feature.xsd"; gmlConfiguration = new org.geotools.wfs.v1_0.WFSConfiguration(); schemas.add(new org.geotools.gml2.GMLSchema().profile()); } // GML 3 // if (Version.GML3 == version) { gmlNamespace = org.geotools.gml3.GML.NAMESPACE; gmlLocation = "gml/3.1.1/base/gml.xsd"; gmlConfiguration = new org.geotools.gml3.GMLConfiguration(); schemas.add(new org.geotools.gml3.GMLSchema().profile()); } if (Version.WFS1_1 == version) { gmlNamespace = org.geotools.gml3.GML.NAMESPACE; gmlLocation = "gml/3.1.1/base/gml.xsd"; gmlConfiguration = new org.geotools.wfs.v1_1.WFSConfiguration(); schemas.add(new org.geotools.gml3.GMLSchema().profile()); } schemaList = schemas; } private Entry<Name, AttributeType> searchSchemas(Class<?> binding) { // sort by isAssignable so we get the most specific match possible // Comparator<Entry<Name, AttributeType>> sort = new Comparator<Entry<Name, AttributeType>>() { public int compare(Entry<Name, AttributeType> o1, Entry<Name, AttributeType> o2) { Class<?> binding1 = o1.getValue().getBinding(); Class<?> binding2 = o2.getValue().getBinding(); if (binding1.equals(binding2)) { return 0; } if (binding1.isAssignableFrom(binding2)) { return 1; } else { return 0; } } }; List<Entry<Name, AttributeType>> match = new ArrayList<Entry<Name, AttributeType>>(); // process the listed profiles recording all available matches for (Schema profile : schemaList) { for (Entry<Name, AttributeType> entry : profile.entrySet()) { AttributeType type = entry.getValue(); if (type.getBinding().isAssignableFrom(binding)) { match.add(entry); } } } Collections.sort(match, sort); Iterator<Entry<Name, AttributeType>> iter = match.iterator(); if (iter.hasNext()) { Entry<Name, AttributeType> entry = iter.next(); return entry; } else { return null; // no binding found that matches } } @SuppressWarnings("unchecked") public void encode(OutputStream out, SimpleFeatureCollection collection) throws IOException { if (version == Version.GML2) { if (legacy) { encodeLegacyGML2(out, collection); } else { throw new IllegalStateException( "Cannot encode a feature collection using GML2 (only WFS)"); } } if (version == Version.WFS1_0) { Encoder e = new Encoder(new org.geotools.wfs.v1_0.WFSConfiguration()); e.getNamespaces().declarePrefix(prefix, namespace); e.setIndenting(true); FeatureCollectionType featureCollectionType = WfsFactory.eINSTANCE .createFeatureCollectionType(); featureCollectionType.getFeature().add(collection); e.encode(featureCollectionType, org.geotools.wfs.WFS.FeatureCollection, out); } if (version == Version.WFS1_1) { Encoder e = new Encoder(new org.geotools.wfs.v1_1.WFSConfiguration()); e.getNamespaces().declarePrefix(prefix, namespace); e.setIndenting(true); FeatureCollectionType featureCollectionType = WfsFactory.eINSTANCE .createFeatureCollectionType(); featureCollectionType.getFeature().add(collection); e.encode(featureCollectionType, org.geotools.wfs.WFS.FeatureCollection, out); } } private void encodeLegacyGML2(OutputStream out, SimpleFeatureCollection collection) throws IOException { final SimpleFeatureType TYPE = collection.getSchema(); FeatureTransformer transform = new FeatureTransformer(); transform.setIndentation(4); transform.setGmlPrefixing(true); if (prefix != null && namespace != null) { transform.getFeatureTypeNamespaces().declareDefaultNamespace(prefix, namespace); transform.addSchemaLocation(prefix, namespace); // transform.getFeatureTypeNamespaces().declareDefaultNamespace("", namespace ); } if (TYPE.getName().getNamespaceURI() != null && TYPE.getUserData().get("prefix") != null) { String typeNamespace = TYPE.getName().getNamespaceURI(); String typePrefix = (String) TYPE.getUserData().get("prefix"); transform.getFeatureTypeNamespaces().declareNamespace(TYPE, typePrefix, typeNamespace); } else if (prefix != null && namespace != null) { // ignore namespace URI in feature type transform.getFeatureTypeNamespaces().declareNamespace(TYPE, prefix, namespace); } else { // hopefully that works out for you then } // we probably need to do a wfs feaure collection here? transform.setCollectionPrefix(null); transform.setCollectionNamespace(null); // other configuration transform.setCollectionBounding(true); transform.setEncoding(encoding); // configure additional feature namespace lookup transform.getFeatureNamespaces(); String srsName = CRS.toSRS(TYPE.getCoordinateReferenceSystem()); if (srsName != null) { transform.setSrsName(srsName); } try { transform.transform(collection, out); } catch (TransformerException e) { throw (IOException) new IOException("Failed to encode feature collection:" + e) .initCause(e); } } /** * Encode the provided SimpleFeatureType into an XSD file, using a target namespace * <p> * When encoding the simpleFeatureType: * <ul> * <li>target prefix/namespace can be provided by prefix and namespace parameters. This is the * default for the entire XSD document.</li> * <li>simpleFeatureType.geName().getNamespaceURI() is used for the simpleFeatureType itself, * providing simpleFeatureType.getUserData().get("prefix") is defined</li> * </ul> * * @param simpleFeatureType * To be encoded as an XSD document * @param prefix * Prefix to use for for target namespace * @param namespace * Target namespace */ public void encode(OutputStream out, SimpleFeatureType simpleFeatureType) throws IOException { XSDSchema xsd = xsd(simpleFeatureType); XSDResourceImpl.serialize(out, xsd.getElement(), encoding.name()); } /** * Decode a typeName from the provided schemaLocation. * <p> * The XMLSchema does not include CoordinateReferenceSystem we need to ask you to supply this * information. * * @param schemaLocation * @param typeName * @param crs * @return * @throws IOException */ public SimpleFeatureType decodeSimpleFeatureType(URL schemaLocation, Name typeName) throws IOException { if (Version.WFS1_1 == version) { final QName featureName = new QName(typeName.getNamespaceURI(), typeName.getLocalPart()); String namespaceURI = featureName.getNamespaceURI(); String uri = schemaLocation.toExternalForm(); Configuration wfsConfiguration = new org.geotools.gml3.ApplicationSchemaConfiguration( namespaceURI, uri); FeatureType parsed = GTXML.parseFeatureType(wfsConfiguration, featureName, crs); return DataUtilities.simple(parsed); } if (Version.WFS1_0 == version) { final QName featureName = new QName(typeName.getNamespaceURI(), typeName.getLocalPart()); String namespaceURI = featureName.getNamespaceURI(); String uri = schemaLocation.toExternalForm(); XSD xsd = new org.geotools.gml2.ApplicationSchemaXSD(namespaceURI, uri); Configuration configuration = new Configuration(xsd) { { addDependency(new XSConfiguration()); addDependency(gmlConfiguration); // use our GML configuration } protected void registerBindings(java.util.Map bindings) { // we have no special bindings } }; FeatureType parsed = GTXML.parseFeatureType(configuration, featureName, crs); return DataUtilities.simple(parsed); } return null; } public SimpleFeatureCollection decodeFeatureCollection(InputStream in) throws IOException, SAXException, ParserConfigurationException { if (Version.GML2 == version || Version.WFS1_0 == version || Version.GML2 == version || Version.GML3 == version || Version.WFS1_0 == version || Version.WFS1_1 == version) { Parser parser = new Parser(gmlConfiguration); Object obj = parser.parse(in); SimpleFeatureCollection collection = toFeatureCollection(obj); return collection; } return null; } /** * Convert parse results into a SimpleFeatureCollection. * * @param obj SimpleFeatureCollection, Collection<?>, SimpleFeature, etc... * @return SimpleFeatureCollection of the results */ private SimpleFeatureCollection toFeatureCollection(Object obj) { if (obj == null) { return null; // not available? } if (obj instanceof SimpleFeatureCollection) { return (SimpleFeatureCollection) obj; } if (obj instanceof Collection<?>) { Collection<?> collection = (Collection<?>) obj; SimpleFeatureCollection simpleFeatureCollection = simpleFeatureCollection(collection); return simpleFeatureCollection; } if (obj instanceof SimpleFeature) { SimpleFeature feature = (SimpleFeature) obj; return DataUtilities.collection(feature); } if (obj instanceof FeatureCollectionType) { FeatureCollectionType collectionType = (FeatureCollectionType) obj; for (Object entry : collectionType.getFeature()) { SimpleFeatureCollection collection = toFeatureCollection(entry); if (entry != null) { return collection; } } return null; // nothing found } else { throw new ClassCastException(obj.getClass() + " produced when FeatureCollection expected" + " check schema use of AbstractFeatureCollection"); } } /** * Allow the parsing of features as a stream; the returned iterator can be used to step through * the inputstream of content one feature at a time without loading everything into memory. * <p> * The schema used by the XML is consulted to determine what element extends AbstractFeature. * * @param in * @return Iterator that can be used to parse features one at a time * @throws SAXException * @throws ParserConfigurationException * @throws IOException */ public SimpleFeatureIterator decodeFeatureIterator(InputStream in) throws IOException, ParserConfigurationException, SAXException { return decodeFeatureIterator(in, null); } /** * Allow the parsing of features as a stream; the returned iterator can be used to step through * the inputstream of content one feature at a time without loading everything into memory. * <p> * The use of an elementName is optional; and can be used as a workaround in cases where the * schema is not available or correctly defined. The returned elements are wrapped up as a * Feature if needed. This mehtod can be used to retrive only the Geometry elements from a GML * docuemnt. * * @param in * InputStream used as a source of SimpleFeature content * @param xpath * Optional xpath used to indicate simple feature element; the schema will be checked * for an entry that extends AbstratFeatureType * @return * @throws SAXException * @throws ParserConfigurationException */ public SimpleFeatureIterator decodeFeatureIterator(InputStream in, QName elementName) throws IOException, ParserConfigurationException, SAXException { if (Version.GML2 == version || Version.GML3 == version || Version.WFS1_0 == version || Version.WFS1_1 == version) { // ParserDelegate parserDelegate = new XSDParserDelegate( gmlConfiguration ); StreamingParser parser; if (elementName != null) { parser = new StreamingParser(gmlConfiguration, in, elementName); } else { parser = new StreamingParser(gmlConfiguration, in, SimpleFeature.class); } return iterator(parser); } return null; } /** * Go through collection contents and morph contents into SimpleFeatures as required. * * @param collection * @return SimpleFeatureCollection */ private SimpleFeatureCollection simpleFeatureCollection(Collection<?> collection) { SimpleFeatureCollection featureCollection = FeatureCollections.newCollection(); SimpleFeatureType schema = null; for (Object obj : collection) { if (schema == null) { schema = simpleType(obj); } SimpleFeature feature = simpleFeature(obj, schema); featureCollection.add(feature); } return featureCollection; } /** * Used to wrap up a StreamingParser as a Iterator<SimpleFeature>. * <p> * This iterator is actually forgiving; and willing to "morph" content into a SimpleFeature if * needed. * <ul> * <li>SimpleFeature - is returned as is * <li> * * @param parser * @return */ protected SimpleFeatureIterator iterator(final StreamingParser parser) { return new SimpleFeatureIterator() { SimpleFeatureType schema; Object next; public boolean hasNext() { if (next != null) { return true; } next = parser.parse(); return next != null; } public SimpleFeature next() { if (next == null) { next = parser.parse(); } if (next != null) { try { if (schema == null) { schema = simpleType(next); } SimpleFeature feature = simpleFeature(next, schema); return feature; } finally { next = null; // we have tried processing this one now } } else { return null; // nothing left } } public void close() { schema = null; } }; } protected SimpleFeatureType simpleType(Object obj) { if (obj instanceof SimpleFeature) { SimpleFeature feature = (SimpleFeature) obj; return feature.getFeatureType(); } if (obj instanceof Map<?, ?>) { Map<?, ?> map = (Map<?, ?>) obj; SimpleFeatureTypeBuilder build = new SimpleFeatureTypeBuilder(); build.setName("Unknown"); for (Map.Entry<?, ?> entry : map.entrySet()) { String key = (String) entry.getKey(); Object value = entry.getValue(); Class<?> binding = value == null ? Object.class : value.getClass(); if (value instanceof Geometry) { Geometry geom = (Geometry) value; Object srs = geom.getUserData(); if (srs instanceof CoordinateReferenceSystem) { build.add(key, binding, (CoordinateReferenceSystem) srs); } else if (srs instanceof Integer) { build.add(key, binding, (Integer) srs); } else if (srs instanceof String) { build.add(key, binding, (String) srs); } else { build.add(key, binding); } } else { build.add(key, binding); } } SimpleFeatureType schema = build.buildFeatureType(); return schema; } if (obj instanceof Geometry) { Geometry geom = (Geometry) obj; Class<?> binding = geom.getClass(); Object srs = geom.getUserData(); SimpleFeatureTypeBuilder build = new SimpleFeatureTypeBuilder(); build.setName("Unknown"); if (srs instanceof CoordinateReferenceSystem) { build.add("the_geom", binding, (CoordinateReferenceSystem) srs); } else if (srs instanceof Integer) { build.add("the_geom", binding, (Integer) srs); } else if (srs instanceof String) { build.add("the_geom", binding, (String) srs); } else { build.add("the_geom", binding); } build.setDefaultGeometry("the_geom"); SimpleFeatureType schema = build.buildFeatureType(); return schema; } return null; } /** * Morph provided obj to a SimpleFeature if possible. * * @param obj * @param schema * @return SimpleFeature, or null if not possible */ protected SimpleFeature simpleFeature(Object obj, SimpleFeatureType schema) { if (schema == null) { schema = simpleType(obj); } if (obj instanceof SimpleFeature) { return (SimpleFeature) obj; } if (obj instanceof Map<?, ?>) { Map<?, ?> map = (Map<?, ?>) obj; Object values[] = new Object[schema.getAttributeCount()]; for (int i = 0; i < schema.getAttributeCount(); i++) { AttributeDescriptor descriptor = schema.getDescriptor(i); String key = descriptor.getLocalName(); Object value = map.get(key); values[i] = value; } SimpleFeature feature = SimpleFeatureBuilder.build(schema, values, null); return feature; } if (obj instanceof Geometry) { Geometry geom = (Geometry) obj; SimpleFeatureBuilder build = new SimpleFeatureBuilder(schema); build.set(schema.getGeometryDescriptor().getName(), geom); SimpleFeature feature = build.buildFeature(null); return feature; } return null; // not available as a feature! } @SuppressWarnings("unchecked") protected XSDSchema xsd(SimpleFeatureType simpleFeatureType) throws IOException { XSDFactory factory = XSDFactory.eINSTANCE; XSDSchema xsd = factory.createXSDSchema(); xsd.setSchemaForSchemaQNamePrefix("xsd"); xsd.getQNamePrefixToNamespaceMap().put("xsd", XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); xsd.setElementFormDefault(XSDForm.get(XSDForm.QUALIFIED)); if (baseURL == null) { throw new IllegalStateException("Please setBaseURL prior to encoding"); } if (prefix != null || namespace != null) { xsd.setTargetNamespace(namespace); xsd.getQNamePrefixToNamespaceMap().put(prefix, namespace); } if (simpleFeatureType.getName().getNamespaceURI() != null && simpleFeatureType.getUserData().get("prefix") != null) { String providedNamespace = simpleFeatureType.getName().getNamespaceURI(); String providedPrefix = (String) simpleFeatureType.getUserData().get("prefix"); xsd.getQNamePrefixToNamespaceMap().put(providedPrefix, providedNamespace); } if (simpleFeatureType.getUserData().get("schemaURI") != null) { throw new IllegalArgumentException("Unable to support app-schema supplied types"); } // import GML import XSDImport gml = factory.createXSDImport(); gml.setNamespace(gmlNamespace); gml.setSchemaLocation(baseURL.toString() + "/" + gmlLocation); gml.setResolvedSchema(gmlConfiguration.getXSD().getSchema()); xsd.getContents().add(gml); xsd.getQNamePrefixToNamespaceMap().put("gml", gmlNamespace); xsd.getQNamePrefixToNamespaceMap().put("gml", "http://www.opengis.net/gml"); XSDElementDeclaration element = factory.createXSDElementDeclaration(); element.setName(simpleFeatureType.getTypeName()); XSDElementDeclaration _FEATURE = xsd.resolveElementDeclaration(gmlNamespace, "_Feature"); element.setSubstitutionGroupAffiliation(_FEATURE); XSDComplexTypeDefinition ABSTRACT_FEATURE_TYPE = xsd.resolveComplexTypeDefinition( gmlNamespace, "AbstractFeatureType"); XSDComplexTypeDefinition featureType = xsd(xsd, simpleFeatureType, ABSTRACT_FEATURE_TYPE); // package up and add to xsd element.setTypeDefinition(featureType); xsd.getContents().add(element); xsd.updateElement(); return xsd; } /** * Build the XSD definition for the provided type. * <p> * The generated definition is recorded in the XSDSchema prior to being returned. * * @param xsd * The XSDSchema being worked on * @param type * ComplexType to capture as an encoding, usually a SimpleFeatureType * @param L_TYPE * definition to use as the base type, or null * @return XSDComplexTypeDefinition generated for the provided type */ @SuppressWarnings("unchecked") protected XSDComplexTypeDefinition xsd(XSDSchema xsd, ComplexType type, final XSDComplexTypeDefinition BASE_TYPE) { XSDFactory factory = XSDFactory.eINSTANCE; XSDComplexTypeDefinition definition = factory.createXSDComplexTypeDefinition(); definition.setName(type.getName().getLocalPart()); definition.setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL); if (BASE_TYPE != null) { definition.setBaseTypeDefinition(BASE_TYPE); } List<String> skip = Collections.emptyList(); if ("AbstractFeatureType".equals(BASE_TYPE.getName())) { // should look at ABSTRACT_FEATURE_TYPE to determine contents to skip skip = Arrays.asList(new String[] { "nounds", "description", "boundedBy" }); } // attributes XSDModelGroup attributes = factory.createXSDModelGroup(); attributes.setCompositor(XSDCompositor.SEQUENCE_LITERAL); Name anyName = new NameImpl(XS.NAMESPACE, XS.ANYTYPE.getLocalPart()); for (PropertyDescriptor descriptor : type.getDescriptors()) { if (descriptor instanceof AttributeDescriptor) { AttributeDescriptor attributeDescriptor = (AttributeDescriptor) descriptor; if (skip.contains(attributeDescriptor.getLocalName())) { continue; } XSDElementDeclaration attribute = factory.createXSDElementDeclaration(); attribute.setName(attributeDescriptor.getLocalName()); attribute.setNillable(attributeDescriptor.isNillable()); Name name = attributeDescriptor.getType().getName(); // return the first match. if (!anyName.equals(name)) { AttributeType attributeType = attributeDescriptor.getType(); if (attributeType instanceof ComplexType) { ComplexType complexType = (ComplexType) attributeType; // any complex contents must resolve (we cannot encode against // an abstract type for example) if (xsd.resolveTypeDefinition(name.getNamespaceURI(), name.getLocalPart()) == null) { // not yet added; better add it into the mix xsd(xsd, complexType, null); } } else { Class<?> binding = attributeType.getBinding(); Entry<Name, AttributeType> entry = searchSchemas(binding); if (entry == null) { throw new IllegalStateException("No type for " + attribute.getName() + " (" + binding.getName() + ")"); } name = entry.getKey(); } } XSDTypeDefinition attributeDefinition = xsd.resolveTypeDefinition(name .getNamespaceURI(), name.getLocalPart()); attribute.setTypeDefinition(attributeDefinition); XSDParticle particle = factory.createXSDParticle(); particle.setMinOccurs(attributeDescriptor.getMinOccurs()); particle.setMaxOccurs(attributeDescriptor.getMaxOccurs()); particle.setContent(attribute); attributes.getContents().add(particle); } } // set up fatureType with attributes XSDParticle contents = factory.createXSDParticle(); contents.setContent(attributes); definition.setContent(contents); xsd.getContents().add(definition); return definition; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
2ed6e871a860ae2b8c2aa999a70fd102c2fb2e42
d30057083117299a24392ec519b17e4e8e20865b
/app/src/main/java/comrr/example/starlingsoftwares/fragmentsdemo/FirstFragment.java
2d58d1443cc8c2a4b9d2813372004a676b120d5c
[]
no_license
PrernaYadav/FragmentsDemo
bb9079aa3a7f6691a04252360f2a2e7947f5d92e
23287b5500d2cc547f042daf6ef49747ac05a5cd
refs/heads/master
2020-03-19T02:54:20.820578
2018-05-21T12:22:36
2018-05-21T12:22:36
135,673,453
0
0
null
null
null
null
UTF-8
Java
false
false
607
java
package comrr.example.starlingsoftwares.fragmentsdemo; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class FirstFragment extends Fragment { @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View v = inflater.inflate(R.layout.first, container, false); return v; } }
[ "prernasyadav027@gmail.com" ]
prernasyadav027@gmail.com
34250db4a501d13059f9240079faa52b19e357c5
3fe5b243bd149f6028a6121f925adf4093a444ce
/src/com/simen/plane/Bullet.java
54142695496590c8d382b0b452ff30996297ce5a
[]
no_license
Simenhug/spaceship-game
993b4ddd4ead85473539ed715f2e2c87b7614cd3
e583acb24df31b4b4b2c709db2c6b06d0dde824b
refs/heads/master
2022-11-08T10:14:09.682179
2020-06-30T22:13:39
2020-06-30T22:13:39
276,215,505
0
0
null
null
null
null
UTF-8
Java
false
false
854
java
package com.simen.plane; import java.awt.Color; import java.awt.Graphics; import java.awt.Rectangle; import com.simen.util.Constant; public class Bullet extends GameObject{ double degree; public Rectangle getHitbox() { return new Rectangle((int)x, (int)y, width, height); } public Bullet() { degree = Math.random()*Math.PI*2; x = Constant.frameWidth/2; y = Constant.frameHight/2; speed = 8; width = 10; height = 10; } public void draw(Graphics g) { Color c = g.getColor(); g.setColor(Color.yellow); g.fillOval((int)x, (int)y, width, height); x += speed*Math.cos(degree); y += speed*Math.sin(degree); if(y>Constant.frameHight-height||y<30) { degree = -degree; } if(x<0||x>Constant.frameWidth-width) { degree = Math.PI-degree; } g.setColor(c); } }
[ "xinmianhug@gmail.com" ]
xinmianhug@gmail.com
8a740c375304e96f8b1c6eaad6207b9c971da5c3
4055e5e3da26ba9955d91a381938a70bc5aafa4b
/Stationery/src/com/wabacus/system/datatype/TimestampType.java
1e6f13d319a615812f43ad573ed32073061837b2
[]
no_license
xiciliu/Stationery
b2eb55bc5246e774e242db465c7a10b8b64aa349
738159fffb30a84c82a25975d3acd6c66225d5b3
refs/heads/master
2021-12-13T01:22:07.531961
2017-03-09T13:18:07
2017-03-09T13:18:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,561
java
/* * Copyright (C) 2010---2014 星星(wuweixing)<349446658@qq.com> * * This file is part of Wabacus * * Wabacus 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.wabacus.system.datatype; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.wabacus.config.database.type.AbsDatabaseType; public class TimestampType extends AbsDateTimeType { private final static Log log=LogFactory.getLog(TimestampType.class); private final static Map<String,AbsDateTimeType> mDatetimeTypeObjects=new HashMap<String,AbsDateTimeType>(); public Object label2value(String label) { if(label==null||label.trim().equals("")) return null; try { Date date=new SimpleDateFormat(dateformat).parse(label.trim()); return new java.sql.Timestamp(date.getTime()); }catch(ParseException e) { log.error(label+"非法的日期格式,不能格式化为"+dateformat+"形式的日期类型",e); return null; } } public String value2label(Object value) { if(value==null) return ""; if(!(value instanceof Date)) { return String.valueOf(value); } return new SimpleDateFormat(dateformat).format((Date)value); } public Object getColumnValue(ResultSet rs,String column,AbsDatabaseType dbtype) throws SQLException { java.sql.Timestamp ts=rs.getTimestamp(column); if(ts==null) return null; return new Date(ts.getTime()); } public Object getColumnValue(ResultSet rs,int iindex,AbsDatabaseType dbtype) throws SQLException { java.sql.Timestamp ts=rs.getTimestamp(iindex); if(ts==null) return null; return new Date(ts.getTime()); } public void setPreparedStatementValue(int iindex,String value,PreparedStatement pstmt, AbsDatabaseType dbtype) throws SQLException { log.debug("setTimestamp("+iindex+","+value+")"); pstmt.setTimestamp(iindex,(java.sql.Timestamp)label2value(value)); } public void setPreparedStatementValue(int index,Date dateValue,PreparedStatement pstmt) throws SQLException { log.debug("setTimestamp("+index+","+dateValue+")"); if(dateValue==null) { pstmt.setTimestamp(index,null); }else { pstmt.setTimestamp(index,new java.sql.Timestamp(dateValue.getTime())); } } public Class getJavaTypeClass() { return Date.class; } protected Map<String,AbsDateTimeType> getMDatetimeTypeObjects() { return mDatetimeTypeObjects; } }
[ "1299615504@qq.com" ]
1299615504@qq.com
a0fa763782bb037afdf1335bb77194702048d7b7
5c909dd8d42cc26aee0d0c638a3a68f09ea3d3fb
/src/test1/Test1.java
2c4fe772b160476474666db00472174dc703654f
[]
no_license
edenjiga/test1
1580ae4358ee2d2ca29385b7b8f15357a9b8b7a7
45c94b912534e11c701a10f32699e35b18c4e319
refs/heads/master
2020-05-24T19:59:10.075737
2017-03-13T21:39:23
2017-03-13T21:39:23
84,876,710
0
0
null
null
null
null
UTF-8
Java
false
false
446
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package test1; /** * * @author Edgar */ public class Test1 { /** * @param args the command line arguments */ private Test1(){} public static void main(String[] args) { System.out.println("HOLA MUNDIO"); } }
[ "edenjiga_@hotmail.com" ]
edenjiga_@hotmail.com
e06e7c401900662cb654d32ce3e3687cbce50b7b
a70358d251e2bb926ddb5b7e75a7bce50b137181
/dc_udf/src/main/java/com/hopson/dc/udf/encrypt/UDFSha512.java
502fe1ccdf54b71dea8ba65916c5ee574209f4bc
[]
no_license
WeiWan5675/datacenter_common
5a1d77701f9d07e12e55ed61a3cec1990bb9ce4b
56cb33a25b29dd93cd8d1b26c7b055bf3830b066
refs/heads/master
2022-05-18T16:58:58.750167
2020-03-09T01:57:10
2020-03-09T01:57:10
235,009,932
1
1
null
2022-04-12T21:58:33
2020-01-20T03:17:29
Java
UTF-8
Java
false
false
864
java
package com.hopson.dc.udf.encrypt; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.ql.exec.UDF; import org.apache.hadoop.io.Text; import com.hopson.dc.utils.enDeCrypt.EncryptUtils; /** * @author ruifeng.shan * date: 2016-07-25 * time: 14:29 */ @Description(name = "sha512" , value = "_FUNC_(string) - get sha512 hash code by given input string." , extended = "Example:\n > select _FUNC_(string) from src;") public class UDFSha512 extends UDF { private Text result = new Text(); public UDFSha512() { } /** * sha256 hash. * * @param text 字符串 * @return sha256 hash. */ public Text evaluate(Text text) { if (text == null) { return null; } result.set(EncryptUtils.sha512((text.toString()))); return result; } }
[ "190657@lifeat.cn" ]
190657@lifeat.cn
222fc49f2e01e0cd5ad06eda287c333f29a3dc04
4e284effd4a880a327824def544fc0b1399883f3
/Workspace/groupeB5/src/main/java/be/helha/aemt/dao/PictureDAO.java
9d838c0609090c305a7fb270501d4b221aa55356
[]
no_license
Mithirsan/AEMT-GroupB5-2020
c027b15cdd13bd95c66b22729931450079d00f0e
31ebf97d0a3e38b4b3871be0d379168f181adffa
refs/heads/master
2023-08-22T10:26:44.460575
2021-10-13T10:34:07
2021-10-13T10:34:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
532
java
package be.helha.aemt.dao; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.Query; import be.helha.aemt.entities.Picture; public class PictureDAO { public static Picture targetSelect(Picture picture,EntityManager em) { Query qGet = em.createQuery("SELECT p FROM Picture p WHERE p.base64 = :pictureBase64"); qGet.setParameter("pictureBase64", picture.getBase64()); List<Picture> tmp = qGet.getResultList(); return tmp.size()== 0 ? null : tmp.get(0); } }
[ "161674@student.helha.be" ]
161674@student.helha.be
fd4e80f878576d5ab5251b0f8ae5579504f9399c
7cff170415752c045cae13f2c3091b84d84fe002
/src/test/java/com/ParaBank/Tests/LogoutTest.java
bd26b4e179dce637c9278d75c837bbceaf9c8ac7
[]
no_license
docsujith/ParaBank-Assignment
a18efb5f2459447756f23c79f0eb6cb43407a532
73a582929729562279183635ee75aa3d899481c3
refs/heads/master
2023-05-03T17:57:57.387241
2021-05-20T22:09:40
2021-05-20T22:09:40
369,350,121
0
0
null
null
null
null
UTF-8
Java
false
false
761
java
package com.ParaBank.Tests; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import com.ParaBank.Base.TestBase; import com.ParaBank.Pages.HomePage; import com.ParaBank.Pages.OverviewPage; public class LogoutTest extends TestBase { HomePage homePage; OverviewPage overviewPage; @BeforeMethod public void beforeTest() { initialization(); homePage = new HomePage(); overviewPage = homePage.loginTest(); } @Test public void logoutTest() { overviewPage.logout(); Assert.assertEquals(driver.getCurrentUrl(), "https://parabank.parasoft.com/parabank/index.htm?ConnType=JDBC"); } @AfterMethod public void afterTest() { driver.quit(); } }
[ "docsujith@gmail.com" ]
docsujith@gmail.com
079f4de266d46d9b09a0a15ebafe9cc24bd96765
3577feae91ca2e56e810175142e2ff1935ca5cf5
/LBS_1_1/app1/src/androidTest/java/com/lbs/programming/lbs_1_1/ExampleInstrumentedTest.java
3e53bfe7b9d03a394f96707d615a357b9fad5a14
[ "Apache-2.0" ]
permissive
ssangjin/lbs_programming
ca787b06007618ae55543f59e633416b965a8043
a573ecbf511c19eee93349fef82db89f71577452
refs/heads/master
2022-06-26T03:33:57.108275
2020-11-15T05:23:52
2020-11-15T05:23:52
134,939,973
0
0
Apache-2.0
2022-06-21T02:07:15
2018-05-26T07:36:30
Java
UTF-8
Java
false
false
738
java
package com.lbs.programming.lbs_1_1; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.lbs.programming.lbs_1_1", appContext.getPackageName()); } }
[ "sangjin.yun@gmail.com" ]
sangjin.yun@gmail.com
761842fd27ba1afe30c16ea67f3a4e4994464282
138656b817434518414fc60ff3c0cb134fbd0184
/FirstHibernateProject/src/com/rahul/onetomany/TestStudent.java
a18adc86d3dc882ec090797d58b52b8a6494ff2e
[]
no_license
ctsdevtest/hibernate
4ee329fc40e43951cc282a3ffdc996809550734a
587e7a3b8e81f0b6c324a2b025722b8a40e7df04
refs/heads/master
2020-07-06T09:03:24.643907
2016-11-20T08:26:21
2016-11-20T08:26:21
74,049,719
0
0
null
null
null
null
UTF-8
Java
false
false
1,394
java
package com.rahul.onetomany; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.AnnotationConfiguration; import org.hibernate.tool.hbm2ddl.SchemaExport; import com.rahul.onetoone.Person; import com.rahul.onetoone.PersonDetails; @SuppressWarnings({ "deprecation", "unused" }) public class TestStudent { public static void main(String[] args) { AnnotationConfiguration config = new AnnotationConfiguration(); config.addAnnotatedClass(Student.class); config.addAnnotatedClass(College.class); config.configure(); // first true denotes that whatever sql statement is generated will be printed in console // second true say whatever sql is written needs to executed to database new SchemaExport(config).create(true, true); SessionFactory sessionFactory = config.buildSessionFactory(); Session session = sessionFactory.openSession(); session.beginTransaction(); College college1 = new College(); college1.setCollegeName("PCEA"); Student stud1 = new Student(); stud1.setStudentName("Ajay"); stud1.setCollege(college1); Student stud2 = new Student(); stud2.setStudentName("Bijay"); stud2.setCollege(college1); session.save(college1); session.save(stud1); session.save(stud2); // No need if we set the cascade type //session.save(personDetails); session.getTransaction().commit(); } }
[ "avengers2016.lma@.com" ]
avengers2016.lma@.com
b417bf93a36847f9999d0e60697ccce7fdb9f6d3
6366b267010f3fe9b4a07639398d5f45a29e9d2e
/crm_backend/src/main/java/com/dev/crm/core/repository/jdbc/DatosOnusCustomJdbcRepository.java
6b44f7d3bb7f44831cd5f3aa9094a734fdbfa817
[ "Apache-2.0" ]
permissive
frsknalexis/crm-java
aad23c61d84d4f8780a240f7b199fb6a692c38dc
064f54855d8f6ca50ac1e1be21f545bb837c2ea9
refs/heads/master
2022-07-27T21:44:25.180469
2019-09-27T05:28:29
2019-09-27T05:28:29
178,519,935
1
0
Apache-2.0
2022-06-30T20:17:03
2019-03-30T06:16:56
Java
UTF-8
Java
false
false
2,718
java
package com.dev.crm.core.repository.jdbc; import java.sql.Types; import java.util.HashMap; import java.util.Map; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.SqlOutParameter; import org.springframework.jdbc.core.SqlParameter; import org.springframework.jdbc.core.simple.SimpleJdbcCall; import org.springframework.stereotype.Repository; import com.dev.crm.core.dto.DatosOnuRequest; import com.dev.crm.core.dto.DatosOnusResultViewModel; import com.dev.crm.core.util.Constantes; import com.dev.crm.core.util.GenericUtil; @Repository("datosOnusJdbcRepository") public class DatosOnusCustomJdbcRepository implements DatosOnusJdbcRepository { private SimpleJdbcCall simpleJdbcCall; @Autowired public void setDataSource(DataSource dataSource) { JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); this.simpleJdbcCall = new SimpleJdbcCall(jdbcTemplate); } @Override public DatosOnusResultViewModel spRecuperarDatosOnu(DatosOnuRequest request) { try { simpleJdbcCall.withProcedureName(Constantes.SP_DATOS_ONUS); simpleJdbcCall.declareParameters(new SqlParameter("SN", Types.VARCHAR), new SqlParameter("MAC", Types.VARCHAR), new SqlOutParameter("OUTMAC", Types.VARCHAR), new SqlOutParameter("OUTSN", Types.VARCHAR), new SqlOutParameter("OUTUSER", Types.VARCHAR), new SqlOutParameter("OUTPASS", Types.VARCHAR), new SqlOutParameter("OUTSSID", Types.VARCHAR), new SqlOutParameter("OUTWIFFIPASS", Types.VARCHAR), new SqlOutParameter("OUTESTADO", Types.VARCHAR)); Map<String, Object> inParams = new HashMap<String, Object>(); inParams.put("SN", request.getSnDescripcion()); inParams.put("MAC", request.getMacDescripcion()); Map<String, Object> out = simpleJdbcCall.execute(inParams); if(GenericUtil.isNotNull(out.get("OUTMAC")) && GenericUtil.isNotNull(out.get("OUTSN"))) { DatosOnusResultViewModel datosOnu = new DatosOnusResultViewModel(); datosOnu.setMacDescripcion((String) out.get("OUTMAC")); datosOnu.setSnDescripcion((String) out.get("OUTSN")); datosOnu.setWinUser((String) out.get("OUTUSER")); datosOnu.setWinPassword((String) out.get("OUTPASS")); datosOnu.setWifissidDescripcion((String) out.get("OUTSSID")); datosOnu.setWifiPasswordDescripcion((String) out.get("OUTWIFFIPASS")); datosOnu.setEstado((String) out.get("OUTESTADO")); return datosOnu; } else if(GenericUtil.isNull(out.get("OUTMAC")) && GenericUtil.isNull(out.get("OUTSN"))) { return null; } } catch(Exception e) { e.printStackTrace(); } return null; } }
[ "alexisgutierrezf.1997@gmail.com" ]
alexisgutierrezf.1997@gmail.com
2cafb35874c1a6eb4927990228d1ba88530bac72
ee5207436a3362bdb791727c73a3189dfa868ed8
/src/de/vs/unikassel/GuiComponents/SAXTreeViewer.java
2a1df4f83035367d488db20d5ae36f6f56f68224
[]
no_license
GIPSY-dev/WSC-Gen
7f1c387b47470f277e27e7994fbf6e4f942fddf6
25beebdda5c1a4a0e4c213fa97155e2b3455da87
refs/heads/master
2020-04-06T04:20:49.760697
2018-03-13T16:30:34
2018-03-13T19:11:48
82,968,360
1
2
null
2018-04-23T17:06:51
2017-02-23T20:27:06
Java
UTF-8
Java
false
false
21,256
java
/*-- Copyright (C) 2001 Brett McLaughlin. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the disclaimer that follows these conditions in the documentation and/or other materials provided with the distribution. 3. The name "Java and XML" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact brett@newInstance.com. In addition, we request (but do not require) that you include in the end-user documentation provided with the redistribution and/or in the software itself an acknowledgement equivalent to the following: "This product includes software developed for the 'Java and XML' book, by Brett McLaughlin (O'Reilly & Associates)." THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,R 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 de.vs.unikassel.GuiComponents; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; import org.xml.sax.Locator; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; // This is an XML book - no need for explicit Swing imports import java.awt.*; import java.awt.event.*; import java.io.*; import java.net.MalformedURLException; import java.net.URI; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import javax.swing.*; import javax.swing.filechooser.FileFilter; import javax.swing.tree.*; /** * <b><code>SAXTreeViewer</code></b> uses Swing to graphically * display an XML document. */ public class SAXTreeViewer extends JFrame implements ActionListener { /** * */ private static final long serialVersionUID = 1L; /** Default parser to use */ private String vendorParserClass = "org.apache.xerces.parsers.SAXParser"; /** The base tree to render */ private JTree jTree; /** Tree model to use */ DefaultTreeModel defaultTreeModel; private String bpelDocument; /** * <p> This initializes the needed Swing settings. </p> */ public SAXTreeViewer(String bpelDocument) { // Handle Swing setup super("SAX XML Tree Viewer"); setBounds(200, 200, 600, 450); this.bpelDocument = bpelDocument; } private void saveButton() { // Create a file-chooser. JFileChooser fileChooser=new JFileChooser(); // Restrict the selection to files. fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); fileChooser.setSelectedFile(new File("result.bpel")); // Display the file-chooser. int option = fileChooser.showSaveDialog(this); // Check the return-status. if(option == JFileChooser.APPROVE_OPTION) { // Convert the path of the file into an URL. try { File selectedFile = fileChooser.getSelectedFile(); FileWriter fileWriter = new FileWriter(selectedFile); fileWriter.write(this.bpelDocument); fileWriter.flush(); fileWriter.close(); } catch (Exception exception) { exception.printStackTrace(); JOptionPane.showMessageDialog(this, "An error occurred during the creation of file file-URL!\n See debug-window for more informations.","Incorrect Path",JOptionPane.ERROR_MESSAGE); } } else { return; } } private void closeButton() { this.dispose(); } private void showPlainButton() { File tempFile; try { tempFile = File.createTempFile("resultBpel", ".xml"); FileWriter fileWriter = new FileWriter(tempFile); fileWriter.write(this.bpelDocument); fileWriter.flush(); fileWriter.close(); //Desktop.getDesktop().open(tempFile); Desktop.getDesktop().browse(tempFile.toURI()); tempFile.deleteOnExit(); } catch (IOException exception) { exception.printStackTrace(); } } public void actionPerformed(ActionEvent e) { if(e.getActionCommand().equals("Show Plain")) { showPlainButton(); } else if(e.getActionCommand().equals("Save")) { saveButton(); } else if(e.getActionCommand().equals("Close")) { closeButton(); } } /** * <p> This will construct the tree using Swing. </p> * * @param filename <code>String</code> path to XML document. */ public void init(String description, Reader reader) throws IOException, SAXException { DefaultMutableTreeNode base = new DefaultMutableTreeNode( "XML Document: " + description); // Build the tree model defaultTreeModel = new DefaultTreeModel(base); jTree = new JTree(defaultTreeModel); // Construct the tree hierarchy buildTree(defaultTreeModel, base, reader); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER)); JButton showPlainButton = new JButton("Show Plain Document"); showPlainButton.setActionCommand("Show Plain"); showPlainButton.addActionListener(this); buttonPanel.add(showPlainButton); JButton saveButton = new JButton("Save"); saveButton.setActionCommand("Save"); saveButton.addActionListener(this); buttonPanel.add(saveButton); JButton closebutton = new JButton("Close"); closebutton.setActionCommand("Close"); closebutton.addActionListener(this); buttonPanel.add(closebutton); this.add(new JScrollPane(jTree)); this.add(buttonPanel, BorderLayout.PAGE_END); this.setVisible(true); } /** * <p>This handles building the Swing UI tree.</p> * * @param treeModel Swing component to build upon. * @param base tree node to build on. * @param xmlURI URI to build XML document from. * @throws <code>IOException</code> - when reading the XML URI fails. * @throws <code>SAXException</code> - when errors in parsing occur. */ public void buildTree(DefaultTreeModel treeModel, DefaultMutableTreeNode base, Reader stringreader) throws IOException, SAXException { // Create instances needed for parsing XMLReader reader = XMLReaderFactory.createXMLReader(vendorParserClass); ContentHandler jTreeContentHandler = new JTreeContentHandler(treeModel, base); ErrorHandler jTreeErrorHandler = new JTreeErrorHandler(); // Register content handler reader.setContentHandler(jTreeContentHandler); // Register error handler reader.setErrorHandler(jTreeErrorHandler); // Parse InputSource inputSource = new InputSource(stringreader); reader.parse(inputSource); } /** * <p> Static entry point for running the viewer. </p> */ /*public static void main(String[] args) { try { if (args.length != 1) { System.out.println( "Usage: java javaxml2.SAXTreeViewer " + "[XML Document URI]"); System.exit(0); } SAXTreeViewer viewer = new SAXTreeViewer(); viewer.init(args[0]); viewer.setVisible(true); } catch (Exception e) { e.printStackTrace(); } }*/ } /** * <b><code>JTreeContentHandler</code></b> implements the SAX * <code>ContentHandler</code> interface and defines callback * behavior for the SAX callbacks associated with an XML * document's content, bulding up JTree nodes. */ class JTreeContentHandler implements ContentHandler { /** Hold onto the locator for location information */ //private Locator locator; /** Store URI to prefix mappings */ private Map namespaceMappings; /** Tree Model to add nodes to */ //private DefaultTreeModel treeModel; /** Current node to add sub-nodes to */ private DefaultMutableTreeNode current; /** * <p> Set up for working with the JTree. </p> * * @param treeModel tree to add nodes to. * @param base node to start adding sub-nodes to. */ public JTreeContentHandler(DefaultTreeModel treeModel, DefaultMutableTreeNode base) { //this.treeModel = treeModel; this.current = base; this.namespaceMappings = new HashMap(); } /** * <p> * Provide reference to <code>Locator</code> which provides * information about where in a document callbacks occur. * </p> * * @param locator <code>Locator</code> object tied to callback * process */ public void setDocumentLocator(Locator locator) { // Save this for later use //this.locator = locator; } /** * <p> * This indicates the start of a Document parse-this precedes * all callbacks in all SAX Handlers with the sole exception * of <code>{@link #setDocumentLocator}</code>. * </p> * * @throws <code>SAXException</code> when things go wrong */ public void startDocument() throws SAXException { // No visual events occur here } /** * <p> * This indicates the end of a Document parse-this occurs after * all callbacks in all SAX Handlers.</code>. * </p> * * @throws <code>SAXException</code> when things go wrong */ public void endDocument() throws SAXException { // No visual events occur here } /** * <p> * This indicates that a processing instruction (other than * the XML declaration) has been encountered. * </p> * * @param target <code>String</code> target of PI * @param data <code>String</code containing all data sent to the PI. * This typically looks like one or more attribute value * pairs. * @throws <code>SAXException</code> when things go wrong */ public void processingInstruction(String target, String data) throws SAXException { DefaultMutableTreeNode pi = new DefaultMutableTreeNode("PI (target = '" + target + "', data = '" + data + "')"); current.add(pi); } /** * <p> * This indicates the beginning of an XML Namespace prefix * mapping. Although this typically occurs within the root element * of an XML document, it can occur at any point within the * document. Note that a prefix mapping on an element triggers * this callback <i>before</i> the callback for the actual element * itself (<code>{@link #startElement}</code>) occurs. * </p> * * @param prefix <code>String</code> prefix used for the namespace * being reported * @param uri <code>String</code> URI for the namespace * being reported * @throws <code>SAXException</code> when things go wrong */ public void startPrefixMapping(String prefix, String uri) { // No visual events occur here. namespaceMappings.put(uri, prefix); } /** * <p> * This indicates the end of a prefix mapping, when the namespace * reported in a <code>{@link #startPrefixMapping}</code> callback * is no longer available. * </p> * * @param prefix <code>String</code> of namespace being reported * @throws <code>SAXException</code> when things go wrong */ public void endPrefixMapping(String prefix) { // No visual events occur here. for (Iterator i = namespaceMappings.keySet().iterator(); i.hasNext();) { String uri = (String) i.next(); String thisPrefix = (String) namespaceMappings.get(uri); if (prefix.equals(thisPrefix)) { namespaceMappings.remove(uri); break; } } } /** * <p> * This reports the occurrence of an actual element. It includes * the element's attributes, with the exception of XML vocabulary * specific attributes, such as * <code>xmlns:[namespace prefix]</code> and * <code>xsi:schemaLocation</code>. * </p> * * @param namespaceURI <code>String</code> namespace URI this element * is associated with, or an empty <code>String</code> * @param localName <code>String</code> name of element (with no * namespace prefix, if one is present) * @param qName <code>String</code> XML 1.0 version of element name: * [namespace prefix]:[localName] * @param atts <code>Attributes</code> list for this element * @throws <code>SAXException</code> when things go wrong */ public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { DefaultMutableTreeNode element = new DefaultMutableTreeNode("Element: " + localName); current.add(element); current = element; // Determine namespace if (namespaceURI.length() > 0) { String prefix = (String) namespaceMappings.get(namespaceURI); if (prefix.equals("")) { prefix = "[None]"; } DefaultMutableTreeNode namespace = new DefaultMutableTreeNode( "Namespace: prefix = '" + prefix + "', URI = '" + namespaceURI + "'"); current.add(namespace); } // Process attributes for (int i = 0; i < atts.getLength(); i++) { DefaultMutableTreeNode attribute = new DefaultMutableTreeNode( "Attribute (name = '" + atts.getLocalName(i) + "', value = '" + atts.getValue(i) + "')"); String attURI = atts.getURI(i); if (attURI.length() > 0) { String attPrefix = (String) namespaceMappings.get(namespaceURI); if (attPrefix.equals("")) { attPrefix = "[None]"; } DefaultMutableTreeNode attNamespace = new DefaultMutableTreeNode( "Namespace: prefix = '" + attPrefix + "', URI = '" + attURI + "'"); attribute.add(attNamespace); } current.add(attribute); } } /** * <p> * Indicates the end of an element * (<code>&lt;/[element name]&gt;</code>) is reached. Note that * the parser does not distinguish between empty * elements and non-empty elements, so this occurs uniformly. * </p> * * @param namespaceURI <code>String</code> URI of namespace this * element is associated with * @param localName <code>String</code> name of element without prefix * @param qName <code>String</code> name of element in XML 1.0 form * @throws <code>SAXException</code> when things go wrong */ public void endElement(String namespaceURI, String localName, String qName) throws SAXException { // Walk back up the tree current = (DefaultMutableTreeNode) current.getParent(); } /** * <p> * This reports character data (within an element). * </p> * * @param ch <code>char[]</code> character array with character data * @param start <code>int</code> index in array where data starts. * @param length <code>int</code> index in array where data ends. * @throws <code>SAXException</code> when things go wrong */ public void characters(char[] ch, int start, int length) throws SAXException { String s = new String(ch, start, length); DefaultMutableTreeNode data = new DefaultMutableTreeNode( "Character Data: '" + s + "'"); current.add(data); } /** * <p> * This reports whitespace that can be ignored in the * originating document. This is typically invoked only when * validation is ocurring in the parsing process. * </p> * * @param ch <code>char[]</code> character array with character data * @param start <code>int</code> index in array where data starts. * @param end <code>int</code> index in array where data ends. * @throws <code>SAXException</code> when things go wrong */ public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { // This is ignorable, so don't display it } /** * <p> * This reports an entity that is skipped by the parser. This * should only occur for non-validating parsers, and then is still * implementation-dependent behavior. * </p> * * @param name <code>String</code> name of entity being skipped * @throws <code>SAXException</code> when things go wrong */ public void skippedEntity(String name) throws SAXException { DefaultMutableTreeNode skipped = new DefaultMutableTreeNode( "Skipped Entity: '" + name + "'"); current.add(skipped); } } /** * <b><code>JTreeErrorHandler</code></b> implements the SAX * <code>ErrorHandler</code> interface and defines callback * behavior for the SAX callbacks associated with an XML * document's warnings and errors. */ class JTreeErrorHandler implements ErrorHandler { /** * <p> * This will report a warning that has occurred; this indicates * that while no XML rules were "broken", something appears * to be incorrect or missing. * </p> * * @param exception <code>SAXParseException</code> that occurred. * @throws <code>SAXException</code> when things go wrong */ public void warning(SAXParseException exception) throws SAXException { System.out.println("**Parsing Warning**\n" + " Line: " + exception.getLineNumber() + "\n" + " URI: " + exception.getSystemId() + "\n" + " Message: " + exception.getMessage()); throw new SAXException("Warning encountered"); } /** * <p> * This will report an error that has occurred; this indicates * that a rule was broken, typically in validation, but that * parsing can reasonably continue. * </p> * * @param exception <code>SAXParseException</code> that occurred. * @throws <code>SAXException</code> when things go wrong */ public void error(SAXParseException exception) throws SAXException { System.out.println("**Parsing Error**\n" + " Line: " + exception.getLineNumber() + "\n" + " URI: " + exception.getSystemId() + "\n" + " Message: " + exception.getMessage()); throw new SAXException("Error encountered"); } /** * <p> * This will report a fatal error that has occurred; this indicates * that a rule has been broken that makes continued parsing either * impossible or an almost certain waste of time. * </p> * * @param exception <code>SAXParseException</code> that occurred. * @throws <code>SAXException</code> when things go wrong */ public void fatalError(SAXParseException exception) throws SAXException { System.out.println("**Parsing Fatal Error**\n" + " Line: " + exception.getLineNumber() + "\n" + " URI: " + exception.getSystemId() + "\n" + " Message: " + exception.getMessage()); throw new SAXException("Fatal Error encountered"); } }
[ "happy.hacking.geek@gmail.com" ]
happy.hacking.geek@gmail.com
5f242210139e7bbece457ffe6d9c2fffca958d80
b5a5777e6c32c9e81a4b0d678bc7065c30fb9f1b
/src/main/java/com/udsp/sdc/icbc/comm/GeneralResponse.java
7b5fc59b586c23c7996460a15bfca6f4658eb423
[]
no_license
zedxup/epark
ae58456ba204139dae83f081c7a086dae9591327
2b426cc44411cada13a92a7c63e465c48eff8c80
refs/heads/master
2022-07-07T03:31:20.076396
2019-10-09T10:39:49
2019-10-09T10:39:49
208,267,625
0
0
null
2022-06-17T02:30:13
2019-09-13T13:12:55
CSS
UTF-8
Java
false
false
5,019
java
package com.udsp.sdc.icbc.comm; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonFilter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; /** * * 通用controller层返回对象 * * @author 张宏恺 * @date 2018-04-13 * * */ //@JsonFilter("com.unicom.mcloud.devops.comm.GeneralResponse") @ApiModel(value = "GeneralResponse", description = "通用返回对象") public class GeneralResponse implements Serializable { private static final long serialVersionUID = 4666618210906121362L; /* * 信息 */ @ApiModelProperty(value = "信息", required = false, example = "失败原因:DB连接超时/执行成功") private String message; /* * 编码非200均为失败 */ @ApiModelProperty(value = "编码", required = true) private String code; /* * 数据 */ @ApiModelProperty(value = "数据", required = false, example = "JSON: {name:张三,age:18}") private Object data; public void setMessage(String message) { this.message = message; } public void setCode(String code) { this.code = code; } public void setData(Object data) { this.data = data; } public String getMessage() { return message; } public GeneralResponse withMessage(String message) { this.message = message; return this; } public String getCode() { return code; } public GeneralResponse withCode(String code) { this.code = code; return this; } public Object getData() { return data; } public GeneralResponse withData(Object data) { this.data = data; return this; } /** * * 成功GeneralResponse * * @return GeneralResponse 返回GeneralResponse实例 */ public static GeneralResponse success() { return new GeneralResponse().withMessage("").withCode("200").withData(null); } /** * * 成功GeneralResponse * * @param message * 信息 * @return GeneralResponse 返回GeneralResponse实例 */ public static GeneralResponse successWithMsg(String message) { return new GeneralResponse().withMessage(message).withCode("200").withData(null); } /** * * 成功GeneralResponse * * @param data * 数据 * @return GeneralResponse 返回GeneralResponse实例 */ public static GeneralResponse success(Object data) { return new GeneralResponse().withMessage("").withCode("200").withData(data); } /** * * 成功GeneralResponse * * @param message * 信息 * @param data * 数据 * @return GeneralResponse 返回GeneralResponse实例 */ public static GeneralResponse success(String message, Object data) { return new GeneralResponse().withMessage(message).withCode("200").withData(data); } /** * * 成功GeneralResponse * * @param code * 编码 * @param message * 信息 * @param data * 数据 * @return GeneralResponse 返回GeneralResponse实例 */ public static GeneralResponse success(String code, String message, Object data) { return new GeneralResponse().withMessage(message).withCode(code).withData(data); } /** * * 失败GeneralResponse * * @param message * 信息 * @return GeneralResponse 返回GeneralResponse实例 */ public static GeneralResponse failure(String message) { return new GeneralResponse().withMessage(message).withCode("500").withData(null); } /** * * 失败GeneralResponse * * @param message * 信息 * @param data * 数据 * @return GeneralResponse 返回GeneralResponse实例 */ public static GeneralResponse failure(String message, Object data) { return new GeneralResponse().withMessage(message).withCode("500").withData(data); } /** * * 失败GeneralResponse * * @param code * 编码 * @param message * 信息 * @return GeneralResponse 返回GeneralResponse实例 */ public static GeneralResponse failure(String code, String message) { return new GeneralResponse().withMessage(message).withCode(code).withData(null); } /** * * 失败GeneralResponse * * @param code * 编码 * @param message * 信息 * @param data * 数据 * @return GeneralResponse 返回GeneralResponse实例 */ public static GeneralResponse failure(String code, String message, Object data) { return new GeneralResponse().withMessage(message).withCode(code).withData(data); } /** * * 返回json str 其中data 数据为null * * @return 参数 */ public String toJsonStrWithDataNull() { return "{\"code:\"" + this.code + ",\"message\":" + this.message + "\"data\":null}"; } /** * * 根据message生成json str * * @param message * 消息信息 * @return String json str */ public static String getGeneralResponseFailureJsonStr(String message) { GeneralResponse gr = new GeneralResponse().withMessage(message).withCode("500").withData(null); return gr.toJsonStrWithDataNull(); } }
[ "1354955244@qq.com" ]
1354955244@qq.com
991525d246f9ccba85b1c8e6a9571d992f512a5b
900dc0aa82989b3ab7f5eed926bbc31ebebc2c05
/eureka-server/src/main/java/com/practice/personal/EurekaServerApplication.java
7b4e0bc77cfd03d9e450cce2f18d4e24824910b6
[]
no_license
741978260/springcloud-ecommerce
9f9a699506e0fafab780cdffe8fdfd0723a34edc
2f47957acab4967f97d76b1b7293d7fcde649106
refs/heads/master
2020-04-29T18:59:11.123475
2019-03-19T15:30:19
2019-03-19T15:30:19
176,340,087
0
0
null
2019-03-19T15:30:21
2019-03-18T17:49:31
Java
UTF-8
Java
false
false
500
java
package com.practice.personal; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; /** * Eureka注册中心 */ @SpringBootApplication @EnableEurekaServer//申明此处为服务注册中心。 public class EurekaServerApplication { public static void main(String[] args) { SpringApplication.run(EurekaServerApplication.class, args); } }
[ "741978260@qq.com" ]
741978260@qq.com
4c5fd12320b0a4aae09ea8debc0acaf7cfffbf0f
f2bdbc0f528fbb744ea2f4f76ac1de2056af940a
/java-note-algorithm/src/main/java/com/leosanqing/leetcode/medium/_92_reverseLinkedList2.java
90db87a94ff54fcc57bdda7468dcc1b556694ce5
[]
no_license
krystal-my/Java-Notes
62f5ae1be3f866921303346ac1a3b1b7041dce0d
8a80365e4e05107de0bf190de53b319f4cde593f
refs/heads/master
2022-10-07T09:40:21.662106
2020-06-02T11:50:56
2020-06-02T11:50:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,625
java
package com.leosanqing.leetcode.medium; import java.util.List; /** * @Author: rtliu * @Date: 2020/6/1 下午7:01 * @Package: com.leosanqing.leetcode.medium * @Description: Reverse a linked list from position m to n. Do it in one-pass. * 对反转给定范围的链表节点进行反转,只遍历一遍 * * Note: 1 ≤ m ≤ n ≤ length of list. * * Example: * * Input: 1->2->3->4->5->NULL, m = 2, n = 4 * Output: 1->4->3->2->5->NULL * * @Version: 1.0 */ public class _92_reverseLinkedList2 { public ListNode reverseBetween(ListNode head, int m, int n) { if (head == null) { return null; } // 设置一个虚拟头结点 ListNode fakeHead = new ListNode(0); fakeHead.next = head; ListNode cur1 = fakeHead; ListNode pre1 = null; // 找到 m 的位置 for (int i = 0; i < m; i++) { pre1 = cur1; cur1 = cur1.next; } ListNode next; ListNode pre2 = pre1; ListNode cur2 = cur1; for (int i = 0; i <= n - m; i++) { next = cur2.next; cur2.next = pre2; pre2 = cur2; cur2 = next; } pre1.next = pre2; cur1.next = cur2; return fakeHead.next; } static class ListNode { int val; ListNode next; ListNode() { } ListNode(int val) { this.val = val; } ListNode(int val, ListNode next) { this.val = val; this.next = next; } } }
[ "stormleo@qq.com" ]
stormleo@qq.com
bd60fff505c7b77716caf8b17956a9ec32f3ce49
831bac97031aa48f56881ba4e2fbaf447f773ac6
/src/com/bo/Critere.java
47a5e05fb7830c0a44048a0448e5daf547cec539
[]
no_license
Hiugsor/Eco.Pompe.Library
696ab17a6b60251b137919d37577ab2a61b4c9d3
c5fa6023f204ff0a96fdac3ac2012d29044c2c7b
refs/heads/master
2021-01-10T17:48:58.667655
2016-01-29T08:01:23
2016-01-29T08:01:23
49,564,875
0
0
null
null
null
null
UTF-8
Java
false
false
756
java
package com.bo; public class Critere { private Adresse adresse; private Carburant carburant; private Integer rayon; private Point position; public Critere() { } public void setAdresse(Adresse adresse) { this.adresse = adresse; } public Adresse getAdresse() { return this.adresse; } public void setCarburant(Carburant carburant) { this.carburant = carburant; } public Carburant getCarburant() { return this.carburant; } public void setRayon(Integer rayon) { this.rayon = rayon; } public Integer getRayon() { return this.rayon; } public void setPosition(Point position) { this.position = position; } public Point getPosition() { return this.position; } }
[ "xpunk@mailoo.org" ]
xpunk@mailoo.org
2d1eae6dbd679518a0b687b9d6c361aa04636d8f
dfb2c72e464e5183526faac7402c8f3b923df2eb
/MultithreadPartII_3/app/src/main/java/com/example/kien/multithreadpartii_3/MainActivity.java
c9d2b54f6039d437606bb0d568f0668ec7baebcf
[]
no_license
trungkien26102511/Multithread_baitap
107fe1d00c03a60a40930b5098b16f2653526fd2
2b9c0565c701260a07c966e62fdb94c8b9100a26
refs/heads/master
2021-01-19T00:43:12.309966
2016-11-08T08:31:32
2016-11-08T08:31:32
73,164,011
0
0
null
null
null
null
UTF-8
Java
false
false
2,319
java
package com.example.kien.multithreadpartii_3; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import java.util.Random; public class MainActivity extends AppCompatActivity { private LinearLayout mLinearLayout; private Random mRandom; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mLinearLayout = (LinearLayout)findViewById(R.id.ll_result); mRandom = new Random(); } public void buttonHandler(View clickedButton){ for(int i = 0; i < 5; i++){ FlipperTask task = new FlipperTask(); task.execute(mRandom.nextInt(1000)); } } public class FlipperTask extends AsyncTask<Integer,Void,TextView>{ private int mMaxConsecutive = 0; private int mConsecutiveR = 0; private int mConsecutiveL = 0; @Override protected TextView doInBackground(Integer... params) { int loop = params[0]; for(int i = 1; i <= loop; i++){ int coinHead = mRandom.nextInt(2); if(coinHead == 1){ mConsecutiveR++; mConsecutiveL = 0; }else{ mConsecutiveL++; mConsecutiveR = 0; } if(mConsecutiveL > mMaxConsecutive){ mMaxConsecutive = mConsecutiveL; } if(mConsecutiveR > mMaxConsecutive){ mMaxConsecutive = mConsecutiveR; } try { Thread.sleep(100); } catch (InterruptedException e) {} } TextView tv = getTextView(mMaxConsecutive); return tv; } @Override protected void onPostExecute(TextView textView) { super.onPostExecute(textView); mLinearLayout.addView(textView); } } public TextView getTextView(int max){ TextView tv = new TextView(MainActivity.this); tv.setText("Max consecutive head: " + max); return tv; } }
[ "iniesta113@gmail.com" ]
iniesta113@gmail.com
2016918f33c6a82bfdea3f3edd3d1edf17676768
0ead26a40dca04233da9351ab27e4023482f0010
/Luna_Project/src/main/java/com/formation/model/Test.java
74cef7b5cd08560bfed71ac68e4be5779c45a58e
[]
no_license
johnlomb/Projet-Luna
5ed34582abf9eeee9c7898c9a01a79fb0fca5780
7974595a5095e4e1971da144a045a9121b12892c
refs/heads/master
2021-08-23T19:44:42.851694
2017-12-06T08:26:33
2017-12-06T08:26:33
112,203,030
0
0
null
null
null
null
UTF-8
Java
false
false
105
java
/** * */ package com.formation.model; /** * @author SDJ06 * */ public class Test { }
[ "jonpoke@hotmail.fr" ]
jonpoke@hotmail.fr
dcf8397095d25307b1317bfef807ceeda0e24e62
4bb6ec8e4a5373d0e1660ef3818be61ecda5eace
/src/main/java/com/medical/demo/model/SysRole.java
8c2d1d807fb5770543737139f481641e62b6ecc0
[]
no_license
maaarmot/user
5ea11cd4571605f21c5cf51e263d7d5d859aec3a
f567cb9e892a149a24190b88166e73e025c57fc7
refs/heads/master
2022-06-23T12:45:08.184728
2020-03-28T14:22:39
2020-03-28T14:22:39
250,808,687
0
0
null
2022-06-21T03:04:57
2020-03-28T13:58:44
Java
UTF-8
Java
false
false
2,781
java
package com.medical.demo.model; public class SysRole { /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column sys_role.id * * @mbg.generated Wed Mar 25 21:06:10 CST 2020 */ private Integer id; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column sys_role.name * * @mbg.generated Wed Mar 25 21:06:10 CST 2020 */ private String name; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column sys_role.description * * @mbg.generated Wed Mar 25 21:06:10 CST 2020 */ private String description; /** * This method was generated by MyBatis Generator. * This method returns the value of the database column sys_role.id * * @return the value of sys_role.id * * @mbg.generated Wed Mar 25 21:06:10 CST 2020 */ public Integer getId() { return id; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column sys_role.id * * @param id the value for sys_role.id * * @mbg.generated Wed Mar 25 21:06:10 CST 2020 */ public void setId(Integer id) { this.id = id; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column sys_role.name * * @return the value of sys_role.name * * @mbg.generated Wed Mar 25 21:06:10 CST 2020 */ public String getName() { return name; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column sys_role.name * * @param name the value for sys_role.name * * @mbg.generated Wed Mar 25 21:06:10 CST 2020 */ public void setName(String name) { this.name = name == null ? null : name.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column sys_role.description * * @return the value of sys_role.description * * @mbg.generated Wed Mar 25 21:06:10 CST 2020 */ public String getDescription() { return description; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column sys_role.description * * @param description the value for sys_role.description * * @mbg.generated Wed Mar 25 21:06:10 CST 2020 */ public void setDescription(String description) { this.description = description == null ? null : description.trim(); } }
[ "c752961562@163.com" ]
c752961562@163.com
d4736fecfec73981ee4a603964f2c0bb18af5f27
de41fbdfe660efd7de1482663c4b0a34ba7cfcf3
/src/com/vallantyn/androidspaceshooter/CustomSurfaceView.java
d2385c420fd6c561ee7b96c9f1a850bc5b0b0186
[]
no_license
Vallantyn/AndroidSpaceShooter
25978576bc805dcfa67c6bf24c804862f19ddac2
0e62cdb83db9b9b00dc1faf3b78c76a998a8a74f
refs/heads/master
2021-01-13T02:32:15.887332
2013-07-11T14:03:54
2013-07-11T14:03:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,223
java
/** * La SurfaceView permet d'effectuer tout le traitement propre au rendu (dessin) * sur un autre thread que l'UIThread. Cela permet de ne pas surcharger ce dernier * afin de ne pas ralentir l'affichage � l'�cran. */ package com.vallantyn.androidspaceshooter; import android.content.Context; import android.graphics.Canvas; import android.graphics.PointF; import android.media.MediaPlayer; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.SurfaceView; import com.vallantyn.androidspaceshooter.assets.scenes.SampleScene; import java.util.Calendar; import engine.GameEngine; import engine.Input; import engine.MusicPlayer; import engine.Screen; import engine.SoundFXManager; import engine.Vector2; public class CustomSurfaceView extends SurfaceView implements Runnable { private Thread loopThread; private boolean running; private float dt; private boolean stPress = false; private MediaPlayer mp = null; private Vector2[] touched = new Vector2[10]; public CustomSurfaceView (Context context) { super(context); } public CustomSurfaceView (Context context, AttributeSet attrs) { super(context, attrs); } public CustomSurfaceView (Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public void resume () { // instantier votre Thread ici running = true; if (loopThread == null) { loopThread = new Thread(this); loopThread.start(); } if (!loopThread.isAlive()) { loopThread = new Thread(this); loopThread.start(); } if (mp != null) mp.start(); } public void pause () { if (mp != null) mp.pause(); running = false; } @Override public void run () { long t1 = Calendar.getInstance().getTimeInMillis(); long t2; GameEngine game = GameEngine.getInstance(); Canvas canvas = null; while (running) { t2 = Calendar.getInstance().getTimeInMillis(); dt = t2 - t1; if (!getHolder().getSurface().isValid()) continue; canvas = getHolder().lockCanvas(); Screen.setCanvas(canvas); if (!game.started) { game.setScene(new SampleScene()); game.start(); mp = MediaPlayer.create(getContext(), R.raw.background); mp.setLooping(true); mp.start(); // MusicPlayer.getInstance().loadMusic("music/background.mp3"); } game.update(dt / 1000); game.render(canvas); if (Input.secondTouch) { if (!stPress) { stPress = true; } } else { stPress = false; } getHolder().unlockCanvasAndPost(canvas); t1 = t2; } } @Override public boolean onTouchEvent (MotionEvent event) { // R�cup�rer le type d'action int action = event.getActionMasked(); // R�cup�rer l'index int actionIndex = event.getActionIndex(); // R�cup�rer l'id du pointeur int pointerId = event.getPointerId(actionIndex); switch (action) { case MotionEvent.ACTION_UP: // premier touch uniquement case MotionEvent.ACTION_POINTER_UP: touched[pointerId] = null; if (pointerId == 0) Input.firstTouch = false; if (pointerId == 1) Input.secondTouch = false; break; // autres touch case MotionEvent.ACTION_DOWN: // premier touch uniquement case MotionEvent.ACTION_POINTER_DOWN: for (int i = 0; i < event.getPointerCount(); i++) { touched[event.getPointerId(i)] = new Vector2(event.getX(i), event.getY(i)); if (event.getPointerId(i) == 0) { Input.firstTouch = true; Input.touch = new PointF(event.getX(i), event.getY(i)); } if (event.getPointerId(i) == 1) { Input.secondTouch = true; Input.touch2 = new PointF(event.getX(i), event.getY(i)); } } break; // autres touch case MotionEvent.ACTION_MOVE: for (int i = 0; i < event.getPointerCount(); i++) { touched[event.getPointerId(i)] = new Vector2(event.getX(i), event.getY(i)); if (event.getPointerId(i) == 0) { Input.touch = new PointF(event.getX(i), event.getY(i)); } if (event.getPointerId(i) == 1) { Input.touch2 = new PointF(event.getX(i), event.getY(i)); } } break; // tous les touch } return true; } }
[ "jul.murtin@gmail.com" ]
jul.murtin@gmail.com
5454743a24b1b137d5369574bce84ceefdf19598
9fb90a4bcc514fcdfc0003ed2060e88be831ac26
/src/com/mic/demo/strings/ReplacingStringTokenizer.java
beccbcbae0489fd1fdd07aa6369db3706d4dbda1
[]
no_license
lpjhblpj/FimicsJava
84cf93030b7172b0986b75c6d3e44226edce2019
0f00b6457500db81d9eac3499de31cc980a46166
refs/heads/master
2020-04-24T23:32:16.893756
2019-02-24T14:45:43
2019-02-24T14:45:43
132,058,969
0
0
null
null
null
null
UTF-8
Java
false
false
868
java
//: com.mic.demo.strings/ReplacingStringTokenizer.java package com.mic.demo.strings; /* Added by Eclipse.py */ import java.util.Arrays; import java.util.Scanner; import java.util.StringTokenizer; public class ReplacingStringTokenizer { public static void main(String[] args) { String input = "But I'm not dead yet! I feel happy!"; StringTokenizer stoke = new StringTokenizer(input); while (stoke.hasMoreElements()) System.out.print(stoke.nextToken() + " "); System.out.println(); System.out.println(Arrays.toString(input.split(" "))); Scanner scanner = new Scanner(input); while (scanner.hasNext()) System.out.print(scanner.next() + " "); } } /* Output: But I'm not dead yet! I feel happy! [But, I'm, not, dead, yet!, I, feel, happy!] But I'm not dead yet! I feel happy! *///:~
[ "lpjhblpj@sina.com" ]
lpjhblpj@sina.com
fb84023885eed8743db7a0edcf829291804bac0c
e6228b08cdce48abc7a4d3e3ee824934eaf1d202
/coder-web/src/main/java/com/cz/coder/web/service/PrivilegeService.java
e035cb56f3fff90df15ce99a0635c5fae61f1715
[]
no_license
halikes23/coder
649dfdb5eb0ae3b5a5a00d52f2dd8689439f2084
7644aaf8f00550aa2c7bcbcb7b4fc266c61bdb44
refs/heads/master
2021-01-19T14:27:26.848919
2017-11-06T03:53:44
2017-11-06T03:53:44
100,902,531
0
0
null
null
null
null
UTF-8
Java
false
false
7,613
java
package com.cz.coder.web.service; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.cz.coder.common.constant.RetCode; import com.cz.coder.common.util.JnwtvStringUtils; import com.cz.coder.common.util.MD5Util; import com.cz.coder.web.common.util.page.PageInfo; import com.cz.coder.web.common.util.page.PageUtil; import com.cz.coder.web.dao.dao.privilege.PrivilegeDAO; import com.cz.coder.web.dao.entity.po.AdminPO; import com.cz.coder.web.dao.entity.po.RolePO; import com.cz.coder.web.dao.entity.vo.privilege.AdminVO; import com.cz.coder.web.dao.entity.vo.privilege.ListAdminPrivilegesVO; import com.cz.coder.web.dao.entity.vo.privilege.ListAdminRolesVO; import com.cz.coder.web.dao.entity.vo.privilege.ListRolePrivilegesVO; import com.cz.coder.web.dao.entity.vo.privilege.RoleVO; import com.cz.coder.web.web.form.privilege.AddAdminForm; import com.cz.coder.web.web.form.privilege.AddRoleForm; import com.cz.coder.web.web.form.privilege.SaveAdminForm; import com.cz.coder.web.web.form.privilege.SaveAdminRolesForm; import com.cz.coder.web.web.form.privilege.SaveRoleForm; import com.cz.coder.web.web.form.privilege.SaveRolePrivilegesForm; /** * 权限service * @author zhen.cheng * */ @Service public class PrivilegeService { private final static Logger logger = LoggerFactory.getLogger(PrivilegeService.class) ; private final static String DEFAULT_PASSWORD = MD5Util.encrypt("1") ; @Autowired private PrivilegeDAO privilegeDAO ; /** * 查询所有操作员 * @param param * @return */ public List<AdminVO> queryAllAdmin(Map<String,Object> param) { List<AdminVO> admins = privilegeDAO.selectAdmin(param); return admins ; } /** * 添加操作员 * @param form * @return */ public String addAdmin(AddAdminForm form) { try{ AdminVO admin = privilegeDAO.selectAdminByUserName(form.getUserName()); if( admin != null ){ //return RetCode.ADMIN_HAS_EXISTS ; } AdminPO po = new AdminPO() ; po.setAdminName(form.getUserName()); po.setRealName(form.getRealName()); po.setAdminPhone(form.getPhone()); //新增 po.setMail(form.getMail()); po.setPwd(DEFAULT_PASSWORD); privilegeDAO.insertAdmin(po); return RetCode.SUCCESS ; }catch(Exception e){ logger.error("",e); return RetCode.SYSTEM_ERROR ; } } /** * 删除操作员 * @param adminId * @return */ public String removeAdmin(Integer adminId) { try{ this.privilegeDAO.deleteAdmin(adminId); return RetCode.SUCCESS ; }catch(Exception e){ logger.error("",e); return RetCode.DATABASE_EXCEPTION ; } } public String saveAdmin(SaveAdminForm form) { try{ AdminPO po = new AdminPO() ; po.setaId(form.getAdminId()); po.setRealName(form.getRealName() == null ? "" : form.getRealName()); po.setAdminPhone(form.getAdminPhone()); po.setMail(form.getMail()); this.privilegeDAO.updateAdmin(po); return RetCode.SUCCESS ; }catch(Exception e){ logger.error("",e); return RetCode.DATABASE_EXCEPTION ; } } public List<ListAdminRolesVO> listAdminRoles(Integer adminId) { return this.privilegeDAO.selectRolesWithAdmin(adminId); } public String doSaveAdminRoles(SaveAdminRolesForm form) { try{ this.privilegeDAO.deleteAdminRoles(form.getAdminId()); Map<String,Object> params = new HashMap<String,Object>() ; params.put("creator", form.getCreator()); params.put("adminId", form.getAdminId()) ; params.put("rolesCodes", form.getRolesCodes()) ; this.privilegeDAO.insertAdminRoleRels( params); return RetCode.SUCCESS ; }catch(Exception e){ logger.error("",e); return RetCode.DATABASE_EXCEPTION ; } } public List<RoleVO> queryAllRoles(Map<String, Object> param) { return this.privilegeDAO.selectRoles(param); } public String addRole(AddRoleForm form) { try{ RoleVO role = privilegeDAO.selectRoleByRoleName(form.getRoleName()); if( role != null ){ return RetCode.ROLE_HAS_EXISTS ; } RolePO po = new RolePO() ; po.setRoleName(form.getRoleName()); po.setCreator(form.getCreator()); privilegeDAO.insertRole(po); return RetCode.SUCCESS ; }catch(Exception e){ logger.error("",e); return RetCode.SYSTEM_ERROR ; } } public String doRemoveRole(Integer roleCode) { try{ this.privilegeDAO.deleteRole(roleCode); this.privilegeDAO.deleteAdminRoleRelByRoleCode(roleCode); return RetCode.SUCCESS ; }catch(Exception e){ logger.error("",e); return RetCode.DATABASE_EXCEPTION ; } } public List<ListRolePrivilegesVO> queryRolePrivileges(Integer roleCode) { List<ListRolePrivilegesVO> privileges = privilegeDAO.selectPrivilegesWithRole(roleCode) ; List<ListRolePrivilegesVO> topPrivileges = new ArrayList<ListRolePrivilegesVO>() ; for(ListRolePrivilegesVO priv : privileges){ if( StringUtils.isEmpty(priv.getParentPrivCode()) ){ priv.setChildren(new ArrayList<ListRolePrivilegesVO>()); topPrivileges.add(priv) ; } } for(ListRolePrivilegesVO top : topPrivileges){ for(ListRolePrivilegesVO priv : privileges){ if(!StringUtils.isEmpty(priv.getParentPrivCode())){ if( StringUtils.equals(top.getPrivCode(), priv.getParentPrivCode()) ){ top.getChildren().add(priv) ; } } } } return topPrivileges; } public String doSaveRole(SaveRoleForm form) { RolePO po = new RolePO() ; po.setRoleCode(form.getRoleCode()); po.setRoleName(form.getRoleName()); po.setModifier(form.getModifier()); try{ this.privilegeDAO.updateRole(po); return RetCode.SUCCESS ; }catch(Exception e){ logger.error("",e); return RetCode.DATABASE_EXCEPTION ; } } public String doSaveRolePrivileges(SaveRolePrivilegesForm form) { try{ this.privilegeDAO.deleteRolePrivileges(form.getRoleCode()) ; if(JnwtvStringUtils.isEmpty(form.getPrivilegesCodes())){ return RetCode.SUCCESS ; } Map<String,Object> params = new HashMap<String,Object>() ; params.put("creator", form.getCreator()) ; params.put("privilegesCodes", form.getPrivilegesCodes()); params.put("roleCode", form.getRoleCode()); this.privilegeDAO.insertRolePriviegeRels(params); return RetCode.SUCCESS ; }catch(Exception e){ logger.error("",e); return RetCode.DATABASE_EXCEPTION ; } } public List<ListAdminPrivilegesVO> calAdminPriviletes(Integer userName) { return this.privilegeDAO.selectAdminPriviletes(userName); } public PageInfo<Map<String, Object>> queryUserOperateLogger(Map<String, Object> paramMap) { try { PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String,Object>>(); paramMap.putAll( PageUtil.buildPage( Integer.valueOf(paramMap.get("pageNow").toString() ) , Integer.valueOf(paramMap.get("pageSize").toString() ) ) ) ; // 获取操作人操作记录 List<Map<String , Object>> userRecordings = privilegeDAO.queryUserRecord(paramMap); Integer pageCount = privilegeDAO.queryUserRecordTotals(paramMap) ; pageInfo.setDataList( userRecordings ) ; pageInfo.setDataCount(pageCount); pageInfo.setCurrentlyPageNo(Integer.valueOf( paramMap.get("pageNow").toString()) ); pageInfo.setPageSize( Integer.valueOf( paramMap.get("pageSize").toString())); return pageInfo; } catch (Exception e) { logger.error("错误日志" , e); throw e ; } } }
[ "chengzhen000000@163.com" ]
chengzhen000000@163.com
3789f7a418de3a50022156f4ec3014aa2afe7f9e
1f3b218d2ee211b1ef71f4cf71c7ad3356d61aaa
/src/main/java/com/lovo/service/IMessageService.java
317aac1f1d4ba628c284571464e8292af27386fc
[]
no_license
houmingsong/show1
29f1e54718e450d13e652e7ba9a7c8567f0c5e22
396d451d53d52538625267d76fe67e5895843d81
refs/heads/master
2022-12-23T11:31:42.853874
2019-06-20T22:52:42
2019-06-20T22:52:42
192,992,761
2
0
null
2022-12-16T09:45:29
2019-06-20T22:05:06
JavaScript
UTF-8
Java
false
false
392
java
package com.lovo.service; import java.util.List; import com.lovo.entity.MesEntity; import com.lovo.entity.MessageEntity; public interface IMessageService { public List<MessageEntity> show(int currentpage); public int getTotalPage(); public List<MesEntity> show1(Integer id); public List<MessageEntity> show2(); public List<MessageEntity> QueryAllUsers(); }
[ "castle@192.168.1.108" ]
castle@192.168.1.108
0905ce4b629a7292d7717cfd61a33825e26f3785
ba68f1810869143e2db6eeb3dafa6187968f755e
/src/eficiencia1/GeneraCaso.java
23bfd5a6f2aa7ca1314c3ed068a357c4446529ff
[]
no_license
juanse77/OrdenaVector
9430c7b84a7f5708e01b233930745c1dbf946330
b2c4fcf3107b7e9eeeae95a9a9b3efe55355ed29
refs/heads/master
2021-08-14T05:59:14.314949
2017-11-14T17:44:40
2017-11-14T17:44:40
109,501,642
0
0
null
null
null
null
UTF-8
Java
false
false
744
java
package eficiencia1; public class GeneraCaso { public static int[] generaVector(int tamaño, boolean modo) { int[] res = new int[tamaño]; if (modo) { for (int i = 0; i < tamaño; i++) { res[i] = i + 1; } java.util.Random r = new java.util.Random(); for (int i = 0; i < tamaño; i++) { int pos1 = r.nextInt(tamaño); int pos2 = r.nextInt(tamaño); int aux = res[pos1]; res[pos1] = res[pos2]; res[pos2] = aux; } } else { for (int i = 0; i < tamaño; i++) { res[i] = tamaño - i; } } return res; } }
[ "Juan Ramírez@DESKTOP-H4LOGIE" ]
Juan Ramírez@DESKTOP-H4LOGIE
73d216b2dc8a513c7fc91465ba0bd2a3e11fcb13
7bba85bedf97fa75fff81eda334eb571af161cf9
/Lesson_7/T07.02-Baitap-TaoDatabase/app/src/main/java/com/example/android/orderlist/GuestListAdapter.java
6aa8ad3e2d4b0dc1af1e10c3ea903aa5a1a80ce1
[]
no_license
Kampusvn/ToyApp
b2b954796ae13e9fe5f53729b9eb254ac2c94136
a3275d2229414094d5d837d4112a7c9dc0dba640
refs/heads/master
2021-08-30T20:18:29.894316
2017-12-19T09:14:10
2017-12-19T09:14:10
111,488,996
0
0
null
null
null
null
UTF-8
Java
false
false
2,000
java
package com.example.android.orderlist; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; public class GuestListAdapter extends RecyclerView.Adapter<GuestListAdapter.GuestViewHolder> { private Context mContext; /** * Hàm khởi tạo, sử dụng context và con trỏ db * * @param context context/activity được gọi */ public GuestListAdapter(Context context) { this.mContext = context; } @Override public GuestViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { // Lấy RecyclerView item layout LayoutInflater inflater = LayoutInflater.from(mContext); View view = inflater.inflate(R.layout.guest_list_item, parent, false); return new GuestViewHolder(view); } @Override public void onBindViewHolder(GuestViewHolder holder, int position) { } @Override public int getItemCount() { return 0; } /** * Inner class giữ các view cần thiết để hiển thị một mục duy nhất trong recycler view */ class GuestViewHolder extends RecyclerView.ViewHolder { // Hiển thị tên khách mời TextView nameTextView; // Hiển thị số lượng khách mời TextView partySizeTextView; /** * Constructor của ViewHolder. Trong constructor này, ta lấy reference của * TextViews * * @param itemView View được inflated * {@link GuestListAdapter#onCreateViewHolder(ViewGroup, int)} */ public GuestViewHolder(View itemView) { super(itemView); nameTextView = (TextView) itemView.findViewById(R.id.name_text_view); partySizeTextView = (TextView) itemView.findViewById(R.id.party_size_text_view); } } }
[ "kampuslearntocode@gmail.com" ]
kampuslearntocode@gmail.com
43c433432b07899eecbbaa83624f41ec07d7a298
cdb070cda18931941530d59753336dc9116ac2bc
/algorithmCoding/src/com/nixuan/leetCode/LeetCode201_300/LeetCode0300_最长上升子序列.java
e0e872345efa1f1b42237cfeeaac6c220d2c423f
[]
no_license
Frank-nx/MyLearningRoute
53a746a624039da2c4431adb63c68d732eede302
8f3922ab2647ccd25dd56e57749e33f98243b2dc
refs/heads/master
2021-07-07T22:42:11.793907
2019-03-14T11:36:45
2019-03-14T11:36:45
139,299,744
0
0
null
null
null
null
UTF-8
Java
false
false
1,366
java
package com.nixuan.leetCode.LeetCode201_300; import java.util.Arrays; /** * @program: MyLearningRoute * @description: * @author: nixuan * @create: 2018-11-24 10:04 **/ public class LeetCode0300_最长上升子序列 { public static void main(String[] args) { int[] arr = {3,5,6,2,5,4,19,5,6,7,12}; System.out.println(lengthOfLIS(arr)); } public static int lengthOfLIS(int[] nums) { if(nums == null || nums.length < 1){ return 0; } int[] help = new int[nums.length]; help[0] = nums[0]; int index = 0; for (int i = 1; i < nums.length; i++) { if(help[index] < nums[i]){ help[++index] = nums[i]; }else if(help[index] > nums[i]){ int position = binarySearch(help,index,nums[i]); help[position] = nums[i]; } } return index+1; } private static int binarySearch(int[] help, int index, int num) { int left = 0; int right = index; while(left <= right){ int mid = ((right-left)>>1)+left; if(help[mid] == num){ return mid; } if(help[mid] > num){ right = mid - 1; }else{ left = mid + 1; } } return left; } }
[ "nixuanwb@163.com" ]
nixuanwb@163.com
105ab3df060347314f1606cdb7aa46b54027d0c5
0ff473cf58f6353ebeda0ebed935f77c2952cf2a
/bytecode-test/src/main/java/lsieun/sample/java5_annotation/A_SimpleInterface.java
a0be6839201c07f8c9711989be76bed2ff9227a0
[ "MIT" ]
permissive
lsieun/lsieun-bytecode
36663bd1dc9826b5e8c81365b04ba37c7569c0ed
3752af5393fb8123fe22b72e522a3c554d088b59
refs/heads/master
2021-07-08T11:15:04.547133
2019-11-13T08:11:03
2019-11-13T08:11:03
202,947,962
0
0
MIT
2020-10-13T15:24:28
2019-08-18T01:42:49
Java
UTF-8
Java
false
false
80
java
package lsieun.sample.java5_annotation; public interface A_SimpleInterface { }
[ "331505785@qq.com" ]
331505785@qq.com
bf7072374ba8461f095a25a1bcca6c4ff9ed3d03
359f049e4575dc1ecba21d0e99766f0c4a1534eb
/standard_test/src/main/java/com/Class0911.java
6a10456fe7c5e73487c5ffe002915b134146d150
[]
no_license
CK-qa/IDETest
be9001ffa20b025fc8fd2a54c5b58861349eb81a
7f798d4ab463b075a18bbf278883dd4b3278c430
refs/heads/master
2021-05-10T12:11:21.720178
2019-09-27T10:17:03
2019-09-27T10:17:03
118,434,301
0
0
null
2021-03-31T20:33:12
2018-01-22T09:20:33
Java
UTF-8
Java
false
false
131
java
package com; public class Class0911 { public static void main(String[] args) { System.out.println("lalala"); } }
[ "viktoria.bozhko@jetbrains.com" ]
viktoria.bozhko@jetbrains.com
0786c8749047b5aa930bbb33f01c0c033eb19ebe
85b08f690de3713caee727f2a7cf2852e71732a0
/caprice/sample/src/main/java/net/qiujuer/sample/genius/KitActivity.java
86fd16d6712ac3d46fb73c1167273845deea6175
[ "Apache-2.0" ]
permissive
cqululei/Genius-Android
5472b4907010ea634035e46cd3042133fc5ed5ef
56db09c2dbb1d741a3d6ee10747d6017b02857db
refs/heads/master
2021-01-17T22:11:50.243633
2016-04-10T05:42:41
2016-04-10T05:42:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
16,508
java
package net.qiujuer.sample.genius; import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; import net.qiujuer.genius.kit.Kit; import net.qiujuer.genius.kit.command.Command; import net.qiujuer.genius.kit.net.DnsResolve; import net.qiujuer.genius.kit.net.Ping; import net.qiujuer.genius.kit.net.Telnet; import net.qiujuer.genius.kit.net.TraceRoute; import net.qiujuer.genius.kit.util.FixedList; import net.qiujuer.genius.kit.util.HashKit; import net.qiujuer.genius.kit.util.Log; import net.qiujuer.genius.kit.util.Tools; import net.qiujuer.genius.kit.util.UiKit; import net.qiujuer.genius.ui.widget.Button; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.List; public class KitActivity extends AppCompatActivity implements View.OnClickListener { private static final String TAG = KitActivity.class.getSimpleName(); private TextView mText = null; private Button mAsync; private Button mSync; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_kit); // init bar ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowHomeEnabled(true); } // Init to use // 初始化使用 Kit.initialize(getApplication()); mAsync = (Button) findViewById(R.id.btn_async); mSync = (Button) findViewById(R.id.btn_sync); mText = (TextView) findViewById(R.id.text); mAsync.setOnClickListener(this); mSync.setOnClickListener(this); // Add callback // 添加回调显示 Log.addCallbackListener(new Log.LogCallbackListener() { @Override public void onLogArrived(final Log data) { try { // Async to show // 异步显示到界面 UiKit.runOnMainThreadAsync(new Runnable() { @Override public void run() { if (mText != null) mText.append("\n" + data.getMsg()); } }); } catch (Exception e) { e.printStackTrace(); } } }); // Start testLog(); testTool(); testToolKit(); testHashUtils(); testFixedList(); testNetTool(); testCommand(); } @Override protected void onDestroy() { super.onDestroy(); mText = null; mRunAsyncThread = false; mRunSyncThread = false; // Dispose when you don't use Kit.dispose(); } /** * Test Tool */ private void testToolKit() { // Synchronous mode in the main thread when operating the child thread will enter the waiting, // until the main thread processing is completed // 同步模式在主线程操作时子线程将进入等待,直到主线程处理完成 // Asynchronous mode the child thread parallel operation with the main thread, don't depend on each other // 异步模式子线程与主线程并行操作,不相互依赖等待 Thread thread = new Thread(new Runnable() { @Override public void run() { String msg = "ToolKit:"; long start = System.currentTimeMillis(); // Test synchronization mode, // in this mode method first to execute commands on the queue, waiting for the main thread // 测试同步模式,在该模式下 // 该方法首先会将要执行的命令放到队列中,等待主线程执行 UiKit.runOnMainThreadSync(new Runnable() { @Override public void run() { Tools.sleepIgnoreInterrupt(20); } }); msg += "Sync Time:" + (System.currentTimeMillis() - start) + ", "; start = System.currentTimeMillis(); // Test asynchronous mode, // in this mode the child thread calls the method added to the queue, can continue to go down, will not be blocked // 测试异步模式,在该模式下 // 子线程调用该方法加入到队列后,可继续往下走,并不会阻塞 UiKit.runOnMainThreadAsync(new Runnable() { @Override public void run() { Tools.sleepIgnoreInterrupt(20); } }); msg += "Async Time:" + (System.currentTimeMillis() - start) + " "; Log.v(TAG, msg); } }); thread.start(); } private void testTool() { Log.i(TAG, "ToolKit: getAndroidId: " + Tools.getAndroidId(Kit.getApplication())); Log.i(TAG, "ToolKit: getSerialNumber: " + Tools.getSerialNumber()); } /** * Log */ private void testLog() { // Whether to call system Android Log, release can be set to false // 是否调用系统Android Log,发布时可设置为false Log.setCallLog(true); // Clear the storage file // 清理存储的文件 Log.clearLogFile(); // Whether open is written to the file, stored maximum number of files, a single file size (Mb) // 是否开启写入文件,存储最大文件数量,单个文件大小(Mb) Log.setSaveLog(true, 10, 1); // Set whether to monitor external storage inserts // 设置是否监听外部存储插入操作 // Open when inserting an external device (SD) to store the log file copy to external storage devices // 开启时插入外部设备(SD)时将拷贝存储的日志文件到外部存储设备 // This operation depends on whether written to the file open function, the method is invalid when not open // 此操作依赖于是否开启写入文件功能,未开启则此方法无效 // Parameters: whether open, SD card catalog // 参数: 是否开启,SD卡目录 Log.setCopyExternalStorage(true, "Test/Logs"); // Set show log level // 设置显示日志等级 // VERBOSE: 5 ERROR:1, decline in turn // VERBOSE为5到ERROR为1依次递减 Log.setLevel(Log.ALL); Log.v(TAG, "LOG VERBOSE Level"); Log.d(TAG, "LOG DEBUG Level"); Log.i(TAG, "LOG INFO Level"); Log.w(TAG, "LOG WARN Level"); Log.e(TAG, "LOG ERROR Level"); Log.setLevel(Log.INFO); Log.v(TAG, "LOG VERBOSE Level"); Log.d(TAG, "LOG DEBUG Level"); Log.i(TAG, "LOG INFO Level"); Log.w(TAG, "LOG WARN Level"); Log.e(TAG, "LOG ERROR Level"); Log.setLevel(Log.ALL); } /** * MD5 */ private void testHashUtils() { Log.i(TAG, "HashUtils: QIUJUER's MD5: " + HashKit.getMD5String("QIUJUER")); //HashUtils.getMD5String(new File("FilePath")); } /** * FixedList * 固定长度队列 */ private void testFixedList() { // Init max length 5 // 初始化最大长度为5 FixedList<Integer> list = new FixedList<Integer>(5); Log.i(TAG, "FixedList:" + list.size() + " ," + list.getMaxSize()); // Add // 添加4个元素 list.add(1); list.add(2); list.add(3); list.add(4); Log.i(TAG, "FixedList:" + list.size() + " ," + list.getMaxSize()); // 继续追加2个 list.add(5); list.add(6); Log.i(TAG, "FixedList:" + list.size() + " ," + list.getMaxSize()); // Changed MaxSize // 调整最大长度 list.setMaxSize(6); list.add(7); Log.i(TAG, "FixedList:" + list.size() + " ," + list.getMaxSize()); list.add(8); Log.i(TAG, "FixedList:" + list.size() + " ," + list.getMaxSize()); // Narrow length, automatically deletes the spare parts // 缩小长度,自动删除前面多余部分 list.setMaxSize(3); Log.i(TAG, "FixedList:" + list.size() + " ," + list.getMaxSize()); list.add(9); Log.i(TAG, "FixedList:" + list.size() + " ," + list.getMaxSize()); // Add a list, automatically remove unwanted parts // 添加一个列表进去,自动删除多余部分 List<Integer> addList = new ArrayList<Integer>(); addList.add(10); addList.add(11); addList.add(12); addList.add(13); list.addAll(addList); Log.i(TAG, "FixedList:AddList:" + list.toString() + " " + list.size() + " ," + list.getMaxSize()); // Using poll pop-up elements // 采用poll方式弹出元素 Log.i(TAG, "FixedList:Poll:[" + list.poll() + "] " + list.size() + " ," + list.getMaxSize()); Log.i(TAG, "FixedList:Poll:[" + list.poll() + "] " + list.size() + " ," + list.getMaxSize()); Log.i(TAG, "FixedList:Poll:[" + list.poll() + "] " + list.size() + " ," + list.getMaxSize()); // Add to end insert // 末尾插入元素与add一样 list.addLast(14); list.addLast(15); list.addLast(16); list.addLast(17); list.addLast(18); Log.i(TAG, "FixedList:AddLast:" + list.toString() + " " + list.size() + " ," + list.getMaxSize()); // From the head insert, delete the default tail beyond part // 从头部插入,默认删除尾部超出部分 list.addFirst(19); list.addFirst(20); Log.i(TAG, "FixedList:AddFirst:" + list.toString() + " " + list.size() + " ," + list.getMaxSize()); // Clear // 清空操作 list.clear(); Log.i(TAG, "FixedList:Clear:" + list.toString() + " " + list.size() + " ," + list.getMaxSize()); // List // 使用List操作,最大长度2 List<Integer> list1 = new FixedList<Integer>(2); list1.add(1); list1.add(2); Log.i(TAG, "FixedList:List:" + " " + list1.size() + " ," + list1.toString()); list1.add(3); Log.i(TAG, "FixedList:List:" + " " + list1.size() + " ," + list1.toString()); list1.add(4); Log.i(TAG, "FixedList:List:" + " " + list1.size() + " ," + list1.toString()); list1.clear(); Log.i(TAG, "FixedList:List:" + " " + list1.size() + " ," + list1.toString()); } /** * Command * 测试命令行执行 */ private void testCommand() { // Sync // 同步 Thread thread = new Thread() { public void run() { // The same way call way and the ProcessBuilder mass participation // 调用方式与ProcessBuilder传参方式一样 Command command = new Command(Command.TIMEOUT, "/system/bin/ping", "-c", "4", "-s", "100", "www.baidu.com"); String res = Command.command(command); Log.i(TAG, "\n\nCommand Sync: " + res); } }; thread.setDaemon(true); thread.start(); // Async // 异步 Command command = new Command("/system/bin/ping", "-c", "4", "-s", "100", "www.baidu.com"); // Asynchronous execution using callback methods, // do not need to build a thread // callback by listener // 异步方式执行 // 采用回调方式,无需自己建立线程 // 传入回调后自动采用此种方式 Command.command(command, new Command.CommandListener() { @Override public void onCompleted(String str) { Log.i(TAG, "\n\nCommand Async onCompleted: \n" + str); } @Override public void onCancel() { Log.i(TAG, "\n\nCommand Async onCancel"); } @Override public void onError(Exception e) { Log.i(TAG, "\n\nCommand Async onError:" + (e != null ? e.toString() : "null")); } }); } /** * NetTool * 基本网络功能测试 */ public void testNetTool() { Thread thread = new Thread() { public void run() { // Packets, Packet size,The target,Whether parsing IP // 包数,包大小,目标,是否解析IP Ping ping = new Ping(4, 32, "www.baidu.com", true); ping.start(); Log.i(TAG, "Ping: " + ping.toString()); // target // 目标,可指定解析服务器 DnsResolve dns = null; try { // Add DNS service // 添加DNS服务器 dns = new DnsResolve("www.baidu.com", InetAddress.getByName("202.96.128.166")); dns.start(); Log.i(TAG, "DnsResolve: " + dns.toString()); } catch (UnknownHostException e) { e.printStackTrace(); } // target port // 目标,端口 Telnet telnet = new Telnet("www.baidu.com", 80); telnet.start(); Log.i(TAG, "Telnet: " + telnet.toString()); // target // 目标 TraceRoute traceRoute = new TraceRoute("www.baidu.com"); traceRoute.start(); Log.i(TAG, "\n\nTraceRoute: " + traceRoute.toString()); } }; thread.setDaemon(true); thread.start(); } private boolean mRunAsyncThread = false; private boolean mRunSyncThread = false; @Override public void onClick(View v) { if (v.getId() == R.id.btn_async) { if (mRunAsyncThread) { mRunAsyncThread = false; return; } mRunAsyncThread = true; Thread thread = new Thread("ASYNC-ADD-THREAD") { long count = 0; @Override public void run() { super.run(); while (mRunAsyncThread && count < 10000) { add(); Tools.sleepIgnoreInterrupt(0, 500); } } private void add() { count++; final long cur = count; UiKit.runOnMainThreadAsync(new Runnable() { @Override public void run() { mAsync.setText(cur + "/" + getCount()); } }); } public long getCount() { return count; } }; thread.start(); } else if (v.getId() == R.id.btn_sync) { if (mRunSyncThread) { mRunSyncThread = false; return; } mRunSyncThread = true; Thread thread = new Thread("SYNC-ADD-THREAD") { long count = 0; @Override public void run() { super.run(); while (mRunSyncThread && count < 10000) { add(); Tools.sleepIgnoreInterrupt(0, 500); } } private void add() { count++; final long cur = count; UiKit.runOnMainThreadSync(new Runnable() { @Override public void run() { mSync.setText(cur + "/" + getCount()); } }); } public long getCount() { return count; } }; thread.start(); } } @Override public boolean onSupportNavigateUp() { onBackPressed(); return true; } }
[ "qiujuer@live.cn" ]
qiujuer@live.cn
398415d912f9fe9eeb41b72b37fb929c8297a2d5
a3387588d129bd4b396d8473847708a076f255de
/auth-service/src/main/java/com/tsys/poc/auth/controller/TestController.java
24f44fc12a8dc6ef4faf317bff4c1860f43a3024
[]
no_license
ayushjain14377/awsmicroservices
35acdb30b20f66e9f99fda3246a83a04b2dcd1d2
5503aeab4f3d70a630e7d12a9cac09663c1a5fd0
refs/heads/main
2023-01-12T09:25:12.596142
2020-11-09T22:05:43
2020-11-09T22:05:43
309,100,508
2
0
null
2020-11-01T13:20:52
2020-11-01T13:20:51
null
UTF-8
Java
false
false
784
java
package com.tsys.poc.auth.controller; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.tsys.poc.auth.service.TestService; import lombok.AllArgsConstructor; @RestController @RequestMapping("/api/validate") @AllArgsConstructor public class TestController { TestService testService; @PostMapping("/token") public ResponseEntity<String> signup(@RequestBody String username) { String result =testService.save(username); return new ResponseEntity<>(result, HttpStatus.OK); } }
[ "shsinghal@tsys.com" ]
shsinghal@tsys.com
366c3935228293114fdf35fd34579434b5a57929
e7afcaae4162e9fdb20f8606a08c913526be290e
/src/main/java/com/zzzhc/routing/annotation/Delete.java
08da0ffe2a76a958d38fd55e8a970e73aabb17f2
[]
no_license
rack-java/jrack
e6fcbef07f3a56e7ebb0c4faafe4b4b74afd4fc3
36455e1718b4e1c45be710bbf7fb351942294daf
refs/heads/master
2016-09-10T19:03:31.312353
2013-01-05T08:17:34
2013-01-05T08:17:34
6,938,277
3
0
null
null
null
null
UTF-8
Java
false
false
328
java
package com.zzzhc.routing.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target({ ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) public @interface Delete { String value() default ""; }
[ "zzzhc.starfire@gmail.com" ]
zzzhc.starfire@gmail.com
9e6d991cfc3c2ff7747656cf2e65167e992afbd3
b0ab739109867a9a8348f57625b373f20d43835b
/Lesson 24/src/exercises.java
4490c8f58b5b9eb8720c029a48df1bf9b4c8f121
[]
no_license
Jumaiza/AP-Comp-Sci
76b794885aa694d09a91b7827d72a5c719763a1e
c3e12219f679eb5decd1afd9be5a43d4b44909c2
refs/heads/master
2021-06-26T02:09:24.496881
2020-02-20T17:10:54
2020-02-20T17:10:54
215,580,220
0
0
null
null
null
null
UTF-8
Java
false
false
196
java
public class exercises { public static void main(String[] args) { // TODO Auto-generated method stub for(int k = 0; k!=7; k += 3) { System.out.print(k + " "); } } }
[ "zabujumaiza@HS-D210-07.MOHS.local" ]
zabujumaiza@HS-D210-07.MOHS.local
5b4bd3c3ad19dc487e7194ddb48f0839e8faa228
c8147245186c1c4ba86d62871e3f43e2d33c7d17
/src/main/java/Global.java
c9c506b04dc2303ac0e29f3c2a70c1e5d7bc939e
[]
no_license
ceo-domido/TWS
acb28a4aad6f084ad8a0870d1ef0d34985c75f24
ffbb8ec48a827137d74af67d96ca59966f689066
refs/heads/master
2020-04-15T01:48:43.004311
2019-02-10T14:00:45
2019-02-10T14:00:45
164,292,216
0
0
null
null
null
null
UTF-8
Java
false
false
78
java
public class Global { public static final int HISTORY_MONTH_DEPTH = 12; }
[ "ceo@domido.com" ]
ceo@domido.com
baff76150b8979c783d36fdfc12d269cf61503d7
1619dc708feb780cc89b21b30ea0dffca91aec7f
/src/StartStopAppiumServer.java
f579f5ba8cd7067ed03981a4677a5841a7810ca6
[]
no_license
ashutoshdobhal/WebDriverMaven
4e1482083b9c670654eb62dcbbc581583c139831
bd91a507776461dc5cf3a681d9ea33ac639f6572
refs/heads/master
2021-05-03T06:31:12.350285
2018-02-08T05:47:26
2018-02-08T05:47:26
120,595,996
0
0
null
null
null
null
UTF-8
Java
false
false
4,302
java
import io.appium.java_client.remote.MobileCapabilityType; import io.appium.java_client.service.local.AppiumDriverLocalService; import io.appium.java_client.service.local.AppiumServiceBuilder; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class StartStopAppiumServer { WebDriver driver; AppiumDriverLocalService appiumService; String appiumServiceUrl; @BeforeTest public void setUp() throws MalformedURLException { // Start Appium Service appiumService = AppiumDriverLocalService .buildService(new AppiumServiceBuilder() .usingAnyFreePort() .usingDriverExecutable( new File( "C:\\Program Files\\nodejs\\node.exe")) .withAppiumJS( new File( "C:/Program Files (x86)/Appium/node_modules/appium/bin/appium.js"))); appiumService.start(); appiumServiceUrl = appiumService.getUrl().toString(); System.out.println("Appium Service Address : - " + appiumServiceUrl); // Created object of DesiredCapabilities class. DesiredCapabilities capabilities = new DesiredCapabilities(); // Set android deviceName desired capabilitcy. Set your device name. // capabilities.setCapability("deviceName", "c8c5d8f6"); capabilities .setCapability(MobileCapabilityType.DEVICE_NAME, "c8c5d8f6"); // Set BROWSER_NAME desired capability. It's Android in our case here. capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android"); // Set android VERSION desired capability. Set your mobile device's OS // version. capabilities.setCapability("platformVersion", "5.1.1"); // Set android platformName desired capability. It's Android in our case // here. capabilities.setCapability("platformName", "Android"); capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, "100"); // Set android appPackage desired capability. It is // com.android.calculator2 for calculator application. // Set your application's appPackage if you are using any other app. capabilities.setCapability("appPackage", "com.android.calculator2"); // Set android appActivity desired capability. It is // com.android.calculator2.Calculator for calculator application. // Set your application's appPackage if you are using any other app. capabilities.setCapability("appActivity", "com.android.calculator2.Calculator"); // Created object of RemoteWebDriver will all set capabilities. // Set appium server address and port number in URL string. // It will launch calculator app in android device. // driver = new RemoteWebDriver(new // URL("http://127.0.0.1:4723/wd/hub"),capabilities); driver = new RemoteWebDriver(new URL(appiumServiceUrl), capabilities); capabilities.setCapability("fullReset", true); driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS); } @Test public void Sum() { // Click on DELETE/CLR button to clear result text box before running // test. driver.findElements( By.xpath("//android.widget.ImageButton[contains(@resource-id,'clear')]")) .get(0).click(); // Click on number 2 button. driver.findElement(By.id("com.android.calculator2:id/digit2")).click(); // Click on + button. driver.findElement(By.id("com.android.calculator2:id/plus")).click(); // Click on number 5 button. driver.findElement(By.id("com.android.calculator2:id/digit5")).click(); // Click on = button. driver.findElement(By.id("com.android.calculator2:id/equal")).click(); // Get result from result text box. String result = driver.findElement( By.className("android.widget.EditText")).getText(); System.out.println("Number sum result is : " + result); } @AfterTest public void End() { System.out.println("Stop driver"); driver.quit(); System.out.println("Stop appium service"); appiumService.stop(); } }
[ "Ashutosh.Dobhal@commdel.local" ]
Ashutosh.Dobhal@commdel.local
7756d9d1b5dd2fa61039388c093148454c5abb79
39b6c8baf75d5b11cd198f017d5e885a9c047335
/src/main/java/com/shortrent/myproject/service/HURelateService.java
90cab13d68d789cad1c71588b187bef1f9a44151
[]
no_license
ipalpiter/public
82428888eea0db73314073750f138688ec0a7cdb
ce7832eb9c42f9c2f19e30a722c8d7b5b4024f16
refs/heads/master
2022-03-02T14:40:00.009673
2019-09-17T02:11:08
2019-09-17T02:11:08
208,938,696
0
0
null
null
null
null
UTF-8
Java
false
false
358
java
package com.shortrent.myproject.service; import com.shortrent.myproject.generator.model.HURelate; import java.util.List; public interface HURelateService { void saveHURelate(HURelate huRelate); void deleteHURelate(Integer rId); HURelate getHURelate(Integer rId); void updateHURelate(HURelate huRelate); List<HURelate> getAll(); }
[ "971839627@qq.com" ]
971839627@qq.com