blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
dd96ce551be2f25d4cef65eaa4cc44fd624dbdd2
9593e7a5f802dc2b81469e203d9f19e5ca88fcd1
/IsPrimeNumber/test/TestShopingCart.java
888b6e4f2be3304bf67c756918d86ef37707d88d
[]
no_license
bankjirapan/WebPrograming
9252244696b04551fd8a23d1e04f3d9be39f360b
b7cc2c0617876204929bbaee86df896da776ab64
refs/heads/master
2020-03-25T15:29:56.976274
2018-10-12T02:43:38
2018-10-12T02:43:38
143,885,935
0
0
null
null
null
null
UTF-8
Java
false
false
1,659
java
import Model.LineItems; import Model.ShopingCart; import java.util.List; import sit.int303.mockup.model.Product; /* * 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. */ /** * * @author INT303 */ public class TestShopingCart { public static void main(String[] args) { ShopingCart cart = new ShopingCart(); Product p = new Product(); p.setProductCode("S19_111"); p.setProductName("Computer"); p.setMsrp(100.0); cart.add(p); cart.add(p); p = new Product(); p.setProductCode("S19_112"); p.setProductName("Macbook"); p.setMsrp(15.0); cart.add(p); cart.add(p); cart.add(p); List<LineItems> lines = cart.getLineItems(); for (LineItems line : lines) { System.out.printf("%-8s %-15s %8.2f %2d %10.2f\n",line.getProduct().getProductCode(),line.getProduct().getProductName(),line.getSalePrice(),line.getQuantity(),line.getTotalPrice()); } System.out.println("Total price : " + cart.getTotalPrice()); System.out.println("Total Quantity :" + cart.getTotalQuantity()); cart.remove("S19_111"); System.out.println("Total price : " + cart.getTotalPrice()); System.out.println("Total Quantity :" + cart.getTotalQuantity()); cart.remove(p); System.out.println("Total price : " + cart.getTotalPrice()); System.out.println("Total Quantity :" + cart.getTotalQuantity()); } }
[ "jirapan_yankhan@hotmail.com" ]
jirapan_yankhan@hotmail.com
8950ea162cd138a3bc3a62890e6d18081cb4cc3d
f7def0ab5b7bfbb0f2f9fbb989238f09bf18a93f
/servlet/src/main/java/io/undertow/servlet/api/LoggingExceptionHandler.java
3357b1d9ce1c902c733ca01d0fd510c91b86af9f
[ "Apache-2.0" ]
permissive
stuartwdouglas/undertow
9f12ead5426c05b7414dac33b66663fc8112298d
1609b26b67030f9ca5a62869f5088087f2d1ecbf
refs/heads/master
2023-01-11T00:33:15.464202
2020-07-28T06:26:37
2020-07-28T06:26:37
5,106,225
1
1
Apache-2.0
2020-07-30T11:07:44
2012-07-19T06:22:19
Java
UTF-8
Java
false
false
5,598
java
/* * JBoss, Home of Professional Open Source. * Copyright 2014 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.undertow.servlet.api; import io.undertow.UndertowLogger; import io.undertow.server.HttpServerExchange; import io.undertow.servlet.ExceptionLog; import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.Map; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; /** * An exception handler that * * * @author Stuart Douglas */ public class LoggingExceptionHandler implements ExceptionHandler { public static final LoggingExceptionHandler DEFAULT = new LoggingExceptionHandler(Collections.<Class<? extends Throwable>, ExceptionDetails>emptyMap()); private final Map<Class<? extends Throwable>, ExceptionDetails> exceptionDetails; public LoggingExceptionHandler(Map<Class<? extends Throwable>, ExceptionDetails> exceptionDetails) { this.exceptionDetails = exceptionDetails; } @Override public boolean handleThrowable(HttpServerExchange exchange, ServletRequest request, ServletResponse response, Throwable t) { ExceptionDetails details = null; if (!exceptionDetails.isEmpty()) { Class c = t.getClass(); while (c != null && c != Object.class) { details = exceptionDetails.get(c); if (details != null) { break; } c = c.getSuperclass(); } } ExceptionLog log = t.getClass().getAnnotation(ExceptionLog.class); if (details != null) { Logger.Level level = details.level; Logger.Level stackTraceLevel = details.stackTraceLevel; String category = details.category; handleCustomLog(exchange, t, level, stackTraceLevel, category); } else if (log != null) { Logger.Level level = log.value(); Logger.Level stackTraceLevel = log.stackTraceLevel(); String category = log.category(); handleCustomLog(exchange, t, level, stackTraceLevel, category); } else if (t instanceof IOException) { //we log IOExceptions at a lower level //because they can be easily caused by malicious remote clients in at attempt to DOS the server by filling the logs UndertowLogger.REQUEST_IO_LOGGER.debugf(t, "Exception handling request to %s", exchange.getRequestURI()); } else { UndertowLogger.REQUEST_LOGGER.exceptionHandlingRequest(t, exchange.getRequestURI()); } return false; } private void handleCustomLog(HttpServerExchange exchange, Throwable t, Logger.Level level, Logger.Level stackTraceLevel, String category) { BasicLogger logger = UndertowLogger.REQUEST_LOGGER; if (!category.isEmpty()) { logger = Logger.getLogger(category); } boolean stackTrace = true; if (stackTraceLevel.ordinal() > level.ordinal()) { if (!logger.isEnabled(stackTraceLevel)) { stackTrace = false; } } if (stackTrace) { logger.logf(level, t, "Exception handling request to %s", exchange.getRequestURI()); } else { logger.logf(level, "Exception handling request to %s: %s", exchange.getRequestURI(), t.getMessage()); } } private static class ExceptionDetails { final Logger.Level level; final Logger.Level stackTraceLevel; final String category; private ExceptionDetails(Logger.Level level, Logger.Level stackTraceLevel, String category) { this.level = level; this.stackTraceLevel = stackTraceLevel; this.category = category; } } public static Builder builder() { return new Builder(); } public static final class Builder { private final Map<Class<? extends Throwable>, ExceptionDetails> exceptionDetails = new HashMap<>(); Builder() {} public Builder add(Class<? extends Throwable> exception, String category, Logger.Level level) { exceptionDetails.put(exception, new ExceptionDetails(level, Logger.Level.FATAL, category)); return this; } public Builder add(Class<? extends Throwable> exception, String category) { exceptionDetails.put(exception, new ExceptionDetails(Logger.Level.ERROR, Logger.Level.FATAL, category)); return this; } public Builder add(Class<? extends Throwable> exception, String category, Logger.Level level, Logger.Level stackTraceLevel) { exceptionDetails.put(exception, new ExceptionDetails(level, stackTraceLevel, category)); return this; } public LoggingExceptionHandler build() { return new LoggingExceptionHandler(exceptionDetails); } } }
[ "stuart.w.douglas@gmail.com" ]
stuart.w.douglas@gmail.com
0302bb3c8c8d38a8aee07b5f3e82ff0edf033868
1176e2212a13cf2f90d984c776a56295022d260d
/SZASServer/src/com/szas/server/gwt/client/universalwidgets/FieldDataWidget.java
2f2e15fd24f30299369d792f7be63e169a0a73fb
[ "Apache-2.0" ]
permissive
jacek-marchwicki/SZAS-form
e65cb838c596596abc746af02fd46ea6107b9bfc
6ba54aee349fefc136ea72b04f44d1fcde6cb283
refs/heads/master
2020-04-06T06:55:34.849272
2011-06-13T01:39:36
2011-06-13T01:39:36
1,524,867
0
0
null
null
null
null
UTF-8
Java
false
false
238
java
package com.szas.server.gwt.client.universalwidgets; import com.google.gwt.user.client.ui.Composite; public abstract class FieldDataWidget extends Composite{ public abstract void updateField(); public abstract void updateWidget(); }
[ "jacek@3made.eu" ]
jacek@3made.eu
c5462ef74a62b56fd694310dfea432218dd9a174
cc4771944378976f4d1c5798d49c0daab8ba2a19
/chapter_007/src/main/java/ru/job4j/vacancy/VacancyCollector.java
fd2aef6878fdf8745e380bb00b3e6d863acef607
[]
no_license
svedentsov/job4j
6c61141bfbae4f9731bfcaecef8cb46aa9268e3d
e586e84121090d8a9fa9cd7815aca3ec83244668
refs/heads/master
2023-03-04T10:51:38.860139
2022-02-13T18:01:57
2022-02-13T18:01:57
202,960,433
0
0
null
2023-02-22T08:38:25
2019-08-18T04:40:38
Java
UTF-8
Java
false
false
794
java
package ru.job4j.vacancy; import org.quartz.SchedulerException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Main executable class to start sql.ru vacancy parser */ public class VacancyCollector { private static final Logger LOG = LoggerFactory.getLogger(VacancyCollector.class); public static void main(String[] args) { JobMainStarter jobMainStarter = new JobMainStarter(args); try { var message = jobMainStarter.start(VacancyCollectorJob.class); LOG.info(message); } catch (Exception e) { jobMainStarter.handleException(LOG, e); try { jobMainStarter.shutdown(false); } catch (SchedulerException ex) { // ignored } } } }
[ "svedentsov@gmail.com" ]
svedentsov@gmail.com
9c1622d882cbee24728972594c36dafea5580bd9
aef1962d16636a4390f3eba580674cb521f5220e
/com.ibm.profiler.jdbc/src/main/java/com/ibm/issw/jdbc/profiler/JdbcUtilities.java
560ae8cad311a947021934c8d31e721eb45ec536
[ "Apache-2.0" ]
permissive
dd00f/ibm-performance-monitor
d88d816ece019ed2e0c0bb1999f0831fde196f26
34c1a2a8a2930355174fac0822542f55f73a6c85
refs/heads/master
2022-07-11T04:10:13.485886
2022-07-05T19:49:27
2022-07-05T19:49:27
68,019,127
8
5
Apache-2.0
2022-07-05T19:49:28
2016-09-12T14:57:12
Java
UTF-8
Java
false
false
1,740
java
/* * Copyright 2017 Steve McDuff * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.ibm.issw.jdbc.profiler; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Enumeration; import java.util.logging.Logger; import com.ibm.commerce.cache.LoggingHelper; /** * JDBC profiling utility methods. */ public class JdbcUtilities { private static final String CLASSNAME = JdbcUtilities.class.getName(); private static final Logger LOGGER = Logger.getLogger(CLASSNAME); /** * Utility method to remove all the registered JDBC drivers from the driver * manager. Used to ensure that the instrumented version of the drivers * takes precedence over the standard ones. */ public void clearRegisteredJdbcDrivers() { final String methodName = "clearRegisteredJdbcDrivers()"; Enumeration<Driver> drivers = DriverManager.getDrivers(); while (drivers.hasMoreElements()) { Driver nextElement = drivers.nextElement(); try { DriverManager.deregisterDriver(nextElement); } catch (SQLException e) { LoggingHelper.logUnexpectedException(LOGGER, CLASSNAME, methodName, e); } } } }
[ "mcduffs@ca.ibm.com" ]
mcduffs@ca.ibm.com
5b813250bb1fcb56f13c26b24181312ee40caea7
612f8a3a3a7f319d9d47eaed84880bf7a21a4e70
/java/linkdeList/ll.java
1b91dfde724d999c19308963c09f139a1fc06277
[]
no_license
albertin0/coding
ab7b82e4e27c1f9eab94d66eeb2d0b614494b0f8
e4ced3127596958c6b233772097f101ec6093d84
refs/heads/master
2021-01-10T14:27:22.672157
2016-04-09T15:25:28
2016-04-09T15:25:28
49,198,001
0
0
null
null
null
null
UTF-8
Java
false
false
208
java
public class ll { public static void main(String args[]) { node n1; n1= new node(3); n1.next= new node(4); while(n1.item!=4) { System.out.println(n1.item); n1=n1.next; } } }
[ "albertino1903@gmail.com" ]
albertino1903@gmail.com
e1ad5164b5a5ebfee5a7043d3fd94bc0dfc098bc
20e86f3481969bd6e8eb1eda20672e3a2cd22e43
/PlanIT/app/src/main/java/model/TeamMemebershipDTO.java
442f47fa8f28aa45102120eb48034703be2cd9bc
[ "MIT" ]
permissive
majak96/planIT
fd26e3bfecc1ea65a090d7ab6fcc3c628d01ba6b
cf57f2e386aecca8abd45c59d7dee79f250e6845
refs/heads/master
2022-11-18T22:31:08.443018
2020-07-11T18:41:39
2020-07-11T18:41:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,070
java
package model; public class TeamMemebershipDTO { private Long memebrshipId; private String userEmail; private Long teamId; public TeamMemebershipDTO() { } public TeamMemebershipDTO(Long globalId, String userEmail, Long teamId) { super(); this.memebrshipId = globalId; this.userEmail = userEmail; this.teamId = teamId; } public Long getMemebrshipId() { return memebrshipId; } public void setMemebrshipId(Long memebrshipId) { this.memebrshipId = memebrshipId; } public Long getGlobalId() { return memebrshipId; } public void setGlobalId(Long globalId) { this.memebrshipId = globalId; } public String getUserEmail() { return userEmail; } public void setUserEmail(String userEmail) { this.userEmail = userEmail; } public Long getTeamId() { return teamId; } public void setTeamId(Long teamId) { this.teamId = teamId; } @Override public String toString() { return "TeamMemebershipDTO{" + "memebrshipId=" + memebrshipId + ", userEmail='" + userEmail + '\'' + ", teamId=" + teamId + '}'; } }
[ "marijanamatkovski@uns.ac.rs" ]
marijanamatkovski@uns.ac.rs
0686191465e76691dea702fab082edb9632252a8
d00e4e33eba0bc886638290bb7b2f5375456d57d
/src/main/java/com/how2java/tmall/service/impl/UserServiceImpl.java
49a2f7a507e97456a0355e3033e727f5fdc7ac87
[]
no_license
ckj662262/tmall_ssm
e28c5403c3cf60e31f15cdb07cf2d2e71a5bdcb0
bcc6b93d4a259678ee32fd0c367773612ad2af19
refs/heads/master
2022-12-22T19:23:08.791847
2020-09-30T02:03:19
2020-09-30T02:03:52
299,785,695
0
0
null
null
null
null
UTF-8
Java
false
false
1,735
java
package com.how2java.tmall.service.impl; import com.how2java.tmall.mapper.UserMapper; import com.how2java.tmall.pojo.User; import com.how2java.tmall.pojo.UserExample; import com.how2java.tmall.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class UserServiceImpl implements UserService{ @Autowired UserMapper userMapper; @Override public void add(User user){ userMapper.insert(user); } @Override public void delete(int id){ userMapper.deleteByPrimaryKey(id); } @Override public void update(User user){ userMapper.updateByPrimaryKeySelective(user); } @Override public User get(int id){ return userMapper.selectByPrimaryKey(id); } @Override public List<User> list(){ UserExample example = new UserExample(); example.setOrderByClause("id desc"); List<User> result = userMapper.selectByExample(example); return result; } @Override public boolean isExist(String name) { UserExample example =new UserExample(); example.createCriteria().andNameEqualTo(name); List<User> result= userMapper.selectByExample(example); if(!result.isEmpty()) return true; return false; } @Override public User get(String name, String password) { UserExample example =new UserExample(); example.createCriteria().andNameEqualTo(name).andPasswordEqualTo(password); List<User> result= userMapper.selectByExample(example); if(result.isEmpty()) return null; return result.get(0); } }
[ "422844285@qq.com" ]
422844285@qq.com
0f3b600e103358f394dfe0cbc51b1eb134212d25
c885ef92397be9d54b87741f01557f61d3f794f3
/results/Mockito-4/org.mockito.exceptions.Reporter/BBC-F0-opt-50/tests/24/org/mockito/exceptions/Reporter_ESTest.java
125c62b413c50f2e8a2c96851764c5cfcc16fb08
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
38,307
java
/* * This file was automatically generated by EvoSuite * Sat Oct 23 22:53:51 GMT 2021 */ package org.mockito.exceptions; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.sql.BatchUpdateException; import java.sql.ClientInfoStatus; import java.sql.SQLClientInfoException; import java.sql.SQLDataException; import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLIntegrityConstraintViolationException; import java.sql.SQLNonTransientConnectionException; import java.sql.SQLNonTransientException; import java.sql.SQLTransientConnectionException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.hamcrest.Matcher; import org.hamcrest.collection.IsIn; import org.hamcrest.core.AnyOf; import org.hamcrest.text.IsEmptyString; import org.junit.runner.RunWith; import org.mockito.exceptions.Reporter; import org.mockito.exceptions.base.MockitoAssertionError; import org.mockito.exceptions.verification.junit.ArgumentsAreDifferent; import org.mockito.internal.debugging.LocationImpl; import org.mockito.internal.debugging.VerboseMockInvocationLogger; import org.mockito.internal.exceptions.VerificationAwareInvocation; import org.mockito.internal.exceptions.stacktrace.StackTraceFilter; import org.mockito.internal.invocation.InvocationImpl; import org.mockito.internal.invocation.InvocationMatcher; import org.mockito.internal.matchers.LocalizedMatcher; import org.mockito.internal.stubbing.StubbedInvocationMatcher; import org.mockito.invocation.DescribedInvocation; import org.mockito.invocation.Invocation; import org.mockito.invocation.InvocationOnMock; import org.mockito.invocation.Location; import org.mockito.listeners.InvocationListener; import org.mockito.mock.SerializableMode; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) public class Reporter_ESTest extends Reporter_ESTest_scaffolding { @Test(timeout = 4000) public void test00() throws Throwable { Reporter reporter0 = new Reporter(); LocationImpl locationImpl0 = new LocationImpl(); // Undeclared exception! try { reporter0.unfinishedVerificationException(locationImpl0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test01() throws Throwable { Reporter reporter0 = new Reporter(); LocationImpl locationImpl0 = new LocationImpl(); // Undeclared exception! try { reporter0.unfinishedStubbing(locationImpl0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test02() throws Throwable { Reporter reporter0 = new Reporter(); LocationImpl locationImpl0 = new LocationImpl(); // Undeclared exception! try { reporter0.smartNullPointerException("2. inside when() you don't call method on mock but on some other object.", locationImpl0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test03() throws Throwable { Reporter reporter0 = new Reporter(); Class<String> class0 = String.class; // Undeclared exception! try { reporter0.mockedTypeIsInconsistentWithSpiedInstanceType(class0, "60>x\"E.E.B b*otrU"); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test04() throws Throwable { Reporter reporter0 = new Reporter(); Class<InvocationImpl> class0 = InvocationImpl.class; // Undeclared exception! try { reporter0.mockedTypeIsInconsistentWithDelegatedInstanceType(class0, "-> at <evosuite>.<evosuite>(<evosuite>)"); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test05() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.misplacedArgumentMatcher((List<LocalizedMatcher>) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test06() throws Throwable { Reporter reporter0 = new Reporter(); VerboseMockInvocationLogger verboseMockInvocationLogger0 = new VerboseMockInvocationLogger(); BatchUpdateException batchUpdateException0 = new BatchUpdateException((Throwable) null); // Undeclared exception! try { reporter0.invocationListenerThrewException(verboseMockInvocationLogger0, batchUpdateException0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test07() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.invalidArgumentPositionRangeAtInvocationTime((InvocationOnMock) null, true, (-3939)); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test08() throws Throwable { Reporter reporter0 = new Reporter(); HashSet<LocalizedMatcher> hashSet0 = new HashSet<LocalizedMatcher>(); // Undeclared exception! try { reporter0.incorrectUseOfAdditionalMatchers("LTho:-IS9ccXQ+LI:b", 0, hashSet0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test09() throws Throwable { Reporter reporter0 = new Reporter(); BatchUpdateException batchUpdateException0 = new BatchUpdateException(); // Undeclared exception! try { reporter0.cannotInitializeForSpyAnnotation("~%_XLH}WLwwTr.*=^@", batchUpdateException0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test10() throws Throwable { Reporter reporter0 = new Reporter(); SQLIntegrityConstraintViolationException sQLIntegrityConstraintViolationException0 = new SQLIntegrityConstraintViolationException("org.hamcrest.collection.IsEmptyCollection", "", 1); SQLDataException sQLDataException0 = new SQLDataException("r0e3]G#:RVH~Hv_8", "org.hamcrest.collection.IsEmptyCollection", sQLIntegrityConstraintViolationException0); SQLNonTransientConnectionException sQLNonTransientConnectionException0 = new SQLNonTransientConnectionException("", sQLDataException0); SQLFeatureNotSupportedException sQLFeatureNotSupportedException0 = new SQLFeatureNotSupportedException("/`", "", sQLNonTransientConnectionException0); // Undeclared exception! try { reporter0.cannotInitializeForInjectMocksAnnotation("org.hamcrest.collection.IsEmptyCollection", sQLFeatureNotSupportedException0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test11() throws Throwable { Reporter reporter0 = new Reporter(); LocationImpl locationImpl0 = new LocationImpl(); // Undeclared exception! try { reporter0.argumentsAreDifferent(" recorded:", " recorded:", locationImpl0); fail("Expecting exception: ArgumentsAreDifferent"); } catch(ArgumentsAreDifferent e) { } } @Test(timeout = 4000) public void test12() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.wantedButNotInvokedInOrder((DescribedInvocation) null, (DescribedInvocation) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test13() throws Throwable { Reporter reporter0 = new Reporter(); LinkedList<InvocationMatcher> linkedList0 = new LinkedList<InvocationMatcher>(); // Undeclared exception! try { reporter0.wantedButNotInvoked((DescribedInvocation) null, (List<? extends DescribedInvocation>) linkedList0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test14() throws Throwable { Reporter reporter0 = new Reporter(); LinkedList<InvocationMatcher> linkedList0 = new LinkedList<InvocationMatcher>(); linkedList0.add((InvocationMatcher) null); // Undeclared exception! try { reporter0.wantedButNotInvoked((DescribedInvocation) null, (List<? extends DescribedInvocation>) linkedList0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test15() throws Throwable { Reporter reporter0 = new Reporter(); ArrayList<LocalizedMatcher> arrayList0 = new ArrayList<LocalizedMatcher>(); Matcher<String> matcher0 = IsEmptyString.isEmptyString(); LocalizedMatcher localizedMatcher0 = new LocalizedMatcher(matcher0); arrayList0.add(localizedMatcher0); // Undeclared exception! try { reporter0.invalidUseOfMatchers((-1497), arrayList0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test16() throws Throwable { Reporter reporter0 = new Reporter(); Class<InvocationMatcher> class0 = InvocationMatcher.class; // Undeclared exception! try { reporter0.extraInterfacesCannotContainMockedType(class0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test17() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.reportNoSubMatchersFound(""); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test18() throws Throwable { Reporter reporter0 = new Reporter(); Class<String> class0 = String.class; // Undeclared exception! try { reporter0.wrongTypeOfArgumentToReturn((InvocationOnMock) null, "Description should be non null!", class0, 0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test19() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.missingMethodInvocation(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test20() throws Throwable { Reporter reporter0 = new Reporter(); HashMap<String, ClientInfoStatus> hashMap0 = new HashMap<String, ClientInfoStatus>(); SQLClientInfoException sQLClientInfoException0 = new SQLClientInfoException("", "", (-3901), hashMap0); // Undeclared exception! try { reporter0.cannotInjectDependency((Field) null, (Object) null, sQLClientInfoException0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test21() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.notAMockPassedToVerifyNoMoreInteractions(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test22() throws Throwable { Reporter reporter0 = new Reporter(); Class<StubbedInvocationMatcher> class0 = StubbedInvocationMatcher.class; // Undeclared exception! try { reporter0.mockedTypeIsInconsistentWithDelegatedInstanceType(class0, (Object) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test23() throws Throwable { Reporter reporter0 = new Reporter(); Object[] objectArray0 = new Object[2]; IsIn<Object> isIn0 = new IsIn<Object>(objectArray0); AnyOf<Object> anyOf0 = AnyOf.anyOf((Matcher<Object>) isIn0, (Matcher<? super Object>) isIn0, (Matcher<? super Object>) isIn0, (Matcher<? super Object>) isIn0, (Matcher<? super Object>) isIn0); LocalizedMatcher localizedMatcher0 = new LocalizedMatcher(anyOf0); Location location0 = localizedMatcher0.getLocation(); // Undeclared exception! try { reporter0.neverWantedButInvoked((DescribedInvocation) null, location0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test24() throws Throwable { Reporter reporter0 = new Reporter(); org.mockito.internal.reporting.Discrepancy discrepancy0 = new org.mockito.internal.reporting.Discrepancy(6, 2829); // Undeclared exception! try { reporter0.tooLittleActualInvocationsInOrder(discrepancy0, (DescribedInvocation) null, (Location) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test25() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.stubPassedToVerify(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test26() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.cannotCallAbstractRealMethod(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test27() throws Throwable { Reporter reporter0 = new Reporter(); Class<ClientInfoStatus> class0 = ClientInfoStatus.class; // Undeclared exception! try { reporter0.mockedTypeIsInconsistentWithSpiedInstanceType(class0, (Object) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test28() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.nullPassedToVerifyNoMoreInteractions(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test29() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.wantedButNotInvoked((DescribedInvocation) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test30() throws Throwable { Reporter reporter0 = new Reporter(); LinkedList<VerificationAwareInvocation> linkedList0 = new LinkedList<VerificationAwareInvocation>(); // Undeclared exception! try { reporter0.noMoreInteractionsWanted((Invocation) null, linkedList0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test31() throws Throwable { Reporter reporter0 = new Reporter(); SQLTransientConnectionException sQLTransientConnectionException0 = new SQLTransientConnectionException("", ""); // Undeclared exception! try { reporter0.invocationListenerThrewException((InvocationListener) null, sQLTransientConnectionException0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test32() throws Throwable { Reporter reporter0 = new Reporter(); ArrayList<LocalizedMatcher> arrayList0 = new ArrayList<LocalizedMatcher>(); // Undeclared exception! try { reporter0.misplacedArgumentMatcher(arrayList0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test33() throws Throwable { Reporter reporter0 = new Reporter(); BatchUpdateException batchUpdateException0 = new BatchUpdateException(); // Undeclared exception! try { reporter0.fieldInitialisationThrewException((Field) null, batchUpdateException0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test34() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.noArgumentValueWasCaptured(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test35() throws Throwable { Reporter reporter0 = new Reporter(); SQLNonTransientException sQLNonTransientException0 = new SQLNonTransientException((String) null, "ImQ8*fuOCdk}", 1964); SQLFeatureNotSupportedException sQLFeatureNotSupportedException0 = new SQLFeatureNotSupportedException("eNs", "org.mockito.internal.invocation.realmethod.CleanTraceRealMethod", sQLNonTransientException0); // Undeclared exception! try { reporter0.checkedExceptionInvalid(sQLFeatureNotSupportedException0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test36() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.nullPassedWhenCreatingInOrder(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test37() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.unfinishedStubbing((Location) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.evosuite.runtime.System", e); } } @Test(timeout = 4000) public void test38() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.smartNullPointerException("org.mockito.internal.stubbing.defaultanswers.ReturnsSmartNulls", (Location) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.evosuite.runtime.System", e); } } @Test(timeout = 4000) public void test39() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.mocksHaveToBePassedToVerifyNoMoreInteractions(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test40() throws Throwable { Reporter reporter0 = new Reporter(); Class<Integer> class0 = Integer.class; // Undeclared exception! try { reporter0.serializableWontWorkForObjectsThatDontImplementSerializable(class0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test41() throws Throwable { Reporter reporter0 = new Reporter(); Class<InvocationMatcher> class0 = InvocationMatcher.class; // Undeclared exception! try { reporter0.extraInterfacesAcceptsOnlyInterfaces(class0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test42() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.argumentsAreDifferent("ReturnsElementsOf does not accept null as constructor argument.\nPlease pass a collection instance", "ReturnsElementsOf does not accept null as constructor argument.\nPlease pass a collection instance", (Location) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.evosuite.runtime.System", e); } } @Test(timeout = 4000) public void test43() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.nullPassedToVerify(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test44() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.delegatedMethodHasWrongReturnType((Method) null, (Method) null, (Object) null, (Object) null); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test45() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.wantedAtMostX(0, 0); fail("Expecting exception: MockitoAssertionError"); } catch(MockitoAssertionError e) { } } @Test(timeout = 4000) public void test46() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.notAMockPassedToWhenMethod(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test47() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.atMostAndNeverShouldNotBeUsedWithTimeout(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test48() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.invalidUseOfMatchers((-1), (List<LocalizedMatcher>) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test49() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.onlyVoidMethodsCanBeSetToDoNothing(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test50() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.incorrectUseOfApi(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test51() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.unsupportedCombinationOfAnnotations("org.mockito.exceptions.verification.NoInteractionsWanted", ""); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test52() throws Throwable { Reporter reporter0 = new Reporter(); Class<Object> class0 = Object.class; // Undeclared exception! try { reporter0.notAMockPassedToVerify(class0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test53() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.incorrectUseOfAdditionalMatchers("", 1, (Collection<LocalizedMatcher>) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test54() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.nullPassedToWhenMethod(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test55() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.moreThanOneAnnotationNotAllowed("=[@ Z,-S##"); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test56() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.cannotStubVoidMethodWithAReturnValue("tTB.s5_r5.}]Te@"); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test57() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.invocationListenersRequiresAtLeastOneListener(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test58() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.extraInterfacesRequiresAtLeastOneInterface(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test59() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.cannotStubWithNullThrowable(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test60() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.defaultAnswerDoesNotAcceptNullParameter(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test61() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.spyAndDelegateAreMutuallyExclusive(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test62() throws Throwable { Reporter reporter0 = new Reporter(); StackTraceFilter stackTraceFilter0 = new StackTraceFilter(); LocationImpl locationImpl0 = new LocationImpl(stackTraceFilter0); // Undeclared exception! try { reporter0.tooManyActualInvocations((-117), 4, (DescribedInvocation) null, locationImpl0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test63() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.unfinishedVerificationException((Location) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.evosuite.runtime.System", e); } } @Test(timeout = 4000) public void test64() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.cannotInitializeForInjectMocksAnnotation("", (Exception) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test65() throws Throwable { Reporter reporter0 = new Reporter(); LocationImpl locationImpl0 = new LocationImpl(); // Undeclared exception! try { reporter0.tooManyActualInvocationsInOrder((-276), (-276), (DescribedInvocation) null, locationImpl0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test66() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.invocationListenerDoesNotAcceptNullParameters(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test67() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.delegatedMethodDoesNotExistOnDelegate((Method) null, "", ""); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test68() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.cannotVerifyToString(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test69() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.inOrderRequiresFamiliarMock(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test70() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.notAMockPassedWhenCreatingInOrder(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test71() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.mocksHaveToBePassedWhenCreatingInOrder(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test72() throws Throwable { Reporter reporter0 = new Reporter(); SerializableMode serializableMode0 = SerializableMode.ACROSS_CLASSLOADERS; // Undeclared exception! try { reporter0.usingConstructorWithFancySerializable(serializableMode0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test73() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.noMoreInteractionsWantedInOrder((Invocation) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test74() throws Throwable { Reporter reporter0 = new Reporter(); org.mockito.internal.reporting.Discrepancy discrepancy0 = new org.mockito.internal.reporting.Discrepancy((-1535), 4); LocalizedMatcher localizedMatcher0 = new LocalizedMatcher((Matcher) null); Location location0 = localizedMatcher0.getLocation(); // Undeclared exception! try { reporter0.tooLittleActualInvocations(discrepancy0, (DescribedInvocation) null, location0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test75() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.cannotInitializeForSpyAnnotation("%([0-9]+)", (Exception) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.mockito.exceptions.Reporter", e); } } @Test(timeout = 4000) public void test76() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.invalidArgumentRangeAtIdentityAnswerCreationTime(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test77() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.wrongTypeOfReturnValue("su-_=ycQ", "su-_=ycQ", "su-_=ycQ"); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test78() throws Throwable { Reporter reporter0 = new Reporter(); // Undeclared exception! try { reporter0.extraInterfacesDoesNotAcceptNullParameters(); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } @Test(timeout = 4000) public void test79() throws Throwable { Reporter reporter0 = new Reporter(); Class<Object> class0 = Object.class; // Undeclared exception! try { reporter0.cannotMockFinalClass(class0); fail("Expecting exception: RuntimeException"); } catch(RuntimeException e) { } } }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
4aea7f2036e6f18cd6df70819293831875a629f2
61fcca5c547a13794ae29033940beb8fbd050f21
/src/com/emlago/sociainfo/data/gson/Work.java
0fca79dd1acdb0a9d57eac5e78859bf75a880c80
[]
no_license
pszychiewicz/SociaInfoData
d841ac5ff25c8106a9d3018498d95e654560e63a
00e0091f1c56d66b4e36d68e82634ba863edfdd7
refs/heads/master
2021-01-22T10:33:30.435900
2015-10-11T18:56:36
2015-10-11T18:56:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
654
java
package com.emlago.sociainfo.data.gson; import com.emlago.sociainfo.data.gson.helpers.IdName; import com.google.gson.annotations.SerializedName; import java.io.Serializable; import lombok.Getter; import lombok.Setter; import lombok.ToString; @Getter @Setter @ToString public class Work implements Serializable { @SerializedName("employer") private IdName employer = null; @SerializedName("position") private IdName position = null; @SerializedName("location") private IdName location = null; @SerializedName("start_date") private String startDate = ""; @SerializedName("end_date") private String endDate = ""; }
[ "marcin.lagowski@turbineanalytics.com" ]
marcin.lagowski@turbineanalytics.com
b2a2d05f60c93fea1fb3e3cce06023a6e656a6ff
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/7/7_2b4e2512530a5d0a12e92071eb2e3198722dcd6b/MissingTypeInDeclareParents/7_2b4e2512530a5d0a12e92071eb2e3198722dcd6b_MissingTypeInDeclareParents_s.java
56bea6617d92aaad55f8c71887060a156ee29277
[]
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
618
java
import org.aspectj.testing.Tester; import java.util.*; import java.io.*; /** @testcase unmatched type name in a declare parents should result in a warning in -Xlint mode */ public class MissingTypeInDeclareParents { public static void main(String[] args) throws Exception { FileWriter fr = new FileWriter("foo"); fr.close(); Tester.check(true, "Kilroy was here"); } } class C { } aspect A { /** Xlint warning expected where FileWriter is outside code controlled by implementation */ declare parents : FileWriter extends Runnable; // CW 20 Xlint warning }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
35258a3611d6480280ab8fdfc62b2fe13f983c5d
feec4f3943c6a3ab7927109f799843179547316f
/app/src/androidTest/java/com/jhonlopera/practica1_p5/ExampleInstrumentedTest.java
29285b54c3cd02dc74ea4cfbd4851d23f57e5ca2
[]
no_license
jhonlopera05/Practica1-P5
97310745654f66d9cdc9e429481869de205c1fc6
58b019a87f9445af93f027f6572907f238e68e92
refs/heads/master
2021-01-20T11:48:01.326403
2017-08-28T21:37:41
2017-08-28T21:37:41
101,690,210
0
0
null
null
null
null
UTF-8
Java
false
false
758
java
package com.jhonlopera.practica1_p5; 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.*; /** * Instrumentation 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() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.jhonlopera.practica1_p5", appContext.getPackageName()); } }
[ "jhon.lopera05@gmail.com" ]
jhon.lopera05@gmail.com
8c49b2020f23311f351a8b7c2401a22d75557f5e
3a825f835dba336337019c6ffb55a53eba3a8df6
/src/test/java/io/r2dbc/postgresql/codec/UuidArrayCodecUnitTests.java
4447364cabebca34cdad4b435f56485abb7825bd
[ "Apache-2.0" ]
permissive
appsmithorg/r2dbc-postgresql
1fd969e585d1f3423553000422b8ef6ae0b0c9eb
042eff1e5642e10b189a1b40d1105cefd9c231a3
refs/heads/main
2023-01-27T13:10:07.905585
2020-12-08T15:33:01
2020-12-09T11:19:02
320,235,970
1
2
Apache-2.0
2020-12-10T10:25:12
2020-12-10T10:25:11
null
UTF-8
Java
false
false
4,216
java
/* * Copyright 2020 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.r2dbc.postgresql.codec; import io.netty.buffer.ByteBuf; import io.r2dbc.postgresql.client.Parameter; import io.r2dbc.postgresql.type.PostgresqlObjectId; import org.junit.jupiter.api.Test; import java.util.UUID; import static io.r2dbc.postgresql.client.Parameter.NULL_VALUE; import static io.r2dbc.postgresql.client.ParameterAssert.assertThat; import static io.r2dbc.postgresql.message.Format.FORMAT_BINARY; import static io.r2dbc.postgresql.message.Format.FORMAT_TEXT; import static io.r2dbc.postgresql.type.PostgresqlObjectId.UUID_ARRAY; import static io.r2dbc.postgresql.util.ByteBufUtils.encode; import static io.r2dbc.postgresql.util.TestByteBufAllocator.TEST; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; /** * Unit tests for {@link UuidArrayCodec}. */ final class UuidArrayCodecUnitTests { private static final int dataType = UUID_ARRAY.getObjectId(); private static final UUID u1 = UUID.randomUUID(); private static final UUID u2 = UUID.randomUUID(); private static final String parms = "{" + u1 + "," + u2 + "}"; private final ByteBuf BINARY_ARRAY = TEST .buffer() .writeInt(1) .writeInt(0) .writeInt(2951) .writeInt(2) .writeInt(2) .writeInt(16) .writeLong(u1.getMostSignificantBits()) .writeLong(u1.getLeastSignificantBits()) .writeInt(16) .writeLong(u2.getMostSignificantBits()) .writeLong(u2.getLeastSignificantBits()); @Test void decodeItem() { assertThat(new UuidArrayCodec(TEST).decode(BINARY_ARRAY, dataType, FORMAT_BINARY, UUID[].class)).isEqualTo(new UUID[]{u1, u2}); assertThat(new UuidArrayCodec(TEST).decode(encode(TEST, parms), dataType, FORMAT_TEXT, UUID[].class)).isEqualTo(new UUID[]{u1, u2}); } @Test @SuppressWarnings({"rawtypes", "unchecked"}) void decodeObject() { assertThat(((Codec) new UuidArrayCodec(TEST)).decode(BINARY_ARRAY, dataType, FORMAT_BINARY, Object.class)).isEqualTo(new UUID[]{u1, u2}); assertThat(((Codec) new UuidArrayCodec(TEST)).decode(encode(TEST, parms), dataType, FORMAT_TEXT, Object.class)).isEqualTo(new UUID[]{u1, u2}); } @Test void doCanDecode() { assertThat(new UuidArrayCodec(TEST).doCanDecode(PostgresqlObjectId.UUID, FORMAT_TEXT)).isFalse(); assertThat(new UuidArrayCodec(TEST).doCanDecode(UUID_ARRAY, FORMAT_TEXT)).isTrue(); assertThat(new UuidArrayCodec(TEST).doCanDecode(UUID_ARRAY, FORMAT_BINARY)).isTrue(); } @Test void doCanDecodeNoType() { assertThatIllegalArgumentException().isThrownBy(() -> new UuidArrayCodec(TEST).doCanDecode(null, null)) .withMessage("type must not be null"); } @Test void encodeArray() { assertThat(new UuidArrayCodec(TEST).encodeArray(() -> encode(TEST, parms))) .hasFormat(FORMAT_TEXT) .hasType(UUID_ARRAY.getObjectId()) .hasValue(encode(TEST, parms)); } @Test void encodeItem() { assertThat(new UuidArrayCodec(TEST).doEncodeText(u1)).isEqualTo(u1.toString()); } @Test void encodeItemNoValue() { assertThatIllegalArgumentException().isThrownBy(() -> new UuidArrayCodec(TEST).doEncodeText(null)) .withMessage("value must not be null"); } @Test void encodeNull() { assertThat(new UuidArrayCodec(TEST).encodeNull()) .isEqualTo(new Parameter(FORMAT_TEXT, UUID_ARRAY.getObjectId(), NULL_VALUE)); } }
[ "mpaluch@pivotal.io" ]
mpaluch@pivotal.io
4358973655cdccacaa9ef0b4fd3169daffa8aa9f
a70581d3644861b2a70def58927666c50ddac445
/dajia-core/src/main/java/com/dajia/vo/ProductVO.java
d19bad64c8aacf58196b20b7d2ecd1d866221a36
[]
no_license
kppamy/dajiav2
4a0d09eceddee55dd75e53acb66f59bcccced4d5
5c594bc9693997364b655b60f967661e4b25aaea
refs/heads/master
2021-01-13T06:10:43.793071
2016-07-09T18:06:22
2016-07-09T18:06:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
996
java
package com.dajia.vo; import java.math.BigDecimal; import java.util.Date; import java.util.List; import com.dajia.domain.Price; import com.dajia.domain.ProductImage; public class ProductVO { public Long productId; public Long productItemId; public String refId; public String shortName; public String name; public String brief; public String description; public String spec; public Long sold; public Long totalSold; public Long stock; public Integer buyQuota; public Integer productStatus; public BigDecimal originalPrice; public BigDecimal currentPrice; public BigDecimal postFee; public Date startDate; public Date expiredDate; public BigDecimal targetPrice; public BigDecimal priceOff; public long soldNeeded; public long progressValue; public BigDecimal nextOff; public boolean isFav; public String status4Show; public String imgUrl; public String imgUrl4List; public List<ProductImage> productImages; public List<Price> prices; }
[ "nicepuffy@gmail.com" ]
nicepuffy@gmail.com
d061dc69bff60e660611325bfa935b8f2e66f79c
7cebc1c40df73cec113e06b2f14d67b3f50bbbfa
/app/src/main/java/com/hb/rssai/presenter/ModifySubscriptionPresenter.java
78e6fe35dbce23cd64708351c59236af4f85c768
[]
no_license
Huangbin1234/RssAIPro
7245e9012ec2228740e83c7d6825e78a6f2f97c1
12646eb3f91dc1dda418015f675dcb2a3569a6a3
refs/heads/master
2021-08-07T03:14:14.326187
2019-09-29T08:22:35
2019-09-29T08:22:35
96,398,996
0
0
null
null
null
null
UTF-8
Java
false
false
1,740
java
package com.hb.rssai.presenter; import com.hb.rssai.constants.Constant; import com.hb.rssai.contract.ModifySubscriptionContract; import java.util.HashMap; import java.util.Map; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; /** * Created by Administrator * on 2019/5/5 */ public class ModifySubscriptionPresenter extends BasePresenter<ModifySubscriptionContract.View> implements ModifySubscriptionContract.Presenter { ModifySubscriptionContract.View mView; public ModifySubscriptionPresenter(ModifySubscriptionContract.View mView) { this.mView = mView; this.mView.setPresenter(this); } public void getDataGroupList() { dataGroupApi.getDataGroupList(getDataGroupListParams()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(resDataGroup -> { mView.setDataGroupResult(resDataGroup); }, mView::loadError); } @Override public void modifySubscription(Map<String, Object> params) { findApi.modifySubscription(params) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(resBase -> mView.showModifyResult(resBase), mView::loadError); } private HashMap<String, String> getDataGroupListParams() { //参数可以不要 HashMap<String, String> map = new HashMap<>(); String jsonParams = "{\"page\":\"" + 1 + "\",\"size\":\"" + Constant.PAGE_SIZE + "\"}"; map.put(Constant.KEY_JSON_PARAMS, jsonParams); return map; } @Override public void start() { getDataGroupList(); } }
[ "txg" ]
txg
74b48d51404cac2bd4462cdb011da6899651350f
204e5b76266ecd02f8274f4268cb6943a4fc3324
/src/com/joeysoft/kc868/db/DBConnection.java
97a891a45035de65c731fad820059b78ecc851e3
[]
no_license
ardy30/apro
834131d005086c89abbba5e8902424edc1d02450
0d6a29cecea1635ed7b52de77e82f178615cb992
refs/heads/master
2020-05-23T23:30:41.363360
2013-03-17T08:40:59
2013-03-17T08:40:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,080
java
package com.joeysoft.kc868.db; import java.sql.Connection; import java.sql.Driver; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; import java.util.Properties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.joeysoft.kc868.SystemConfig; /** * 数据库连接,因为只需要一个连接,所以用了static * @author JOEY * */ public class DBConnection { private static Logger logger = LoggerFactory.getLogger(DBConnection.class); private static Connection conn = null; private DBConnection(){}; public static Connection getConnection(){ try { if(conn == null || conn.isClosed()){ Driver myDriver = (Driver)Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); Properties props = new Properties(); props.put("charSet", "GBK"); props.put("user", "kincony852"); props.put("password", "kincony852"); //conn = myDriver.connect("jdbc:odbc:driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=./config/DB.accdb", props); conn = myDriver.connect("jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=./config/"+SystemConfig.getInstance().getDbFileName(), props); if (conn == null || conn.isClosed()) { return null; }else{ logger.debug("db connectioned"); } conn.setAutoCommit(false); } } catch (Exception e) { logger.error(e.getMessage(), e); e.printStackTrace(); } return conn; } public static void freeConnection() throws Exception { if (conn != null) { conn.rollback(); conn.close(); conn = null; } } /** * @param args */ public static void main(String[] args) { try { Connection conn = DBConnection.getConnection(); Map htParam = new HashMap(); htParam.put("FLOOR", "4"); htParam.put("FLOOR_NAME", "一楼"); SQLUtil.insertSQL(conn, "FLOOR", htParam); conn.commit(); System.out.println(conn); DBConnection.freeConnection(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
[ "ailinty@163.com" ]
ailinty@163.com
1e11f2debcebee14200046221f6e3204107dd642
85bd7067c9be43f71b0663abc680c01048407c03
/Reverse the Stack/Main.java
89866524ec52e4a63d5c1741ca22278534376f77
[]
no_license
saikrishna9542/Playground
c103841e894df05eb5e612c4067b50523b5044fe
264bae347d57474a35ddc4c7236195339a7fae07
refs/heads/master
2021-07-11T19:06:12.626160
2020-07-02T11:59:27
2020-07-02T11:59:27
166,536,837
0
0
null
null
null
null
UTF-8
Java
false
false
936
java
def insertAtBottom(stack, item): if isEmpty(stack): push(stack, item) else: temp = pop(stack) insertAtBottom(stack, item) push(stack, temp) def reverse(stack): if not isEmpty(stack): temp = pop(stack) reverse(stack) insertAtBottom(stack, temp) def createStack(): stack = [] return stack def isEmpty( stack ): return len(stack) == 0 # Function to push an # item to stack def push( stack, item ): stack.append( item ) # Function to pop an # item from stack def pop( stack ): if(isEmpty( stack )): print("Stack Underflow ") exit(1) return stack.pop() # Function to print the stack def prints(stack): for i in range(len(stack)-1, -1, -1): print(stack[i], end = ' ') print() stack = createStack() while True: x=int(input()) if x!=-1: push(stack,x) else: break print("Original Stack ") prints(stack) reverse(stack) print("Reversed Stack ") prints(stack)
[ "46840846+saikrishna9542@users.noreply.github.com" ]
46840846+saikrishna9542@users.noreply.github.com
fa29e78249865ef64320ce83c00fe82f200ad141
0c6badd057655465a419a973921bab102304290a
/src/main/java/ftn/diplomski/repository/UserDao.java
d316bafb48e1a5562491da93ec514756be59ffa8
[]
no_license
nsboki/docAppBackend
bbd26ee968c346313ca6d983819f38e25dd14078
79ecc376de6ae714561d22bead93e14d015d0e32
refs/heads/master
2021-09-05T06:47:07.847537
2018-01-24T23:44:30
2018-01-24T23:44:30
115,515,545
0
0
null
null
null
null
UTF-8
Java
false
false
504
java
/** * */ package ftn.diplomski.repository; import java.util.List; import org.springframework.data.repository.CrudRepository; import ftn.diplomski.entity.User; /** * @author Boki on Dec 15, 2017 * */ public interface UserDao extends CrudRepository<User, Long>{ User findByUsername(String username); User findByEmail(String email); List<User> findAll(); List<User> findByUserRoles(String role); /** * @param username * @return */ List<User> findByDoctorUsername(String username); }
[ "nsboki@gmail.com" ]
nsboki@gmail.com
04b8fb140bd4ed5f29a7a8750d5d1d539a22e270
f6d6f3ac26f0479955223430df8d8e83c8fe7b0b
/src/main/java/njt/sevice/impl/ZahtevServiceImpl.java
f57638338fb7fd481489583b4d0e1fd6bc5ec5d3
[]
no_license
ZlicaS/spring_boot
2f150f4f118a7ce63ace8af9fd8cf6ed76a972b8
825445b28fe5b6e4fae0dc22619510592c761316
refs/heads/master
2023-06-10T21:06:45.416186
2021-07-02T13:37:16
2021-07-02T13:37:16
382,357,634
0
0
null
null
null
null
UTF-8
Java
false
false
1,928
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 njt.sevice.impl; import java.util.Optional; import njt.entity.StavkaZahteva; import njt.entity.Zahtev; import njt.repository.StavkaZahtevaRepository; import njt.repository.ZahtevRepository; import njt.service.ZahtevService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * * @author lizasapsaj */ @Service public class ZahtevServiceImpl implements ZahtevService { @Autowired private ZahtevRepository zahtevRepository; @Autowired private StavkaZahtevaRepository stavkaZahtevaRepository; @Override public Zahtev saveZahtev(Zahtev zahtev) { Optional<Zahtev> optionalKd = zahtevRepository.findById(zahtev.getIdZahteva()); if (optionalKd.isPresent()) { stavkaZahtevaRepository.deleteByZahtevSifraZahteva(zahtev.getIdZahteva()); } Zahtev savedZahtev = zahtevRepository.save(zahtev); if (zahtev.getStavkeZahteva() != null) { for (StavkaZahteva sz : zahtev.getStavkeZahteva()) { sz.setZahtev(savedZahtev); } stavkaZahtevaRepository.saveAll(zahtev.getStavkeZahteva()); } return savedZahtev; } @Override public Zahtev findOne(int idZahtev) { Optional<Zahtev> zahtev = zahtevRepository.findById(idZahtev); if (zahtev.isPresent()) { return zahtev.get(); } return null; } @Override public Zahtev updateZahtev(Zahtev kd) { stavkaZahtevaRepository.deleteByZahtevSifraZahteva(kd.getIdZahteva()); return saveZahtev(kd); } @Override public void deleteZahtev(int idZahteva) { zahtevRepository.deleteById(idZahteva); } }
[ "lizasapsaj@yahoo.com" ]
lizasapsaj@yahoo.com
a91b6427732a7bc31161ae5ba1479d210b7c4774
4262a5006737e41b1c648332253dd625293e82ac
/spring-cloud-alibaba-starters/spring-cloud-starter-dubbo/src/main/java/com/alibaba/cloud/dubbo/registry/ReSubscribeManager.java
5de52dbf67b38841b7816d3d68cec2f76bd29aa7
[ "Apache-2.0" ]
permissive
caojiele/spring-cloud-alibaba
4b36e90611ac6b3c4ae75a0bc99b1350279c8ec4
05b41a555ce0bb7126e533f4a88f3e43ae6f86f1
refs/heads/master
2021-06-15T04:24:30.183138
2021-06-06T01:27:27
2021-06-06T01:27:27
172,014,959
6
0
Apache-2.0
2021-06-06T01:27:27
2019-02-22T07:22:59
Java
UTF-8
Java
false
false
3,729
java
/* * Copyright 2013-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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alibaba.cloud.dubbo.registry; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import com.alibaba.cloud.dubbo.env.DubboCloudProperties; import com.alibaba.cloud.dubbo.registry.event.ServiceInstancesChangedEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.client.ServiceInstance; /** * @author <a href="mailto:chenxilzx1@gmail.com">theonefx</a> */ public class ReSubscribeManager { private final Logger logger = LoggerFactory.getLogger(ReSubscribeManager.class); private final Map<String, ReSubscribeMetadataJob> reConnectJobMap = new ConcurrentHashMap<>(); private final ScheduledThreadPoolExecutor reConnectPool = new ScheduledThreadPoolExecutor( 5); private final DubboCloudRegistry registry; private final DubboCloudProperties properties; public ReSubscribeManager(DubboCloudRegistry registry) { this.registry = registry; this.properties = registry.getBean(DubboCloudProperties.class); reConnectPool.setKeepAliveTime(10, TimeUnit.MINUTES); reConnectPool.allowCoreThreadTimeOut(true); } public void onRefreshSuccess(ServiceInstancesChangedEvent event) { reConnectJobMap.remove(event.getServiceName()); } public void onRefreshFail(ServiceInstancesChangedEvent event) { String serviceName = event.getServiceName(); int count = 1; if (event instanceof FakeServiceInstancesChangedEvent) { count = ((FakeServiceInstancesChangedEvent) event).getCount() + 1; } if (count >= properties.getMaxReSubscribeMetadataTimes()) { logger.error( "reSubscribe failed too many times, serviceName = {}, count = {}", serviceName, count); return; } ReSubscribeMetadataJob job = new ReSubscribeMetadataJob(serviceName, count); reConnectPool.schedule(job, properties.getReSubscribeMetadataIntervial(), TimeUnit.SECONDS); } private final class ReSubscribeMetadataJob implements Runnable { private final String serviceName; private final int errorCounts; private ReSubscribeMetadataJob(String serviceName, int errorCounts) { this.errorCounts = errorCounts; this.serviceName = serviceName; } @Override public void run() { if (!reConnectJobMap.containsKey(serviceName) || reConnectJobMap.get(serviceName) != this) { return; } List<ServiceInstance> list = registry.getServiceInstances(serviceName); FakeServiceInstancesChangedEvent event = new FakeServiceInstancesChangedEvent( serviceName, list, errorCounts); registry.onApplicationEvent(event); } } private static final class FakeServiceInstancesChangedEvent extends ServiceInstancesChangedEvent { private static final long serialVersionUID = -2832478604601472915L; private final int count; private FakeServiceInstancesChangedEvent(String serviceName, List<ServiceInstance> serviceInstances, int count) { super(serviceName, serviceInstances); this.count = count; } public int getCount() { return count; } } }
[ "chenxilzx1@gmail.com" ]
chenxilzx1@gmail.com
ae11b03328f20e98f5cbfe894c5d8ea492611f58
e7268d49cf10630237869b1562da01d44e242825
/src/br/com/controle/ControleLivroList.java
234cced6ae88c9dc1440951676bb021adc28ae7c
[]
no_license
clacla-s8/sistemacepedc
ea701be4a5a041175d2ad359182ac4d9a9fdce7b
33e3105a7fa078e48e97e6697a99e876417b5f09
refs/heads/main
2023-01-02T00:05:00.193928
2020-10-29T00:35:52
2020-10-29T00:35:52
308,174,759
0
0
null
2020-10-29T00:35:54
2020-10-29T00:28:07
null
ISO-8859-1
Java
false
false
5,491
java
package br.com.controle; import java.io.IOException; import java.net.URL; import java.util.List; import java.util.Optional; import java.util.ResourceBundle; import br.com.application.Main; import br.com.exception.BusinessException; import br.com.fachada.Fachada; import br.com.interfaces.AtualizarDadosOuvinte; import br.com.model.Alerts; import br.com.model.Livro; import br.com.model.Utils; import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.Scene; import javafx.scene.control.Alert.AlertType; import javafx.scene.control.Button; import javafx.scene.control.ButtonType; import javafx.scene.control.TableCell; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.cell.PropertyValueFactory; import javafx.scene.layout.Pane; import javafx.stage.Modality; import javafx.stage.Stage; public class ControleLivroList implements Initializable, AtualizarDadosOuvinte { private Fachada fachada; private ObservableList<Livro> obsList; @FXML private TableView<Livro> tableViewLivro; @FXML private TableColumn<Livro, Integer> tableColumnId; @FXML private TableColumn<Livro, String> tableColumnNome; @FXML private TableColumn<Livro, String> tableColumnEditora; @FXML private TableColumn<Livro, String> tableColumnAutor1; @FXML private TableColumn<Livro, String> tableColumnAutor2; @FXML private TableColumn<Livro, Integer> tableColumnQuant; @FXML private TableColumn<Livro, Livro> tableColumnEDIT; @FXML private TableColumn<Livro, Livro> tableColumnDELETE; @FXML private Button btnNovo; public void setFachada(Fachada fachada) { this.fachada = fachada; } @FXML public void onBtnNovoAction(ActionEvent event) { Stage parentStage = Utils.currentStage(event); Livro obj = new Livro(); createDialogForm(obj, "/br/com/view/LivroForm.fxml", parentStage); } @Override public void initialize(URL arg0, ResourceBundle arg1) { initializeNodes(); } private void initializeNodes() { tableColumnId.setCellValueFactory(new PropertyValueFactory<>("id")); tableColumnNome.setCellValueFactory(new PropertyValueFactory<>("nomeLivro")); tableColumnEditora.setCellValueFactory(new PropertyValueFactory<>("editora")); tableColumnAutor1.setCellValueFactory(new PropertyValueFactory<>("autor1")); tableColumnAutor2.setCellValueFactory(new PropertyValueFactory<>("autor2")); tableColumnQuant.setCellValueFactory(new PropertyValueFactory<>("quantidade")); Stage stage = (Stage) Main.getMainScene().getWindow(); tableViewLivro.prefHeightProperty().bind(stage.heightProperty()); } public void updateTableView() { if (fachada == null) { throw new IllegalStateException("Fachada null (injete dependencia)"); } List<Livro> list = fachada.getAllLivro(); obsList = FXCollections.observableArrayList(list); tableViewLivro.setItems(obsList); initEditButtons(); initDeleteButtons(); } private void createDialogForm(Livro obj, String strNome, Stage parentStage) { try { FXMLLoader loader = new FXMLLoader(getClass().getResource(strNome)); Pane pane = loader.load(); ControleLivroForm controller = loader.getController(); controller.setLivro(obj); controller.setFachada(new Fachada()); controller.inscreverAtualizarDadosOuvinte(this); controller.updateFormData(); Stage dialogStage = new Stage(); dialogStage.setTitle("Insira os dados do livro"); dialogStage.setScene(new Scene(pane)); dialogStage.setResizable(false); dialogStage.initOwner(parentStage); dialogStage.initModality(Modality.WINDOW_MODAL); dialogStage.showAndWait(); } catch (IOException e) { Alerts.mostrarAlert("IO EXCEPCTION", "Erro ao carregar", e.getMessage(), AlertType.ERROR); e.printStackTrace(); } } @Override public void onDadosAtualizados() { updateTableView(); } private void initEditButtons() { tableColumnEDIT.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue())); tableColumnEDIT.setCellFactory(param -> new TableCell<Livro, Livro>() { private final Button button = new Button("editar"); @Override protected void updateItem(Livro obj, boolean empty) { super.updateItem(obj, empty); if (obj == null) { setGraphic(null); return; } setGraphic(button); button.setOnAction( event -> createDialogForm(obj, "/br/com/view/LivroForm.fxml", Utils.currentStage(event))); } }); } private void initDeleteButtons() { tableColumnDELETE.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue())); tableColumnDELETE.setCellFactory(param -> new TableCell<Livro, Livro>() { private final Button button = new Button("deletar"); @Override protected void updateItem(Livro obj, boolean empty) { super.updateItem(obj, empty); if (obj == null) { setGraphic(null); return; } setGraphic(button); button.setOnAction(event -> deletarLivro(obj)); } }); } private void deletarLivro(Livro obj) { Optional<ButtonType> result = Alerts.mostrarConfirmacao("Confirmação", "Tem certeza que deseja deletar ?"); if (result.get() == ButtonType.OK) { try { fachada.deletarLivroPorId(obj); updateTableView(); } catch (BusinessException e) { e.printStackTrace(); } } } }
[ "clariceks8@gmail.com" ]
clariceks8@gmail.com
e9ce30638279145a1c33fe125fa3ce95502591b4
b26cfa7e2614386d0e1f43eb15bba6bdb9ecdb0a
/src/chord/analyses/logsite/LogsiteAnalysis.java
1e07c4b9beb1f92dc70440c04ca2134771f57ddc
[]
no_license
newmanne/logparser
feca045f9b4fb0ed18f35f9352c0b401fb665a8f
5fd4723b3221785fe97971779bcc44db0e2ce361
refs/heads/master
2021-01-16T18:19:05.155056
2014-01-27T02:19:04
2014-01-27T02:19:04
15,855,236
0
0
null
null
null
null
UTF-8
Java
false
false
4,483
java
package chord.analyses.logsite; import java.util.List; import joeq.Class.jq_Method; import joeq.Compiler.Quad.BasicBlock; import joeq.Compiler.Quad.ControlFlowGraph; import joeq.Compiler.Quad.Operand.AConstOperand; import joeq.Compiler.Quad.Operand.RegisterOperand; import joeq.Compiler.Quad.Quad; import joeq.Compiler.Quad.RegisterFactory.Register; import lombok.Data; import chord.project.Chord; import chord.project.ClassicProject; import chord.project.analyses.JavaAnalysis; import chord.project.analyses.ProgramRel; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Lists; /** * This implements a simple analysis that prints the call-site -> call target * information. The name of the analysis is "logsite-java". */ @Chord(name = "logsite-java", consumes = { "MLogInvkInst" }) public class LogsiteAnalysis extends JavaAnalysis { public void run() { ProgramRel relMLogInvkInst = (ProgramRel) ClassicProject.g().getTrgt("MLogInvkInst"); relMLogInvkInst.load(); for (Object[] tuple : relMLogInvkInst.getAryNValTuples()) { Quad q = (Quad) tuple[1]; // the call-site, in quad format jq_Method m_caller = q.getMethod(); // the callee method String file = m_caller.getDeclaringClass().getSourceFileName(); // file // System.out.println("Call site @" + q.getMethod() + " in file " + q.getMethod().getDeclaringClass().getSourceFileName() + " on line " + q.getLineNumber() + " " + q); // TODO: better to filter with chord.ext.scope.exclude if (!file.startsWith("org/apache/hadoop")) { continue; } List<RegId> regIds = Lists.newArrayList(); joeq.Util.Templates.List.RegisterOperand usedRegisters = q.getUsedRegisters(); for (int i = 0; i < usedRegisters.size(); i++) { RegisterOperand reg = usedRegisters.getRegisterOperand(i); regIds.add(new RegId(reg.getRegister())); } final List<RegId> roots = Lists.newArrayList(regIds); ControlFlowGraph cfg = m_caller.getCFG(); joeq.Util.Templates.ListIterator.BasicBlock reversePostOrderIterator = cfg.reversePostOrderIterator(); List<BasicBlock> reverse = Lists.reverse(Lists.newArrayList(reversePostOrderIterator)); ListMultimap<RegId, RegId> multimap = ArrayListMultimap.create(); for (BasicBlock bb : reverse) { for (int i = bb.size() - 1; i >= 0; i--) { Quad quad = bb.getQuad(i); if (quad.toString().contains("PHI")) { // if its a phi function, just skip continue; } joeq.Util.Templates.List.RegisterOperand regs = quad.getDefinedRegisters(); for (int j = 0; j < regs.size(); j++) { RegisterOperand reg = regs.getRegisterOperand(j); if (regIds.contains(new RegId(reg.getRegister()))) { final RegId regId = regIds.get(regIds.indexOf(new RegId(reg.getRegister()))); regId.setDefinitionQuad(quad); regIds.remove(regId); joeq.Util.Templates.List.RegisterOperand usedRegs = quad.getUsedRegisters(); for (int k = 0; k < usedRegs.size(); k++) { RegId newRegId = new RegId(usedRegs.getRegisterOperand(k).getRegister()); multimap.put(regId, newRegId); regIds.add(newRegId); } } } } } final int line = q.getLineNumber(); // line number System.out.println("LogSiteAnalysis: call instruction at line: " + line + "@" + file + " is from: " + m_caller); for (RegId root : roots) { final String regex = makeRegex(new StringBuilder(), root, multimap); if (!regex.isEmpty()) { System.out.println(regex); } } } } private String makeRegex(StringBuilder sb, RegId curNode, ListMultimap<RegId, RegId> multimap) { final Quad definitionQuad = curNode.getDefinitionQuad(); if (definitionQuad == null) { sb.append(".*"); } else if (definitionQuad.getOp2() instanceof AConstOperand) { // TODO: fix for NPE on Server.java (ipc) line 979 - 0 arg functions final String value = (((AConstOperand) definitionQuad.getOp2()).getValue()).toString(); sb.append(value); } for (RegId reg : multimap.get(curNode)) { sb.append(makeRegex(new StringBuilder(), reg, multimap)); } return sb.toString(); } @Data public static class RegId { final int number; final boolean isTemp; Quad definitionQuad; public RegId(Register r) { this.number = r.getNumber(); this.isTemp = r.isTemp(); } // @Override // public String toString() { // return (isTemp ? "T" : "R") + number; // } } }
[ "newman-n@hotmail.com" ]
newman-n@hotmail.com
ac3a22022f224ef8d6fcc9a590c4c20514c4f6ca
b9648eb0f0475e4a234e5d956925ff9aa8c34552
/google-ads-stubs-v10/src/main/java/com/google/ads/googleads/v10/services/stub/GrpcBiddingStrategyServiceCallableFactory.java
0ce6f8ca15e216eb53f6fd8137c1d7d2781a38ad
[ "Apache-2.0" ]
permissive
wfansh/google-ads-java
ce977abd611d1ee6d6a38b7b3032646d5ffb0b12
7dda56bed67a9e47391e199940bb8e1568844875
refs/heads/main
2022-05-22T23:45:55.238928
2022-03-03T14:23:07
2022-03-03T14:23:07
460,746,933
0
0
Apache-2.0
2022-02-18T07:08:46
2022-02-18T07:08:45
null
UTF-8
Java
false
false
812
java
/** * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.ads.googleads.v10.services.stub; import com.google.ads.googleads.lib.GrpcGoogleAdsCallableFactory; public class GrpcBiddingStrategyServiceCallableFactory extends GrpcGoogleAdsCallableFactory { }
[ "noreply@github.com" ]
noreply@github.com
f31ff09819cd76988d952a40b9a0ff1bc9450f71
fce7e9cb3345487ea6357fdebb4614b0988ed7a2
/app/src/main/java/com/example/expensemanagement/RegistrationActivity.java
d60326260926d166e2304027df713f2dbb7a2851
[]
no_license
prashant-15/expense-management-app
41fb207969f3accd9b742340cf72649a42badd26
ab18513e2d26c8c106693f0295d581fef4cf1dc3
refs/heads/master
2023-06-19T12:15:46.067341
2021-07-17T14:41:34
2021-07-17T14:41:34
386,953,776
0
0
null
null
null
null
UTF-8
Java
false
false
3,352
java
package com.example.expensemanagement; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; public class RegistrationActivity extends AppCompatActivity { private EditText email, password; private Button registerBtn; private TextView registerQn; private FirebaseAuth mAuth; private ProgressDialog progressDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_registration); email = findViewById(R.id.email); password = findViewById(R.id.password); registerBtn = findViewById(R.id.registerBtn); registerQn = findViewById(R.id.registerQn); mAuth = FirebaseAuth.getInstance(); progressDialog = new ProgressDialog(this); registerQn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(RegistrationActivity.this, LoginActivity.class); startActivity(intent); } }); registerBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String inputEmail = email.getText().toString(); String inputPassword = password.getText().toString(); if(TextUtils.isEmpty(inputEmail)){ email.setError("Email is required!"); } if(TextUtils.isEmpty(inputPassword)){ password.setError("Password is required!"); } else{ progressDialog.setMessage("Registration in progress"); progressDialog.setCanceledOnTouchOutside(false); progressDialog.show(); mAuth.createUserWithEmailAndPassword(inputEmail,inputPassword).addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()){ Toast.makeText(RegistrationActivity.this, "Registration Success", Toast.LENGTH_SHORT).show(); Intent intent = new Intent(RegistrationActivity.this, MainActivity.class); startActivity(intent); finish(); } else{ Toast.makeText(RegistrationActivity.this, task.getException().toString(), Toast.LENGTH_SHORT).show(); } progressDialog.dismiss(); } }); } } }); } }
[ "prashantbaghel215@gmail.com" ]
prashantbaghel215@gmail.com
8176aad53616bc75c2b942fdf67fe66b26855adb
f9cd17921a0c820e2235f1cd4ee651a59b82189b
/src/net/cbtltd/rest/nextpax/PlaceID.java
2e2baf6879c6ae312b8e186b7e38c18bb2d979c5
[]
no_license
bookingnet/booking
6042228c12fd15883000f4b6e3ba943015b604ad
0047b1ade78543819bcccdace74e872ffcd99c7a
refs/heads/master
2021-01-10T14:19:29.183022
2015-12-07T21:51:06
2015-12-07T21:51:06
44,936,675
2
1
null
null
null
null
UTF-8
Java
false
false
1,265
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2013.12.05 at 09:44:01 AM IST // package net.cbtltd.rest.nextpax; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; /** * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "value" }) @XmlRootElement(name = "PlaceID") public class PlaceID { @XmlValue protected String value; /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getvalue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setvalue(String value) { this.value = value; } }
[ "bookingnet@mail.ru" ]
bookingnet@mail.ru
737eb390355df4cc1e76e7dcf3d68be66ac747ae
746572ba552f7d52e8b5a0e752a1d6eb899842b9
/Test/src/main/java/com/lobinary/test/normal/高并发测试.java
bf09a78294651465551beacaca8fc52f2a4fc99e
[]
no_license
lobinary/Lobinary
fde035d3ce6780a20a5a808b5d4357604ed70054
8de466228bf893b72c7771e153607674b6024709
refs/heads/master
2022-02-27T05:02:04.208763
2022-01-20T07:01:28
2022-01-20T07:01:28
26,812,634
7
5
null
null
null
null
UTF-8
Java
false
false
1,491
java
/* * @(#)高并发测试.java V1.0.0 @下午5:14:27 * * Project: Test * * Modify Information: * Author Date Description * ============ ========== ======================================= * lvbin 2015年7月28日 Create this file * * Copyright Notice: * Copyright (c) 2009-2014 Unicompay Co., Ltd. * 1002 Room, No. 133 North Street, Xi Dan, * Xicheng District, Beijing ,100032, China * All rights reserved. * * This software is the confidential and proprietary information of * Unicompay Co., Ltd. ("Confidential Information"). * You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement you * entered into with Unicompay. */ package com.lobinary.test.normal; /** * <pre> * * </pre> * @author 吕斌:lvb3@chinaunicom.cn * @since 2015年7月28日 下午5:14:27 * @version V1.0.0 描述 : 创建文件高并发测试 * * * */ public class 高并发测试 { public static void main(String[] args) throws InterruptedException { for (int i = 0; i < 10000; i++) { final int j = i; new Thread(){ @Override public void run() { super.run(); 高并发测试对象 a = new 高并发测试对象(); // a.out("" + j); } }.start(); } Thread.sleep(10000); System.out.println("高并发测试对象总数" + 高并发测试对象.list.size()); } }
[ "lobinary@qq.com" ]
lobinary@qq.com
068532745f3ff5393e981721ed7f4a64aaee5509
fa48359545128a154c0d7101e0b77afeb003873d
/app/src/main/java/com/chengzhen/wearmanager/adapter/MyEmployeeAdapter.java
cb0d90010f7482f367452765b9232dd275e5c347
[]
no_license
liwei49699/WearManager
5e105265ec4187392be8be97b9512f585bde422a
6763a52832b2d9c27a28a904726899452300d20c
refs/heads/master
2020-12-13T19:13:04.253492
2020-05-26T14:43:56
2020-05-26T14:43:56
234,505,741
0
0
null
null
null
null
UTF-8
Java
false
false
2,570
java
package com.chengzhen.wearmanager.adapter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.SectionIndexer; import android.widget.TextView; import com.chengzhen.wearmanager.R; import com.chengzhen.wearmanager.bean.PeopleListResponse; import java.util.List; public class MyEmployeeAdapter extends BaseAdapter implements SectionIndexer { private List<PeopleListResponse.DataBean> dataBeanList; public void setPeopleList(List<PeopleListResponse.DataBean> dataBeanList){ this.dataBeanList = dataBeanList; notifyDataSetChanged(); } @Override public int getCount() { return dataBeanList == null ? 0 : dataBeanList.size(); } @Override public PeopleListResponse.DataBean getItem(int position) { return dataBeanList.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder vh; if(convertView == null){ vh = new ViewHolder(); convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_appoint_employee,parent,false); vh.tvNameEmployee = (TextView) convertView.findViewById(R.id.tv_name_employee); vh.tvIndex = (TextView) convertView.findViewById(R.id.tv_index); convertView.setTag(vh); }else{ vh = (ViewHolder) convertView.getTag(); } PeopleListResponse.DataBean employee = getItem(position); vh.tvNameEmployee.setText(employee.getDeviceName()); vh.tvIndex.setText(employee.getFirstSpell()); // if(position != ) { // // } if( position !=0 && getItem(position-1).getFirstSpell().equals(employee.getFirstSpell())){ vh.tvIndex.setVisibility(View.GONE); /*vh.tvNameEmployee.setVisibility(View.VISIBLE);*/ }else { vh.tvIndex.setVisibility(View.VISIBLE); /*vh.tvNameEmployee.setVisibility(View.GONE);*/ } return convertView; } class ViewHolder{ TextView tvNameEmployee,tvIndex; } @Override public int getPositionForSection(int sectionIndex) { if(sectionIndex == '↑'){ return -1; // +1 = 0 正好所有头视图的位置 } for (int i = 0; i < (dataBeanList == null ? 0 : dataBeanList.size()); i++) { PeopleListResponse.DataBean employee = dataBeanList.get(i); if(employee.getFirstSpell().equals("" + (char)sectionIndex)){ return i; } } return -2; } @Override public Object[] getSections() { return null; } @Override public int getSectionForPosition(int position) { return 0; } }
[ "liwei49699@163.com" ]
liwei49699@163.com
458d132f6bfabdb9bd0155947c8e79e9c2927e92
7346339b5f2d09d7c1f0a54551c4003e65e43e4e
/src/main/java/top/easylearning/register/service/RegisterService.java
50006b520204e5f249fab5c7c2358fbcb4d65a59
[]
no_license
dengjiyu/easylearning
49557a878b2529a63e4579bdb823c3a652e67a9d
86360d297abf4786b405f08cc171af8c7c4699a1
refs/heads/master
2022-12-25T10:40:31.860145
2021-12-18T12:36:16
2021-12-18T12:36:16
191,868,473
1
0
null
2022-12-16T03:31:40
2019-06-14T03:13:37
Java
UTF-8
Java
false
false
277
java
package top.easylearning.register.service; import java.util.List; public interface RegisterService { //完成用户的注册功能 /** * * 参数:封装的JDBC中的对于增删改操作的占位符 * @return */ public boolean registerUser(List<Object> params); }
[ "343903954@qq.com" ]
343903954@qq.com
69faa3b46cbf3c720590e186030b22dbb90e8995
38084df0bd676ae4cb5347192437edc0aea4f02f
/SpringBoot_Photography/src/test/java/com/cnblog/SpringBootPhotographyApplicationTests.java
fdc3026837c3fc85b30adda8fee5a986cbee220f
[]
no_license
baimouren/Spring_boot
579bbdb483878ad6602b1cde48bd5fd973500847
6e6e5abd4b1f1c07f8483f8a8cc95d1b6249a34e
refs/heads/master
2020-03-15T11:23:40.694350
2018-08-09T07:57:06
2018-08-09T07:57:06
132,120,012
1
0
null
null
null
null
UTF-8
Java
false
false
342
java
package com.cnblog; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class SpringBootPhotographyApplicationTests { @Test public void contextLoads() { } }
[ "18321749330@163.com" ]
18321749330@163.com
b1be363d27eef6ef2f715ca953d3abb096011154
1dae8028189c1d1af8ff866c474fe771a9cc78fc
/app/src/main/java/com/jimahtech/banking/adapters/AccountDetailsAdapter.java
fbe3d35a4d1979e9ada73bbcaf0c7a9403e30e57
[]
no_license
FransDroid/susu
7b63f645f7d157f7542b81ae34ca0e83d990f7cb
c8cbf030dc610a2831c1968ddc7661e8698133e3
refs/heads/master
2020-06-26T04:45:46.506224
2019-07-30T13:00:58
2019-07-30T13:00:58
199,536,031
0
0
null
null
null
null
UTF-8
Java
false
false
2,391
java
package com.jimahtech.banking.adapters; import android.content.Context; import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import com.jimahtech.banking.R; import com.jimahtech.banking.model.Item; import java.util.ArrayList; /** * Created by Chief on 2017-11-02. */ public class AccountDetailsAdapter extends RecyclerView.Adapter<SetViewHolder> { private Context context; ArrayList<Item> items; private LayoutInflater inflater; private int previousPosition = 0; public AccountDetailsAdapter(Context context, ArrayList<Item> items) { this.context = context; this.items = items; inflater = LayoutInflater.from(context); } @Override public SetViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = inflater.inflate(R.layout.acc_details_card, parent, false); SetViewHolder holder = new SetViewHolder(view); return holder; } @Override public void onBindViewHolder(SetViewHolder holder, int position) { holder.trans_time.setText(items.get(position).getTransDate()); holder.trans_desc.setText(items.get(position).getDesc()); holder.type.setText(items.get(position).getStatus()); /* if (holder.type.toString().equals("Credit")){ holder.trans_type.setText("(¢"+Double.parseDouble(items.get(position).getTrans_type())+")"); holder.type.setTextColor(Color.parseColor("#FF2ECA71")); } else { holder.trans_type.setText("(¢"+Double.parseDouble(items.get(position).getTrans_type())+")"); holder.type.setTextColor(Color.parseColor("#FFE54B3D")); } */ if (position % 2 == 0) { holder.itemView.setBackgroundColor(ContextCompat.getColor(context, R.color.rec_color1)); } else { holder.itemView.setBackgroundColor(ContextCompat.getColor(context, R.color.rec_color2)); } Animation fromRight = AnimationUtils.loadAnimation(context, R.anim.item_animation_from_bottom); holder.itemView.startAnimation(fromRight); } @Override public int getItemCount() { return items.size(); } }
[ "francis300@gmail.com" ]
francis300@gmail.com
f86c710827e23f3aae8c97b45691bd7c8ba70427
c7a358d63729bceca98181f850e8a84dfb22781f
/src/test/java/com/example/gcloud/GcloudApplicationTests.java
1536942ffe3dcc32b92548e18589998073f5e4fa
[]
no_license
umeshk301290/GoogleCloud
1d86f3308bba503443fa1c4102b5afc40c85b694
cc490f205875a790ca9a4079b39e9cea2c91f26d
refs/heads/master
2022-07-09T02:53:51.389486
2020-05-21T09:16:42
2020-05-21T09:16:42
265,796,761
0
0
null
null
null
null
UTF-8
Java
false
false
210
java
package com.example.gcloud; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class GcloudApplicationTests { @Test void contextLoads() { } }
[ "noreply@github.com" ]
noreply@github.com
3a1e74de6e92231a3c130ab56e15ad91b1989391
3a59bd4f3c7841a60444bb5af6c859dd2fe7b355
/sources/com/google/zxing/oned/CodaBarWriter.java
12eef4c7086fec7f3071b05b8e62f59a3830afff
[]
no_license
sengeiou/KnowAndGo-android-thunkable
65ac6882af9b52aac4f5a4999e095eaae4da3c7f
39e809d0bbbe9a743253bed99b8209679ad449c9
refs/heads/master
2023-01-01T02:20:01.680570
2020-10-22T04:35:27
2020-10-22T04:35:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,055
java
package com.google.zxing.oned; import org.apache.commons.p032io.IOUtils; public final class CodaBarWriter extends OneDimensionalCodeWriter { private static final char[] ALT_START_END_CHARS = {'T', 'N', '*', 'E'}; private static final char[] CHARS_WHICH_ARE_TEN_LENGTH_EACH_AFTER_DECODED = {IOUtils.DIR_SEPARATOR_UNIX, ':', '+', '.'}; private static final char DEFAULT_GUARD = START_END_CHARS[0]; private static final char[] START_END_CHARS = {'A', 'B', 'C', 'D'}; public boolean[] encode(String str) { int i; if (str.length() < 2) { str = DEFAULT_GUARD + str + DEFAULT_GUARD; } else { char upperCase = Character.toUpperCase(str.charAt(0)); char upperCase2 = Character.toUpperCase(str.charAt(str.length() - 1)); boolean arrayContains = CodaBarReader.arrayContains(START_END_CHARS, upperCase); boolean arrayContains2 = CodaBarReader.arrayContains(START_END_CHARS, upperCase2); boolean arrayContains3 = CodaBarReader.arrayContains(ALT_START_END_CHARS, upperCase); boolean arrayContains4 = CodaBarReader.arrayContains(ALT_START_END_CHARS, upperCase2); if (arrayContains) { if (!arrayContains2) { throw new IllegalArgumentException("Invalid start/end guards: ".concat(String.valueOf(str))); } } else if (arrayContains3) { if (!arrayContains4) { throw new IllegalArgumentException("Invalid start/end guards: ".concat(String.valueOf(str))); } } else if (arrayContains2 || arrayContains4) { throw new IllegalArgumentException("Invalid start/end guards: ".concat(String.valueOf(str))); } else { str = DEFAULT_GUARD + str + DEFAULT_GUARD; } } int i2 = 20; for (int i3 = 1; i3 < str.length() - 1; i3++) { if (Character.isDigit(str.charAt(i3)) || str.charAt(i3) == '-' || str.charAt(i3) == '$') { i2 += 9; } else if (CodaBarReader.arrayContains(CHARS_WHICH_ARE_TEN_LENGTH_EACH_AFTER_DECODED, str.charAt(i3))) { i2 += 10; } else { throw new IllegalArgumentException("Cannot encode : '" + str.charAt(i3) + '\''); } } boolean[] zArr = new boolean[(i2 + (str.length() - 1))]; int i4 = 0; for (int i5 = 0; i5 < str.length(); i5++) { char upperCase3 = Character.toUpperCase(str.charAt(i5)); if (i5 == 0 || i5 == str.length() - 1) { if (upperCase3 == '*') { upperCase3 = 'C'; } else if (upperCase3 == 'E') { upperCase3 = 'D'; } else if (upperCase3 == 'N') { upperCase3 = 'B'; } else if (upperCase3 == 'T') { upperCase3 = 'A'; } } int i6 = 0; while (true) { if (i6 >= CodaBarReader.ALPHABET.length) { i = 0; break; } else if (upperCase3 == CodaBarReader.ALPHABET[i6]) { i = CodaBarReader.CHARACTER_ENCODINGS[i6]; break; } else { i6++; } } int i7 = i4; int i8 = 0; boolean z = true; while (true) { int i9 = 0; while (i8 < 7) { zArr[i7] = z; i7++; if (((i >> (6 - i8)) & 1) == 0 || i9 == 1) { z = !z; i8++; } else { i9++; } } break; } if (i5 < str.length() - 1) { zArr[i7] = false; i7++; } i4 = i7; } return zArr; } }
[ "joshuahj.tsao@gmail.com" ]
joshuahj.tsao@gmail.com
f49b8de1a1dfd66552e6a2263ae55f2a2ef1d365
b4e7c4a46d7d58ebe1641f82970f8c6c9f18ecdf
/app/src/main/java/com/cph/drivers/driverperson/Myalert.java
438d88ae686d1f7b0a2fc698c1d4f54350fe6e31
[]
no_license
Chumphae911/DriverPersonCPH
fe1d37a13d08826705d43af5535b1dcf41cc2e17
d4857948a4c438a42e5380262ec9bb4653e83400
refs/heads/master
2020-06-18T07:48:09.329116
2017-11-22T07:32:13
2017-11-22T07:32:13
94,163,222
0
0
null
null
null
null
UTF-8
Java
false
false
923
java
package com.cph.drivers.driverperson; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; /** * Created by CPHchum on 18/6/2560. */ public class Myalert { private Context context; public Myalert(Context context) { this.context = context; } public Myalert() { } public void myDialog(String strTitle, String strMassage) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setCancelable(false); builder.setIcon(R.mipmap.ic_icon); builder.setTitle(strTitle); builder.setMessage(strMassage); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.show(); } } //Main Class
[ "Singernice@hotmail.com" ]
Singernice@hotmail.com
bffaf5d245c97ac23c38433c5c88b69d7fa8e336
7a1b159839c6f9e79cb79990edace15cce11d427
/app/src/main/java/com/leshadow/mapme/LocalServerUserAreaActivity.java
2ca819c96d5817e33d92cb246ddee1ed6be5e40b
[]
no_license
LeShadowHub/Mapme
acb4c5d5d35e5465341a4b45af6742c50caa86c6
60fbe1a09a112718e73e89c4906b88b3e6049eba
refs/heads/master
2021-03-30T17:16:28.506782
2017-10-15T05:50:49
2017-10-15T05:50:49
93,961,328
0
0
null
null
null
null
UTF-8
Java
false
false
927
java
package com.leshadow.mapme; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; /** * The LocalServerUserAreaActivity takes user to user area once login is successful * from LocalServerLoginActivity * Not used in MapMe */ public class LocalServerUserAreaActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_local_server_user_area); Button btnLogout = (Button) findViewById(R.id.bLogout); btnLogout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(LocalServerUserAreaActivity.this, LocalServerLoginActivity.class)); } }); } }
[ "kevins168@utexas.edu" ]
kevins168@utexas.edu
9fca3ffe334a3942e1cfdcc8e7d9af9c3972be02
0b4e0c56eca9150a7c83b6bc316d15eb1b0a3235
/src/main/java/com/google/devtools/build/docgen/MultiPageBuildEncyclopediaProcessor.java
9c3a95153f16f03286a312ea1de8508e716e955c
[ "Apache-2.0" ]
permissive
WhiteSymmetry/bazel
7415e0d838719a0bd63527cab95e23c62a37af3d
43e5d3bf426125c3dd413234d7b23a4228d22ff1
refs/heads/master
2021-01-11T07:57:09.858940
2016-10-27T18:33:19
2016-10-27T18:39:03
72,142,327
1
0
null
2016-10-27T19:44:38
2016-10-27T19:44:37
null
UTF-8
Java
false
false
5,251
java
// Copyright 2014 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.devtools.build.docgen; import com.google.common.collect.Sets; import com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider; import java.io.IOException; import java.util.List; import java.util.Map; /** * Assembles the multi-page version of the Build Encyclopedia with one page per rule family. */ public class MultiPageBuildEncyclopediaProcessor extends BuildEncyclopediaProcessor { public MultiPageBuildEncyclopediaProcessor(ConfiguredRuleClassProvider ruleClassProvider) { super(ruleClassProvider); } /** * Collects and processes all the rule and attribute documentation in inputDirs and * generates the Build Encyclopedia into the outputDir. * * @param inputDirs list of directory to scan for document in the source code * @param outputDir output directory where to write the build encyclopedia * @param blackList optional path to a file listing rules to not document */ @Override public void generateDocumentation(List<String> inputDirs, String outputDir, String blackList) throws BuildEncyclopediaDocException, IOException { BuildDocCollector collector = new BuildDocCollector(ruleClassProvider, false); RuleLinkExpander expander = new RuleLinkExpander(false); Map<String, RuleDocumentation> ruleDocEntries = collector.collect( inputDirs, blackList, expander); warnAboutUndocumentedRules( Sets.difference(ruleClassProvider.getRuleClassMap().keySet(), ruleDocEntries.keySet())); writeStaticDoc(outputDir, expander, "make-variables"); writeStaticDoc(outputDir, expander, "predefined-python-variables"); writeStaticDoc(outputDir, expander, "functions"); writeCommonDefinitionsPage(outputDir, expander); writeRuleDocs(outputDir, expander, ruleDocEntries.values()); } private void writeStaticDoc(String outputDir, RuleLinkExpander expander, String name) throws IOException { // TODO(dzc): Consider splitting out the call to writePage so that this method only creates the // Page object and adding docgen tests that test the state of Page objects constructed by // this method, and similar methods in this class. Page page = TemplateEngine.newPage(DocgenConsts.BE_TEMPLATE_DIR + "/" + name + ".vm"); page.add("expander", expander); writePage(page, outputDir, name + ".html"); } private void writeCommonDefinitionsPage(String outputDir, RuleLinkExpander expander) throws IOException { Page page = TemplateEngine.newPage(DocgenConsts.COMMON_DEFINITIONS_TEMPLATE); page.add("expander", expander); page.add("commonAttributes", expandCommonAttributes(PredefinedAttributes.COMMON_ATTRIBUTES, expander)); page.add("testAttributes", expandCommonAttributes(PredefinedAttributes.TEST_ATTRIBUTES, expander)); page.add("binaryAttributes", expandCommonAttributes(PredefinedAttributes.BINARY_ATTRIBUTES, expander)); writePage(page, outputDir, "common-definitions.html"); } private void writeRuleDocs(String outputDir, RuleLinkExpander expander, Iterable<RuleDocumentation> docEntries) throws BuildEncyclopediaDocException, IOException { RuleFamilies ruleFamilies = assembleRuleFamilies(docEntries); // Generate documentation. writeOverviewPage(outputDir, expander, ruleFamilies.langSpecific, ruleFamilies.generic); writeBeNav(outputDir, ruleFamilies.all); for (RuleFamily ruleFamily : ruleFamilies.all) { if (ruleFamily.size() > 0) { writeRuleDoc(outputDir, ruleFamily); } } } private void writeOverviewPage(String outputDir, RuleLinkExpander expander, List<RuleFamily> langSpecificRuleFamilies, List<RuleFamily> genericRuleFamilies) throws BuildEncyclopediaDocException, IOException { Page page = TemplateEngine.newPage(DocgenConsts.OVERVIEW_TEMPLATE); page.add("expander", expander); page.add("langSpecificRuleFamilies", langSpecificRuleFamilies); page.add("genericRuleFamilies", genericRuleFamilies); writePage(page, outputDir, "overview.html"); } private void writeRuleDoc(String outputDir, RuleFamily ruleFamily) throws BuildEncyclopediaDocException, IOException { Page page = TemplateEngine.newPage(DocgenConsts.RULES_TEMPLATE); page.add("ruleFamily", ruleFamily); writePage(page, outputDir, ruleFamily.getId() + ".html"); } private void writeBeNav(String outputDir, List<RuleFamily> ruleFamilies) throws IOException { Page page = TemplateEngine.newPage(DocgenConsts.BE_NAV_TEMPLATE); page.add("ruleFamilies", ruleFamilies); writePage(page, outputDir, "be-nav.html"); } }
[ "aehlig@google.com" ]
aehlig@google.com
d9c870a131c97d207375fdd9a47a80748ea7b8e4
2f4a058ab684068be5af77fea0bf07665b675ac0
/app/android/support/v4/view/ViewPager$1.java
59fbe537f645eea9c95e13377af9fb00d13d0512
[]
no_license
cengizgoren/facebook_apk_crack
ee812a57c746df3c28fb1f9263ae77190f08d8d2
a112d30542b9f0bfcf17de0b3a09c6e6cfe1273b
refs/heads/master
2021-05-26T14:44:04.092474
2013-01-16T08:39:00
2013-01-16T08:39:00
8,321,708
1
0
null
null
null
null
UTF-8
Java
false
false
462
java
package android.support.v4.view; import java.util.Comparator; final class ViewPager$1 implements Comparator<ViewPager.ItemInfo> { public int a(ViewPager.ItemInfo paramItemInfo1, ViewPager.ItemInfo paramItemInfo2) { return paramItemInfo1.b - paramItemInfo2.b; } } /* Location: /data1/software/jd-gui/com.facebook.katana_2.0_liqucn.com-dex2jar.jar * Qualified Name: android.support.v4.view.ViewPager.1 * JD-Core Version: 0.6.0 */
[ "macluz@msn.com" ]
macluz@msn.com
17b5d88926925474626570ae49a023aae4a16993
9a4ef5e97a8cdfbfdbc6edecc973c17f241c33ad
/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteBackendResponse.java
fda664bf4328bd76cd67b9efc18420cd96b40580
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer", "UPL-1.0" ]
permissive
sudison/bmcs-java-sdk
cd1eb725ba55498808c92c63bf9ac66dc760da07
27304207619d533206f4501f94d81582702bf86a
refs/heads/master
2021-01-21T15:12:50.875976
2017-05-19T19:27:49
2017-05-19T19:28:11
91,830,361
0
0
null
2017-05-19T17:34:41
2017-05-19T17:34:41
null
UTF-8
Java
false
false
1,314
java
/** * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.bmc.loadbalancer.responses; import java.io.*; import java.util.*; import com.oracle.bmc.model.*; import javax.ws.rs.core.*; import lombok.Builder; import lombok.Getter; import lombok.experimental.Accessors; import com.oracle.bmc.loadbalancer.model.*; @javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") @Builder(builderClassName = "Builder") @Getter public class DeleteBackendResponse { /** * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about * a particular request, please provide the request ID. * */ private String opcRequestId; /** * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. */ private String opcWorkRequestId; public static class Builder { /** * Copy method to populate the builder with values from the given instance. * @return this builder instance */ public Builder copy(DeleteBackendResponse o) { opcRequestId(o.getOpcRequestId()); opcWorkRequestId(o.getOpcWorkRequestId()); return this; } } }
[ "mathias.ricken@oracle.com" ]
mathias.ricken@oracle.com
b5db4a5969f48ff7f0f8752c59fa96213e1dd6c9
fb107dae0bd722b392b75dd3328190e3b1f1434d
/node_modules/lottie-react-native/src/android/build/generated/source/r/androidTest/debug/android/support/compat/R.java
ba05f4068b624221bb820231bc4f3d7a6994e5d0
[ "Apache-2.0", "MIT" ]
permissive
basilwong/small_steps
8c8d5c09f0d054a4bd302314de7725f8123664f0
a25c7dae0fe269a5734225d1c8c24a95f0b8af8c
refs/heads/master
2023-01-10T02:23:10.626725
2022-12-28T08:09:08
2022-12-28T08:09:08
148,940,392
5
6
MIT
2022-12-28T08:09:09
2018-09-15T21:11:55
JavaScript
UTF-8
Java
false
false
7,610
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.compat; public final class R { public static final class attr { public static final int font = 0x7f0100bc; public static final int fontProviderAuthority = 0x7f0100b5; public static final int fontProviderCerts = 0x7f0100b8; public static final int fontProviderFetchStrategy = 0x7f0100b9; public static final int fontProviderFetchTimeout = 0x7f0100ba; public static final int fontProviderPackage = 0x7f0100b6; public static final int fontProviderQuery = 0x7f0100b7; public static final int fontStyle = 0x7f0100bb; public static final int fontWeight = 0x7f0100bd; } public static final class bool { public static final int abc_action_bar_embed_tabs = 0x7f080000; } public static final class color { public static final int notification_action_color_filter = 0x7f090000; public static final int notification_icon_bg_color = 0x7f090028; public static final int ripple_material_light = 0x7f090033; public static final int secondary_text_default_material_light = 0x7f090035; } public static final class dimen { public static final int compat_button_inset_horizontal_material = 0x7f06004e; public static final int compat_button_inset_vertical_material = 0x7f06004f; public static final int compat_button_padding_horizontal_material = 0x7f060050; public static final int compat_button_padding_vertical_material = 0x7f060051; public static final int compat_control_corner_material = 0x7f060052; public static final int notification_action_icon_size = 0x7f06005c; public static final int notification_action_text_size = 0x7f06005d; public static final int notification_big_circle_margin = 0x7f06005e; public static final int notification_content_margin_start = 0x7f060012; public static final int notification_large_icon_height = 0x7f06005f; public static final int notification_large_icon_width = 0x7f060060; public static final int notification_main_column_padding_top = 0x7f060013; public static final int notification_media_narrow_margin = 0x7f060014; public static final int notification_right_icon_size = 0x7f060061; public static final int notification_right_side_padding_top = 0x7f060010; public static final int notification_small_icon_background_padding = 0x7f060062; public static final int notification_small_icon_size_as_large = 0x7f060063; public static final int notification_subtext_size = 0x7f060064; public static final int notification_top_pad = 0x7f060065; public static final int notification_top_pad_large_text = 0x7f060066; } public static final class drawable { public static final int notification_action_background = 0x7f020053; public static final int notification_bg = 0x7f020054; public static final int notification_bg_low = 0x7f020055; public static final int notification_bg_low_normal = 0x7f020056; public static final int notification_bg_low_pressed = 0x7f020057; public static final int notification_bg_normal = 0x7f020058; public static final int notification_bg_normal_pressed = 0x7f020059; public static final int notification_icon_background = 0x7f02005a; public static final int notification_template_icon_bg = 0x7f02005f; public static final int notification_template_icon_low_bg = 0x7f020060; public static final int notification_tile_bg = 0x7f02005b; public static final int notify_panel_notification_icon_bg = 0x7f02005c; } public static final class id { public static final int action_container = 0x7f0a0068; public static final int action_divider = 0x7f0a006f; public static final int action_image = 0x7f0a0069; public static final int action_text = 0x7f0a006a; public static final int actions = 0x7f0a0078; public static final int async = 0x7f0a0021; public static final int blocking = 0x7f0a0022; public static final int chronometer = 0x7f0a0074; public static final int forever = 0x7f0a0023; public static final int icon = 0x7f0a003f; public static final int icon_group = 0x7f0a0079; public static final int info = 0x7f0a0075; public static final int italic = 0x7f0a0024; public static final int line1 = 0x7f0a0005; public static final int line3 = 0x7f0a0006; public static final int normal = 0x7f0a0010; public static final int notification_background = 0x7f0a0076; public static final int notification_main_column = 0x7f0a0071; public static final int notification_main_column_container = 0x7f0a0070; public static final int right_icon = 0x7f0a0077; public static final int right_side = 0x7f0a0072; public static final int text = 0x7f0a000b; public static final int text2 = 0x7f0a000c; public static final int time = 0x7f0a0073; public static final int title = 0x7f0a000d; } public static final class integer { public static final int status_bar_notification_info_maxnum = 0x7f0b0004; } public static final class layout { public static final int notification_action = 0x7f03001b; public static final int notification_action_tombstone = 0x7f03001c; public static final int notification_template_custom_big = 0x7f030023; public static final int notification_template_icon_group = 0x7f030024; public static final int notification_template_part_chronometer = 0x7f030028; public static final int notification_template_part_time = 0x7f030029; } public static final class string { public static final int status_bar_notification_info_overflow = 0x7f050014; } public static final class style { public static final int TextAppearance_Compat_Notification = 0x7f07008c; public static final int TextAppearance_Compat_Notification_Info = 0x7f07008d; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f07010a; public static final int TextAppearance_Compat_Notification_Time = 0x7f070090; public static final int TextAppearance_Compat_Notification_Title = 0x7f070092; public static final int Widget_Compat_NotificationActionContainer = 0x7f070094; public static final int Widget_Compat_NotificationActionText = 0x7f070095; } public static final class styleable { public static final int[] FontFamily = { 0x7f0100b5, 0x7f0100b6, 0x7f0100b7, 0x7f0100b8, 0x7f0100b9, 0x7f0100ba }; public static final int[] FontFamilyFont = { 0x7f0100bb, 0x7f0100bc, 0x7f0100bd }; public static final int FontFamilyFont_font = 1; public static final int FontFamilyFont_fontStyle = 0; public static final int FontFamilyFont_fontWeight = 2; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 3; public static final int FontFamily_fontProviderFetchStrategy = 4; public static final int FontFamily_fontProviderFetchTimeout = 5; public static final int FontFamily_fontProviderPackage = 1; public static final int FontFamily_fontProviderQuery = 2; } }
[ "wong.bas@gmail.com" ]
wong.bas@gmail.com
861e5eed17d5ea45cec831a0fb07974c0a705ac2
cd3ccc969d6e31dce1a0cdc21de71899ab670a46
/agp-7.1.0-alpha01/tools/base/common/src/test/java/com/android/utils/JvmWideVariableTest.java
825ea3727c551c6db807d7ed0a97347b4721261d
[ "Apache-2.0" ]
permissive
jomof/CppBuildCacheWorkInProgress
75e76e1bd1d8451e3ee31631e74f22e5bb15dd3c
9e3475f6d94cb3239f27ed8f8ee81b0abde4ef51
refs/heads/main
2023-05-28T19:03:16.798422
2021-06-10T20:59:25
2021-06-10T20:59:25
374,736,765
0
1
Apache-2.0
2021-06-07T21:06:53
2021-06-07T16:44:55
Java
UTF-8
Java
false
false
25,039
java
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.utils; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.fail; import com.android.testutils.classloader.SingleClassLoader; import com.google.common.base.Throwables; import com.google.common.base.VerifyException; import com.google.common.collect.ImmutableList; import com.google.common.reflect.TypeToken; import java.lang.reflect.Method; import java.util.Collection; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import org.junit.Test; /** Test cases for {@link JvmWideVariable}. */ @SuppressWarnings("ResultOfObjectAllocationIgnored") public class JvmWideVariableTest { @Test public void testRead() { JvmWideVariable<String> variable = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "Some text"); assertThat(variable.get()).isEqualTo("Some text"); variable.unregister(); } @Test public void testInitializeTwiceThenRead() { new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "Some text"); JvmWideVariable<String> variable = new JvmWideVariable<>( JvmWideVariableTest.class, "name", String.class, "Some other text"); // Expect that the second default value is ignored assertThat(variable.get()).isEqualTo("Some text"); variable.unregister(); } @Test public void testWriteThenRead() { JvmWideVariable<String> variable = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "Some text"); variable.set("Some other text"); assertThat(variable.get()).isEqualTo("Some other text"); variable.unregister(); } @Test public void testWriteThenReadTwice() { JvmWideVariable<String> variable = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "Some text"); variable.set("Some other text"); assertThat(variable.get()).isEqualTo("Some other text"); variable.set("Yet some other text"); assertThat(variable.get()).isEqualTo("Yet some other text"); variable.unregister(); } @Test public void testSameVariable() { JvmWideVariable<String> variable = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "This text"); JvmWideVariable<String> variable2 = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "That text"); assertThat(variable.get()).isEqualTo("This text"); assertThat(variable2.get()).isEqualTo("This text"); variable2.set("Other text"); assertThat(variable.get()).isEqualTo("Other text"); assertThat(variable2.get()).isEqualTo("Other text"); variable.unregister(); } @Test public void testDifferentVariables() { JvmWideVariable<String> variable = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "This text"); JvmWideVariable<String> variable2 = new JvmWideVariable<>( JvmWideVariableTest.class, "name2", String.class, "That text"); assertThat(variable.get()).isEqualTo("This text"); assertThat(variable2.get()).isEqualTo("That text"); variable2.set("Other text"); assertThat(variable.get()).isEqualTo("This text"); assertThat(variable2.get()).isEqualTo("Other text"); variable.unregister(); variable2.unregister(); } @Test public void testNullValues() { JvmWideVariable<String> variable = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, null); assertThat(variable.get()).isNull(); variable.set("Some text"); assertThat(variable.get()).isEqualTo("Some text"); variable.set(null); assertThat(variable.get()).isNull(); variable.unregister(); } @Test public void testDefaultValueSupplier() { JvmWideVariable<String> variable = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "Some text"); new JvmWideVariable<>( JvmWideVariableTest.class, "name", TypeToken.of(String.class), () -> { fail("This should not be executed"); return null; }); JvmWideVariable<String> variable2 = new JvmWideVariable<>( JvmWideVariableTest.class, "name2", TypeToken.of(String.class), () -> "This should be executed"); assertThat(variable2.get()).isEqualTo("This should be executed"); variable.unregister(); variable2.unregister(); } @Test public void testGetFullName() { // Test valid full name JvmWideVariable.getFullName("group", "name", "tag"); // Test invalid full names try { JvmWideVariable.getFullName("group with space", "name", "tag"); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { // Expected } try { JvmWideVariable.getFullName("group", "name with :", "tag"); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { // Expected } try { JvmWideVariable.getFullName("group", "name with =", "tag"); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { // Expected } try { JvmWideVariable.getFullName("group", "name", "tag with ,"); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { // Expected } try { JvmWideVariable.getFullName("group", "name", ""); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { // Expected } } @Test public void testCollectComponentClasses_SimpleType() { Collection<Class<?>> classes = JvmWideVariable.collectComponentClasses(new TypeToken<String>() {}.getType()); assertThat(classes).containsExactly(String.class); } @Test public void testCollectComponentClasses_ParameterizedType() { Collection<Class<?>> classes = JvmWideVariable.collectComponentClasses(new TypeToken<List<String>>() {}.getType()); assertThat(classes).containsExactly(List.class, String.class); } @Test public void testCollectComponentClasses_GenericArrayType() { Collection<Class<?>> classes = JvmWideVariable.collectComponentClasses( new TypeToken<List<String>[]>() {}.getType()); assertThat(classes).containsExactly(List.class, String.class); } @Test public void testCollectComponentClasses_UpperBoundWildcardType() { Collection<Class<?>> classes = JvmWideVariable.collectComponentClasses( new TypeToken<Class<? extends CharSequence>>() {}.getType()); assertThat(classes).containsExactly(Class.class, CharSequence.class); } @Test public void testCollectComponentClasses_LowerBoundWildcardType() { Collection<Class<?>> classes = JvmWideVariable.collectComponentClasses( new TypeToken<Class<? super String>>() {}.getType()); assertThat(classes).containsExactly(Class.class, String.class, Object.class); } @Test public void testVariables_WithBootstrapAndNonBootstrapClassLoaders_SimpleTypes() throws Exception { // Create a JVM-wide variable whose type is loaded by the bootstrap class loader, expect // success JvmWideVariable<String> variable = new JvmWideVariable<>(JvmWideVariableTest.class, "foo", String.class, null); // Create a JVM-wide variable whose type is loaded by the application (non-bootstrap) class // loader, expect failure try { new JvmWideVariable<>(JvmWideVariableTest.class, "fooCounter", FooCounter.class, null); fail("Expected VerifyException"); } catch (VerifyException e) { assertThat(e.getMessage()) .isEqualTo( String.format( "Type %s used to define JVM-wide variable %s must be loaded by" + " the bootstrap class loader but is loaded by %s", FooCounter.class, JvmWideVariable.getFullName( JvmWideVariableTest.class.getName(), "fooCounter", FooCounter.class.getName()), FooCounter.class.getClassLoader())); } // Create a JVM-wide variable whose type is loaded by a custom class loader, expect failure SingleClassLoader classLoader = new SingleClassLoader(FooCounter.class.getName()); Class<?> clazz = classLoader.load(); try { new JvmWideVariable<>(JvmWideVariableTest.class, "fooCounter", clazz, null); fail("Expected VerifyException"); } catch (VerifyException e) { assertThat(e.getMessage()) .isEqualTo( String.format( "Type %s used to define JVM-wide variable %s must be loaded by" + " the bootstrap class loader but is loaded by %s", clazz, JvmWideVariable.getFullName( JvmWideVariableTest.class.getName(), "fooCounter", FooCounter.class.getName()), clazz.getClassLoader())); } variable.unregister(); } @Test public void testVariables_WithBootstrapAndNonBootstrapClassLoaders_ComplexTypes() throws Exception { // Create a JVM-wide variable whose type is a ParameterizeType, and its argument's type is // loaded by the bootstrap class loader, expect success JvmWideVariable<List<String>> variable = new JvmWideVariable<>( JvmWideVariableTest.class, "foo", new TypeToken<List<String>>() {}, () -> null); // Create a JVM-wide variable whose type is a ParameterizeType, and its argument's type is // loaded by the application (non-bootstrap) class loader, expect failure try { new JvmWideVariable<>( JvmWideVariableTest.class, "fooCounter", new TypeToken<List<FooCounter>>() {}, () -> null); fail("Expected VerifyException"); } catch (VerifyException e) { String tag = JvmWideVariable.collectComponentClasses( new TypeToken<List<FooCounter>>() {}.getType()) .stream() .map(Class::getName) .collect(Collectors.joining("-")); assertThat(e.getMessage()) .isEqualTo( String.format( "Type %s used to define JVM-wide variable %s must be loaded by" + " the bootstrap class loader but is loaded by %s", JvmWideVariableTest.FooCounter.class, JvmWideVariable.getFullName( JvmWideVariableTest.class.getName(), "fooCounter", tag), JvmWideVariableTest.FooCounter.class.getClassLoader())); } variable.unregister(); } @Test public void testVariables_WithSameGroupNameTag_DifferentSimpleTypes() throws Exception { JvmWideVariable<String> variable = new JvmWideVariable<>( JvmWideVariableTest.class.getName(), "name", "tag", TypeToken.of(String.class), () -> "Some text"); // Create another JVM-wide variable with the same group, same name, same tag, but different // type, expect failure JvmWideVariable<Integer> variable2 = new JvmWideVariable<>( JvmWideVariableTest.class.getName(), "name", "tag", TypeToken.of(Integer.class), () -> 1); try { @SuppressWarnings("unused") Integer value = variable2.get(); fail("Expected ClassCastException"); } catch (ClassCastException e) { String message = e.getMessage(); // Don't assert the entire message because its format may change across JDK versions // (bug 161616922). assertThat(message).contains("java.lang.String"); assertThat(message).contains("java.lang.Integer"); } variable.unregister(); } @Test public void testVariables_WithSameGroupNameTag_DifferentComplexTypes() throws Exception { // Create a JVM-wide variable with a ParameterizedType JvmWideVariable<List<String>> variable = new JvmWideVariable<>( JvmWideVariableTest.class.getName(), "name", "tag", new TypeToken<List<String>>() {}, () -> ImmutableList.of("Some text")); // Create another JVM-wide variable with the same group, same name, same tag, but different // ParameterizedType, expect failure JvmWideVariable<List<Integer>> variable2 = new JvmWideVariable<>( JvmWideVariableTest.class.getName(), "name", "tag", new TypeToken<List<Integer>>() {}, () -> null); try { @SuppressWarnings({"unused", "ConstantConditions"}) Integer value = variable2.get().get(0); fail("Expected ClassCastException"); } catch (ClassCastException e) { String message = e.getMessage(); // Don't assert the entire message because its format may change across JDK versions // (bug 161616922). assertThat(message).contains("java.lang.String"); assertThat(message).contains("java.lang.Integer"); } variable.unregister(); } @Test public void testExecuteCallableSynchronously() throws ExecutionException { JvmWideVariable<String> variable = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "Some text"); Integer result = variable.executeCallableSynchronously(() -> 1); assertThat(result).isEqualTo(1); variable.unregister(); } @Test public void testExecuteCallableSynchronously_ThrowingExecutionException() { JvmWideVariable<String> variable = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "Some text"); try { variable.executeCallableSynchronously( () -> { throw new IllegalStateException("Some exception"); }); fail("Expected ExecutionException"); } catch (ExecutionException e) { assertThat(Throwables.getRootCause(e)).isInstanceOf(IllegalStateException.class); assertThat(Throwables.getRootCause(e)).hasMessageThat().isEqualTo("Some exception"); } variable.unregister(); } @Test public void testDifferentClassLoaders() throws Exception { // Get a JVM-wide variable from a class loaded by the default class loader Integer counter = FooCounter.getCounterValue(); // Load the same class with a custom class loader SingleClassLoader classLoader = new SingleClassLoader(FooCounter.class.getName()); Class<?> clazz = classLoader.load(); assertThat(clazz.getClassLoader()).isNotEqualTo(FooCounter.class.getClassLoader()); // Get the JVM-wide variable from the same class loaded by the custom class loader Method method = clazz.getMethod("getCounterValue"); method.setAccessible(true); Integer counter2 = (Integer) method.invoke(null); // Assert that they are the same instance assertThat(counter2).isSameAs(counter); } /** * Sample class containing a {@link JvmWideVariable} static field. */ private static class FooCounter { private static final JvmWideVariable<Integer> COUNT = new JvmWideVariable<>(FooCounter.class, "COUNT", Integer.class, 1); public FooCounter() { } public static Integer getCounterValue() { return COUNT.get(); } } @Test public void testUnregister() throws Exception { JvmWideVariable<String> variable = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "Some text"); JvmWideVariable<String> sameVariable = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "Some text"); JvmWideVariable<String> variable2 = new JvmWideVariable<>( JvmWideVariableTest.class, "name2", String.class, "Some other text"); // Unregister the JVM-wide variable, expect that access to it afterwards will fail variable.unregister(); try { variable.get(); fail("Expected VerifyException"); } catch (VerifyException e) { assertThat(e.getMessage()).contains("has already been unregistered"); } // Check that access to the same JVM-wide variable from another JvmWideVariable instance // will also fail try { sameVariable.get(); fail("Expected VerifyException"); } catch (VerifyException e) { assertThat(e.getMessage()).contains("has already been unregistered"); } // Check that access to the second variable will still succeed assertThat(variable2.get()).isEqualTo("Some other text"); // Let another JvmWideVariable instance re-register the JVM-wide variable JvmWideVariable<String> anotherSameVariable = new JvmWideVariable<>(JvmWideVariableTest.class, "name", String.class, "Some text"); // The first variable was unregistered, it will not be used even if the underlying JVM-wide // variable is re-registered try { variable.get(); fail("Expected VerifyException"); } catch (VerifyException e) { assertThat(e.getMessage()).contains("has already been unregistered"); } // The second variable was never unregistered, so it can still be used if the underlying // JVM-wide variable is re-registered assertThat(sameVariable.get()).isEqualTo("Some text"); // Access to the other variables should succeed as normal assertThat(anotherSameVariable.get()).isEqualTo("Some text"); assertThat(variable2.get()).isEqualTo("Some other text"); sameVariable.unregister(); variable2.unregister(); } @Test public void testGetJvmWideObjectPerKey() { AtomicInteger object = JvmWideVariable.getJvmWideObjectPerKey( JvmWideVariableTest.class, "name", TypeToken.of(String.class), TypeToken.of(AtomicInteger.class), "key", () -> new AtomicInteger(1)); assertThat(object.get()).isEqualTo(1); AtomicInteger sameObject = JvmWideVariable.getJvmWideObjectPerKey( JvmWideVariableTest.class, "name", TypeToken.of(String.class), TypeToken.of(AtomicInteger.class), "key", () -> new AtomicInteger(-1)); assertThat(sameObject).isSameAs(object); assertThat(sameObject.get()).isEqualTo(1); AtomicInteger object2 = JvmWideVariable.getJvmWideObjectPerKey( JvmWideVariableTest.class, "name", TypeToken.of(String.class), TypeToken.of(AtomicInteger.class), "key2", () -> new AtomicInteger(2)); assertThat(object2).isNotSameAs(object); assertThat(object2.get()).isEqualTo(2); AtomicInteger object3 = JvmWideVariable.getJvmWideObjectPerKey( JvmWideVariableTest.class, "name2", TypeToken.of(String.class), TypeToken.of(AtomicInteger.class), "key", () -> new AtomicInteger(3)); assertThat(object3).isNotSameAs(object); assertThat(object3).isNotSameAs(object2); assertThat(object3.get()).isEqualTo(3); AtomicBoolean object4 = JvmWideVariable.getJvmWideObjectPerKey( JvmWideVariableTest.class, "name2", TypeToken.of(String.class), TypeToken.of(AtomicBoolean.class), "key", () -> new AtomicBoolean(true)); assertThat(object4).isNotSameAs(object); assertThat(object4).isNotSameAs(object2); assertThat(object4).isNotSameAs(object3); assertThat(object4.get()).isEqualTo(true); try { //noinspection InstantiationOfUtilityClass JvmWideVariable.getJvmWideObjectPerKey( JvmWideVariableTest.class, "foo", TypeToken.of(FooCounter.class), TypeToken.of(AtomicReference.class), new FooCounter(), AtomicReference::new); fail("Expected VerifyException"); } catch (VerifyException e) { assertThat(e.getMessage()).contains("must be loaded by the bootstrap class loader"); } try { JvmWideVariable.getJvmWideObjectPerKey( JvmWideVariableTest.class, "foo", TypeToken.of(String.class), TypeToken.of(FooCounter.class), "key", FooCounter::new); fail("Expected VerifyException"); } catch (VerifyException e) { assertThat(e.getMessage()).contains("must be loaded by the bootstrap class loader"); } try { JvmWideVariable.getJvmWideObjectPerKey( JvmWideVariableTest.class, "foo", TypeToken.of(String.class), TypeToken.of(AtomicReference.class), "key", () -> null); fail("Expected VerifyException"); } catch (VerifyException e) { assertThat(e.getMessage()).contains("expected a non-null reference"); } } }
[ "jomof@google.com" ]
jomof@google.com
16adf80e38ba905079285bd0d97dc56b130d9657
84ac7c7349c7a968ffc4df25715c40fa8316367e
/java/socialnetwork/domain/validators/FriendshipRequestValidator.java
9dca742bda7471be67d151e2ad2bdedeb5e87ef9
[]
no_license
MihaiVulcan/SocialNetwork
6d261762718c51a77cc22e3a2076afbcedeba4d1
c7f94a22cbfc28357e2b79d3ff525f0fd8e8f351
refs/heads/main
2023-03-24T06:51:26.429404
2021-03-11T10:09:30
2021-03-11T10:09:30
346,656,783
0
0
null
null
null
null
UTF-8
Java
false
false
503
java
package socialnetwork.domain.validators; import socialnetwork.domain.Friendship; import socialnetwork.domain.FriendshipRequest; public class FriendshipRequestValidator implements Validator<FriendshipRequest> { @Override public void validate(FriendshipRequest entity) throws ValidationException { if(entity.getId().getLeft() == entity.getId().getRight()) throw new ValidationException("Doesn't matter how awesome your pet is cannot befriend himself"); } }
[ "noreply@github.com" ]
noreply@github.com
27153a45d06a8a6af99702e3dee175e510501de5
067f565a12d52d888ac1f282d5610c30bb106696
/JavaApplication2/src/wsq/code/ListNode.java
89807472935366ebfc029d6f1738f8677ae6e807
[]
no_license
matogolf/BIO
75da34a29567ec870f16c021b0c0ffa5f9dc92e0
62c2e92b6b82a0c7ba09ecb0a02556ea815e39d5
refs/heads/master
2020-04-02T10:26:16.912512
2018-11-20T18:50:15
2018-11-20T18:50:15
154,339,744
1
0
null
2018-11-12T09:41:50
2018-10-23T14:11:15
Java
UTF-8
Java
false
false
976
java
package wsq.code; public class ListNode<T> { private T data; private ListNode next; // Constructor: No reference to next node provided so make it null public ListNode( T nodeData ) { this( nodeData, null); } // Constructor: Set data and reference to next node. public ListNode( T nodeData, ListNode nodeNext ) { data = nodeData; next = nodeNext; } // Accessor: Return the data for current ListNode object public T getData() { return data; } // Accessor: Return reference to next ListNode object public ListNode getNext() { return next; } // Mutator: Set new data for current ListNode object public void setData( T newData ) { data = newData; } // Mutator: Set new reference to the next node object public void setNext( ListNode newNext ) { next = newNext; } }
[ "lubomirgallovic@gmail.com" ]
lubomirgallovic@gmail.com
290fcc147dbff99181f95b0834801b1b12b19b83
d7a34f9561f379c36b2258b267eb5d537323c924
/ex0923인터페이스/src/인터페이스예제/IGame.java
d496bfe3480ba58c16c1262f75e6303a0c9386a1
[]
no_license
younghwaa/gitHubTest
386b7895718af91452e56723f6544a2c8ef2e780
0977438f1dea9f9931c01f1ec0a4303a741d8103
refs/heads/master
2023-08-11T16:14:09.458110
2021-09-27T05:42:10
2021-09-27T05:42:10
409,515,538
0
0
null
null
null
null
UHC
Java
false
false
289
java
package 인터페이스예제; public interface IGame { //작업 설계도 //랜덤한 수를 생성하는 기능 public void makeRandom(); //퀴즈 셍성하는 기능 public String getQuizMsg(); //정답 체크 public boolean checkAnswer(int answer); }
[ "smhrd@121.147.185.9" ]
smhrd@121.147.185.9
4047a80355bb6baa54fb7095b970155014e544f9
699b77fa3dd086daa42c3ca8930d706c114da0c7
/src/test/java/org/fasttrackit/moneycontrol/steps/BudgetTestSteps.java
00c997dd7897e5ae63de6818cfe4d949811ecfb3
[]
no_license
ramona2226/money-control
6b5ea22f8816eb7890ce47cebef4e40251184bfe
bcad2910edc04113286025e24cdd4641e34828ac
refs/heads/master
2023-01-23T09:46:46.565094
2020-12-01T14:17:09
2020-12-01T14:17:09
306,511,397
0
0
null
null
null
null
UTF-8
Java
false
false
1,203
java
//package org.fasttrackit.moneycontrol.steps; // //import org.fasttrackit.moneycontrol.domain.Budget; //import org.fasttrackit.moneycontrol.service.BudgetService; //import org.fasttrackit.moneycontrol.transfer.budget.SaveBudgetRequest; //import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.stereotype.Component; // //import static org.hamcrest.CoreMatchers.is; //import static org.hamcrest.CoreMatchers.notNullValue; //import static org.hamcrest.MatcherAssert.assertThat; //import static org.hamcrest.Matchers.greaterThan; // // //@Component // //public class BudgetTestSteps { // // // @Autowired // private BudgetService budgetService; // // // public Budget addBudget() { // SaveBudgetRequest request = new SaveBudgetRequest() // request.setMybudget(2000); // request.setValuteName("Euro"); // // // Budget budget = budgetService.addBudget(request); // // assertThat(budget, notNullValue()); // assertThat(budget.getId(), greaterThan(0L)); // assertThat(budget.getValuteName(), is(request.getValuteName())); // // // return budget; // } // //}
[ "brisc.ramona22@yahoo.com" ]
brisc.ramona22@yahoo.com
afb0df5c547639dc349e00055d7a373ae8b2db9b
ff1926a429ae8e26f0dee16fe82d6532cb192b5d
/app/src/main/java/com/example/sec/android_rpg_project/DBHelper.java
5446b6b6e757a6e616d50a16dbc8fe56f8330dc5
[]
no_license
qhtlr4/Android_RPG_project
80ad6689da9330b3864b8a62a6b94f000e5f6fdc
cb587f1fef3909daed7ca0493e27dff42ac76b59
refs/heads/master
2021-08-23T07:36:47.328491
2017-12-04T05:21:08
2017-12-04T05:21:08
109,508,759
0
0
null
null
null
null
UTF-8
Java
false
false
37,625
java
package com.example.sec.android_rpg_project; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import java.util.ArrayList; import java.util.HashMap; import java.util.Random; /** * Created by USER on 2017-11-02. */ public class DBHelper extends SQLiteOpenHelper { Random rand = new Random(); public static int DATABASE_VERSION = 1; //아이템 판매/사용시 idx를 참조하여 조작할수 있도록 idx를 정렬하기위함 //다음 insert실행시 들어갈 위치를 지정 public static int idx_weapon; public static int idx_armor; public static int idx_potion; //상점에 판매하는 장비의 수 public static int weapon_num; public static int armor_num; public DBHelper(Context context){ super(context, "MyDB.db", null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase sqLiteDatabase) { //아이템번호, 이름, 공, 방어, 피회복, 마나회복, 가격, 아이템클래스(0, 1, 2, 3) //item_id = 1부터 시작 sqLiteDatabase.execSQL("CREATE TABLE ITEM (item_id INTEGER PRIMARY KEY AUTOINCREMENT, item_name TEXT, attack INTEGER, defence INTEGER, addHp INTEGER, addMp INTEGER, cost INTEGER, class INTEGER);"); sqLiteDatabase.execSQL("INSERT INTO ITEM VALUES(null, '골드', 0, 0, 0, 0, 0, 0);"); sqLiteDatabase.execSQL("INSERT INTO ITEM VALUES(null, '목검', 5, 0, 0, 0, 500, 1);"); sqLiteDatabase.execSQL("INSERT INTO ITEM VALUES(null, '청동검', 7, 0, 0, 0, 4000, 1);"); sqLiteDatabase.execSQL("INSERT INTO ITEM VALUES(null, '강철검', 9, 0, 0, 0, 50000, 1);"); sqLiteDatabase.execSQL("INSERT INTO ITEM VALUES(null, '다이아몬드검', 14, 0, 0, 0, 500000, 1);"); sqLiteDatabase.execSQL("INSERT INTO ITEM VALUES(null, '낡은 옷', 0, 5, 0, 0, 500, 2);"); sqLiteDatabase.execSQL("INSERT INTO ITEM VALUES(null, '가죽 옷', 0, 7, 0, 0, 4000, 2);"); sqLiteDatabase.execSQL("INSERT INTO ITEM VALUES(null, '청동 갑옷', 0, 9, 0, 0, 50000, 2);"); sqLiteDatabase.execSQL("INSERT INTO ITEM VALUES(null, '강철 갑옷', 0, 14, 0, 0, 500000, 2);"); sqLiteDatabase.execSQL("INSERT INTO ITEM VALUES(null, '무적 갑옷', 0, 200, 0, 0, 5000000, 2);"); sqLiteDatabase.execSQL("INSERT INTO ITEM VALUES(null, 'HP 포션', 0, 0, 30, 0, 500, 3);"); sqLiteDatabase.execSQL("INSERT INTO ITEM VALUES(null, 'MP 포션', 0, 0, 0, 10, 300, 3);"); //강화 확률 가격 정보 입력 테이블 ( level-1 = 0) sqLiteDatabase.execSQL("CREATE TABLE ENHANCEMENT (level INTEGER PRIMARY KEY AUTOINCREMENT, attack INTEGER, defence INTEGER, rate INTEGER, cost INTEGER)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 1, 0, 1000, 1000)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 0, 1, 1000, 1200)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 1, 1, 950, 1700)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 1, 1, 900, 2000)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 2, 0, 850, 2000)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 0, 2, 850, 2300)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 2, 1, 800, 2800)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 1, 2, 750, 3200)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 3, 0, 700, 4500)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 3, 1, 650, 5000)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 3, 2, 600, 5300)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 5, 3, 500, 7000)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 6, 4, 500, 7400)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 7, 5, 500, 7900)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 10, 8, 450, 8250)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 15, 12, 400, 8700)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 30, 30, 300, 10000)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 30, 30, 300, 10000)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 30, 30, 300, 10000)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 30, 30, 300, 10000)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 30, 30, 300, 10000)"); sqLiteDatabase.execSQL("INSERT INTO ENHANCEMENT VALUES(null, 30, 30, 300, 10000)"); sqLiteDatabase.execSQL("CREATE TABLE MOB (mob_id INTEGER PRIMARY KEY AUTOINCREMENT, mob_name TEXT, hp INTEGER, damage INTEGER, exp INTEGER, is_boss INTEGER);"); // sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '피카츄', 25, 11, 3, 0);"); //1 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '크로뱃', 35, 15, 7, 0);"); //2 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '입치트', 45, 18, 11, 0);"); //3 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '독개굴', 50, 21, 17, 0);"); //4 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '라프라스', 55, 26, 25, 0);"); //5 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '핫삼', 75, 31, 37, 0);"); //6 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '워글', 99, 35, 52, 0);"); //7 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '팬텀', 116, 40, 73, 0);"); //8 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '한카리아스', 148, 48, 94, 0);"); //9 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '삼삼드래', 153, 52, 115, 0);"); //10 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '루카리오', 170, 61, 250, 0);"); //11 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '망나뇽', 200, 70, 330, 0);"); //12 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '리자몽', 240, 75, 400, 0);"); //13 sqLiteDatabase.execSQL("INSERT INTO MOB VALUES(null, '레쿠쟈', 300, 100, 700, 1);"); //14 boss1 //index, 아이템번호, 몬스터번호, 최소개수, 최대개수, 드롭률 sqLiteDatabase.execSQL("CREATE TABLE DROP_ITEM (idx INTEGER PRIMARY KEY AUTOINCREMENT, item_id INTEGER, mob_id INTEGER, min INTEGER, max INTEGER, ratio INTEGER);"); //ratio -> 10 = 1% sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 1, 1, 10, 40, 1000);"); //골드 sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 1, 2, 10, 60, 1000);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 1, 3, 10, 110, 1000);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 1, 4, 10, 190, 1000);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 1, 5, 10, 340, 1000);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 1, 6, 100, 300, 1000);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 1, 7, 150, 450, 1000);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 1, 8, 170, 600, 1000);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 1, 9, 300, 800, 1000);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 1, 10, 500, 1080, 1000);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 1, 11, 10000, 50000, 1000);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 2, 1, 0, 1, 100);"); //목검 sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 2, 2, 0, 1, 120);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 2, 3, 0, 1, 130);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 2, 4, 0, 1, 140);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 3, 3, 0, 1, 80);"); //청동검 sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 3, 4, 0, 1, 90);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 3, 5, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 3, 6, 0, 1, 110);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 3, 7, 0, 1, 120);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 3, 8, 0, 1, 130);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 3, 9, 0, 1, 140);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 4, 6, 0, 1, 50);"); //강철검 sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 4, 7, 0, 1, 60);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 4, 8, 0, 1, 70);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 4, 9, 0, 1, 80);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 4, 10, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 6, 1, 0, 1, 100);"); //낡은 옷 sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 6, 2, 0, 1, 110);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 6, 3, 0, 1, 120);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 6, 4, 0, 1, 130);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 6, 5, 0, 1, 140);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 7, 4, 0, 1, 130);"); //가죽 옷 sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 7, 5, 0, 1, 150);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 7, 6, 0, 1, 170);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 7, 7, 0, 1, 190);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 8, 7, 0, 1, 130);"); //청동갑옷 sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 8, 8, 0, 1, 150);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 8, 9, 0, 1, 170);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 8, 10, 0, 1, 190);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 11, 1, 0, 1, 100);"); //포션 sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 11, 2, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 11, 3, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 11, 4, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 11, 5, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 11, 6, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 11, 7, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 11, 8, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 11, 9, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 11, 10, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 11, 11, 0, 1, 1000);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 12, 1, 0, 1, 100);"); //포션 sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 12, 2, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 12, 3, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 12, 4, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 12, 5, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 12, 6, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 12, 7, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 12, 8, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 12, 9, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 12, 10, 0, 1, 100);"); sqLiteDatabase.execSQL("INSERT INTO DROP_ITEM VALUES(null, 12, 11, 0, 1, 1000);"); // 샵위치아이템번호, 아이템번호, 이름, 공, 방어, 피회복, 마나회복, 가격, 종류 sqLiteDatabase.execSQL("CREATE TABLE SHOP (idx INTEGER PRIMARY KEY AUTOINCREMENT, item_id INTEGER);"); sqLiteDatabase.execSQL("INSERT INTO SHOP VALUES(null, 2);"); //목검 sqLiteDatabase.execSQL("INSERT INTO SHOP VALUES(null, 3);"); //청동검 // test sqLiteDatabase.execSQL("INSERT INTO SHOP VALUES(null, 4);"); //청동검 sqLiteDatabase.execSQL("INSERT INTO SHOP VALUES(null, 5);"); //청동검 sqLiteDatabase.execSQL("INSERT INTO SHOP VALUES(null, 6);"); //청동검 sqLiteDatabase.execSQL("INSERT INTO SHOP VALUES(null, 7);"); //청동검 sqLiteDatabase.execSQL("INSERT INTO SHOP VALUES(null, 8);"); //청동검 sqLiteDatabase.execSQL("INSERT INTO SHOP VALUES(null, 9);"); //청동검 sqLiteDatabase.execSQL("INSERT INTO SHOP VALUES(null, 10);"); //청동검 sqLiteDatabase.execSQL("INSERT INTO SHOP VALUES(null, 11);"); //hp포션 sqLiteDatabase.execSQL("INSERT INTO SHOP VALUES(null, 12);"); //mp포션 // 아이템idx, 인벤토리idx, 이름, 공, 방어, 피회복, 마나회복, 가격, 착용여부(0 or 1) sqLiteDatabase.execSQL("CREATE TABLE INVENTORY_1 (slot INTEGER PRIMARY KEY AUTOINCREMENT, idx INTEGER, enhance INTEGER, item_name TEXT, attack INTEGER, defence INTEGER, cost INTEGER, is_equip INTEGER);"); //아이템이위치한칸, 아이템번호, 이름, 레벨제헌, 공, 방어, 피회복, 마나회복, 가격, 착용여부(0 or 1) sqLiteDatabase.execSQL("CREATE TABLE INVENTORY_2 (slot INTEGER PRIMARY KEY AUTOINCREMENT, idx INTEGER, enhance INTEGER, item_name TEXT, attack INTEGER, defence INTEGER, cost INTEGER, is_equip INTEGER);"); //아이템이위치한칸, 아이템번호, 이름, 레벨제헌, 공, 방어, 피회복, 마나회복, 가격, 착용여부(0 or 1) sqLiteDatabase.execSQL("CREATE TABLE INVENTORY_3 (slot INTEGER PRIMARY KEY AUTOINCREMENT, idx INTEGER, item_name TEXT, addHp INTEGER, addMp INTEGER, cost INTEGER);"); //아이템이위치한칸, 아이템번호, 이름, 레벨제헌, 공, 방어, 피회복, 마나회복, 가격 idx_weapon = 2; idx_armor = 2; idx_potion = 3; sqLiteDatabase.execSQL("INSERT INTO INVENTORY_1 VALUES(null, 1, 0, '기본무기', 2, 0, 1, 1);"); sqLiteDatabase.execSQL("INSERT INTO INVENTORY_2 VALUES(null, 1, 0, '기본방어구', 0, 2, 1, 1);"); sqLiteDatabase.execSQL("INSERT INTO INVENTORY_3 VALUES(null, 1, '초보용 HP 포션', 20, 0, 500);"); sqLiteDatabase.execSQL("INSERT INTO INVENTORY_3 VALUES(null, 2, '초보용 MP 포션', 0, 5, 500);"); } @Override public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) { } //저장데이터 삭제 후 초기화 public void init_db(){ SQLiteDatabase db = getWritableDatabase(); db.execSQL("DROP TABLE IF EXISTS ITEM"); db.execSQL("DROP TABLE IF EXISTS MOB"); db.execSQL("DROP TABLE IF EXISTS DROP_ITEM"); db.execSQL("DROP TABLE IF EXISTS SHOP"); db.execSQL("DROP TABLE IF EXISTS INVENTORY_1"); db.execSQL("DROP TABLE IF EXISTS INVENTORY_2"); db.execSQL("DROP TABLE IF EXISTS INVENTORY_3"); db.execSQL("DROP TABLE IF EXISTS ENHANCEMENT"); onCreate(db); } //shop에서 판매하는 항목을 return public ArrayList<String> getShopInfo(int clas){ ArrayList<String> result_array = new ArrayList<String>(); SQLiteDatabase db = getReadableDatabase(); String result = ""; weapon_num = 0; armor_num = 0; //아이템번호, 이름, 공, 방어, 피회복, 마나회복, 가격, 아이템클래스(0, 1, 2, 3) Cursor cursor = db.rawQuery("SELECT * FROM ITEM, SHOP WHERE (ITEM.item_id = SHOP.item_id);", null); while (cursor.moveToNext()) { if(cursor.getInt(7) == 1) { weapon_num++; } else if (cursor.getInt(7) == 2) { armor_num++; } if(cursor.getInt(7) == clas && clas != 3){ result += "이름 : " + cursor.getString(1) + "\n공격력 : " + cursor.getInt(2) + "\t\t\t방어력 : " + cursor.getInt(3) + "\t\t\t가격 : " + cursor.getInt(6); result_array.add(result); result = ""; } else if (cursor.getInt(7) == clas && clas == 3){ result += "이름 : " + cursor.getString(1) + "\t\t\t\tHP : " + cursor.getInt(4) + "\t\t\t\tMP : " + cursor.getInt(5) + "\n가격 : " + cursor.getInt(6); result_array.add(result); result = ""; } } return result_array; } public int getcost(int idx, int clas){ SQLiteDatabase db = getReadableDatabase(); Cursor cursor; if(clas == 1){ cursor = db.rawQuery("SELECT cost FROM ITEM WHERE item_id=(SELECT item_id FROM SHOP WHERE idx=" +idx + ");", null); } else if (clas == 2){ cursor = db.rawQuery("SELECT cost FROM ITEM WHERE item_id=(SELECT item_id FROM SHOP WHERE idx=" +(idx + weapon_num) + ");", null); } else{ cursor = db.rawQuery("SELECT cost FROM ITEM WHERE item_id=(SELECT item_id FROM SHOP WHERE idx=" +(idx + weapon_num + armor_num) + ");", null); } if(cursor.moveToFirst() != false) { cursor.moveToFirst(); int cost = cursor.getInt(0); cursor.close(); return cost; } else return 99999; } //아이템 종류에 따라 인벤토리 1, 2, 3 항목을 return public ArrayList<String> getInventoryResult(int clas) { ArrayList<String> result_array = new ArrayList<String>(); // 인벤토리 DB 열기 SQLiteDatabase db = getReadableDatabase(); String result = ""; String a = ""; if(clas == 1){ a = "_1"; } else if(clas == 2){ a = "_2"; } else{ a = "_3"; } // DB에 있는 데이터를 쉽게 처리하기 위해 Cursor를 사용하여 테이블에 있는 모든 데이터 출력 Cursor cursor = db.rawQuery("SELECT * FROM INVENTORY" + a + ";", null); int enhance; while (cursor.moveToNext()) { enhance = cursor.getInt(2); if(clas == 1 || clas == 2) { if(enhance != 0) result += "이름 : " + cursor.getString(3) + " (+ " + enhance + ")\n공격력 : " + cursor.getInt(4) + "\t\t방어력 : " + cursor.getInt(5) + "\t\t가격 : " + (int) (cursor.getInt(6) / 2); else result += "이름 : " + cursor.getString(3) + "\n공격력 : " + cursor.getInt(4) + "\t\t방어력 : " + cursor.getInt(5) + "\t\t가격 : " + (int) (cursor.getInt(6) / 2); } else result += "이름 : " + cursor.getString(2) + "\t\tHP + " + cursor.getInt(3) + "\t\tMP + " + cursor.getInt(4) + "\n가격 : " + (int)(cursor.getInt(5)/2); result_array.add(result); result = ""; } return result_array; } //user가 호출한 것에 맞는 몬스터 정보를 return public Enemy get_enemy(int min_level, int max_level, int is_boss){ SQLiteDatabase db = getReadableDatabase(); int level; Cursor cursor; if(is_boss == 0) { level = start_rand(max_level, min_level); cursor = db.rawQuery("SELECT * FROM MOB WHERE mob_id=" + level, null); } else{ cursor = db.rawQuery("SELECT * FROM MOB WHERE is_boss=" + is_boss, null); } Enemy enemy = new Enemy(); while (cursor.moveToNext()) { enemy.mob_num = cursor.getInt(0); enemy.name = cursor.getString(1); enemy.hp = cursor.getInt(2); enemy.damage = cursor.getInt(3); enemy.exp = cursor.getInt(4); enemy.is_boss = cursor.getInt(5); } return enemy; } //전투가 끝난 후 gold, 아이템 획득정보를 return, 아이템은 insert_item()을 통하여 db에 저장 public HashMap<String, String> get_item(Enemy enemy){ SQLiteDatabase db = getReadableDatabase(); HashMap<String, String> hashMap = new HashMap<String, String>(); String result = ""; int drop; int count = 0; int gold = 0; //index, 아이템번호, 몬스터번호, 최소개수, 최대개수, 드롭률 Cursor cursor = db.rawQuery("SELECT * FROM DROP_ITEM WHERE mob_id= " + enemy.mob_num, null); while (cursor.moveToNext()) { drop = start_rand(1000); int item_id = cursor.getInt(1); int min = cursor.getInt(3); int max = cursor.getInt(4); int ratio = cursor.getInt(5); if(drop <= ratio){ //드롭되었다. if(item_id == 1){ //골드인경우 drop = start_rand(max, min); gold = drop; result = drop + "골드와 "; } else { //아이템인 경우 hashMap.put("gold", "0"); insert_item(item_id); count++; } } } hashMap.put("gold", String.valueOf(gold)); result = result + "아이템 "+ count +"개를 얻었다."; hashMap.put("result", result); return hashMap; } //shop에서 구매한 아이템을 db에 저장, public void insert_item(int param_item_id, int clas){ SQLiteDatabase db = getReadableDatabase(); SQLiteDatabase db2 = getWritableDatabase(); Cursor cursor = null; if(clas == 1) cursor = db.rawQuery("SELECT * FROM ITEM WHERE item_id=(SELECT item_id FROM SHOP WHERE idx=" + param_item_id + ");", null); else if(clas == 2) { cursor = db.rawQuery("SELECT * FROM ITEM WHERE item_id=(SELECT item_id FROM SHOP WHERE idx=" + (param_item_id + weapon_num) + ");", null); } else if(clas == 3) { cursor = db.rawQuery("SELECT * FROM ITEM WHERE item_id=(SELECT item_id FROM SHOP WHERE idx=" + (param_item_id + weapon_num + armor_num) + ");", null); } while (cursor.moveToNext()) { String item_name = cursor.getString(1); int attack = cursor.getInt(2); int defence = cursor.getInt(3); int hp = cursor.getInt(4); int mp = cursor.getInt(5); int cost = cursor.getInt(6); if(clas == 1) { db2.execSQL("INSERT INTO INVENTORY_1 VALUES(null, " + idx_weapon + ", " + 0 + ", '" + item_name + "', " + attack + ", " + defence + ", " + cost + ", 0);"); idx_weapon++; } else if(clas == 2) { db2.execSQL("INSERT INTO INVENTORY_2 VALUES(null, " + idx_armor + ", " + 0 + ", '" + item_name + "', " + attack + ", " + defence + ", " + cost + ", 0);"); idx_armor++; } else if(clas == 3) { db2.execSQL("INSERT INTO INVENTORY_3 VALUES(null, " + idx_potion + ", '" + item_name + "', " + hp + ", " + mp + ", " + cost + ");"); idx_potion++; } } } //전리품을 db에 저장 하기위한 함수. public void insert_item(int param_item_id) { SQLiteDatabase db = getReadableDatabase(); SQLiteDatabase db2 = getWritableDatabase(); Cursor cursor = null; cursor = db.rawQuery("SELECT * FROM ITEM WHERE item_id=" + param_item_id, null); while (cursor.moveToNext()) { String item_name = cursor.getString(1); int attack = cursor.getInt(2); int defence = cursor.getInt(3); int hp = cursor.getInt(4); int mp = cursor.getInt(5); int cost = cursor.getInt(6); int clas = cursor.getInt(7); if(clas == 1) { db2.execSQL("INSERT INTO INVENTORY_1 VALUES(null, " + idx_weapon + ", "+ 0 + ", '" + item_name + "', " + attack + ", " + defence + ", " + cost + ", 0);"); idx_weapon++; } else if(clas == 2) { db2.execSQL("INSERT INTO INVENTORY_2 VALUES(null, " + idx_armor + ", " + 0 + ", '" + item_name + "', " + attack + ", " + defence + ", " + cost + ", 0);"); idx_armor++; } else if(clas == 3) { db2.execSQL("INSERT INTO INVENTORY_3 VALUES(null, " + idx_potion + ", '" + item_name + "', " + hp + ", " + mp + ", " + cost + ");"); idx_potion++; } } } //clas- 1:무기 2:방어구장착 아이템 확인 함수 public int equipment_item(int clas){ SQLiteDatabase db = getReadableDatabase(); String str = ""; if(clas == 1){ str = "_1"; } else{ str = "_2"; } Cursor cursor = db.rawQuery("SELECT idx FROM INVENTORY" + str + " WHERE is_equip=1;", null); //장착된것이 없음 if(cursor.moveToFirst() == false) return -1; else { cursor.moveToFirst(); return cursor.getInt(0); } } //장착 아이템으로 상승된 능력치 public HashMap<String, Integer> equipment_ability(){ HashMap<String, Integer> hashMap = new HashMap<>(); int attack = 0; int defence = 0; int temp; hashMap.put("weapon_attack", 0); hashMap.put("weapon_defence", 0); hashMap.put("armor_attack", 0); hashMap.put("armor_defence", 0); SQLiteDatabase db = getReadableDatabase(); Cursor cursor = db.rawQuery("SELECT attack, defence FROM INVENTORY_1 WHERE is_equip=1;", null); while (cursor.moveToNext()){ attack = cursor.getInt(0); defence = cursor.getInt(1); hashMap.put("weapon_attack", attack); hashMap.put("weapon_defence", defence); } cursor = db.rawQuery("SELECT attack, defence FROM INVENTORY_2 WHERE is_equip=1;", null); while (cursor.moveToNext()){ temp = cursor.getInt(0); attack += temp; hashMap.put("armor_attack", temp); temp = cursor.getInt(1); defence += temp; hashMap.put("armor_defence", temp); } hashMap.put("attack", attack); hashMap.put("defence", defence); return hashMap; } //장착 아이템 변경함수 (변경 능력치값 리턴) public HashMap<String, Integer> change_equipment_item(int clas, int a_itemslot, int b_itemslot) { SQLiteDatabase db = getWritableDatabase(); //장착변수(is_equip) 변경 SQLiteDatabase db2 = getReadableDatabase(); //전 아이템의 능력치 SQLiteDatabase db3 = getReadableDatabase(); //사용할 아이템의 능력치 //리턴할 hashmap (변경 공격력, 방어력 정보가 있음) int attack = 0; int defence = 0; HashMap<String, Integer> hashMap = new HashMap<String, Integer>(); String str = ""; String str1; //db테이블 검색 Cursor cursor2 = null; Cursor cursor3 = null; if (clas == 1) { str1 = "_1"; } else { str1 = "_2"; } //게임시작후 초기화때 & 장비를 처음 착용할때 조건 (장착 된 것이 없는 상태 -1) if(a_itemslot == -1) { if(b_itemslot != -1) { str = "SELECT attack, defence FROM INVENTORY" + str1 + " WHERE idx=" + b_itemslot + ";"; cursor3 = db3.rawQuery(str, null); cursor3.moveToFirst(); attack = cursor3.getInt(0); defence = cursor3.getInt(1); hashMap.put("attack", attack); hashMap.put("defence", defence); db.execSQL("UPDATE INVENTORY" + str1 + " SET is_equip=1 WHERE idx=" + b_itemslot + ";"); return hashMap; } else if (b_itemslot == -1){ hashMap.put("attack", attack); hashMap.put("defence", defence); return hashMap; } } //장비 착용중이며 교체시 else if(a_itemslot != -1 && b_itemslot != -1){ str = "SELECT attack, defence FROM INVENTORY" + str1 + " WHERE idx=" + a_itemslot + ";"; cursor2 = db2.rawQuery(str, null); str = "SELECT attack, defence FROM INVENTORY" + str1 + " WHERE idx=" + b_itemslot + ";"; cursor3 = db3.rawQuery(str, null); cursor2.moveToFirst(); cursor3.moveToFirst(); attack = cursor3.getInt(0) - cursor2.getInt(0); defence = cursor3.getInt(1) - cursor2.getInt(1); hashMap.put("attack", attack); hashMap.put("defence", defence); str = "UPDATE INVENTORY" + str1 + " SET is_equip=0 WHERE idx=" + a_itemslot + ";"; db.execSQL(str); str = "UPDATE INVENTORY" + str1 + " SET is_equip=1 WHERE idx=" + b_itemslot + ";"; db.execSQL(str); } return hashMap; } //아이템 판매 처리함수 (판매아이템가격, 장착된 아이템일시 능력치 감소량 리턴) public HashMap<String, Integer> sell_item(int idx, int clas){ HashMap<String, Integer> hashMap = new HashMap<String, Integer>(); String a; SQLiteDatabase db = getReadableDatabase(); SQLiteDatabase db2 = getWritableDatabase(); if(clas == 1){ a = "_1"; } else if(clas == 2){ a = "_2"; } else{ a = "_3"; } Cursor cursor = db.rawQuery("SELECT attack, defence, cost, is_equip FROM INVENTORY" + a + " WHERE idx=" + idx + ";", null); cursor.moveToFirst(); //장착됨 if(cursor.getInt(3) == 1) { hashMap.put("attack", cursor.getInt(0)); hashMap.put("defence", cursor.getInt(1)); hashMap.put("cost", cursor.getInt(2) / 2); } //장착되지는 않음 else{ hashMap.put("attack", 0); hashMap.put("defence", 0); hashMap.put("cost", cursor.getInt(2) / 2); } hashMap.put("is_equip", cursor.getInt(3)); db2.execSQL("DELETE FROM INVENTORY" + a + " WHERE idx=" + idx + ";"); if(a.equals("_1")){ idx_weapon--; } else if(a.equals("_2")){ idx_armor--; } Cursor cursor1 = db.rawQuery("SELECT idx FROM INVENTORY" + a + " WHERE idx>" + idx + ";", null); while (cursor1.moveToNext()){ db2.execSQL("UPDATE INVENTORY" + a + " SET idx="+ (cursor1.getInt(0)-1) +" WHERE idx=" + cursor1.getInt(0) + ";"); } return hashMap; } //포션 사용시 사용할 함수 public HashMap<String, Integer> use_potion(int idx){ HashMap<String, Integer> heal_value = new HashMap<>(); SQLiteDatabase db = getReadableDatabase(); SQLiteDatabase db2 = getWritableDatabase(); Cursor cursor = db.rawQuery("SELECT addHp, addMp FROM INVENTORY_3 WHERE idx=" + idx + ";", null); cursor.moveToFirst(); heal_value.put("hp", cursor.getInt(0)); heal_value.put("mp", cursor.getInt(1)); db2.execSQL("DELETE FROM INVENTORY_3 WHERE idx=" + idx + ";"); idx_potion--; Cursor cursor1 = db.rawQuery("SELECT idx FROM INVENTORY_3 WHERE idx>" + idx + ";", null); while (cursor1.moveToNext()){ db2.execSQL("UPDATE INVENTORY_3 SET idx="+ (cursor1.getInt(0)-1) +" WHERE idx=" + cursor1.getInt(0) + ";"); } return heal_value; } //강화작업 public HashMap<String, String> enhancement(int idx, int clas){ HashMap<String, String> result = new HashMap<>(); String a; int now_level; double value = start_rand(1000); int attack; int defence; int equip_state; int cost; int rate; // 10 -> 1% SQLiteDatabase db = getReadableDatabase(); SQLiteDatabase db2 = getWritableDatabase(); if(clas == 1){ a = "_1"; } else{ a = "_2"; } Cursor cursor = db.rawQuery("SELECT enhance, attack, defence, is_equip, cost FROM INVENTORY" + a + " WHERE idx=" + idx + ";", null); cursor.moveToFirst(); now_level = cursor.getInt(0); attack = cursor.getInt(1); defence = cursor.getInt(2); cost = cursor.getInt(4); if(cursor.getInt(3) == 1){ equip_state = 1; } else equip_state = 0; rate = enhance_rate(now_level).get("rate"); result.put("is_equip", String.valueOf(equip_state)); if(value <= rate){ attack += enhance_rate(now_level).get("attack"); //성공시 공격력 defence += enhance_rate(now_level).get("defence"); //성공시 방어력 cost += (int)(enhance_rate(now_level).get("cost")/2); //성공시 아이템 판매가격 상승 (등급에 따른 가치 상승) db2.execSQL("UPDATE INVENTORY" + a + " SET enhance=" + (now_level + 1) + ", attack="+ attack +", defence="+ defence + ", cost="+ cost +" WHERE idx=" + idx + ";"); result.put("result", "성공"); result.put("attack", String.valueOf(enhance_rate(now_level).get("attack"))); //성공시 공격력 증가량 result.put("defence", String.valueOf(enhance_rate(now_level).get("defence"))); //성공시 방어력 증가량 } else { if(clas == 1) { db2.execSQL("DELETE FROM INVENTORY_1 WHERE idx=" + idx + ";"); idx_weapon--; Cursor cursor1 = db.rawQuery("SELECT idx FROM INVENTORY_1 WHERE idx>" + idx + ";", null); while (cursor1.moveToNext()){ db2.execSQL("UPDATE INVENTORY_1 SET idx="+ (cursor1.getInt(0)-1) +" WHERE idx=" + cursor1.getInt(0) + ";"); } } else{ db2.execSQL("DELETE FROM INVENTORY_2 WHERE idx=" + idx + ";"); idx_armor--; Cursor cursor1 = db.rawQuery("SELECT idx FROM INVENTORY_2 WHERE idx>" + idx + ";", null); while (cursor1.moveToNext()){ db2.execSQL("UPDATE INVENTORY_2 SET idx="+ (cursor1.getInt(0)-1) +" WHERE idx=" + cursor1.getInt(0) + ";"); } } result.put("result", "실패"); result.put("attack", String.valueOf(attack)); //실패시 공격력 감소량 result.put("defence", String.valueOf(defence)); //실패시 방어력 감소량 } return result; } //강화 비용, 확률을 사용자가 볼 수 있게 리턴 public HashMap<String, Integer> enhance_info(int idx, int clas){ HashMap<String, Integer> hashMap = new HashMap<String, Integer>(); String a; SQLiteDatabase db = getReadableDatabase(); if(clas == 1){ a = "_1"; } else{ a = "_2"; } Cursor cursor = db.rawQuery("SELECT enhance FROM INVENTORY" + a + " WHERE idx=" + idx + ";", null); cursor.moveToFirst(); int number = cursor.getInt(0); hashMap = enhance_rate(number); return hashMap; } //강화단계에 대한 비용, 확률, 능력치 증가량 public HashMap<String, Integer> enhance_rate(int item_level) { HashMap<String, Integer> hashMap = new HashMap<String, Integer>(); SQLiteDatabase db = getReadableDatabase(); Cursor cursor = db.rawQuery("SELECT attack, defence, cost, rate FROM ENHANCEMENT WHERE level=" + (item_level + 1) + ";", null); cursor.moveToFirst(); hashMap.put("attack", cursor.getInt(0)); hashMap.put("defence", cursor.getInt(1)); hashMap.put("cost", cursor.getInt(2)); hashMap.put("rate", cursor.getInt(3)); return hashMap; } //random public int start_rand(int max) { int rand_num; rand_num = rand.nextInt(max) + 1; return rand_num; } public int start_rand(int max, int offset) { //max, min int rand_num; rand_num = rand.nextInt(max-offset) + offset; return rand_num; } }
[ "qhtlr4@naver.com" ]
qhtlr4@naver.com
88c57100362b3cd88d5e2f659117d2e6f067cb5a
d7d598324a9f17012abc094fac03d8460995fa09
/src/main/java/exercitii/homework1/Swimmer.java
8497942666512f6d1751f96aac0816c89ccab8a6
[]
no_license
Bogdan051979/demo_repo
de8d3391384f9fa5be76ff3c606656b3c15c0dd4
1cb96d886e604280e1fa5b665bdc96e8eae5888f
refs/heads/master
2023-05-31T09:51:53.607421
2021-06-05T12:38:50
2021-06-05T12:38:50
374,086,323
0
0
null
null
null
null
UTF-8
Java
false
false
401
java
package exercitii.homework1; public class Swimmer extends Walker { /** declaring and instantiate a variable talker of type Talker */ private Talker talker = new Talker(); // public Swimmer(Talker talker) { // this.talker = talker; // // } /** a getter that return Talker */ public Talker getTalker() { return this.talker; } public String performSwimm() { return "I can swimm"; } }
[ "rudolphusamv79@gmail.com" ]
rudolphusamv79@gmail.com
bfd22d1286933c7099b5bcb99ee6050013ae8057
73d8cdbaf379b07f78905cdd3b5882358fcba1e6
/src/main/java/pl/bluemedia/test/domain/application/repository/ApplicationRepositoryCustom.java
e0c07f3b822e32f2941c28595e8e8462b19e8185
[]
no_license
Wlodas/BlueServicesTest
5fe4b17dd1c808211a7ad865d97af1ed05962c97
bb48079dc0dd0afc1c14a76ad3b7335b733035ec
refs/heads/master
2016-08-12T09:43:16.677611
2016-01-26T11:16:58
2016-01-26T11:16:58
43,254,790
0
0
null
null
null
null
UTF-8
Java
false
false
336
java
package pl.bluemedia.test.domain.application.repository; import org.springframework.data.repository.NoRepositoryBean; import pl.bluemedia.test.domain.application.repository.builder.ApplicationSearchBuilder; @NoRepositoryBean public interface ApplicationRepositoryCustom { ApplicationSearchBuilder createSearchBuilder(); }
[ "madmax1028@gmail.com" ]
madmax1028@gmail.com
d27ad5f9fd043399dd46e57893f7dc983e57253e
19238af79743400d9b7cb4c29234294750fb0c32
/ofg6.2_oracle/src/main/java/com/ambition/ecm/dcrn/dao/DcrnReportDao.java
eb0e9bae7eb3720baeeb229a32f182a38554921b
[]
no_license
laonanhai481580/ofg6.2_oracle
7d8ed374c51e298c92713dbea266cfa8ef55ff85
286c242bbf44b6addc4622374e95af27e6979242
refs/heads/master
2020-04-19T04:03:13.924288
2019-01-28T11:27:42
2019-01-28T11:27:42
167,951,726
0
0
null
null
null
null
UTF-8
Java
false
false
457
java
package com.ambition.ecm.dcrn.dao; import org.springframework.stereotype.Repository; import com.ambition.ecm.entity.DcrnReport; import com.norteksoft.product.orm.Page; import com.norteksoft.product.orm.hibernate.HibernateDao; @Repository public class DcrnReportDao extends HibernateDao<DcrnReport, Long>{ public Page<DcrnReport> searchPage(Page<DcrnReport> page){ String hql="from DcrnReport report"; return this.searchPageByHql(page, hql); } }
[ "1198824455@qq.com" ]
1198824455@qq.com
44391eb98a3a6351c21e0ced1cf04be3516454b8
430ebe0404d102d72f7d999bcc6eec15b4041e80
/src/main/java/com/shopify/model/structs/ShopifyLocation.java
0b196d82c2e46c78cc4d2f3b50e1368e44f32ebf
[ "Apache-2.0" ]
permissive
mavenreposs/shopify-sdk
125ace37545c28db712610c367b88212a16a8e15
14f3ae0c6a9224f346fffb5eb6a3f3f60ee8f9c3
refs/heads/master
2023-09-03T10:11:27.893784
2021-11-18T13:17:24
2021-11-18T13:17:24
380,980,529
0
0
null
null
null
null
UTF-8
Java
false
false
4,806
java
package com.shopify.model.structs; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; /** * https://shopify.dev/api/admin/rest/reference/inventory/location?api%5Bversion%5D=2021-04 */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class ShopifyLocation { private String id; private String name; private String address1; private String address2; private String city; private String zip; private String phone; private String province; @XmlElement(name = "province_code") private String provinceCode; /** * The localized name of the location's region. Typically a province, state, or prefecture. */ @XmlElement(name = "localized_province_name") private String localizedProvinceName; private String country; @XmlElement(name = "country_code") private String countryCode; /** * The localized name of the location's country. */ @XmlElement(name = "localized_country_name") private String localizedCountryName; /** * Whether the location is active. If true, then the location can be used to sell products, stock inventory, and fulfill orders. * Merchants can deactivate locations from the Shopify admin. * Deactivated locations don't contribute to the shop's location limit. */ private boolean active; @XmlElement(name = "created_at") private String createdAt; @XmlElement(name = "updated_at") private String updatedAt; private boolean legacy; public String getId() { return id; } public String getName() { return name; } public String getAddress1() { return address1; } public String getAddress2() { return address2; } public String getCity() { return city; } public String getZip() { return zip; } public String getCountry() { return country; } public String getPhone() { return phone; } public String getProvince() { return province; } public String getCountryCode() { return countryCode; } public String getLocalizedProvinceName() { return localizedProvinceName; } public String getLocalizedCountryName() { return localizedCountryName; } public boolean isActive() { return active; } public String getCreatedAt() { return createdAt; } public String getUpdatedAt() { return updatedAt; } public boolean isLegacy() { return legacy; } public String getProvinceCode() { return provinceCode; } public void setId(final String id) { this.id = id; } public void setName(final String name) { this.name = name; } public void setAddress1(final String address1) { this.address1 = address1; } public void setAddress2(final String address2) { this.address2 = address2; } public void setCity(final String city) { this.city = city; } public void setZip(final String zip) { this.zip = zip; } public void setCountry(final String country) { this.country = country; } public void setPhone(final String phone) { this.phone = phone; } public void setProvince(final String province) { this.province = province; } public void setCountryCode(final String countryCode) { this.countryCode = countryCode; } public void setProvinceCode(final String provinceCode) { this.provinceCode = provinceCode; } public void setLocalizedProvinceName(String localizedProvinceName) { this.localizedProvinceName = localizedProvinceName; } public void setLocalizedCountryName(String localizedCountryName) { this.localizedCountryName = localizedCountryName; } public void setActive(boolean active) { this.active = active; } public void setCreatedAt(String createdAt) { this.createdAt = createdAt; } public void setUpdatedAt(String updatedAt) { this.updatedAt = updatedAt; } public void setLegacy(boolean legacy) { this.legacy = legacy; } @Override public String toString() { return "ShopifyLocation{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", address1='" + address1 + '\'' + ", address2='" + address2 + '\'' + ", city='" + city + '\'' + ", zip='" + zip + '\'' + ", phone='" + phone + '\'' + ", province='" + province + '\'' + ", provinceCode='" + provinceCode + '\'' + ", localizedProvinceName='" + localizedProvinceName + '\'' + ", country='" + country + '\'' + ", countryCode='" + countryCode + '\'' + ", localizedCountryName='" + localizedCountryName + '\'' + ", active=" + active + ", createdAt='" + createdAt + '\'' + ", updatedAt='" + updatedAt + '\'' + ", legacy=" + legacy + '}'; } }
[ "zhengdong.wang@bloomchic.tech" ]
zhengdong.wang@bloomchic.tech
f13994f7128da5879fbeffb54836d1d4bda74e96
50aaff0d7a2bf1eed82ba8a6de09db1afad6c446
/src/main/java/com/wedevs/supermercado/web/app/models/Factura.java
db593b2c040089f95b227ce0660182d2f3184c0a
[]
no_license
furuya666/spring-boot-supermercado
9f636952fc7c8966482fea02954bff53828a3b19
918404b3523d9e13ece9f82ecc8f2e91f9e1ed1b
refs/heads/main
2023-02-23T13:32:08.884701
2021-01-28T16:03:33
2021-01-28T16:03:33
333,811,119
0
0
null
null
null
null
UTF-8
Java
false
false
1,101
java
package com.wedevs.supermercado.web.app.models; import java.io.Serializable; import java.util.Date; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.PrePersist; import javax.persistence.Temporal; import javax.persistence.TemporalType; @Entity public class Factura implements Serializable { /** * */ private static final long serialVersionUID = 1L; @Id private String id; @Temporal(value = TemporalType.DATE) private Date fecha; @Temporal(value = TemporalType.TIME) private Date hora; @Temporal(value = TemporalType.TIMESTAMP) private Date createAt; @PrePersist public void Preppersist() { createAt= new Date(); } public String getId() { return id; } public void setId(String id) { this.id = id; } public Date getFecha() { return fecha; } public void setFecha(Date fecha) { this.fecha = fecha; } public Date getHora() { return hora; } public void setHora(Date hora) { this.hora = hora; } public Date getCreateAt() { return createAt; } public void setCreateAt(Date createAt) { this.createAt = createAt; } }
[ "furuyagary@gmail.com" ]
furuyagary@gmail.com
96de459bcc96c4a1e00a3b9741975f2fb4c57542
916a837f5bfb7d4ad23a6a24eee2f7911e8416f6
/src/test/java/com/fasterxml/jackson/failing/TestCollectionSerialization.java
18fd5eec81ee4c6a73ff6ec7b859558164c665eb
[]
no_license
SynteZZZ/jackson-databind
5fa184c32dad225ff6e364b129ff1c74720911b7
f0650ba80825c50c3c1b27e64a94b3d21cea452c
refs/heads/master
2020-12-24T21:55:03.331749
2012-07-24T03:39:39
2012-07-24T03:39:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,970
java
package com.fasterxml.jackson.failing; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.BaseMapTest; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; public class TestCollectionSerialization extends BaseMapTest { // [JACKSON-822] static interface Issue822Interface { public int getA(); } // If this annotation is added, things will work: //@com.fasterxml.jackson.databind.annotation.JsonSerialize(as=Issue822Interface.class) // but it should not be necessary when root type is passed static class Issue822Impl implements Issue822Interface { public int getA() { return 3; } public int getB() { return 9; } } // [JACKSON-822]: ensure that type can be coerced public void testTypedArrays() throws Exception { ObjectMapper mapper = new ObjectMapper(); mapper.enable(MapperFeature.USE_STATIC_TYPING); assertEquals("[{\"a\":3}]", mapper.writerWithType(Issue822Interface[].class).writeValueAsString( new Issue822Interface[] { new Issue822Impl() })); } // [JACKSON-822]: ensure that type can be coerced public void testTypedLists() throws Exception { ObjectMapper mapper = new ObjectMapper(); mapper.enable(MapperFeature.USE_STATIC_TYPING); String singleJson = mapper.writerWithType(Issue822Interface.class).writeValueAsString(new Issue822Impl()); // start with specific value case: assertEquals("{\"a\":3}", singleJson); // then lists List<Issue822Interface> list = new ArrayList<Issue822Interface>(); list.add(new Issue822Impl()); String listJson = mapper.writerWithType(new TypeReference<List<Issue822Interface>>(){}) .writeValueAsString(list); assertEquals("[{\"a\":3}]", listJson); } }
[ "tsaloranta@gmail.com" ]
tsaloranta@gmail.com
c0a68705a5fe024836ec1324f38a34d45cec4461
4f016d0bdcbdff1bee63c8a06f1398fdb4a26a7e
/src/ru/veqveq/lesson3/pingpong/PingPong.java
dbf586e8ae15c96c7fd0396b3d2ddca6c7b22143
[]
no_license
veqveq/GB.PreparingForInterview
dd27f72a7d706abba5966db291c6177fa9c8d508
fbc5441a66e6480f4dafb5213be74db64070b91e
refs/heads/main
2023-06-03T11:36:41.382191
2021-06-21T20:38:04
2021-06-21T20:38:04
370,435,902
0
0
null
2021-06-21T20:38:11
2021-05-24T17:37:38
Java
UTF-8
Java
false
false
194
java
package ru.veqveq.lesson3.pingpong; public class PingPong { public static void main(String[] args) throws InterruptedException { Bot bot = new Bot(); bot.start(); } }
[ "vasyakov94@gmail.com" ]
vasyakov94@gmail.com
52ba93a456b0e081df563abc9cfc58d69ec9b95d
9da910f79b3f1141058a14960266ebfb0e3d3128
/OneTech_common/src/main/java/com/OneTech/common/util/pingyinUtils/CharacterUtil.java
966a2914c7e33d9b1f51041e139a41a971ffa6ed
[]
no_license
StephenChio/deyan
501b4b493f3b3f7443468d85ccd405b6263301b0
c2b47f6ac3260fa82c01a4ff171086c2ae55dece
refs/heads/master
2022-06-21T09:51:12.874805
2020-04-14T09:48:03
2020-04-14T09:48:03
234,846,021
1
0
null
2022-06-17T02:52:54
2020-01-19T05:33:13
Java
UTF-8
Java
false
false
2,683
java
package com.OneTech.common.util.pingyinUtils; import java.util.regex.Matcher; import java.util.regex.Pattern; import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; /*** * 汉字工具类 * @author wantao * @since 2018.10.26 * */ public class CharacterUtil { /*** * 将汉字转成拼音(取首字母或全拼) * @param hanzi * @param full 是否全拼 * @return */ public static String convertHanzi2Pinyin(String hanzi,boolean full) { /*** * ^[\u2E80-\u9FFF]+$ 匹配所有东亚区的语言 * ^[\u4E00-\u9FFF]+$ 匹配简体和繁体 * ^[\u4E00-\u9FA5]+$ 匹配简体 */ String regExp="^[\u4E00-\u9FFF]+$"; StringBuffer sb=new StringBuffer(); if(hanzi==null||"".equals(hanzi.trim())) { return ""; } String pinyin=""; for(int i=0;i<hanzi.length();i++) { char unit=hanzi.charAt(i); if(match(String.valueOf(unit),regExp))//是汉字,则转拼音 { pinyin=convertSingleHanzi2Pinyin(unit); if(full) { sb.append(pinyin); } else { sb.append(pinyin.charAt(0)); } } else { sb.append(unit); } } return sb.toString(); } /*** * 将单个汉字转成拼音 * @param hanzi * @return */ private static String convertSingleHanzi2Pinyin(char hanzi) { HanyuPinyinOutputFormat outputFormat = new HanyuPinyinOutputFormat(); outputFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); String[] res; StringBuffer sb=new StringBuffer(); try { res = PinyinHelper.toHanyuPinyinStringArray(hanzi,outputFormat); sb.append(res[0]);//对于多音字,只用第一个拼音 } catch (Exception e) { e.printStackTrace(); return ""; } return sb.toString(); } /*** * @param str 源字符串 * @param regex 正则表达式 * @return 是否匹配 */ public static boolean match(String str,String regex) { Pattern pattern=Pattern.compile(regex); Matcher matcher=pattern.matcher(str); return matcher.find(); } // // public static void main(String[] args) { // System.out.println(convertHanzi2Pinyin("齋藤飛鳥",false).toUpperCase()); // } }
[ "779833570@qq.com" ]
779833570@qq.com
a64926bd046aa728268e7581ad5d246784baa121
fdfbc429afd6d40a33a032fb206953238330dc4f
/synertone/src/main/java/com/my51c/see51/app/VideoMeet.java
2cd719037f1f19a98bb82075cf191f8ec4d7e328
[]
no_license
liuluming/Synertone0124
784e379313d1ef9e7ebfc2c62fae11e7d5fc7036
92169921443a563acabf0ec1c8f10907bf3f4ef1
refs/heads/master
2020-04-18T06:17:30.389019
2019-01-24T06:32:24
2019-01-24T06:32:24
167,313,874
2
0
null
null
null
null
UTF-8
Java
false
false
1,244
java
package com.my51c.see51.app; import android.os.Bundle; import android.view.View; import android.widget.TextView; import com.my51c.see51.BaseActivity; import com.my51c.see51.common.AppData; import com.synertone.netAssistant.R; public class VideoMeet extends BaseActivity { private TextView putongshiping, weixingshiping, yidongshiping, shipinhuiyi;//字体显示文本 @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.video_meeting_activity); initView(); } private void initView() { shipinhuiyi = (TextView) findViewById(R.id.shipinhuiyi); shipinhuiyi.setTypeface(AppData.fontXiti); putongshiping = (TextView) findViewById(R.id.putongshiping); putongshiping.setTypeface(AppData.fontXiti); weixingshiping = (TextView) findViewById(R.id.weixingshiping); weixingshiping.setTypeface(AppData.fontXiti); yidongshiping = (TextView) findViewById(R.id.yidongshiping); yidongshiping.setTypeface(AppData.fontXiti); } //点击退出视频会议界面 public void onMeetFinish(View v) { finish(); } }
[ "snt1206@techtone.com" ]
snt1206@techtone.com
cc5cf1b0bb921951307ef77dd76d2c9033bdce77
56611c7c174650b8124b527255c42ff88ae58923
/src/main/java/com/aseledtsov/algorithms/util/Range.java
6e9ed43ef590dfeba4193a55474834d1bbee5784
[]
no_license
lexx1413/GrokkingAlgorithms
f08ff6c1df997b788b44037001647e25e8949cb3
71f55772c3e1718ed745bf4b7d85dc3eb155334f
refs/heads/master
2022-07-19T17:29:53.991789
2020-05-28T16:25:31
2020-05-28T16:25:31
267,631,076
0
0
null
null
null
null
UTF-8
Java
false
false
879
java
package com.aseledtsov.algorithms.util; import java.util.Objects; public class Range<T> { T min, max; public Range(T min, T max) { this.min = min; this.max = max; } public static <T> Range<T> of(T min, T max) { return new Range<>(min, max); } public T getMin() { return min; } public T getMax() { return max; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Range<?> range = (Range<?>) o; return getMin().equals(range.getMin()) && getMax().equals(range.getMax()); } @Override public int hashCode() { return Objects.hash(getMin(), getMax()); } @Override public String toString() { return "Range(" + min + ", " + max + ')'; } }
[ "lexx1413@gmail.com" ]
lexx1413@gmail.com
9a7f9d099b3fab1027a302b1b62bbf2525715adf
7a66c82a58bcd88863d106773759f6a930295ea4
/src/main/java/ru/naumen/sd40/log/parser/parsers/IParser.java
266ee5e30724c166eb1b4c81ded011e695c2f8bf
[]
no_license
TGladysheva/liquid-log
798a7520655d63b2173d0df16a82e896c5d37fc9
102161dafda746d9a4f3a9ae1ec2f5ae6a3ad11b
refs/heads/master
2020-03-30T04:53:43.977316
2018-12-18T16:59:40
2018-12-18T16:59:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
296
java
package ru.naumen.sd40.log.parser.parsers; import ru.naumen.sd40.log.parser.parsers.DataSetFactory.ICreator; import ru.naumen.sd40.log.parser.parsers.dataTypes.IDataType; import java.util.List; public interface IParser { ICreator getDataSetCreator(); List<IDataType> getDataTypes(); }
[ "tatiana.gladysheva24@gmail.com" ]
tatiana.gladysheva24@gmail.com
c88c80a19871b7719a95d2f1a96dd1fb71c4a2de
1f3aa01939429a126e0b286fa7cf5a189c48f03a
/src/io/littleworld/datatime/Main.java
c0f63793b92015f3d81dafb4b0e5b548252a467d
[]
no_license
little-world/java-exercises
3aafa1167a2cc6f487e28c861ac1eb16d4f22e86
04f390df83557ab20b75ba4bd5b75ec9dc328b39
refs/heads/master
2021-01-30T08:34:00.736980
2020-06-02T11:01:36
2020-06-02T11:01:36
243,495,426
0
0
null
null
null
null
UTF-8
Java
false
false
686
java
package io.littleworld.datatime; import java.time.LocalDate; import java.time.Month; import java.time.Period; public class Main { public static void main(String[] args) { LocalDate start = LocalDate.of(2015, Month.JANUARY, 1); LocalDate end = LocalDate.of(2015, Month.MARCH, 30); Period period = Period.ofMonths(1); performAnimalEnrichment(start, end, period); } private static void performAnimalEnrichment(LocalDate start, LocalDate end, Period period) { LocalDate upTo = start; while (upTo.isBefore(end)) { System.out.println("give new toy: " + upTo); upTo = upTo.plus(period); } } }
[ "peter.van.rijn@little-world.nl" ]
peter.van.rijn@little-world.nl
ceb90452861baab6e1c015eec9cb065baf360190
7511d71c0f9ac97d803514299128da18b9b83154
/Paint/app/src/main/java/com/example/paint/DrawActivity.java
9ef2dbc56948e7f24fb5b233a7662af95565e273
[]
no_license
vitaliishulhan/mobile_systems_labs
80175f15c2aeac4e9b2ec658ad4e79d243f7ebbf
4aa3569a3c5dbd29fa99a70308d3b9a29c47daf8
refs/heads/main
2023-02-01T08:29:41.381167
2020-12-19T21:56:41
2020-12-19T21:56:41
322,943,383
0
0
null
null
null
null
UTF-8
Java
false
false
8,516
java
package com.example.paint; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.app.Dialog; import android.graphics.Color; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.SeekBar; import android.widget.TextView; import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN; public class DrawActivity extends AppCompatActivity { DrawView drawView; Menu menu; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setFlags(FLAG_FULLSCREEN,FLAG_FULLSCREEN); drawView = new DrawView(this); setContentView(drawView); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); this.menu = menu; return true; } @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { item.setChecked(true); switch (item.getItemId()) { case R.id.normalModeItem: drawView.setMode(0); drawView.invalidate(); return true; case R.id.embossModeItem: drawView.setMode(1); drawView.invalidate(); return true; case R.id.blurModeItem: drawView.setMode(2); drawView.invalidate(); return true; case R.id.clearAllItem: drawView.points.clear(); drawView.invalidate(); return true; case R.id.changeColorItem: changeColor(); return true; case R.id.thicknessItem: changeThickness(); return true; case R.id.eraserItem: drawView.eraseOn = !drawView.eraseOn; item.setTitle(drawView.eraseOn ? "Eraser Off" : "Eraser On"); return true; default: return super.onOptionsItemSelected(item); } } public void changeThickness() { final Dialog d = new Dialog(DrawActivity.this); final ThicknessView thicknessView = new ThicknessView(d.getContext()); thicknessView.setColor(drawView.color); thicknessView.setMode(drawView.mode); thicknessView.setThickness(drawView.thickness); d.setContentView(R.layout.thickness_dialog); final float scale = d.getContext().getResources().getDisplayMetrics().density; d.addContentView(thicknessView, new ViewGroup.LayoutParams((int)(200*scale + 0.5F),(int)(100*scale + 0.5F))); final TextView thicknessTextView = d.findViewById(R.id.thicknessTextView); thicknessTextView.setText(String.valueOf(drawView.thickness)); final SeekBar thicknessSeekBar = d.findViewById(R.id.thicknessSeekBar); thicknessSeekBar.setProgress(drawView.thickness); thicknessSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { thicknessView.setThickness(progress); thicknessTextView.setText(String.valueOf(progress)); } @Override public void onStartTrackingTouch(SeekBar seekBar) {/*not used*/} @Override public void onStopTrackingTouch(SeekBar seekBar) {/*not used*/} }); Button thicknessSetBtn = d.findViewById(R.id.thickness_set); Button thicknessCancelBtn = d.findViewById(R.id.thickness_cancel); thicknessSetBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { menu.findItem(R.id.thicknessItem).setTitle("Thickness (" + thicknessSeekBar.getProgress() + ")"); drawView.setThickness(thicknessSeekBar.getProgress()); d.dismiss(); } }); thicknessCancelBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { d.dismiss(); } }); d.show(); } public void changeColor() { final Dialog d = new Dialog(DrawActivity.this); d.setContentView(R.layout.color_dialog); final View colorView = d.findViewById(R.id.colorView); final SeekBar redBar = d.findViewById(R.id.redBar); final SeekBar blueBar = d.findViewById(R.id.blueBar); final SeekBar greenBar = d.findViewById(R.id.greenBar); final TextView redTextView = d.findViewById(R.id.redTextView); final TextView greenTextView = d.findViewById(R.id.greenTextView); final TextView blueTextView = d.findViewById(R.id.blueTextView); redBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { redTextView.setText(String.valueOf(progress)); colorView.setBackgroundColor(convertColor( redBar.getProgress(), greenBar.getProgress(), blueBar.getProgress())); } @Override public void onStartTrackingTouch(SeekBar seekBar) {/*not used*/} @Override public void onStopTrackingTouch(SeekBar seekBar) {/*not used*/} }); greenBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { greenTextView.setText(String.valueOf(progress)); colorView.setBackgroundColor(convertColor( redBar.getProgress(), greenBar.getProgress(), blueBar.getProgress())); } @Override public void onStartTrackingTouch(SeekBar seekBar) {/*not used*/} @Override public void onStopTrackingTouch(SeekBar seekBar) {/*not used*/} }); blueBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { blueTextView.setText(String.valueOf(progress)); colorView.setBackgroundColor(convertColor( redBar.getProgress(), greenBar.getProgress(), blueBar.getProgress())); } @Override public void onStartTrackingTouch(SeekBar seekBar) {/*not used*/} @Override public void onStopTrackingTouch(SeekBar seekBar) {/*not used*/} }); Button colorSetBtn = d.findViewById(R.id.color_set); Button colorCancelBtn = d.findViewById(R.id.color_cancel); colorSetBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { drawView.setColor(convertColor( redBar.getProgress(), greenBar.getProgress(), blueBar.getProgress())); d.dismiss(); } }); colorCancelBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { d.dismiss(); } }); d.show(); } private int convertColor(int r, int g, int b) { String hex_r = Integer.toHexString(r); String hex_g = Integer.toHexString(g); String hex_b = Integer.toHexString(b); if(hex_r.length() == 1) hex_r = "0" + hex_r; if(hex_g.length() == 1) hex_g = "0" + hex_g; if(hex_b.length() == 1) hex_b = "0" + hex_b; return Color.parseColor("#" + hex_r + hex_g + hex_b); } }
[ "vitalii.shulhan@gmail.com" ]
vitalii.shulhan@gmail.com
dd3e7ee58ba6825853d3acc4224fa431a6a22518
6b282d5230e2f681177077e1a8249957f2ea8afc
/src/main/java/java8/com/insightfullogic/java8/exercises/chapter9/package-info.java
596dc8a0f502ab2fd4ba4236ca59cbc11918621e
[]
no_license
erlendstuyven/CodeWars
3d6a9621ae484ddc4ea19fe75aa717b0c5c681ab
79d3590230ddb29626ed2ad89b74840717eab307
refs/heads/master
2021-04-29T11:07:37.564259
2018-09-25T18:15:57
2018-09-25T18:15:57
77,855,586
0
0
null
null
null
null
UTF-8
Java
false
false
173
java
package java8.com.insightfullogic.java8.exercises.chapter9; /** * The API gets refactored to CallbackArtistAnalyzer and * the code to CompletableFutureArtistAnalyser. */
[ "erlend.stuyven@cegeka.com" ]
erlend.stuyven@cegeka.com
f6d3fe5991836994e69fbdab57b5c498a986c437
44e641e2a612d58e8f522d8397345d1ca1dc9c56
/car-utils/src/main/java/Utils/Conn.java
631da882d4b581a453ca6c9af0cd640b19f71a27
[]
no_license
luoliyi/CarSystem
38d9017fe8f1dd60b89c72584e13febf880d02ac
ed861c7d077a42b35a7bc44a489d9e540707dac8
refs/heads/master
2020-03-29T15:25:28.091467
2019-01-18T06:13:08
2019-01-18T06:13:08
150,062,381
0
0
null
null
null
null
UTF-8
Java
false
false
7,970
java
package Utils; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; public class Conn { static Connection conn; static Statement stmt; static PreparedStatement pstmt; public static void open(){ //驱动程序名//不固定,根据驱动 String driver = "com.mysql.jdbc.Driver"; // URL指向要访问的数据库名******,8.0jar包新增时区。 String url = "jdbc:mysql://nf513.cn/CarSystemDB?serverTimezone=GMT%2B8"; // MySQL配置时的用户名 String user = "root"; // Java连接MySQL配置时的密码****** String password = "10086"; try { // 加载驱动程序 Class.forName(driver); // 连续数据库 conn = DriverManager.getConnection(url, user, password); if(!conn.isClosed()) System.out.println("Succeeded connecting to the Database!"); } catch(ClassNotFoundException e) { System.out.println("Sorry,can`t find the Driver!"); e.printStackTrace(); } catch(SQLException e) { e.printStackTrace(); } catch(Exception e){ e.printStackTrace(); } } public static void close(){ try { if(!conn.isClosed()){ conn.close(); } } catch (SQLException e) { e.printStackTrace(); } } //修改表格内容 public static int executeUpdate(String sql) { int result = 0; try { open();//保证连接是成功的 stmt = conn.createStatement(); result = stmt.executeUpdate(sql); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { close(); } return result; } /** * 如果执行的查询或存储过程,会返回多个数据集,或多个执行成功记录数 * 可以调用本方法,返回的结果, * 是一个List<ResultSet>或List<Integer>集合 * @param sql * @return */ public static Object execute(String sql) { boolean b=false; try { open();//保证连接是成功的 stmt = conn.createStatement(); b = stmt.execute(sql); //true,执行的是一个查询语句,我们可以得到一个数据集 //false,执行的是一个修改语句,我们可以得到一个执行成功的记录数 if(b){ return stmt.getResultSet(); } else { return stmt.getUpdateCount(); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { if(!b) { close(); } } return null; } /** * 查询数据,参数形式 * select * from student where name=? and sex=? */ public static ResultSet executeQuery(String sql,Object[] in) { try { open();//保证连接是成功的 PreparedStatement pst = conn.prepareStatement(sql); for(int i=0;i<in.length;i++) pst.setObject(i+1, in[i]); stmt = pst;//只是为了关闭命令对象pst return pst.executeQuery(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } /** * 修改 */ public static int executeUpdate(String sql,Object[] in) { try { open();//保证连接是成功的 PreparedStatement pst = conn.prepareStatement(sql); for(int i=0;i<in.length;i++) pst.setObject(i+1, in[i]); stmt = pst;//只是为了关闭命令对象pst return pst.executeUpdate(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally { close(); } return 0; } public static Object execute(String sql,Object[] in) { boolean b=false; try { open();//保证连接是成功的 PreparedStatement pst = conn.prepareStatement(sql); for(int i=0;i<in.length;i++) pst.setObject(i+1, in[i]); b = pst.execute(); //true,执行的是一个查询语句,我们可以得到一个数据集 //false,执行的是一个修改语句,我们可以得到一个执行成功的记录数 if(b){ return pst.getResultSet(); } else { System.out.println("****"); List<Integer> list = new ArrayList<Integer>(); list.add(pst.getUpdateCount()); while(pst.getMoreResults()) { list.add(pst.getUpdateCount()); } return list; } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { if(!b) { System.out.println("===="); close(); } } return null; } /** * 调用存储过程 proc_Insert(?,?,?) * @param procName * @param in * @return */ public static Object executeProcedure(String procName,Object[] in) { open(); try { procName = "{call "+procName+"("; String link=""; for(int i=0;i<in.length;i++) { procName+=link+"?"; link=","; } procName+=")}"; CallableStatement cstmt = conn.prepareCall(procName); for(int i=0;i<in.length;i++) { cstmt.setObject(i+1, in[i]); } if(cstmt.execute()) { return cstmt.getResultSet(); } else { return cstmt.getUpdateCount(); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } /** * 调用存储过程,并有输出参数 * @procName ,存储过程名称:proc_Insert(?,?) * @in ,输入参数集合 * @output,输出参数集合 * @type,输出参数类型集合 */ public static Object executeOutputProcedure(String procName, Object[] in,Object[] output,int[] type){ Object result = null; try { CallableStatement cstmt = conn.prepareCall("{call "+procName+"}"); //设置存储过程的参数值 int i=0; for(;i<in.length;i++){//设置输入参数 cstmt.setObject(i+1, in[i]); //print(i+1); } int len = output.length+i; for(;i<len;i++){//设置输出参数 cstmt.registerOutParameter(i+1,type[i-in.length]); //print(i+1); } boolean b = cstmt.execute(); //获取输出参数的值 for(i=in.length;i<output.length+in.length;i++) output[i-in.length] = cstmt.getObject(i+1); if(b) { result = cstmt.getResultSet(); } else { result = cstmt.getUpdateCount(); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; } public static void main(String[] args) { open(); } }
[ "mopln510@qq.com" ]
mopln510@qq.com
553faff1398f64e002416b5fbb760512437af61a
3d54fc7ae9ef5f5f57078d9f09fdbe53e08aefbc
/Java/Projetos/ProjetoPoo2-master/src/uml1/main.java
5b2d5bda00918f9d5129c57b672334a3f43f23e5
[]
no_license
ThomasLossio/Codigos-durante-a-faculdade
ee5f13adb14967acd3b4309d566715519a6f2205
33ee1edaa936182ad918199d21abb5f82f942c55
refs/heads/master
2021-09-18T13:18:25.000535
2018-07-14T23:53:25
2018-07-14T23:53:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,785
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 uml1; /** * * @author batista */ // Empregado empregado = new Empregado(); // empregado.setSalario(1300); // // Gerente gerente = new Gerente(); // gerente.setGratificacao(300); // gerente.setSalario(2500); // // Gerente gerente2 = new Gerente(); // gerente2.setGratificacao(500); // gerente2.setSalario(3000); // // Comissionado comissionado = new Comissionado(); // comissionado.setPercentual(2); // comissionado.setSalario(800); // // Aluno aluno = new Aluno(); // aluno.setMatricula(1234); // aluno.setMensalidade(1000); // aluno.setCpf("123456"); // aluno.setNome("João Maria das Flores"); // // Aluno aluno2 = new Aluno(); // aluno2.setMatricula(1234); // aluno2.setMensalidade(1000); // // Aluno aluno3 = new Aluno(); // aluno3.setMatricula(1234); // aluno3.setMensalidade(3000); //// //// System.out.println("Salario do gerente: " + gerente.getValor()); //// System.out.println("Salario do empregado: " + empregado.getValor()); //// System.out.println("Salario do comissionado: " + comissionado.getValor()); // // ArrayList<Contabilidade> contasPagar = new ArrayList(); // ArrayList<Contabilidade> contasReceber = new ArrayList(); // // contasPagar.add(empregado); // contasPagar.add(gerente); // // contasPagar.add(gerente2); // contasPagar.add(comissionado); // // // contasReceber.add(aluno); // contasReceber.add(aluno2); // contasReceber.add(aluno3); // // // double totalContasPagar = 0; // for (Contabilidade contasPagar2 : contasPagar) { // totalContasPagar += contasPagar2.getValor(); // } // // double totalContasReceber = 0; // for (Contabilidade contasReceber1 : contasReceber) { // totalContasReceber += contasReceber1.getValor(); // } // // // System.out.println("TOTAL DE CONTAS A PAGAR : " + totalContasPagar); // System.out.println("TOTAL DE CONTAS A RECEBER: " + totalContasReceber); // double Saldo = totalContasReceber - totalContasPagar; // System.out.println("SALDO: " + Saldo); public class main { public static void main (String [] args) { uml1.Interface.FramePrincipal Frame = new uml1.Interface.FramePrincipal(); Frame.setVisible(true); } }
[ "thomaslossio@hotmail.com" ]
thomaslossio@hotmail.com
92205125fcc015545abebb847351c71492ff279f
f9b47a23cdc099d87cb674572f1cb7e83a174c10
/src/main/java/cn/com/lms/entity/Event.java
3496b50b7ba703cc70f0d2a203a2a861441ad4b9
[]
no_license
LongDianDian/lms
992da094a3dd59a3781791143cb703080a93eff7
f86c2e4e41f69bc80c41012fd186a0254c7fe26c
refs/heads/master
2020-03-12T19:19:23.580752
2018-04-24T10:10:33
2018-04-24T10:10:33
130,782,398
0
0
null
null
null
null
UTF-8
Java
false
false
2,516
java
package cn.com.lms.entity; import java.util.Date; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; import org.springframework.web.bind.annotation.Mapping; /** 事件表 * */ @Entity @Table(name="lms_event") public class Event { @Id @GeneratedValue private int id ; /** * 事件类型; 1:新闻 2:动态 3:公告 */ @Column(name="type") private int type; /** * 是否为视频 * */ @Column(name="isVideo") private int isVideo; @Column(name="title") private String title; /** * 内容 */ @Column(name="content") private String content; /** * 概要 */ @Column(name="outline") private String outline; @ManyToOne @JoinColumn(name="school_id") private School school; /** * 资源内容 */ @OneToMany(cascade=CascadeType.ALL,fetch= FetchType.LAZY) @JoinColumn(name="event_id") private List<Media> medias; @Column(name="createTime") private Date createTime; public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getType() { return type; } public void setType(int type) { this.type = type; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getOutline() { return outline; } public void setOutline(String outline) { this.outline = outline; } public School getSchool() { return school; } public void setSchool(School school) { this.school = school; } public int getIsVideo() { return isVideo; } public void setIsVideo(int isVideo) { this.isVideo = isVideo; } public List<Media> getMedias() { return medias; } public void setMedias(List<Media> medias) { this.medias = medias; } }
[ "Administrator@mam.abc.com" ]
Administrator@mam.abc.com
55b5a6abb4c3a5605b2ce8f50c280f513c8892cb
b1b23e08cfa48009fed555ccaaaecd1236588804
/Source Code/FYP-backend/src/main/java/com/fyp/hotel/api/ent/Report.java
88654ca5bae74cc40ad64e3194c4526928548d8b
[]
no_license
chithuan102/UGW-COMP1682
77a8e74e41aaa56b9274a02c6ff7b17734b9468a
58b6ed0ca79ca244168a5e0f636cec7b5efd242e
refs/heads/main
2023-01-09T03:07:51.958767
2020-11-13T02:05:01
2020-11-13T02:05:01
312,447,204
0
0
null
null
null
null
UTF-8
Java
false
false
396
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 com.fyp.hotel.api.ent; import javax.persistence.Entity; import lombok.Data; /** * * @author mct */ @Entity @Data public class Report extends MasterEnt{ String date; String type; }
[ "chithuan102@gmail.com" ]
chithuan102@gmail.com
90d8219092c3f0905a0cbac36ef3cdd6b13a819a
126cb08d2af4eeaa9b18b2410fc4923ba625fa45
/fop-core/src/main/java/org/apache/fop/render/intermediate/PageIndexContext.java
09c42c4a53d640fbf44a5c016c689972fcf59d71
[ "Apache-2.0" ]
permissive
apache/xmlgraphics-fop
5413ae11fc0eb3875ffafd299d381f19c21f61a2
caba469ffe74ac9afa1ce189fbbb2643637d94f1
refs/heads/main
2023-08-31T03:16:17.099726
2023-08-14T10:34:19
2023-08-14T10:46:35
206,318
63
67
Apache-2.0
2023-04-27T09:16:16
2009-05-21T00:26:43
Java
UTF-8
Java
false
false
965
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. */ /* $Id$ */ package org.apache.fop.render.intermediate; /** * Interface to get the page index */ public interface PageIndexContext { int getPageIndex(); }
[ "ssteiner@apache.org" ]
ssteiner@apache.org
7389777f496feea0871d8ab3377a3c42109c2994
240d4bdef09c9be627e2def250bf2f23f5dfe0c9
/common-service/crud-service/src/test/java/org/go/together/configuration/H2HibernateConfig.java
c129767173a612eb0b4fe37db7983261a7275aa8
[]
no_license
satker/go-together
9db9ebdca7a5d3b9d4eb52f21688e9ecc8de10b4
9333195bd0b87d0688f683c4ed083b3f4c9492c3
refs/heads/master
2023-09-04T03:26:15.955769
2021-07-12T10:46:26
2021-07-12T10:46:26
235,290,009
0
0
null
2020-08-18T12:52:26
2020-01-21T08:26:13
Java
UTF-8
Java
false
false
2,043
java
package org.go.together.configuration; import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.orm.hibernate5.HibernateTransactionManager; import org.springframework.orm.hibernate5.LocalSessionFactoryBean; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; import javax.sql.DataSource; import java.util.Properties; @Configuration @EnableTransactionManagement public class H2HibernateConfig { private Properties hibernateProperties() { Properties hibernateProperties = new Properties(); hibernateProperties.setProperty("hibernate.hbm2ddl.auto", "create"); hibernateProperties.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect"); hibernateProperties.setProperty("hibernate.show_sql", "false"); hibernateProperties.setProperty("hibernate.format_sql", "true"); return hibernateProperties; } @Bean public DataSource dataSource() { return DataSourceBuilder.create() .driverClassName("org.h2.Driver") .url("jdbc:h2:mem:test") .username("SA") .password("") .build(); } @Bean public LocalSessionFactoryBean sessionFactory() { LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean(); sessionFactory.setPackagesToScan("org.go.together.test.entities"); sessionFactory.setDataSource(dataSource()); sessionFactory.setHibernateProperties(hibernateProperties()); return sessionFactory; } @Bean public PlatformTransactionManager hibernateTransactionManager() { HibernateTransactionManager transactionManager = new HibernateTransactionManager(); transactionManager.setSessionFactory(sessionFactory().getObject()); return transactionManager; } }
[ "satker73@gmail.com" ]
satker73@gmail.com
6a2ebfc9f3e0a0614b035171334cf128d81ef3d4
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/88/org/apache/commons/math/optimization/direct/DirectSearchOptimizer_replaceWorstPoint_414.java
c1317ec3b4222d2a72454d468e84baa7a06fa996
[]
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
2,370
java
org apach common math optim direct simplex base direct search optim algorithm direct search method object function valu deriv comput approxim deriv paper margaret wright href http bell lab doc direct search method scorn respect comput deriv imposs noisi function unpredict discontinu difficult complex comput cost case optimum bad point desir case optimum desir found case direct search method simplex base direct search method base comparison object function valu vertic simplex set point dimens updat algorithm step initi configur simplex set link set start configur setstartconfigur link set start configur setstartconfigur method call optim attempt explicit call method step set trigger build configur unit hypercub call link optim multivari real function multivariaterealfunct goal type goaltyp optim reus current start configur move vertex provid start point optim optim solv problem number paramet chang start configur reset dimens mismatch occur link set converg checker setconvergencecheck real converg checker realconvergencecheck call link simpl scalar checker simplescalarvaluecheck converg check provid worst point previou current simplex converg checker base perform boilerpl simplex initi handl simplex updat perform deriv class implement algorithm multivari real optim multivariaterealoptim serializ multivari real function multivariaterealfunct nelder mead neldermead multi direct multidirect version revis date direct search optim directsearchoptim multivari real optim multivariaterealoptim serializ replac worst point simplex point param point pair pointvaluepair point insert param compar compar sort simplex vertic worst replac worst point replaceworstpoint real point pair realpointvaluepair point pair pointvaluepair compar real point pair realpointvaluepair compar simplex length compar compar simplex point pair pointvaluepair real point pair realpointvaluepair tmp simplex simplex point pair pointvaluepair point pair pointvaluepair tmp simplex point pair pointvaluepair
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
bda4e7ac648d8695a84da1cf3e6266d06dbe2c65
3be42ab6d884fb937b47cfa93ae4a76d94daca9a
/springboot-powerNT/src/main/java/com/yuanqi/powernt/dao/RegNumberDao.java
7450a095a04ee9ea7b818c04e26a16e72d599952
[]
no_license
raochao/Test
bf781bfff8a5a9ac3ebc619314d84712483b90b0
418af863901d987a1108ae68521b526ff736594e
refs/heads/master
2023-07-06T19:34:27.954026
2021-08-06T08:21:03
2021-08-06T08:21:03
393,284,901
0
0
null
null
null
null
UTF-8
Java
false
false
22,534
java
package com.yuanqi.powernt.dao; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.yuanqi.powernt.model.BaseResult; import com.yuanqi.powernt.tools.HttpTools; import org.springframework.stereotype.Service; import orgine.powermop.api.gateway.sdk.info.BusinessCallResponse; import pnbclient.util.JSONParser; import java.sql.Date; import java.util.HashMap; @Service public class RegNumberDao { //操作别名对象 private pnbclient.alias.SQLCommandService aliasSrv = null; //操作sql语句对象 private pnbclient.command.SQLCommandService sqlSrv = null; public RegNumberDao(){ try { aliasSrv = new pnbclient.alias.SQLCommandService(); sqlSrv = new pnbclient.command.SQLCommandService(); } catch (Exception e) { e.printStackTrace(); } } public BaseResult request (Object obj,String interfaceId) throws Exception{ BaseResult result =null; final JSONObject jsonObject = (JSONObject)JSON.toJSON(obj); System.out.println("前端传入参数对象=================="+jsonObject.toString()); // String interfaceId=jsonObject.getJSONObject("headers").getString("interfaceId"); System.out.println("请求的interfaceId================="+interfaceId); if("getRegDeptmentList".equals(interfaceId)){ result = getRegDeptmentList(obj,"orgine.powermsp.service.overt.register."+interfaceId); } if("getRegDoctorList".equals(interfaceId)){ result = getRegDoctorList(obj,"orgine.powermsp.service.overt.register."+interfaceId); } if("createRegOrder".equals(interfaceId)){ result = createRegOrder(obj,"orgine.powermsp.service.overt.register."+interfaceId); } if("prepay".equals(interfaceId)){ result = prepay(obj,"orgine.powermpp.pay.aggre.service.api.pay."+interfaceId); } if("confirmRegOrder".equals(interfaceId)){ result = confirmRegOrder(obj,"orgine.powermsp.service.overt.register."+interfaceId); } return result; } public BaseResult getRegDeptmentList(Object obj,String interfaceId) throws Exception{ System.out.println("开始执行获取科室列表方法-----------------------------"); final JSONObject jsonObject = (JSONObject)JSON.toJSON(obj); String headJson = ""; String bodyJson = ""; BaseResult baseResult=null; try { // JSONObject headObject=jsonObject.getJSONObject("headers"); // String interfaceId=headObject.getString("interfaceId"); // JSONObject bodyObject=jsonObject.getJSONObject("body"); headJson=getHeader(interfaceId); //重构请求参数-body部分 HashMap<String, Object> bodyMap = new HashMap<>(); HashMap<String, String> infoMap = new HashMap<>(); JSONObject infoObject=jsonObject.getJSONObject("info"); infoMap.put("deptment_area",infoObject.getString("deptment_area")); infoMap.put("parent_deptment_code",infoObject.getString("parent_deptment_code")); infoMap.put("extend_params",infoObject.getString("extend_params")); infoMap.put("deptment_code",infoObject.getString("deptment_code")); infoMap.put("time_interval",infoObject.getString("time_interval")); infoMap.put("id_card",infoObject.getString("id_card")); infoMap.put("birthday",infoObject.getString("birthday")); infoMap.put("category_mark",infoObject.getString("category_mark")); infoMap.put("level",infoObject.getString("level")); infoMap.put("operator",infoObject.getString("operator")); infoMap.put("input_name",infoObject.getString("input_name")); infoMap.put("sex",infoObject.getString("sex")); bodyMap.put("info",infoMap); //重构请求参数-extInfo部分 HashMap<String, Object> extInfoMap = new HashMap<>(); extInfoMap.put("pass_through",null); bodyMap.put("ext_info",extInfoMap); //重构请求参数-pagein部分 JSONObject pageinObject=jsonObject.getJSONObject("pagein"); HashMap<String, String> pageinMap = new HashMap<>(); pageinMap.put("rowsperpage",pageinObject.getString("rowsperpage")); pageinMap.put("pageaction",pageinObject.getString("pageaction")); pageinMap.put("topagenum",pageinObject.getString("topagenum")); pageinMap.put("currentpagenum",pageinObject.getString("currentpagenum")); bodyMap.put("pagein",pageinMap); // int a=1/0; bodyJson = JSONParser.fromObject(bodyMap); //请求接口 BusinessCallResponse response = HttpTools.requestHttp(headJson, bodyJson); if("10000".equals(response.getResult().getCode())){ baseResult=new BaseResult(200, response.getResult().getMsg()+","+response.getResult().getSubMsg(), JSON.parseObject(response.getBody()!=null?response.getBody().toString():null)); }else{ baseResult=new BaseResult(500, response.getResult().getMsg()+","+response.getResult().getSubMsg(), JSON.parseObject(response.getBody()!=null?response.getBody().toString():null)); } } catch (Exception e) { e.printStackTrace(); } System.out.println("结束执行获取科室列表方法-----------------------------"); return baseResult; } /** * 获取医生和排班信息 * @param obj * @return */ public BaseResult getRegDoctorList(Object obj,String interfaceId){ System.out.println("开始执行获取医生和排版信息方法-----------------------------"); final JSONObject jsonObject = (JSONObject)JSON.toJSON(obj); String headJson = ""; String bodyJson = ""; BaseResult baseResult =null; try { // JSONObject headObject=jsonObject.getJSONObject("headers"); // String interfaceId=headObject.getString("interfaceId"); // JSONObject bodyObject=jsonObject.getJSONObject("body"); headJson=getHeader(interfaceId); //重构请求参数-body部分 HashMap<String, Object> bodyMap = new HashMap<>(); HashMap<String, String> infoMap = new HashMap<>(); JSONObject infoObject=jsonObject.getJSONObject("info"); infoMap.put("end_time",infoObject.getString("end_time")); infoMap.put("doctor_code",infoObject.getString("doctor_code")); infoMap.put("start_time",infoObject.getString("start_time")); infoMap.put("extend_params",infoObject.getString("extend_params")); infoMap.put("category_mark",infoObject.getString("category_mark")); infoMap.put("patient_id",infoObject.getString("patient_id")); infoMap.put("operator",infoObject.getString("operator")); infoMap.put("deptment_code",infoObject.getString("deptment_code")); infoMap.put("input_name",infoObject.getString("input_name")); infoMap.put("parent_deptment_code",infoObject.getString("parent_deptment_code")); infoMap.put("charge_type",infoObject.getString("charge_type")); infoMap.put("time_interval",infoObject.getString("time_interval")); bodyMap.put("info",infoMap); //重构请求参数-extInfo部分 HashMap<String, Object> extInfoMap = new HashMap<>(); extInfoMap.put("pass_through",null); bodyMap.put("ext_info",extInfoMap); //重构请求参数-pagein部分 JSONObject pageinObject=jsonObject.getJSONObject("pagein"); HashMap<String, String> pageinMap = new HashMap<>(); pageinMap.put("rowsperpage",pageinObject.getString("rowsperpage")); pageinMap.put("pageaction",pageinObject.getString("pageaction")); pageinMap.put("topagenum",pageinObject.getString("topagenum")); pageinMap.put("currentpagenum",pageinObject.getString("currentpagenum")); bodyMap.put("pagein",pageinMap); bodyJson = JSONParser.fromObject(bodyMap); //请求接口 BusinessCallResponse response = HttpTools.requestHttp(headJson, bodyJson); if("10000".equals(response.getResult().getCode())){ baseResult=new BaseResult(200, response.getResult().getMsg()+","+response.getResult().getSubMsg(), JSON.parseObject(response.getBody()!=null?response.getBody().toString():null)); }else{ baseResult=new BaseResult(500, response.getResult().getMsg()+","+response.getResult().getSubMsg(), JSON.parseObject(response.getBody()!=null?response.getBody().toString():null)); } } catch (Exception e) { e.printStackTrace(); } System.out.println("结束执行获取医生和排版信息方法-----------------------------"); return baseResult; } /** * 创建订单 * @param obj * @return */ public BaseResult createRegOrder(Object obj,String interfaceId){ System.out.println("开始执行创建订单方法-----------------------------"); final JSONObject jsonObject = (JSONObject)JSON.toJSON(obj); String headJson = ""; String bodyJson = ""; BaseResult baseResult=null; try { // JSONObject headObject=jsonObject.getJSONObject("headers"); // String interfaceId=headObject.getString("interfaceId"); // JSONObject bodyObject=jsonObject.getJSONObject("body"); headJson=getHeader(interfaceId); //重构请求参数-body部分 HashMap<String, Object> bodyMap = new HashMap<>(); HashMap<String, String> infoMap = new HashMap<>(); JSONObject infoObject=jsonObject.getJSONObject("info"); infoMap.put("family_address",infoObject.getString("family_address")); infoMap.put("card_number",infoObject.getString("card_number")); infoMap.put("start_time",infoObject.getString("start_time")); infoMap.put("patient_id",infoObject.getString("patient_id")); infoMap.put("extend_params",infoObject.getString("extend_params")); infoMap.put("schedule_alias",infoObject.getString("schedule_alias")); infoMap.put("treatment_fee",infoObject.getString("treatment_fee")); infoMap.put("mac_number",infoObject.getString("mac_number")); infoMap.put("patient_name",infoObject.getString("patient_name")); infoMap.put("doctor_name",infoObject.getString("doctor_name")); infoMap.put("category_mark",infoObject.getString("category_mark")); infoMap.put("other_fees",infoObject.getString("other_fees")); infoMap.put("id_type",infoObject.getString("id_type")); infoMap.put("doctor_code",infoObject.getString("doctor_code")); infoMap.put("schedule_id",infoObject.getString("schedule_id")); infoMap.put("discount_allfee",infoObject.getString("discount_allfee")); infoMap.put("time_id",infoObject.getString("time_id")); infoMap.put("deptment_code",infoObject.getString("deptment_code")); infoMap.put("out_call_date",infoObject.getString("out_call_date")); infoMap.put("id_number",infoObject.getString("id_number")); infoMap.put("deptment_name",infoObject.getString("deptment_name")); infoMap.put("serial_number",infoObject.getString("serial_number")); infoMap.put("sex",infoObject.getString("sex")); infoMap.put("end_time",infoObject.getString("end_time")); infoMap.put("registration_fee",infoObject.getString("registration_fee")); infoMap.put("time_interval",infoObject.getString("time_interval")); infoMap.put("operator",infoObject.getString("operator")); infoMap.put("mobile_number",infoObject.getString("mobile_number")); infoMap.put("pay_choice",infoObject.getString("pay_choice")); infoMap.put("card_type",infoObject.getString("card_type")); bodyMap.put("info",infoMap); //重构请求参数-extInfo部分 HashMap<String, Object> extInfoMap = new HashMap<>(); extInfoMap.put("pass_through",null); bodyMap.put("ext_info",extInfoMap); bodyJson = JSONParser.fromObject(bodyMap); //请求接口 BusinessCallResponse response = HttpTools.requestHttp(headJson, bodyJson); if("10000".equals(response.getResult().getCode())){ baseResult=new BaseResult(200, response.getResult().getMsg()+","+response.getResult().getSubMsg(), JSON.parseObject(response.getBody()!=null?response.getBody().toString():null)); }else{ baseResult=new BaseResult(500, response.getResult().getMsg()+","+response.getResult().getSubMsg(), JSON.parseObject(response.getBody()!=null?response.getBody().toString():null)); } ; String orderId=JSON.parseObject((String) response.getBody()).getJSONObject("info").getString("order_id"); String tradeOrderId=JSON.parseObject((String) response.getBody()).getJSONObject("info").getString("trade_order_id"); //创建本地订单 aliasSrv.setLangId("sc"); aliasSrv.addParameter(orderId);//订单编号 aliasSrv.addParameter(tradeOrderId);//数字订单号(医院返回订单号码) aliasSrv.addParameter(tradeOrderId);// 商户支付订单号(平台产生) aliasSrv.addParameter("李四");//用户名 aliasSrv.addParameter("123456");//用户标识 aliasSrv.addParameter("0");//诊疗方式0:初诊 1:复诊 aliasSrv.addParameter(new Date(System.currentTimeMillis()));//订单生成时间 aliasSrv.addParameter(infoObject.getString("enterprise_id"));//医院代码 aliasSrv.addParameter(infoObject.getString("deptment_code"));//科室代码 aliasSrv.addParameter(infoObject.getString("doctor_code"));//医生代码 aliasSrv.addParameter(infoObject.getString("positional_titles"));//医生职称 aliasSrv.addParameter("");//号源类型0:当天号源 1:预约号源 aliasSrv.addParameter("1");//号别1:普通号 2:专家号 aliasSrv.addParameter(""); aliasSrv.addParameter(""); aliasSrv.addParameter(""); aliasSrv.addParameter(""); aliasSrv.addParameter(infoObject.getString("registration_fee"));//挂号费 aliasSrv.addParameter(""); aliasSrv.addParameter(""); aliasSrv.addParameter(""); aliasSrv.addParameter(""); aliasSrv.addParameter("0");//状态:0平台新建订单 aliasSrv.execute("RegNumber_CreateOrderInfo_sql"); } catch (Exception e) { baseResult=new BaseResult(500, e.getMessage(), null); e.printStackTrace(); return baseResult; // e.printStackTrace(); } System.out.println("结束执行创建订单方法-----------------------------"); return baseResult; } /** * 确认订单 * @param obj * @return */ public BaseResult confirmRegOrder(Object obj,String interfaceId){ System.out.println("开始执行确认订单方法-----------------------------"); final JSONObject jsonObject = (JSONObject)JSON.toJSON(obj); String headJson = ""; String bodyJson = ""; BaseResult baseResult=null; try { // JSONObject headObject=jsonObject.getJSONObject("headers"); // String interfaceId=headObject.getString("interfaceId"); // JSONObject bodyObject=jsonObject.getJSONObject("body"); headJson=getHeader(interfaceId); //重构请求参数-body部分 HashMap<String, Object> bodyMap = new HashMap<>(); HashMap<String, String> infoMap = new HashMap<>(); JSONObject infoObject=jsonObject.getJSONObject("info"); infoMap.put("extend_params",infoObject.getString("extend_params")); infoMap.put("trade_order_id",infoObject.getString("trade_order_id")); infoMap.put("order_id",infoObject.getString("order_id")); infoMap.put("operator",infoObject.getString("operator")); infoMap.put("pay_allamount",infoObject.getString("pay_allamount")); infoMap.put("discount_amount",infoObject.getString("discount_amount")); infoMap.put("mac_number",infoObject.getString("mac_number")); infoMap.put("on_line_flag",infoObject.getString("on_line_flag")); bodyMap.put("info",infoMap); //重构请求参数-extInfo部分 HashMap<String, Object> extInfoMap = new HashMap<>(); extInfoMap.put("pass_through",null); bodyMap.put("ext_info",extInfoMap); JSONArray infoJSONArray=jsonObject.getJSONArray("paylist"); bodyMap.put("paylist",infoJSONArray); bodyJson = JSONParser.fromObject(bodyMap); //请求接口 BusinessCallResponse response = HttpTools.requestHttp(headJson, bodyJson); if("10000".equals(response.getResult().getCode())){ baseResult=new BaseResult(200, response.getResult().getMsg()+","+response.getResult().getSubMsg(), JSON.parseObject(response.getBody()!=null?response.getBody().toString():null)); }else{ baseResult=new BaseResult(500, response.getResult().getMsg()+","+response.getResult().getSubMsg(), JSON.parseObject(response.getBody()!=null?response.getBody().toString():null)); } } catch (Exception e) { e.printStackTrace(); } System.out.println("结束执行确认订单方法-----------------------------"); return baseResult; } public BaseResult prepay(Object obj,String interfaceId){ System.out.println("开始执行预支付方法-----------------------------"); final JSONObject jsonObject = (JSONObject)JSON.toJSON(obj); BaseResult baseResult=null; String headJson = ""; try { // JSONObject headObject=jsonObject.getJSONObject("headers"); // String interfaceId=headObject.getString("interfaceId"); // JSONObject bodyObject=jsonObject.getJSONObject("body"); headJson=getHeader(interfaceId); HashMap<String, Object> bodyMap = new HashMap<>(); bodyMap.put("request_no", jsonObject.getString("request_no"));//订单号 bodyMap.put("trade_no", jsonObject.getString("trade_no"));//交易订单号 bodyMap.put("pay_type", jsonObject.getString("pay_type")); bodyMap.put("mac_number", jsonObject.getString("mac_number")); bodyMap.put("pay_amount", jsonObject.getString("pay_amount")); bodyMap.put("identity_id", jsonObject.getString("identity_id")); bodyMap.put("name", jsonObject.getString("name")); bodyMap.put("notify_url", jsonObject.getString("notify_url"));//回调地址 HashMap<String, Object> attachParamsMap = new HashMap<>(); attachParamsMap.put("order_id",jsonObject.getString("request_no")); attachParamsMap.put("trade_order_id",jsonObject.getString("trade_no")); bodyMap.put("attach_params", JSONObject.toJSON(attachParamsMap));//穿透字段 HashMap<String, String> bizContentMap = new HashMap<>(); bizContentMap.put("openid",jsonObject.getJSONObject("biz_content").getString("openid")); bizContentMap.put("product_id",jsonObject.getJSONObject("biz_content").getString("product_id")); bizContentMap.put("goods_desc",jsonObject.getJSONObject("biz_content").getString("goods_desc")); bodyMap.put("biz_content", JSONParser.fromObject(bizContentMap)); String bodyJson = JSONParser.fromObject(bodyMap); BusinessCallResponse response = HttpTools.requestPay(headJson, bodyJson); if("10000".equals(response.getResult().getCode())){ JSONObject object=JSONObject.parseObject(response.getBody().toString()); HashMap<String, Object> map = new HashMap<>(); object.put("order_id",jsonObject.getString("request_no")); object.put("trade_order_id",jsonObject.getString("trade_no")); baseResult=new BaseResult(200, response.getResult().getMsg()+","+response.getResult().getSubMsg(), JSON.parseObject(object!=null?object.toString():null)); }else{ baseResult=new BaseResult(500, response.getResult().getMsg()+","+response.getResult().getSubMsg(), JSON.parseObject(response.getBody()!=null?response.getBody().toString():null)); } String sqlCommand="update IT_REGISTER_RECORD set REGISTER_STATUS=? where REGISTER_ID=?"; sqlSrv.setLangId("sc"); sqlSrv.addParameter("1"); sqlSrv.addParameter(jsonObject.getString("request_no")); sqlSrv.execute(sqlCommand); }catch (Exception e) { e.printStackTrace(); return baseResult; } System.out.println("结束执行预支付方法-----------------------------"); return baseResult; } public String getHeader(String interfaceId){ HashMap<String, String> headMap = new HashMap<>(); headMap.put("charset", "utf-8"); headMap.put("encrypt_type", "AES"); headMap.put("enterprise_id", "yqjkzhyy"); headMap.put("language", "zh_CN"); headMap.put("method", interfaceId); headMap.put("timestamp", System.currentTimeMillis() + ""); headMap.put("sign_type", "md5"); headMap.put("sys_track_code", String.valueOf(System.currentTimeMillis())); headMap.put("version", "1.0"); headMap.put("access_token", ""); headMap.put("sign", ""); headMap.put("app_id", "b11a72077d9743369f9812c7cab193e6"); final String headJson = JSONParser.fromObject(headMap); return headJson; } }
[ "892708371@qq.com" ]
892708371@qq.com
9c2e9f3b0b92d82c0a56ee5f7695757796a3d79f
dbe688965d7dc25573ed1706e67a385afe6da30f
/addressbook-web-tests/src/test/java/ru/stqa/ptf2/addressbook/model/AddNewContactData.java
b195d7379d93cd59435c4645d9b235fd5a3cf879
[ "Apache-2.0" ]
permissive
kerenbog/first_repository
99caa65aa95f2b63abd8554eeba88568cc215904
f59fc4d7c6e552baa2b3096849307423f724f955
refs/heads/master
2022-12-27T08:47:00.079785
2020-10-09T20:07:15
2020-10-09T20:07:15
297,047,803
0
0
null
null
null
null
UTF-8
Java
false
false
1,385
java
package ru.stqa.ptf2.addressbook.model; public class AddNewContactData { private final String firstName; private final String middleName; private final String lastName; private final String address; private final String mobile; private final String email; private final int bday; private final int bMonth; private final int bYear; public AddNewContactData(String middleName, String lastName, String address, String mobile, String email, int bday, int bMonth, int bYear, String firstName) { this.firstName = firstName; this.middleName = middleName; this.lastName = lastName; this.address = address; this.mobile = mobile; this.email = email; this.bday = bday; this.bMonth = bMonth; this.bYear = bYear; } public String getFirstName() { return firstName; } public String getMiddleName() { return middleName; } public String getLastName() { return lastName; } public String getAddress() { return address; } public String getMobile() { return mobile; } public String getEmail() { return email; } public int getBday() { return bday; } public int getbMonth() { return bMonth; } public int getbYear() { return bYear; } }
[ "kerenbog@gmail.com" ]
kerenbog@gmail.com
f3fdaed6fadd26b1089e48a46555ec0182b57a0f
343b383406581831341206f1b3feacfa5e7536e6
/src/tableModel/Check.java
28e37b982c2719309b6437eda9b65c90237f2956
[]
no_license
swj1991/jxc_MS
fffaf8f725eb4eb6b967ce6390e342eb122379d5
13fcaf24a7b404a9e537f0f1aebe6912f8d8f2e0
refs/heads/master
2021-01-20T02:34:03.903407
2017-04-26T03:00:18
2017-04-26T03:00:18
89,425,100
0
0
null
null
null
null
UTF-8
Java
false
false
1,306
java
package tableModel; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Check { public static boolean checkItem(String str,String check){ boolean checkup = false; Pattern pattern = Pattern.compile(str); Matcher matcher = pattern.matcher(check); checkup = matcher.matches(); return checkup; } public static boolean checkPhoneNumber(String phonenumber){ String reg = "^[1][\\d]{10}|\\d{4}-\\d{7,8}|\\d{3}-\\d{8}"; return checkItem(reg,phonenumber); } public static boolean checkEmail(String email){ String reg = "\\w+\\@\\w+\\.\\w{2,}"; return checkItem(reg,email); } public static boolean checkPostcode(String postcode){ String reg = "^[1-9]\\d{5}"; return checkItem(reg,postcode); } public static boolean checkIDCard(String idcard){ String reg = "\\d{17}[\\d|X]|\\d{14}[\\d|X]"; return checkItem(reg,idcard); } // public static void main(String[] args) { // if(checkIDCard("420606199109043056")){ // System.out.println("successful"); // }else{ // System.out.println("failed!"); // } // // } }
[ "noreply@github.com" ]
noreply@github.com
69d71fb346f49cf0682b2cef8c80d0671fef3da0
2b5459a71d1332aa7701362a8b28ffeff9166071
/midlevel/src/Demo16PredicatedAnd.java
949d690d564845295e515f912d816f589bc6a6d3
[]
no_license
aloneagy/university-of-birmingham
7973ff0598d33e2f5d048058d34bc8e50f33c956
10076b8afedcda9537022b2f2317c0dff40e3f76
refs/heads/master
2021-01-03T00:34:26.201228
2020-02-12T00:46:12
2020-02-12T00:46:12
239,838,075
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
import java.util.function.Predicate; public class Demo16PredicatedAnd { private static void method(Predicate<String>one,Predicate<String>two){ boolean isValid=one.and(two).test("helloworld"); System.out.println(isValid); } public static void main(String[] args) { method(s->s.contains("h"),s ->s.contains("w")); } }
[ "zhangyongnan@zhangyongnandeMacBook-Pro.local" ]
zhangyongnan@zhangyongnandeMacBook-Pro.local
f46d5cfa9fa7f942a915d55217311379c15a6c17
02163fc96cb4fde1e2477842d76fcf3f558bb51d
/src/ReadNumsByOthers.java
0d0a65e56550f46a04cff19ed5fe7634d8338e2e
[]
no_license
bangmac/JavaIntro
ac28f081bbf279a4618906a01b80e74ef010e867
1ec8de724e765f66d9c99dd8b6c4db160a9a73f2
refs/heads/master
2020-11-28T04:17:59.943458
2019-12-25T01:58:56
2019-12-25T01:58:56
229,701,023
0
0
null
null
null
null
UTF-8
Java
false
false
4,544
java
import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class ReadNumsByOthers { private static String ChuSo[] = new String[]{"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"}; private static String DonVi[] = new String[]{"Hundered", "Billion", "Ten", "Hundred", "Thousand", "Ten", "Hundred", "Million", "Ten"}; public static void main(String[] args) { long so = new Scanner(System.in).nextLong(); long temp = so; String result = ""; ArrayList<Long> numberList = getNumberLetter(so); int count = countNumberLetter(numberList); for (int j = 0; j < numberList.size(); j++) { String CS = ChuSo[Math.toIntExact(numberList.get(j))]; String DV = DonVi[(count - j) % 9]; if (CS == "Zero") { continue; } else if (CS == "One" && DV == "Ten") { long num = numberList.get(j) * 10 + numberList.get(j + 1); j++; result += " " + readNumberBetween10and20(num) + " "; } else if (CS == "Two" && DV == "Ten") { result += "Twenty "; } else if (CS == "Three" && DV == "Ten") { result += "Thirty "; } else if (CS == "Four" && DV == "Ten") { result += "Forty "; } else if (CS == "Five" && DV == "Ten") { result += "Fifty "; } else if (CS == "Six" && DV == "Ten") { result += "Sixty "; } else if (CS == "Seven" && DV == "Ten") { result += "Seventy "; } else if (CS == "Eight" && DV == "Ten") { result += "Eighty "; } else if (CS == "Nine" && DV == "Ten") { result += "Ninety "; } else result += CS + " " + ((j < count - 1) ? DV : "") + " "; } System.out.println(result); } private static ArrayList<Long> getNumberLetter(long num) { ArrayList<Long> numberList = new ArrayList<Long>(); long temp = num; while (temp != 0) { numberList.add(temp % 10); temp /= 10; } Collections.reverse(numberList); return numberList; } private static int countNumberLetter(ArrayList<Long> list) { int size = list.size(); return size; } private static String readNumberBetween10and20(long num) { switch ((int) num) { case 10: return "ten"; case 11: return "eleven"; case 12: return "twelve"; case 13: return "thirteen"; case 14: return "fourteen"; case 15: return "fifteen"; case 16: return "sixteen"; case 17: return "seventeen"; case 18: return "eighteen"; case 19: return "nineteen"; case 20: return "twenty"; } return null; } } //import java.util.ArrayList; //import java.util.Collections; // //public class ReadNumber { // private static String ChuSo[] = new String[]{"Khong", "Mot", "Hai", "Ba", "Bon", "Nam", "Sau", "Bay", "Tam", "Chin"}; // private static String DonVi[] = new String[]{"Tram", "Ty", "Muoi", "Tram", "Nghin", "Muoi", "Tram", "Trieu", "Muoi"}; // // public static void main(String[] args) { // int so = 12; // int temp = so; // String result = ""; // // ArrayList<Integer> numberList = getNumberLetter(so); // // int count = countNumberLetter(numberList); // int i = 0; // // for (int item: // numberList) { // String CS = ChuSo[item]; // String DV = DonVi[(count-i) % 9]; // // if (CS == "Mot" && DV == "Muoi") result += "Muoi "; // else result += CS + " " + ((i < count -1) ? DV : "") + " "; // // i++; // } // // System.out.println(result); // } // // private static ArrayList<Integer> getNumberLetter(int num) { // ArrayList<Integer> numberList = new ArrayList<Integer>(); // int temp = num; // while (temp != 0) { // numberList.add(temp % 10); // temp /= 10; // } // Collections.reverse(numberList); // return numberList; // } // // private static int countNumberLetter(ArrayList<Integer> list) { // int size = list.size(); // return size; // } //}
[ "leeloo1899@gmail.com" ]
leeloo1899@gmail.com
9bdb83e8deb8e09ff9bcc57ff25388cea74b2c87
418e76874cc6f547ca97bacc1184ed3b99aeb7d1
/app/src/main/java/com/jackhang/easydialog/MainActivity.java
5532887698eae7dc5899a6a6c2c9b431950a8032
[ "MIT" ]
permissive
JackHang/EasyDialog
e0024be0a1b0d0d8689cadc080438b14dc3b633e
944cefea139e951bc2bdeaac66cb4a1853d2db37
refs/heads/master
2021-01-16T21:09:47.426921
2017-08-18T02:04:05
2017-08-18T02:04:05
100,218,734
1
1
null
2017-08-14T07:25:26
2017-08-14T02:07:44
Java
UTF-8
Java
false
false
9,850
java
package com.jackhang.easydialog; import android.app.DatePickerDialog; import android.app.TimePickerDialog; import android.content.DialogInterface; import android.os.Bundle; import android.os.Handler; import android.support.v4.app.DialogFragment; import android.support.v7.app.AppCompatActivity; import android.text.InputType; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.DatePicker; import android.widget.EditText; import android.widget.ImageView; import android.widget.TimePicker; import android.widget.Toast; import com.jackhang.lib.EasyDialog; import com.jackhang.lib.IDialogResultListener; import java.util.ArrayList; import java.util.Calendar; public class MainActivity extends AppCompatActivity implements IDialogResultListener { private DialogFragment mDialogFragment; private int THEME = 0; private Calendar calendar = Calendar.getInstance(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button button = (Button) findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (THEME != 0) { THEME = 0; } else { THEME = R.style.Base_AlertDialog; } } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = new MenuInflater(this); inflater.inflate(R.menu.menu_dialog, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.showConfirmDialog: showConfirmDialog(); break; case R.id.showDateDialog: final DatePickerDialog datePickerDialog = new DatePickerDialog(this, THEME, new DatePickerDialog .OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) { Toast.makeText(MainActivity.this, "Time : " + year + "/" + (month + 1) + "/" + dayOfMonth, Toast .LENGTH_SHORT) .show(); } }, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)); datePickerDialog.setTitle("data"); datePickerDialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { datePickerDialog.getButton(DialogInterface.BUTTON_POSITIVE).setText("Yes"); datePickerDialog.getButton(DialogInterface.BUTTON_NEGATIVE).setText("No"); } }); new EasyDialog.Builder(getSupportFragmentManager()) .setCustomDialog(datePickerDialog) .customDialogBuild(); break; case R.id.showInsertDialog: showInsertDialog(); break; case R.id.showIntervalInsertDialog: showIntervalInsertDialog(); break; case R.id.showListDialog: showListDialog(); break; case R.id.showPasswordInsertDialog: showPasswordInsertDialog(); break; case R.id.showProgress: showProgress(); break; case R.id.showTimeDialog: final TimePickerDialog dateDialog = new TimePickerDialog(this, THEME, new TimePickerDialog.OnTimeSetListener() { @Override public void onTimeSet(TimePicker view, int hourOfDay, int minute) { Toast.makeText(MainActivity.this, "Time : " + hourOfDay + ":" + minute, Toast.LENGTH_SHORT).show(); } }, calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), true); dateDialog.setTitle("Time"); dateDialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { dateDialog.getButton(DialogInterface.BUTTON_POSITIVE).setText("Yes"); dateDialog.getButton(DialogInterface.BUTTON_NEGATIVE).setText("No"); } }); new EasyDialog.Builder(getSupportFragmentManager()) .setCustomDialog(dateDialog) .customDialogBuild(); break; case R.id.showTips: showTips(); break; case R.id.customDialog: customDialog(); break; default: break; } return true; } private void showListDialog() { ArrayList<String> strings = new ArrayList<>(); strings.add("Android"); strings.add("Ios"); strings.add("前端"); strings.add("福利"); new EasyDialog.Builder(getSupportFragmentManager()) .setTHEME(THEME) .setCancelable(true) .Items(strings) .setNegative("No") .setPositive("Yes") .setListener(this) .setTitle("Tips") .alterListBuild(); } private void customDialog() { EasyDialog.Builder builder = new EasyDialog.Builder(getSupportFragmentManager()) .setTHEME(THEME) .setCancelable(true) .setContentView(this, R.layout.image); ImageView view = builder.getView(R.id.image); view.setImageResource(R.mipmap.ic_launcher); view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(MainActivity.this, "Click Image", Toast.LENGTH_SHORT).show(); } }); builder.customBuild(); } private void showTips() { new EasyDialog.Builder(getSupportFragmentManager()) .setTHEME(THEME) .setCancelable(true) .setMessage("你进入了无网的异次元中") .setTitle("Tips") .alterBuild(); } private void showProgress() { mDialogFragment = new EasyDialog.Builder(getSupportFragmentManager()) .setTHEME(THEME) .setDialogBackground(R.drawable.loading_dialog_corner) .setMessage("正在加载中") .setTitle("Test") .setCancelable(true) .progressBuild(); Handler handler = new Handler(); Runnable runnable = new Runnable() { @Override public void run() { mDialogFragment.dismiss(); } }; handler.postDelayed(runnable, 5000); } private void showPasswordInsertDialog() { final EditText passwordEdit = new EditText(this); passwordEdit.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); passwordEdit.setEnabled(true); new EasyDialog.Builder(getSupportFragmentManager()) .setContentView(passwordEdit) .setTHEME(THEME) .setNegative("No") .setPositive("Yes") .setListener(new IDialogResultListener() { @Override public void onDataResult(int which) { switch (which) { case DialogInterface.BUTTON_NEGATIVE: Toast.makeText(MainActivity.this, "click NEGATIVE", Toast.LENGTH_SHORT).show(); break; case DialogInterface.BUTTON_POSITIVE: Toast.makeText(MainActivity.this, passwordEdit.getText().toString(), Toast.LENGTH_SHORT) .show(); break; default: break; } } @Override public void onDataResult(String what) { } }) .alterCustomBuild(); } private void showIntervalInsertDialog() { EasyDialog.Builder insertBuilder = new EasyDialog.Builder(getSupportFragmentManager()) .setTHEME(THEME) .setCancelable(true) .setContentView(this, R.layout.dialog_interval_insert); final EditText minEditText = insertBuilder.getView(R.id.interval_insert_et_min); final EditText maxEditText = insertBuilder.getView(R.id.interval_insert_et_max); insertBuilder.setNegative("No") .setPositive("Yes") .setListener(new IDialogResultListener() { @Override public void onDataResult(int which) { switch (which) { case DialogInterface.BUTTON_NEGATIVE: Toast.makeText(MainActivity.this, "click NEGATIVE", Toast.LENGTH_SHORT).show(); break; case DialogInterface.BUTTON_POSITIVE: Toast.makeText(MainActivity.this, minEditText.getText().toString() + " ~ " + maxEditText.getText().toString(), Toast.LENGTH_SHORT) .show(); break; default: break; } } @Override public void onDataResult(String what) { } }) .alterCustomBuild(); } private void showInsertDialog() { final EditText editText = new EditText(this); editText.setBackground(null); editText.setPadding(60, 40, 0, 0); new EasyDialog.Builder(getSupportFragmentManager()) .setContentView(editText) .setTHEME(THEME) .setNegative("No") .setPositive("Yes") .setListener(new IDialogResultListener() { @Override public void onDataResult(int which) { switch (which) { case DialogInterface.BUTTON_NEGATIVE: Toast.makeText(MainActivity.this, "click NEGATIVE", Toast.LENGTH_SHORT).show(); break; case DialogInterface.BUTTON_POSITIVE: Toast.makeText(MainActivity.this, editText.getText().toString(), Toast.LENGTH_SHORT) .show(); break; default: break; } } @Override public void onDataResult(String what) { } }) .alterCustomBuild(); } private void showConfirmDialog() { new EasyDialog.Builder(getSupportFragmentManager()) .setTHEME(THEME) .setMessage("ConfirmDialog") .setNegative("No") .setPositive("Yes") .setNeutral("Neutral") .setListener(this) .alterBuild(); } @Override public void onDataResult(int which) { switch (which) { case DialogInterface.BUTTON_NEGATIVE: Toast.makeText(MainActivity.this, "click NEGATIVE", Toast.LENGTH_SHORT).show(); break; case DialogInterface.BUTTON_POSITIVE: Toast.makeText(MainActivity.this, "click POSITIVE", Toast.LENGTH_SHORT).show(); break; case DialogInterface.BUTTON_NEUTRAL: Toast.makeText(MainActivity.this, "click NEUTRAL", Toast.LENGTH_SHORT).show(); break; default: break; } } @Override public void onDataResult(String what) { Toast.makeText(MainActivity.this, "click " + what, Toast.LENGTH_SHORT).show(); } }
[ "449359690@qq.com" ]
449359690@qq.com
246535ce2a6c20d87580f060d5739f46f801b96f
8a93b91576272df5205f36904cf6ee2b59af267c
/src/main/java/io/github/jhipster/application/config/AsyncConfiguration.java
ca1f8a0afc69cc9057fdacfc884eb914977827d0
[]
no_license
maashwaq/jhipsterOAuth2MicroserviceApplication
d9525d3d4f0dc55f395228560a243fc5b5a4466d
d0dbe4a113095bbea7ee4488b3ad19783466cb3a
refs/heads/master
2021-01-20T08:34:04.333470
2017-08-27T16:10:52
2017-08-27T16:10:52
101,564,272
0
0
null
null
null
null
UTF-8
Java
false
false
1,824
java
package io.github.jhipster.application.config; import io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor; import io.github.jhipster.config.JHipsterProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.*; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import java.util.concurrent.Executor; @Configuration @EnableAsync @EnableScheduling public class AsyncConfiguration implements AsyncConfigurer { private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class); private final JHipsterProperties jHipsterProperties; public AsyncConfiguration(JHipsterProperties jHipsterProperties) { this.jHipsterProperties = jHipsterProperties; } @Override @Bean(name = "taskExecutor") public Executor getAsyncExecutor() { log.debug("Creating Async Task Executor"); ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize()); executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize()); executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity()); executor.setThreadNamePrefix("jhipster-o-auth-2-microservice-application-Executor-"); return new ExceptionHandlingAsyncTaskExecutor(executor); } @Override public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { return new SimpleAsyncUncaughtExceptionHandler(); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
f8c550698aa245628c799dda6855c316016b5200
660c0ad4384070d45de80ff68d592834d5ab1840
/app/src/main/java/com/example/wheatherapp/Model/Coord.java
d090493fba081b623b94307e278553918c974407
[]
no_license
JonatanLifshits/WheatherApp
e348c30c2d092ef13b9f2b576bceef2c9c3894f9
f49cbb8e6a5ec0729413499eecec5ac4b269755c
refs/heads/master
2020-03-21T11:00:08.921312
2018-06-24T13:17:54
2018-06-24T13:17:54
138,483,395
0
0
null
null
null
null
UTF-8
Java
false
false
457
java
package com.example.wheatherapp.Model; public class Coord { private double lat; private double lon; public Coord(double lat, double lon) { this.lat = lat; this.lon = lon; } public double getLat() { return lat; } public void setLat(double lat) { this.lat = lat; } public double getLon() { return lon; } public void setLon(double lon) { this.lon = lon; } }
[ "djonli@mail.ua" ]
djonli@mail.ua
fa4e165370dd791de54a4b864b9696c3d83aea6f
afb1090c56825be2972cb6c428f4578505bd764a
/ADAPTER_Structural_Examples/Adapter_Bank example/ClientClass.java
376bc690938b4655db6d0f47cae0265158d764e7
[]
no_license
jbakolas/Design_Patterns
da2ea1e7646ae11834e60196f88dd5e32a23b263
0ddf7bf26494046cef2be1125e48e6b4ed0c4cb8
refs/heads/master
2021-01-18T23:54:56.855598
2016-07-31T18:35:11
2016-07-31T18:35:11
54,268,073
0
0
null
null
null
null
UTF-8
Java
false
false
1,002
java
package Structural_Adapter_BankCase; import java.util.Scanner; /** * Created by bakgi on 3/23/2016. */ public class ClientClass { public static void main(String []args){ //1st way of implementation f client StandardAccount sa = new StandardAccount(2000); System.out.println(sa.toString()); PlatinumAccount pa = new PlatinumAccount(2000); System.out.println(pa.toString()); //Calling getBalance() on Adapter AccountAdapter adapter = new AccountAdapter(new OffshoreAccount(2000)); System.out.println(adapter.toString()); //2nd way of client implementation /* AbstractAccount sa = new StandardAccount(2000); AbstractAccount adapter = new AccountAdapter(new OffshoreAccount(2000)); printBalance(sa); printBalance(adapter);*/ } /* public static void printBalance(AbstractAccount abstractAccount){ System.out.println("Acount Balance = "+ abstractAccount.getBalance()); }*/ }
[ "jbakolas@gmail.com" ]
jbakolas@gmail.com
0973cf6bbb5f3a9093810c7f7ccf1f55112c8dd8
72dd36dfa4d8d0c5a74d64bb2ec7f336330218a6
/AL_WORKINGSET_2016/com/guille/al/labs/lab_5/TimeCalculator.java
a57fea5a409f271127bfda311d75f6837dddbe6a
[]
no_license
thewillyhuman/uniovi.al
6feb8134026496193cb10b1887cf3d0546084a8c
b63b37a926e522cebc19e8d2ac6baa82b3d00362
refs/heads/master
2021-06-06T14:08:04.085821
2016-09-14T09:26:48
2016-09-14T09:26:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,143
java
package com.guille.al.labs.lab_5; import java.io.IOException; import java.util.ArrayList; import java.util.List; import com.guille.al.labs.lab_3.QuicksortCentralElement; import com.guille.al.labs.lab_3.Vector; import com.guille.util.FilesImproved; public class TimeCalculator { final static int BUBBLE_FACTOR = 10000; final static int SELECTION_FACTOR = 10000; final static int INSERTION_FACTOR = 10000; final static int QUICK_FACTOR = 10000; static final String PATH = "com/guille/al/files/out/"; static final String[] FILE_NAMES = {"Quicksort_times", "QuickSortParallel_times" }; // 4 static final int[] FACTORS = {QUICK_FACTOR, QUICK_FACTOR }; // 4 static List<StringBuilder> files = new ArrayList<StringBuilder>(); static final String COLUM_SEPARATOR = ","; static final int TOTALN = 200; public static void main(String[] args) throws IOException { int[] auxV = null; /** * SECURITY CHECK */ if(FILE_NAMES.length != FACTORS.length) { System.err.println("ERROR: The file names and the factors programed must have the same lenght."); System.exit(-1); } long t1, t2, totalSorted = 0, totalInvSorted = 0, totalRand = 0; String columNames = "N SIZE" + COLUM_SEPARATOR + "SORTED TIME" + COLUM_SEPARATOR + "INV. SRT. TIME" + COLUM_SEPARATOR + "RANDOM" + "\n"; /** * BUILDING THE FILES */ for(int i = 0; i < FILE_NAMES.length; i++) { StringBuilder aux = new StringBuilder(); aux.append(columNames); files.add(aux); } for (int n = 10; n <= TOTALN; n += 1) { auxV = new int[n]; /* HERE STARTS THE QUICKSORT TIMES MEASURING*/ for (int repeticion = 0; repeticion <= QUICK_FACTOR; repeticion++) { int[] v = Vector.sorted(auxV); t1 = System.currentTimeMillis(); QuicksortCentralElement.quicksort(v); t2 = System.currentTimeMillis(); totalSorted += (t2 - t1); } for (int repeticion = 0; repeticion <= QUICK_FACTOR; repeticion++) { int[] v = Vector.inverselySorted(auxV); t1 = System.currentTimeMillis(); QuicksortCentralElement.quicksort(v); t2 = System.currentTimeMillis(); totalInvSorted += (t2 - t1); } for (int repeticion = 0; repeticion <= QUICK_FACTOR; repeticion++) { int[] v = Vector.random(auxV, Vector.MAX_RAND); t1 = System.currentTimeMillis(); QuicksortCentralElement.quicksort(v); t2 = System.currentTimeMillis(); totalRand += (t2 - t1); } files.get(0).append(n+ COLUM_SEPARATOR + ((float)totalSorted/QUICK_FACTOR) + COLUM_SEPARATOR + ((float)totalInvSorted/QUICK_FACTOR) + COLUM_SEPARATOR + ((float)totalRand/QUICK_FACTOR) + "\n"); /* HERE STARTS THE QUICKSORT PARALLEL TIMES MEASURING*/ for (int repeticion = 0; repeticion <= QUICK_FACTOR; repeticion++) { int[] v = Vector.sorted(auxV); t1 = System.currentTimeMillis(); QuicksortCentralElementParallel.quicksortParallel(v); t2 = System.currentTimeMillis(); totalSorted += (t2 - t1); } for (int repeticion = 0; repeticion <= QUICK_FACTOR; repeticion++) { int[] v = Vector.inverselySorted(auxV); t1 = System.currentTimeMillis(); QuicksortCentralElementParallel.quicksortParallel(v); t2 = System.currentTimeMillis(); totalInvSorted += (t2 - t1); } for (int repeticion = 0; repeticion <= QUICK_FACTOR; repeticion++) { int[] v = Vector.random(auxV, Vector.MAX_RAND); t1 = System.currentTimeMillis(); QuicksortCentralElementParallel.quicksortParallel(v); t2 = System.currentTimeMillis(); totalRand += (t2 - t1); } files.get(1).append(n+ COLUM_SEPARATOR + ((float)totalSorted/QUICK_FACTOR) + COLUM_SEPARATOR + ((float)totalInvSorted/QUICK_FACTOR) + COLUM_SEPARATOR + ((float)totalRand/QUICK_FACTOR) + "\n"); System.out.println((((float)n/TOTALN) * 100)+ "% COMPLETED..."); } for(int i = 0; i < files.size(); i++) { FilesImproved.writeFileFromString(PATH, FILE_NAMES[i], files.get(i).toString(), ".csv", FilesImproved.UTF_8); } System.out.println("*** ALL FINISHED ***"); } }
[ "colunga91@gmail.com" ]
colunga91@gmail.com
fc9f017d2e4a5fa42d0bf37378a541f6e1e78fe4
350f6b6906e7f596677b4fa437469e7b7df6e733
/Microservice_hr-oauth/src/main/java/com/alvesjefs/hroauth/MicroserviceHrOauthApplication.java
b703a0024ad997d76666bd6dd67e364b94fdc78b
[]
no_license
jefsAlves/http-microservices
44f22f41359f5eeae8364263b10bbe6ff9942d35
e46fb29d3ded06aaa141708b07ac02257aab4947
refs/heads/main
2023-02-08T21:21:47.181121
2020-12-30T19:30:54
2020-12-30T19:30:54
322,365,152
0
0
null
null
null
null
UTF-8
Java
false
false
511
java
package com.alvesjefs.hroauth; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.openfeign.EnableFeignClients; @EnableFeignClients @EnableEurekaClient @SpringBootApplication public class MicroserviceHrOauthApplication { public static void main(String[] args) { SpringApplication.run(MicroserviceHrOauthApplication.class, args); } }
[ "jeffersonalmeida16@outlook.com" ]
jeffersonalmeida16@outlook.com
39520e9d10a9012b520415a78d8785ea4e3123d7
cd8cdc26652c7594b356be9477b7c106837de616
/src/main/java/com/base/plantform/dao/PinBoardDao.java
3206dac921f3e901ce573ab5f8ee5da915f0fd31
[]
no_license
l635184372/BasePlantForm
d570634840dfbb88203771607c33b6af12ce7e26
6f42334eee93ec63cc34c0de770d9b53d040358c
refs/heads/master
2021-01-19T21:21:16.116892
2017-03-17T08:27:09
2017-03-17T08:27:09
82,503,123
0
1
null
null
null
null
UTF-8
Java
false
false
582
java
package com.base.plantform.dao; import com.base.plantform.entity.PinBoard; import org.springframework.stereotype.Repository; import java.util.List; /** * Created by Administrator on 2017/3/1. */ @Repository public interface PinBoardDao { /** * 获取标签墙列表 * @return */ List<PinBoard> findPinBoardList(); /** * 新建标签 * @param pinBoard * @return */ int savePinBoard(PinBoard pinBoard); /** * 删除标签 * @param pinBoardId * @return */ int deletePinBoard(String pinBoardId); }
[ "lwma6148135@126.com" ]
lwma6148135@126.com
22cd4f75f9d52bf3a55be238237ba4a45083fdbd
cc8d7dca07be632646c0d5edcc318ef74958c8ff
/src/AI.java
d154ebf07fd1ede61130619888d02d3d4af71502
[]
no_license
mgyarmathy/team31-fanorona
702f48dda7530b6c0b1a1b688af01b7d37c01583
203107b2758902ebae7c7dbebe7b6ad3e77dc1f4
refs/heads/master
2016-08-09T19:41:17.303566
2013-04-03T01:28:26
2013-04-03T01:31:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
21,857
java
import javax.swing.*; import java.awt.*; import java.util.*; public class AI{ public Tree<AIBoard> tree; public GamePanel.Piece color; public AI(GamePanel.Piece[][] board, GamePanel.Piece col){ AIBoard rootB = new AIBoard(board); tree = new Tree<AIBoard>(rootB); color = col; } public void create(GamePanel.Piece mColor, Tree<AIBoard>.Node<AIBoard> t){ AIBoard base = t.getData(); GamePanel.Piece[][] baseBoard = copyBoard(base.getBoard()); ArrayList<AIBoard> moves = new ArrayList<AIBoard>(); ArrayList<Point> places = new ArrayList<Point>(); for(int i = 0; i < baseBoard.length; i++){ for (int j = 0; j < baseBoard[0].length; j++){ if(baseBoard[i][j] == mColor){ findMoves(j,i,mColor,base,moves,places); } } } for(int k = 0; k < moves.size(); k++){ t.add(moves.get(k)); findMoves(places.get(k).x,places.get(k).y,mColor,moves.get(k),moves,places); } } public AIBoard getMove(){ create(color, tree.getRoot()); int index = -1; int i = 0; int value = 1000; if(color == GamePanel.Piece.PLAYER) value = -1000; for(; i < tree.getRoot().getChildren().size(); i++){ AIBoard base = tree.getRoot().getChildren().get(i).getData(); if(color == GamePanel.Piece.OPPONENT){ if(base.rank < value){ value = base.rank; index = i; } } else { if(base.rank > value){ value = base.rank; index = i; } } } if(index == -1){ index = 0; tree.erase(); ArrayList<AIBoard> boards = makeEmpty(color); //add empty moves for(int z = 0; z < boards.size(); z++){ tree.getRoot().add(boards.get(z)); } } Random ran = new Random(); int ranCase = ran.nextInt(); GamePanel.Piece color2 = GamePanel.Piece.PLAYER; int negarank = 1000; if(color == GamePanel.Piece.PLAYER){ color2 = GamePanel.Piece.OPPONENT; negarank = -1000; } for(int y = 0; y < tree.getRoot().getChildren().size(); y++){ create(color2, tree.getRoot().getChildren().get(y)); //add opponent moves if(tree.getRoot().getChildren().get(y).getChildren().size() == 0){ ArrayList<AIBoard> opponentEmpty = makeEmpty(color2); for(int q = 0; q < opponentEmpty.size(); q++){ tree.getRoot().getChildren().get(y).add(opponentEmpty.get(q)); } } } int worstCase = 1000; int bestCase = 1000; int oppBest = -1000; if(color == GamePanel.Piece.PLAYER){ worstCase = -1000; bestCase = -1000; oppBest = 1000; } for(i = 0; i < tree.getRoot().getChildren().size(); i++){ //for every move if(tree.getRoot().getChildren().get(i) != null){ if (color == GamePanel.Piece.OPPONENT){ oppBest = -1000; } else { oppBest = 1000; } for (int e = 0; e < tree.getRoot().getChildren().get(i).getChildren().size(); e++){ //for every opponent response Tree<AIBoard>.Node<AIBoard> base2 = tree.getRoot().getChildren().get(i).getChildren().get(e); boolean proceed = false; if(color == GamePanel.Piece.OPPONENT){ if(base2.getData().rank >= oppBest){ oppBest = base2.getData().rank; proceed = true; } } else { if(base2.getData().rank <= oppBest){ oppBest = base2.getData().rank; proceed = true; } } if(proceed){ create(color, base2); if(base2.getChildren().size() == 0){ ArrayList<AIBoard> futureEmpty = makeEmpty(color); for(int w = 0; w < futureEmpty.size(); w++){ base2.add(futureEmpty.get(w)); } } if(color == GamePanel.Piece.PLAYER){ worstCase = 1000; } else { worstCase = -1000; } if(color == GamePanel.Piece.OPPONENT){ for(int s = 0; s < base2.getChildren().size(); s++){ //for every future move if(base2.getChildren().get(s).getData().rank > worstCase){ worstCase = base2.getChildren().get(s).getData().rank; } } }else { for(int s = 0; s < base2.getChildren().size(); s++){ //for every future move if(base2.getChildren().get(s).getData().rank < worstCase){ worstCase = base2.getChildren().get(s).getData().rank; } } } if(color == GamePanel.Piece.OPPONENT){ if(worstCase < bestCase){ bestCase = worstCase; index = i; } else if (worstCase == bestCase){ if(ran.nextInt() > ranCase){ ranCase = ran.nextInt(); index = i; } } } else { if(worstCase > bestCase){ bestCase = worstCase; index = i; } else if (worstCase == bestCase){ if(ran.nextInt() > ranCase){ ranCase = ran.nextInt(); index = i; } } } } } } } for(int x = 0; x < tree.getRoot().getChildren().get(index).getData().messages.size(); x++){ GamePanel.info.write(tree.getRoot().getChildren().get(index).getData().messages.get(x)); } return tree.getRoot().getChildren().get(index).getData(); } public ArrayList<AIBoard> makeEmpty(GamePanel.Piece mColor){ ArrayList<AIBoard> retList = new ArrayList<AIBoard>(); GamePanel.Piece[][] base = copyBoard(tree.getRoot().getData().getBoard()); for (int i = 0; i < base.length; i++){ for (int j = 0; j < base[0].length; j++){ if(base[i][j] == mColor){ ArrayList<Point> p = findSpace(j,i,base); for(int k = 0; k < p.size(); k++){ GamePanel.Piece[][] base2 = copyBoard(base); GamePanel.Direction dir = GamePanel.Direction.DUMMY; if(p.get(k).x - j == -1){ switch(p.get(k).y - i){ case -1: dir = GamePanel.Direction.UPLEFT; break; case 0: dir = GamePanel.Direction.LEFT; break; case 1: dir = GamePanel.Direction.DOWNLEFT; break; default: break; } } else if (p.get(k).x - j == 0){ switch(p.get(k).y - i){ case -1: dir = GamePanel.Direction.UP; break; case 0: dir = GamePanel.Direction.NEUTRAL; break; case 1: dir = GamePanel.Direction.DOWN; break; default: break; } } else if (p.get(k).x - j == 1){ switch(p.get(k).y - i){ case -1: dir = GamePanel.Direction.UPRIGHT; break; case 0: dir = GamePanel.Direction.RIGHT; break; case 1: dir = GamePanel.Direction.DOWNRIGHT; break; default: break; } } AIBoard curBoard = new AIBoard(base2); curBoard.makeMove(dir, new Point(j,i),mColor,true); retList.add(curBoard); } } } } return retList; } public ArrayList<Point> findSpace(int x, int y, GamePanel.Piece[][] board){ ArrayList<Point> retList = new ArrayList<Point>(); boolean UL = false; boolean U = false; boolean UR = false; boolean L = false; boolean R = false; boolean DL = false; boolean D = false; boolean DR = false; if ((y+x)%2 == GamePanel.Diag){ if(y > 0 && x > 0) UL = true; if(y > 0 && x < GamePanel.COLS - 1) UR = true; if(y < GamePanel.ROWS - 1 && x > 0) DL = true; if(y < GamePanel.ROWS - 1 && x < GamePanel.COLS - 1) DR = true; } if(y > 0) U = true; if(x > 0) L = true; if(x < GamePanel.COLS - 1) R = true; if(y < GamePanel.ROWS - 1) D = true; if(UL){ if (board[y-1][x-1] == GamePanel.Piece.EMPTY){ retList.add(new Point(x-1,y-1)); } } if(U){ if (board[y-1][x] == GamePanel.Piece.EMPTY){ retList.add(new Point(x,y-1)); } } if(UR){ if (board[y-1][x+1] == GamePanel.Piece.EMPTY){ retList.add(new Point(x+1,y-1)); } } if(L){ if (board[y][x-1] == GamePanel.Piece.EMPTY){ retList.add(new Point(x-1,y)); } } if(R){ if (board[y][x+1] == GamePanel.Piece.EMPTY){ retList.add(new Point(x+1,y)); } } if(DL){ if (board[y+1][x-1] == GamePanel.Piece.EMPTY){ retList.add(new Point(x-1,y+1)); } } if(D){ if (board[y+1][x] == GamePanel.Piece.EMPTY){ retList.add(new Point(x,y+1)); } } if(DR){ if (board[y+1][x+1] == GamePanel.Piece.EMPTY){ retList.add(new Point(x+1,y+1)); } } return retList; } public void findMoves(int x, int y, GamePanel.Piece myColor, AIBoard base, ArrayList<AIBoard> moves, ArrayList<Point> places){ AIBoard base2 = copyAI(base); GamePanel.Piece[][] baseBoard = base2.getBoard(); GamePanel.Direction dir = base2.prevDir; GamePanel.Piece color2 = myColor; if(myColor == GamePanel.Piece.PLAYER){ color2 = GamePanel.Piece.OPPONENT; } else { color2 = GamePanel.Piece.PLAYER; } boolean ULafter = false; boolean ULbefore = false; boolean Uafter = false; boolean Ubefore = false; boolean URafter = false; boolean URbefore = false; boolean Lafter = false; boolean Lbefore = false; boolean Rafter = false; boolean Rbefore = false; boolean DLafter = false; boolean DLbefore = false; boolean Dafter = false; boolean Dbefore = false; boolean DRafter = false; boolean DRbefore = false; //Determine which directions to take into account, based on position if ((y+x)%2 == GamePanel.Diag){ if(y > 1 && x > 1) ULafter = true; if(y > 0 && x > 0 && y < GamePanel.ROWS - 1 && x < GamePanel.COLS - 1) ULbefore = true; if(y > 1 && x < GamePanel.COLS - 2) URafter = true; if(y > 0 && x < GamePanel.COLS - 1 && y < GamePanel.ROWS - 1 && x > 0) URbefore = true; if(y < GamePanel.ROWS - 2 && x > 1) DLafter = true; if(y < GamePanel.ROWS - 1 && x > 0 && y > 0 && x < GamePanel.COLS - 1) DLbefore = true; if(y < GamePanel.ROWS - 2 && x < GamePanel.COLS - 2) DRafter = true; if(y < GamePanel.ROWS - 1 && x < GamePanel.COLS - 1 && y > 0 && x > 0) DRbefore = true; } if(y > 1) Uafter = true; if(y > 0 && y < GamePanel.ROWS - 1) Ubefore = true; if(x > 1) Lafter = true; if(x > 0 && x < GamePanel.COLS - 1) Lbefore = true; if(x < GamePanel.COLS - 2) Rafter = true; if(x < GamePanel.COLS - 1 && x > 0) Rbefore = true; if(y < GamePanel.ROWS - 2) Dafter = true; if(y < GamePanel.ROWS - 1 && y > 0) Dbefore = true; //For each direction, test if the next piece is empty, if the appropriate //piece is the opponent color, if the direction from the last move was //not the same as this move, and if this space has been traveled to during //the current chain. if(ULafter){ boolean valid = true; if(baseBoard[y-1][x-1] == GamePanel.Piece.EMPTY){ if(baseBoard[y-2][x-2] == color2){ if (dir != GamePanel.Direction.UPLEFT){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y-1){ if(base2.chained_spots.get(i).x == x-1){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.UPLEFT, new Point(x,y), myColor, true); moves.add(newbase); places.add(newP); } } } } } if(ULbefore){ boolean valid = true; if(baseBoard[y-1][x-1] == GamePanel.Piece.EMPTY){ if(baseBoard[y+1][x+1] == color2){ if (dir != GamePanel.Direction.UPLEFT){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y-1){ if(base2.chained_spots.get(i).x == x-1){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.UPLEFT, new Point(x,y), myColor, false); moves.add(newbase); places.add(newP); } } } } } if(Uafter){ boolean valid = true; if(baseBoard[y-1][x] == GamePanel.Piece.EMPTY){ if(baseBoard[y-2][x] == color2){ if (dir != GamePanel.Direction.UP){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y-1){ if(base2.chained_spots.get(i).x == x){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.UP, new Point(x,y), myColor, true); moves.add(newbase); places.add(newP); } } } } } if(Ubefore){ boolean valid = true; if(baseBoard[y-1][x] == GamePanel.Piece.EMPTY){ if(baseBoard[y+1][x] == color2){ if (dir != GamePanel.Direction.UP){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y-1){ if(base2.chained_spots.get(i).x == x){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.UP, new Point(x,y), myColor, false); moves.add(newbase); places.add(newP); } } } } } if(URafter){ boolean valid = true; if(baseBoard[y-1][x+1] == GamePanel.Piece.EMPTY){ if(baseBoard[y-2][x+2] == color2){ if (dir != GamePanel.Direction.UPRIGHT){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y-1){ if(base2.chained_spots.get(i).x == x+1){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.UPRIGHT, new Point(x,y), myColor, true); moves.add(newbase); places.add(newP); } } } } } if(URbefore){ boolean valid = true; if(baseBoard[y-1][x+1] == GamePanel.Piece.EMPTY){ if(baseBoard[y+1][x-1] == color2){ if (dir != GamePanel.Direction.UPRIGHT){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y-1){ if(base2.chained_spots.get(i).x == x+1){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.UPRIGHT, new Point(x,y), myColor, false); moves.add(newbase); places.add(newP); } } } } } if(Lafter){ boolean valid = true; if(baseBoard[y][x-1] == GamePanel.Piece.EMPTY){ if(baseBoard[y][x-2] == color2){ if (dir != GamePanel.Direction.LEFT){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y){ if(base2.chained_spots.get(i).x == x-1){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.LEFT, new Point(x,y), myColor, true); moves.add(newbase); places.add(newP); } } } } } if(Lbefore){ boolean valid = true; if(baseBoard[y][x-1] == GamePanel.Piece.EMPTY){ if(baseBoard[y][x+1] == color2){ if (dir != GamePanel.Direction.LEFT){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y){ if(base2.chained_spots.get(i).x == x-1){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.LEFT, new Point(x,y), myColor, false); moves.add(newbase); places.add(newP); } } } } } if(Rafter){ boolean valid = true; if(baseBoard[y][x+1] == GamePanel.Piece.EMPTY){ if(baseBoard[y][x+2] == color2){ if (dir != GamePanel.Direction.RIGHT){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y){ if(base2.chained_spots.get(i).x == x+1){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.RIGHT, new Point(x,y), myColor, true); moves.add(newbase); places.add(newP); } } } } } if(Rbefore){ boolean valid = true; if(baseBoard[y][x+1] == GamePanel.Piece.EMPTY){ if(baseBoard[y][x-1] == color2){ if (dir != GamePanel.Direction.RIGHT){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y){ if(base2.chained_spots.get(i).x == x+1){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.RIGHT, new Point(x,y), myColor, false); moves.add(newbase); places.add(newP); } } } } } if(DLafter){ boolean valid = true; if(baseBoard[y+1][x-1] == GamePanel.Piece.EMPTY){ if(baseBoard[y+2][x-2] == color2){ if (dir != GamePanel.Direction.DOWNLEFT){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y+1){ if(base2.chained_spots.get(i).x == x-1){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.DOWNLEFT, new Point(x,y), myColor, true); moves.add(newbase); places.add(newP); } } } } } if(DLbefore){ boolean valid = true; if(baseBoard[y+1][x-1] == GamePanel.Piece.EMPTY){ if(baseBoard[y-1][x+1] == color2){ if (dir != GamePanel.Direction.DOWNLEFT){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y+1){ if(base2.chained_spots.get(i).x == x-1){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.DOWNLEFT, new Point(x,y), myColor, false); moves.add(newbase); places.add(newP); } } } } } if(Dafter){ boolean valid = true; if(baseBoard[y+1][x] == GamePanel.Piece.EMPTY){ if(baseBoard[y+2][x] == color2){ if (dir != GamePanel.Direction.DOWN){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y+1){ if(base2.chained_spots.get(i).x == x){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.DOWN, new Point(x,y), myColor, true); moves.add(newbase); places.add(newP); } } } } } if(Dbefore){ boolean valid = true; if(baseBoard[y+1][x] == GamePanel.Piece.EMPTY){ if(baseBoard[y-1][x] == color2){ if (dir != GamePanel.Direction.DOWN){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y+1){ if(base2.chained_spots.get(i).x == x){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.DOWN, new Point(x,y), myColor, false); moves.add(newbase); places.add(newP); } } } } } if(DRafter){ boolean valid = true; if(baseBoard[y+1][x+1] == GamePanel.Piece.EMPTY){ if(baseBoard[y+2][x+2] == color2){ if (dir != GamePanel.Direction.DOWNRIGHT){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y+1){ if(base2.chained_spots.get(i).x == x+1){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.DOWNRIGHT, new Point(x,y), myColor, true); moves.add(newbase); places.add(newP); } } } } } if(DRbefore){ boolean valid = true; if(baseBoard[y+1][x+1] == GamePanel.Piece.EMPTY){ if(baseBoard[y-1][x-1] == color2){ if (dir != GamePanel.Direction.DOWNRIGHT){ for (int i = 0; i < base2.chained_spots.size(); i++){ if(base2.chained_spots.get(i).y == y+1){ if(base2.chained_spots.get(i).x == x+1){ valid = false; } } } if(valid) { AIBoard newbase = copyAI(base2); Point newP = newbase.makeMove(GamePanel.Direction.DOWNRIGHT, new Point(x,y), myColor, false); moves.add(newbase); places.add(newP); } } } } } return; } public GamePanel.Piece[][] copyBoard(GamePanel.Piece[][] base){ GamePanel.Piece[][] board = new GamePanel.Piece[base.length][base[0].length]; for(int i = 0; i < base.length; i++){ for (int j = 0; j < base[0].length; j++){ if(base[i][j] == GamePanel.Piece.EMPTY){ board[i][j] = GamePanel.Piece.EMPTY; } else if(base[i][j] == GamePanel.Piece.PLAYER){ board[i][j] = GamePanel.Piece.PLAYER; } else if(base[i][j] == GamePanel.Piece.OPPONENT){ board[i][j] = GamePanel.Piece.OPPONENT; } else { board[i][j] = GamePanel.Piece.SACRIFICE; } } } return board; } public AIBoard copyAI(AIBoard base){ AIBoard base2 = new AIBoard(copyBoard(base.getBoard())); base2.messages = new ArrayList<String>(base.messages); base2.moves = new ArrayList<GamePanel.Type>(base.moves); switch(base.prevDir){ case UPLEFT: base2.prevDir = GamePanel.Direction.UPLEFT; break; case UP: base2.prevDir = GamePanel.Direction.UP; break; case UPRIGHT: base2.prevDir = GamePanel.Direction.UPRIGHT; break; case LEFT: base2.prevDir = GamePanel.Direction.LEFT; break; case RIGHT: base2.prevDir = GamePanel.Direction.RIGHT; break; case DOWNLEFT: base2.prevDir = GamePanel.Direction.DOWNLEFT; break; case DOWN: base2.prevDir = GamePanel.Direction.DOWN; break; case DOWNRIGHT: base2.prevDir = GamePanel.Direction.DOWNRIGHT; break; default: break; } base2.chained_spots = new ArrayList<Point>(base.chained_spots); return base2; } }
[ "metace13@tamu.edu" ]
metace13@tamu.edu
0628e523bda147c67b9544030b8de7e7cb599c91
6a1ac9439c6c02f0e406b124a8534a241e36f54f
/dongyimai_search_interface/src/main/java/com/offcn/search/service/ItemSearchService.java
fb106034fd6c90e1a0744bcdd3c769e33197c746
[]
no_license
zzh11Coureage/dongyimai-parent
99e3e8069bf927fbf644c51ab17d8ed8ccf53f88
49b82f42200157cae9baa778e100fe4761c29fcc
refs/heads/master
2023-01-12T00:12:57.561869
2020-11-10T12:05:04
2020-11-10T12:05:04
311,645,627
0
0
null
null
null
null
UTF-8
Java
false
false
353
java
package com.offcn.search.service; import com.offcn.pojo.TbItem; import java.util.List; import java.util.Map; public interface ItemSearchService { //搜索 public Map<String,Object> search(Map searchMap); //导入数据 public void importList(List<TbItem>list); //删除数据 public void deleteByGoodsIds(List goodsIdsList); }
[ "940050716@qq.com" ]
940050716@qq.com
45f01da9aa3f06836dcc7097924f01946291482d
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/9/org/apache/commons/math3/dfp/Dfp_newInstance_615.java
a6728eef30cd4027d77b422a15cd8859d64f7d42
[]
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
4,311
java
org apach common math3 dfp decim float point librari java float point built radix decim design goal decim math close settabl precis mix number set portabl code portabl perform accuraci result ulp basic algebra oper compli ieee ieee note trade off memori foot print memori repres number perform digit bigger round greater loss decim digit base digit partial fill number repres form pre sign time mant time radix exp pre sign plusmn mantissa repres fraction number mant signific digit exp rang ieee note differ ieee requir radix radix requir met subclass made make behav radix number opinion behav radix number requir met radix chosen faster oper decim digit time radix behavior realiz ad addit round step ensur number decim digit repres constant ieee standard specif leav intern data encod reason conclud subclass radix system encod radix system ieee specifi exist normal number entiti signific radix digit support gradual underflow rais underflow flag number expon exp min expmin flush expon reach min exp digit smallest number repres min exp digit digit min exp ieee defin impli radix point li signific digit left remain digit implement put impli radix point left digit includ signific signific digit radix point fine detail matter definit side effect render invis subclass dfp field dfpfield version dfp extend field element extendedfieldel dfp creat instanc string represent intern prefer constructor facilit subclass param string represent instanc instanc pars string dfp instanc newinst string dfp field
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
e1f73ccba37bb5a2051059081754b8ec9e7c41f5
5c821273636862a33dadadbb85b817cece470d4d
/src/main/java/com/mopaas/test/SchedualServiceHiHystric.java
53748bdc16e45eb6e0e3546e4283b896590bb870
[]
no_license
xyh1007/service-feign
ae39f4390d868e8868767f50935e02ae1e5435cd
44261df1dd67b82a12b55ffcbc9f5f760d2c794c
refs/heads/master
2020-03-19T05:44:47.224426
2018-06-04T02:10:08
2018-06-04T02:10:08
135,958,863
0
0
null
null
null
null
UTF-8
Java
false
false
271
java
package com.mopaas.test; import org.springframework.stereotype.Component; @Component public class SchedualServiceHiHystric implements SchedualServiceHi { @Override public String sayHiFromClientOne(String name) { return "sorry "+name; } }
[ "419356700@qq.com" ]
419356700@qq.com
15a240216fb13cf2df1ecd545fcfee171b31612d
e5b678f50ae7526b34d08085b960cdd0173e126a
/app/src/main/java/ie/ul/collegetimekeeper/Objects/User.java
6e6ebfbd2e233a42531254e12abf28d2d6dd917b
[]
no_license
patrykl97/CollegeTimeKeeper
ebf0143c3735ec2b47f2b123c79c5fbd119d7990
373d03ca74cbcde315ccfbdfa442dca7470770b9
refs/heads/master
2021-01-20T04:11:36.333719
2017-05-20T09:04:02
2017-05-20T09:04:02
89,654,731
0
0
null
2017-04-29T20:58:16
2017-04-28T01:22:04
Java
UTF-8
Java
false
false
2,385
java
package ie.ul.collegetimekeeper.Objects; import java.io.Serializable; import java.util.ArrayList; /** * Created by Patryk on 10/03/2017. */ public class User implements Serializable{ private int id; private String name; private String surname; private String email; private String password; private String collegeName; private String userType; private boolean signedIn; private ArrayList<Module> modulesList = new ArrayList<Module>(); private boolean isStudent; //might have to be inititialised public User() { this.signedIn = true; } public User(int id, String name, String surname, String collegeName, String userType){ this.id = id; this.name = name; this.surname = surname; this.collegeName = collegeName; this.userType = userType; } public void setId(int id){ this.id = id; } public int getId() { return id; } public void setName(String name) { this.name = name; } public String getName() { return name; } public void setSurname(String surname) { this.surname = surname; } public String getSurname() { return surname; } public void setEmail(String email) { this.email = email; } public String getEmail() { return email; } public void setPassword(String password) { this.password = password; } public String getPassword() { return password; } public void setCollegeName(String collegeName) { this.collegeName = collegeName; } public String getCollegeName() { return collegeName; } public void setUserType(String userType) { this.userType = userType; if(this.userType.equals("Student")){ isStudent = true; } else { isStudent = false; } } public String getUserType(){ return userType; } public void logOut() { signedIn = false; } public boolean getSignedIn() { return signedIn; } public void addModule(String moduleID) { this.modulesList.add(new Module(moduleID)); } public void addModule(String moduleID, String moduleName) { this.modulesList.add(new Module(moduleID, moduleName)); } public ArrayList<Module> getModulesList(){ return modulesList; } }
[ "patryk.leszczynski1997@gmail.com" ]
patryk.leszczynski1997@gmail.com
37eb4d62b265d3c2cf63b2fce3c9219efa295778
ba6c65eba51dc557344a9e7b4f2c1d9ec1a67d1a
/app/src/main/java/com/example/sun_safe_app/ui/notifications/NotificationsFragment.java
3d82ec54841fb8e2d73cad9956bbe7953d3f32a8
[]
no_license
imp528/sunsafeapp_backup
f9f6a2640e48f30fb8bf830d4524a69be305954a
2bc52b1405d1333de90741e0195b2e231dbd10f9
refs/heads/master
2023-07-19T11:44:15.023985
2021-09-08T15:48:17
2021-09-08T15:48:17
404,381,558
0
0
null
null
null
null
UTF-8
Java
false
false
1,238
java
package com.example.sun_safe_app.ui.notifications; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import com.example.sun_safe_app.R; public class NotificationsFragment extends Fragment { private NotificationsViewModel notificationsViewModel; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { notificationsViewModel = new ViewModelProvider(this).get(NotificationsViewModel.class); View root = inflater.inflate(R.layout.fragment_notifications, container, false); final TextView textView = root.findViewById(R.id.text_notifications); notificationsViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() { @Override public void onChanged(@Nullable String s) { textView.setText(s); } }); return root; } }
[ "ywuu0164@student.monash.edu" ]
ywuu0164@student.monash.edu
42c076aecc25462ec4513251fba42e2835f34b87
6e62edede31211d1f52fbd6b64bb292a1b37abc1
/redis-application/src/main/java/com/itcloud/redis/application/model/Position.java
74bd030ecb760f4c9c1b65f0ca0609d4863d280e
[]
no_license
1056945048/SpringCloudLearing
619f34452cacc5a6e8cef94b2614c221e7f1de03
eefc784b265fccaca99f3b80ce11efa01cb68617
refs/heads/master
2023-04-24T16:24:44.915753
2021-04-05T07:47:30
2021-04-05T07:53:25
345,964,592
0
0
null
null
null
null
UTF-8
Java
false
false
805
java
package com.itcloud.redis.application.model; import java.io.Serializable; public class Position implements Serializable { private String name; private String city; private int status; public Position() { } public Position(String name, String city) { this.name = name; this.city = city; } public Position(int status) { this.status = status; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } }
[ "1056945048@qq.com" ]
1056945048@qq.com
b9a4dd9743596adfd44602d70ae09239d351f861
0bc0ed2e07d94594f2610fce9dc9f0cbd4d1b1f8
/app/src/main/java/com/example/seok/alone/network/MagazineList.java
5b7636fb7032857a9e01e50382833841ee26f636
[]
no_license
joanjang/alone-android
50e2168cdffb18f2d4aa690a75abeb133e513d63
3b10113bd312ed33b87050a9a284933230f99c10
refs/heads/master
2022-05-24T13:34:26.186106
2017-11-27T05:48:07
2017-11-27T05:48:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
267
java
package com.example.seok.alone.network; import java.util.ArrayList; /** * Created by Seok on 2016-02-13. */ public class MagazineList { ArrayList<Magazine> userList; public ArrayList<Magazine> getUserList() { return userList; } }
[ "je0489@naver.com" ]
je0489@naver.com
0a4db3fe668519ebd81d7d77a25e2c760b6e04e2
a9a18a161576222f63fccb2a0ba3984e396602d6
/recyclerviewl/src/main/java/com/example/recyclerviewl/view/MainActivity.java
65c9f12c355b99f9608dec9530ce90af6380361c
[]
no_license
Swallow-Lgy/Liuguangyan1211
80456f151ca9df82be2c624f695508f3acc8bdc3
45a34a1c2a051b945a2060d836548dfa4991fb0b
refs/heads/master
2020-04-10T23:25:52.503713
2018-12-11T15:20:54
2018-12-11T15:20:54
161,353,288
0
0
null
null
null
null
UTF-8
Java
false
false
1,192
java
package com.example.recyclerviewl.view; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import com.example.recyclerviewl.R; public class MainActivity extends AppCompatActivity implements View.OnClickListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.linear).setOnClickListener(this); findViewById(R.id.grid).setOnClickListener(this); findViewById(R.id.flow).setOnClickListener(this); } @Override public void onClick(View v) { Intent intent = new Intent(); int id = v.getId(); switch (id){ case R.id.linear: intent.setClass(this,LinaerActivity.class); break; case R.id.grid: intent.setClass(this,GrildActivity.class); break; case R.id.flow: intent.setClass(this,FlowActivity.class); break; default: break; } startActivity(intent); } }
[ "2451528553@qq.com" ]
2451528553@qq.com
6cebb49fc367da088380fa96c87b8d07269b42de
81a7628cbc09a96dc75ff123ea6adc22158c6b79
/src/main/java/Solution.java
3c77706b74d0d529f53fcadbecc60d394c3f7c7e
[]
no_license
mohsseha/TRXmlParser
0082d05b85febd1b0461af07c030f488accea2e0
62b2cffbad3ea89e14cc00c644432813ca3749ab
refs/heads/master
2023-06-23T10:33:57.031331
2020-06-30T23:43:26
2020-06-30T23:43:26
21,878,821
0
0
null
2023-06-14T22:29:37
2014-07-15T22:56:53
Java
UTF-8
Java
false
false
264
java
import java.util.HashSet; /** * Created by husain on 7/1/14. */ public class Solution { public static void main(String... args) throws Exception { System.out.println("testing the CodPair Webpage"); HashSet hashSet = new HashSet(4); } }
[ "husain@alum.mit.edu" ]
husain@alum.mit.edu
3b2b69423a611e917a869b3fb7a39549858289f8
f40c5613a833bc38fca6676bad8f681200cffb25
/kubernetes-model-generator/openshift-model/src/generated/java/io/fabric8/openshift/api/model/RouteList.java
d42a9e0805323d646e65e0ecf80d3c42f2c0f277
[ "Apache-2.0" ]
permissive
rohanKanojia/kubernetes-client
2d599e4ed1beedf603c79d28f49203fbce1fc8b2
502a14c166dce9ec07cf6adb114e9e36053baece
refs/heads/master
2023-07-25T18:31:33.982683
2022-04-12T13:39:06
2022-04-13T05:12:38
106,398,990
2
3
Apache-2.0
2023-04-28T16:21:03
2017-10-10T09:50:25
Java
UTF-8
Java
false
false
5,036
java
package io.fabric8.openshift.api.model; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.fabric8.kubernetes.api.model.Container; import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.fabric8.kubernetes.api.model.KubernetesResourceList; import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.ListMeta; import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; import io.fabric8.kubernetes.api.model.ResourceRequirements; import io.fabric8.kubernetes.model.annotation.Group; import io.fabric8.kubernetes.model.annotation.Version; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.BuildableReference; import lombok.EqualsAndHashCode; import lombok.Setter; import lombok.ToString; import lombok.experimental.Accessors; @JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "apiVersion", "kind", "metadata", "items" }) @ToString @EqualsAndHashCode @Setter @Accessors(prefix = { "_", "" }) @Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { @BuildableReference(ObjectMeta.class), @BuildableReference(LabelSelector.class), @BuildableReference(Container.class), @BuildableReference(PodTemplateSpec.class), @BuildableReference(ResourceRequirements.class), @BuildableReference(IntOrString.class), @BuildableReference(ObjectReference.class), @BuildableReference(LocalObjectReference.class), @BuildableReference(PersistentVolumeClaim.class) }) @Version("v1") @Group("route.openshift.io") public class RouteList implements KubernetesResource, KubernetesResourceList<io.fabric8.openshift.api.model.Route> { /** * * (Required) * */ @JsonProperty("apiVersion") private String apiVersion = "route.openshift.io/v1"; @JsonProperty("items") private List<io.fabric8.openshift.api.model.Route> items = new ArrayList<io.fabric8.openshift.api.model.Route>(); /** * * (Required) * */ @JsonProperty("kind") private String kind = "RouteList"; @JsonProperty("metadata") private ListMeta metadata; @JsonIgnore private Map<String, Object> additionalProperties = new HashMap<String, Object>(); /** * No args constructor for use in serialization * */ public RouteList() { } /** * * @param metadata * @param apiVersion * @param kind * @param items */ public RouteList(String apiVersion, List<io.fabric8.openshift.api.model.Route> items, String kind, ListMeta metadata) { super(); this.apiVersion = apiVersion; this.items = items; this.kind = kind; this.metadata = metadata; } /** * * (Required) * */ @JsonProperty("apiVersion") public String getApiVersion() { return apiVersion; } /** * * (Required) * */ @JsonProperty("apiVersion") public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } @JsonProperty("items") public List<io.fabric8.openshift.api.model.Route> getItems() { return items; } @JsonProperty("items") public void setItems(List<io.fabric8.openshift.api.model.Route> items) { this.items = items; } /** * * (Required) * */ @JsonProperty("kind") public String getKind() { return kind; } /** * * (Required) * */ @JsonProperty("kind") public void setKind(String kind) { this.kind = kind; } @JsonProperty("metadata") public ListMeta getMetadata() { return metadata; } @JsonProperty("metadata") public void setMetadata(ListMeta metadata) { this.metadata = metadata; } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } }
[ "marc@marcnuri.com" ]
marc@marcnuri.com
40dd1a507f2fcc999729df82e83c7b4c6edcc7cf
0f4bc07554c08a51a07c78e453ecd21c52c563b7
/src/interfacesAndAbstractClassesLecture/building/Tent.java
c1980ce33d865c69e3bf2d987caecbd83c1477ff
[]
no_license
CodeupClassroom/xanadu-java-exercises
976f0d635f777c1bd42934d6b2f781ff3595d74b
1cef7488a168b4b85f48e554f6de43beeb041b2f
refs/heads/master
2020-04-05T04:57:46.359767
2018-11-26T18:20:26
2018-11-26T18:20:26
156,574,844
0
0
null
2018-11-26T18:20:19
2018-11-07T16:20:41
Java
UTF-8
Java
false
false
275
java
package interfacesAndAbstractClassesLecture.building; public class Tent extends PrivateBuilding { @Override public void transferOwners() { } @Override protected void measureSquareFeet() { } @Override protected void demolish() { } }
[ "justinreich.dev@gmail.com" ]
justinreich.dev@gmail.com
c412539a3db50d6451e19476eb531fd8c90b923f
bfc7a4cda00a0b89d4b984c83976770b0523f7f5
/OA/JavaSource/com/icss/oa/phonebook/admin/ManageSearchPhoneServlet.java
42693f39443d53f80ac52b71c8c7538178c5a9bd
[]
no_license
liveqmock/oa
100c4a554c99cabe0c3f9af7a1ab5629dcb697a6
0dfbb239210d4187e46a933661a031dba2711459
refs/heads/master
2021-01-18T05:02:00.704337
2015-03-03T06:47:30
2015-03-03T06:47:30
35,557,095
0
1
null
2015-05-13T15:26:06
2015-05-13T15:26:06
null
ISO-8859-1
Java
false
false
4,678
java
/* * Created on 2004-8-5 * * To change the template for this generated file go to * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments */ package com.icss.oa.phonebook.admin; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.util.*; import javax.servlet.ServletException; import javax.servlet.http.*; import com.icss.common.log.ConnLog; import com.icss.j2ee.servlet.ServletBase; import com.icss.j2ee.util.Globals; import com.icss.oa.address.handler.AddressHelp; import com.icss.oa.address.vo.SelectOrgpersonVO; import com.icss.oa.config.PhoneBookConfig; import com.icss.oa.phonebook.handler.PhoneHandler; import com.icss.oa.phonebook.vo.PhoneInfoSysPersonVO; import com.icss.oa.phonebook.vo.PhoneInfoVO; import com.icss.oa.phonebook.vo.PhoneSysNameVO; import com.icss.resourceone.common.logininfo.UserInfo; import com.icss.resourceone.sdk.framework.Context; import com.icss.oa.phonebook.vo.SysOrgVO; import com.icss.oa.phonebook.dao.SysOrgDAO; /** * @author firecoral * * To change the template for this generated type comment go to * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments */ public class ManageSearchPhoneServlet extends ServletBase{ /* (non-Javadoc) * @see com.icss.j2ee.servlet.ServletBase#performTask(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ protected void performTask(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Connection conn = null; String noteids="",username="",orguuid="",officeaddress="",officephone="",homephone="",mobilephone="",netphone="",faxphone=""; //À´×ÔMyDelPhone if(request.getParameter("fromdelpage")!=null) { if(request.getParameter("noteids")!=null) noteids=request.getParameter("noteids"); } if(request.getParameter("username")!=null) username = request.getParameter("username"); if(request.getParameter("orguuid")!=null) orguuid=request.getParameter("orguuid"); if(request.getParameter("officeaddress")!=null) officeaddress = request.getParameter("officeaddress"); if(request.getParameter("officephone")!=null) officephone = request.getParameter("officephone"); if(request.getParameter("homephone")!=null) homephone = request.getParameter("homephone"); if(request.getParameter("mobilephone")!=null) mobilephone = request.getParameter("mobilephone"); if(request.getParameter("netphone")!=null) netphone = request.getParameter("netphone"); if(request.getParameter("faxphone")!=null) faxphone = request.getParameter("faxphone"); String type=""; HttpSession session = request.getSession(); List ownerList = (List) session.getAttribute("owner"); //Çå³ýSession if(ownerList!=null){ session.removeAttribute("owner"); } try { conn = this.getConnection(Globals.DATASOURCEJNDI); PhoneHandler pHandler = new PhoneHandler(conn); ConnLog.open("MySearchPhoneServlet"); Context ctx = null; ctx = Context.getInstance(); UserInfo user = ctx.getCurrentLoginInfo(); String cuorguuid=user.getPrimaryOrguuid(); String cupersonuuid=user.getPersonUuid(); String cuorgname=user.getCnName(); List chuorgList=new ArrayList(); chuorgList=pHandler.getChuOrguuid(cuorguuid); List phoneList=new ArrayList(); List fullorglist=new ArrayList(); phoneList=pHandler.ManageSearchPhone(noteids,username,orguuid,officeaddress,officephone,homephone, mobilephone, netphone, faxphone,chuorgList); Iterator it = phoneList.iterator(); while(it.hasNext()) { PhoneInfoVO vo=(PhoneInfoVO)it.next(); fullorglist.add(pHandler.getFullOrgName(vo.getOrguuid())); } request.setAttribute("chuorgList",chuorgList); request.setAttribute("phoneList",phoneList); request.setAttribute("fullorglist",fullorglist); //System.out.println("sizesize3:"+phoneList.size()); this.forward(request,response,"/phonebook/managephone.jsp?orguuid="+orguuid); }catch (Exception e) { e.printStackTrace(); }finally { if (conn != null) try { conn.close(); ConnLog.close("MySearchPhoneServlet"); } catch (Exception e2) { e2.printStackTrace(); } } } }
[ "peijn1026@gmail.com" ]
peijn1026@gmail.com
cf87893164e9ee37c8342f7b880aa4edeb005953
e9b01221c9e74595d0acdde16477503a0281367a
/src/main/java/pe/com/confisys/soft/sispedidosbackend/service/BaseService.java
cacb9fea9b75422a4d62a8b5ec54d89615996d64
[]
no_license
jtejadavilca/sispedidos-backend
cab896ce3b8153be2b5ff8121474f5b5c78a4f3a
ba4db1944fcd4593ccb30e2e49ca9adf5e7ecd33
refs/heads/master
2020-06-06T16:21:05.663362
2019-07-15T07:14:52
2019-07-15T07:14:52
192,790,157
0
0
null
null
null
null
UTF-8
Java
false
false
312
java
package pe.com.confisys.soft.sispedidosbackend.service; import pe.com.confisys.soft.sispedidosbackend.utils.ResponseBean; public interface BaseService<T> { ResponseBean<T> listarTodos(); ResponseBean<T> obtenerPorId(Integer id); ResponseBean<T> crear(T entity); T actualizar(T entity); }
[ "jtejadavilca@gmail.com" ]
jtejadavilca@gmail.com
525e8bb3e7b32592c312382acb76d091402a308f
1647773f028a6703496741de69979ca34392f675
/spring-data-aggregate-fun/src/main/java/com/marceloserpa/aggregatefun/books/AuthorRepository.java
5d58f9f05f0a66814a9353be13cd58eb41645e51
[]
no_license
marceloserpa/marcelo_serpa_sandbox
5dbd05168743fbba2992e582f6192ef7fa2cb1eb
f6016786ce70fe2009c145adb03af9117eece08b
refs/heads/master
2023-08-31T18:06:59.646716
2023-08-29T23:04:30
2023-08-29T23:04:30
63,018,017
8
4
null
2022-12-11T02:25:05
2016-07-10T20:52:25
Java
UTF-8
Java
false
false
236
java
package com.marceloserpa.aggregatefun.books; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; @Repository interface AuthorRepository extends CrudRepository<Author, Long> { }
[ "jdev.marcelo@gmail.com" ]
jdev.marcelo@gmail.com
7e71c63d66974fbccee882becfa5111980d668d8
d133fffddfba6783f4cf9403a04269e7955a74b0
/src/osmedile/intellij/stringmanip/filter/RemoveAllSpacesAction.java
6a24dfa650afe73a44cc2b3b8eade56383bbd572
[ "Apache-2.0" ]
permissive
hatip5656/StringManipulation
2d94b13f36b3b59d2c26d90c50a01ed0fa4b42d4
6ea59b84fde34d806874516a1dc37a3bd889e6aa
refs/heads/master
2023-08-22T04:45:14.361417
2021-10-27T09:43:32
2021-10-27T09:43:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
916
java
package osmedile.intellij.stringmanip.filter; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.SelectionModel; import osmedile.intellij.stringmanip.AbstractStringManipAction; import osmedile.intellij.stringmanip.utils.StringUtil; import java.util.Map; /** * @author Olivier Smedile * @version $Id: RemoveAllSpacesAction.java 16 2008-03-20 19:21:43Z osmedile $ */ public class RemoveAllSpacesAction extends AbstractStringManipAction<Object> { @Override protected boolean selectSomethingUnderCaret(Editor editor, DataContext dataContext, SelectionModel selectionModel) { selectionModel.setSelection(selectionModel.getSelectionStart(), selectionModel.getSelectionEnd() - 1); return true; } @Override public String transformByLine(Map<String, Object> actionContext, String s) { return StringUtil.removeAllSpace(s); } }
[ "vojta.krasa@gmail.com" ]
vojta.krasa@gmail.com
81fb39d93fd70e36ab100e5a9e0b5886d339ae7b
3a5acedfa06c5a0b84ade467cfe6d94df1e2e027
/src/test/java/unit/service/CharityServiceUnitTest.java
9cc6369814357b3a3b6b2284567e0ed6cd90b350
[]
no_license
carlylou/connectingcharity
e999c1909a438ff2af630474efee364a7f03b05a
e3200305be9418323e10944f4aee71b055e4f1e5
refs/heads/master
2020-04-20T14:47:11.827941
2019-02-03T04:36:41
2019-02-03T04:36:41
168,909,442
0
0
null
null
null
null
UTF-8
Java
false
false
5,372
java
package unit.service; import com.charityconnector.dao.CharityRepository; import com.charityconnector.entity.Charity; import com.charityconnector.service.CharityService; import com.charityconnector.serviceImpl.CharityServiceImpl; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.mockito.Mock; import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.mockito.Mockito.*; public class CharityServiceUnitTest { @Rule public MockitoRule mockitoRule = MockitoJUnit.rule(); CharityService charityService; @Mock CharityRepository mockRepo; @Before public void initService() { charityService = new CharityServiceImpl(mockRepo); } @Test public void gettingACharity() { Charity charity = new Charity(); when(mockRepo.findOne(1L)).thenReturn(charity); Charity returnedCharity = charityService.getCharity(); verify(mockRepo, times(1)).findOne(1L); assertThat(returnedCharity, equalTo(charity)); } @Test public void addingCharity() { Charity charity = new Charity(); when(mockRepo.save(charity)).thenReturn(charity); Charity returnedCharity = charityService.addCharity(charity); assertThat(returnedCharity, equalTo(charity)); verify(mockRepo, times(1)).save(charity); verifyNoMoreInteractions(mockRepo); } @Test public void gettingCharitiesByExisthingName() { Charity charity = new Charity(); Charity[] charities = {charity}; Page<Charity> charityPage = new PageImpl(Arrays.asList(charities)); when(mockRepo.findByNameLike("name", new PageRequest(0, 10))).thenReturn(charityPage); Page<Charity> returnedCharityPage = charityService.findByNameLike("name", new PageRequest(0, 10)); verify(mockRepo, times(1)).findByNameLike("name", new PageRequest(0, 10)); verifyNoMoreInteractions(mockRepo); assertThat(returnedCharityPage, equalTo(charityPage)); } @Test public void gettingARandomCharity() { Charity charity = new Charity(); when(mockRepo.findRandom()).thenReturn(charity); Charity returnedCharity = charityService.findRandom(); verify(mockRepo, times(1)).findRandom(); assertThat(returnedCharity, equalTo(charity)); } @Test public void selectiveUpdatingCharity() { Charity oldCharity = new Charity(1L, "name", "description", "123", "email", "paypal", null, null, null,"verifyCode", 1, 1L,null); Charity newCharity = new Charity(1L, null, "adifferentDescription", null, "email2", "paypal", null, null, null, null, 0, 2L,null); when(mockRepo.findOne(1L)).thenReturn(oldCharity); charityService.updateSelective(newCharity); verify(mockRepo).save(argThat(new SelectiveUpdateCharityMatcher(newCharity))); } @Test public void directlyUpdatingCharity() { Charity charity = new Charity(); charityService.updateDirect(charity); verify(mockRepo, times(1)).save(charity); verifyNoMoreInteractions(mockRepo); } @Test public void deletingCharity() { charityService.deleteById(1L); verify(mockRepo, times(1)).delete(1L); verifyNoMoreInteractions(mockRepo); } @Test public void gettingCharityByExisthingId() { Charity charity = new Charity(); charity.setId(1L); when(mockRepo.findOne(1L)).thenReturn(charity); Charity returnedCharity = charityService.findById(1L); assertThat(returnedCharity.getId(), is(1L)); } @Test public void gettingCharityByPage() { Charity charity = new Charity(); charity.setId(1L); List<Charity> charities = new ArrayList<>(); charities.add(charity); Pageable pageable = new PageRequest(0, 1); Page page = new PageImpl(charities); when(mockRepo.findAll(pageable)).thenReturn(page); Charity[] returnedCharities = charityService.findPaged(pageable); verify(mockRepo, times(1)).findAll(pageable); verifyNoMoreInteractions(mockRepo); assertThat(returnedCharities[0], equalTo(charity)); } @Test public void gettingCharityByNameAndPage() { Charity charity = new Charity(); charity.setId(1L); List<Charity> charities = new ArrayList<>(); charities.add(charity); Pageable pageable = new PageRequest(0, 1); Page page = new PageImpl(charities); String name = "name"; when(mockRepo.findByNameLike(name, pageable)).thenReturn(page); Page<Charity> returnedCharities = charityService.findByNameLike(name, pageable); verify(mockRepo, times(1)).findByNameLike(name, pageable); verifyNoMoreInteractions(mockRepo); assertThat(returnedCharities.getContent().get(0), equalTo(charity)); } }
[ "564458176@qq.com" ]
564458176@qq.com
351dab35e76ec6f0b2b17c63b3f59be66f2d037a
9757bbb318fa245dcdb099ce356ddbeff5f2fbaf
/src/main/java/g1401_1500/s1491_average_salary_excluding_the_minimum_and_maximum_salary/Solution.java
3802a3f8f5c910d64847a40d7eda4d316f80ad71
[ "MIT" ]
permissive
javadev/LeetCode-in-Java
181aebf56caa51a4442f07466e89b869aa217424
413de2cb56123d3844a1b142eec7e9a8182c78fb
refs/heads/main
2023-08-31T01:46:52.740790
2023-08-30T08:45:06
2023-08-30T08:45:06
426,947,282
103
57
MIT
2023-09-14T08:08:08
2021-11-11T09:46:12
Java
UTF-8
Java
false
false
691
java
package g1401_1500.s1491_average_salary_excluding_the_minimum_and_maximum_salary; // #Easy #Array #Sorting #Programming_Skills_I_Day_1_Basic_Data_Type // #2022_04_05_Time_0_ms_(100.00%)_Space_42.1_MB_(23.90%) public class Solution { public double average(int[] salary) { int n = salary.length; int min = salary[0]; int max = salary[0]; int sum = salary[0]; for (int i = 1; i < n; ++i) { if (salary[i] < min) { min = salary[i]; } else if (salary[i] > max) { max = salary[i]; } sum += salary[i]; } return (double) (sum - min - max) / (n - 2); } }
[ "noreply@github.com" ]
noreply@github.com
1fb36775034d948e47c518779af8941d6497fc1f
e8e7e2e11484ff2835d96f91b4cc2d995230580f
/src/main/java/domain/EntityState.java
f5ef6f87e56c4a4b203a56574b097eed3323f01c
[]
no_license
MariannaJan/MPR_ProjektZal_s14292
435d4feae5b45ff6f54bae6135ef4d8208572c3c
58e7c13d32ffa40d46bd99bab6e49dfae8f46bb4
refs/heads/master
2021-01-11T18:41:42.198735
2017-01-20T22:33:41
2017-01-20T22:35:20
79,602,889
0
0
null
null
null
null
UTF-8
Java
false
false
89
java
package domain; public enum EntityState { New, Modified, UnChanged, Deleted, Unknown }
[ "skaven1313" ]
skaven1313
89516ad44c2ba44f4061432b00d60c1cf45114dc
435d568701c00442a8d3cd0d1cd0d24e6eacf0f2
/source/org/alfresco/web/evaluator/IsChineseLanguage.java
8c6b98c7d99d51c70016464adf1f78378e737b8c
[]
no_license
mdykhno/multilingual-share
a69937ebc8b33a3c5eebe6a7a835502624ec9f3d
27aa61542c891f2d3df9614319fa18b1af36c225
refs/heads/master
2021-01-17T07:04:09.791731
2016-05-16T09:07:17
2016-05-16T09:07:17
39,768,466
0
0
null
2016-05-16T09:07:17
2015-07-27T10:21:50
JavaScript
UTF-8
Java
false
false
1,148
java
package org.alfresco.web.evaluator; import org.alfresco.error.AlfrescoRuntimeException; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import java.util.ArrayList; import java.util.Locale; public class IsChineseLanguage extends BaseEvaluator { private ArrayList<String> aspects; public void setAspects(ArrayList<String> aspects) { this.aspects = aspects; } public boolean evaluate(JSONObject jsonObject) { try { JSONObject decoratedLocale = (JSONObject) this.getProperty(jsonObject, "sys:locale"); if (decoratedLocale == null) return false; Integer isMultiLin = ((JSONArray)((JSONObject)jsonObject.get("node")).get("aspects")).indexOf("cm:mlDocument"); if(isMultiLin == -1) return false; Object language = decoratedLocale.get("value"); return Locale.CHINESE.getLanguage().equals(language); } catch (Exception err) { throw new AlfrescoRuntimeException("Failed to run action IsPivotLanguage: " + err.getMessage()); } } }
[ "d.solyanik@aimprosoft.com" ]
d.solyanik@aimprosoft.com
ed53bfa66ad795d0680d226a30e81bd805ac0594
829bd84681da216fb71bb3556117664451973c34
/order-service/src/main/java/com/example/orderservice/model/Order.java
300349a8e859eb0bcf3b610060bccc1b7b5bb558
[]
no_license
dnilay/repo16
8c5066e4092609f598e28630db3cd59fcd585a4d
f2e324c3bbf9197c3e4efaa08f6ccc42400a0a41
refs/heads/main
2023-06-20T22:31:28.096557
2021-07-28T09:11:19
2021-07-28T09:11:19
388,777,380
0
0
null
null
null
null
UTF-8
Java
false
false
1,008
java
package com.example.orderservice.model; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; @Entity @Table(name = "my_order_details_table") @Data @NoArgsConstructor public class Order { @Id @GeneratedValue private Integer orderId; private String itemName; private String customerName; public Order(String itemName, String customerName) { this.itemName = itemName; this.customerName = customerName; } public Integer getOrderId() { return orderId; } public void setOrderId(Integer orderId) { this.orderId = orderId; } public String getItemName() { return itemName; } public void setItemName(String itemName) { this.itemName = itemName; } public String getCustomerName() { return customerName; } public void setCustomerName(String customerName) { this.customerName = customerName; } }
[ "noreply@github.com" ]
noreply@github.com
75cb1ab99a069767e98054c0c9015cb3b40d477f
677ebd70a8b59cd94c62d05afed6214d92b11840
/app/src/main/java/com/lyne/mvvmcodetemplatesample/view/SingleActivity.java
78011ac696c7deb98583a0c511c2d05eb073f4c0
[]
no_license
fe203/mvvmCodeTemplateSample
eefdbca027ebbd866aa36685892d017f25ccf4fc
df9bbfa3e33ba47e27a2ec2ace701eb54e7a9d6d
refs/heads/master
2020-03-27T23:10:23.852626
2018-09-04T09:51:54
2018-09-04T09:51:54
147,297,706
1
0
null
null
null
null
UTF-8
Java
false
false
1,119
java
package com.lyne.mvvmcodetemplatesample.view; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import com.lyne.mvvmcodetemplatesample.R; import com.lyne.mvvmcodetemplatesample.model.Single; import android.arch.lifecycle.Observer; import android.arch.lifecycle.ViewModelProviders; import com.lyne.mvvmcodetemplatesample.viewmodel.SingleViewModel; /** * Created by liht on 2018-9-4. */ public class SingleActivity extends AppCompatActivity { private SingleViewModel singleViewModel; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_single); initViewModel(); } private void initViewModel() { singleViewModel = ViewModelProviders.of(this).get(SingleViewModel.class); singleViewModel.getLiveDataObserver().observe(this, new Observer<Single>() { @Override public void onChanged(@Nullable Single single) { //TODO } }); } }
[ "lihaitao" ]
lihaitao
9efbcbfed64e9cdb7af97646ab74055bf6fcccba
fbd98292ff67cf8ae763dd871b93951c60cada91
/app/src/main/java/com/example/myfirstapp/MainActivity.java
0c39c8dc858cfb615e121d5fbeed578020cc4e30
[]
no_license
Cegenati/CalgaryHacks
527fd310ebe52746b03d93456ed0ec92a7d5bb5f
28873bd49eb397ffc48ca984519b7c3b7bd37aa5
refs/heads/master
2020-04-22T23:16:55.733775
2019-11-01T00:37:48
2019-11-01T00:37:48
170,735,942
0
0
null
null
null
null
UTF-8
Java
false
false
1,422
java
package example.com; import android.content.Intent; import android.provider.MediaStore; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageButton; import android.graphics.Bitmap; import android.widget.TextView; import com.example.myfirstapp.R; public class MainActivity extends AppCompatActivity { ImageButton imagebutton; static final int REQUEST_CODE = 1; TextView tv; tv = find @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); imagebutton = findViewById(R.id.imageButton); imagebutton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, REQUEST_CODE); } }); } @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode == REQUEST_CODE && resultCode == RESULT_OK) { Bitmap bitmap = (Bitmap) data.getExtras().get("data"); imagebutton.setImageBitmap(bitmap); } } }
[ "cegenati@edu.uwaterloo.ca" ]
cegenati@edu.uwaterloo.ca