blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0584444d0faa3c54e3a3e472f7a17c67d1288dd2 | 5e13db1b90932ce46f688d1bf28d3f46c2358f37 | /Trees/IdenticalTrees.java | 1cabe64e461534470d8374e53ea9eeba845be2f4 | [] | no_license | nakul-chakrapani/careercup-geeksforgeeks-practice-problems | 5e9b91bfef64fd8797cbb3ded449707344e5b68c | 65742e6539976560e077798fbc8293f68ff127a7 | refs/heads/master | 2021-01-20T01:11:05.120734 | 2015-01-26T03:11:36 | 2015-01-26T03:11:36 | 29,416,922 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,341 | java | package Trees;
public class IdenticalTrees {
public static void main(String[] args) {
// TODO Auto-generated method stub
Node node7 = new Node(7, null, null);
Node node6 = new Node(6, null, null);
Node node5 = new Node(5, null, null);
Node node4 = new Node(4, null, null);
Node node3 = new Node(3, node6, node7);
Node node2 = new Node(2, node4, node5);
Node node1 = new Node(1, node2, node3);
Node node71 = new Node(7, null, null);
Node node61 = new Node(6, null, null);
Node node51 = new Node(6, null, null);
Node node41 = new Node(4, null, null);
Node node31 = new Node(3, node61, node71);
Node node21 = new Node(2, node41, node51);
Node node11 = new Node(1, node21, node31);
IdenticalTreesClass obj = new IdenticalTreesClass();
System.out.println(obj.identicalTrees(node1, node11));
}
}
class IdenticalTreesClass {
public boolean identicalTrees(Node root1, Node root2) {
boolean leftIdentical = true;
boolean rightIdentical = true;
if (root1.left != null && root2.left !=null) {
leftIdentical = identicalTrees(root1.left, root2.left);
}
if (root1.right != null && root2.right !=null) {
rightIdentical = identicalTrees(root1.right, root2.right);
}
if (root1.value == root2.value) {
return leftIdentical && rightIdentical;
} else {
return false;
}
}
} | [
"nakulchakrapani.pes@gmail.com"
] | nakulchakrapani.pes@gmail.com |
27b7921ca2c3f7ede8decbc588ff9d4d066f1556 | ca7da6499e839c5d12eb475abe019370d5dd557d | /spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandlerIntegrationTests.java | 9243304b91af6c55a66691cf71b55e4627d614c5 | [
"Apache-2.0"
] | permissive | yangfancoming/spring-5.1.x | 19d423f96627636a01222ba747f951a0de83c7cd | db4c2cbcaf8ba58f43463eff865d46bdbd742064 | refs/heads/master | 2021-12-28T16:21:26.101946 | 2021-12-22T08:55:13 | 2021-12-22T08:55:13 | 194,103,586 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 18,202 | java |
package org.springframework.messaging.simp.stomp;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import org.apache.activemq.broker.BrokerService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageDeliveryException;
import org.springframework.messaging.MessageHandler;
import org.springframework.messaging.MessagingException;
import org.springframework.messaging.StubMessageChannel;
import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
import org.springframework.messaging.simp.SimpMessageType;
import org.springframework.messaging.simp.broker.BrokerAvailabilityEvent;
import org.springframework.messaging.support.ExecutorSubscribableChannel;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.util.Assert;
import org.springframework.util.SocketUtils;
import static org.junit.Assert.*;
/**
* Integration tests for {@link StompBrokerRelayMessageHandler} running against ActiveMQ.
*
*
*/
public class StompBrokerRelayMessageHandlerIntegrationTests {
@Rule
public final TestName testName = new TestName();
private static final Log logger = LogFactory.getLog(StompBrokerRelayMessageHandlerIntegrationTests.class);
private StompBrokerRelayMessageHandler relay;
private BrokerService activeMQBroker;
private ExecutorSubscribableChannel responseChannel;
private TestMessageHandler responseHandler;
private TestEventPublisher eventPublisher;
private int port;
@Before
public void setup() throws Exception {
logger.debug("Setting up before '" + this.testName.getMethodName() + "'");
this.port = SocketUtils.findAvailableTcpPort(61613);
this.responseChannel = new ExecutorSubscribableChannel();
this.responseHandler = new TestMessageHandler();
this.responseChannel.subscribe(this.responseHandler);
this.eventPublisher = new TestEventPublisher();
startActiveMqBroker();
createAndStartRelay();
}
private void startActiveMqBroker() throws Exception {
this.activeMQBroker = new BrokerService();
this.activeMQBroker.addConnector("stomp://localhost:" + this.port);
this.activeMQBroker.setStartAsync(false);
this.activeMQBroker.setPersistent(false);
this.activeMQBroker.setUseJmx(false);
this.activeMQBroker.getSystemUsage().getMemoryUsage().setLimit(1024 * 1024 * 5);
this.activeMQBroker.getSystemUsage().getTempUsage().setLimit(1024 * 1024 * 5);
this.activeMQBroker.start();
}
private void createAndStartRelay() throws InterruptedException {
StubMessageChannel channel = new StubMessageChannel();
List<String> prefixes = Arrays.asList("/queue/", "/topic/");
this.relay = new StompBrokerRelayMessageHandler(channel, this.responseChannel, channel, prefixes);
this.relay.setRelayPort(this.port);
this.relay.setApplicationEventPublisher(this.eventPublisher);
this.relay.setSystemHeartbeatReceiveInterval(0);
this.relay.setSystemHeartbeatSendInterval(0);
this.relay.setPreservePublishOrder(true);
this.relay.start();
this.eventPublisher.expectBrokerAvailabilityEvent(true);
}
@After
public void stop() throws Exception {
try {
logger.debug("STOMP broker relay stats: " + this.relay.getStatsInfo());
this.relay.stop();
}
finally {
stopActiveMqBrokerAndAwait();
}
}
private void stopActiveMqBrokerAndAwait() throws Exception {
logger.debug("Stopping ActiveMQ broker and will await shutdown");
if (!this.activeMQBroker.isStarted()) {
logger.debug("Broker not running");
return;
}
final CountDownLatch latch = new CountDownLatch(1);
this.activeMQBroker.addShutdownHook(new Runnable() {
public void run() {
latch.countDown();
}
});
this.activeMQBroker.stop();
assertTrue("Broker did not stop", latch.await(5, TimeUnit.SECONDS));
logger.debug("Broker stopped");
}
@Test
public void publishSubscribe() throws Exception {
logger.debug("Starting test publishSubscribe()");
String sess1 = "sess1";
String sess2 = "sess2";
String subs1 = "subs1";
String destination = "/topic/test";
MessageExchange conn1 = MessageExchangeBuilder.connect(sess1).build();
MessageExchange conn2 = MessageExchangeBuilder.connect(sess2).build();
this.relay.handleMessage(conn1.message);
this.relay.handleMessage(conn2.message);
this.responseHandler.expectMessages(conn1, conn2);
MessageExchange subscribe = MessageExchangeBuilder.subscribeWithReceipt(sess1, subs1, destination, "r1").build();
this.relay.handleMessage(subscribe.message);
this.responseHandler.expectMessages(subscribe);
MessageExchange send = MessageExchangeBuilder.send(destination, "foo").andExpectMessage(sess1, subs1).build();
this.relay.handleMessage(send.message);
this.responseHandler.expectMessages(send);
}
@Test(expected = MessageDeliveryException.class)
public void messageDeliveryExceptionIfSystemSessionForwardFails() throws Exception {
logger.debug("Starting test messageDeliveryExceptionIfSystemSessionForwardFails()");
stopActiveMqBrokerAndAwait();
this.eventPublisher.expectBrokerAvailabilityEvent(false);
StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.SEND);
this.relay.handleMessage(MessageBuilder.createMessage("test".getBytes(), headers.getMessageHeaders()));
}
@Test
public void brokerBecomingUnavailableTriggersErrorFrame() throws Exception {
logger.debug("Starting test brokerBecomingUnavailableTriggersErrorFrame()");
String sess1 = "sess1";
MessageExchange connect = MessageExchangeBuilder.connect(sess1).build();
this.relay.handleMessage(connect.message);
this.responseHandler.expectMessages(connect);
MessageExchange error = MessageExchangeBuilder.error(sess1).build();
stopActiveMqBrokerAndAwait();
this.eventPublisher.expectBrokerAvailabilityEvent(false);
this.responseHandler.expectMessages(error);
}
@Test
public void brokerAvailabilityEventWhenStopped() throws Exception {
logger.debug("Starting test brokerAvailabilityEventWhenStopped()");
stopActiveMqBrokerAndAwait();
this.eventPublisher.expectBrokerAvailabilityEvent(false);
}
@Test
public void relayReconnectsIfBrokerComesBackUp() throws Exception {
logger.debug("Starting test relayReconnectsIfBrokerComesBackUp()");
String sess1 = "sess1";
MessageExchange conn1 = MessageExchangeBuilder.connect(sess1).build();
this.relay.handleMessage(conn1.message);
this.responseHandler.expectMessages(conn1);
String subs1 = "subs1";
String destination = "/topic/test";
MessageExchange subscribe = MessageExchangeBuilder.subscribeWithReceipt(sess1, subs1, destination, "r1").build();
this.relay.handleMessage(subscribe.message);
this.responseHandler.expectMessages(subscribe);
MessageExchange error = MessageExchangeBuilder.error(sess1).build();
stopActiveMqBrokerAndAwait();
this.responseHandler.expectMessages(error);
this.eventPublisher.expectBrokerAvailabilityEvent(false);
startActiveMqBroker();
this.eventPublisher.expectBrokerAvailabilityEvent(true);
}
@Test
public void disconnectWithReceipt() throws Exception {
logger.debug("Starting test disconnectWithReceipt()");
MessageExchange connect = MessageExchangeBuilder.connect("sess1").build();
this.relay.handleMessage(connect.message);
this.responseHandler.expectMessages(connect);
MessageExchange disconnect = MessageExchangeBuilder.disconnectWithReceipt("sess1", "r123").build();
this.relay.handleMessage(disconnect.message);
this.responseHandler.expectMessages(disconnect);
}
private static class TestEventPublisher implements ApplicationEventPublisher {
private final BlockingQueue<BrokerAvailabilityEvent> eventQueue = new LinkedBlockingQueue<>();
@Override
public void publishEvent(ApplicationEvent event) {
publishEvent((Object) event);
}
@Override
public void publishEvent(Object event) {
logger.debug("Processing ApplicationEvent " + event);
if (event instanceof BrokerAvailabilityEvent) {
this.eventQueue.add((BrokerAvailabilityEvent) event);
}
}
public void expectBrokerAvailabilityEvent(boolean isBrokerAvailable) throws InterruptedException {
BrokerAvailabilityEvent event = this.eventQueue.poll(20000, TimeUnit.MILLISECONDS);
assertNotNull("Times out waiting for BrokerAvailabilityEvent[" + isBrokerAvailable + "]", event);
assertEquals(isBrokerAvailable, event.isBrokerAvailable());
}
}
private static class TestMessageHandler implements MessageHandler {
private final BlockingQueue<Message<?>> queue = new LinkedBlockingQueue<>();
@Override
public void handleMessage(Message<?> message) throws MessagingException {
if (SimpMessageType.HEARTBEAT == SimpMessageHeaderAccessor.getMessageType(message.getHeaders())) {
return;
}
this.queue.add(message);
}
public void expectMessages(MessageExchange... messageExchanges) throws InterruptedException {
List<MessageExchange> expectedMessages =
new ArrayList<>(Arrays.<MessageExchange>asList(messageExchanges));
while (expectedMessages.size() > 0) {
Message<?> message = this.queue.poll(10000, TimeUnit.MILLISECONDS);
assertNotNull("Timed out waiting for messages, expected [" + expectedMessages + "]", message);
MessageExchange match = findMatch(expectedMessages, message);
assertNotNull("Unexpected message=" + message + ", expected [" + expectedMessages + "]", match);
expectedMessages.remove(match);
}
}
private MessageExchange findMatch(List<MessageExchange> expectedMessages, Message<?> message) {
for (MessageExchange exchange : expectedMessages) {
if (exchange.matchMessage(message)) {
return exchange;
}
}
return null;
}
}
/**
* Holds a message as well as expected and actual messages matched against expectations.
*/
private static class MessageExchange {
private final Message<?> message;
private final MessageMatcher[] expected;
private final Message<?>[] actual;
public MessageExchange(Message<?> message, MessageMatcher... expected) {
this.message = message;
this.expected = expected;
this.actual = new Message<?>[expected.length];
}
public boolean matchMessage(Message<?> message) {
for (int i = 0 ; i < this.expected.length; i++) {
if (this.expected[i].match(message)) {
this.actual[i] = message;
return true;
}
}
return false;
}
@Override
public String toString() {
return "Forwarded message:\n" + this.message + "\n" +
"Should receive back:\n" + Arrays.toString(this.expected) + "\n" +
"Actually received:\n" + Arrays.toString(this.actual) + "\n";
}
}
private static class MessageExchangeBuilder {
private final Message<?> message;
private final StompHeaderAccessor headers;
private final List<MessageMatcher> expected = new ArrayList<>();
public MessageExchangeBuilder(Message<?> message) {
this.message = message;
this.headers = StompHeaderAccessor.wrap(message);
}
public static MessageExchangeBuilder error(String sessionId) {
return new MessageExchangeBuilder(null).andExpectError(sessionId);
}
public static MessageExchangeBuilder connect(String sessionId) {
StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.CONNECT);
headers.setSessionId(sessionId);
headers.setAcceptVersion("1.1,1.2");
headers.setHeartbeat(0, 0);
Message<?> message = MessageBuilder.createMessage(new byte[0], headers.getMessageHeaders());
MessageExchangeBuilder builder = new MessageExchangeBuilder(message);
builder.expected.add(new StompConnectedFrameMessageMatcher(sessionId));
return builder;
}
// TODO Determine why connectWithError() is unused.
@SuppressWarnings("unused")
public static MessageExchangeBuilder connectWithError(String sessionId) {
StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.CONNECT);
headers.setSessionId(sessionId);
headers.setAcceptVersion("1.1,1.2");
Message<?> message = MessageBuilder.createMessage(new byte[0], headers.getMessageHeaders());
MessageExchangeBuilder builder = new MessageExchangeBuilder(message);
return builder.andExpectError();
}
public static MessageExchangeBuilder subscribeWithReceipt(String sessionId, String subscriptionId,
String destination, String receiptId) {
StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.SUBSCRIBE);
headers.setSessionId(sessionId);
headers.setSubscriptionId(subscriptionId);
headers.setDestination(destination);
headers.setReceipt(receiptId);
Message<?> message = MessageBuilder.createMessage(new byte[0], headers.getMessageHeaders());
MessageExchangeBuilder builder = new MessageExchangeBuilder(message);
builder.expected.add(new StompReceiptFrameMessageMatcher(sessionId, receiptId));
return builder;
}
public static MessageExchangeBuilder send(String destination, String payload) {
SimpMessageHeaderAccessor headers = SimpMessageHeaderAccessor.create(SimpMessageType.MESSAGE);
headers.setDestination(destination);
Message<?> message = MessageBuilder.createMessage(payload.getBytes(StandardCharsets.UTF_8),
headers.getMessageHeaders());
return new MessageExchangeBuilder(message);
}
public static MessageExchangeBuilder disconnectWithReceipt(String sessionId, String receiptId) {
StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.DISCONNECT);
headers.setSessionId(sessionId);
headers.setReceipt(receiptId);
Message<?> message = MessageBuilder.createMessage(new byte[0], headers.getMessageHeaders());
MessageExchangeBuilder builder = new MessageExchangeBuilder(message);
builder.expected.add(new StompReceiptFrameMessageMatcher(sessionId, receiptId));
return builder;
}
public MessageExchangeBuilder andExpectMessage(String sessionId, String subscriptionId) {
Assert.state(SimpMessageType.MESSAGE.equals(this.headers.getMessageType()), "MESSAGE type expected");
String destination = this.headers.getDestination();
Object payload = this.message.getPayload();
this.expected.add(new StompMessageFrameMessageMatcher(sessionId, subscriptionId, destination, payload));
return this;
}
public MessageExchangeBuilder andExpectError() {
String sessionId = this.headers.getSessionId();
Assert.state(sessionId != null, "No sessionId to match the ERROR frame to");
return andExpectError(sessionId);
}
public MessageExchangeBuilder andExpectError(String sessionId) {
this.expected.add(new StompFrameMessageMatcher(StompCommand.ERROR, sessionId));
return this;
}
public MessageExchange build() {
return new MessageExchange(this.message, this.expected.toArray(new MessageMatcher[this.expected.size()]));
}
}
private interface MessageMatcher {
boolean match(Message<?> message);
}
private static class StompFrameMessageMatcher implements MessageMatcher {
private final StompCommand command;
private final String sessionId;
public StompFrameMessageMatcher(StompCommand command, String sessionId) {
this.command = command;
this.sessionId = sessionId;
}
@Override
public final boolean match(Message<?> message) {
StompHeaderAccessor headers = StompHeaderAccessor.wrap(message);
if (!this.command.equals(headers.getCommand()) || (this.sessionId != headers.getSessionId())) {
return false;
}
return matchInternal(headers, message.getPayload());
}
protected boolean matchInternal(StompHeaderAccessor headers, Object payload) {
return true;
}
@Override
public String toString() {
return "command=" + this.command + ", session=\"" + this.sessionId + "\"";
}
}
private static class StompReceiptFrameMessageMatcher extends StompFrameMessageMatcher {
private final String receiptId;
public StompReceiptFrameMessageMatcher(String sessionId, String receipt) {
super(StompCommand.RECEIPT, sessionId);
this.receiptId = receipt;
}
@Override
protected boolean matchInternal(StompHeaderAccessor headers, Object payload) {
return (this.receiptId.equals(headers.getReceiptId()));
}
@Override
public String toString() {
return super.toString() + ", receiptId=\"" + this.receiptId + "\"";
}
}
private static class StompMessageFrameMessageMatcher extends StompFrameMessageMatcher {
private final String subscriptionId;
private final String destination;
private final Object payload;
public StompMessageFrameMessageMatcher(String sessionId, String subscriptionId, String destination, Object payload) {
super(StompCommand.MESSAGE, sessionId);
this.subscriptionId = subscriptionId;
this.destination = destination;
this.payload = payload;
}
@Override
protected boolean matchInternal(StompHeaderAccessor headers, Object payload) {
if (!this.subscriptionId.equals(headers.getSubscriptionId()) ||
!this.destination.equals(headers.getDestination())) {
return false;
}
if (payload instanceof byte[] && this.payload instanceof byte[]) {
return Arrays.equals((byte[]) payload, (byte[]) this.payload);
}
else {
return this.payload.equals(payload);
}
}
@Override
public String toString() {
return super.toString() + ", subscriptionId=\"" + this.subscriptionId
+ "\", destination=\"" + this.destination + "\", payload=\"" + getPayloadAsText() + "\"";
}
protected String getPayloadAsText() {
return (this.payload instanceof byte[]) ?
new String((byte[]) this.payload, StandardCharsets.UTF_8) : this.payload.toString();
}
}
private static class StompConnectedFrameMessageMatcher extends StompFrameMessageMatcher {
public StompConnectedFrameMessageMatcher(String sessionId) {
super(StompCommand.CONNECTED, sessionId);
}
}
}
| [
"34465021+jwfl724168@users.noreply.github.com"
] | 34465021+jwfl724168@users.noreply.github.com |
3e0bd1fb0f7ddcb2232c01d91e33d4266fe5a04d | 893dcab529cd0e93968c7131a4ac734d7ed0acb6 | /src/com/loiane/estruturadados/vetor/teste/Aula06.java | 80e4c5925d04dea470b441437af9431a06b49189 | [] | no_license | loiane/estrutura-dados-algoritmos-java | bd637569e8b02ccfd4037c393f783124934d07a2 | 2abb845a38c5d0b2903dd80ab8b76006a9508a91 | refs/heads/master | 2022-09-06T09:48:49.923288 | 2022-09-01T23:07:02 | 2022-09-01T23:07:02 | 50,466,225 | 207 | 102 | null | 2022-02-16T01:04:14 | 2016-01-26T23:14:50 | Java | UTF-8 | Java | false | false | 408 | java | package com.loiane.estruturadados.vetor.teste;
import com.loiane.estruturadados.vetor.Vetor;
public class Aula06 {
public static void main(String[] args) {
Vetor vetor = new Vetor(10);
vetor.adiciona("elemento 1"); //0
vetor.adiciona("elemento 2"); //1
vetor.adiciona("elemento 3"); //2
System.out.println(vetor.busca("elemento 1"));
System.out.println(vetor.busca("elemento 4"));
}
}
| [
"loianeg@gmail.com"
] | loianeg@gmail.com |
0f55eb095bcc354199e67033e45158e0d3f7e703 | 7720dbad4808696e9de2e6ed15498ace799a1c12 | /haash-broker/src/main/java/com/test/cf/haash/repository/ServiceInstanceRepository.java | 980f89e2430f3e69ba6462e242ae56a6be49d45c | [] | no_license | chetnya/PCF-MY-ASSIGNMENT | 71d5ebedc7b09eb181a68c6963adf7c1948d0535 | e68ea7a7a165129104b18b2a9bec055c9de61cc3 | refs/heads/master | 2020-06-25T07:23:13.811253 | 2017-07-12T04:35:35 | 2017-07-12T04:35:35 | 96,964,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 284 | java | package com.test.cf.haash.repository;
import com.test.cf.haash.model.ServiceInstance;
import org.springframework.data.repository.CrudRepository;
/**
* Created by pivotal on 6/26/14.
*/
public interface ServiceInstanceRepository extends CrudRepository<ServiceInstance, String> {
}
| [
"githubgagan@gmail.com"
] | githubgagan@gmail.com |
688e89fe2c215aadf978801a33057ea3448ea860 | e4b3c6f9268f07254c217aad308a8931057021b2 | /lab07/com/mycorp/account/SavingsAccount.java | 746762b7e2a89d480da4bd9377e006b9ee1f57af | [] | no_license | ThoughtFlow/Java_bootcamp | 1d8a5f252faf849ab8f539725439f716784cc20e | b35de74b957493bd034cfc6d008af6a00886d64d | refs/heads/master | 2020-12-24T19:37:18.869197 | 2016-05-26T23:42:14 | 2016-05-26T23:42:14 | 59,216,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,849 | java | package lab07.com.mycorp.account;
import lab07.com.mycorp.customer.Customer;
/**
* This class represents the Savings account. It is derived from CheckingAccount.
*
* @author Nick Maiorano
* @version 1.0
*/
public class SavingsAccount extends CheckingAccount {
private static final String ACCOUNT_TYPE = "Savings";
private static double annualInterestRate;
/**
* Creates an instance with a given customer and balance. Sets the account type to "Savings".
*
* @param customer The customer attached to this account.
* @param balance The initial balance.
*/
public SavingsAccount(Customer customer, double balance) {
super(customer, balance, ACCOUNT_TYPE);
}
/**
* Creates an instance with a given customer and zero balance. Sets the account type to "Savings".
*
* @param customer The customer attached to this account.
*/
public SavingsAccount(Customer customer) {
super(customer, ACCOUNT_TYPE);
}
/**
* Sets the interest rate.
*
* @param annualInterestRate Rate to set.
*/
public static void setAnnualInterestRate(double annualInterestRate) {
SavingsAccount.annualInterestRate = annualInterestRate;
}
/**
* Credits the account with the interest accrued.
*/
public void creditInterest() {
double interest = getBalance() * annualInterestRate / 12;
credit(interest);
}
/**
* {@inheritDoc}
*
* Additional comments go here.
*/
@Override
public boolean equals(Object obj) {
return super.equals(obj);
}
/**
* {@inheritDoc}
*
* Additional comments go here.
*/
@Override
public int hashCode() {
return super.hashCode();
}
/**
* {@inheritDoc}
*
* Additional comments go here.
*/
@Override
public String toString() {
return "SavingsAccount [Customer=" + getCustomer() + " Number=" + getNumber() + ", Balance()=" + getBalance() + "]";
}
} | [
"info@thoughtflow.ca"
] | info@thoughtflow.ca |
648f568d8a415bd11d387cc49d1eff68fe337fce | 4f63489bf28f5e4043aa57b934b6b3c5c1fdc069 | /movies/TheaterTester.java | f9c8444f421a898d25e1153f76bfc02c26ebbeb3 | [] | no_license | Anita-Naragund/Arrays | 8a0a46ea66cc63d003bb45ffa842df23e765b051 | 436ac71e4de0505468614b619d0372f85f829407 | refs/heads/main | 2023-03-01T09:20:35.619448 | 2020-12-17T18:42:33 | 2020-12-17T18:42:33 | 306,389,620 | 0 | 0 | null | 2020-10-24T01:39:35 | 2020-10-22T16:00:50 | Java | UTF-8 | Java | false | false | 781 | java | package com.xworkz.movies;
import java.util.Arrays;
import com.xworkz.movies.moviehub.MovieHub;
public class TheaterTester {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Invoke main method");
String[] movieNames = { "PK", "KGF", "Shivam", "Zodiac", "Avengures", "Jentelman", "Chennie express",
"Departed", "Inception", "Interstella" };
MovieHub movieHub=new MovieHub("Navaranga",500,movieNames);
System.out.println(movieHub.getTheaterName());
System.out.println(movieHub.getTotalTickets());
String convertedMovieName=Arrays.toString(movieHub.getMovieName());
System.out.println(convertedMovieName);
System.out.println(movieHub.bookTicketsAndGetTotalPrice("PK", 5, "Anita"));
}
}
| [
"noreply@github.com"
] | Anita-Naragund.noreply@github.com |
e7e496dfa5298d84c330bb1c7721370d5e8ca5a0 | afff2a82c877200b31a91a2bc71b6c66addcca4b | /SSM/src/com/mapper/CarsMapper.java | cd65801b6a2e64c1ddef7690491620f950bd9b48 | [] | no_license | PANXLA/Git | 4e255ddd60288117fbfd1512acca5258762a2751 | 5298de72a9ea800a7d5b9e9ac6276a25a614b276 | refs/heads/master | 2023-01-24T10:37:17.215159 | 2020-11-30T13:28:18 | 2020-11-30T13:28:18 | 317,234,200 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,254 | java | package com.mapper;
import com.pojo.Cars;
import com.pojo.CarsExample;
import java.util.HashMap;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CarsMapper {
int countByExample(CarsExample example);
int deleteByExample(CarsExample example);
int deleteByPrimaryKey(Integer id);
int insert(Cars record);
int insertSelective(Cars record);
List<Cars> selectByExample(CarsExample example);
Cars selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") Cars record, @Param("example") CarsExample example);
int updateByExample(@Param("record") Cars record, @Param("example") CarsExample example);
int updateByPrimaryKeySelective(Cars record);
int updateByPrimaryKey(Cars record);
List<HashMap> selectAll();
void insertCar(Cars car);
List<HashMap> findByPage(HashMap<String, Object> pd);
int carscount();
void delById(Cars car);
void addorder(HashMap<String, Object> pd);
List<HashMap> rentcarinfo(HashMap<String, Object> pd);
int rentcarinfocount();
void addtimerange(HashMap<String, Object> pd);
void updatecar(HashMap<String, Object> pd);
void updatecarstats();
List<HashMap> checkTimeRange(HashMap<String, Object> pd);
} | [
"172663886@qq.com"
] | 172663886@qq.com |
1ef42bfbf3731faa951b15c946edf9a1271033b7 | 1f8656c1faed6354dc2b8f954df95c04b6e94df2 | /src/main/java/cn/changan/entity/Student.java | e7c1ff9e37c3197c9a5c88a4dbed10fdd45ae886 | [] | no_license | ningjiangzhu/scholarship | c5862b9f003a6df1a9e154e950537a532ecb8406 | 67ff228a137d17249544e6cb7e406e08cde0bcf8 | refs/heads/master | 2022-12-29T08:04:14.026520 | 2020-10-22T02:48:21 | 2020-10-22T02:48:21 | 289,655,921 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,773 | java | package cn.changan.entity;
import java.util.Date;
public class Student {
private String student_id;
private String student_name;
private String sex;
private Date birth;
private String nationality;
private String id_card;
private String native_place;
private String politic_face;
private String student_year;
private String department;
private String major;
private String student_class;
private String phone_number;
private String portrait;
public String getStudent_id() {
return student_id;
}
public void setStudent_id(String student_id) {
this.student_id = student_id;
}
public String getStudent_name() {
return student_name;
}
public void setStudent_name(String student_name) {
this.student_name = student_name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public Date getBirth() {
return birth;
}
public void setBirth(Date birth) {
this.birth = birth;
}
public String getNationality() {
return nationality;
}
public void setNationality(String nationality) {
this.nationality = nationality;
}
public String getId_card() {
return id_card;
}
public void setId_card(String id_card) {
this.id_card = id_card;
}
public String getNative_place() {
return native_place;
}
public void setNative_place(String native_place) {
this.native_place = native_place;
}
public String getPolitic_face() {
return politic_face;
}
public void setPolitic_face(String politic_face) {
this.politic_face = politic_face;
}
public String getStudent_year() {
return student_year;
}
public void setStudent_year(String student_year) {
this.student_year = student_year;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
public String getStudent_class() {
return student_class;
}
public void setStudent_class(String student_class) {
this.student_class = student_class;
}
public String getPhone_number() {
return phone_number;
}
public void setPhone_number(String phone_number) {
this.phone_number = phone_number;
}
public String getPortrait() {
return portrait;
}
public void setPortrait(String portrait) {
this.portrait = portrait;
}
}
| [
"979207315@qq.com"
] | 979207315@qq.com |
3a9e856c48aea859d5eeb71f239bd3e4ea3951a0 | 585b32aa908a603aed56565f54e0e4bc44e3a9e9 | /fastutil-6.4.6/src/it/unimi/dsi/fastutil/objects/Object2FloatArrayMap.java | c2143ad0be13c552b006bcb44434916239569765 | [
"Apache-2.0"
] | permissive | commoncrawl/example-languageentropy | 212008c219f2a2822321ca4e02bd35c4fb7eff1d | 0653cf112f1c16dec4b16f4503feba6b100a7440 | refs/heads/master | 2021-01-16T23:13:59.123943 | 2013-01-15T11:25:11 | 2013-01-15T11:25:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,984 | java | /* Generic definitions */
/* Assertions (useful to generate conditional code) */
/* Current type and class (and size, if applicable) */
/* Value methods */
/* Interfaces (keys) */
/* Interfaces (values) */
/* Abstract implementations (keys) */
/* Abstract implementations (values) */
/* Static containers (keys) */
/* Static containers (values) */
/* Implementations */
/* Synchronized wrappers */
/* Unmodifiable wrappers */
/* Other wrappers */
/* Methods (keys) */
/* Methods (values) */
/* Methods (keys/values) */
/* Methods that have special names depending on keys (but the special names depend on values) */
/* Equality */
/* Object/Reference-only definitions (keys) */
/* Object/Reference-only definitions (values) */
/* Primitive-type-only definitions (values) */
/*
* Copyright (C) 2007-2012 Sebastiano Vigna
*
* 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 it.unimi.dsi.fastutil.objects;
import java.util.Map;
import java.util.NoSuchElementException;
import it.unimi.dsi.fastutil.objects.AbstractObjectIterator;
import it.unimi.dsi.fastutil.objects.AbstractObjectSet;
import it.unimi.dsi.fastutil.objects.ObjectIterator;
import it.unimi.dsi.fastutil.floats.FloatCollection;
import it.unimi.dsi.fastutil.floats.FloatCollections;
import it.unimi.dsi.fastutil.floats.FloatArraySet;
import it.unimi.dsi.fastutil.floats.FloatArrays;
/** A simple, brute-force implementation of a map based on two parallel backing arrays.
*
* <p>The main purpose of this
* implementation is that of wrapping cleanly the brute-force approach to the storage of a very
* small number of pairs: just put them into two parallel arrays and scan linearly to find an item.
*/
public class Object2FloatArrayMap <K> extends AbstractObject2FloatMap <K> implements java.io.Serializable, Cloneable {
private static final long serialVersionUID = 1L;
/** The keys (valid up to {@link #size}, excluded). */
private transient Object[] key;
/** The values (parallel to {@link #key}). */
private transient float[] value;
/** The number of valid entries in {@link #key} and {@link #value}. */
private int size;
/** Creates a new empty array map with given key and value backing arrays. The resulting map will have as many entries as the given arrays.
*
* <p>It is responsibility of the caller that the elements of <code>key</code> are distinct.
*
* @param key the key array.
* @param value the value array (it <em>must</em> have the same length as <code>key</code>).
*/
public Object2FloatArrayMap( final Object[] key, final float[] value ) {
this.key = key;
this.value = value;
size = key.length;
if( key.length != value.length ) throw new IllegalArgumentException( "Keys and values have different lengths (" + key.length + ", " + value.length + ")" );
}
/** Creates a new empty array map.
*/
public Object2FloatArrayMap() {
this.key = ObjectArrays.EMPTY_ARRAY;
this.value = FloatArrays.EMPTY_ARRAY;
}
/** Creates a new empty array map of given capacity.
*
* @param capacity the initial capacity.
*/
public Object2FloatArrayMap( final int capacity ) {
this.key = new Object[ capacity ];
this.value = new float[ capacity ];
}
/** Creates a new empty array map copying the entries of a given map.
*
* @param m a map.
*/
public Object2FloatArrayMap( final Object2FloatMap <K> m ) {
this( m.size() );
putAll( m );
}
/** Creates a new empty array map copying the entries of a given map.
*
* @param m a map.
*/
public Object2FloatArrayMap( final Map<? extends K, ? extends Float> m ) {
this( m.size() );
putAll( m );
}
/** Creates a new array map with given key and value backing arrays, using the given number of elements.
*
* <p>It is responsibility of the caller that the first <code>size</code> elements of <code>key</code> are distinct.
*
* @param key the key array.
* @param value the value array (it <em>must</em> have the same length as <code>key</code>).
* @param size the number of valid elements in <code>key</code> and <code>value</code>.
*/
public Object2FloatArrayMap( final Object[] key, final float[] value, final int size ) {
this.key = key;
this.value = value;
this.size = size;
if( key.length != value.length ) throw new IllegalArgumentException( "Keys and values have different lengths (" + key.length + ", " + value.length + ")" );
if ( size > key.length ) throw new IllegalArgumentException( "The provided size (" + size + ") is larger than or equal to the backing-arrays size (" + key.length + ")" );
}
private final class EntrySet extends AbstractObjectSet<Object2FloatMap.Entry <K> > implements FastEntrySet <K> {
@Override
public ObjectIterator<Object2FloatMap.Entry <K> > iterator() {
return new AbstractObjectIterator<Object2FloatMap.Entry <K> >() {
int next = 0;
public boolean hasNext() {
return next < size;
}
@SuppressWarnings("unchecked")
public Entry <K> next() {
if ( ! hasNext() ) throw new NoSuchElementException();
return new AbstractObject2FloatMap.BasicEntry <K>( (K) key[ next ], value[ next++ ] );
}
};
}
public ObjectIterator<Object2FloatMap.Entry <K> > fastIterator() {
return new AbstractObjectIterator<Object2FloatMap.Entry <K> >() {
int next = 0;
final BasicEntry <K> entry = new BasicEntry <K> ( (null), (0) );
public boolean hasNext() {
return next < size;
}
@SuppressWarnings("unchecked")
public Entry <K> next() {
if ( ! hasNext() ) throw new NoSuchElementException();
entry.key = (K) key[ next ];
entry.value = value[ next++ ];
return entry;
}
};
}
public int size() {
return size;
}
@SuppressWarnings("unchecked")
public boolean contains( Object o ) {
if ( ! ( o instanceof Map.Entry ) ) return false;
final Map.Entry<K, Float> e = (Map.Entry<K, Float>)o;
final K k = (e.getKey());
return Object2FloatArrayMap.this.containsKey( k ) && ( (Object2FloatArrayMap.this.get( k )) == (((e.getValue()).floatValue())) );
}
}
public FastEntrySet <K> object2FloatEntrySet() {
return new EntrySet();
}
private int findKey( final Object k ) {
final Object[] key = this.key;
for( int i = size; i-- != 0; ) if ( ( (key[ i ]) == null ? (k) == null : (key[ i ]).equals(k) ) ) return i;
return -1;
}
@SuppressWarnings("unchecked")
public float getFloat( final Object k ) {
final Object[] key = this.key;
for( int i = size; i-- != 0; ) if ( ( (key[ i ]) == null ? (k) == null : (key[ i ]).equals(k) ) ) return value[ i ];
return defRetValue;
}
public int size() {
return size;
}
@Override
public void clear() {
for( int i = size; i-- != 0; ) {
key[ i ] = null;
}
size = 0;
}
@Override
public boolean containsKey( final Object k ) {
return findKey( k ) != -1;
}
@Override
@SuppressWarnings("unchecked")
public boolean containsValue( float v ) {
for( int i = size; i-- != 0; ) if ( ( (value[ i ]) == (v) ) ) return true;
return false;
}
@Override
public boolean isEmpty() {
return size == 0;
}
@Override
@SuppressWarnings("unchecked")
public float put( K k, float v ) {
final int oldKey = findKey( k );
if ( oldKey != -1 ) {
final float oldValue = value[ oldKey ];
value[ oldKey ] = v;
return oldValue;
}
if ( size == key.length ) {
final Object[] newKey = new Object[ size == 0 ? 2 : size * 2 ];
final float[] newValue = new float[ size == 0 ? 2 : size * 2 ];
for( int i = size; i-- != 0; ) {
newKey[ i ] = key[ i ];
newValue[ i ] = value[ i ];
}
key = newKey;
value = newValue;
}
key[ size ] = k;
value[ size ] = v;
size++;
return defRetValue;
}
@Override
@SuppressWarnings("unchecked")
public float removeFloat( final Object k ) {
final int oldPos = findKey( k );
if ( oldPos == -1 ) return defRetValue;
final float oldValue = value[ oldPos ];
final int tail = size - oldPos - 1;
for( int i = 0; i < tail; i++ ) {
key[ oldPos + i ] = key[ oldPos + i + 1 ];
value[ oldPos + i ] = value[ oldPos + i + 1 ];
}
size--;
key[ size ] = null;
return oldValue;
}
@Override
@SuppressWarnings("unchecked")
public ObjectSet <K> keySet() {
return new ObjectArraySet <K>( key, size );
}
@Override
public FloatCollection values() {
return FloatCollections.unmodifiable( new FloatArraySet ( value, size ) );
}
/** Returns a deep copy of this map.
*
* <P>This method performs a deep copy of this hash map; the data stored in the
* map, however, is not cloned. Note that this makes a difference only for object keys.
*
* @return a deep copy of this map.
*/
@SuppressWarnings("unchecked")
public Object2FloatArrayMap <K> clone() {
Object2FloatArrayMap <K> c;
try {
c = (Object2FloatArrayMap <K>)super.clone();
}
catch(CloneNotSupportedException cantHappen) {
throw new InternalError();
}
c.key = key.clone();
c.value = value.clone();
return c;
}
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
s.defaultWriteObject();
for( int i = 0; i < size; i++ ) {
s.writeObject( key[ i ] );
s.writeFloat( value[ i ] );
}
}
@SuppressWarnings("unchecked")
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
key = new Object[ size ];
value = new float[ size ];
for( int i = 0; i < size; i++ ) {
key[ i ] = s.readObject();
value[ i ] = s.readFloat();
}
}
}
| [
"participant@hadoop-vm.(none)"
] | participant@hadoop-vm.(none) |
2ba28cd0d2d83e5fb74b33cb5d61e722a9dbe16c | 5e7eb07633fede119e2f6f055e32e954ea529949 | /src/main/java/com/aikeeper/speed/kill/system/api/SpeedKillOrderInfoService.java | 56ae6f6fdd0d23e648c9e7c40d34e28b76896982 | [] | no_license | Eric-LBJ/speedKillSystem | eaab549ac602523244fa4a27953c36b4532ad7b6 | 9ee9fd49e34d87ecc9a9e2b76f18774fba174cbb | refs/heads/master | 2022-06-28T21:33:59.597440 | 2019-12-10T09:21:17 | 2019-12-10T09:21:17 | 224,122,079 | 0 | 0 | null | 2022-06-17T02:42:43 | 2019-11-26T06:48:42 | Java | UTF-8 | Java | false | false | 1,129 | java | package com.aikeeper.speed.kill.system.api;
import com.aikeeper.speed.kill.system.domain.vo.SpeedKillOrderInfoVO;
import java.util.List;
/**
* @author
*/
public interface SpeedKillOrderInfoService {
/**
* 删除秒杀订单信息
*
* @param id
* @return
*/
Boolean deleteByPrimaryKey(Long id);
/**
* 新增秒杀订单信息
*
* @param record
* @return
*/
Boolean insert(SpeedKillOrderInfoVO record);
/**
* 根据id获取秒杀订单信息
*
* @param id
* @return
*/
SpeedKillOrderInfoVO selectByPrimaryKey(Long id);
/**
* 获取秒杀订单信息列表
*
* @return
*/
List<SpeedKillOrderInfoVO> selectAll();
/**
* 更新秒杀订单信息
*
* @param record
* @return
*/
Boolean updateByPrimaryKey(SpeedKillOrderInfoVO record);
/**
* 根据用户id和商品id获取秒杀订单信息
*
* @param userId
* @param goodsId
* @return
*/
SpeedKillOrderInfoVO getSpeedKillOrderInfoByUserAndGoodsId(Long userId, Long goodsId);
} | [
"ga.zhang@ailivingtech.com"
] | ga.zhang@ailivingtech.com |
11e4cacb8b391d1e609b7a0b1a5e667377530d36 | de3569dc00c12e707a57def0946450a4e4a38449 | /project/src/jp/ac/uec/is/fs/tadalab/hidetaka/lib/opengl/Figure.java | 7ec9903e999c0bb1a8e8a4ebfcc22a77fc7dd557 | [] | no_license | YoheiMurata/openGLforAndroid | 88d6798c334338254e6c7b982087e1b20cdf03c9 | 5bb12655e7b16eed2442c725ecb20a3023abf83f | refs/heads/master | 2021-01-01T05:51:01.446482 | 2013-10-02T13:52:34 | 2013-10-02T13:52:34 | null | 0 | 0 | null | null | null | null | SHIFT_JIS | Java | false | false | 360 | java | package jp.ac.uec.is.fs.tadalab.hidetaka.lib.opengl;
import java.util.ArrayList;
import java.util.HashMap;
//フィギュア
public class Figure {
public HashMap<String,Material> materials;//マテリアル群
public ArrayList<Mesh> meshs; //メッシュ群
//描画
public void draw() {
for (Mesh mesh:meshs) mesh.draw();
}
}
| [
"fullmetaljacket893@gmail.com"
] | fullmetaljacket893@gmail.com |
6451b75c7c422cf9ece083653807d7bd3fa7b15e | 571b14d115b1172bd75668224e4e6f34aa5bd632 | /src/com/job/serviceImpl/SecurityServiceImpl.java | 48f5873c18871674776117bab05bc6fe3ec0d121 | [] | no_license | xiaotmh/recruiteOnline | 05e70365ab6a94ce8d8258b92aec22c01d4ad961 | 627a7c8ec76861a2598416751a1d63aa93ba6212 | refs/heads/master | 2020-12-05T04:45:21.085003 | 2018-03-09T13:51:45 | 2018-03-09T13:51:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,172 | java | package com.job.serviceImpl;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.security.NoSuchAlgorithmException;
import java.sql.Timestamp;
import java.util.HashMap;
import javax.servlet.http.Cookie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.job.dao.JobDao;
import com.job.dao.ManDao;
import com.job.dao.ManLogDao;
import com.job.dao.ManRegDao;
import com.job.dao.StuDao;
import com.job.dao.StuLogDao;
import com.job.dao.StuRegDao;
import com.job.entity.Man;
import com.job.entity.ManLog;
import com.job.entity.ManReg;
import com.job.entity.Stu;
import com.job.entity.StuLog;
import com.job.entity.StuReg;
import com.job.json.LoginJson;
import com.job.json.MsgJson;
import com.job.json.RegisterJson;
import com.job.service.SecurityService;
import com.job.tools.MyCookie;
import com.job.tools.MyEnCoding;
import com.job.tools.MyMsgJson;
import com.job.tools.MyTimestramp;
@Service("securityService")
public class SecurityServiceImpl implements SecurityService {
@Autowired
private StuDao stuDao;
@Autowired
private StuLogDao stuLogDao;
@Autowired
private StuRegDao stuRegDao;
@Autowired
private ManDao manDao;
@Autowired
private ManLogDao manLogDao;
@Autowired
private ManRegDao manRegDao;
// 注册用户服务
// 事务的管理 无事务就创建新事务 存在事务就在该事务中进行
@Transactional(propagation = Propagation.REQUIRED)
@Override
public MsgJson<String, Object> register(MsgJson<String, Object> msgFromController) {
// 获取注册信息
RegisterJson registerJson = (RegisterJson) msgFromController.getJsonData("registerJson");
String registerEmail = registerJson.getRegisterEmail();
String registerPassword = registerJson.getRegisterPassword();
boolean asManager;
if (registerJson.getAsManager().length == 3)
asManager = true;
else
asManager = false;
// 初始化 返回消息 返回给前端的session或response或request
MsgJson<String, Object> msgToController = MyMsgJson.newMsgjson();
msgToController.setMsg("注册成功");
// 如果存在cookie分隔符& 也就是非法字符 则报错
if (registerEmail.contains("&")) {
msgToController.setMsg("注册失败:邮箱存在非法字符'&'");
msgToController.setState(false);
return msgToController;
}
// 如果用户名存在,否则返回主界面
if (stuDao.getStuByEmail(registerEmail) == null && manDao.getManByEmail(registerEmail) == null) {
// 获得MD5加密的密码,失败则返回注册界面
try {
registerPassword = MyEnCoding.encoderByMd5(registerPassword);
} catch (Exception e) {
msgToController.setMsg("注册失败:加密错误");
msgToController.setState(false);
return msgToController;
}
// 获得注册时间
Timestamp registerTimestamp = MyTimestramp.setTime(new Timestamp(System.currentTimeMillis()));
// 初始化自动登录有效时间
Timestamp lastTimestamp = MyTimestramp.setTime(new Timestamp(System.currentTimeMillis()));
if (asManager) {
// 封装用户注册数据
Man register = new Man(1, registerEmail, registerPassword);
// 如果注册成功,保存登录状态,前往获取用户信息,否则回到注册界面
if (manDao.insertMan(register) == 1) {
// 更新stuReg表中用户的信息数据
ManReg manReg = new ManReg(register.getManId(), registerTimestamp, "袁伟伦");
// 更新stuLog表中的数据
ManLog manLog = new ManLog(register.getManId(), lastTimestamp, lastTimestamp);
manRegDao.insertManReg(manReg);
manLogDao.insertManLog(manLog);
// 设置session中的用户信息
msgToController.setSessionData("email", registerEmail);
// 设置session的 attr 使得控制层可以接收到需要返回给前端的属性
msgToController.setSessionData("isLogin", "yes");
msgToController.setSessionData("asManager", "yes");
msgToController.setSessionData("manId", register.getManId());
} else {
msgToController.setMsg("注册失败:系统错误");
msgToController.setState(false);
return msgToController;
}
} else {
// 封装用户注册数据
Stu register = new Stu(1, registerEmail, registerPassword);
// 如果注册成功,保存登录状态,前往获取用户信息,否则回到注册界面
if (stuDao.insertStu(register) == 1) {
// 更新stuReg表中用户的信息数据
StuReg stuReg = new StuReg(register.getStuId(), registerTimestamp, "袁伟伦");
// 更新stuLog表中的数据
StuLog stuLog = new StuLog(register.getStuId(), lastTimestamp, lastTimestamp);
stuRegDao.insertStuReg(stuReg);
stuLogDao.insertStuLog(stuLog);
// 设置session中的用户信息
msgToController.setSessionData("email", registerEmail);
// 设置session的 attr 使得控制层可以接收到需要返回给前端的属性
msgToController.setSessionData("isLogin", "yes");
msgToController.setSessionData("asManager", "no");
msgToController.setSessionData("stuId", register.getStuId());
} else {
msgToController.setMsg("注册失败:系统错误");
msgToController.setState(false);
return msgToController;
}
}
msgToController.setJsonData("page", "/recruiteOnline/page/main");
} else {
// 用户名存在,返回主界面
msgToController.setMsg("邮箱已存在");
msgToController.setState(false);
return msgToController;
}
return msgToController;
}
// 自动登录服务
@Override
public MsgJson<String, Object> freeLogin(MsgJson<String, Object> msgFromController) {
// 初始化 返回消息 没有返回给前端的session或response或request
MsgJson<String, Object> msgToController = MyMsgJson.newMsgjson();
// 获取用户登录状态 下标为0代表取的是session的hashmap
HashMap<String, Object> sessionMap = msgFromController.getSessionDataMap();
// 用户没有登录
if (sessionMap.get("isLogin") == null) {
// 获取request中的cookies数组
Cookie cookies[] = (Cookie[]) msgFromController.getRequestData("cookies");
// 如果有cookie,获得cookies数组
Cookie cookie = MyCookie.getCookie(cookies, "recruiteOnline");
// 如果cookie不为空 解析cookie内容
if (cookie != null) {
// 获得cookie值,并base64解码用“&”分割
String value[] = null;
// 对读取的cookie解码获取正确的值
String cookieValue = URLDecoder.decode(cookie.getValue());
// 得到value[]分别为[0]账号[1]MD5(账号+MD5(密码)+有效时间)[2]有效时间
value = MyEnCoding.getFromBase64(cookieValue).split("&");
System.out.println("读取时的value" + cookie.getValue());
for (int i = 0; i < value.length; i++) {
System.out.println("value的第" + i + "段" + value[i]);
}
// 如果长度不为3 自动登录失败
if (value.length != 3) {
msgToController.setMsg("cookie读取错误,自动登录失败");
System.out.println("cookie读取错误,自动登录失败");
msgToController.setState(false);
msgToController.setJsonData("page", "login");
return msgToController;
}
// 如果有效时间超时,自动登陆失败
if (Timestamp.valueOf(value[2]).getTime() - new Timestamp(System.currentTimeMillis()).getTime() < 0) {
msgToController.setMsg("cookie已超时,自动登录失败");
System.out.println("cookie已超时,自动登录失败");
msgToController.setState(false);
msgToController.setJsonData("page", "login");
return msgToController;
}
Stu stu = stuDao.getStuByEmail(value[0]);
Man man = manDao.getManByEmail(value[0]);
// 根据账号查找 不存在则失败
if (stu == null && man == null) {
msgToController.setMsg("根据cookie读取账号错误,自动登录失败");
System.out.println("根据cookie读取账号错误,自动登录失败");
msgToController.setState(false);
msgToController.setJsonData("page", "login");
return msgToController;
} else {
// 长度为3 有效时间未超时 账号存在 则判断cookie中的值是否有效
try {
if (stu == null) {
// 获得系统中用户注册信息的MD5(账号+MD5(密码)+有效时间)
String md5 = MyEnCoding.encoderByMd5(value[0] + stuDao.getStuByEmail(value[0]).getPassword()
+ stuLogDao.getStuLog(stu.getStuId()).getAbleTime());
System.out.println("数据库的取出的值" + md5);
// 如果匹配则登录成功
if (value[1].equals(md5)) {
// 设置返回的session信息 下标0代表session
msgToController.setSessionData("isLogin", "yes");
msgToController.setSessionData("email", value[0]);
msgToController.setSessionData("manId", man.getManId());
msgToController.setSessionData("asManager", "yes");
msgToController.setJsonData("page", "platform");
}
} else {
// 获得系统中用户注册信息的MD5(账号+MD5(密码)+有效时间)
String md5 = MyEnCoding.encoderByMd5(value[0] + manDao.getManByEmail(value[0]).getPassword()
+ manLogDao.getManLog(man.getManId()).getAbleTime());
System.out.println("数据库的取出的值" + md5);
// 如果匹配则登录成功
if (value[1].equals(md5)) {
// 设置返回的session信息 下标0代表session
msgToController.setSessionData("isLogin", "yes");
msgToController.setSessionData("email", value[0]);
msgToController.setSessionData("stuId", stu.getStuId());
msgToController.setSessionData("asManager", "no");
msgToController.setJsonData("page", "platform");
}
}
} catch (Exception e) {
msgToController.setMsg("系统错误,自动登录失败");
System.out.println("系统错误,自动登录失败");
msgToController.setState(false);
msgToController.setJsonData("page", "login");
return msgToController;
}
}
} else { // 如果cookie为空 name直接跳转到主页 不做任何操作
msgToController.setMsg("找不到cookie,自动登录失败");
System.out.println("Service找不到cookie,自动登录失败");
msgToController.setState(false);
msgToController.setJsonData("page", "login");
return msgToController;
}
}
msgToController.setJsonData("page", "platform");
return msgToController;
}
// 登录服务
@Override
public MsgJson<String, Object> login(MsgJson<String, Object> msgFromController) {
// 获得表单信息
LoginJson loginJson = (LoginJson) msgFromController.getJsonData("loginJson");
String loginEmail = loginJson.getLoginEmail();
String loginPassword = loginJson.getLoginPassword();
String loginRemenber[] = loginJson.getLoginRemenber();
if (loginRemenber.length == 2) {
System.out.println("未勾选7天");
} else {
System.out.println("已勾选7天");
}
// 初始化提示消息msg
MsgJson<String, Object> msgToController = MyMsgJson.newMsgjson();
msgToController.setMsg("登录成功");
// 获取用户注册信息
Stu stu = stuDao.getStuByEmail(loginEmail);
Man man = manDao.getManByEmail(loginEmail);
if (stu == null && man == null) {
msgToController.setMsg("邮箱不存在");
msgToController.setState(false);
return msgToController;
}
// 获取当前系统的时间戳
Timestamp lastTimestamp = MyTimestramp.setTime(new Timestamp(System.currentTimeMillis()));
// 如果用户名和密码不为空获取用户名和密码,否则返回登录界面
if (loginEmail != null && loginPassword != null) {
// 获得MD5加密的密码,失败则返回注册界面
try {
loginPassword = MyEnCoding.encoderByMd5(loginPassword);
} catch (Exception e) {
msgToController.setMsg("密码加密失败");
msgToController.setState(false);
return msgToController;
}
// 前往匹配用户密码
if ((stu != null && stu.getEmail().equals(loginEmail) && stu.getPassword().equals(loginPassword))
|| (man != null && man.getEmail().equals(loginEmail) && man.getPassword().equals(loginPassword))) {
// 匹配成功保存用户登录状态
msgToController.setSessionData("isLogin", "yes");
if (stu == null) {
msgToController.setSessionData("email", man.getEmail());
msgToController.setSessionData("asManager", "yes");
msgToController.setSessionData("manId", man.getManId());
} else {
msgToController.setSessionData("email", stu.getEmail());
msgToController.setSessionData("asManager", "no");
msgToController.setSessionData("stuId", stu.getStuId());
}
msgToController.setJsonData("page", "/recruiteOnline/page/main");
// 如果勾选7天免登陆
// 保存客户端cookie
if (loginRemenber.length == 3) {
System.out.println("已经勾选7天免登陆 执行保存cookie操作");
// 设置自动登录有效时间为7天 7*24*60*60*1000毫秒
lastTimestamp = new Timestamp(System.currentTimeMillis());
long time = lastTimestamp.getTime();
time = time + 7 * 24 * 60 * 60 * 1000;
lastTimestamp = MyTimestramp.setTime(new Timestamp(time));
try {
// 更新cookie的value:base64(账号+MD5(账号+MD5(密码)+有效时间)+有效时间)
String CookieValue = MyEnCoding.getBase64(
loginEmail + "&" + MyEnCoding.encoderByMd5(loginEmail + loginPassword + lastTimestamp)
+ "&" + lastTimestamp);
// 对cookievalue进行编码 以防止出现特殊字符 导致cookie错误
CookieValue = URLEncoder.encode(CookieValue);
System.out.println("登录时保存的cookie" + CookieValue);
Cookie cookie = new Cookie("recruiteOnline", CookieValue);
cookie.setMaxAge(7 * 24 * 60 * 60);
// 写入responseHashMap供controller使用
msgToController.setResponseData("cookie", cookie);
// 更新 数据库表中的lastTime自动登录有效时间
if (stu == null) {
ManLog manLog = new ManLog(man.getManId(),
MyTimestramp.setTime(new Timestamp(System.currentTimeMillis())), lastTimestamp);
manLogDao.updateManLog(manLog);
} else {
StuLog stuLog = new StuLog(stu.getStuId(),
MyTimestramp.setTime(new Timestamp(System.currentTimeMillis())), lastTimestamp);
stuLogDao.updateStuLog(stuLog);
}
} catch (Exception e) {
msgToController.setMsg(msgToController.getMsg() + " 但是cookie保存失败");
System.out.println(msgToController.getMsg() + " 但是cookie在Service中保存失败");
}
}
} else {
msgToController.setMsg("用户名或密码错误");
msgToController.setState(false);
return msgToController;
}
} else {
// 用户名和密码为空,返回登录界面
msgToController.setMsg("请输入完整");
msgToController.setState(false);
return msgToController;
}
return msgToController;
}
// 注销服务
@Override
public MsgJson<String, Object> exit(MsgJson<String, Object> msgFromController) {
// 获得从控制层传来的数据
Cookie cookies[] = (Cookie[]) msgFromController.getRequestData("cookies");
// 初始化返回控制层的数据
MsgJson<String, Object> msgToController = MyMsgJson.newMsgjson();
msgToController.setMsg("退出成功");
// 如果有cookie,获得cookies数组
Cookie cookie = MyCookie.getCookie(cookies, "recruiteOnline");
if (cookie != null) {
cookie.setMaxAge(0);
msgToController.setResponseData("cookie", cookie);
msgToController.setMsg(msgToController.getMsg() + " cookie删除成功");
}
msgToController.setSessionData("session", "invalidate");
msgToController.setJsonData("page", "/recruiteOnline/page/login");
return msgToController;
}
// 修改密码
@Override
public void alterPwd(MsgJson<String, Object> msgFromController) {
String oldPassword = (String) msgFromController.getRequestData("oldPassword");
String newPassword = (String) msgFromController.getRequestData("newPassword");
if(msgFromController.getSessionData("stuId")==null){
int manId = (Integer) msgFromController.getSessionData("manId");
Man man = manDao.getMan(manId);
try {
if(man.getPassword().equals(MyEnCoding.encoderByMd5(oldPassword))){
//如果密码匹配 则更新数据库的加密密码
Man newMan = new Man(manId,man.getEmail(),MyEnCoding.encoderByMd5(newPassword));
manDao.updateMan(newMan);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
int stuId = (Integer) msgFromController.getSessionData("stuId");
Stu stu = stuDao.getStu(stuId);
try {
if(stu.getPassword().equals(MyEnCoding.encoderByMd5(oldPassword))){
//如果密码匹配 则更新数据库的加密密码
Stu newStu = new Stu(stuId,stu.getEmail(),MyEnCoding.encoderByMd5(newPassword));
stuDao.updateStu(newStu);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
| [
"842234092@qq.com"
] | 842234092@qq.com |
fb3665db6795679018687dba58c26a97d6d7d057 | 14001957f8ff9867c24b24c8838688686955c988 | /src/main/java/io/openslice/tmf/cm629/repo/CustomerRepository.java | 6595cfa11fedc9f926a9749fd7db2a9b72eae7b8 | [
"Apache-2.0"
] | permissive | openslice/io.openslice.tmf.api | a88d97590a714cb0080f6da4c64c59991b2b7543 | 65e7fe8d4ab68313d4413ad4d7be1a5cc0408435 | refs/heads/develop | 2023-09-01T23:14:22.653219 | 2023-08-31T15:11:45 | 2023-08-31T15:11:45 | 210,859,232 | 9 | 2 | Apache-2.0 | 2023-08-23T11:41:15 | 2019-09-25T14:00:53 | Java | UTF-8 | Java | false | false | 1,413 | java | /*-
* ========================LICENSE_START=================================
* io.openslice.tmf.api
* %%
* Copyright (C) 2019 openslice.io
* %%
* 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.
* =========================LICENSE_END==================================
*/
package io.openslice.tmf.cm629.repo;
import java.util.List;
import java.util.Optional;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
import io.openslice.tmf.cm629.model.Customer;
@Repository
public interface CustomerRepository extends CrudRepository<Customer, Long>, PagingAndSortingRepository<Customer, Long> {
Optional<Customer> findByUuid(String id);
Iterable<Customer> findByName( String name);
List<Customer> findByOrderByName();
}
| [
"tranoris@gmail.com"
] | tranoris@gmail.com |
2df7579020f08a7f12481eeb18b615de3404b413 | 81497c747fbf87378c286290d80b932877ac60da | /app/src/main/java/com/alkhair/helper/MyApplication.java | 38047b616a1858f3f895d10f7638d2ea9510602c | [] | no_license | hossamxp33/Khairs | 2ade4527dbd38bee60727b8253ff16dfbe7a7a87 | 488e8d21f568ba6ee84dda94aaf5a1ddca8c3cab | refs/heads/master | 2023-03-25T09:05:12.017579 | 2021-03-21T23:17:29 | 2021-03-21T23:17:29 | 350,109,110 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,855 | java | package com.alkhair.helper;
import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
import android.content.res.Resources;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.multidex.BuildConfig;
import androidx.multidex.MultiDex;
import com.facebook.stetho.Stetho;
/**
* Created by Hossam on 11/19/2020.
*/
public class MyApplication extends Application implements AppLifeCycleHandler.AppLifeCycleCallback {
public static final String TAG = MyApplication.class.getSimpleName();
@SuppressLint("StaticFieldLeak")
private static MyApplication mInstance;
@SuppressLint("StaticFieldLeak")
private static Context context;
public static synchronized MyApplication getInstance() {
return mInstance;
}
// public static Context getAppContext() {
// return context;
// }
@Override
public void onCreate() {
super.onCreate();
mInstance = this;
context = this;
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
if (BuildConfig.DEBUG) {
Stetho.initialize(Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
.build());
}
AppLifeCycleHandler appLifeCycleHandler = new AppLifeCycleHandler(this);
registerActivityLifecycleCallbacks(appLifeCycleHandler);
registerComponentCallbacks(appLifeCycleHandler);
}
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
@Override
public void onAppBackground() {
}
@Override
public void onAppForeground() {
}
}
| [
"hossamxp33"
] | hossamxp33 |
c182beaead3d83597935c3574db7d6ede312272d | b2ee8846b39a2b436c9ca49914b19ee180cfd0f9 | /src/main/java/za/co/magma/cmsproject/controllers/ExampleController.java | b2f63c1206a7372bbc57473335740b98ffddf7a1 | [] | no_license | ptchankue/cmsMagmaProject | eaadce8df6c4483b44d1316621b32700429f0f0a | 9cf9b575c5d613867c3250099820f25271bfcea7 | refs/heads/master | 2023-05-27T07:56:37.711459 | 2021-06-09T16:24:00 | 2021-06-09T16:24:00 | 358,856,086 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,390 | java | package za.co.magma.cmsproject.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import za.co.magma.cmsproject.domain.Person;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import static za.co.magma.cmsproject.constants.Constants.UPLOAD_FOLDER;
@Controller
public class ExampleController {
@GetMapping("/hello")
String viewHelloPage(Model model) {
model.addAttribute("person", new Person());
return "hello";
}
@PostMapping("/hello")
String addHelloPage(@ModelAttribute("person") Person person) {
System.out.println(person);
return "hello";
}
@GetMapping("/upload")
String uploadFile(Model model) {
return "upload";
}
@PostMapping("/upload")
String uploadFilePost(Model model, @RequestParam("files") MultipartFile file,
RedirectAttributes redirectAttributes) {
if (file.isEmpty()) {
redirectAttributes.addFlashAttribute("message", "Please select a file to upload");
return "redirect:upload";
}
try {
// Get the file and save it somewhere
byte[] bytes = file.getBytes();
Path path = Paths.get(UPLOAD_FOLDER + file.getOriginalFilename());
Files.write(path, bytes);
redirectAttributes.addFlashAttribute("message",
"You successfully uploaded '" + file.getOriginalFilename() + "'");
} catch (IOException e) {
e.printStackTrace();
}
model.addAttribute("files", file);
System.out.println(file);
return "redirect:upload";
}
@GetMapping("/tinymce")
String tinyMCEExample(Model model) {
model.addAttribute("person", new Person());
return "tinymce";
}
@RequestMapping("/tourism")
String myTest(Model model) {
String[] continents = {
"Africa", "Antarctica", "Asia", "Australia",
"Europe", "North America", "Sourth America"
};
// return "site1/Department of Tourism";
String[] menus = {
};
model.addAttribute("continents", continents);
return "site1/index";
}
@RequestMapping("/welcome")
public String hello(Model model, @RequestParam(value="name", required=false, defaultValue="World") String name) {
model.addAttribute("name", name);
return "welcome";
}
@RequestMapping("/ms")
String testMicrosoft() {
return "xtests/Microsoft Community";
}
@RequestMapping("/rental")
String testRental() {
return "xtests/rental";
}
@RequestMapping("/tmp/{templateName}")
String testGeneric(@PathVariable String templateName, Model model) {
Map<String, Map<String, String>> map = new HashMap<>();
Map<String, String> w3cc = new HashMap<>();
w3cc.put("title", "My Car");
map.put("w3css", w3cc);
model.addAttribute("values", map.get(templateName));
String temp = "xtests/" + templateName;
return temp;
}
}
| [
"psielinou@africanbank.co.za"
] | psielinou@africanbank.co.za |
aa48116a9fb7154cace14e2d2c7d13887459a436 | f8243f6166e3262a7183b87f19a8956ec8e68730 | /SpaceInvaders/core/src/com/space/invaders/actores/ElementoTexto.java | 5dfafe75ae514bf2be64a4b896faf1eaf3135961 | [
"MIT"
] | permissive | wilmerbz/dp-final-project | 862a248732491c1aca3f48c2b682004144f80da0 | 8e81e9a040b5c274030a3f495aca4ce639622d89 | refs/heads/master | 2021-01-23T18:25:04.796817 | 2017-11-14T19:04:02 | 2017-11-14T19:04:02 | 102,794,486 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,887 | java | package com.space.invaders.actores;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.GlyphLayout;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.space.invaders.interfaces.actores.IElementoJuego;
import com.space.invaders.recursos.texto.AdministradorTexto;
import com.space.invaders.recursos.texto.IAdministradorTexto;
import com.space.invaders.recursos.texto.NombreFuente;
/**
* Representa un elemento de texto del juego.
*/
public class ElementoTexto implements IElementoJuego {
private String texto;
private int tamano;
private Color color;
private Color colorSombra;
private float x;
private float y;
private String nombreFuente;
private BitmapFont fuente;
private GlyphLayout glyphLayout;
/**
* Crea un nuevo elemento de juego.
*
* @param texto
* Texto del elemento.
* @param fuente
* Fuente.
*/
public ElementoTexto(String texto, BitmapFont fuente) {
super();
this.texto = texto;
this.fuente = fuente;
inicializar();
}
/**
* Crea un nuevo elemento de texto.
*
* @param texto
* Texto del elemento.
* @param nombreFuente
* Nombre de la fuente.
* @param tamano
* Tamano del texto.
* @param color
* Color del texto.
*/
public ElementoTexto(String texto, String nombreFuente, int tamano, Color color) {
this.texto = texto;
this.nombreFuente = nombreFuente;
this.tamano = tamano;
this.color = color;
inicializar();
}
/**
* Crea un nuevo elemento de texto.
*
* @param texto
* Texto del elemento.
* @param nombreFuente
* Nombre de la fuente.
* @param tamano
* Tamano del texto.
* @param color
* Color del texto.
* @param colorSombra
* Color de sombra del texto.
*/
public ElementoTexto(String texto, String nombreFuente, int tamano, Color color, Color colorSombra) {
this.texto = texto;
this.nombreFuente = nombreFuente;
this.tamano = tamano;
this.color = color;
this.colorSombra = colorSombra;
inicializar();
}
public void inicializar() {
IAdministradorTexto administradorTexto = AdministradorTexto.getInstancia();
if (fuente == null) {
if (colorSombra != null) {
fuente = administradorTexto.obtenerFuente(nombreFuente, tamano, color, colorSombra);
} else {
fuente = administradorTexto.obtenerFuente(nombreFuente, tamano, color);
}
}
glyphLayout = administradorTexto.crearGlifoTexto(texto, fuente);
}
@Override
public void actualizar(float deltaTiempo) {
}
@Override
public void renderizar(SpriteBatch spriteBatch) {
fuente.draw(spriteBatch, glyphLayout, getX(), getY());
}
/**
* Obtiene el texto del elemento.
*
* @return Texto del elemento.
*/
public String getTexto() {
return texto;
}
/**
* Asigna el texto del elemento.
*
* @param texto
* Texto a asignar.
*/
public void setTexto(String texto) {
this.texto = texto;
glyphLayout.setText(fuente, texto);
}
/**
* Obtiene el tamano del texto.
*
* @return Tamano del texto.
*/
public int getTamano() {
return tamano;
}
/**
* Asgigna el tamano del texto.
*
* @param tamano
* Tamano del texto.
*/
public void setTamano(int tamano) {
this.tamano = tamano;
}
/**
* Obtiene el color del texto.
*
* @return Color del texto.
*/
public Color getColor() {
return color;
}
/**
* Asigna el color del texto.
*
* @param Color
* del texto.
*/
public void setColor(Color color) {
this.color = color;
}
/**
* Obtiene el color de la sombra del texto.
*
* @return Color de la sombra del texto.
*/
public Color getColorSombra() {
return colorSombra;
}
/**
* Asigna el color de la sombra del texto.
*
* @param colorSombra
* Color de la sombra del texto.
*/
public void setColorSombra(Color colorSombra) {
this.colorSombra = colorSombra;
}
@Override
public float getX() {
return x;
}
@Override
public void setX(float x) {
this.x = x;
}
@Override
public float getY() {
return y;
}
@Override
public void setY(float y) {
this.y = y;
}
@Override
public float getWidth() {
return glyphLayout.width;
}
@Override
public float getHeight() {
// TODO Auto-generated method stub
return glyphLayout.height;
}
@Override
public void setWidth(float width) {
glyphLayout.width = width;
}
@Override
public void setHeight(float height) {
glyphLayout.height = height;
}
/**
* Obtiene la fuente del elemento.
* @return Fuente.
*/
public BitmapFont getFuente() {
return fuente;
}
/**
* Asigna la fuente del elemento.
* @param fuente Fuente.
*/
public void setFuente(BitmapFont fuente) {
this.fuente = fuente;
glyphLayout.setText(fuente, texto);
}
}
| [
"wilmerbz@outlook.com"
] | wilmerbz@outlook.com |
464c29e762ee9a7c47c982bee6028c5debc05664 | 600f9427fe1e4855ed05c7331ba45c697f183aa0 | /CSE360/src/cse360assign2/SimpleList.java | 98856a76c3c1e22dc7f7b7cb31ad95d278e6eb83 | [] | no_license | pcphatar217/CSE360_Spring2020 | e9f8c41eeebc00c722615d169d12528396ef9fde | 44c5ec6109db21bb854c91584f13803902e3a1e0 | refs/heads/master | 2021-01-16T17:11:43.305283 | 2020-02-28T00:21:45 | 2020-02-28T00:21:45 | 243,192,641 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,638 | java |
/**
* @author Piyapot Charles Phataraphruk
* @ClassID 217
* @Assignment 2
* @since 2020-02-27
* This is a simple list program that can input up to 10 integers into an array,
* remove an integer from the array, print the array as a string, and locate
* the index of an integer in the array.
* This program is for assignment 2.
* URL to repository: https://github.com/pcphatar217/CSE360_Spring2020
*/
package cse360assign2;
/**
* The SimpleList class contains two private variables of an integer array list
* and integer counter. There is a constructor that initializes the two private
* variables. The program contains five methods which are add(), remove(),
* count(), toString(), search(),append(), first(), last(), and size().
*/
public class SimpleList
{
private int list[]; //Creates a private array variable
private int count; //Creates a private integer count variable
public SimpleList()
{ //Constructor
this.list = new int[10]; //Sets the size of the array to 10 elements
this.count = 0; //Sets the initial value of count to zero
}
/**
* This method adds and integer to the array list.
* If the array is not full then the method will
* shift the elements to the right starting from
* index location equal to the counter value.
* The current index will be overridden by the
* value in the previous index. The new value
* will then be placed in index zero and
* the counter will increment. But if the
* List is full then a copy array will be
* made but with 50% more spaces. The original
* values will be shifted by 1 to the right when
* copied so the new parameter can be added at
* index 0. The main list will then be set equal
* to the copy list which mean the main list is now
* updated.
* @param integer
*/
public void add(int integer)
{
int arrayLength = list.length; //arrayLength tells the current length of the array list.
if (count < arrayLength) //Instance where the array is not full
{
for(int shift = count;shift > 0;shift--)
{
list[shift]= list[shift - 1];
}
list[0]=integer;
this.count++;
}
else
{ //An instance where the array is full.
int increaseList50Percent = 0; //Used to help in increasing the size of the array list
increaseList50Percent=arrayLength+arrayLength/2; //Value of the length when increased by 50%.
int[] copyList = new int[increaseList50Percent]; //Creates a new array that will be the increase of the original list.
for(int copy = 0;copy < count;copy++) //Loop that copies the contents of the original list to the new.
{
copyList[copy+1] = list[copy]; //Leave the initial index empty for the new element.
}
list = copyList; //Copies the new list to the original which makes it larger
list[0]=integer; //Inputs the new value
this.count++; //Increase the count.
}
}
/**
* This method removes an element from the list.
* The method will scan the list for the
* parameter. If it is found, the method will
* start shifting elements from the parameter
* index and shift the elements from the right
* to the left. Once the elements have shifted,
* the method will override the last element
* with a zero and the counter will decrement.
* The remove method now check to see if more
* than 25% of the list are empty spaces and
* if so it will remove the empty spaces, unless
* if there is only one element in the list, by
* making a copy of the original list but
* without the empty spaces. The original list
* will then be set equal to the copy which means
* the list has been updated and the rest of the
* remove method will execute.
*
* @param integer
*/
public void remove(int integer)
{
int arrayLength = list.length; //arrayLength tells the current length of the array list.
int decreasedList25Percent = 0; //Used to help in decreasing the size of the array list
int emptySpace = 0;
int twentyFivePercentLength = 0;
twentyFivePercentLength = arrayLength / 4;
emptySpace = arrayLength - count;
for(int scan = 0;scan < count;scan++)
{
if (list[scan]==integer)
{
if(emptySpace > twentyFivePercentLength && arrayLength > 1)
{
decreasedList25Percent=arrayLength - twentyFivePercentLength; //Value of the length when decreased by 25%.
int[] copyList = new int[decreasedList25Percent]; //Creates a new array that will be the decrease of the original list.
for(int copy = 0;copy < count;copy++) //Loop that copies the contents of the original list to the new.
{
copyList[copy] = list[copy];
}
list = copyList; //Copies the new list to the original which makes it smaller
for(int shift = scan;shift < count-1;shift++)
{
list[shift] = list[shift+1];
}
list[count-1]=0;
this.count--;
}
else
{
for(int shift = scan;shift < count-1;shift++)
{
list[shift] = list[shift+1];
}
list[count-1]=0;
this.count--;
}
break;
}
}
}
/**
* This method returns the current
* integer value of count. Which is
* the current size of the array list.
* @return
*/
public int count()
{
return this.count;
}
/**
* This method converts the contents
* of the list into a string variable
* and spaces the elements apart. The
* method will then return a string
* of the elements in the list.
* @return
*/
public String toString()
{
String listString = "";
for(int increment = 0; increment < count; increment++)
{//
listString += list[increment] + " ";
}
return listString;
}
/**
* This method searches for the index
* of the value specified by the parameter.
* If the value is in the list then it will
* return the index location. If not then the
* method will return a negative one.
* @param integer
* @return
*/
public int search(int integer)
{
for(int scan = 0;scan < 10;scan++)
{
if (list[scan] == integer)
{
return scan;
}
}
return -1;
}
/**
* This method works similarly as add() however,
* it places the parameter at the end of the list.
* The method will check if the list is full and
* if that is the case, the list size
* will increase by 50%.
* @param integer
*/
public void append(int integer)
{
int arrayLength = list.length; //arrayLength tells the current length of the array list.
if (count < arrayLength) //Instance where the array is not full
{
list[count]=integer;
this.count++;
}
else { //An instance where the array is full.
int increaseList50Percent = 0; //Used to help in increasing the size of the array list
increaseList50Percent=arrayLength+arrayLength/2; //Value of the length when increased by 50%.
int[] copyList = new int[increaseList50Percent]; //Creates a new array that will be the increase of the original list.
for(int copy = 0;copy < count;copy++) //Loop that copies the contents of the original list to the new.
{
copyList[copy] = list[copy]; //Leave the initial index empty for the new element.
}
list = copyList; //Copies the new list to the original which makes it larger
list[count]=integer; //Inputs the new value
this.count++; //Increase the count.
}
}
/**
* This method returns the first value in the list.
* If there isn't then return -1.
* @return
*/
public int first()
{
if(count>0)
{
return list[0];
}
else
{
return -1;
}
}
/**
* This method returns the last value in the list.
* If there isn't then return -1.
* @return
*/
public int last()
{
if(count>0)
{
return list[count-1];
}
else
{
return -1;
}
}
/**
* This method returns the length of the list.
* @return
*/
public int size()
{
return this.list.length;
}
}
| [
"pcphatar@asu.edu"
] | pcphatar@asu.edu |
eee57aa4ea1084a73e3239778d62b2b36d9da87c | ca6c0917bdd494c979711d3591c46bd1dd8e4a77 | /app/src/main/java/com/vi/gamedex/model/ExternalGame.java | 2b8e2bb6975a67eb06e0ff4648b779e09c830537 | [] | no_license | joshua-hilborn/Gamedex | 492bb9997d064700542cc3a747147ee6e84a3a4a | 7896259886c90cacbe3ee7f341690fec4a967036 | refs/heads/master | 2020-08-14T16:30:28.580348 | 2019-11-20T02:07:27 | 2019-11-20T02:07:27 | 215,199,458 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,744 | java | package com.vi.gamedex.model;
import com.squareup.moshi.Json;
public class ExternalGame {
@Json(name = "id")
private int id;
@Json(name = "category")
private int category;
@Json(name = "created_at")
private int createdAt;
@Json(name = "game")
private int game;
@Json(name = "name")
private String name;
@Json(name = "uid")
private String uid;
@Json(name = "updated_at")
private int updatedAt;
@Json(name = "url")
private String url;
@Json(name = "year")
private int year;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getCategory() {
return category;
}
public void setCategory(int category) {
this.category = category;
}
public int getCreatedAt() {
return createdAt;
}
public void setCreatedAt(int createdAt) {
this.createdAt = createdAt;
}
public int getGame() {
return game;
}
public void setGame(int game) {
this.game = game;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public int getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(int updatedAt) {
this.updatedAt = updatedAt;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
}
| [
"josh.hilborn@gmail.com"
] | josh.hilborn@gmail.com |
e15d87ce33fc5c862a81de9db4ff38ca55e412ba | 7ebd6d4cf0e3a41658b433dc9edf20dfb1690530 | /backend/src/main/java/com/myapp/livro/security/jwt/TokenProvider.java | e57c8acabf004d649edf63cf740f94e4dcee021a | [] | no_license | djalmaberaldo/livroApp | 6d33427dba64fcade0d479706a955020666bd4e5 | b662e2a0775314c02b5d94c0c16c26270fc74026 | refs/heads/master | 2022-12-12T16:24:15.887397 | 2021-08-09T20:55:48 | 2021-08-09T20:55:48 | 162,751,184 | 0 | 0 | null | 2022-12-08T08:39:55 | 2018-12-21T19:34:08 | Java | UTF-8 | Java | false | false | 4,703 | java | package com.myapp.livro.security.jwt;
import java.nio.charset.StandardCharsets;
import java.security.Key;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import io.github.jhipster.config.JHipsterProperties;
import io.jsonwebtoken.*;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
@Component
public class TokenProvider {
private final Logger log = LoggerFactory.getLogger(TokenProvider.class);
private static final String AUTHORITIES_KEY = "auth";
private Key key;
private long tokenValidityInMilliseconds;
private long tokenValidityInMillisecondsForRememberMe;
private final JHipsterProperties jHipsterProperties;
public TokenProvider(JHipsterProperties jHipsterProperties) {
this.jHipsterProperties = jHipsterProperties;
}
@PostConstruct
public void init() {
byte[] keyBytes;
String secret = jHipsterProperties.getSecurity().getAuthentication().getJwt().getSecret();
if (!StringUtils.isEmpty(secret)) {
log.warn("Warning: the JWT key used is not Base64-encoded. " +
"We recommend using the `jhipster.security.authentication.jwt.base64-secret` key for optimum security.");
keyBytes = secret.getBytes(StandardCharsets.UTF_8);
} else {
log.debug("Using a Base64-encoded JWT secret key");
keyBytes = Decoders.BASE64.decode(jHipsterProperties.getSecurity().getAuthentication().getJwt().getBase64Secret());
}
this.key = Keys.hmacShaKeyFor(keyBytes);
this.tokenValidityInMilliseconds =
1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSeconds();
this.tokenValidityInMillisecondsForRememberMe =
1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt()
.getTokenValidityInSecondsForRememberMe();
}
public String createToken(Authentication authentication, boolean rememberMe) {
String authorities = authentication.getAuthorities().stream()
.map(GrantedAuthority::getAuthority)
.collect(Collectors.joining(","));
long now = (new Date()).getTime();
Date validity;
if (rememberMe) {
validity = new Date(now + this.tokenValidityInMillisecondsForRememberMe);
} else {
validity = new Date(now + this.tokenValidityInMilliseconds);
}
return Jwts.builder()
.setSubject(authentication.getName())
.claim(AUTHORITIES_KEY, authorities)
.signWith(key, SignatureAlgorithm.HS512)
.setExpiration(validity)
.compact();
}
public Authentication getAuthentication(String token) {
Claims claims = Jwts.parser()
.setSigningKey(key)
.parseClaimsJws(token)
.getBody();
Collection<? extends GrantedAuthority> authorities =
Arrays.stream(claims.get(AUTHORITIES_KEY).toString().split(","))
.map(SimpleGrantedAuthority::new)
.collect(Collectors.toList());
User principal = new User(claims.getSubject(), "", authorities);
return new UsernamePasswordAuthenticationToken(principal, token, authorities);
}
public boolean validateToken(String authToken) {
try {
Jwts.parser().setSigningKey(key).parseClaimsJws(authToken);
return true;
} catch (io.jsonwebtoken.security.SecurityException | MalformedJwtException e) {
log.info("Invalid JWT signature.");
log.trace("Invalid JWT signature trace: {}", e);
} catch (ExpiredJwtException e) {
log.info("Expired JWT token.");
log.trace("Expired JWT token trace: {}", e);
} catch (UnsupportedJwtException e) {
log.info("Unsupported JWT token.");
log.trace("Unsupported JWT token trace: {}", e);
} catch (IllegalArgumentException e) {
log.info("JWT token compact of handler are invalid.");
log.trace("JWT token compact of handler are invalid trace: {}", e);
}
return false;
}
}
| [
"djalma.batista@indt.org.br"
] | djalma.batista@indt.org.br |
63dde6c1dccf62da203cabe6b6f9abd75726b5b3 | 4e627e667e3268e9dad5669f9065947af9f72ee8 | /ListaRecordAudio/app/src/main/java/pe/edu/cibertec/listarecordaudio/SplashActivity.java | d4a8b82dc452158d95ffecd27f50b8158f78726c | [] | no_license | cmta2112/ListaRecordAudio | 944bf1e8ad07d7bb83e2415b5a9cadcbe211a524 | 843a0b8368d41de5a573c2034f98bc6584a8d59e | refs/heads/master | 2020-06-04T17:58:20.139227 | 2019-06-16T00:14:33 | 2019-06-16T00:14:33 | 192,134,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 974 | java | package pe.edu.cibertec.listarecordaudio;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class SplashActivity extends AppCompatActivity {
//el splash es como un reconocimiento de marca , mientras que carga el mainActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash_activity);
Thread background = new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(3*1000);
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
startActivity(intent);
finish();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
});
background.start();
}
} | [
"cmta2112@gmail.com"
] | cmta2112@gmail.com |
1281f16fdb90066019f91b5d8a54afcfa9733a13 | 564cac19668bf1103b21ed34e4aec38b7dfa2c6e | /obcp-user/src/main/java/cn/obcp/user/Exception/VerifyException.java | 7d33754e3bc42b78e063c31e6bf30237077f72e8 | [
"MIT"
] | permissive | sparkchain-cn/obcp | c609684fb6a2d9458dc1847a358b23ee4a1383df | eeeb9ba226d38887fd17959a8675329f0fb901f9 | refs/heads/master | 2022-09-15T13:46:00.866128 | 2019-09-25T08:58:06 | 2019-09-25T08:58:06 | 206,459,323 | 0 | 0 | MIT | 2022-09-01T23:14:07 | 2019-09-05T02:38:45 | Java | UTF-8 | Java | false | false | 697 | java | /**
* TODO
*
*
* lmf 创建于2018年11月14日
*/
package cn.obcp.user.Exception;
import java.util.ArrayList;
import java.util.List;
import org.springframework.validation.ObjectError;
import cn.obcp.base.RetData;
import cn.obcp.base.utils.StringUtils;
/**
* @author lmf
*
*/
public class VerifyException {
private String errMsg = "";
public VerifyException(List<ObjectError> errList) {
// TODO Auto-generated constructor stub
List<String> errMsgList = new ArrayList<String>();
errList.forEach(s -> {
errMsgList.add(s.getDefaultMessage()) ;
});
errMsg = StringUtils.join(errMsgList, ",");
}
public RetData getErrMsg() {
return RetData.error(errMsg);
}
}
| [
"chenxiao@sparkchain.cn"
] | chenxiao@sparkchain.cn |
e2453880af96b7c4effbf5205777e2f3d1620f50 | 81b0bb3cfb2e9501f53451e7f03ec072ee2b0e13 | /src/com/firebase/jobdispatcher/Job.java | 59a1a141b0ecf25b3188a25abca8db6519b97777 | [] | no_license | reverseengineeringer/me.lyft.android | 48bb85e8693ce4dab50185424d2ec51debf5c243 | 8c26caeeb54ffbde0711d3ce8b187480d84968ef | refs/heads/master | 2021-01-19T02:32:03.752176 | 2016-07-19T16:30:00 | 2016-07-19T16:30:00 | 63,710,356 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,313 | java | package com.firebase.jobdispatcher;
import android.os.Bundle;
public final class Job
implements JobParameters
{
private final int[] mConstraints;
private Bundle mExtras;
private final int mLifetime;
private final boolean mRecurring;
private final boolean mReplaceCurrent;
private final RetryStrategy mRetryStrategy;
private final String mService;
private final String mTag;
private final JobTrigger mTrigger;
private Job(Builder paramBuilder)
{
if (mServiceClass != null)
{
localObject = mServiceClass.getName();
mService = ((String)localObject);
mExtras = mExtras;
mTag = mTag;
mTrigger = mTrigger;
mRetryStrategy = mRetryStrategy;
mLifetime = mLifetime;
mRecurring = mRecurring;
if (mConstraints == null) {
break label103;
}
}
label103:
for (Object localObject = mConstraints;; localObject = new int[0])
{
mConstraints = ((int[])localObject);
mReplaceCurrent = mReplaceCurrent;
return;
localObject = null;
break;
}
}
public int[] getConstraints()
{
return mConstraints;
}
public Bundle getExtras()
{
return mExtras;
}
public int getLifetime()
{
return mLifetime;
}
public RetryStrategy getRetryStrategy()
{
return mRetryStrategy;
}
public String getService()
{
return mService;
}
public String getTag()
{
return mTag;
}
public JobTrigger getTrigger()
{
return mTrigger;
}
public boolean isRecurring()
{
return mRecurring;
}
public boolean shouldReplaceCurrent()
{
return mReplaceCurrent;
}
public static final class Builder
implements JobParameters
{
private int[] mConstraints;
private Bundle mExtras;
private int mLifetime = 1;
private boolean mRecurring = false;
private boolean mReplaceCurrent = false;
private RetryStrategy mRetryStrategy = RetryStrategy.DEFAULT_EXPONENTIAL;
private Class<? extends JobService> mServiceClass;
private String mTag;
private JobTrigger mTrigger = Trigger.NOW;
private final ValidationEnforcer mValidator;
Builder(ValidationEnforcer paramValidationEnforcer)
{
mValidator = paramValidationEnforcer;
}
public Job build()
{
mValidator.ensureValid(this);
return new Job(this, null);
}
public int[] getConstraints()
{
if (mConstraints == null) {
return new int[0];
}
return mConstraints;
}
public Bundle getExtras()
{
return mExtras;
}
public int getLifetime()
{
return mLifetime;
}
public RetryStrategy getRetryStrategy()
{
return mRetryStrategy;
}
public String getService()
{
return mServiceClass.getName();
}
public String getTag()
{
return mTag;
}
public JobTrigger getTrigger()
{
return mTrigger;
}
public boolean isRecurring()
{
return mRecurring;
}
public Builder setConstraints(int... paramVarArgs)
{
mConstraints = paramVarArgs;
return this;
}
public Builder setLifetime(int paramInt)
{
mLifetime = paramInt;
return this;
}
public Builder setRecurring(boolean paramBoolean)
{
mRecurring = paramBoolean;
return this;
}
public Builder setReplaceCurrent(boolean paramBoolean)
{
mReplaceCurrent = paramBoolean;
return this;
}
public Builder setRetryStrategy(RetryStrategy paramRetryStrategy)
{
mRetryStrategy = paramRetryStrategy;
return this;
}
public Builder setService(Class<? extends JobService> paramClass)
{
mServiceClass = paramClass;
return this;
}
public Builder setTag(String paramString)
{
mTag = paramString;
return this;
}
public Builder setTrigger(JobTrigger paramJobTrigger)
{
mTrigger = paramJobTrigger;
return this;
}
public boolean shouldReplaceCurrent()
{
return mReplaceCurrent;
}
}
}
/* Location:
* Qualified Name: com.firebase.jobdispatcher.Job
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
8c1c4747072aa0ee9a7312e66e1d7b70bd10e57a | 699c5894668e07bbb4ddae632730f0d218f72558 | /Changhun-Han/src/baekjoon/bronze100/e/BOJ_18883.java | 42e081a35b12ee11c49b95e0aa1ecc4fe69fc00f | [] | no_license | Sumsan38/learning-algorithm | 0914ddbbd8786381dda807562e4529773b4aa987 | 59a1d7b53d4348a0320b0cbf48ee75b5086b3a29 | refs/heads/master | 2023-07-15T08:16:29.896218 | 2021-08-14T11:47:01 | 2021-08-14T11:47:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,017 | java | package baekjoon.bronze100.e;
import java.io.*;
import java.util.StringTokenizer;
import static java.lang.Integer.parseInt;
/**
* @see <a href="https://www.acmicpc.net/problem/18883">
* https://www.acmicpc.net/problem/18883
* </a>
*/
public class BOJ_18883 {
public static void main (String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringBuilder sb = new StringBuilder();
StringTokenizer st = new StringTokenizer(br.readLine());
int N = parseInt(st.nextToken());
int M = parseInt(st.nextToken());
int end = N * M;
for (int i = 1; i <= end; i++) {
if (i % M == 0) {
sb.append(i + "\n");
} else {
sb.append(i + " ");
}
}
bw.write(sb.toString());
bw.flush();
bw.close();
br.close();
}
} | [
"noreply@github.com"
] | Sumsan38.noreply@github.com |
46c2da9a8693cf8edfd0c4b35800bb4b9a855675 | 92f8eff6e9f9586ab09beb0c101767a34d6f47da | /src/main/java/lumien/randomthings/Items/ItemBiomeCapsule.java | aa3e6c2227d4edf75548fd674b8bd0570d3e1730 | [
"MIT"
] | permissive | LCAdmin/Random-Things | 49d360957149aa2bca29304a98b98929184f5d54 | a0a46988d888ad03ccf84fa3f3bcb43feba51e37 | refs/heads/master | 2020-12-25T16:02:57.453146 | 2014-07-07T09:34:23 | 2014-07-07T09:34:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,596 | java | package lumien.randomthings.Items;
import java.awt.Color;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import lumien.randomthings.RandomThings;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraft.world.biome.BiomeGenBase;
public class ItemBiomeCapsule extends Item
{
static public HashMap<Integer, Integer> biomeColors;
static Random rng = new Random();
final static float modColor = 1F/255F;
public ItemBiomeCapsule()
{
this.setUnlocalizedName("biomeCapsule");
this.setCreativeTab(RandomThings.creativeTab);
this.setMaxStackSize(1);
GameRegistry.registerItem(this, "biomeCapsule");
biomeColors = new HashMap<Integer, Integer>();
{
biomeColors.put(0, 1452177); // Ozean
biomeColors.put(7, 4303848); // Fluss
biomeColors.put(8, 6029312); // Nether
biomeColors.put(9, 8223332); // The End
}
}
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
if (stack.getItemDamage() != 0)
{
NBTTagCompound nbt = stack.stackTagCompound;
if (nbt == null)
{
nbt = stack.stackTagCompound = new NBTTagCompound();
nbt.setInteger("charges", 0);
}
par3List.add("Charges: " + nbt.getInteger("charges") + " / " + getMaxDamage(stack));
}
}
@Override
public int getMaxDamage(ItemStack stack)
{
return 256;
}
@Override
public int getDisplayDamage(ItemStack stack)
{
if (stack.getItemDamage() != 0)
{
NBTTagCompound nbt = stack.stackTagCompound;
if (nbt == null)
{
nbt = stack.stackTagCompound = new NBTTagCompound();
nbt.setInteger("charges", 0);
}
return 256 - nbt.getInteger("charges");
}
return 0;
}
@Override
public void registerIcons(IIconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon("RandomThings:biomeCapsule");
}
@Override
public boolean onEntityItemUpdate(EntityItem entityItem)
{
if (entityItem.worldObj.isRemote)
{
ItemStack is = entityItem.getEntityItem();
BiomeGenBase biome = entityItem.worldObj.getBiomeGenForCoords((int) Math.floor(entityItem.posX), (int) Math.floor(entityItem.posZ));
NBTTagCompound nbt = is.stackTagCompound;
if (nbt == null)
{
nbt = is.stackTagCompound = new NBTTagCompound();
nbt.setInteger("charges", 0);
}
System.out.println(nbt.getInteger("selectingTimer"));
int charges = is.stackTagCompound.getInteger("charges");
int biomeID = is.getItemDamage()-1;
if (charges < 256 && biomeID!=-1 && biome.biomeID == biomeID)
{
int intColor = getColorForBiome(BiomeGenBase.getBiome(biomeID));
Color c = new Color(intColor);
RandomThings.proxy.spawnColoredDust(entityItem.posX, entityItem.posY+0.1, entityItem.posZ, 0, 0, 0,modColor*c.getRed(),modColor*c.getGreen(),modColor*c.getBlue());
}
}
else
{
if (entityItem.getEntityItem().getItemDamage() == 0)
{
NBTTagCompound nbt = entityItem.getEntityData();
if (nbt.getInteger("selectingTimer") == 0)
{
nbt.setInteger("selectingTimer", 200);
}
else
{
int currentTime = nbt.getInteger("selectingTimer");
if (currentTime == 1)
{
BiomeGenBase biome = entityItem.worldObj.getBiomeGenForCoords((int) Math.floor(entityItem.posX), (int) Math.floor(entityItem.posZ));
ItemStack is = entityItem.getEntityItem();
is.setItemDamage(biome.biomeID + 1);
entityItem.setEntityItemStack(is);
}
else
{
currentTime--;
nbt.setInteger("selectingTimer", currentTime);
}
}
}
else
{
ItemStack is = entityItem.getEntityItem();
NBTTagCompound nbt = is.stackTagCompound;
if (nbt == null)
{
nbt = is.stackTagCompound = new NBTTagCompound();
nbt.setInteger("charges", 0);
}
int charges = is.stackTagCompound.getInteger("charges");
int biomeID = is.getItemDamage() - 1;
if (charges < 256)
{
int itemPosX = (int) Math.floor(entityItem.posX);
int itemPosY = (int) Math.floor(entityItem.posY);
int itemPosZ = (int) Math.floor(entityItem.posZ);
int foundBiomeID = entityItem.worldObj.getBiomeGenForCoords(itemPosX, itemPosZ).biomeID;
if (foundBiomeID == biomeID)
{
charges++;
is.stackTagCompound.setInteger("charges", charges);
}
}
}
}
return false;
}
public static int getColorForBiome(BiomeGenBase b)
{
if (biomeColors.containsKey(b.biomeID))
{
return biomeColors.get(b.biomeID);
}
else
{
return b.getBiomeFoliageColor(0, 0, 0);
}
}
@Override
public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
{
if (par1ItemStack.getItemDamage() == 0)
{
return 16777215;
}
else
{
int biomeID = par1ItemStack.getItemDamage() - 1;
BiomeGenBase biome = BiomeGenBase.getBiome(biomeID);
return getColorForBiome(biome);
}
}
@Override
public String getItemStackDisplayName(ItemStack par1ItemStack)
{
String biomeName = "";
if (par1ItemStack.getItemDamage() == 0)
{
return ("" + StatCollector.translateToLocal("item.biomeCapsule" + ".name")).trim();
}
else
{
int biomeID = par1ItemStack.getItemDamage() - 1;
BiomeGenBase biome = BiomeGenBase.getBiome(biomeID);
biomeName = biome.biomeName;
}
return biomeName + " Capsule";
}
}
| [
"lumien231@users.noreply.github.com"
] | lumien231@users.noreply.github.com |
d58c2267140c52889f2e5f044417e543f55ad948 | fe606347ac234d6fb5bfc07e72d53d567f3c0ee9 | /PseudocodigoEMF.tests/src/diagramapseudocodigo/tests/OperadorTest.java | 8536454492c2f58bb868326542963325feec8bd9 | [] | no_license | TatyPerson/Vary | 3639d110555ee9c3d36ba0421a53be6bdf435fab | d0dda76c581c2d88392264e5a76b80d02c56d900 | refs/heads/master | 2020-04-16T15:41:31.414425 | 2016-10-31T12:13:50 | 2016-10-31T12:13:50 | 42,443,319 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 700 | java | /**
*/
package diagramapseudocodigo.tests;
import diagramapseudocodigo.Operador;
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Operador</b></em>'.
* <!-- end-user-doc -->
* @generated
*/
public abstract class OperadorTest extends ValorTest {
/**
* Constructs a new Operador test case with the given name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OperadorTest(String name) {
super(name);
}
/**
* Returns the fixture for this Operador test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected Operador getFixture() {
return (Operador)fixture;
}
} //OperadorTest
| [
"tatyperson22@gmail.com"
] | tatyperson22@gmail.com |
f20e078f69962e85e57b883e72c108da8396dfdf | cec2640350d05fa6035ae477ec6853d548179839 | /src/main/java/com/crescendocollective/yelpscraper/controller/ReviewController.java | e3fe08ee3e9d7e6d876c1d8dae27be1610542038 | [] | no_license | nickfaelnar/yelp-scraper | 3706a1eac84b2d208d79234a26826892b25208ba | 1c9665c3d2ce8490cd3e7b26263393eff4217aa1 | refs/heads/master | 2022-11-27T09:32:30.924969 | 2020-08-06T13:29:06 | 2020-08-06T13:29:06 | 285,574,077 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,568 | java | package com.crescendocollective.yelpscraper.controller;
import com.crescendocollective.yelpscraper.constants.ReviewSite;
import com.crescendocollective.yelpscraper.dto.RestaurantReview;
import com.crescendocollective.yelpscraper.dto.YelpRequestV1;
import com.crescendocollective.yelpscraper.dto.YelpRequestV2;
import com.crescendocollective.yelpscraper.factory.ReviewServiceFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/review")
public class ReviewController {
@Autowired
private ReviewServiceFactory reviewServiceFactory;
@GetMapping("/v1/yelp/{restaurantAlias}")
@ApiOperation(value = "Get Restaurant Reviews", notes = "Scrapes Yelp Page")
public RestaurantReview getYelpReview(@PathVariable String restaurantAlias) {
return reviewServiceFactory.create(ReviewSite.YELPV1)
.getReview(new YelpRequestV1(restaurantAlias));
}
@GetMapping("/v2/yelp/{restaurantId}")
@ApiOperation(value = "Get Restaurant Reviews", notes = "Uses Yelp Exposed API")
public RestaurantReview getYelpReviewV2(@PathVariable String restaurantId) {
return reviewServiceFactory.create(ReviewSite.YELPV2)
.getReview(new YelpRequestV2(restaurantId));
}
}
| [
"nickfaelnar@gmail.com"
] | nickfaelnar@gmail.com |
be483c0da27c1bb5a265502097ae8fe8a2601dd7 | 12a99ab3fe76e5c7c05609c0e76d1855bd051bbb | /src/main/java/com/alipay/api/domain/AlipayAssetPointOrderQueryModel.java | 20092f89306b41b171139263dc33d4ad552cf771 | [
"Apache-2.0"
] | permissive | WindLee05-17/alipay-sdk-java-all | ce2415cfab2416d2e0ae67c625b6a000231a8cfc | 19ccb203268316b346ead9c36ff8aa5f1eac6c77 | refs/heads/master | 2022-11-30T18:42:42.077288 | 2020-08-17T05:57:47 | 2020-08-17T05:57:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 958 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 商户在调用集分宝发放接口后可以通过此接口查询发放情况
*
* @author auto create
* @since 1.0, 2016-01-29 15:44:10
*/
public class AlipayAssetPointOrderQueryModel extends AlipayObject {
private static final long serialVersionUID = 1719716656573541849L;
/**
* isv提供的发放号订单号,由数字和字母组成,最大长度为32为,需要保证每笔发放的唯一性,集分宝系统会对该参数做唯一性控制。调用接口后集分宝系统会根据这个外部订单号查询发放的订单详情。
*/
@ApiField("merchant_order_no")
private String merchantOrderNo;
public String getMerchantOrderNo() {
return this.merchantOrderNo;
}
public void setMerchantOrderNo(String merchantOrderNo) {
this.merchantOrderNo = merchantOrderNo;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
7dd851b1695980bf11ae4a283187cfb4410aa280 | d1559885ad6eab3a476a577502da5c3ab5c105ba | /Restaurant.java | 646a812a9512b9ebad1ca59bed57d0fc21b02cfe | [] | no_license | NikitaJTelisara/SingletonDesignPattern | daccae36ff74c46ad04e0a1489a7f263a1e2e084 | 089fe1bf93141d70e53576a7b35ad81f99ac5f84 | refs/heads/master | 2021-01-22T21:22:58.847407 | 2017-03-18T18:33:07 | 2017-03-18T18:33:07 | 85,423,389 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 924 | java | /*The Singleton pattern ensures that a class has only one instance and ensures access to
the instance through the application. It can be useful in cases where you have a "global"
object with exactly one instance. For example, we may want to implement Restaurant
such that it has exactly one instance of Restaurant.*/
public class Restaurant {
/* Singleton Instance is always private*/
private static Restaurant restaurantInstance = null;
public static Restaurant createInstance(){
if(restaurantInstance == null){
System.out.println("creating instance");
restaurantInstance = new Restaurant();
}
return restaurantInstance;
}
/* protected as it it used by same class + classes in same package+ subclasses */
protected static void printRestaurant(){
System.out.println("This is a restaurant");
}
}
| [
"noreply@github.com"
] | NikitaJTelisara.noreply@github.com |
eb5e3b93089f3cd5b02e3e70b2d7bf2bb0ed2591 | fd853fe3e99ee45783f2182a4f72bf38a0bf3ba8 | /CompanyClient/architecture_library/src/main/java/com/architecture/di/PerFragment.java | 16c4f85912c7b8cc01ea590f1a4c8ae898f2cb57 | [
"Apache-2.0"
] | permissive | suncunx/TradeManagement | 84269d046c53913f7bb8040e43e1af1d5c16ab81 | 1796945c88585c258c1d8576cde15b3a61025aa9 | refs/heads/master | 2020-03-20T13:23:47.804774 | 2019-11-19T09:50:56 | 2019-11-19T09:50:56 | 137,454,508 | 7 | 1 | null | null | null | null | UTF-8 | Java | false | false | 218 | java | package com.architecture.di;
import java.lang.annotation.Retention;
import javax.inject.Scope;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Scope
@Retention(RUNTIME) public @interface PerFragment {} | [
"sun.cunxing@hoowe.cn"
] | sun.cunxing@hoowe.cn |
fe4caac57a9fb2d70880c3175073fd6e28b5f47b | e106555bb07d17f69885b5955999b645c40ca55d | /app/src/main/java/br/unitins/aula/Logcat.java | 6d15d46c390b6de218602e2d0466575cef40bd28 | [] | no_license | joaobatistade/Aula | 80ce7cab140127f023b72749647161c2dcfe3bdf | cd6bffd3813465762bfe8fb6b9072ca181a7f50c | refs/heads/master | 2023-01-03T02:08:27.187508 | 2020-10-29T18:21:24 | 2020-10-29T18:21:24 | 305,822,439 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,133 | java | package br.unitins.aula;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import androidx.annotation.NonNull;
public class Logcat extends Activity {
private String name;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_logcat);
Log.d("APP", "onCreate()");
// Log.i("APP", "Mensagem de INFO");
// Log.d("APP", "Mensagem de DEBUNG");
// Log.w("APP", "Mensagem de WARN");
// Log.e("APP", "Mensagem de ERROR");
// Log.v("APP", "Mensagem de VERBOSE");
}
public void nn(View view) {
name = "Unitins";
Log.d("APP", name);
}
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) { //Método pra salva o que ta na tela antes de vira a tela
super.onSaveInstanceState(outState);
outState.putString("nome", name); //Salva o conteúdo que tá no atributo "name"
Log.d("APP", "onSaveInstanceState()");
}
@Override
protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) { //Recupera a informação
super.onRestoreInstanceState(savedInstanceState);
name = savedInstanceState.getString("nome"); //Recupera o conteúdo que foi salvo
Log.d("APP", "onRestoreInstanceState()");
Log.d("APP", name);
}
@Override
protected void onStart() {
super.onStart();
Log.d("APP", "onStart()");
}
@Override
protected void onResume() {
super.onResume();
Log.d("APP", "onResume()");
}
@Override
protected void onPause() {
super.onPause();
Log.d("APP", "onPause()");
}
@Override
protected void onStop() {
super.onStop();
Log.d("APP", "onStop()");
}
@Override
protected void onRestart() {
super.onRestart();
Log.d("APP", "onRestart()");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.d("APP", "onDestroy()");
}
} | [
"joaobatistadesousarodrigues@gmail.com"
] | joaobatistadesousarodrigues@gmail.com |
416be6657f7bf6a1de3c920fda6d3eeaae1cbe65 | d8473f7aa83b5df3b9e5b5d7bf4d792415a89bf0 | /Enunciado1/src/clases/Problema1.java | 529cad74dd85f495dd9123dcfb496dc4b085a0ca | [] | no_license | StivenAxelZuasnabarOscco/REPOSITORIO-ZUASNABAR-OSCCO-STIVEN-AXEL | 0e697d4912e3ccc67487ee9b3e4dd80241448214 | 414dc9c752462a7d6f851aac70e77dc81ff3da72 | refs/heads/main | 2023-08-03T17:52:00.403004 | 2021-09-20T18:52:10 | 2021-09-20T18:52:10 | 404,186,354 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,234 | java | package clases;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
public class Problema1 extends javax.swing.JFrame {
Cuadrado cua = new Cuadrado();
public Problema1() {
initComponents();
formulario();
setIconImage(new ImageIcon(getClass().getResource("/IMAGENES/usuario.png")).getImage());
}
private void formulario() {
this.setTitle("AREA DE UN CUADRADO");
this.setLocationRelativeTo(null);
this.setVisible(true);
this.setSize(new Dimension(330, 160));
this.setResizable(false);
this.getContentPane().setBackground(new Color(255, 255, 255));
this.PanelIngreso.setBackground(new Color(255, 255, 255));
this.PanelOperaciones.setBackground(new Color(255, 255, 255));
}
private void valIniciales() {
PanelIngreso.setVisible(true);
PanelOperaciones.setVisible(true);
PanelResultado.setVisible(false);
btnCalcular.setEnabled(false);
btnNuevo.setEnabled(false);
btnSalir.setEnabled(true);
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
PanelResultado = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
txtArea = new javax.swing.JTextField();
PanelIngreso = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
txtLado = new javax.swing.JTextField();
PanelOperaciones = new javax.swing.JPanel();
btnCalcular = new javax.swing.JButton();
btnNuevo = new javax.swing.JButton();
btnSalir = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
PanelResultado.setBackground(new java.awt.Color(255, 255, 255));
jLabel2.setText("AREA:");
txtArea.setBackground(new java.awt.Color(204, 204, 255));
javax.swing.GroupLayout PanelResultadoLayout = new javax.swing.GroupLayout(PanelResultado);
PanelResultado.setLayout(PanelResultadoLayout);
PanelResultadoLayout.setHorizontalGroup(
PanelResultadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelResultadoLayout.createSequentialGroup()
.addGap(19, 19, 19)
.addComponent(jLabel2)
.addGap(31, 31, 31)
.addComponent(txtArea, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)
.addGap(20, 20, 20))
);
PanelResultadoLayout.setVerticalGroup(
PanelResultadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelResultadoLayout.createSequentialGroup()
.addGroup(PanelResultadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtArea, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2))
.addGap(0, 1, Short.MAX_VALUE))
);
jLabel1.setText("INGRESE LADO:");
txtLado.setBackground(new java.awt.Color(204, 204, 255));
txtLado.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtLadoActionPerformed(evt);
}
});
txtLado.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtLadoKeyPressed(evt);
}
public void keyTyped(java.awt.event.KeyEvent evt) {
txtLadoKeyTyped(evt);
}
});
btnCalcular.setBackground(new java.awt.Color(204, 204, 255));
btnCalcular.setText("Calcular");
btnCalcular.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCalcularActionPerformed(evt);
}
});
btnNuevo.setBackground(new java.awt.Color(204, 204, 255));
btnNuevo.setText("Nuevo");
btnNuevo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnNuevoActionPerformed(evt);
}
});
btnSalir.setBackground(new java.awt.Color(204, 204, 255));
btnSalir.setText("Salir");
btnSalir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSalirActionPerformed(evt);
}
});
javax.swing.GroupLayout PanelOperacionesLayout = new javax.swing.GroupLayout(PanelOperaciones);
PanelOperaciones.setLayout(PanelOperacionesLayout);
PanelOperacionesLayout.setHorizontalGroup(
PanelOperacionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelOperacionesLayout.createSequentialGroup()
.addComponent(btnCalcular)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(btnNuevo)
.addGap(14, 14, 14)
.addComponent(btnSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE))
);
PanelOperacionesLayout.setVerticalGroup(
PanelOperacionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelOperacionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnCalcular)
.addComponent(btnNuevo)
.addComponent(btnSalir))
);
javax.swing.GroupLayout PanelIngresoLayout = new javax.swing.GroupLayout(PanelIngreso);
PanelIngreso.setLayout(PanelIngresoLayout);
PanelIngresoLayout.setHorizontalGroup(
PanelIngresoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelIngresoLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtLado, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(PanelIngresoLayout.createSequentialGroup()
.addComponent(PanelOperaciones, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
PanelIngresoLayout.setVerticalGroup(
PanelIngresoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelIngresoLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(PanelIngresoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtLado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(PanelOperaciones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(33, 33, 33))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(PanelResultado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(31, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(PanelIngreso, javax.swing.GroupLayout.PREFERRED_SIZE, 222, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(PanelIngreso, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(PanelResultado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void txtLadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtLadoActionPerformed
btnCalcular.doClick();
txtLado.setText("");
txtLado.requestFocus();
btnCalcular.setEnabled(false);
btnNuevo.setEnabled(true);
}//GEN-LAST:event_txtLadoActionPerformed
private void btnNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoActionPerformed
txtLado.setText("");
txtArea.setText("");
this.setSize(new Dimension(330, 170));
PanelResultado.setVisible(false);
txtLado.requestFocus();
btnNuevo.setEnabled(false);
btnCalcular.setEnabled(false);
}//GEN-LAST:event_btnNuevoActionPerformed
private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
int r = JOptionPane.showOptionDialog(this, "Estas Seguro de salir...?", "Area Cuadrado", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{"Si Salgo", "No Salgo"}, "No Salgo");
if (r == 0) {
System.exit(0);
}
}//GEN-LAST:event_btnSalirActionPerformed
private void txtLadoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtLadoKeyTyped
btnCalcular.setEnabled(true);
char c = evt.getKeyChar();
if (!Character.isDigit(c)) {
evt.consume();
}
}//GEN-LAST:event_txtLadoKeyTyped
private void formWindowActivated(java.awt.event.WindowEvent evt) {
valIniciales();
}
private void txtLadoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtLadoKeyPressed
if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
btnCalcular.doClick();
}
}//GEN-LAST:event_txtLadoKeyPressed
private void btnCalcularActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalcularActionPerformed
float lado;
if (txtLado.getText().isEmpty()) {
JOptionPane.showMessageDialog(this, "INGRESE UN VALOR");
} else {
lado = Float.parseFloat(txtLado.getText().trim());
cua.setLado(lado);
cua.hallarArea();
txtArea.setText(String.valueOf(cua.mostrarArea()));
this.setSize(new Dimension(330, 220));
PanelResultado.setVisible(true);
btnNuevo.setEnabled(true);
this.PanelResultado.setBackground(new Color(255, 255, 255));
}
txtLado.requestFocus();
btnCalcular.setEnabled(false);
}//GEN-LAST:event_btnCalcularActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Problema1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Problema1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Problema1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Problema1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Problema1().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel PanelIngreso;
private javax.swing.JPanel PanelOperaciones;
private javax.swing.JPanel PanelResultado;
private javax.swing.JButton btnCalcular;
private javax.swing.JButton btnNuevo;
private javax.swing.JButton btnSalir;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JTextField txtArea;
private javax.swing.JTextField txtLado;
// End of variables declaration//GEN-END:variables
}
| [
"noreply@github.com"
] | StivenAxelZuasnabarOscco.noreply@github.com |
477a21ef8ab0a6e51ae3f055de4b6c8e34fbe199 | ebf6a8302f172852f3f7d94c92a02f81f8817202 | /micro-service/authentication-service/src/main/java/com/cts/authentication/service/service/UserService.java | 69890bd2bd02e09a3761bc84ce8bdde45b070507 | [] | no_license | abhi16897/Mentor_On_Demand-1 | 7bfcd44c44a3de6ff3f4b0a0e502f76d65f06ed7 | 9cdf355cebff3ca9c7989b1f428e2231f7a2d241 | refs/heads/master | 2023-08-31T20:28:05.910834 | 2019-12-12T04:20:49 | 2019-12-12T04:20:49 | 272,346,184 | 0 | 1 | null | 2021-10-02T17:31:38 | 2020-06-15T05:00:36 | null | UTF-8 | Java | false | false | 427 | java | package com.cts.authentication.service.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cts.authentication.service.model.User;
import com.cts.authentication.service.repositry.UserRepository;
@Service
public class UserService {
@Autowired
UserRepository userRepository;
public void register(User user) {
userRepository.save(user);
}
}
| [
"799357@cognizant.com"
] | 799357@cognizant.com |
0e07f0bd5a7f0c738becf9f6ce0a5d27877cd884 | caffd6d327e4f40cc545d6b559d155b1faec3e35 | /BYRnote/src/filters/FormFilter.java | 74a79983897745845fd6633574b8f987c3a63ea8 | [] | no_license | ydjia/BYRnote | 169da5e2614a3e51bf097aa4cb815bda3c92acca | 5853983874a1fab15f65106de210e6f1df17c09d | refs/heads/master | 2021-01-22T18:44:05.948217 | 2013-08-14T09:28:44 | 2013-08-14T09:28:44 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 6,268 | java | package filters;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Method;
import java.text.DateFormat;
import java.util.Map;
import java.util.List;
import java.util.LinkedList;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Enumeration;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
public class FormFilter implements Filter
{
// 被拦截的URL和JavaBean的对应关系,key表示被拦截的URL,value表示封装请求参数的JavaBean
Map<String, String> actions = new HashMap<String, String>();
// 封装请求参数的JavaBean对象实例保存在request域中的属性名称,从过滤器的初始化参数中读取
private String formName;
// 如果过滤器初始化参数名在该方法返回的List对象中,则表示该参数值不是JavaBean,而是普通的参数值
// 可以覆盖该方法,并添加新的普通参数名称
protected List<String> getFilterParamNames()
{
List<String> paramNames = new LinkedList<String>();
paramNames.add("formName");
return paramNames;
}
public void init(FilterConfig filterConfig) throws ServletException
{
Enumeration names = filterConfig.getInitParameterNames();
// 读取所有的过滤器初始化参数值
while (names.hasMoreElements())
{
String name = names.nextElement().toString();
List<String> paramNames = getFilterParamNames();
// 如果当前参数是普通参数,将该参数值赋给相应的变量
if(paramNames.contains(name))
{
if(name.equals("formName"))
formName = filterConfig.getInitParameter(name);
}
else
{
// 如果当前参数表示一个被拦截的URL,那么该参数值必须是一个与其对应的JavaBean,并这个对应关系加入Map中
actions.put(name, filterConfig.getInitParameter(name));
}
}
}
// 返回一个setter方法对应的属性名称
protected String getProperty(String setter)
{
String property = setter.substring(3);
property = property.substring(0, 1).toLowerCase()
+ property.substring(1);
return property;
}
// 对字符串进行解码
protected String decode(HttpServletRequest request, String s)
throws UnsupportedEncodingException
{
String encoding = request.getCharacterEncoding();
if(encoding == null)
encoding = "ISO-8859-1";
s = new String(s.getBytes(encoding), "UTF-8");
return s;
}
// 如果JavaBean中属性的数据类型无法处理,则调用该方法。其他的过滤器类可以继承FormFilter类,并覆盖该方法以处理这些属性
protected void doMethod(Object form, Object paramValue, Method method)
{
}
// 返回指定的请求参数的值,该方法也可以在FormFilter类的子类被覆盖,以使用其他方法获得请求参数的值
protected Object getParamValue(HttpServletRequest request, String name)
{
return request.getParameter(name);
}
// 处理过滤器逻辑的方法
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException
{
HttpServletRequest myRequest = (HttpServletRequest) request;
// 获得被拦截的Web资源的路径,该路径可看作一个动作
String action = myRequest.getServletPath();
// 根据该动作从过滤器
String className = actions.get(action);
if(className != null)
{
try
{
// 创建JavaBean的对象实例
Object form = Class.forName(className).newInstance();
// 保存JavaBean中所有setter方法的Method对象
List<Method> setterMethods = new ArrayList<Method>();
// 获得JavaBean中所有方法的Method对象
Method[] methods = form.getClass().getMethods();
for (Method method : methods)
{
// 如果方法名称的前三个字符是set,并且只有一个参数,则表示该方法是setter方法,
if(method.getName().startsWith("set")
&& method.getParameterTypes().length == 1)
setterMethods.add(method);
}
// 为JavaBean中的属性寻找与其同名的请求参数
for (Method method : setterMethods)
{
// 获得setter方法的参数类型的Class对象
Class paramType = method.getParameterTypes()[0];
// 获得与setter方法对应的属性同名的请求参数的值
Object paramValue = getParamValue(myRequest,
getProperty(method.getName()));
// 如果不存在同名的请求参数,则继续处理下一个setter方法
if(paramValue == null)
continue;
// 处理字符串类型的属性
if(paramType == String.class)
{
String value = decode(myRequest, paramValue.toString());
// 调用setter方法为属性赋值
method.invoke(form, value);
}
// 处理整数类型的属性
else if(paramType == int.class
|| paramType == Integer.class)
{
// 进行类型转换
int value = Integer.parseInt(paramValue.toString());
method.invoke(form, value);
}
// 处理浮点类型的属性
else if(paramType == float.class
|| paramType == Float.class)
{
float value = Float.parseFloat(paramValue.toString());
method.invoke(form, value);
}
// 处理日期类型的属性
else if(paramType == java.util.Date.class)
{
DateFormat df = DateFormat.getDateInstance();
java.util.Date value = df.parse(paramValue.toString());
method.invoke(form, value);
}
// 处理布尔类型的属性
else if(paramType == boolean.class
|| paramType == Boolean.class)
{
method.invoke(form, true);
}
else
{
doMethod(form, paramValue, method);
}
}
// 将JavaBean对象实例保存在request域中,域属性名称为formName变量的值
request.setAttribute(formName, form);
// 调用下一个过滤器的Servlet
chain.doFilter(request, response);
}
catch (Exception e)
{
e.printStackTrace(response.getWriter());
}
}
}
public void destroy()
{
}
}
| [
"ydjia1993@gmail.com"
] | ydjia1993@gmail.com |
fad1627814a591bfb33ed7172aa4e665d6da768a | 694d574b989e75282326153d51bd85cb8b83fb9f | /google-ads/src/main/java/com/google/ads/googleads/v3/resources/SharedSet.java | 70c6c75481ddf8f07d45248778fc6117b146c100 | [
"Apache-2.0"
] | permissive | tikivn/google-ads-java | 99201ef20efd52f884d651755eb5a3634e951e9b | 1456d890e5c6efc5fad6bd276b4a3cd877175418 | refs/heads/master | 2023-08-03T13:02:40.730269 | 2020-07-17T16:33:40 | 2020-07-17T16:33:40 | 280,845,720 | 0 | 0 | Apache-2.0 | 2023-07-23T23:39:26 | 2020-07-19T10:51:35 | null | UTF-8 | Java | false | true | 61,065 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/ads/googleads/v3/resources/shared_set.proto
package com.google.ads.googleads.v3.resources;
/**
* <pre>
* SharedSets are used for sharing criterion exclusions across multiple
* campaigns.
* </pre>
*
* Protobuf type {@code google.ads.googleads.v3.resources.SharedSet}
*/
public final class SharedSet extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.ads.googleads.v3.resources.SharedSet)
SharedSetOrBuilder {
private static final long serialVersionUID = 0L;
// Use SharedSet.newBuilder() to construct.
private SharedSet(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private SharedSet() {
resourceName_ = "";
type_ = 0;
status_ = 0;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private SharedSet(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
resourceName_ = s;
break;
}
case 18: {
com.google.protobuf.Int64Value.Builder subBuilder = null;
if (id_ != null) {
subBuilder = id_.toBuilder();
}
id_ = input.readMessage(com.google.protobuf.Int64Value.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(id_);
id_ = subBuilder.buildPartial();
}
break;
}
case 24: {
int rawValue = input.readEnum();
type_ = rawValue;
break;
}
case 34: {
com.google.protobuf.StringValue.Builder subBuilder = null;
if (name_ != null) {
subBuilder = name_.toBuilder();
}
name_ = input.readMessage(com.google.protobuf.StringValue.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(name_);
name_ = subBuilder.buildPartial();
}
break;
}
case 40: {
int rawValue = input.readEnum();
status_ = rawValue;
break;
}
case 50: {
com.google.protobuf.Int64Value.Builder subBuilder = null;
if (memberCount_ != null) {
subBuilder = memberCount_.toBuilder();
}
memberCount_ = input.readMessage(com.google.protobuf.Int64Value.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(memberCount_);
memberCount_ = subBuilder.buildPartial();
}
break;
}
case 58: {
com.google.protobuf.Int64Value.Builder subBuilder = null;
if (referenceCount_ != null) {
subBuilder = referenceCount_.toBuilder();
}
referenceCount_ = input.readMessage(com.google.protobuf.Int64Value.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(referenceCount_);
referenceCount_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ads.googleads.v3.resources.SharedSetProto.internal_static_google_ads_googleads_v3_resources_SharedSet_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ads.googleads.v3.resources.SharedSetProto.internal_static_google_ads_googleads_v3_resources_SharedSet_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ads.googleads.v3.resources.SharedSet.class, com.google.ads.googleads.v3.resources.SharedSet.Builder.class);
}
public static final int RESOURCE_NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object resourceName_;
/**
* <pre>
* Immutable. The resource name of the shared set.
* Shared set resource names have the form:
* `customers/{customer_id}/sharedSets/{shared_set_id}`
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }</code>
*/
public java.lang.String getResourceName() {
java.lang.Object ref = resourceName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
resourceName_ = s;
return s;
}
}
/**
* <pre>
* Immutable. The resource name of the shared set.
* Shared set resource names have the form:
* `customers/{customer_id}/sharedSets/{shared_set_id}`
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }</code>
*/
public com.google.protobuf.ByteString
getResourceNameBytes() {
java.lang.Object ref = resourceName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
resourceName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ID_FIELD_NUMBER = 2;
private com.google.protobuf.Int64Value id_;
/**
* <pre>
* Output only. The ID of this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public boolean hasId() {
return id_ != null;
}
/**
* <pre>
* Output only. The ID of this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64Value getId() {
return id_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : id_;
}
/**
* <pre>
* Output only. The ID of this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64ValueOrBuilder getIdOrBuilder() {
return getId();
}
public static final int TYPE_FIELD_NUMBER = 3;
private int type_;
/**
* <pre>
* Immutable. The type of this shared set: each shared set holds only a single kind
* of resource. Required. Immutable.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType type = 3 [(.google.api.field_behavior) = IMMUTABLE];</code>
*/
public int getTypeValue() {
return type_;
}
/**
* <pre>
* Immutable. The type of this shared set: each shared set holds only a single kind
* of resource. Required. Immutable.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType type = 3 [(.google.api.field_behavior) = IMMUTABLE];</code>
*/
public com.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType getType() {
@SuppressWarnings("deprecation")
com.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType result = com.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType.valueOf(type_);
return result == null ? com.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType.UNRECOGNIZED : result;
}
public static final int NAME_FIELD_NUMBER = 4;
private com.google.protobuf.StringValue name_;
/**
* <pre>
* The name of this shared set. Required.
* Shared Sets must have names that are unique among active shared sets of
* the same type.
* The length of this string should be between 1 and 255 UTF-8 bytes,
* inclusive.
* </pre>
*
* <code>.google.protobuf.StringValue name = 4;</code>
*/
public boolean hasName() {
return name_ != null;
}
/**
* <pre>
* The name of this shared set. Required.
* Shared Sets must have names that are unique among active shared sets of
* the same type.
* The length of this string should be between 1 and 255 UTF-8 bytes,
* inclusive.
* </pre>
*
* <code>.google.protobuf.StringValue name = 4;</code>
*/
public com.google.protobuf.StringValue getName() {
return name_ == null ? com.google.protobuf.StringValue.getDefaultInstance() : name_;
}
/**
* <pre>
* The name of this shared set. Required.
* Shared Sets must have names that are unique among active shared sets of
* the same type.
* The length of this string should be between 1 and 255 UTF-8 bytes,
* inclusive.
* </pre>
*
* <code>.google.protobuf.StringValue name = 4;</code>
*/
public com.google.protobuf.StringValueOrBuilder getNameOrBuilder() {
return getName();
}
public static final int STATUS_FIELD_NUMBER = 5;
private int status_;
/**
* <pre>
* Output only. The status of this shared set. Read only.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus status = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public int getStatusValue() {
return status_;
}
/**
* <pre>
* Output only. The status of this shared set. Read only.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus status = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus getStatus() {
@SuppressWarnings("deprecation")
com.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus result = com.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus.valueOf(status_);
return result == null ? com.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus.UNRECOGNIZED : result;
}
public static final int MEMBER_COUNT_FIELD_NUMBER = 6;
private com.google.protobuf.Int64Value memberCount_;
/**
* <pre>
* Output only. The number of shared criteria within this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value member_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public boolean hasMemberCount() {
return memberCount_ != null;
}
/**
* <pre>
* Output only. The number of shared criteria within this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value member_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64Value getMemberCount() {
return memberCount_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : memberCount_;
}
/**
* <pre>
* Output only. The number of shared criteria within this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value member_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64ValueOrBuilder getMemberCountOrBuilder() {
return getMemberCount();
}
public static final int REFERENCE_COUNT_FIELD_NUMBER = 7;
private com.google.protobuf.Int64Value referenceCount_;
/**
* <pre>
* Output only. The number of campaigns associated with this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value reference_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public boolean hasReferenceCount() {
return referenceCount_ != null;
}
/**
* <pre>
* Output only. The number of campaigns associated with this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value reference_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64Value getReferenceCount() {
return referenceCount_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : referenceCount_;
}
/**
* <pre>
* Output only. The number of campaigns associated with this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value reference_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64ValueOrBuilder getReferenceCountOrBuilder() {
return getReferenceCount();
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getResourceNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceName_);
}
if (id_ != null) {
output.writeMessage(2, getId());
}
if (type_ != com.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType.UNSPECIFIED.getNumber()) {
output.writeEnum(3, type_);
}
if (name_ != null) {
output.writeMessage(4, getName());
}
if (status_ != com.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus.UNSPECIFIED.getNumber()) {
output.writeEnum(5, status_);
}
if (memberCount_ != null) {
output.writeMessage(6, getMemberCount());
}
if (referenceCount_ != null) {
output.writeMessage(7, getReferenceCount());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getResourceNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceName_);
}
if (id_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getId());
}
if (type_ != com.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType.UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, type_);
}
if (name_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getName());
}
if (status_ != com.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus.UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(5, status_);
}
if (memberCount_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, getMemberCount());
}
if (referenceCount_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(7, getReferenceCount());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.ads.googleads.v3.resources.SharedSet)) {
return super.equals(obj);
}
com.google.ads.googleads.v3.resources.SharedSet other = (com.google.ads.googleads.v3.resources.SharedSet) obj;
if (!getResourceName()
.equals(other.getResourceName())) return false;
if (hasId() != other.hasId()) return false;
if (hasId()) {
if (!getId()
.equals(other.getId())) return false;
}
if (type_ != other.type_) return false;
if (hasName() != other.hasName()) return false;
if (hasName()) {
if (!getName()
.equals(other.getName())) return false;
}
if (status_ != other.status_) return false;
if (hasMemberCount() != other.hasMemberCount()) return false;
if (hasMemberCount()) {
if (!getMemberCount()
.equals(other.getMemberCount())) return false;
}
if (hasReferenceCount() != other.hasReferenceCount()) return false;
if (hasReferenceCount()) {
if (!getReferenceCount()
.equals(other.getReferenceCount())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + RESOURCE_NAME_FIELD_NUMBER;
hash = (53 * hash) + getResourceName().hashCode();
if (hasId()) {
hash = (37 * hash) + ID_FIELD_NUMBER;
hash = (53 * hash) + getId().hashCode();
}
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + type_;
if (hasName()) {
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
}
hash = (37 * hash) + STATUS_FIELD_NUMBER;
hash = (53 * hash) + status_;
if (hasMemberCount()) {
hash = (37 * hash) + MEMBER_COUNT_FIELD_NUMBER;
hash = (53 * hash) + getMemberCount().hashCode();
}
if (hasReferenceCount()) {
hash = (37 * hash) + REFERENCE_COUNT_FIELD_NUMBER;
hash = (53 * hash) + getReferenceCount().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.ads.googleads.v3.resources.SharedSet parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ads.googleads.v3.resources.SharedSet parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ads.googleads.v3.resources.SharedSet parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ads.googleads.v3.resources.SharedSet parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ads.googleads.v3.resources.SharedSet parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ads.googleads.v3.resources.SharedSet parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ads.googleads.v3.resources.SharedSet parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ads.googleads.v3.resources.SharedSet parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.ads.googleads.v3.resources.SharedSet parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.ads.googleads.v3.resources.SharedSet parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.ads.googleads.v3.resources.SharedSet parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ads.googleads.v3.resources.SharedSet parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.ads.googleads.v3.resources.SharedSet prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* SharedSets are used for sharing criterion exclusions across multiple
* campaigns.
* </pre>
*
* Protobuf type {@code google.ads.googleads.v3.resources.SharedSet}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:google.ads.googleads.v3.resources.SharedSet)
com.google.ads.googleads.v3.resources.SharedSetOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ads.googleads.v3.resources.SharedSetProto.internal_static_google_ads_googleads_v3_resources_SharedSet_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ads.googleads.v3.resources.SharedSetProto.internal_static_google_ads_googleads_v3_resources_SharedSet_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ads.googleads.v3.resources.SharedSet.class, com.google.ads.googleads.v3.resources.SharedSet.Builder.class);
}
// Construct using com.google.ads.googleads.v3.resources.SharedSet.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
resourceName_ = "";
if (idBuilder_ == null) {
id_ = null;
} else {
id_ = null;
idBuilder_ = null;
}
type_ = 0;
if (nameBuilder_ == null) {
name_ = null;
} else {
name_ = null;
nameBuilder_ = null;
}
status_ = 0;
if (memberCountBuilder_ == null) {
memberCount_ = null;
} else {
memberCount_ = null;
memberCountBuilder_ = null;
}
if (referenceCountBuilder_ == null) {
referenceCount_ = null;
} else {
referenceCount_ = null;
referenceCountBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.ads.googleads.v3.resources.SharedSetProto.internal_static_google_ads_googleads_v3_resources_SharedSet_descriptor;
}
@java.lang.Override
public com.google.ads.googleads.v3.resources.SharedSet getDefaultInstanceForType() {
return com.google.ads.googleads.v3.resources.SharedSet.getDefaultInstance();
}
@java.lang.Override
public com.google.ads.googleads.v3.resources.SharedSet build() {
com.google.ads.googleads.v3.resources.SharedSet result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.ads.googleads.v3.resources.SharedSet buildPartial() {
com.google.ads.googleads.v3.resources.SharedSet result = new com.google.ads.googleads.v3.resources.SharedSet(this);
result.resourceName_ = resourceName_;
if (idBuilder_ == null) {
result.id_ = id_;
} else {
result.id_ = idBuilder_.build();
}
result.type_ = type_;
if (nameBuilder_ == null) {
result.name_ = name_;
} else {
result.name_ = nameBuilder_.build();
}
result.status_ = status_;
if (memberCountBuilder_ == null) {
result.memberCount_ = memberCount_;
} else {
result.memberCount_ = memberCountBuilder_.build();
}
if (referenceCountBuilder_ == null) {
result.referenceCount_ = referenceCount_;
} else {
result.referenceCount_ = referenceCountBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.ads.googleads.v3.resources.SharedSet) {
return mergeFrom((com.google.ads.googleads.v3.resources.SharedSet)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.ads.googleads.v3.resources.SharedSet other) {
if (other == com.google.ads.googleads.v3.resources.SharedSet.getDefaultInstance()) return this;
if (!other.getResourceName().isEmpty()) {
resourceName_ = other.resourceName_;
onChanged();
}
if (other.hasId()) {
mergeId(other.getId());
}
if (other.type_ != 0) {
setTypeValue(other.getTypeValue());
}
if (other.hasName()) {
mergeName(other.getName());
}
if (other.status_ != 0) {
setStatusValue(other.getStatusValue());
}
if (other.hasMemberCount()) {
mergeMemberCount(other.getMemberCount());
}
if (other.hasReferenceCount()) {
mergeReferenceCount(other.getReferenceCount());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.ads.googleads.v3.resources.SharedSet parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.ads.googleads.v3.resources.SharedSet) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object resourceName_ = "";
/**
* <pre>
* Immutable. The resource name of the shared set.
* Shared set resource names have the form:
* `customers/{customer_id}/sharedSets/{shared_set_id}`
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }</code>
*/
public java.lang.String getResourceName() {
java.lang.Object ref = resourceName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
resourceName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
* Immutable. The resource name of the shared set.
* Shared set resource names have the form:
* `customers/{customer_id}/sharedSets/{shared_set_id}`
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }</code>
*/
public com.google.protobuf.ByteString
getResourceNameBytes() {
java.lang.Object ref = resourceName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
resourceName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
* Immutable. The resource name of the shared set.
* Shared set resource names have the form:
* `customers/{customer_id}/sharedSets/{shared_set_id}`
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }</code>
*/
public Builder setResourceName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
resourceName_ = value;
onChanged();
return this;
}
/**
* <pre>
* Immutable. The resource name of the shared set.
* Shared set resource names have the form:
* `customers/{customer_id}/sharedSets/{shared_set_id}`
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }</code>
*/
public Builder clearResourceName() {
resourceName_ = getDefaultInstance().getResourceName();
onChanged();
return this;
}
/**
* <pre>
* Immutable. The resource name of the shared set.
* Shared set resource names have the form:
* `customers/{customer_id}/sharedSets/{shared_set_id}`
* </pre>
*
* <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }</code>
*/
public Builder setResourceNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
resourceName_ = value;
onChanged();
return this;
}
private com.google.protobuf.Int64Value id_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder> idBuilder_;
/**
* <pre>
* Output only. The ID of this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public boolean hasId() {
return idBuilder_ != null || id_ != null;
}
/**
* <pre>
* Output only. The ID of this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64Value getId() {
if (idBuilder_ == null) {
return id_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : id_;
} else {
return idBuilder_.getMessage();
}
}
/**
* <pre>
* Output only. The ID of this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder setId(com.google.protobuf.Int64Value value) {
if (idBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
id_ = value;
onChanged();
} else {
idBuilder_.setMessage(value);
}
return this;
}
/**
* <pre>
* Output only. The ID of this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder setId(
com.google.protobuf.Int64Value.Builder builderForValue) {
if (idBuilder_ == null) {
id_ = builderForValue.build();
onChanged();
} else {
idBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* Output only. The ID of this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder mergeId(com.google.protobuf.Int64Value value) {
if (idBuilder_ == null) {
if (id_ != null) {
id_ =
com.google.protobuf.Int64Value.newBuilder(id_).mergeFrom(value).buildPartial();
} else {
id_ = value;
}
onChanged();
} else {
idBuilder_.mergeFrom(value);
}
return this;
}
/**
* <pre>
* Output only. The ID of this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder clearId() {
if (idBuilder_ == null) {
id_ = null;
onChanged();
} else {
id_ = null;
idBuilder_ = null;
}
return this;
}
/**
* <pre>
* Output only. The ID of this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64Value.Builder getIdBuilder() {
onChanged();
return getIdFieldBuilder().getBuilder();
}
/**
* <pre>
* Output only. The ID of this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64ValueOrBuilder getIdOrBuilder() {
if (idBuilder_ != null) {
return idBuilder_.getMessageOrBuilder();
} else {
return id_ == null ?
com.google.protobuf.Int64Value.getDefaultInstance() : id_;
}
}
/**
* <pre>
* Output only. The ID of this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder>
getIdFieldBuilder() {
if (idBuilder_ == null) {
idBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder>(
getId(),
getParentForChildren(),
isClean());
id_ = null;
}
return idBuilder_;
}
private int type_ = 0;
/**
* <pre>
* Immutable. The type of this shared set: each shared set holds only a single kind
* of resource. Required. Immutable.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType type = 3 [(.google.api.field_behavior) = IMMUTABLE];</code>
*/
public int getTypeValue() {
return type_;
}
/**
* <pre>
* Immutable. The type of this shared set: each shared set holds only a single kind
* of resource. Required. Immutable.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType type = 3 [(.google.api.field_behavior) = IMMUTABLE];</code>
*/
public Builder setTypeValue(int value) {
type_ = value;
onChanged();
return this;
}
/**
* <pre>
* Immutable. The type of this shared set: each shared set holds only a single kind
* of resource. Required. Immutable.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType type = 3 [(.google.api.field_behavior) = IMMUTABLE];</code>
*/
public com.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType getType() {
@SuppressWarnings("deprecation")
com.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType result = com.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType.valueOf(type_);
return result == null ? com.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType.UNRECOGNIZED : result;
}
/**
* <pre>
* Immutable. The type of this shared set: each shared set holds only a single kind
* of resource. Required. Immutable.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType type = 3 [(.google.api.field_behavior) = IMMUTABLE];</code>
*/
public Builder setType(com.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType value) {
if (value == null) {
throw new NullPointerException();
}
type_ = value.getNumber();
onChanged();
return this;
}
/**
* <pre>
* Immutable. The type of this shared set: each shared set holds only a single kind
* of resource. Required. Immutable.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetTypeEnum.SharedSetType type = 3 [(.google.api.field_behavior) = IMMUTABLE];</code>
*/
public Builder clearType() {
type_ = 0;
onChanged();
return this;
}
private com.google.protobuf.StringValue name_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.StringValue, com.google.protobuf.StringValue.Builder, com.google.protobuf.StringValueOrBuilder> nameBuilder_;
/**
* <pre>
* The name of this shared set. Required.
* Shared Sets must have names that are unique among active shared sets of
* the same type.
* The length of this string should be between 1 and 255 UTF-8 bytes,
* inclusive.
* </pre>
*
* <code>.google.protobuf.StringValue name = 4;</code>
*/
public boolean hasName() {
return nameBuilder_ != null || name_ != null;
}
/**
* <pre>
* The name of this shared set. Required.
* Shared Sets must have names that are unique among active shared sets of
* the same type.
* The length of this string should be between 1 and 255 UTF-8 bytes,
* inclusive.
* </pre>
*
* <code>.google.protobuf.StringValue name = 4;</code>
*/
public com.google.protobuf.StringValue getName() {
if (nameBuilder_ == null) {
return name_ == null ? com.google.protobuf.StringValue.getDefaultInstance() : name_;
} else {
return nameBuilder_.getMessage();
}
}
/**
* <pre>
* The name of this shared set. Required.
* Shared Sets must have names that are unique among active shared sets of
* the same type.
* The length of this string should be between 1 and 255 UTF-8 bytes,
* inclusive.
* </pre>
*
* <code>.google.protobuf.StringValue name = 4;</code>
*/
public Builder setName(com.google.protobuf.StringValue value) {
if (nameBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
} else {
nameBuilder_.setMessage(value);
}
return this;
}
/**
* <pre>
* The name of this shared set. Required.
* Shared Sets must have names that are unique among active shared sets of
* the same type.
* The length of this string should be between 1 and 255 UTF-8 bytes,
* inclusive.
* </pre>
*
* <code>.google.protobuf.StringValue name = 4;</code>
*/
public Builder setName(
com.google.protobuf.StringValue.Builder builderForValue) {
if (nameBuilder_ == null) {
name_ = builderForValue.build();
onChanged();
} else {
nameBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* The name of this shared set. Required.
* Shared Sets must have names that are unique among active shared sets of
* the same type.
* The length of this string should be between 1 and 255 UTF-8 bytes,
* inclusive.
* </pre>
*
* <code>.google.protobuf.StringValue name = 4;</code>
*/
public Builder mergeName(com.google.protobuf.StringValue value) {
if (nameBuilder_ == null) {
if (name_ != null) {
name_ =
com.google.protobuf.StringValue.newBuilder(name_).mergeFrom(value).buildPartial();
} else {
name_ = value;
}
onChanged();
} else {
nameBuilder_.mergeFrom(value);
}
return this;
}
/**
* <pre>
* The name of this shared set. Required.
* Shared Sets must have names that are unique among active shared sets of
* the same type.
* The length of this string should be between 1 and 255 UTF-8 bytes,
* inclusive.
* </pre>
*
* <code>.google.protobuf.StringValue name = 4;</code>
*/
public Builder clearName() {
if (nameBuilder_ == null) {
name_ = null;
onChanged();
} else {
name_ = null;
nameBuilder_ = null;
}
return this;
}
/**
* <pre>
* The name of this shared set. Required.
* Shared Sets must have names that are unique among active shared sets of
* the same type.
* The length of this string should be between 1 and 255 UTF-8 bytes,
* inclusive.
* </pre>
*
* <code>.google.protobuf.StringValue name = 4;</code>
*/
public com.google.protobuf.StringValue.Builder getNameBuilder() {
onChanged();
return getNameFieldBuilder().getBuilder();
}
/**
* <pre>
* The name of this shared set. Required.
* Shared Sets must have names that are unique among active shared sets of
* the same type.
* The length of this string should be between 1 and 255 UTF-8 bytes,
* inclusive.
* </pre>
*
* <code>.google.protobuf.StringValue name = 4;</code>
*/
public com.google.protobuf.StringValueOrBuilder getNameOrBuilder() {
if (nameBuilder_ != null) {
return nameBuilder_.getMessageOrBuilder();
} else {
return name_ == null ?
com.google.protobuf.StringValue.getDefaultInstance() : name_;
}
}
/**
* <pre>
* The name of this shared set. Required.
* Shared Sets must have names that are unique among active shared sets of
* the same type.
* The length of this string should be between 1 and 255 UTF-8 bytes,
* inclusive.
* </pre>
*
* <code>.google.protobuf.StringValue name = 4;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.StringValue, com.google.protobuf.StringValue.Builder, com.google.protobuf.StringValueOrBuilder>
getNameFieldBuilder() {
if (nameBuilder_ == null) {
nameBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.StringValue, com.google.protobuf.StringValue.Builder, com.google.protobuf.StringValueOrBuilder>(
getName(),
getParentForChildren(),
isClean());
name_ = null;
}
return nameBuilder_;
}
private int status_ = 0;
/**
* <pre>
* Output only. The status of this shared set. Read only.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus status = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public int getStatusValue() {
return status_;
}
/**
* <pre>
* Output only. The status of this shared set. Read only.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus status = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder setStatusValue(int value) {
status_ = value;
onChanged();
return this;
}
/**
* <pre>
* Output only. The status of this shared set. Read only.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus status = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus getStatus() {
@SuppressWarnings("deprecation")
com.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus result = com.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus.valueOf(status_);
return result == null ? com.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus.UNRECOGNIZED : result;
}
/**
* <pre>
* Output only. The status of this shared set. Read only.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus status = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder setStatus(com.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus value) {
if (value == null) {
throw new NullPointerException();
}
status_ = value.getNumber();
onChanged();
return this;
}
/**
* <pre>
* Output only. The status of this shared set. Read only.
* </pre>
*
* <code>.google.ads.googleads.v3.enums.SharedSetStatusEnum.SharedSetStatus status = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder clearStatus() {
status_ = 0;
onChanged();
return this;
}
private com.google.protobuf.Int64Value memberCount_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder> memberCountBuilder_;
/**
* <pre>
* Output only. The number of shared criteria within this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value member_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public boolean hasMemberCount() {
return memberCountBuilder_ != null || memberCount_ != null;
}
/**
* <pre>
* Output only. The number of shared criteria within this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value member_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64Value getMemberCount() {
if (memberCountBuilder_ == null) {
return memberCount_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : memberCount_;
} else {
return memberCountBuilder_.getMessage();
}
}
/**
* <pre>
* Output only. The number of shared criteria within this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value member_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder setMemberCount(com.google.protobuf.Int64Value value) {
if (memberCountBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
memberCount_ = value;
onChanged();
} else {
memberCountBuilder_.setMessage(value);
}
return this;
}
/**
* <pre>
* Output only. The number of shared criteria within this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value member_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder setMemberCount(
com.google.protobuf.Int64Value.Builder builderForValue) {
if (memberCountBuilder_ == null) {
memberCount_ = builderForValue.build();
onChanged();
} else {
memberCountBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* Output only. The number of shared criteria within this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value member_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder mergeMemberCount(com.google.protobuf.Int64Value value) {
if (memberCountBuilder_ == null) {
if (memberCount_ != null) {
memberCount_ =
com.google.protobuf.Int64Value.newBuilder(memberCount_).mergeFrom(value).buildPartial();
} else {
memberCount_ = value;
}
onChanged();
} else {
memberCountBuilder_.mergeFrom(value);
}
return this;
}
/**
* <pre>
* Output only. The number of shared criteria within this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value member_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder clearMemberCount() {
if (memberCountBuilder_ == null) {
memberCount_ = null;
onChanged();
} else {
memberCount_ = null;
memberCountBuilder_ = null;
}
return this;
}
/**
* <pre>
* Output only. The number of shared criteria within this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value member_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64Value.Builder getMemberCountBuilder() {
onChanged();
return getMemberCountFieldBuilder().getBuilder();
}
/**
* <pre>
* Output only. The number of shared criteria within this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value member_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64ValueOrBuilder getMemberCountOrBuilder() {
if (memberCountBuilder_ != null) {
return memberCountBuilder_.getMessageOrBuilder();
} else {
return memberCount_ == null ?
com.google.protobuf.Int64Value.getDefaultInstance() : memberCount_;
}
}
/**
* <pre>
* Output only. The number of shared criteria within this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value member_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder>
getMemberCountFieldBuilder() {
if (memberCountBuilder_ == null) {
memberCountBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder>(
getMemberCount(),
getParentForChildren(),
isClean());
memberCount_ = null;
}
return memberCountBuilder_;
}
private com.google.protobuf.Int64Value referenceCount_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder> referenceCountBuilder_;
/**
* <pre>
* Output only. The number of campaigns associated with this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value reference_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public boolean hasReferenceCount() {
return referenceCountBuilder_ != null || referenceCount_ != null;
}
/**
* <pre>
* Output only. The number of campaigns associated with this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value reference_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64Value getReferenceCount() {
if (referenceCountBuilder_ == null) {
return referenceCount_ == null ? com.google.protobuf.Int64Value.getDefaultInstance() : referenceCount_;
} else {
return referenceCountBuilder_.getMessage();
}
}
/**
* <pre>
* Output only. The number of campaigns associated with this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value reference_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder setReferenceCount(com.google.protobuf.Int64Value value) {
if (referenceCountBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
referenceCount_ = value;
onChanged();
} else {
referenceCountBuilder_.setMessage(value);
}
return this;
}
/**
* <pre>
* Output only. The number of campaigns associated with this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value reference_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder setReferenceCount(
com.google.protobuf.Int64Value.Builder builderForValue) {
if (referenceCountBuilder_ == null) {
referenceCount_ = builderForValue.build();
onChanged();
} else {
referenceCountBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* Output only. The number of campaigns associated with this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value reference_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder mergeReferenceCount(com.google.protobuf.Int64Value value) {
if (referenceCountBuilder_ == null) {
if (referenceCount_ != null) {
referenceCount_ =
com.google.protobuf.Int64Value.newBuilder(referenceCount_).mergeFrom(value).buildPartial();
} else {
referenceCount_ = value;
}
onChanged();
} else {
referenceCountBuilder_.mergeFrom(value);
}
return this;
}
/**
* <pre>
* Output only. The number of campaigns associated with this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value reference_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public Builder clearReferenceCount() {
if (referenceCountBuilder_ == null) {
referenceCount_ = null;
onChanged();
} else {
referenceCount_ = null;
referenceCountBuilder_ = null;
}
return this;
}
/**
* <pre>
* Output only. The number of campaigns associated with this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value reference_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64Value.Builder getReferenceCountBuilder() {
onChanged();
return getReferenceCountFieldBuilder().getBuilder();
}
/**
* <pre>
* Output only. The number of campaigns associated with this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value reference_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
public com.google.protobuf.Int64ValueOrBuilder getReferenceCountOrBuilder() {
if (referenceCountBuilder_ != null) {
return referenceCountBuilder_.getMessageOrBuilder();
} else {
return referenceCount_ == null ?
com.google.protobuf.Int64Value.getDefaultInstance() : referenceCount_;
}
}
/**
* <pre>
* Output only. The number of campaigns associated with this shared set. Read only.
* </pre>
*
* <code>.google.protobuf.Int64Value reference_count = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder>
getReferenceCountFieldBuilder() {
if (referenceCountBuilder_ == null) {
referenceCountBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Int64Value, com.google.protobuf.Int64Value.Builder, com.google.protobuf.Int64ValueOrBuilder>(
getReferenceCount(),
getParentForChildren(),
isClean());
referenceCount_ = null;
}
return referenceCountBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.ads.googleads.v3.resources.SharedSet)
}
// @@protoc_insertion_point(class_scope:google.ads.googleads.v3.resources.SharedSet)
private static final com.google.ads.googleads.v3.resources.SharedSet DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.ads.googleads.v3.resources.SharedSet();
}
public static com.google.ads.googleads.v3.resources.SharedSet getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<SharedSet>
PARSER = new com.google.protobuf.AbstractParser<SharedSet>() {
@java.lang.Override
public SharedSet parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new SharedSet(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<SharedSet> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<SharedSet> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.ads.googleads.v3.resources.SharedSet getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
| [
"noreply@github.com"
] | tikivn.noreply@github.com |
9b6ca33b0de313908ecf83c6a7a7c73654b4e27e | 9c10e70c38f5e3632f21a891e0f5b1ad88a8b172 | /app/src/androidTest/java/com/wang/zxing/ApplicationTest.java | 7c1f9f95915f48f94303722669d38088c5eb1848 | [] | no_license | w1123440793/zxinglib | 8397633b9d6d5b61ff1590bb160a29218735e0bc | d5c92cf06c2ddb251d8ceb297b8962997206d603 | refs/heads/master | 2021-01-25T08:12:44.703359 | 2017-06-19T08:04:10 | 2017-06-19T08:04:10 | 93,726,494 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 345 | java | package com.wang.zxing;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"wangchenchen0225@163.com"
] | wangchenchen0225@163.com |
09defc6181bdd4971765f6b059c75ca0ee96917c | fc0aa589ca06c4fc9f357a44712452f306617df4 | /rest/src/main/java/by/epam/kvirykashvili/javalabtask/rest/error/ErrorDetails.java | b45de32668af1e33c2ad2514421ee31fb2bba093 | [] | no_license | gshkvr/swagger | fd094d1447e4bcaa4a7bd6e21ac4120ed1483032 | 4121f09bd41957f925aa6e2f7ce0c2c3dca0579d | refs/heads/master | 2020-06-11T10:45:50.041490 | 2019-06-26T15:57:44 | 2019-06-26T15:57:44 | 193,935,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 780 | java | package by.epam.kvirykashvili.javalabtask.rest.error;
import org.springframework.validation.ObjectError;
import java.util.Date;
import java.util.List;
public class ErrorDetails {
private Date timestamp;
private String message;
public ErrorDetails(Date timestamp, List<ObjectError> errors) {
super();
this.timestamp = timestamp;
this.message = setMessage(errors);
}
public Date getTimestamp() {
return timestamp;
}
public String getMessage() {
return message;
}
private String setMessage(List<ObjectError> errors){
StringBuilder ret = new StringBuilder();
for(ObjectError e : errors){
ret.append(e.getDefaultMessage());
}
return ret.toString();
}
}
| [
"heorhi_kvirykashvili@epam.com"
] | heorhi_kvirykashvili@epam.com |
fc8b509621425a1e45b3b30ee39d609dfff035d5 | 6b00798ac2ea312ee6737895eb6bc90bd5051ab9 | /cloud-system/cloud-system-api/src/main/java/com/lyl/study/cloud/gateway/api/facade/UserFacade.java | 51cd32e3789a7782e12d5f687db9ffc64a6826ec | [] | no_license | Gsmall7/cloud | f3d8534bb57b4abe92a3381e028cbfff004919a5 | 26f3de19364e7dcd545aa0d7a3658d5feca7e2ad | refs/heads/master | 2020-03-30T07:25:33.019384 | 2018-09-28T15:50:56 | 2018-09-28T15:50:56 | 150,938,659 | 1 | 0 | null | 2018-09-30T06:39:27 | 2018-09-30T06:39:26 | null | UTF-8 | Java | false | false | 2,374 | java | package com.lyl.study.cloud.gateway.api.facade;
import com.lyl.study.cloud.base.dto.PageInfo;
import com.lyl.study.cloud.base.exception.NoSuchEntityException;
import com.lyl.study.cloud.gateway.api.dto.request.UserListConditions;
import com.lyl.study.cloud.gateway.api.dto.request.UserSaveForm;
import com.lyl.study.cloud.gateway.api.dto.request.UserUpdateForm;
import com.lyl.study.cloud.gateway.api.dto.response.RoleDTO;
import com.lyl.study.cloud.gateway.api.dto.response.UserDTO;
import com.lyl.study.cloud.gateway.api.dto.response.UserDetailDTO;
import java.util.List;
public interface UserFacade {
/**
* 根据ID获取用户信息
*
* @param id 用户ID
* @return 返回对应ID的用户信息;找不到用户时,返回null
*/
UserDetailDTO getById(long id);
/**
* 根据用户名查询用户信息
*
* @param username 用户名
* @return 返回对应用户名的用户信息;找不到用户时,返回null
*/
UserDetailDTO getByUsername(String username);
/**
* 获取用户的角色列表
*
* @param userId 用户ID
* @param onlyEnable 只筛选启用的角色
* @return 返回对应ID用户的角色列表
* @throws NoSuchEntityException 找不到用户时抛出次异常
*/
List<RoleDTO> getRolesByUserId(long userId, boolean onlyEnable) throws NoSuchEntityException;
/**
* 查询用户列表
*
* @param conditions 查询表单
* @return 用户列表
*/
PageInfo<UserDTO> list(UserListConditions conditions);
/**
* 新增用户信息
*
* @return 新用户ID
* @throws IllegalArgumentException 用户名已存在时,抛出此异常
*/
long save(UserSaveForm userSaveForm) throws IllegalArgumentException;
/**
* 修改用户信息
*/
void update(UserUpdateForm userUpdateForm);
/**
* 根据ID删除用户信息
*
* @param id 用户ID
* @throws NoSuchEntityException 找不到用户
*/
void deleteById(long id) throws NoSuchEntityException;
/**
* 修改用户密码
*
* @param username 用户名
* @param password 密码
* @throws NoSuchEntityException 找不到用户名对应的用户信息
*/
void changePassword(String username, String password) throws NoSuchEntityException;
} | [
"502291755@qq.com"
] | 502291755@qq.com |
b58a1219494c0d5d54a56a9cecf01acb03bba7de | 574d86dd058f0955af86ebf78090397ce6807895 | /solr/src/main/java/solr/Person.java | 98d4d01f8ce599fd1a71964674887a38a13b8da2 | [] | no_license | prosenjit-techHubGit/springcloud-OrderManagement | 835c59c1493f41a2866bd5f7228a4a9c9f4a3bd1 | 0e59d70dedc6010094a258c29331180177eb9c48 | refs/heads/master | 2020-04-05T03:14:42.371333 | 2019-01-01T12:01:36 | 2019-01-01T12:01:36 | 156,506,868 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 624 | java | package solr;
import java.util.Date;
public class Person {
private String fullName;
private Date dateOfBirth;
private int age;
public Person() {
super();
// TODO Auto-generated constructor stub
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public Date getDateOfBirth() {
return dateOfBirth;
}
public void setDateOfBirth(Date dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
| [
"cosypro@gmail.com"
] | cosypro@gmail.com |
e218ac9fd7fe63440cce8e005679366a191ab24b | 7faa7ba4dbd378105aeb468b9005978512f0b063 | /July6_30AMSeleniumBatch/src/verifications/FoldersCreation.java | 890333a4e69959025208e031d940e328c5b61d9b | [] | no_license | ravilella1234/July2021_6_30AM-Batch | 0d455b592e7b8879b85b7086d86e62510c182a58 | 313723f3333a8b36c660b3271fc17cc87a972839 | refs/heads/main | 2023-08-11T04:53:18.920212 | 2021-10-14T01:33:48 | 2021-10-14T01:33:48 | 381,880,275 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package verifications;
import java.io.File;
import java.util.Date;
public class FoldersCreation
{
public static void main(String[] args)
{
String projectPath = System.getProperty("user.dir");
Date dt =new Date();
String screenShotFolder = dt.toString().replace(':', '_').replace(' ', '_');
String mainFolder = projectPath+"//Reports//"+screenShotFolder +"//screenshots//";
File f = new File(mainFolder);
f.mkdirs();
}
}
| [
"maha@gmail.com"
] | maha@gmail.com |
ad9ea66d2b9f9a94ba9dd06144399d36c606c79a | 976c6cb5f9a772ac69dff3c2057d128a9dfe5b15 | /DemoMvc/src/main/java/com/spring/mvc/servlet/AppConfig.java | d9797f44413d950c1c239c8edbcebac7a1a64fad | [] | no_license | vishnuvardhan-cmd/springmvc | c449f386f0088c69a9c407fe9c69a97fc46c1c8f | d39c53e04d9235447717ac0e11c24099234e0855 | refs/heads/master | 2022-12-23T07:09:50.973058 | 2020-03-12T18:56:50 | 2020-03-12T18:56:50 | 246,909,034 | 0 | 0 | null | 2022-12-16T06:06:33 | 2020-03-12T18:53:20 | Rich Text Format | UTF-8 | Java | false | false | 581 | java | package com.spring.mvc.servlet;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
@Configuration
@ComponentScan({ "com.spring.mvc.servlet" })
public class AppConfig {
@Bean
public InternalResourceViewResolver view()
{
InternalResourceViewResolver rv=new InternalResourceViewResolver();
rv.setPrefix("/WEB-INF/");
rv.setSuffix(".jsp");
return rv;
}
}
| [
"noreply@github.com"
] | vishnuvardhan-cmd.noreply@github.com |
799191cc5373e9b31bc652b757bf882988d297eb | 66ba5a880a06f31d0ebb9c755ad87f7261075edf | /JavaWeb/课程资料/day06_JDBC连接池&JDBCTemplate/代码/day05_dataSource_jdbcTemplate/src/cn/itcast/datasource/druid/DruidDemo.java | a666646cdb86b60bbf8cba780bae33c72e4e3928 | [] | no_license | wqkeep/notes | bdbc7564970fbb937690a600e8e2857592a32088 | 82687d6f8de403bfdf194727139a5798c6566c30 | refs/heads/master | 2022-12-21T08:47:31.903713 | 2019-06-12T04:14:53 | 2019-06-12T04:14:53 | 190,994,730 | 2 | 0 | null | 2022-12-16T04:24:54 | 2019-06-09T10:48:44 | HTML | UTF-8 | Java | false | false | 814 | java | package cn.itcast.datasource.druid;
import com.alibaba.druid.pool.DruidDataSourceFactory;
import javax.sql.DataSource;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.util.Properties;
/**
* Druid演示
*/
public class DruidDemo {
public static void main(String[] args) throws Exception {
//1.导入jar包
//2.定义配置文件
//3.加载配置文件
Properties pro = new Properties();
InputStream is = DruidDemo.class.getClassLoader().getResourceAsStream("druid.properties");
pro.load(is);
//4.获取连接池对象
DataSource ds = DruidDataSourceFactory.createDataSource(pro);
//5.获取连接
Connection conn = ds.getConnection();
System.out.println(conn);
}
}
| [
"wqkeep@163.com"
] | wqkeep@163.com |
e766e3e0abe40b642d3b14e4fdfb178571617902 | d37c3bef4022e22860df8bc569630a113ba6078d | /src/chess/Queen.java | e1d6f218a9845a8be0ba478877ec29cf7495167c | [] | no_license | mahsimaheydarii/chess | 9d43ca679c77584ff6042e9e315b7673fadbdd3e | 3689e5b92efac1b6a43fdefc3f82014114d95f05 | refs/heads/master | 2023-08-18T09:23:09.719003 | 2020-07-19T13:02:28 | 2020-07-19T13:02:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 944 | java | package chess;
public class Queen {
private int[][] result;
public Queen(int i, int j, int[][] Definition, boolean number, int[][] maps) {
int[][] result1 = new int[8][8];
int[][] result2 = new int[8][8];
int[][] result = new int[8][8];
Bishop BishopTest = new Bishop(i, j, number, maps);
Rook RookTest = new Rook(i, j, Definition, number, maps);
result1 = BishopTest.information();
result2 = RookTest.information();
for (int k = 0; k < 8; k++) {
for (int l = 0; l < 8; l++) {
if (result1[k][l] > 0 || result2[k][l] > 0) {
result[k][l] = 1;
} else {
result[k][l] = 0;
}
}
}
this.result = result;
}
public int[][] information() {
return result;
}
}
| [
"aliasmdev@gmail.com"
] | aliasmdev@gmail.com |
cc13c708452cac370ab56011699df8bc60bff73f | 498dd2daff74247c83a698135e4fe728de93585a | /clients/google-api-services-ml/v1/1.31.0/com/google/api/services/ml/v1/model/GoogleLongrunningOperation.java | e4b571cfefb150555d85593c348c893e3e951dff | [
"Apache-2.0"
] | permissive | googleapis/google-api-java-client-services | 0e2d474988d9b692c2404d444c248ea57b1f453d | eb359dd2ad555431c5bc7deaeafca11af08eee43 | refs/heads/main | 2023-08-23T00:17:30.601626 | 2023-08-20T02:16:12 | 2023-08-20T02:16:12 | 147,399,159 | 545 | 390 | Apache-2.0 | 2023-09-14T02:14:14 | 2018-09-04T19:11:33 | null | UTF-8 | Java | false | false | 7,775 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.ml.v1.model;
/**
* This resource represents a long-running operation that is the result of a network API call.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the AI Platform Training & Prediction API. For a detailed
* explanation see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class GoogleLongrunningOperation extends com.google.api.client.json.GenericJson {
/**
* If the value is `false`, it means the operation is still in progress. If `true`, the operation
* is completed, and either `error` or `response` is available.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean done;
/**
* The error result of the operation in case of failure or cancellation.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private GoogleRpcStatus error;
/**
* Service-specific metadata associated with the operation. It typically contains progress
* information and common metadata such as create time. Some services might not provide such
* metadata. Any method that returns a long-running operation should document the metadata type,
* if any.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.Map<String, java.lang.Object> metadata;
/**
* The server-assigned name, which is only unique within the same service that originally returns
* it. If you use the default HTTP mapping, the `name` should be a resource name ending with
* `operations/{unique_id}`.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/**
* The normal response of the operation in case of success. If the original method returns no data
* on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method
* is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods,
* the response should have the type `XxxResponse`, where `Xxx` is the original method name. For
* example, if the original method name is `TakeSnapshot()`, the inferred response type is
* `TakeSnapshotResponse`.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.Map<String, java.lang.Object> response;
/**
* If the value is `false`, it means the operation is still in progress. If `true`, the operation
* is completed, and either `error` or `response` is available.
* @return value or {@code null} for none
*/
public java.lang.Boolean getDone() {
return done;
}
/**
* If the value is `false`, it means the operation is still in progress. If `true`, the operation
* is completed, and either `error` or `response` is available.
* @param done done or {@code null} for none
*/
public GoogleLongrunningOperation setDone(java.lang.Boolean done) {
this.done = done;
return this;
}
/**
* The error result of the operation in case of failure or cancellation.
* @return value or {@code null} for none
*/
public GoogleRpcStatus getError() {
return error;
}
/**
* The error result of the operation in case of failure or cancellation.
* @param error error or {@code null} for none
*/
public GoogleLongrunningOperation setError(GoogleRpcStatus error) {
this.error = error;
return this;
}
/**
* Service-specific metadata associated with the operation. It typically contains progress
* information and common metadata such as create time. Some services might not provide such
* metadata. Any method that returns a long-running operation should document the metadata type,
* if any.
* @return value or {@code null} for none
*/
public java.util.Map<String, java.lang.Object> getMetadata() {
return metadata;
}
/**
* Service-specific metadata associated with the operation. It typically contains progress
* information and common metadata such as create time. Some services might not provide such
* metadata. Any method that returns a long-running operation should document the metadata type,
* if any.
* @param metadata metadata or {@code null} for none
*/
public GoogleLongrunningOperation setMetadata(java.util.Map<String, java.lang.Object> metadata) {
this.metadata = metadata;
return this;
}
/**
* The server-assigned name, which is only unique within the same service that originally returns
* it. If you use the default HTTP mapping, the `name` should be a resource name ending with
* `operations/{unique_id}`.
* @return value or {@code null} for none
*/
public java.lang.String getName() {
return name;
}
/**
* The server-assigned name, which is only unique within the same service that originally returns
* it. If you use the default HTTP mapping, the `name` should be a resource name ending with
* `operations/{unique_id}`.
* @param name name or {@code null} for none
*/
public GoogleLongrunningOperation setName(java.lang.String name) {
this.name = name;
return this;
}
/**
* The normal response of the operation in case of success. If the original method returns no data
* on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method
* is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods,
* the response should have the type `XxxResponse`, where `Xxx` is the original method name. For
* example, if the original method name is `TakeSnapshot()`, the inferred response type is
* `TakeSnapshotResponse`.
* @return value or {@code null} for none
*/
public java.util.Map<String, java.lang.Object> getResponse() {
return response;
}
/**
* The normal response of the operation in case of success. If the original method returns no data
* on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method
* is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods,
* the response should have the type `XxxResponse`, where `Xxx` is the original method name. For
* example, if the original method name is `TakeSnapshot()`, the inferred response type is
* `TakeSnapshotResponse`.
* @param response response or {@code null} for none
*/
public GoogleLongrunningOperation setResponse(java.util.Map<String, java.lang.Object> response) {
this.response = response;
return this;
}
@Override
public GoogleLongrunningOperation set(String fieldName, Object value) {
return (GoogleLongrunningOperation) super.set(fieldName, value);
}
@Override
public GoogleLongrunningOperation clone() {
return (GoogleLongrunningOperation) super.clone();
}
}
| [
"noreply@github.com"
] | googleapis.noreply@github.com |
2209953ea9a18863e5fa1f60ad04cb1c7c1c3dbe | 49d02a4771760ae393570ad4cb395f865dcad231 | /app/src/main/java/com/example/collection/activities/AddActivity.java | 3a82438c877211ef73d1740ce79d9fffa185e5e2 | [] | no_license | mariflux/Collection | 33af6bda5beb68213109ca05e728a9da483394cc | 9a04048bf8ec46f1a0c4ea1ba2b7529eb8a135b2 | refs/heads/master | 2022-05-24T09:12:54.547595 | 2020-04-29T13:28:45 | 2020-04-29T13:28:45 | 259,932,769 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,812 | java | package com.example.collection.activities;
import android.content.DialogInterface;
import android.database.Cursor;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import com.example.collection.R;
import com.example.collection.database.DBConstants;
import com.example.collection.database.DBHelper;
import com.example.collection.database.DBQueries;
import com.example.collection.model.Item;
public class AddActivity extends AppCompatActivity {
DBQueries dbQueries;
DBHelper dbHelper;
TextView author;
EditText editTitle, editDescription, editAuthor;
Button addDataButton;
AutoCompleteTextView categoryDropDown;
AutoCompleteTextView typeDropDown;
ImageView dropDownImage;
ImageView dropDownImageType;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add);
setTitle("Dodaj nowy obiekt");
assert getSupportActionBar() != null;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
dbHelper = new DBHelper(this);
dbQueries = new DBQueries(this);
author = (TextView) findViewById(R.id.author);
editTitle = (EditText) findViewById(R.id.editText_title);
editDescription = (EditText) findViewById(R.id.editText_description);
editAuthor = (EditText) findViewById(R.id.editText_author);
editAuthor.setVisibility(View.INVISIBLE);
author.setVisibility(View.INVISIBLE);
addDataButton = (Button) findViewById(R.id.button_addData);
addData();
categoryDropDown = (AutoCompleteTextView) findViewById(R.id.chooseCategoryAdd);
dropDownImage = (ImageView) findViewById(R.id.dropDownImageAdd);
typeDropDown = (AutoCompleteTextView) findViewById(R.id.editText_type);
dropDownImageType = (ImageView) findViewById(R.id.dropDownImageAddType);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, DBConstants.CATEGORY);
categoryDropDown.setAdapter(adapter);
chooseCategory();
chooseType();
categoryDropDown.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String category = categoryDropDown.getText().toString();
showAuthor(category);
hideAuthor(category);
}
});
//showAuthor();
}
public void showAuthor(String category) {
//String category = categoryDropDown.getText().toString();
if (category.equals(DBConstants.TABLE_NAME_BOOKS)) {
editAuthor.setVisibility(View.VISIBLE);
author.setVisibility(View.VISIBLE);
}
}
public void hideAuthor(String category) {
//String category = categoryDropDown.getText().toString();
if (!category.equals(DBConstants.TABLE_NAME_BOOKS)) {
editAuthor.setVisibility(View.INVISIBLE);
author.setVisibility(View.INVISIBLE);
}
}
public void setTypes() {
ArrayAdapter<String> adapterType = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, getTypes());
typeDropDown.setAdapter(adapterType);
}
public String[] getTypes() {
String category = categoryDropDown.getText().toString();
String[] types = new String[]{""};
if (!category.isEmpty()) {
dbQueries.open();
Cursor res = dbQueries.findTypeByCategory(category);
// dbQueries.close();
types = new String[res.getCount()];
int i = 0;
while (res.moveToNext()) {
String type = res.getString(0);
types[i] = type;
i++;
}
}
return types;
}
public void addData() {
addDataButton.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
String cat = categoryDropDown.getText().toString();
String title = editTitle.getText().toString();
String description = editDescription.getText().toString();
String type = typeDropDown.getText().toString();
String author = editAuthor.getText().toString();
if (DBConstants.CATEGORY_LIST.contains(cat)) {
if (!title.trim().isEmpty()) {
dbQueries.open();
if (!dbQueries.alreadyInDatabase(cat, title)) {
addItem(cat, title, description, type, author);
} else {
showMessage("Powtórka!", "" + title + " znajduje się na naszej liście\n" + "Czy na pewno chcesz go dodać?", cat, title, description, type, author);
}
//dbQueries.close();
} else {
Toast.makeText(AddActivity.this, "Podaj tytuł ", Toast.LENGTH_LONG).show();
}
//editCategory.clearComposingText();
} else {
Toast.makeText(AddActivity.this, "Podaj dostępną kategorię ", Toast.LENGTH_LONG).show();
}
if (!title.trim().isEmpty()) {
categoryDropDown.setText("");
editTitle.setText("");
editDescription.setText("");
typeDropDown.setText("");
if (cat.equals(DBConstants.TABLE_NAME_BOOKS))
editAuthor.setText("");
}
}
}
);
}
public void chooseCategory() {
dropDownImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
categoryDropDown.showDropDown();
}
});
}
public void chooseType() {
dropDownImageType.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setTypes();
typeDropDown.showDropDown();
}
});
}
public void addItem(String category, String title, String description, String type, String author) {
Item item = new Item(category, title, description, type, author);
dbQueries.open();
boolean isInserted = dbQueries.insertItem(item);
//dbQueries.close();
if (isInserted && !title.trim().isEmpty()) {
Toast.makeText(AddActivity.this, "Pomyślnie dodano " + title, Toast.LENGTH_LONG).show();
} else {
Toast.makeText(AddActivity.this, "Wystąpił błąd podczas dodawania " + title, Toast.LENGTH_LONG).show();
}
}
public void showMessage(String msgTitle, String msg, final String category, final String title, final String description, final String type, final String author) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(true);
builder.setTitle(msgTitle);
builder.setMessage(msg);
builder.setPositiveButton("Tak", new DialogInterface.OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
addItem(category, title, description, type, author);
dialog.cancel();
}
}
);
builder.setNegativeButton("Nie", new DialogInterface.OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
dialog.cancel();
}
}
);
builder.show();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home)
onBackPressed();
return true;
}
}
| [
"martyna.florian@trimlogic.pl"
] | martyna.florian@trimlogic.pl |
d57cc0e9fff9e7aea904de366ef10d6383831561 | 9a6abd479d5bf43592cf47c3db9b93db91f07cd1 | /bos_utils/src/main/java/Utils/PinYin4jUtils.java | 08b18b2f6a07757c03ea96797c5056d76866d5ad | [] | no_license | wulaobo/bos_parent | c0af88d6631010c6d8c32c0704e0403744e310a8 | 6d17a30393eac390c0689e831d938be4333cc4b4 | refs/heads/master | 2020-04-01T10:03:46.108315 | 2018-10-15T11:16:58 | 2018-10-15T11:17:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,216 | java | package Utils;
import java.util.Arrays;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
public class PinYin4jUtils {
/**
* 将字符串转换成拼音数组
*
* @param src
* @return
*/
public static String[] stringToPinyin(String src) {
return stringToPinyin(src, false, null);
}
/**
* 将字符串转换成拼音数组
*
* @param src
* @return
*/
public static String[] stringToPinyin(String src, String separator) {
return stringToPinyin(src, true, separator);
}
/**
* 将字符串转换成拼音数组
*
* @param src
* @param isPolyphone
* 是否查出多音字的所有拼音
* @param separator
* 多音字拼音之间的分隔符
* @return
*/
public static String[] stringToPinyin(String src, boolean isPolyphone,
String separator) {
// 判断字符串是否为空
if ("".equals(src) || null == src) {
return null;
}
char[] srcChar = src.toCharArray();
int srcCount = srcChar.length;
String[] srcStr = new String[srcCount];
for (int i = 0; i < srcCount; i++) {
srcStr[i] = charToPinyin(srcChar[i], isPolyphone, separator);
}
return srcStr;
}
/**
* 将单个字符转换成拼音
*
* @param src
* @return
*/
public static String charToPinyin(char src, boolean isPolyphone,
String separator) {
// 创建汉语拼音处理类
HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
// 输出设置,大小写,音标方式
defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
StringBuffer tempPinying = new StringBuffer();
// 如果是中文
if (src > 128) {
try {
// 转换得出结果
String[] strs = PinyinHelper.toHanyuPinyinStringArray(src,
defaultFormat);
// 是否查出多音字,默认是查出多音字的第一个字符
if (isPolyphone && null != separator) {
for (int i = 0; i < strs.length; i++) {
tempPinying.append(strs[i]);
if (strs.length != (i + 1)) {
// 多音字之间用特殊符号间隔起来
tempPinying.append(separator);
}
}
} else {
tempPinying.append(strs[0]);
}
} catch (BadHanyuPinyinOutputFormatCombination e) {
e.printStackTrace();
}
} else {
tempPinying.append(src);
}
return tempPinying.toString();
}
public static String hanziToPinyin(String hanzi) {
return hanziToPinyin(hanzi, " ");
}
/**
* 将汉字转换成拼音
*
* @param hanzi
* @param separator
* @return
*/
public static String hanziToPinyin(String hanzi, String separator) {
// 创建汉语拼音处理类
HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
// 输出设置,大小写,音标方式
defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
String pinyingStr = "";
try {
pinyingStr = PinyinHelper.toHanyuPinyinString(hanzi, defaultFormat,
separator);
} catch (BadHanyuPinyinOutputFormatCombination e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return pinyingStr;
}
/**
* 将字符串数组转换成字符串
*
* @param str
* @param separator
* 各个字符串之间的分隔符
* @return
*/
public static String stringArrayToString(String[] str, String separator) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < str.length; i++) {
sb.append(str[i]);
if (str.length != (i + 1)) {
sb.append(separator);
}
}
return sb.toString();
}
/**
* 简单的将各个字符数组之间连接起来
*
* @param str
* @return
*/
public static String stringArrayToString(String[] str) {
return stringArrayToString(str, "");
}
/**
* 将字符数组转换成字符串
*
* @param str
* @param separator
* 各个字符串之间的分隔符
* @return
*/
public static String charArrayToString(char[] ch, String separator) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < ch.length; i++) {
sb.append(ch[i]);
if (ch.length != (i + 1)) {
sb.append(separator);
}
}
return sb.toString();
}
/**
* 将字符数组转换成字符串
*
* @param str
* @return
*/
public static String charArrayToString(char[] ch) {
return charArrayToString(ch, " ");
}
/**
* 取汉字的首字母
*
* @param src
* @param isCapital
* 是否是大写
* @return
*/
public static char[] getHeadByChar(char src, boolean isCapital) {
// 如果不是汉字直接返回
if (src <= 128) {
return new char[] { src };
}
// 获取所有的拼音
String[] pinyingStr = PinyinHelper.toHanyuPinyinStringArray(src);
// 创建返回对象
int polyphoneSize = pinyingStr.length;
char[] headChars = new char[polyphoneSize];
int i = 0;
// 截取首字符
for (String s : pinyingStr) {
char headChar = s.charAt(0);
// 首字母是否大写,默认是小写
if (isCapital) {
headChars[i] = Character.toUpperCase(headChar);
} else {
headChars[i] = headChar;
}
i++;
}
return headChars;
}
/**
* 取汉字的首字母(默认是大写)
*
* @param src
* @return
*/
public static char[] getHeadByChar(char src) {
return getHeadByChar(src, true);
}
/**
* 查找字符串首字母
*
* @param src
* @return
*/
public static String[] getHeadByString(String src) {
return getHeadByString(src, true);
}
/**
* 查找字符串首字母
*
* @param src
* @param isCapital
* 是否大写
* @return
*/
public static String[] getHeadByString(String src, boolean isCapital) {
return getHeadByString(src, isCapital, null);
}
/**
* 查找字符串首字母
*
* @param src
* @param isCapital
* 是否大写
* @param separator
* 分隔符
* @return
*/
public static String[] getHeadByString(String src, boolean isCapital,
String separator) {
char[] chars = src.toCharArray();
String[] headString = new String[chars.length];
int i = 0;
for (char ch : chars) {
char[] chs = getHeadByChar(ch, isCapital);
StringBuffer sb = new StringBuffer();
if (null != separator) {
int j = 1;
for (char ch1 : chs) {
sb.append(ch1);
if (j != chs.length) {
sb.append(separator);
}
j++;
}
} else {
sb.append(chs[0]);
}
headString[i] = sb.toString();
i++;
}
return headString;
}
public static void main(String[] args) {
// pin4j 简码 和 城市编码
String s1 = "中华人民共和国";
String[] headArray = getHeadByString(s1); // 获得每个汉字拼音首字母
System.out.println(Arrays.toString(headArray));
String s2 ="长城" ;
System.out.println(Arrays.toString(stringToPinyin(s2,true,",")));
String s3 ="长";
System.out.println(Arrays.toString(stringToPinyin(s3,true,",")));
}
}
| [
"wulaoboOne@atgit.com"
] | wulaoboOne@atgit.com |
66f86ace4d9b41027300290be6290221f66ce0ec | 195c3c1e6bd9d6641ac30cff626d4abd45e6cf28 | /VisitorListINIS/src/controller/PersonTableUIMouseController.java | d63324b6982542fe6e6bc99f1dcbb3f2a8d01ba1 | [] | no_license | Eliezer-Barbosa/queue-data-structure-visitor- | 34358dc8492cc4467d5505a69f3f165ffe455af9 | a7d30057d3f23d93fd30edd4ce70d22a782724f8 | refs/heads/master | 2020-09-27T15:36:53.143494 | 2019-12-07T17:16:23 | 2019-12-07T17:16:23 | 226,547,355 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,592 | java | package controller;
import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import view.PersonTableUI;
public class PersonTableUIMouseController implements MouseListener {
private PersonTableUI personTableUI;
public PersonTableUIMouseController(PersonTableUI personTableUI) {
this.personTableUI = personTableUI;
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent e) {
if(e.getSource().equals(personTableUI.getBtnAdd())) {
personTableUI.getBtnAdd().setForeground(Color.CYAN);
personTableUI.getBtnAdd().setSize(personTableUI.getBtnAdd().getWidth() + 10, personTableUI.getBtnAdd().getHeight() + 10);
}
if(e.getSource().equals(personTableUI.getBtnBack())) {
personTableUI.getBtnBack().setForeground(Color.CYAN);
personTableUI.getBtnBack().setSize(personTableUI.getBtnBack().getWidth() + 10, personTableUI.getBtnBack().getHeight() + 10);
}
if(e.getSource().equals(personTableUI.getBtnCallNext())) {
personTableUI.getBtnCallNext().setForeground(Color.CYAN);
personTableUI.getBtnCallNext().setSize(personTableUI.getBtnCallNext().getWidth() + 10, personTableUI.getBtnCallNext().getHeight() + 10);
}
if(e.getSource().equals(personTableUI.getBtnDelete())) {
personTableUI.getBtnDelete().setForeground(Color.CYAN);
personTableUI.getBtnDelete().setSize(personTableUI.getBtnDelete().getWidth() + 10, personTableUI.getBtnDelete().getHeight() + 10);
}
if(e.getSource().equals(personTableUI.getBtnDeleteNpersons())) {
personTableUI.getBtnDeleteNpersons().setForeground(Color.CYAN);
personTableUI.getBtnDeleteNpersons().setSize(personTableUI.getBtnDeleteNpersons().getWidth() + 10, personTableUI.getBtnDeleteNpersons().getHeight() + 10);
}
if(e.getSource().equals(personTableUI.getBtnUpdate())) {
personTableUI.getBtnUpdate().setForeground(Color.CYAN);
personTableUI.getBtnUpdate().setSize(personTableUI.getBtnUpdate().getWidth() + 10, personTableUI.getBtnUpdate().getHeight() + 10);
}
if(e.getSource().equals(personTableUI.getBtnFindById())) {
personTableUI.getBtnFindById().setForeground(Color.CYAN);
personTableUI.getBtnFindById().setSize(personTableUI.getBtnFindById().getWidth() + 10, personTableUI.getBtnFindById().getHeight() + 10);
}
}
@Override
public void mouseExited(MouseEvent e) {
if(e.getSource().equals(personTableUI.getBtnAdd())) {
personTableUI.getBtnAdd().setForeground(Color.WHITE);
personTableUI.getBtnAdd().setSize(personTableUI.getBtnAdd().getWidth() - 10, personTableUI.getBtnAdd().getHeight() - 10);
}
if(e.getSource().equals(personTableUI.getBtnBack())) {
personTableUI.getBtnBack().setForeground(Color.WHITE);
personTableUI.getBtnBack().setSize(personTableUI.getBtnBack().getWidth() - 10, personTableUI.getBtnBack().getHeight() - 10);
}
if(e.getSource().equals(personTableUI.getBtnCallNext())) {
personTableUI.getBtnCallNext().setForeground(Color.WHITE);
personTableUI.getBtnCallNext().setSize(personTableUI.getBtnCallNext().getWidth() - 10, personTableUI.getBtnCallNext().getHeight() - 10);
}
if(e.getSource().equals(personTableUI.getBtnDelete())) {
personTableUI.getBtnDelete().setForeground(Color.WHITE);
personTableUI.getBtnDelete().setSize(personTableUI.getBtnDelete().getWidth() - 10, personTableUI.getBtnDelete().getHeight() - 10);
}
if(e.getSource().equals(personTableUI.getBtnDeleteNpersons())) {
personTableUI.getBtnDeleteNpersons().setForeground(Color.WHITE);
personTableUI.getBtnDeleteNpersons().setSize(personTableUI.getBtnDeleteNpersons().getWidth() - 10, personTableUI.getBtnDeleteNpersons().getHeight() - 10);
}
if(e.getSource().equals(personTableUI.getBtnUpdate())) {
personTableUI.getBtnUpdate().setForeground(Color.WHITE);
personTableUI.getBtnUpdate().setSize(personTableUI.getBtnUpdate().getWidth() - 10, personTableUI.getBtnUpdate().getHeight() - 10);
}
if(e.getSource().equals(personTableUI.getBtnFindById())) {
personTableUI.getBtnFindById().setForeground(Color.WHITE);
personTableUI.getBtnFindById().setSize(personTableUI.getBtnFindById().getWidth() - 10, personTableUI.getBtnFindById().getHeight() - 10);
}
}
}
| [
"noreply@github.com"
] | Eliezer-Barbosa.noreply@github.com |
ad07cfe981dcb2fdfb15c7306bd5039ab95338ee | 853558e23d5ae7245761ce54cb8fce7b141fddf7 | /app/src/main/java/com/example/actividad1/MainActivity.java | 0f23d630a18266b8289165f015287a9769107b5f | [] | no_license | GifPlay/Actividad1 | 51e4bf3555e9e1c8e431c229509266de7cc338d0 | 1a363f63adb76731ab1d1e7284bb3cdf152f521b | refs/heads/master | 2023-01-03T03:00:33.293582 | 2020-10-20T15:35:48 | 2020-10-20T15:35:48 | 305,749,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 827 | java | package com.example.actividad1;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//vincula al boton del archivo activity_main.xml con el MainActivity.java
Button btnMA = findViewById(R.id.btnMA);
btnMA.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent ira2 = new Intent(MainActivity.this,MainActivity2.class);
startActivity(ira2);
}
});
}
} | [
"ioa_isma@hotmail.com"
] | ioa_isma@hotmail.com |
84fb7cf06158b7d4e2221d4ecabdfbc12e245663 | f730363cf5c7dd63d0d5bc94eede6b5da2dbab15 | /InheritanceChallenge/src/com/company/Main.java | ae3c693fc1d39572b601a5d958557a375eb67b0c | [] | no_license | StephenJMScott/JavaCourse | 6b7ab5a28e634593cd823c48e034bb157e4c0279 | e6e59422692a84343aade383a94717944941ac6f | refs/heads/master | 2020-04-18T14:06:43.523801 | 2019-02-01T15:20:38 | 2019-02-01T15:20:38 | 167,580,545 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 111 | java | package com.company;
public class Main extends Object{
public static void main(String[] args) {
}
}
| [
"stephenjmscott@gmail.com"
] | stephenjmscott@gmail.com |
134b54134b40c2248cef9decc2e734b137b0e01c | 37ca689c9ad2288cd9f8d904d9333f6c646322c6 | /src/module-info.java | 889defaf5eaefb3259f4a532a23d530a2b6f96d1 | [] | no_license | LJB30/QA_Results_Challenge | bfac4bcb4bd7fcdd66d3c5f936e4863e3b173bb5 | 0ee005c483ec1290822eb9bc3e7cc685b44546c2 | refs/heads/main | 2023-03-05T12:01:51.635278 | 2021-02-17T10:55:02 | 2021-02-17T10:55:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 36 | java | module operatorsChallengeResults {
} | [
"LButcher@qa.com"
] | LButcher@qa.com |
e7b8642c815763e3e5aa7605becd0a6495addcfc | de4c1c18247cbf08f84d762cc7bb19192bb90151 | /app/src/main/java/gisclace/aire/trap.java | b385efd2d088ba88d3a844b822451730050c3bf8 | [] | no_license | gisclace/Android_Aire | 786648df65580e311234c9fa5724ad4dfaf91a81 | 9715f1e1637b11cf772fec956978e5dd2ecd3387 | refs/heads/master | 2021-01-10T10:50:35.764345 | 2015-05-29T14:56:09 | 2015-05-29T14:56:09 | 36,510,811 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,079 | java | package gisclace.aire;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class trap extends Fragment {
View rootview;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootview = inflater.inflate(R.layout.trap, container, false);
Button add = (Button) rootview.findViewById(R.id.calculer);
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//Déclaration des EditText
EditText valeura = (EditText) rootview.findViewById(R.id.valeura);
EditText valeurb = (EditText) rootview.findViewById(R.id.valeurb);
EditText valeurc = (EditText) rootview.findViewById(R.id.valeurc);
TextView total = (TextView) rootview.findViewById(R.id.resultat);
//Gestion des champs vides
final String inTxtL = valeura.getText().toString();
final String inTxtl = valeurb.getText().toString();
final String inTxtc = valeurc.getText().toString();
if (inTxtL.equals("") ||inTxtl.equals("")||inTxtc.equals("")) {
Toast.makeText(rootview.getContext(), "Vous devez remplir toutes les valeurs.", Toast.LENGTH_SHORT).show();
return;
}
//Float + calcules
float floata = Float.parseFloat(valeura.getText().toString());
float floatb = Float.parseFloat(valeurb.getText().toString());
float floatc = Float.parseFloat(valeurc.getText().toString());
total.setText(String.valueOf((floatc+floata)*floatb/2));
}
});
return rootview;
}
}
| [
"gisclace@gmail.com"
] | gisclace@gmail.com |
e9781b05e7da29d2784d73c1be00d3f31043ea0b | 74e0a6e7985daa033a7484ad5445531a3dff051e | /app/src/main/java/com/hxsoft/ajitai/utils/CircleImageView.java | c06901f0226ac87f91fb74c1089caf2baa390702 | [] | no_license | lidengyao/ajitai | afc8515f9b7b1d8e107372bc8288c2595062aa42 | 94f54c3adf96426555a082f86f23ce61e74f8b9b | refs/heads/master | 2022-08-16T15:50:24.968078 | 2020-05-24T12:21:34 | 2020-05-24T12:21:34 | 265,784,438 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,885 | java | package com.hxsoft.ajitai.utils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.ColorInt;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.support.annotation.RequiresApi;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewOutlineProvider;
import android.widget.ImageView;
import com.hxsoft.ajitai.R;
@SuppressLint("AppCompatCustomView")
public class CircleImageView extends ImageView {
private static final ScaleType SCALE_TYPE = ScaleType.CENTER_CROP;
private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888;
private static final int COLORDRAWABLE_DIMENSION = 2;
private static final int DEFAULT_BORDER_WIDTH = 0;
private static final int DEFAULT_BORDER_COLOR = Color.BLACK;
private static final int DEFAULT_CIRCLE_BACKGROUND_COLOR = Color.TRANSPARENT;
private static final boolean DEFAULT_BORDER_OVERLAY = false;
private final RectF mDrawableRect = new RectF();
private final RectF mBorderRect = new RectF();
private final Matrix mShaderMatrix = new Matrix();
private final Paint mBitmapPaint = new Paint();
private final Paint mBorderPaint = new Paint();
private final Paint mCircleBackgroundPaint = new Paint();
private int mBorderColor = DEFAULT_BORDER_COLOR;
private int mBorderWidth = DEFAULT_BORDER_WIDTH;
private int mCircleBackgroundColor = DEFAULT_CIRCLE_BACKGROUND_COLOR;
private Bitmap mBitmap;
private BitmapShader mBitmapShader;
private int mBitmapWidth;
private int mBitmapHeight;
private float mDrawableRadius;
private float mBorderRadius;
private ColorFilter mColorFilter;
private boolean mReady;
private boolean mSetupPending;
private boolean mBorderOverlay;
private boolean mDisableCircularTransformation;
public CircleImageView(Context context) {
super(context);
init();
}
public CircleImageView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public CircleImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView, defStyle, 0);
mBorderWidth = a.getDimensionPixelSize(R.styleable.CircleImageView_civ_border_width, DEFAULT_BORDER_WIDTH);
mBorderColor = a.getColor(R.styleable.CircleImageView_civ_border_color, DEFAULT_BORDER_COLOR);
mBorderOverlay = a.getBoolean(R.styleable.CircleImageView_civ_border_overlay, DEFAULT_BORDER_OVERLAY);
// Look for deprecated civ_fill_color if civ_circle_background_color is not set
if (a.hasValue(R.styleable.CircleImageView_civ_circle_background_color)) {
mCircleBackgroundColor = a.getColor(R.styleable.CircleImageView_civ_circle_background_color,
DEFAULT_CIRCLE_BACKGROUND_COLOR);
} else if (a.hasValue(R.styleable.CircleImageView_civ_fill_color)) {
mCircleBackgroundColor = a.getColor(R.styleable.CircleImageView_civ_fill_color,
DEFAULT_CIRCLE_BACKGROUND_COLOR);
}
a.recycle();
init();
}
private void init() {
super.setScaleType(SCALE_TYPE);
mReady = true;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
setOutlineProvider(new OutlineProvider());
}
if (mSetupPending) {
setup();
mSetupPending = false;
}
}
@Override
public ScaleType getScaleType() {
return SCALE_TYPE;
}
@Override
public void setScaleType(ScaleType scaleType) {
if (scaleType != SCALE_TYPE) {
throw new IllegalArgumentException(String.format("ScaleType %s not supported.", scaleType));
}
}
@Override
public void setAdjustViewBounds(boolean adjustViewBounds) {
if (adjustViewBounds) {
throw new IllegalArgumentException("adjustViewBounds not supported.");
}
}
@Override
protected void onDraw(Canvas canvas) {
if (mDisableCircularTransformation) {
super.onDraw(canvas);
return;
}
if (mBitmap == null) {
return;
}
if (mCircleBackgroundColor != Color.TRANSPARENT) {
canvas.drawCircle(mDrawableRect.centerX(), mDrawableRect.centerY(), mDrawableRadius, mCircleBackgroundPaint);
}
canvas.drawCircle(mDrawableRect.centerX(), mDrawableRect.centerY(), mDrawableRadius, mBitmapPaint);
if (mBorderWidth > 0) {
canvas.drawCircle(mBorderRect.centerX(), mBorderRect.centerY(), mBorderRadius, mBorderPaint);
}
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
setup();
}
@Override
public void setPadding(int left, int top, int right, int bottom) {
super.setPadding(left, top, right, bottom);
setup();
}
@Override
public void setPaddingRelative(int start, int top, int end, int bottom) {
super.setPaddingRelative(start, top, end, bottom);
setup();
}
public int getBorderColor() {
return mBorderColor;
}
public void setBorderColor(@ColorInt int borderColor) {
if (borderColor == mBorderColor) {
return;
}
mBorderColor = borderColor;
mBorderPaint.setColor(mBorderColor);
invalidate();
}
/**
* @deprecated Use {@link #setBorderColor(int)} instead
*/
@Deprecated
public void setBorderColorResource(@ColorRes int borderColorRes) {
setBorderColor(getContext().getResources().getColor(borderColorRes));
}
public int getCircleBackgroundColor() {
return mCircleBackgroundColor;
}
public void setCircleBackgroundColor(@ColorInt int circleBackgroundColor) {
if (circleBackgroundColor == mCircleBackgroundColor) {
return;
}
mCircleBackgroundColor = circleBackgroundColor;
mCircleBackgroundPaint.setColor(circleBackgroundColor);
invalidate();
}
public void setCircleBackgroundColorResource(@ColorRes int circleBackgroundRes) {
setCircleBackgroundColor(getContext().getResources().getColor(circleBackgroundRes));
}
/**
* Return the color drawn behind the circle-shaped drawable.
*
* @return The color drawn behind the drawable
*
* @deprecated Use {@link #getCircleBackgroundColor()} instead.
*/
@Deprecated
public int getFillColor() {
return getCircleBackgroundColor();
}
/**
* Set a color to be drawn behind the circle-shaped drawable. Note that
* this has no effect if the drawable is opaque or no drawable is set.
*
* @param fillColor The color to be drawn behind the drawable
*
* @deprecated Use {@link #setCircleBackgroundColor(int)} instead.
*/
@Deprecated
public void setFillColor(@ColorInt int fillColor) {
setCircleBackgroundColor(fillColor);
}
/**
* Set a color to be drawn behind the circle-shaped drawable. Note that
* this has no effect if the drawable is opaque or no drawable is set.
*
* @param fillColorRes The color resource to be resolved to a color and
* drawn behind the drawable
*
* @deprecated Use {@link #setCircleBackgroundColorResource(int)} instead.
*/
@Deprecated
public void setFillColorResource(@ColorRes int fillColorRes) {
setCircleBackgroundColorResource(fillColorRes);
}
public int getBorderWidth() {
return mBorderWidth;
}
public void setBorderWidth(int borderWidth) {
if (borderWidth == mBorderWidth) {
return;
}
mBorderWidth = borderWidth;
setup();
}
public boolean isBorderOverlay() {
return mBorderOverlay;
}
public void setBorderOverlay(boolean borderOverlay) {
if (borderOverlay == mBorderOverlay) {
return;
}
mBorderOverlay = borderOverlay;
setup();
}
public boolean isDisableCircularTransformation() {
return mDisableCircularTransformation;
}
public void setDisableCircularTransformation(boolean disableCircularTransformation) {
if (mDisableCircularTransformation == disableCircularTransformation) {
return;
}
mDisableCircularTransformation = disableCircularTransformation;
initializeBitmap();
}
@Override
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
initializeBitmap();
}
@Override
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
initializeBitmap();
}
@Override
public void setImageResource(@DrawableRes int resId) {
super.setImageResource(resId);
initializeBitmap();
}
@Override
public void setImageURI(Uri uri) {
super.setImageURI(uri);
initializeBitmap();
}
@Override
public void setColorFilter(ColorFilter cf) {
if (cf == mColorFilter) {
return;
}
mColorFilter = cf;
applyColorFilter();
invalidate();
}
@Override
public ColorFilter getColorFilter() {
return mColorFilter;
}
private void applyColorFilter() {
if (mBitmapPaint != null) {
mBitmapPaint.setColorFilter(mColorFilter);
}
}
private Bitmap getBitmapFromDrawable(Drawable drawable) {
if (drawable == null) {
return null;
}
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
}
try {
Bitmap bitmap;
if (drawable instanceof ColorDrawable) {
bitmap = Bitmap.createBitmap(COLORDRAWABLE_DIMENSION, COLORDRAWABLE_DIMENSION, BITMAP_CONFIG);
} else {
bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), BITMAP_CONFIG);
}
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
return bitmap;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
private void initializeBitmap() {
if (mDisableCircularTransformation) {
mBitmap = null;
} else {
mBitmap = getBitmapFromDrawable(getDrawable());
}
setup();
}
private void setup() {
if (!mReady) {
mSetupPending = true;
return;
}
if (getWidth() == 0 && getHeight() == 0) {
return;
}
if (mBitmap == null) {
invalidate();
return;
}
mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
mBitmapPaint.setAntiAlias(true);
mBitmapPaint.setShader(mBitmapShader);
mBorderPaint.setStyle(Paint.Style.STROKE);
mBorderPaint.setAntiAlias(true);
mBorderPaint.setColor(mBorderColor);
mBorderPaint.setStrokeWidth(mBorderWidth);
mCircleBackgroundPaint.setStyle(Paint.Style.FILL);
mCircleBackgroundPaint.setAntiAlias(true);
mCircleBackgroundPaint.setColor(mCircleBackgroundColor);
mBitmapHeight = mBitmap.getHeight();
mBitmapWidth = mBitmap.getWidth();
mBorderRect.set(calculateBounds());
mBorderRadius = Math.min((mBorderRect.height() - mBorderWidth) / 2.0f, (mBorderRect.width() - mBorderWidth) / 2.0f);
mDrawableRect.set(mBorderRect);
if (!mBorderOverlay && mBorderWidth > 0) {
mDrawableRect.inset(mBorderWidth - 1.0f, mBorderWidth - 1.0f);
}
mDrawableRadius = Math.min(mDrawableRect.height() / 2.0f, mDrawableRect.width() / 2.0f);
applyColorFilter();
updateShaderMatrix();
invalidate();
}
private RectF calculateBounds() {
int availableWidth = getWidth() - getPaddingLeft() - getPaddingRight();
int availableHeight = getHeight() - getPaddingTop() - getPaddingBottom();
int sideLength = Math.min(availableWidth, availableHeight);
float left = getPaddingLeft() + (availableWidth - sideLength) / 2f;
float top = getPaddingTop() + (availableHeight - sideLength) / 2f;
return new RectF(left, top, left + sideLength, top + sideLength);
}
private void updateShaderMatrix() {
float scale;
float dx = 0;
float dy = 0;
mShaderMatrix.set(null);
if (mBitmapWidth * mDrawableRect.height() > mDrawableRect.width() * mBitmapHeight) {
scale = mDrawableRect.height() / (float) mBitmapHeight;
dx = (mDrawableRect.width() - mBitmapWidth * scale) * 0.5f;
} else {
scale = mDrawableRect.width() / (float) mBitmapWidth;
dy = (mDrawableRect.height() - mBitmapHeight * scale) * 0.5f;
}
mShaderMatrix.setScale(scale, scale);
mShaderMatrix.postTranslate((int) (dx + 0.5f) + mDrawableRect.left, (int) (dy + 0.5f) + mDrawableRect.top);
mBitmapShader.setLocalMatrix(mShaderMatrix);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
return inTouchableArea(event.getX(), event.getY()) && super.onTouchEvent(event);
}
private boolean inTouchableArea(float x, float y) {
return Math.pow(x - mBorderRect.centerX(), 2) + Math.pow(y - mBorderRect.centerY(), 2) <= Math.pow(mBorderRadius, 2);
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private class OutlineProvider extends ViewOutlineProvider {
@Override
public void getOutline(View view, Outline outline) {
Rect bounds = new Rect();
mBorderRect.roundOut(bounds);
outline.setRoundRect(bounds, bounds.width() / 2.0f);
}
}
}
| [
"atalidengyao@163.com"
] | atalidengyao@163.com |
6bd94936f98ec623849a5069c5be36b17a324bec | d3b25e459593a85d5a43f919f9b57293dccbae87 | /Lab6/MainFrame.java | 6b82565d4b3531e0d074d5aa1db3f3da47ca8d7b | [] | no_license | IvascuVlad/Java | bfc05612d5a4649eb6c0bc0c32b901a7b7750b76 | 8b0a4962e72ba1fdb6596d8fbb9ba123323be7ca | refs/heads/master | 2022-07-27T13:25:38.593331 | 2020-05-21T13:16:52 | 2020-05-21T13:16:52 | 248,571,160 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,063 | java | import javax.swing.*;
import java.awt.*;
import static java.awt.BorderLayout.CENTER;
import static javax.swing.JSplitPane.BOTTOM;
import static javax.swing.JSplitPane.TOP;
public class MainFrame extends JFrame {
ConfigPanel configPanel;
ControlPanel controlPanel;
DrawingPanel canvas;
ShapePanel shapePanel;
public MainFrame() {
super("My Drawing Application");
init();
}
private void init() {
setDefaultCloseOperation(EXIT_ON_CLOSE);
//create the components
canvas = new DrawingPanel(this);
controlPanel = new ControlPanel(this);
shapePanel = new ShapePanel(this);
configPanel = new ConfigPanel(this);
//arrange the components in the container (frame)
//JFrame uses a BorderLayout by default
add(canvas, CENTER); //this is BorderLayout.CENTER
add(configPanel, BorderLayout.NORTH);
add(controlPanel,BorderLayout.SOUTH);
add(shapePanel,BorderLayout.EAST);
//invoke the layout manager
pack();
}
}
| [
"61700616+IvascuVlad@users.noreply.github.com"
] | 61700616+IvascuVlad@users.noreply.github.com |
ad69ad8ef990270d62483e7ece7edfa8a0729ee3 | 246a3e83df30013fe2f3afcb6a060312b3bbd8dc | /src/com/course/ch05/initialization/NewVarArgs.java | d93f63edcbf4324ae9e5a88df6637cabd2f9163b | [] | no_license | tinysquarelabs/tijava4 | 674b3b6207cab217f8c53c6cd56391d8d4e74baf | d0fff0bad77ffca40c996963ffd74a3197c6eb01 | refs/heads/master | 2022-02-17T12:48:25.508794 | 2019-09-27T01:00:49 | 2019-09-27T01:00:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 710 | java | package com.course.ch05.initialization;
import static net.mindview.util.Print.print;
class A{
A(){
print("I'm A");
}
@Override
public String toString() {
return "Override toString ";
}
}
public class NewVarArgs {
static void printArray(Object... args){
for(Object obj:args)
print(obj);
}
public static void main(String[] args) {
printArray(new Object[]{
new Integer(47), new Float(3.14),new Double(11.11)});
printArray(47,3.14F,11.11);
printArray("one","two","three");
printArray(new A(),new A(), new A());
printArray((Object[]) new Integer[]{1,2,3,4});
printArray();
}
}
| [
"silverwater@qq.com"
] | silverwater@qq.com |
8ae78ce05fd469a58e60e23ff627ca810a8fc5a5 | 256e6a80ff7441e971df85c0fd722a310e2916d5 | /igc-clientlibrary/src/main/java/org/odpi/egeria/connectors/ibm/igc/clientlibrary/model/generated/v11502sp6/TermHistory.java | 96bb875fa5853c02b8c7cbca5e0edaaefe44e997 | [
"CC-BY-4.0",
"Apache-2.0"
] | permissive | odpi-poc/egeria-connector-ibm-information-server | fe1fc9b9378c871a860616a4456a8b27f2291aaf | 0b77b6390915310bd89bf3974d0602df301c13ac | refs/heads/master | 2020-07-04T21:19:52.107710 | 2019-08-14T20:41:01 | 2019-09-20T16:14:14 | 202,420,871 | 0 | 1 | Apache-2.0 | 2019-09-05T03:29:04 | 2019-08-14T20:25:31 | Java | UTF-8 | Java | false | false | 4,468 | java | /* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.egeria.connectors.ibm.igc.clientlibrary.model.generated.v11502sp6;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.annotation.Generated;
import org.odpi.egeria.connectors.ibm.igc.clientlibrary.model.common.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
/**
* POJO for the {@code term_history} asset type in IGC, displayed as '{@literal Term History}' in the IGC UI.
* <br><br>
* (this code has been generated based on out-of-the-box IGC metadata types;
* if modifications are needed, eg. to handle custom attributes,
* extending from this class in your own custom class is the best approach.)
*/
@Generated("org.odpi.egeria.connectors.ibm.igc.clientlibrary.model.IGCRestModelGenerator")
@JsonIgnoreProperties(ignoreUnknown=true)
@JsonTypeName("term_history")
public class TermHistory extends Reference {
public static String getIgcTypeDisplayName() { return "Term History"; }
/**
* The {@code term} property, displayed as '{@literal Term}' in the IGC UI.
* <br><br>
* Will be a single {@link Reference} to a {@link InformationAsset} object.
*/
protected Reference term;
/**
* The {@code date} property, displayed as '{@literal Date}' in the IGC UI.
*/
protected Date date;
/**
* The {@code comment} property, displayed as '{@literal Comment}' in the IGC UI.
*/
protected ArrayList<String> comment;
/**
* The {@code edited_by} property, displayed as '{@literal Edited By}' in the IGC UI.
*/
protected String edited_by;
/**
* The {@code changed_properties} property, displayed as '{@literal Changed Properties}' in the IGC UI.
* <br><br>
* Will be a {@link ReferenceList} of {@link ChangedProperties} objects.
*/
protected ReferenceList changed_properties;
/** @see #term */ @JsonProperty("term") public Reference getTerm() { return this.term; }
/** @see #term */ @JsonProperty("term") public void setTerm(Reference term) { this.term = term; }
/** @see #date */ @JsonProperty("date") public Date getDate() { return this.date; }
/** @see #date */ @JsonProperty("date") public void setDate(Date date) { this.date = date; }
/** @see #comment */ @JsonProperty("comment") public ArrayList<String> getComment() { return this.comment; }
/** @see #comment */ @JsonProperty("comment") public void setComment(ArrayList<String> comment) { this.comment = comment; }
/** @see #edited_by */ @JsonProperty("edited_by") public String getEditedBy() { return this.edited_by; }
/** @see #edited_by */ @JsonProperty("edited_by") public void setEditedBy(String edited_by) { this.edited_by = edited_by; }
/** @see #changed_properties */ @JsonProperty("changed_properties") public ReferenceList getChangedProperties() { return this.changed_properties; }
/** @see #changed_properties */ @JsonProperty("changed_properties") public void setChangedProperties(ReferenceList changed_properties) { this.changed_properties = changed_properties; }
public static Boolean canBeCreated() { return false; }
public static Boolean includesModificationDetails() { return false; }
private static final List<String> NON_RELATIONAL_PROPERTIES = Arrays.asList(
"date",
"comment",
"edited_by"
);
private static final List<String> STRING_PROPERTIES = Arrays.asList(
"comment",
"edited_by"
);
private static final List<String> PAGED_RELATIONAL_PROPERTIES = Arrays.asList(
"changed_properties"
);
private static final List<String> ALL_PROPERTIES = Arrays.asList(
"term",
"date",
"comment",
"edited_by",
"changed_properties"
);
public static List<String> getNonRelationshipProperties() { return NON_RELATIONAL_PROPERTIES; }
public static List<String> getStringProperties() { return STRING_PROPERTIES; }
public static List<String> getPagedRelationshipProperties() { return PAGED_RELATIONAL_PROPERTIES; }
public static List<String> getAllProperties() { return ALL_PROPERTIES; }
public static Boolean isTermHistory(Object obj) { return (obj.getClass() == TermHistory.class); }
}
| [
"chris@thegrotes.net"
] | chris@thegrotes.net |
3832aa43aea6cdf6d18539c749a694917323df1f | a335ca17558ed4f77a85e6497cf7b7c4130140cd | /1DV607/src/BlackJack/Controller/PlayGame.java | 9bfc26e63e6e1f6c74a74c9d3641ed1b6d9a5f60 | [] | no_license | RonaZong/Lecture | 4f12ad02e368e7c447448916c0edec8241b96b21 | d357fdf7e3f5a612c673918607e9d0e7a6ce640b | refs/heads/master | 2022-12-31T15:24:05.440593 | 2020-10-22T15:07:33 | 2020-10-22T15:07:33 | 259,694,654 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 800 | java | package BlackJack.Controller;
import BlackJack.Model.Game;
import BlackJack.View.IView;
public class PlayGame {
public boolean Play(Game a_game, IView a_view) {
a_view.DisplayWelcomeMessage();
a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore());
a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore());
if (a_game.IsGameOver())
{
a_view.DisplayGameOver(a_game.IsDealerWinner());
}
int input = a_view.GetInput();
if (input == 'p')
{
a_game.NewGame();
}
else if (input == 'h')
{
a_game.Hit();
}
else if (input == 's')
{
a_game.Stand();
}
return input != 'q';
}
}
| [
"xz222bb@student.lnu.se"
] | xz222bb@student.lnu.se |
f94d2dce137d8c80bd2d823fbcc2b6d5736ebea3 | 1a62c8c2f8da43a4b1d69e6b2e5c895d7c1202f0 | /corejava/src/main/java/com/corejava/Interfaces/DeskPhone.java | 266686118609115b91438cf1676d0fdb718182dc | [] | no_license | sayalm/corejava | bd94d94729b885ed67d02029adef1b437a77d828 | 107597ff7c8f038b792f102abafe09ed6a8af611 | refs/heads/master | 2023-09-04T23:12:37.450582 | 2021-11-18T04:55:52 | 2021-11-18T04:55:52 | 411,931,043 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,007 | java | package com.corejava.Interfaces;
public class DeskPhone implements ITelephone{
private int myNumber;
private boolean isRinging;
public DeskPhone(int myNumber) {
this.myNumber = myNumber;
}
@Override
public void powerOn() {
System.out.println("No action taken, desk phone does not have a power button");
}
@Override
public void dial(int phoneNumber) {
System.out.println("Now ringing" + phoneNumber+ " on deskphone");
}
@Override
public void answer() {
if (isRinging){
System.out.println("Answering the desk phone");
isRinging = false;
}
}
@Override
public boolean callPhone(int phoneNumber) {
if (phoneNumber == myNumber){
isRinging = true;
System.out.println("Ring Ring");
}else {
isRinging = false;
}
return isRinging;
}
@Override
public boolean isRinging() {
return false;
}
}
| [
"deadmetal72@gmail.com"
] | deadmetal72@gmail.com |
3feb698e76b544fe0fc79fe0b684d963ca1c2ff7 | ab3283e0aa7f653ac3896f07f8ec75f06bae0af0 | /app/src/androidTest/java/com/alemacedo/a13mobincrivelfirebase/ExampleInstrumentedTest.java | fa59d645cc319d31669465ec4723db6c299a8575 | [] | no_license | aledebarba/13MOBIncrivelFirebase | ae405f56aa4854c62b25adde6fca915ff7eb654c | 1b36025698fee60c5795da8adc256a412b7ecccb | refs/heads/master | 2021-01-02T23:01:17.329810 | 2017-08-05T19:02:15 | 2017-08-05T19:02:15 | 99,442,350 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 776 | java | package com.alemacedo.a13mobincrivelfirebase;
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.alemacedo.a13mobincrivelfirebase", appContext.getPackageName());
}
}
| [
"logonrm@fiap.com.br"
] | logonrm@fiap.com.br |
9a6faffa7ddf70f80f26c3a5ff8c93bf06dc1ed7 | bdb0433972e45d27c77896db3366e0cc32af5419 | /Test.java | 464a6d341d6490d0644b28cd49aa44e4a965b02e | [] | no_license | ItzUzi/Data-Structures-Practice | 4c902b02d3d770ceec1105075fbd022ad07d1147 | 8a138d41c85e633084a1c0c3375cc826f7a54f8c | refs/heads/master | 2023-08-10T18:33:05.917805 | 2021-09-23T07:03:17 | 2021-09-23T07:03:17 | 402,599,963 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 535 | java | public class Test {
public static void main(String[] args) {
BagArray<String> bag = new BagArray<String>(10);
if(bag.add("Hello"))
System.out.println("Add was successful!");
else
System.out.println("Add was not successful");
bag.add("Hello");
bag.add("Hi");
if (bag.contains("Hello")) {
System.out.println("detects Hello!");
}
Items item = new Items("Shopping Cart", 500.12);
System.out.println(item);
}
}
| [
"ugaeta@cpp.edu"
] | ugaeta@cpp.edu |
73e0ba4d4c9e9b985dc03796587fcafa1203a153 | ad8428446d7ef64390696bf075f4ad2498dec3cf | /src/com/syn/pos/CreditCardType.java | 51783570c44bb7763a25ea589e228197196067fe | [] | no_license | Synature-Jitthapong/myrepo_core_libs | 487e2c85d84e20b19da84622feb1ec3b2b784d55 | 4c1cd93c72357b0d05d13f3e2b4adbcd0e7d8db1 | refs/heads/master | 2021-01-01T18:49:07.350276 | 2014-05-22T11:08:33 | 2014-05-22T11:08:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 709 | java | package com.syn.pos;
public class CreditCardType {
private int CreditCardTypeID;
private String CreditCardTypeName;
public CreditCardType(){
}
public CreditCardType(int type, String name){
this.CreditCardTypeID = type;
this.CreditCardTypeName = name;
}
public int getCreditCardTypeId() {
return CreditCardTypeID;
}
public void setCreditCardTypeId(int creditCardTypeId) {
this.CreditCardTypeID = creditCardTypeId;
}
public String getCreditCardTypeName() {
return CreditCardTypeName;
}
public void setCreditCardTypeName(String creditCardTypeName) {
this.CreditCardTypeName = creditCardTypeName;
}
@Override
public String toString() {
return CreditCardTypeName;
}
}
| [
"jitthapong@synaturegroup.com"
] | jitthapong@synaturegroup.com |
6b225ba8bec054293be9a20617da9873ae905f2a | fd028a27bdcae4b72be45865f4dbed38575e6618 | /src/com/codingbat/string1/twochar/TwoChar.java | 9a1c76ac69daf06e96319b3e2466504266e8ab68 | [
"MIT"
] | permissive | leiurus17/java-codingbat | 4430ab6fa7747926e7f3c7ca8cac2f16e3126fb8 | 826dba4fa1568404072e4c347ade9616e650cdb6 | refs/heads/master | 2022-01-21T12:23:02.792454 | 2019-07-07T08:21:23 | 2019-07-07T08:21:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 597 | java | package com.codingbat.string1.twochar;
public class TwoChar {
public static void main(String[] args) {
System.out.println(twoChar("java", 0));
System.out.println(twoChar("java", 2));
System.out.println(twoChar("java", 3));
System.out.println(twoChar("Hello", 1));
System.out.println(twoChar("Hello", 3));
}
private static String twoChar(String str, int index) {
if (str.length() <= index + 1 || index < 0) {
return str.substring(0,2);
} else {
return str.substring(index, index + 2);
}
}
}
| [
"martianworm17@gmail.com"
] | martianworm17@gmail.com |
46e508c097cf10f4416e107e4ba8e2013b398aca | 520506a54f966c27227f22debb74e6d52ffaba51 | /src/求数组峰值/Solution.java | 5f1975ba9d716be0f0981db992c48c5eab3917d1 | [] | no_license | shenweihai/sword-to-offer | 1b56ff848e1ff8f1630576c1d9a235cd0772f03d | f36ed14b43d0810ba94f68563cce5a17a66a3190 | refs/heads/master | 2021-08-22T15:32:06.047965 | 2018-11-02T14:43:59 | 2018-11-02T14:43:59 | 146,058,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 976 | java | package 求数组峰值;
public class Solution {
public int getPeak(int array[]) {
int low = 0;
int high = array.length - 1;
if (array == null || array.length == 0) {
return -1;
}
while (low < high) {
int mid = (low + high) >> 1;
if (array[mid] > array[mid + 1]) {
high = mid;
} else if (array[mid] < array[mid + 1]) {
low = mid + 1;
} else {
low++;
//high--;
}
}
return array[low];
}
public static void main(String[] args) {
Solution solution = new Solution();
System.out.println(solution.getPeak(new int[]{1,2,3,3,3,55,2,1}));
System.out.println(solution.getPeak(new int[]{1,2,3,4,5,5,6,6,3,1}));
System.out.println(solution.getPeak(new int[]{1,2,3,4,5}));
System.out.println(solution.getPeak(new int[]{1,30,3,3,3,3}));
}
}
| [
"1335191770@qq.com"
] | 1335191770@qq.com |
8126e443748aa20c25ded485f289b77119cd5db0 | 4c2e8b9d64dce94ec74fa2a4951a926f42db7f7a | /src/by/it/kaminskii/jd01_10/PrintString.java | 27058b0022b6fa89be31fd5fabf690ec376cdd98 | [] | no_license | NorthDragons/JD2021-02-24 | 7ffa5d4fc6d0984563a0af192fc34b921327c52a | 14bc46e536a1352dca08585ed03309e1e11e52e5 | refs/heads/master | 2023-04-01T16:44:33.325159 | 2021-04-23T14:59:25 | 2021-04-23T14:59:25 | 344,739,064 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 647 | java | package by.it.kaminskii.jd01_10;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
public class PrintString {
public static void main(String[] args) {
new PrintString().printStrName(java.lang.String.class);
}
void printStrName(Class<?> str){
Method[] methods = str.getDeclaredMethods();
for (Method method : methods){
int modifier = method.getModifiers();
StringBuilder name = new StringBuilder("");
if(!Modifier.isStatic(modifier)){
name.append(method.getName());
System.out.println(name);
}
}
}
}
| [
"ivankaminskii323@gmail.com"
] | ivankaminskii323@gmail.com |
97a40028ae9b141c05fa0b59744d3367019adde2 | 70eca8cdc216cc85679621ce23e06e4cd4dd8355 | /cloudframe-provider/cloudframe-provider-sys/src/main/java/com/ai/cloudframe/provider/sys/mapper/UserRoleMapper.java | df363152d3cd8650515a8121e9f4b3fd8056cbdf | [] | no_license | GzsLlo/cloudframe-master | 794bd63ca888f6f8da41b7f50e2eb20f3441d118 | b616a92d66d99a18ba16f9ce169a28eff68b0f09 | refs/heads/master | 2022-12-26T05:38:29.953943 | 2019-10-14T00:36:34 | 2019-10-14T00:36:34 | 214,049,281 | 0 | 0 | null | 2022-12-10T03:35:22 | 2019-10-10T00:17:16 | Java | UTF-8 | Java | false | false | 323 | java | package com.ai.cloudframe.provider.sys.mapper;
import com.ai.cloudframe.provider.sys.entity.UserRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author Automated procedures
* @since 2019-07-19
*/
public interface UserRoleMapper extends BaseMapper<UserRole> {
}
| [
"jiangchao3@asiainfo.com"
] | jiangchao3@asiainfo.com |
6c5a94baa9c86b4b635720351d435b6fc4f6352d | b2db76de55ab98d1be2235718c2a441e9554eaad | /src/main/java/com/ipartek/formacion/controller/UserController.java | 7e54511ec6459b60580caea916e49e1d29753735 | [] | no_license | JonCarrascoB/uf2218 | f236877b2b178fcd2cfd58310701d5d6e432b070 | ec0552c3fe156568d1f57f76ff129df68fdfd522 | refs/heads/master | 2022-07-04T11:15:10.589816 | 2019-07-29T15:26:00 | 2019-07-29T15:26:00 | 196,944,340 | 0 | 0 | null | 2021-06-15T16:01:42 | 2019-07-15T07:11:01 | Java | UTF-8 | Java | false | false | 2,030 | java | package com.ipartek.formacion.controller;
import java.io.IOException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Validation;
import javax.validation.Validator;
import com.ipartek.formacion.model.dao.UserDAO;
import com.ipartek.formacion.model.dao.VideoDAO;
/**
* Servlet implementation class UserController
*/
@WebServlet("/user")
public class UserController extends HttpServlet {
private static final long serialVersionUID = 1L;
public static final String VIEW_FORM = "sigin.jsp";
public static String view = VIEW_FORM;
public static final String OP_LISTAR = "0";
public static final String OP_NEWUSER = "1";
public static final String OP_GUARDAR = "2";
public static final String OP_MODIFICAR = "3";
public static final String OP_DETALLE = "4";
public static final String OP_ELIMINAR = "5";
private static UserDAO userDAO;
private Validator validator;
public void init(ServletConfig config) throws ServletException {
super.init(config);
userDAO = UserDAO.getInstance();
validator = Validation.buildDefaultValidatorFactory().getValidator();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doProcess(request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doProcess(request, response);
}
private void doProcess(HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
}
}
| [
"jcarrascobar@gmail.com"
] | jcarrascobar@gmail.com |
8ece75aa60d760608b21ce03cb443194dc429b3d | 79ade2654786407c84665b1d171a68b36496d626 | /example/src/main/java/com/picovr/example/activities/BluetoothHelperActivity.java | fdce3b371bc9cf732fcf11f4c30d91fe204a3409 | [] | no_license | juan2615363/AndroidHelper | 069797c804e99efc4c9f641ed1620a7257444dfb | c755d4deef03c790997715e6d5d1c330d677d468 | refs/heads/master | 2023-08-20T12:53:04.542716 | 2021-09-29T06:19:02 | 2021-09-29T06:19:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,591 | java | package com.picovr.example.activities;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.picovr.androidhelper.BlueToothHelper;
import com.picovr.example.MethodAdapter;
import com.picovr.example.R;
import java.util.Arrays;
import java.util.List;
public class BluetoothHelperActivity extends Activity {
private static final String TAG = "BluetoothHelperActivity";
List<String> methods = Arrays.asList("registerBluetoothReceiver", "unregisterBluetoothReceiver", "getContentDevices", "getBluetoothMac");
BlueToothHelper blueToothHelper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bluetooth_helper);
blueToothHelper = new BlueToothHelper();
blueToothHelper.init(this);
initView();
}
private void initView(){
ListView listView = findViewById(R.id.lv_bluetooth_helper);
ArrayAdapter arrayAdapter = new MethodAdapter(this, android.R.layout.simple_list_item_1, methods);
listView.setAdapter(arrayAdapter);
}
private void registerBluetoothReceiver(){
blueToothHelper.registerBlueToothReceiver();
}
private void unregisterBluetoothReceiver(){
blueToothHelper.unregisterBlueToothReceiver();
}
private void getContentDevices(){
String s = blueToothHelper.getContentDevice();
}
private void getBluetoothMac(){
String s = blueToothHelper.getBlueToothMac();
}
} | [
"46362299+picoxr@users.noreply.github.com"
] | 46362299+picoxr@users.noreply.github.com |
68cbd3d1661bb742fe9f2ca2888e04fcfc828563 | 7df8222ec966cd4b40398685c98879f03235ebcd | /app/src/main/java/com/example/souhaikr/adopt/entities/breeds.java | 1ae24d5f401bcbcd71c64197175af91f30876022 | [] | no_license | souhailkr/Adopti-Android | b40ecbf2b662b2763c65f1feb024576b2bcc60a4 | 0e1edfa52bb73b9b7392a4ea3b11bc6f45e56cb9 | refs/heads/master | 2020-04-09T15:41:29.110212 | 2018-12-29T14:38:59 | 2018-12-29T14:38:59 | 160,432,970 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 456 | java | package com.example.souhaikr.adopt.entities;
import com.google.gson.annotations.SerializedName;
import java.lang.reflect.Array;
import java.util.ArrayList;
/**
* Created by SouhaiKr on 10/12/2018.
*/
public class breeds {
@SerializedName("breed")
ArrayList<BreedName> breed ;
public ArrayList<BreedName> getBreed() {
return breed;
}
public void setBreed(ArrayList<BreedName> breed) {
this.breed = breed;
}
}
| [
"souhail.krimi@esprit.tn"
] | souhail.krimi@esprit.tn |
276cb60230fc4378c145139e1a9f2923678531ec | 19114726cf63987e0377a28b5bd0f719fc0f7532 | /src/com/desginpatterns/behavior/observerpattern/IObserver.java | 8bfeff4e302d296e43a1be9f59f9540fa2d2ab24 | [] | no_license | ackjui/learningPath | 487873277f8d57d40c06fe8cbed69bc39974d4f7 | c3b528bfe28446f2e3a91e395b092671c04a67a9 | refs/heads/master | 2021-09-08T23:21:40.030568 | 2021-09-03T03:20:02 | 2021-09-03T03:20:02 | 177,612,885 | 0 | 0 | null | 2019-10-15T17:37:14 | 2019-03-25T15:22:45 | Java | UTF-8 | Java | false | false | 104 | java | package com.desginpatterns.behavior.observerpattern;
public interface IObserver {
void update();
}
| [
"v-rorawat@expedia.com"
] | v-rorawat@expedia.com |
e6924c63a2f4238cd1ce4f3260ee8eaebcbd618f | 22c73191be15e90824ab9d9d475b9d12a71da5c6 | /src/main/java/com/example/demospringncc/service/ProductService.java | 19ebed03f85a231100e8dcdd6d87f5646ce25d0e | [] | no_license | kasawa9x/SpringNCC | 237e6c7d19c49175b38ecb888899f0bc6e70091b | d0da75b65570854adbe4976c43f7abc895c8e8b8 | refs/heads/master | 2023-06-15T18:27:35.281926 | 2021-07-09T04:00:31 | 2021-07-09T04:00:31 | 382,109,653 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,059 | java | package com.example.demospringncc.service;
import com.example.demospringncc.model.Category;
import com.example.demospringncc.model.Product;
import com.example.demospringncc.respository.CategoryRespository;
import com.example.demospringncc.respository.ProductResponsitory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@Service
public class ProductService {
@Autowired
ProductResponsitory productResponsitory;
public List<Product> getAllProduct(){
return productResponsitory.findAll();
}
public void addProduct(Product product){
productResponsitory.save(product);
}
public void remoteProductById(long id){
productResponsitory.deleteById(id);
}
public Optional<Product> getProductyById(long id) {
return productResponsitory.findById(id);
}
public List<Product> getAllProductByCategoryId(int id){
return productResponsitory.findAllByCategory_Id(id);
}
}
| [
"53332944+kasawa9x@users.noreply.github.com"
] | 53332944+kasawa9x@users.noreply.github.com |
76fb31381b1442f7dfa725e4f4e12e21b9b62768 | 61d099e9e44ab00eb1178c6a54f7c9893d813ae7 | /app/src/main/java/adapter/BuyChildAdapter.java | 456c54083415cb40bb5e64b999fbc98025309396 | [] | no_license | haihengMu/huanlecheng | 0fa0e24584fcc6ce7b19e256295987dada594d6e | 361224d1bb0f4d6091aff5aae6d1390cde01ef60 | refs/heads/master | 2021-01-18T16:09:32.663707 | 2017-03-31T06:14:19 | 2017-03-31T06:14:19 | 86,717,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,740 | java | /**
* 异步图片适配器 对应BatmipDemo
*/
package adapter;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
import java.util.List;
import activity.huanlecheng.R;
import bean.CaiPiaoNewTopBean;
import bean.NewPlayGameNameChild;
import util.CaipiaoDao;
import view.ViewHolder;
public class BuyChildAdapter extends BaseAdapter {
private Context mContext;
private LayoutInflater mInflater;
private ImageLoader mImageLoader;
private DisplayImageOptions op;
private List<NewPlayGameNameChild> mList;
private String title;
private CaipiaoDao caipiaoDao;
private RelativeLayout rl_tou;
private String da_title;
public BuyChildAdapter(Context context, List<NewPlayGameNameChild> list, String title, String da_title) {
this.title = title;
this.mContext = context;
this.mList = list;
this.da_title = da_title;
notifyDataSetChanged();
}
@Override
public int getCount() {
return mList == null ? 0 : mList.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(
R.layout.down_lie_grid, null);
}
final TextView bottom_tt = ViewHolder.get(convertView, R.id.tv_name);
ImageView iv_imageview = ViewHolder.get(convertView, R.id.iv_right);
rl_tou = ViewHolder.get(convertView, R.id.rl_tou);
caipiaoDao = new CaipiaoDao(mContext);
rl_tou.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
List<CaiPiaoNewTopBean> list=caipiaoDao.findAllTop();
int a=list.size();
/* List<CaiPiaoNewTopBean> list = caipiaoDao.findAllnewTop();
boolean r = false;
if (list.size() <= 0) {
String a=mList.get(position).getH_g_p_name();
String b=bottom_tt.getText().toString();
caipiaoDao.addnewtop(mList.get(position).getH_g_p_id(), mList.get(position).getH_g_p_name(), mList.get(position).getH_g_p_cid(), mList.get(position).getH_g_p_nid(),
mList.get(position).getH_g_p_tid(), mList.get(position).getH_g_p_gid(), mList.get(position).getH_g_p_rid(), mList.get(position).getH_g_p_one_amount(),
mList.get(position).getH_g_p_max_bet_mum(), mList.get(position).getH_g_p_bonus(), mList.get(position).getH_g_p_amount_step(), mList.get(position).getH_g_p_rebate_step(),
mList.get(position).getH_g_p_decimal(), mList.get(position).getH_g_p_return_off(), mList.get(position).getH_g_p_introduction(), mList.get(position).getH_g_p_example(),
mList.get(position).getH_g_p_max_imumbonus_rebate(), mList.get(position).getH_g_p_mini_mumbonus_rebate(), mList.get(position).getH_g_p_mini_bet_money(), mList.get(position).getH_g_p_max_bet_money(), mList.get(position).getH_g_p_max_bonus(),
mList.get(position).getH_g_p_max_bonus_mode(), mList.get(position).getH_g_p_not_bet_code(), mList.get(position).getH_g_p_singled_num(), mList.get(position).getH_g_p_max_bonus(), title);
} else {
for (int i = 0; i < list.size(); i++) {
if (!list.get(i).getH_g_p_name().equals(mList.get(position).getH_g_p_name())) {
if (!list.get(i).getTitle().equals(title)) {
r = true;
} else {
r = true;
}
} else {
if (!list.get(i).getTitle().equals(title)) {
r = true;
} else {
r = false;
break;
}
}
}
}
if (r) {
caipiaoDao.addnewtop(mList.get(position).getH_g_p_id(), mList.get(position).getH_g_p_name(), mList.get(position).getH_g_p_cid(), mList.get(position).getH_g_p_nid(),
mList.get(position).getH_g_p_tid(), mList.get(position).getH_g_p_gid(), mList.get(position).getH_g_p_rid(), mList.get(position).getH_g_p_one_amount(),
mList.get(position).getH_g_p_max_bet_mum(), mList.get(position).getH_g_p_bonus(), mList.get(position).getH_g_p_amount_step(), mList.get(position).getH_g_p_rebate_step(),
mList.get(position).getH_g_p_decimal(), mList.get(position).getH_g_p_return_off(), mList.get(position).getH_g_p_introduction(), mList.get(position).getH_g_p_example(),
mList.get(position).getH_g_p_max_imumbonus_rebate(), mList.get(position).getH_g_p_mini_mumbonus_rebate(), mList.get(position).getH_g_p_mini_bet_money(), mList.get(position).getH_g_p_max_bet_money(), mList.get(position).getH_g_p_max_bonus(),
mList.get(position).getH_g_p_max_bonus_mode(), mList.get(position).getH_g_p_not_bet_code(), mList.get(position).getH_g_p_singled_num(), mList.get(position).getH_g_p_max_bonus(), title);
}*/
Intent intent = new Intent();
intent.setAction("action.topview");
intent.putExtra("position", position + "");
mContext.sendBroadcast(intent);
notifyDataSetChanged();
}
}
);
final NewPlayGameNameChild gm = mList.get(position);
if (title.indexOf("3D") != -1 || title.indexOf("时时乐") != -1) {
if (da_title.equals("二星")) {
if (position == 0 || position == 1) {
bottom_tt.setText(gm.getH_g_p_name() + "复式");
} else if (position == 2 || position == 3) {
bottom_tt.setText(gm.getH_g_p_name() + "单式");
}
}
} else if (title.indexOf("快3") != -1) {
bottom_tt.setText(gm.getH_g_p_name());
} else if (title.indexOf("赛车") != -1) {
if (da_title.equals("大小") || da_title.equals("单双") || da_title.equals("龙虎")) {
bottom_tt.setText(da_title + gm.getH_g_p_name());
} else {
bottom_tt.setText(gm.getH_g_p_name());
}
} else if (title.indexOf("11选5") == -1) {
if (da_title.equals("任选")) {
if (position == 1 || position == 0) {
bottom_tt.setText("任四" + gm.getH_g_p_name());
} else if (position == 2 || position == 3 || position == 4 || position == 5 || position == 6) {
bottom_tt.setText("任三" + gm.getH_g_p_name());
} else if (position == 7 || position == 8 || position == 9) {
bottom_tt.setText("任二" + gm.getH_g_p_name());
}
} else if (da_title.equals("和值")) {
if (position == 1 || position == 0 || position == 2 || position == 3 || position == 4) {
bottom_tt.setText(gm.getH_g_p_name() + "直选");
} else if (position == 5 || position == 6 || position == 7) {
bottom_tt.setText(gm.getH_g_p_name() + "组选");
} else if (position == 8 || position == 9 || position == 10) {
bottom_tt.setText(gm.getH_g_p_name() + "尾数");
}
} else if (da_title.equals("二星")) {
if (position == 0 || position == 1 || position == 2 || position == 3) {
bottom_tt.setText(gm.getH_g_p_name() + "直选");
} else if (position == 4 || position == 5 || position == 6 || position == 7) {
bottom_tt.setText(gm.getH_g_p_name() + "组选");
}
} else if (position == 0 && gm.getH_g_p_name().equals("复式")) {
bottom_tt.setText(da_title + gm.getH_g_p_name());
} else if (position == 0 && gm.getH_g_p_name().equals("前三")) {
bottom_tt.setText(gm.getH_g_p_name() + da_title);
} else if (position == 1 && gm.getH_g_p_name().equals("中三")) {
bottom_tt.setText(gm.getH_g_p_name() + da_title);
} else if (position == 2 && gm.getH_g_p_name().equals("后三")) {
bottom_tt.setText(gm.getH_g_p_name() + da_title);
} else if (position == 1 && gm.getH_g_p_name().equals("单式")) {
bottom_tt.setText(da_title + gm.getH_g_p_name());
} else if (position == 3 && gm.getH_g_p_name().equals("组选24")) {
bottom_tt.setText(da_title + gm.getH_g_p_name());
} else if (position == 2 && gm.getH_g_p_name().equals("组三")) {
bottom_tt.setText(da_title + gm.getH_g_p_name());
} else if (position == 4 && gm.getH_g_p_name().equals("组六")) {
bottom_tt.setText(da_title + gm.getH_g_p_name());
} else if (position == 2 && gm.getH_g_p_name().equals("组合")) {
bottom_tt.setText(da_title + gm.getH_g_p_name());
} else if (position == 4 && gm.getH_g_p_name().equals("组选12")) {
bottom_tt.setText(da_title + gm.getH_g_p_name());
} else if (position == 5 && gm.getH_g_p_name().equals("组选6")) {
bottom_tt.setText(da_title + gm.getH_g_p_name());
} else if (position == 6 && gm.getH_g_p_name().equals("组选4")) {
bottom_tt.setText(da_title + gm.getH_g_p_name());
} else if (position == 6 && gm.getH_g_p_name().equals("混合组选")) {
bottom_tt.setText(da_title + "混合");
} else {
bottom_tt.setText(gm.getH_g_p_name());
}
} else {
if (da_title.equals("任选")) {
if (position == 0 || position == 1 || position == 2 || position == 3 || position == 4 || position == 5 || position == 6 || position == 7) {
bottom_tt.setText(da_title + gm.getH_g_p_name() + "复式");
} else if (position == 8 || position == 9 || position == 10 || position == 11 || position == 12 || position == 13 || position == 14 || position == 15) {
bottom_tt.setText(da_title + gm.getH_g_p_name() + "单式");
}
} else if (da_title.equals("二星")) {
if (position == 0 || position == 1 || position == 2 || position == 3) {
bottom_tt.setText(gm.getH_g_p_name() + "直选");
} else if (position == 4 || position == 5 || position == 6 || position == 7) {
bottom_tt.setText(gm.getH_g_p_name() + "组选");
}
} else if (da_title.equals("胆拖")) {
bottom_tt.setText("任选" + gm.getH_g_p_name());
} else if (position == 0 && gm.getH_g_p_name().equals("前三")) {
bottom_tt.setText(gm.getH_g_p_name() + da_title);
} else if (position == 1 && gm.getH_g_p_name().equals("中三")) {
bottom_tt.setText(gm.getH_g_p_name() + da_title);
} else if (position == 2 && gm.getH_g_p_name().equals("后三")) {
bottom_tt.setText(gm.getH_g_p_name() + da_title);
} else {
bottom_tt.setText(gm.getH_g_p_name());
}
}
return convertView;
}
public DisplayImageOptions getListOptions() {
DisplayImageOptions options = new DisplayImageOptions.Builder()
.cacheInMemory(false) // 设置图片不缓存于内存中
.cacheOnDisc(true).bitmapConfig(Bitmap.Config.RGB_565) // 设置图片的质量
.imageScaleType(ImageScaleType.IN_SAMPLE_INT) // 设置图片的缩放类型,该方
.build();
return options;
}
}
| [
"18640996690@163.com"
] | 18640996690@163.com |
8cfca4e144c64e382826301db323f328a49e2269 | 6992f990826ab9f7baded219bd95a05cb79f26fe | /StudentDatabase_PieChart/src/StudentDatabase/Controller.java | b4e32536f50ee2e8a358391acde3d56b42611617 | [] | no_license | jvberdec/CSC221 | 3f551caa6b527f1b4c855cb07d03120e223186fd | 062881a4c4c8b0920fd4665ee7cc7d75bf0f5438 | refs/heads/master | 2022-07-16T03:54:32.036598 | 2020-05-16T02:20:24 | 2020-05-16T02:20:24 | 255,436,477 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 54 | java | package StudentDatabase;
public class Controller {
}
| [
"44758976+jvberdec@users.noreply.github.com"
] | 44758976+jvberdec@users.noreply.github.com |
af53c1712ad777a780c69a7fb1a152702a862aca | 992b7c28f9888b55225ab4f9b2e6e4681ae60a11 | /platform/sys/sys-core/src/main/java/com/telecom/ecloudframework/sys/core/model/SerialNo.java | 6bc960deabc54a5ecf9287bb9edde37f3f4bc8b4 | [] | no_license | cehui0802/telecom | 7cdf21e633693a570af8e3a5e6c1fd18e67d781c | 482fb900d9370958d4810a4b987c7a963d1369a7 | refs/heads/master | 2023-03-11T13:45:04.430708 | 2021-02-25T07:39:21 | 2021-02-25T07:39:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,956 | java | package com.telecom.ecloudframework.sys.core.model;
import org.apache.commons.lang3.builder.ToStringBuilder;
import com.telecom.ecloudframework.base.api.model.IDModel;
public class SerialNo implements IDModel{
protected String id; /*主键*/
protected String name; /*名称*/
protected String alias; /*别名*/
protected String regulation; /*规则*/
protected Short genType; /*生成类型*/
protected Integer noLength; /*流水号长度*/
protected String curDate; /*当前日期*/
protected Integer initValue; /*初始值*/
protected Integer curValue = 0; /*当前值*/
protected Short step; /*步长*/
/**
* 新的流水号。
*/
protected Integer newCurValue = 0;
/**
* 预览流水号。
*/
protected String curIdenValue = "";
public void setId(String id) {
this.id = id;
}
/**
* 返回 id_
*
* @return
*/
public String getId() {
return this.id;
}
public void setName(String name) {
this.name = name;
}
/**
* 返回 name_
*
* @return
*/
public String getName() {
return this.name;
}
public void setAlias(String alias) {
this.alias = alias;
}
/**
* 返回 alias_
*
* @return
*/
public String getAlias() {
return this.alias;
}
public void setRegulation(String regulation) {
this.regulation = regulation;
}
/**
* 返回 regulation_
*
* @return
*/
public String getRegulation() {
return this.regulation;
}
public void setGenType(Short genType) {
this.genType = genType;
}
/**
* 返回 gen_type_
*
* @return
*/
public Short getGenType() {
return this.genType;
}
public void setNoLength(Integer noLength) {
this.noLength = noLength;
}
/**
* 返回 no_length_
*
* @return
*/
public Integer getNoLength() {
return this.noLength;
}
public void setCurDate(String curDate) {
this.curDate = curDate;
}
/**
* 返回 cur_date_
*
* @return
*/
public String getCurDate() {
return this.curDate;
}
public void setInitValue(Integer initValue) {
this.initValue = initValue;
}
/**
* 返回 init_value_
*
* @return
*/
public Integer getInitValue() {
return this.initValue;
}
public void setCurValue(Integer curValue) {
this.curValue = curValue;
}
/**
* 返回 cur_value_
*
* @return
*/
public Integer getCurValue() {
if (curValue == null) return 0;
return this.curValue;
}
public void setStep(Short step) {
this.step = step;
}
/**
* 返回 step_
*
* @return
*/
public Short getStep() {
return this.step;
}
public Integer getNewCurValue() {
return newCurValue;
}
public void setNewCurValue(Integer newCurValue) {
this.newCurValue = newCurValue;
}
public String getCurIdenValue() {
return curIdenValue;
}
public void setCurIdenValue(String curIdenValue) {
this.curIdenValue = curIdenValue;
}
/**
* @see java.lang.Object#toString()
*/
public String toString() {
return new ToStringBuilder(this)
.append("id", this.id)
.append("name", this.name)
.append("alias", this.alias)
.append("regulation", this.regulation)
.append("genType", this.genType)
.append("noLength", this.noLength)
.append("curDate", this.curDate)
.append("initValue", this.initValue)
.append("curValue", this.curValue)
.append("step", this.step)
.toString();
}
} | [
"xyf080218@163.com"
] | xyf080218@163.com |
96659848d9f4cdb358c1c033555d2f60c10d2351 | 9c9d404e63f7a9d1318a56fddca6668fa918946f | /src/main/java/org/bl/json/jersey/rest/service/Request.java | 4364f672b5d32c1d73895811221f7423b22ee895 | [] | no_license | bogdanlupashko/JerseyJSONAPITests | 628776045d7ed937c4b73e217a3fc58d2fe675df | de576e88b67f23cb048c592ffa00502daff97d2d | refs/heads/master | 2020-12-24T15:23:11.358404 | 2015-07-21T12:13:27 | 2015-07-21T12:13:27 | 33,369,938 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,266 | java | package org.bl.json.jersey.rest.service;
import org.bl.json.jersey.client.JerseyClient;
import org.bl.json.jersey.model.request.PriceYourRequest;
import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
/**
* @author Bogdan Lupashko
*/
@Path(JerseyClient.API_PREAMBLE + "request/")
public interface Request {
@GET
@Path("item")
@Produces(MediaType.APPLICATION_JSON)
PriceYourRequest requestItem(@QueryParam("token") String token,
@FormParam("id") int id) throws WebApplicationException;
@POST
@Path("item")
@Produces(MediaType.APPLICATION_JSON)
@Consumes("application/x-www-form-urlencoded")
String requestCreate(@FormParam("token") String token,
@FormParam("venueId") int venueId,
@FormParam("beginDateTime") String beginDateTime,
@FormParam("firstName") String firstName,
@FormParam("lastName") String lastName,
@FormParam("email") String email,
@FormParam("phone") String phone,
@FormParam("malesCount") int malesCount,
@FormParam("femalesCount") int femalesCount,
@FormParam("budget") float budget,
@FormParam("note") String note) throws WebApplicationException;
@GET
@Path("status")
@Produces(MediaType.APPLICATION_JSON)
String requestStatus(@QueryParam("token") String token,
@QueryParam("id") int id) throws WebApplicationException;
@PUT
@Path("status")
@Produces(MediaType.APPLICATION_JSON)
@Consumes("application/x-www-form-urlencoded")
String requestStatus(@FormParam("token") String token,
@FormParam("id") int id,
@FormParam("status") String status
/**@status values: confirmed_by_user, cancelled_by_user*/
) throws WebApplicationException;
}
| [
"bogdanlupashko@gmail.com"
] | bogdanlupashko@gmail.com |
80627b6113468d2e863c76364a7dae5643e183cd | 2950e72afd4ac0bdc4887395ed81ca028e800e92 | /017search/src/search/Linear.java | 9061e251dd1844214a4bd58bf830f964d3b8f2c8 | [] | no_license | Synkronizing/Beginning-Java | 31f1fde17e86931e2a5bad59654d41665fb8edfb | f3d1e338f63ea964ccdb85df51233c2a608b06ba | refs/heads/master | 2023-03-24T02:10:06.763887 | 2020-01-21T17:48:05 | 2020-01-21T17:48:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,018 | java | package search;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Linear {
public static void main(String[] args) {
Scanner myObj = new Scanner(System.in);
ArrayList<ArrayList<String>> big_list=new ArrayList<ArrayList<String>>();
ArrayList<String> list = new ArrayList<String>();
String year;
String name;
System.out.println("Enter a year between 1880-2018");
year = myObj.nextLine();
System.out.println("Enter a name to find");
name = myObj.nextLine();
name= name.substring(0,1).toUpperCase()+name.substring(1).toLowerCase();
File file =
new File("/home/compsci/Documents/names/yob"+year+"sorted.txt");
Scanner sc = null;
try {
sc = new Scanner(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String given=" ";
String gender= "";
int amount=0;
int done = 0;
int read=0;
while(sc.hasNextLine()&&done<2) {
read++;
String line = sc.nextLine();
String[] words = line.split(",");
given = words[0];
gender = words[1];
if(given.equals(name)) {
int temp_amt=Integer.parseInt(words[2]);
amount=amount+temp_amt;
done++;
}
}
System.out.println("There was "+amount+" babies that were named "+ name+" in the year "+ year);
System.out.println("This took "+read +" comparisons");
try {
sc = new Scanner(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
while(sc.hasNextLine()) {
String line=sc.nextLine();
String[] words = line.split(",");
list = new ArrayList<String>(Arrays.asList(words));
big_list.add(list);
}
int big_total=0;
int low = 0;
int high = big_list.size() - 1;
int mid = (low + high) / 2;
boolean found = false;
int loops=0;
while (low <= high && found==false) {
loops++;
if(big_list.get(mid).get(0).equals(name)) {
found=true;
int amount2 = Integer.parseInt(big_list.get(mid).get(2));
String gender2 = big_list.get(mid).get(1);
big_total=big_total+amount2;
if(gender2.equals("F")) {
String temp_name = big_list.get(mid+1).get(0);
if(temp_name.equals(name)) {
amount2 = Integer.parseInt(big_list.get(mid+1).get(2));
big_total=big_total+amount2;
}
}
else if(gender2.equals("M")) {
String temp_name = big_list.get(mid-1).get(0);
if(temp_name.equals(name)) {
amount2 = Integer.parseInt(big_list.get(mid-1).get(2));
big_total=big_total+amount2;
}
}
}
else if (big_list.get(mid).get(0).compareTo(name) < 0) {
low = mid + 1;
} else {
high = mid - 1;
}
mid = (low + high) / 2;
}
System.out.println("There was "+big_total+" babies that were named "+ name+" in the year "+ year);
System.out.println("This took "+loops +" comparisons");
}
}
| [
"josh6050@gmail.com"
] | josh6050@gmail.com |
7a39946b9a05c37ae118d20100bc683c0c58dd61 | ebdcaff90c72bf9bb7871574b25602ec22e45c35 | /modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/FeedItemCampaignTarget.java | 543c73ffbaccf96dc68bf6d0fc4478a4f5f678bc | [
"Apache-2.0"
] | permissive | ColleenKeegan/googleads-java-lib | 3c25ea93740b3abceb52bb0534aff66388d8abd1 | 3d38daadf66e5d9c3db220559f099fd5c5b19e70 | refs/heads/master | 2023-04-06T16:16:51.690975 | 2018-11-15T20:50:26 | 2018-11-15T20:50:26 | 158,986,306 | 1 | 0 | Apache-2.0 | 2023-04-04T01:42:56 | 2018-11-25T00:56:39 | Java | UTF-8 | Java | false | false | 9,062 | 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
//
// 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.
/**
* FeedItemCampaignTarget.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.adwords.axis.v201809.cm;
/**
* Represents a feed item target for a campaign.
*/
public class FeedItemCampaignTarget extends com.google.api.ads.adwords.axis.v201809.cm.FeedItemTarget implements java.io.Serializable {
/* ID of the target campaign.
* <span class="constraint Selectable">This field
* can be selected using the value "CampaignId".</span><span class="constraint
* Filterable">This field can be filtered on.</span>
* <span class="constraint Required">This field is
* required and should not be {@code null}.</span> */
private java.lang.Long campaignId;
/* Name of the target campaign.
* <span class="constraint Selectable">This field
* can be selected using the value "CampaignName".</span><span class="constraint
* Filterable">This field can be filtered on.</span>
* <span class="constraint ReadOnly">This field is
* read only and will be ignored when sent to the API.</span> */
private java.lang.String campaignName;
public FeedItemCampaignTarget() {
}
public FeedItemCampaignTarget(
java.lang.Long feedId,
java.lang.Long feedItemId,
com.google.api.ads.adwords.axis.v201809.cm.FeedItemTargetType targetType,
com.google.api.ads.adwords.axis.v201809.cm.FeedItemTargetStatus status,
java.lang.String feedItemTargetType,
java.lang.Long campaignId,
java.lang.String campaignName) {
super(
feedId,
feedItemId,
targetType,
status,
feedItemTargetType);
this.campaignId = campaignId;
this.campaignName = campaignName;
}
@Override
public String toString() {
return com.google.common.base.MoreObjects.toStringHelper(this.getClass())
.omitNullValues()
.add("campaignId", getCampaignId())
.add("campaignName", getCampaignName())
.add("feedId", getFeedId())
.add("feedItemId", getFeedItemId())
.add("feedItemTargetType", getFeedItemTargetType())
.add("status", getStatus())
.add("targetType", getTargetType())
.toString();
}
/**
* Gets the campaignId value for this FeedItemCampaignTarget.
*
* @return campaignId * ID of the target campaign.
* <span class="constraint Selectable">This field
* can be selected using the value "CampaignId".</span><span class="constraint
* Filterable">This field can be filtered on.</span>
* <span class="constraint Required">This field is
* required and should not be {@code null}.</span>
*/
public java.lang.Long getCampaignId() {
return campaignId;
}
/**
* Sets the campaignId value for this FeedItemCampaignTarget.
*
* @param campaignId * ID of the target campaign.
* <span class="constraint Selectable">This field
* can be selected using the value "CampaignId".</span><span class="constraint
* Filterable">This field can be filtered on.</span>
* <span class="constraint Required">This field is
* required and should not be {@code null}.</span>
*/
public void setCampaignId(java.lang.Long campaignId) {
this.campaignId = campaignId;
}
/**
* Gets the campaignName value for this FeedItemCampaignTarget.
*
* @return campaignName * Name of the target campaign.
* <span class="constraint Selectable">This field
* can be selected using the value "CampaignName".</span><span class="constraint
* Filterable">This field can be filtered on.</span>
* <span class="constraint ReadOnly">This field is
* read only and will be ignored when sent to the API.</span>
*/
public java.lang.String getCampaignName() {
return campaignName;
}
/**
* Sets the campaignName value for this FeedItemCampaignTarget.
*
* @param campaignName * Name of the target campaign.
* <span class="constraint Selectable">This field
* can be selected using the value "CampaignName".</span><span class="constraint
* Filterable">This field can be filtered on.</span>
* <span class="constraint ReadOnly">This field is
* read only and will be ignored when sent to the API.</span>
*/
public void setCampaignName(java.lang.String campaignName) {
this.campaignName = campaignName;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof FeedItemCampaignTarget)) return false;
FeedItemCampaignTarget other = (FeedItemCampaignTarget) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj) &&
((this.campaignId==null && other.getCampaignId()==null) ||
(this.campaignId!=null &&
this.campaignId.equals(other.getCampaignId()))) &&
((this.campaignName==null && other.getCampaignName()==null) ||
(this.campaignName!=null &&
this.campaignName.equals(other.getCampaignName())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
if (getCampaignId() != null) {
_hashCode += getCampaignId().hashCode();
}
if (getCampaignName() != null) {
_hashCode += getCampaignName().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(FeedItemCampaignTarget.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201809", "FeedItemCampaignTarget"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("campaignId");
elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201809", "campaignId"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("campaignName");
elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201809", "campaignName"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| [
"jradcliff@users.noreply.github.com"
] | jradcliff@users.noreply.github.com |
2096d425ad8a28343596da71b405b80e0eb9ac17 | be16632b9c4bf9a4f72239779ba9510511b309db | /Current/Product/Production/Packages/FitNesse/Install/Product/FitNesse/Dev/fitnesse-plugins/src/com/targetprocess/integration/userstory/AssignUserAsActorResponse.java | 4b859518577b234c8b72e97d85348587bbb5bbf0 | [] | no_license | vardars/ci-factory | 7430c2afb577937fb598b5af3709990e674e7d05 | b83498949f48948d36dc488310cf280dbd98ecb7 | refs/heads/master | 2020-12-25T19:26:17.750522 | 2015-07-10T10:58:10 | 2015-07-10T10:58:10 | 38,868,165 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 803 | java |
package com.targetprocess.integration.userstory;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "AssignUserAsActorResponse")
public class AssignUserAsActorResponse {
}
| [
"cifactory@571f4c53-cd24-0410-92e9-33dde47f2f63"
] | cifactory@571f4c53-cd24-0410-92e9-33dde47f2f63 |
b58ed3ba15c6dccd67e39e6a10fbf9ea507834c9 | 3637342fa15a76e676dbfb90e824de331955edb5 | /bang-android/branches/MC-LWZ/feature_1.7_FAULT_CODE/src/com/tonggou/andclient/network/DefaultUpdateCheck.java | 0915acd0391b2e54c94ab887601004b572bf6d75 | [] | no_license | BAT6188/bo | 6147f20832263167101003bea45d33e221d0f534 | a1d1885aed8cf9522485fd7e1d961746becb99c9 | refs/heads/master | 2023-05-31T03:36:26.438083 | 2016-11-03T04:43:05 | 2016-11-03T04:43:05 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 6,677 | java | package com.tonggou.andclient.network;
import android.R.string;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnKeyListener;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.os.Message;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.TextView;
import android.widget.Toast;
import com.tonggou.andclient.CarErrorActivity;
import com.tonggou.andclient.OrderDetilActivity;
import com.tonggou.andclient.R;
import com.tonggou.andclient.SettingActivity;
import com.tonggou.andclient.app.TongGouApplication;
import com.tonggou.andclient.jsonresponse.UpgradeCheckResponse;
import com.tonggou.andclient.network.parser.AsyncJsonBaseResponseParseHandler;
import com.tonggou.andclient.network.request.UpdateCheekRequest;
/**
* 检查更新
* @author lwz
*
*/
public class DefaultUpdateCheck implements DialogInterface.OnClickListener {
private String downUrl;
private Handler handler;
/**
* 升级检测监听
* @author lwz
*
*/
public class OnUpdateCheckListener {
/**
* 有新版本
* @param isForceUpdate true:强制 ; false:提醒
* @param updateMesssage 升级提示信息
*/
// delete by fbl
/*public void onShouldUpdate(boolean isForceUpdate, String updateMesssage) {
showUpdateAlertDialog(isForceUpdate, updateMesssage);
}*/
/**
* 没有新版本
*/
public void onNothingToUpdate() {
}
/**
* 检测结束
*/
public void onFinish() {
}
}
private Activity mContext;
private AlertDialog mUpdateDialog,mforceDialog;
private UpgradeCheckResponse mResponse;
public DefaultUpdateCheck(Activity context) {
mContext = context;
}
/**
* 更新动作
* @param listener 不能为 null
*/
public void doCheckUpdate(final OnUpdateCheckListener listener) {
UpdateCheekRequest request = new UpdateCheekRequest();
request.doRequest(mContext, new AsyncJsonBaseResponseParseHandler<UpgradeCheckResponse>() {
@Override
public void onParseSuccess(UpgradeCheckResponse result, byte[] originResult) {
super.onParseSuccess(result, originResult);
mResponse = result;
String action = result.getAction();
TongGouApplication.showLog("升级信息-------"+result.getMessage());
TongGouApplication.showLog("提示升级形式-----"+action);
if( "normal".equals( action ) ) { //没有新版本
listener.onNothingToUpdate();
}else if("force".equals(action)){ //强制升级
showforceUpdateAlertDialog(result.getMessage());
}else { //提示升级
showUpdateAlertDialog(result.getMessage());
//listener.onShouldUpdate( "force".equals(action), result.getMessage() );
}
}
@Override
public void onParseFailure(String errorCode, String errorMsg) {
listener.onNothingToUpdate();
}
@Override
public void onFinish() {
super.onFinish();
listener.onFinish();
}
@Override
public Class<UpgradeCheckResponse> getTypeClass() {
return UpgradeCheckResponse.class;
}
});
}
/**
* * add fbl 2014.2.16
*
* **/
private void showforceUpdateAlertDialog(String msg){
final AlertDialog wrongAlert= new AlertDialog.Builder(mContext).create();
wrongAlert.show();
Window window = wrongAlert.getWindow();
window.setContentView(R.layout.force_update_dialog);
wrongAlert.setCancelable(false);
TextView remindtitle = (TextView)window.findViewById(R.id.alarm_title);
TextView remindcontent= (TextView)window.findViewById(R.id.content_text_alert);
remindcontent.setText(msg);
View retryOper = window.findViewById(R.id.connect_again); //升级
retryOper.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
doUPdate();
}
});
View cancelOper = window.findViewById(R.id.connect_cancel); //取消
cancelOper.setVisibility(View.GONE);
if( mContext != null && !mContext.isFinishing() ) {
mforceDialog.show();
} else {
mforceDialog = null;
}
}
private void showUpdateAlertDialog(String msg) {
final AlertDialog wrongAlert= new AlertDialog.Builder(mContext).create();
wrongAlert.show();
Window window = wrongAlert.getWindow();
window.setContentView(R.layout.force_update_dialog);
wrongAlert.setCancelable(false);
TextView remindtitle = (TextView)window.findViewById(R.id.alarm_title);
TextView remindcontent= (TextView)window.findViewById(R.id.content_text_alert);
remindcontent.setText(msg);
View retryOper = window.findViewById(R.id.connect_again); //升级
retryOper.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
doUPdate();
wrongAlert.cancel();
wrongAlert.dismiss();
}
});
View cancelOper = window.findViewById(R.id.connect_cancel); //取消
cancelOper.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
wrongAlert.cancel();
wrongAlert.dismiss();
}
});
if( mContext != null && !mContext.isFinishing() ) {
mforceDialog.show();
} else {
mforceDialog = null;
}
/*
dismissDoalog();
mUpdateDialog = new AlertDialog.Builder(mContext).create();
mUpdateDialog.setTitle(isForceUpdate ? "强制升级提示" : "升级提示");
mUpdateDialog.setButton(DialogInterface.BUTTON_POSITIVE, "是", this);
mUpdateDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "否", (Message)null);
mUpdateDialog.setMessage( msg );
if( mContext != null && !mContext.isFinishing() ) {
mUpdateDialog.show();
} else {
mUpdateDialog = null;
}
*/}
public void dismissDoalog() {
if( mUpdateDialog != null && mUpdateDialog.isShowing() ) {
mUpdateDialog.dismiss();
}
mUpdateDialog = null;
}
@Override
public void onClick(DialogInterface dialog, int which) {
if( which == DialogInterface.BUTTON_POSITIVE ) {
doUPdate();
}
}
//屏蔽返回键
OnKeyListener keylistener = new DialogInterface.OnKeyListener(){
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0)
{
return true;
}
else
{
return false;
}
}
} ;
private void doUPdate(){
downUrl = mResponse.getUrl(); //下载地址
if(downUrl==null||"".equals(downUrl)){
//url错误提示
TongGouApplication.showToast("升级出错了!");
}else{
Uri uri = Uri.parse(downUrl);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
if( !mContext.isFinishing() ) {
mContext.startActivity(intent);
}
}
}
}
| [
"ndong211@163.com"
] | ndong211@163.com |
906025d7515e9edb51daa106bef6e2c05e05844b | 573b9c497f644aeefd5c05def17315f497bd9536 | /src/main/java/com/alipay/api/domain/AlipayOpenMiniInnerbaseinfoPrecreateConfirmModel.java | 39adcc2ab6575467e8293448066610a01447e074 | [
"Apache-2.0"
] | permissive | zzzyw-work/alipay-sdk-java-all | 44d72874f95cd70ca42083b927a31a277694b672 | 294cc314cd40f5446a0f7f10acbb5e9740c9cce4 | refs/heads/master | 2022-04-15T21:17:33.204840 | 2020-04-14T12:17:20 | 2020-04-14T12:17:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 627 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 小程序预创建确认生成
*
* @author auto create
* @since 1.0, 2020-02-07 21:49:41
*/
public class AlipayOpenMiniInnerbaseinfoPrecreateConfirmModel extends AlipayObject {
private static final long serialVersionUID = 8321646642185854673L;
/**
* 小程序ID
*/
@ApiField("mini_app_id")
private String miniAppId;
public String getMiniAppId() {
return this.miniAppId;
}
public void setMiniAppId(String miniAppId) {
this.miniAppId = miniAppId;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
2ba60a86e595c8efdc426ccc92f6207aeca3914b | 4de66c464d0fd16801c099805f35a01f3c28be4d | /Cracking_codind_interview/linkedlist/2.2/2.2.java | c23f942a5586749e124b98855a4d8cba4d03b59d | [] | no_license | wlsgussla123/Algorithms | 9ec745dea4e45dbc21fff28119e923b3bedf0b5f | f7fe0c2509dcb852182dd1f8a673991362f6d174 | refs/heads/master | 2021-01-23T09:35:23.721109 | 2020-11-15T06:36:49 | 2020-11-15T06:36:49 | 102,583,416 | 6 | 2 | null | null | null | null | UTF-8 | Java | false | false | 842 | java | package algo;
public class main {
public static String pickFromReverse(LinkedListNode list, int k) {
ListNode checkNode = null;
String result = null;
int len = 0;
if(list.head == null) {
System.out.println("list empty");
} else {
checkNode = list.head;
while(checkNode.next != null) {
checkNode = checkNode.next;
len++;
}
ListNode temp = list.head;
for(int i=0; i<len - k; i++) {
temp = temp.next;
}
result = temp.data;
}
return result;
}
public static void main(String args[]) {
LinkedListNode head = new LinkedListNode();
head.insertLastNode("1");
head.insertLastNode("2");
head.insertLastNode("3");
head.insertLastNode("4");
head.insertLastNode("5");
head.insertLastNode("6");
String result = pickFromReverse(head, 5);
System.out.println(result);
}
}
| [
"wlsgussla123@gmail.com"
] | wlsgussla123@gmail.com |
9c2b84411737963509e24930ffd387d9825bef0b | 2cc97ea8be78b2202e5636e57941a75469679cde | /src/main/java/com/esdemo/frame/db/DataSourceContextHolder.java | c8fb9bb34ec0af98f147b714db29f923366572cd | [] | no_license | houmenghui/es-demo | 9fff9a92cfdb332b0ea74c5143dfce0adc17f2c2 | 6e2b1d4842d1da9267320d36a700311460aaac36 | refs/heads/master | 2022-11-14T04:07:55.132853 | 2020-07-14T03:57:51 | 2020-07-14T03:57:51 | 279,468,101 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,301 | java | package com.esdemo.frame.db;
import lombok.extern.slf4j.Slf4j;
import java.util.Deque;
import java.util.concurrent.LinkedBlockingDeque;
/**
* 切换读/写模式
* 利用ThreadLocal保存当前线程是否处于哪种模式
*/
@Slf4j
public class DataSourceContextHolder {
private DataSourceContextHolder(){}
private static final ThreadLocal<Deque<String>> local = new ThreadLocal<>();
public static ThreadLocal<Deque<String>> getLocal() {
return local;
}
public static void config(DataSourceType dataSourceType) {
Deque<String> queue = local.get();
if (queue == null) {
queue = new LinkedBlockingDeque<>();
local.set(queue);
}
queue.addLast(dataSourceType.getType());
log.info("切换到{}...", dataSourceType.getName());
}
//清除local中的值,用于数据源切换失败的问题
public static void clear() {
Deque<String> queue = local.get();
if (queue != null && !queue.isEmpty()) {
queue.removeLast();
if (queue.isEmpty()) {
local.set(null);
}
}
}
public static String getJdbcType() {
Deque<String> queue = local.get();
return queue != null ? queue.peekLast() : null;
}
} | [
"hmh@eeepay.cn"
] | hmh@eeepay.cn |
ec63c06d4557c202bc2583264f043e76d224156c | b6ca2917679b90c09a3c14ba8483908cdcec52a6 | /part06-Part06_13.Exercises/src/main/java/ExerciseManagement.java | 8d2fe9bbf23e56a2f93681ccbc56c181e461c40e | [] | no_license | njantinski/javaMooc | 1e910bdd643c5ce5c6d2133938b195d27bb8369a | d5448c2328dc18cfe21b3fa16d0fb191a52398c5 | refs/heads/master | 2023-03-25T00:05:34.174552 | 2021-03-23T14:17:45 | 2021-03-23T14:17:45 | 349,509,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,034 | java |
import java.util.ArrayList;
public class ExerciseManagement {
private ArrayList<Exercise> exercises;
public ExerciseManagement(){
this.exercises = new ArrayList<>();
}
public ArrayList<String> exerciseList(){
ArrayList<String> listToReturn = new ArrayList<>();
for(Exercise e : exercises){
listToReturn.add(e.getName());
}
return listToReturn;
}
public void add(String exercise){
this.exercises.add(new Exercise(exercise));
}
public void markAsCompleted(String completed) {
for(Exercise e : exercises){
if(e.getName().equals(completed)){
e.setCompleted(true);
break;
}
}
}
boolean isCompleted(String completed) {
Exercise e = exercises.stream().filter(a -> a.getName().equals(completed)).findFirst().orElse(null);
if(e == null){
return false;
}
return e.isCompleted();
}
}
| [
"njantinski@gmail.com"
] | njantinski@gmail.com |
3d0b8d26d77ce09db60a95af9881134c11f43a09 | b9463c8f67d68a9f852dfd2a55d850f2c7859491 | /src/main/java/com/hblog/service/book/BookTableServiceImpl.java | 7e14d2b58d00a4a2e574b9fb2d33e20a6a1c417d | [] | no_license | Horacehao/HBlog | 8de610dd3e7134796ed98322f46ba316cf10a65e | e6657b40e7130aa26955708ddc5c7bec104710ef | refs/heads/master | 2020-03-21T10:55:56.032787 | 2018-06-24T13:02:23 | 2018-06-24T13:02:24 | 138,479,066 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,250 | java | package com.hblog.service.book;
import com.google.common.collect.Lists;
import com.hblog.dao.BookTableMapper;
import com.hblog.domain.BookTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service(value = "bookTableService")
@Transactional
public class BookTableServiceImpl implements BookTableService{
@Autowired
private BookTableMapper bookTableMapper;
public List<BookTableVO> findList() {
List<BookTableVO> bookTableVOList = Lists.newArrayList();
List<BookTable> bookTableList = bookTableMapper.selectAll();
for(BookTable bookTable : bookTableList) {
BookTableVO bookTableVO = transToBookTableVO(bookTable);
bookTableVOList.add(bookTableVO);
}
return bookTableVOList;
}
private BookTableVO transToBookTableVO(BookTable bookTable) {
BookTableVO bookTableVO = new BookTableVO();
bookTableVO.setBookBanner(bookTable.getBookBanner());
bookTableVO.setBookName(bookTable.getBookName());
bookTableVO.setBookUrl(bookTable.getBookUrl());
return bookTableVO;
}
}
| [
"zhonghao.wang@ele.me"
] | zhonghao.wang@ele.me |
836b6243f99fdf7b151e3be42a1d6a1b44a1a2bc | 66c5cca91f8f3b3688d8c50ba2be0923574cf7c8 | /src/com/company/Main.java | 24f56ee9acf24e678c4ed5664537182d18e3a04f | [] | no_license | ltieshue/Week_1_Personal_Assessment | 15989baa52f312eaaf150b36f4ba04aaaa4c375f | a6d66aa87e3ecc3c4498773116e9262a793fd2de | refs/heads/master | 2021-09-05T11:27:26.977235 | 2018-01-26T22:42:30 | 2018-01-26T22:42:30 | 117,290,314 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,653 | java | package com.company;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// write your code here
//X 1-Hello! Please enter your name
//X 2-Enter your current age
//X 3- Enter the current calendar year
// 4-OUTPUT
// X -Name
// X - Age Next Year (2019 = 2018+1): In 2019, you will be YY years old.
// X - Age Next Year (2023 = 2018+5): In 2023, you will be YY years old.
// X - Age Next Year (2019 = 2018+10): In 2028, you will be YY years old.
Scanner sc = new Scanner(System.in);
System.out.println("Hello! Please enter your name.");
String yourName = sc.nextLine();
System.out.println("Enter your current age.");
String currentAge = sc.nextLine();
System.out.println("Enter the current calendar year.");
String currentYear = sc.nextLine();
int intAge= Integer.parseInt(currentAge);
int intYear = Integer.parseInt(currentYear);
int agePlusone = intAge + 1;
int agePlusfive = intAge + 5;
int agePlusten = intAge + 10;
int yearPlusone = intYear + 1;
int yearPlusfive = intYear + 5;
int yearPlusten = intYear + 10;
System.out.println(yourName + ", you are currently " + currentAge + " years old.");
System.out.println("In " + yearPlusone + ", you will be " + agePlusone + " years old.");
System.out.println("In " + yearPlusfive + ", you will be " + agePlusfive + " years old.");
System.out.println("In " + yearPlusten + ", you will be " + agePlusten + " years old.");
}
}
| [
"lori.tieshue@gmail.com"
] | lori.tieshue@gmail.com |
9098df209ea6f016e301f5f94c79deb030a870ce | dfb3f631ed8c18bd4605739f1ecb6e47d715a236 | /disconnect-classlib/src/main/java/js/web/dom/HTMLTableCaptionElement.java | d2222198d95c3f1141c51fb5e74458161c9f96be | [
"Apache-2.0"
] | permissive | fluorumlabs/disconnect-project | ceb788b901d1bf7cfc5ee676592f55f8a584a34e | 54f4ea5e6f05265ea985e1ee615cc3d59d5842b4 | refs/heads/master | 2022-12-26T11:26:46.539891 | 2020-08-20T16:37:19 | 2020-08-20T16:37:19 | 203,577,241 | 6 | 1 | Apache-2.0 | 2022-12-16T00:41:56 | 2019-08-21T12:14:42 | Java | UTF-8 | Java | false | false | 890 | java | package js.web.dom;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSProperty;
/**
* Special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating table caption elements.
*/
public interface HTMLTableCaptionElement extends HTMLElement {
@JSBody(script = "return HTMLTableCaptionElement.prototype")
static HTMLTableCaptionElement prototype() {
throw new UnsupportedOperationException("Available only in JavaScript");
}
@JSBody(script = "return new HTMLTableCaptionElement()")
static HTMLTableCaptionElement create() {
throw new UnsupportedOperationException("Available only in JavaScript");
}
/**
* Sets or retrieves the alignment of the caption or legend.
*/
@Deprecated
@JSProperty
String getAlign();
@JSProperty
void setAlign(String align);
}
| [
"fluorumlabs@users.noreply.github.com"
] | fluorumlabs@users.noreply.github.com |
689f550f1d94060394e7d3eede9e0ffccc0bc4a7 | 4bf624217a618de19614a4252da10088ac6c0464 | /app/src/test/java/ominext/android/vn/ominextalarmmanagerdemo/ExampleUnitTest.java | c53623531708f2d506adf155899b26eb39b3f939 | [] | no_license | congphuong1606/OminextAlarmManagerDemo | e2bacde7395817545078945bbdd50b61ad24fab7 | f45193fa4657ed2161f666682bd01e81cf87e41a | refs/heads/master | 2020-12-02T22:05:21.493846 | 2017-07-03T07:03:02 | 2017-07-03T07:03:02 | 96,079,772 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 420 | java | package ominext.android.vn.ominextalarmmanagerdemo;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"="
] | = |
8900789dd66d5ec3cf65436d76ce1def432b44ad | bae2b1f418576f6cede17be810a91aded0acc1d2 | /Chronic/src/be/ugent/service/MedicineService.java | c26b92255c282a2d6873f3613c3db5860892cf2e | [
"Apache-2.0"
] | permissive | GillesVandewiele/ChronicalRest | afc40d07fee1521ba4ccfd38f6fec62ba90cacce | b5f0fb333376686ad887eeb3808da696cf27c1f9 | refs/heads/master | 2021-01-13T05:37:24.139727 | 2016-08-03T20:14:38 | 2016-08-03T20:14:38 | 95,112,681 | 0 | 0 | null | 2017-06-22T12:21:27 | 2017-06-22T12:21:27 | null | UTF-8 | Java | false | false | 6,503 | java | package be.ugent.service;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import com.google.gson.Gson;
import be.ugent.Authentication;
import be.ugent.dao.MedicineDao;
import be.ugent.dao.PatientDao;
import be.ugent.entitity.Drug;
import be.ugent.entitity.Headache;
import be.ugent.entitity.Medicine;
import be.ugent.entitity.Patient;
@Path("/MedicineService")
public class MedicineService {
MedicineDao medicineDao = new MedicineDao();
PatientDao patientDao = new PatientDao();
Gson gson = new Gson();
@GET
@Path("/medicines")
@Produces({ MediaType.APPLICATION_JSON })
public Response getAllMedicines( @QueryParam("patientID") String patientID,@HeaderParam("Authorization") String header){
if(!Authentication.isAuthorized(header)){
return Response.status(403).build();
}
System.out.println("Alle hoofdpijnen opgevraagd van patient met id:"+patientID);
return Response.ok(medicineDao.getAllMedicinesForPatient(Integer.parseInt(patientID))).build();
}
@POST
@Path("/medicines")
@Consumes({MediaType.APPLICATION_JSON})
public Response addMedicine(String medicine, @HeaderParam("Authorization") String header, @QueryParam("patientID") String patientID) {
// System.out.println("header:"+header);
if(!Authentication.isAuthorized(header)){
return Response.status(403).build();
}
if(medicine == null || patientID==null || patientID.isEmpty()){
return Response.status(422).build();
}
JSONObject medicineJSON = null;
try {
medicineJSON = new JSONObject(medicine);
} catch (JSONException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Medicine test = gson.fromJson(medicine, Medicine.class);
if(test.getMedicineID()>0){
//Medicine is posted to update
Medicine toAdd = test;
toAdd.setPatientID(Integer.parseInt(patientID));
if(medicineDao.updateMedicine(patientID, toAdd)){
//return medicine successfully created
try {
return Response.status(202).entity(medicineDao.getMedicine(toAdd.getMedicineID(), Authentication.getPatientID(header))).build();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return Response.status(500).build();
}
}else{
// return record was already in database, or was wrong format
return Response.status(409).build();
}
}else{
System.out.println("object:"+medicineJSON);
Medicine toAdd = new Medicine();
try {
toAdd.setDate(medicineJSON.getString("date"));
toAdd.setDrugID(medicineJSON.getInt("drugID"));
toAdd.setQuantity(medicineJSON.getInt("quantity"));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("Got request to add medicine: "+toAdd);
toAdd.setMedicineID(medicineDao.getNewMedicineID());
// System.out.println("Created medicine: "+JSON.parse(toAdd.toJSON().toString()));
//TODO return object with correct ID (now id will not be updated in the return object
toAdd.setPatientID(Integer.parseInt(patientID));
if(medicineDao.addMedicine(toAdd)){
//return medicine successfully created
try {
return Response.status(201).entity(medicineDao.getMedicine(medicineJSON.get("date")+"")).build();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return Response.status(500).build();
}
}else{
// return record was already in database, or was wrong format
return Response.status(409).build();
}
}
}
@POST
@Path("/medicines/update")
@Consumes({MediaType.APPLICATION_JSON})
public Response changeMedicine(Medicine medicine,@HeaderParam("Authorization") String header){
// if(!Authentication.isAuthorized(header)){
// return Response.status(403).build();
// }
Medicine toAdd = medicine;
if(toAdd == null){
return Response.status(422).build();
}
System.out.println("Got request to add medicine: "+gson.toJson(medicine));
//if it's a medicine that is not yet submitted to the database
if(medicine.getMedicineID()==-1){
int id = medicineDao.getNewMedicineID();
medicine.setMedicineID(id);
if(medicineDao.addMedicine(medicine)){
return Response.status(201).entity(medicineDao.getMedicine(toAdd.getMedicineID(),toAdd.getPatientID())).build();
}else{
//medicine given is already in database, but with wrong medicineID
return Response.status(409).build();
}
}
System.out.println("Changing medicine: "+gson.toJson(toAdd));
if(medicineDao.changeMedicine(toAdd)){
//return medicine successfully created
return Response.status(202).entity(medicineDao.getMedicine(toAdd.getMedicineID(),toAdd.getPatientID())).build();
}else{
//return record was already in database, or was wrong format
return Response.status(409).build();
}
}
@DELETE
@Path("/medicines/delete")
@Consumes({MediaType.APPLICATION_JSON})
public Response deleteMedicine(@QueryParam("medicineID") String medicineID, @HeaderParam("Authorization") String header){
if(!Authentication.isAuthorized(header)){
return Response.status(403).build();
}
Medicine toAdd = medicineDao.getMedicine(Integer.parseInt(medicineID), Authentication.getPatientID(header));
if(toAdd == null){
System.out.println("toAdd is null, daarom 404");
return Response.status(404).build();
}
if(Authentication.getPatientID(header) != toAdd.getPatientID()){
return Response.status(403).build();
}
if(toAdd == null){
return Response.status(422).build();
}
System.out.println("Got request to delete medicine: "+gson.toJson(toAdd));
//if it's a medicine that is not yet submitted to the database
if(toAdd.getMedicineID()<0){
//medicine given is already in database, but with wrong medicineID
return Response.status(404).build();
}
if(medicineDao.deleteMedicine(toAdd)){
//return medicine successfully deleted
return Response.status(200).build();
}else{
//return record was already in database, or was wrong format
return Response.status(404).build();
}
}
}
| [
"kiani_lannoye@hotmail.com"
] | kiani_lannoye@hotmail.com |
14ca5dfe593f92bd717a225a52197ff706c16995 | d60e287543a95a20350c2caeabafbec517cabe75 | /LACCPlus/Hive/185_1.java | bc82134b5913e21f31895e29085421378c829735 | [
"MIT"
] | permissive | sgholamian/log-aware-clone-detection | 242067df2db6fd056f8d917cfbc143615c558b2c | 9993cb081c420413c231d1807bfff342c39aa69a | refs/heads/main | 2023-07-20T09:32:19.757643 | 2021-08-27T15:02:50 | 2021-08-27T15:02:50 | 337,837,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 694 | java | //,temp,ThriftHiveMetastore.java,25962,25973,temp,TCLIService.java,2325,2337
//,3
public class xxx {
public void onComplete(Void o) {
setMetaConf_result result = new setMetaConf_result();
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
}; | [
"SHOSHIN\\sgholamian@shoshin.uwaterloo.ca"
] | SHOSHIN\sgholamian@shoshin.uwaterloo.ca |
0ed938cea558fa3173fdc2f4745f9f6bf78d7d62 | 946e0d42b65562e4b792ec403e30b2899fc9312f | /src/stepDefinations/SnapdealLogin.java | 367b0914e03857ff68885c337521696b14899030 | [] | no_license | balakrishnadasari/CucumberProject_1 | 50b90a7d7a06002639fdf0597035c6f50b441c44 | d3544aca72a988a198f8458523844bb6dd0649c8 | refs/heads/master | 2021-04-15T04:32:51.770959 | 2018-03-24T20:21:16 | 2018-03-24T20:21:16 | 126,613,910 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,268 | java | package stepDefinations;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class SnapdealLogin {
WebDriver driver;
@Given("^open firefox and start application$")
public void open_firefox_and_start_application() throws Throwable {
driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get("https://www.snapdeal.com");
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@When("^I enter valid username and password$")
public void I_enter_valid_username_and_password() throws Throwable {
driver.findElement(By.id("email")).sendKeys("balakrishna33k@gmail.com");
driver.findElement(By.id("pass")).sendKeys("");
driver.findElement(By.xpath("//*[@id='loginbutton']/input")).click();
//driver.findElement(By.xpath("//div[@id='userNavigationLabel']"));
//driver.findElement(By.xpath("//div[@id='js_65']/div/div/ul/li[12]/a/span/span")).click();
}
@Then("^user should be able to login successfully$")
public void user_should_be_able_to_login_successfully() throws Throwable {
}
}
| [
"balakrishna.gd@gmail.com"
] | balakrishna.gd@gmail.com |
a3a12cd55eb755d909484cd672e5968d00052b9c | 385c6480efe77d3727edad3b98d909d6f1145bfb | /diving-parent/diving-dao/src/main/java/com/liaoin/diving/dao/ActivityRepository.java | a09f0038bd0b9a3d22cce8a68bf28f63ea293662 | [] | no_license | baojize/liaoin-diving | cda1180d275d2bf39d6fbb1a2ba29341c0158675 | 911a3204a73e8d3919b40a3edf22ef6718282982 | refs/heads/master | 2020-03-26T11:05:37.631704 | 2018-08-03T01:05:53 | 2018-08-03T01:05:53 | 144,827,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,086 | java | package com.liaoin.diving.dao;
import com.liaoin.diving.entity.Activity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
public interface ActivityRepository extends JpaRepository<Activity, Integer>, JpaSpecificationExecutor<Activity> {
List<Activity> findByNameLike(String name);
@Query(value = "update t_activity set is_broadcase = 1 where id = ?1", nativeQuery = true)
@Modifying
void setBroadcast(Integer id);
@Query(value = "select * from t_activity where is_recommend = 1 and is_delete = 0 order by activity_time", nativeQuery = true)
List<Activity> findRecommend();
List<Activity> findByActivityCategory(Integer id);
/*List<Activity> findByNameLike(String name);*/
/* @Query(value = "update t_activity set is_broadcase = 1 where id = ?1", nativeQuery = true)
@Modifying
void setBroadcast(Integer id);*/
} | [
"965471570@qq.com"
] | 965471570@qq.com |
8092199f9324578832716773ae878da2e258cd8f | 52d41f19c7c94127edf4e95bc2376a8e06c711b1 | /bridge-spring-webmvc4/src/main/java/io/cettia/asity/bridge/spring/webmvc4/AsityWebSocketHandler.java | 85c5d022484fbe183f8231bf8016e58ed15d87f2 | [
"Apache-2.0"
] | permissive | cettia/asity | 438f43463ccb4c4f02dc4a752485986512c103fa | 53fe447aa870d4b167dbf55d0431853680bffa21 | refs/heads/master | 2023-03-08T22:07:14.276771 | 2021-04-18T15:57:27 | 2021-04-18T15:57:27 | 32,444,134 | 30 | 0 | Apache-2.0 | 2020-10-13T04:46:09 | 2015-03-18T07:26:13 | Java | UTF-8 | Java | false | false | 3,174 | java | /*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.cettia.asity.bridge.spring.webmvc4;
import io.cettia.asity.action.Action;
import io.cettia.asity.action.Actions;
import io.cettia.asity.action.ConcurrentActions;
import io.cettia.asity.websocket.ServerWebSocket;
import org.springframework.web.socket.BinaryMessage;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.AbstractWebSocketHandler;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* WebSocketHandler to provide {@link SpringWebMvcServerWebSocket}.
* <p/>
* <pre>
*{@literal @}Bean
* public AsityWebSocketHandler webSocketHandler() {
* return new AsityWebSocketHandler().onwebsocket(ws -> {});
* }
*
*{@literal @}Override // A contract from WebSocketConfigurer
* public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
* registry.addHandler(webSocketHandler(), "/cettia");
* }
* </pre>
*
* @author Donghwan Kim
*/
public class AsityWebSocketHandler extends AbstractWebSocketHandler {
private Actions<ServerWebSocket> wsActions = new ConcurrentActions<>();
private Map<String, SpringWebMvcServerWebSocket> sessions = new ConcurrentHashMap<>();
@Override
public void afterConnectionEstablished(WebSocketSession session) {
SpringWebMvcServerWebSocket ws = new SpringWebMvcServerWebSocket(session);
sessions.put(session.getId(), ws);
wsActions.fire(ws);
}
@Override
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) {
SpringWebMvcServerWebSocket ws = sessions.remove(session.getId());
ws.onClose();
}
@Override
public void handleTransportError(WebSocketSession session, Throwable exception) {
SpringWebMvcServerWebSocket ws = sessions.get(session.getId());
ws.onError(exception);
}
@Override
protected void handleTextMessage(WebSocketSession session, TextMessage message) {
SpringWebMvcServerWebSocket ws = sessions.get(session.getId());
ws.onTextMessage(message.getPayload());
}
@Override
protected void handleBinaryMessage(WebSocketSession session, BinaryMessage message) {
SpringWebMvcServerWebSocket ws = sessions.get(session.getId());
ws.onBinaryMessage(message.getPayload());
}
/**
* Registers an action to be called when {@link ServerWebSocket} is available.
*/
public AsityWebSocketHandler onwebsocket(Action<ServerWebSocket> action) {
wsActions.add(action);
return this;
}
}
| [
"flowersinthesand@gmail.com"
] | flowersinthesand@gmail.com |
2f67f65d3a9fe3e7ac6f87411ac53f111cab5b95 | 62c585b10abc035f7bea8d1c05a8d06b6204be0b | /app/src/main/java/com/example/sharadjha/slimshady/CandidateProfile.java | 2bd532521b4e3d0c54cd3c6e2713bf31ad9456d5 | [] | no_license | SharadJha18/Lets-Vote | 92100b350865ec0f57e020201bf35a1c764f2201 | bd45f10e713cb8486ee6f9f55f7d4759ef1809d2 | refs/heads/master | 2021-01-20T02:22:41.089455 | 2017-04-25T19:39:31 | 2017-04-25T19:39:31 | 89,399,384 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,632 | java | package com.example.sharadjha.slimshady;
import android.content.Intent;
import android.database.SQLException;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.example.sharadjha.slimshady.Data.CandidateData;
import com.example.sharadjha.slimshady.Data.CandidateDatabaseHelper;
public class CandidateProfile extends AppCompatActivity {
private TextView tvAddress;
private TextView tvName;
private TextView tvVoterId;
private TextView tvDob;
private TextView tvMobile;
private Button bEditProfile;
private String username;
private TextView tvGender;
private Button bViewResult;
private TextView tvNoOfVotes;
private TextView tvUsername;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_candidate_profile);
init();
if (getIntent().getBooleanExtra("buttonDisabled", false)) {
bViewResult.setVisibility(View.GONE);
bEditProfile.setVisibility(View.GONE);
}
username = getIntent().getStringExtra("username");
CandidateDatabaseHelper db = new CandidateDatabaseHelper(getBaseContext());
CandidateData candidateData = new CandidateData();
try {
db.open();
candidateData = db.getData(username);
db.close();
} catch (SQLException e) {
Snackbar.make(getCurrentFocus(), e.getMessage(),
Snackbar.LENGTH_LONG).show();
}
tvAddress.setText(candidateData.getAddress());
tvName.setText(candidateData.getName());
tvVoterId.setText(candidateData.getVoterId());
tvDob.setText(candidateData.getDob());
tvMobile.setText(candidateData.getMobile());
tvGender.setText(candidateData.getGender());
tvUsername.setText(candidateData.getUsername());
tvNoOfVotes.setText("" + candidateData.getNoOfVotes());
Log.e("#Votes", "" + candidateData.getNoOfVotes());
getSupportActionBar().setTitle(candidateData.getName());
// Setting OnClickListener
bEditProfile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getBaseContext(), CandidateRegistration.class);
intent.putExtra("isEditing", true);
intent.putExtra("username", username);
startActivity(intent);
}
});
bViewResult.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getBaseContext(), Result.class);
startActivity(intent);
}
});
}
private void init() {
bEditProfile = (Button) findViewById(R.id.bEditProfile);
bViewResult = (Button) findViewById(R.id.bViewResult);
tvName = (TextView) findViewById(R.id.tvName);
tvVoterId = (TextView) findViewById(R.id.tvVoterId);
tvDob = (TextView) findViewById(R.id.tvDob);
tvMobile = (TextView) findViewById(R.id.tvMobile);
tvAddress = (TextView) findViewById(R.id.tvAddress);
tvGender = (TextView) findViewById(R.id.tvGender);
tvUsername = (TextView) findViewById(R.id.tvUsername);
tvNoOfVotes = (TextView) findViewById(R.id.tvNoOfVotes);
}
}
| [
"sharad304@gmail.com"
] | sharad304@gmail.com |
78bd3156981fb054650e0853fa5b085a93ab44a5 | 90ee028f66d9563fbf98f6c916f25629a226581e | /open-ig-0.89/src/hu/openig/editors/MapRenderer.java | 08d86fd593f24a409f200cac63bb76e7a2981460 | [] | no_license | chrsmithdemos/open-ig | 81c47572b6abfbd985e767aafba546b81eea75ae | dc66330c6c9bb129f3d62e9cff2e7fbe9abf0d0b | refs/heads/master | 2021-01-13T02:16:25.517213 | 2014-12-18T14:07:00 | 2014-12-18T14:07:00 | 31,559,799 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,671 | java | /*
* Copyright 2008-2011, David Karnok
* The file is part of the Open Imperium Galactica project.
*
* The code should be distributed under the LGPL license.
* See http://www.gnu.org/licenses/lgpl.html for details.
*/
package hu.openig.editors;
import hu.openig.core.Act;
import hu.openig.core.Labels;
import hu.openig.core.Location;
import hu.openig.core.Tile;
import hu.openig.gfx.ColonyGFX;
import hu.openig.model.Building;
import hu.openig.model.PlanetSurface;
import hu.openig.model.SurfaceEntity;
import hu.openig.model.SurfaceEntityType;
import hu.openig.render.TextRenderer;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
/** The map renderer. */
public class MapRenderer extends JComponent {
/** */
private static final long serialVersionUID = 5058274675379681602L;
/** The planet surface definition. */
PlanetSurface surface;
/** The offset X. */
int offsetX;
/** The offset Y. */
int offsetY;
/** The current location based on the mouse pointer. */
Location current;
/** The labels. */
Labels labels;
/**
* The selected rectangular region. The X coordinate is the smallest, the Y coordinate is the largest
* the width points to +X and height points to -Y direction
*/
Rectangle selectedRectangle;
/** Show the buildings? */
boolean showBuildings = true;
/** The selection tile. */
Tile selection;
/** The placement tile for allowed area. */
Tile areaAccept;
/** The empty tile indicator. */
Tile areaEmpty;
/** The placement tile for denied area. */
Tile areaDeny;
/** The current cell tile. */
Tile areaCurrent;
/** The last rendering timestamp. */
long t = System.nanoTime();
/** The current scaling factor. */
double scale = 1;
/** Used to place buildings on the surface. */
final Rectangle placementRectangle = new Rectangle();
/** The building bounding box. */
Rectangle buildingBox;
/** Are we in placement mode? */
boolean placementMode;
/** Render the buildings as symbolic cells. */
boolean minimapMode;
/** The text renderer. */
TextRenderer txt;
/** The colony graphics. */
ColonyGFX colonyGFX;
/** The simple blinking state. */
boolean blink;
/** The animation index. */
int animation;
/** The animation timer. */
Timer animationTimer;
/** Enable the drawing of black boxes behind building names and percentages. */
boolean textBackgrounds = true;
/** Render placement hints on the surface. */
boolean placementHints;
/** The current alpha level. */
float alpha = 1.0f;
/** The surface cell image. */
static class SurfaceCell {
/** The tile target. */
public int a;
/** The tile target. */
public int b;
/** The image to render. */
public BufferedImage image;
/** The Y coordinate compensation. */
public int yCompensation;
}
/** The surface cell helper. */
final SurfaceCell cell = new SurfaceCell();
/** Right click-drag. */
final MouseAdapter ma = new MouseAdapter() {
int lastX;
int lastY;
boolean drag;
@Override
public void mousePressed(MouseEvent e) {
if (SwingUtilities.isRightMouseButton(e)) {
drag = true;
lastX = e.getX();
lastY = e.getY();
} else
if (SwingUtilities.isMiddleMouseButton(e)) {
offsetX = 0;
offsetY = 0;
if (e.isControlDown()) {
scale = 1;
}
repaint();
}
}
@Override
public void mouseReleased(MouseEvent e) {
if (SwingUtilities.isRightMouseButton(e)) {
drag = false;
}
}
@Override
public void mouseDragged(MouseEvent e) {
if (drag) {
offsetX += e.getX() - lastX;
offsetY += e.getY() - lastY;
lastX = e.getX();
lastY = e.getY();
repaint();
}
}
@Override
public void mouseMoved(MouseEvent e) {
current = getLocationAt(e.getX(), e.getY());
if (current != null) {
placementRectangle.x = current.x - placementRectangle.width / 2;
placementRectangle.y = current.y + placementRectangle.height / 2;
repaint();
}
}
@Override
public void mouseEntered(MouseEvent e) {
if (!isFocusOwner()) {
requestFocusInWindow();
}
};
};
/** Selection handler. */
final MouseAdapter sma = new MouseAdapter() {
boolean sel;
Location orig;
@Override
public void mousePressed(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e) && surface != null) {
sel = true;
selectedRectangle = new Rectangle();
orig = getLocationAt(e.getX(), e.getY());
selectedRectangle.x = orig.x;
selectedRectangle.y = orig.y;
selectedRectangle.width = 1;
selectedRectangle.height = 1;
repaint();
}
}
@Override
public void mouseReleased(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e)) {
sel = false;
}
}
@Override
public void mouseDragged(MouseEvent e) {
if (sel) {
Location loc = getLocationAt(e.getX(), e.getY());
current = loc;
placementRectangle.x = current.x - placementRectangle.width / 2;
placementRectangle.y = current.y + placementRectangle.height / 2;
selectedRectangle.x = Math.min(orig.x, loc.x);
selectedRectangle.y = Math.max(orig.y, loc.y);
selectedRectangle.width = Math.max(orig.x, loc.x) - selectedRectangle.x + 1;
selectedRectangle.height = - Math.min(orig.y, loc.y) + selectedRectangle.y + 1;
repaint();
}
}
};
/** Preset. */
public MapRenderer() {
setOpaque(true);
addMouseListener(ma);
addMouseMotionListener(ma);
addMouseListener(sma);
addMouseMotionListener(sma);
animationTimer = new Timer(100, new Act() {
@Override
public void act() {
//wrap animation index
if (animation == Integer.MAX_VALUE) {
animation = -1;
}
animation++;
if (surface != null && surface.buildings.size() > 0) {
boolean blink0 = blink;
blink = (animation % 10) >= 5;
if (blink0 != blink || (animation % 3 == 0)) {
repaint();
}
}
}
});
animationTimer.start();
}
@Override
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g2.setColor(new Color(96, 96, 96));
g2.fillRect(0, 0, getWidth(), getHeight());
if (surface == null) {
return;
}
AffineTransform at = g2.getTransform();
g2.translate(offsetX, offsetY);
g2.scale(scale, scale);
int x0 = surface.baseXOffset;
int y0 = surface.baseYOffset;
Rectangle br = surface.boundingRectangle;
g2.setColor(new Color(128, 0, 0));
g2.fillRect(br.x, br.y, br.width, br.height);
g2.setColor(Color.YELLOW);
g2.drawRect(br.x, br.y, br.width, br.height);
BufferedImage empty = areaEmpty.getStrip(0);
Rectangle renderingWindow = new Rectangle(0, 0, getWidth(), getHeight());
for (int i = 0; i < surface.renderingOrigins.size(); i++) {
Location loc = surface.renderingOrigins.get(i);
for (int j = 0; j < surface.renderingLength.get(i); j++) {
int x = x0 + Tile.toScreenX(loc.x - j, loc.y);
int y = y0 + Tile.toScreenY(loc.x - j, loc.y);
Location loc1 = Location.of(loc.x - j, loc.y);
SurfaceEntity se = surface.buildingmap.get(loc1);
if (se == null || !showBuildings) {
se = surface.basemap.get(loc1);
}
if (se != null) {
getImage(se, minimapMode, loc1, cell);
int yref = y0 + Tile.toScreenY(cell.a, cell.b) + cell.yCompensation;
if (renderingWindow.intersects(x * scale + offsetX, yref * scale + offsetY, 57 * scale, se.tile.imageHeight * scale)) {
if (cell.image != null) {
g2.drawImage(cell.image, x, yref, null);
}
}
} else {
if (renderingWindow.intersects(x * scale + offsetX, y * scale + offsetY, 57 * scale, 27 * scale)) {
g2.drawImage(empty, x, y, null);
}
}
}
}
if (placementHints) {
for (Location loc : surface.basemap.keySet()) {
if (!canPlaceBuilding(loc.x, loc.y)) {
int x = x0 + Tile.toScreenX(loc.x, loc.y);
int y = y0 + Tile.toScreenY(loc.x, loc.y);
g2.drawImage(areaDeny.getStrip(0), x, y, null);
}
}
}
if (!placementMode) {
if (selectedRectangle != null) {
for (int i = selectedRectangle.x; i < selectedRectangle.x + selectedRectangle.width; i++) {
for (int j = selectedRectangle.y; j > selectedRectangle.y - selectedRectangle.height; j--) {
int x = x0 + Tile.toScreenX(i, j);
int y = y0 + Tile.toScreenY(i, j);
g2.drawImage(selection.getStrip(0), x, y, null);
}
}
}
if (current != null) {
int x = x0 + Tile.toScreenX(current.x, current.y);
int y = y0 + Tile.toScreenY(current.x, current.y);
g2.drawImage(areaCurrent.getStrip(0), x, y, null);
}
} else
if (placementRectangle.width > 0) {
for (int i = placementRectangle.x; i < placementRectangle.x + placementRectangle.width; i++) {
for (int j = placementRectangle.y; j > placementRectangle.y - placementRectangle.height; j--) {
BufferedImage img = areaAccept.getStrip(0);
// check for existing building
if (!canPlaceBuilding(i, j)) {
img = areaDeny.getStrip(0);
}
int x = x0 + Tile.toScreenX(i, j);
int y = y0 + Tile.toScreenY(i, j);
g2.drawImage(img, x, y, null);
}
}
}
g2.setColor(Color.RED);
if (showBuildings) {
if (buildingBox != null) {
g2.drawRect(buildingBox.x, buildingBox.y, buildingBox.width, buildingBox.height);
}
for (Building b : surface.buildings) {
Rectangle r = getBoundingRect(b.location);
// if (r == null) {
// continue;
// }
int nameLen = txt.getTextWidth(7, b.type.name);
int h = (r.height - 7) / 2;
int nx = r.x + (r.width - nameLen) / 2;
int ny = r.y + h;
Composite compositeSave = null;
Composite a1 = null;
if (textBackgrounds) {
compositeSave = g2.getComposite();
a1 = AlphaComposite.SrcOver.derive(0.8f);
g2.setComposite(a1);
g2.setColor(Color.BLACK);
g2.fillRect(nx - 2, ny - 2, nameLen + 4, 12);
g2.setComposite(compositeSave);
}
txt.paintTo(g2, nx + 1, ny + 1, 7, 0xFF8080FF, b.type.name);
txt.paintTo(g2, nx, ny, 7, 0xD4FC84, b.type.name);
// paint upgrade level indicator
int uw = b.upgradeLevel * colonyGFX.upgrade.getWidth();
int ux = r.x + (r.width - uw) / 2;
int uy = r.y + h - colonyGFX.upgrade.getHeight() - 4;
String percent = null;
int color = 0xFF8080FF;
if (b.isConstructing()) {
percent = (b.buildProgress * 100 / b.type.hitpoints) + "%";
} else
if (b.hitpoints < b.type.hitpoints) {
percent = ((b.type.hitpoints - b.hitpoints) * 100 / b.type.hitpoints) + "%";
if (!blink) {
color = 0xFFFF0000;
}
}
if (percent != null) {
int pw = txt.getTextWidth(10, percent);
int px = r.x + (r.width - pw) / 2;
int py = uy - 14;
if (textBackgrounds) {
g2.setComposite(a1);
g2.setColor(Color.BLACK);
g2.fillRect(px - 2, py - 2, pw + 4, 15);
g2.setComposite(compositeSave);
}
txt.paintTo(g2, px + 1, py + 1, 10, color, percent);
txt.paintTo(g2, px, py, 10, 0xD4FC84, percent);
}
for (int i = 1; i <= b.upgradeLevel; i++) {
g2.drawImage(colonyGFX.upgrade, ux, uy, null);
ux += colonyGFX.upgrade.getWidth();
}
if (b.enabled) {
int ey = r.y + h + 11;
int w = 0;
if (b.isEnergyShortage()) {
w += colonyGFX.unpowered[0].getWidth();
}
if (b.isWorkerShortage()) {
w += colonyGFX.worker[0].getWidth();
}
if (b.repairing) {
w += colonyGFX.repair[0].getWidth();
}
int ex = r.x + (r.width - w) / 2;
// paint power shortage
if (b.isEnergyShortage()) {
g2.drawImage(colonyGFX.unpowered[blink ? 0 : 1], ex, ey, null);
ex += colonyGFX.unpowered[0].getWidth();
}
if (b.isWorkerShortage()) {
g2.drawImage(colonyGFX.worker[blink ? 0 : 1], ex, ey, null);
ex += colonyGFX.worker[0].getWidth();
}
if (b.repairing) {
g2.drawImage(colonyGFX.repair[(animation / 3) % 3], ex, ey, null);
ex += colonyGFX.repair[0].getWidth();
}
} else {
int ey = r.y + h + 13;
String offline = labels.get("buildings.offline");
int w = txt.getTextWidth(10, offline);
color = 0xFF8080FF;
if (!blink) {
color = 0xFF000000;
}
int ex = r.x + (r.width - w) / 2;
if (textBackgrounds) {
g2.setComposite(a1);
g2.setColor(Color.BLACK);
g2.fillRect(ex - 2, ey - 2, w + 4, 15);
g2.setComposite(compositeSave);
}
txt.paintTo(g2, ex + 1, ey + 1, 10, color, offline);
txt.paintTo(g2, ex, ey, 10, 0xD4FC84, offline);
}
}
}
long t1 = System.nanoTime();
long dt = t1 - t;
t = t1;
g2.setTransform(at);
g2.setColor(Color.WHITE);
g2.drawString(String.format("%.3f", dt / 1E9) , getWidth() - 100, 15);
}
/**
* Return the image (strip) representing this surface entry.
* The default behavior returns the tile strips along its lower 'V' arc.
* This method to be overridden to handle the case of damaged or in-progress buildings
* @param se the surface entity
* @param symbolic display a symbolic tile instead of the actual building image.
* @param loc1 the the target cell location
* @param cell the output for the image and the Y coordinate compensation
*/
public void getImage(SurfaceEntity se, boolean symbolic, Location loc1, SurfaceCell cell) {
if (se.type != SurfaceEntityType.BUILDING) {
cell.yCompensation = 27 - se.tile.imageHeight;
cell.a = loc1.x - se.virtualColumn;
cell.b = loc1.y + se.virtualRow - se.tile.height + 1;
if (se.virtualColumn == 0 && se.virtualRow < se.tile.height) {
se.tile.alpha = alpha;
cell.image = se.tile.getStrip(se.virtualRow);
return;
} else
if (se.virtualRow == se.tile.height - 1) {
se.tile.alpha = alpha;
cell.image = se.tile.getStrip(se.tile.height - 1 + se.virtualColumn);
return;
}
cell.image = null;
return;
}
if (symbolic) {
Tile tile = null;
if (se.building.isConstructing()) {
if (se.building.isSeverlyDamaged()) {
tile = se.building.type.minimapTiles.constructingDamaged;
} else {
tile = se.building.type.minimapTiles.constructing;
}
} else {
if (se.building.isDestroyed()) {
tile = se.building.type.minimapTiles.destroyed;
} else
if (se.building.isSeverlyDamaged()) {
tile = se.building.type.minimapTiles.damaged;
} else
if (se.building.getEfficiency() < 0.5f) {
tile = se.building.type.minimapTiles.inoperable;
} else {
tile = se.building.type.minimapTiles.normal;
}
}
cell.yCompensation = 27 - tile.imageHeight;
cell.image = tile.getStrip(0);
cell.a = loc1.x;
cell.b = loc1.y;
return;
}
if (se.building.isConstructing()) {
Tile tile = null;
if (se.building.isSeverlyDamaged()) {
int constructIndex = se.building.buildProgress * se.building.scaffolding.damaged.size() / se.building.type.hitpoints;
tile = se.building.scaffolding.damaged.get(constructIndex);
} else {
int constructIndex = se.building.buildProgress * se.building.scaffolding.normal.size() / se.building.type.hitpoints;
tile = se.building.scaffolding.normal.get(constructIndex);
}
cell.yCompensation = 27 - tile.imageHeight;
tile.alpha = alpha;
cell.image = tile.getStrip(0);
cell.a = loc1.x;
cell.b = loc1.y;
} else {
Tile tile = null;
if (se.building.isSeverlyDamaged()) {
tile = se.building.tileset.damaged;
} else
if (se.building.getEfficiency() < 0.5f) {
tile = se.building.tileset.nolight;
} else {
tile = se.building.tileset.normal;
}
tile.alpha = se.tile.alpha;
cell.yCompensation = 27 - tile.imageHeight;
cell.a = loc1.x - se.virtualColumn;
cell.b = loc1.y + se.virtualRow - se.tile.height + 1;
if (se.virtualColumn == 0 && se.virtualRow < se.tile.height) {
tile.alpha = alpha;
cell.image = tile.getStrip(se.virtualRow);
return;
} else
if (se.virtualRow == se.tile.height - 1) {
tile.alpha = alpha;
cell.image = tile.getStrip(se.tile.height - 1 + se.virtualColumn);
return;
}
cell.image = null;
return;
}
}
/**
* Test if the given rectangular region is eligible for building placement, e.g.:
* all cells are within the map's boundary, no other buildings are present within the given bounds,
* no multi-tile surface object is present at the location.
* @param rect the surface rectangle
* @return true if the building can be placed
*/
public boolean canPlaceBuilding(Rectangle rect) {
for (int i = rect.x; i < rect.x + rect.width; i++) {
for (int j = rect.y; j > rect.y - rect.height; j--) {
if (!canPlaceBuilding(i, j)) {
return false;
}
}
}
return true;
}
/**
* Test if the coordinates are suitable for building placement.
* @param x the X coordinate
* @param y the Y coordinate
* @return true if placement is allowed
*/
public boolean canPlaceBuilding(int x, int y) {
if (!surface.cellInMap(x, y)) {
return false;
} else {
SurfaceEntity se = surface.buildingmap.get(Location.of(x, y));
if (se != null && se.type == SurfaceEntityType.BUILDING) {
return false;
} else {
se = surface.basemap.get(Location.of(x, y));
if (se != null && (se.tile.width > 1 || se.tile.height > 1)) {
return false;
}
}
}
return true;
}
/**
* Get a location based on the mouse coordinates.
* @param mx the mouse X coordinate
* @param my the mouse Y coordinate
* @return the location
*/
public Location getLocationAt(int mx, int my) {
if (surface != null) {
double mx0 = mx - (surface.baseXOffset + 28) * scale - offsetX; // Half left
double my0 = my - (surface.baseYOffset + 27) * scale - offsetY; // Half up
int a = (int)Math.floor(Tile.toTileX((int)mx0, (int)my0) / scale);
int b = (int)Math.floor(Tile.toTileY((int)mx0, (int)my0) / scale) ;
return Location.of(a, b);
}
return null;
}
/**
* Compute the bounding rectangle of the rendered building object.
* @param loc the location to look for a building.
* @return the bounding rectangle or null if the target does not contain a building
*/
public Rectangle getBoundingRect(Location loc) {
SurfaceEntity se = surface.buildingmap.get(loc);
if (se != null && se.type == SurfaceEntityType.BUILDING) {
int a0 = loc.x - se.virtualColumn;
int b0 = loc.y + se.virtualRow;
int x = surface.baseXOffset + Tile.toScreenX(a0, b0);
int y = surface.baseYOffset + Tile.toScreenY(a0, b0 - se.tile.height + 1) + 27;
return new Rectangle(x, y - se.tile.imageHeight, se.tile.imageWidth, se.tile.imageHeight);
}
return null;
}
/** Stop any animation timers. */
public void stopAnimations() {
animationTimer.stop();
}
}
| [
"akarnokd@gmail.com@53a5c284-dfd3-11dd-9b7c-bbba4c9295f9"
] | akarnokd@gmail.com@53a5c284-dfd3-11dd-9b7c-bbba4c9295f9 |
a90061d0849dafbf72a35f049cf5b82d5fd697dd | bc24725a5babf5447e3fdddeee7f1abb5aa62325 | /Heart/src/com/crab/ClientSender.java | 964949f8063f1a21e88b36a8d20c9586c8ac69f5 | [] | no_license | yunxiaoxie/ORMapping | 4d3d7d69e361d7e2911ea060760f6aac214d1e70 | 488a2d34174b8cb2466033646f3a10bc3243d912 | refs/heads/master | 2022-11-05T02:21:19.542876 | 2019-05-24T09:43:20 | 2019-05-24T09:43:20 | 69,338,682 | 1 | 1 | null | 2022-10-12T20:22:05 | 2016-09-27T09:05:01 | JavaScript | UTF-8 | Java | false | false | 1,034 | java | package com.crab;
import java.io.ObjectOutputStream;
import java.net.InetAddress;
import java.net.Socket;
public class ClientSender {
private ClientSender() {
}
Socket sender = null;
private static ClientSender instance;
public static ClientSender getInstance() {
if (instance == null) {
synchronized (ClientHeart.class) {
instance = new ClientSender();
}
}
return instance;
}
public void send() {
try {
sender = new Socket(InetAddress.getLocalHost(), 9090);
while (true) {
ObjectOutputStream out = new ObjectOutputStream(sender.getOutputStream());
Entity obj = new Entity();
obj.setName("xiaoming");
obj.setSex("男");
out.writeObject(obj);
out.flush();
System.out.println("已发送...");
Thread.sleep(5000);
}
} catch (Exception e) {
}
}
} | [
"YunxiaoXie@quarkfinance.com"
] | YunxiaoXie@quarkfinance.com |
1867497f4bc01021a9e1aa00d3017a8e20d69867 | 0582cd490781520b243d4d2dcc7436065c25528c | /java/com/xdeveloperart/apnadairy/helper/TransactionFirebase.java | 7ccddd7cb8bee6f796336edec030df4bb4767e76 | [] | no_license | sachinsah1997/Apna-Dairy | fc10cf1aeecb52bdf3ebd2065b421d3cea534bad | 0ed7434bb8d8a9efe6343550c8f1d598e39275e7 | refs/heads/master | 2022-04-06T18:17:01.891709 | 2020-01-22T02:49:56 | 2020-01-22T02:49:56 | 227,981,599 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,638 | java | package com.xdeveloperart.apnadairy.helper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;
import com.xdeveloperart.apnadairy.R;
import com.xdeveloperart.apnadairy.adapter.TransactionAdapter;
import java.util.List;
public class TransactionFirebase extends ArrayAdapter<TransactionAdapter> {
private FragmentActivity context;
private int resource;
private List <TransactionAdapter> list;
public TransactionFirebase(@NonNull FragmentActivity context, @LayoutRes int resource, @NonNull List<TransactionAdapter> objects) {
super(context, resource, objects);
this.context = context;
this.resource = resource;
list = objects;
}
@Override
public int getCount() {
return list.size();
}
@Override
public TransactionAdapter getItem(int position) {
return list.get(getCount() - position - 1);
}
@Override
public long getItemId(int position) {
return position;
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();
View v = inflater.inflate(resource, null);
TextView customerName = v.findViewById(R.id.textView);
customerName.setText(list.get(position).getCustomerName());
return v;
}
} | [
"ssk1222014@gmail.com"
] | ssk1222014@gmail.com |
4f5d9040f40674ef53949f1d9d09b30d125035ac | bc3cc297c8427f5f175db6eaf33dc11c45739ab9 | /FinalGroupProject/src/UpdateVendorForm.java | 8e73232388b83b69ee37557c6601ef8d4daef879 | [] | no_license | KeithJohn/CS265-Computer_Science_III-Data_Structures_II | f084c6388f1a7497135ec24036efece54c3602f1 | c8513958cf9c05dad0bb94b81882242c8eb6aa06 | refs/heads/master | 2020-04-13T21:56:25.874358 | 2018-12-29T02:49:10 | 2018-12-29T02:49:10 | 163,468,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,660 | java | import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.awt.event.ActionEvent;
import javax.swing.JComboBox;
import java.io.*;
import java.util.*;
public class UpdateVendorForm extends JFrame {
private JPanel contentPane;
private JTextField textField;
private JTextField textField_1;
private JTextField textField_2;
private JTextField textField_3;
private JTextField textField_4;
private JTextField textField_5;
private JTextField textField_6;
private JTextField textField_7;
private JTextField textField_8;
private JTextField textField_9;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UpdateVendorForm frame = new UpdateVendorForm();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
ArrayList<Vendor> vendors;
int sel;
public UpdateVendorForm() {
sel = 0;
try {
FileInputStream fileIn = new FileInputStream("src/Data/Vendors.dat");
ObjectInputStream in = new ObjectInputStream(fileIn);
vendors = (ArrayList<Vendor>) in.readObject();
in.close();
fileIn.close();
}catch(IOException i) {
i.printStackTrace();
}catch(ClassNotFoundException c) {
c.printStackTrace();
}
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 500, 440);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
textField = new JTextField();
textField.setBounds(80, 50, 205, 20);
if (!vendors.isEmpty()) {
textField.setText(Integer.toString(vendors.get(sel).getID()));
}
textField.setEditable(false);
contentPane.add(textField);
textField.setColumns(10);
textField_1 = new JTextField();
textField_1.setBounds(80, 81, 370, 20);
if (!vendors.isEmpty()) {
textField_1.setText(vendors.get(sel).getName());
}
contentPane.add(textField_1);
textField_1.setColumns(10);
textField_2 = new JTextField();
textField_2.setBounds(80, 112, 138, 20);
if (!vendors.isEmpty()) {
textField_2.setText(vendors.get(sel).getPhone1());
}
contentPane.add(textField_2);
textField_2.setColumns(10);
textField_3 = new JTextField();
textField_3.setBounds(305, 112, 145, 20);
if (!vendors.isEmpty()) {
textField_3.setText(vendors.get(sel).getPhone2());
}
contentPane.add(textField_3);
textField_3.setColumns(10);
textField_4 = new JTextField();
textField_4.setBounds(80, 143, 138, 20);
if (!vendors.isEmpty()) {
textField_4.setText(vendors.get(sel).getFax());
}
contentPane.add(textField_4);
textField_4.setColumns(10);
textField_5 = new JTextField();
textField_5.setBounds(80, 174, 370, 20);
if (!vendors.isEmpty()) {
textField_5.setText(vendors.get(sel).getEmail());
}
contentPane.add(textField_5);
textField_5.setColumns(10);
JPanel panel = new JPanel();
panel.setBounds(10, 204, 464, 150);
contentPane.add(panel);
panel.setLayout(null);
textField_6 = new JTextField();
textField_6.setBounds(69, 26, 370, 20);
if (!vendors.isEmpty()) {
textField_6.setText(vendors.get(sel).getAddress()[0]);
}
panel.add(textField_6);
textField_6.setColumns(10);
textField_7 = new JTextField();
textField_7.setBounds(70, 57, 250, 20);
if (!vendors.isEmpty()) {
textField_7.setText(vendors.get(sel).getAddress()[1]);
}
panel.add(textField_7);
textField_7.setColumns(10);
textField_8 = new JTextField();
textField_8.setBounds(70, 88, 250, 20);
if (!vendors.isEmpty()) {
textField_8.setText(vendors.get(sel).getAddress()[2]);
}
panel.add(textField_8);
textField_8.setColumns(10);
textField_9 = new JTextField();
textField_9.setBounds(70, 119, 250, 20);
if (!vendors.isEmpty()) {
textField_9.setText(vendors.get(sel).getAddress()[3]);
}
panel.add(textField_9);
textField_9.setColumns(10);
JLabel lblAddress_1 = new JLabel("Address");
lblAddress_1.setHorizontalAlignment(SwingConstants.CENTER);
lblAddress_1.setBounds(69, 1, 251, 27);
panel.add(lblAddress_1);
JLabel lblStreet = new JLabel("Street");
lblStreet.setBounds(13, 29, 46, 14);
panel.add(lblStreet);
JLabel lblCity = new JLabel("City");
lblCity.setBounds(14, 60, 46, 14);
panel.add(lblCity);
JLabel lblState = new JLabel("State");
lblState.setBounds(13, 91, 46, 14);
panel.add(lblState);
JLabel lblCountry = new JLabel("Country");
lblCountry.setBounds(14, 122, 46, 14);
panel.add(lblCountry);
JButton btnUpdateButton = new JButton("Update");
btnUpdateButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Vendor vendor = new Vendor(Integer.parseInt(textField.getText()), textField_1.getText(), textField_2.getText(), textField_3.getText(), textField_4.getText(), textField_5.getText());
vendor.setAddress(textField_6.getText(), textField_7.getText(), textField_8.getText(), textField_9.getText());
vendors.set(sel, vendor);
FileOutputStream fileOut = new FileOutputStream("src/Data/Vendors.dat");
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(vendors);
out.close();
fileOut.close();
} catch(IOException i) {
i.printStackTrace();
}
setVisible(false);
}
});
btnUpdateButton.setBounds(10, 367, 150, 23);
contentPane.add(btnUpdateButton);
JButton btnDeleteButton = new JButton("Delete");
btnDeleteButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
vendors.remove(sel);
FileOutputStream fileOut = new FileOutputStream("src/Data/Vendors.dat");
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(vendors);
out.close();
fileOut.close();
} catch(IOException i) {
i.printStackTrace();
}
setVisible(false);
}
});
btnDeleteButton.setBounds(170, 367, 150, 23);
contentPane.add(btnDeleteButton);
JButton btnNewButton_2 = new JButton("Cancel");
btnNewButton_2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setVisible(false);
}
});
btnNewButton_2.setBounds(330, 367, 144, 23);
contentPane.add(btnNewButton_2);
JLabel lblNewLabel = new JLabel("ID");
lblNewLabel.setBounds(24, 53, 46, 14);
contentPane.add(lblNewLabel);
JLabel lblName = new JLabel("Name");
lblName.setBounds(24, 84, 46, 14);
contentPane.add(lblName);
JLabel lblPhone = new JLabel("Phone");
lblPhone.setBounds(24, 115, 46, 14);
contentPane.add(lblPhone);
JLabel lblFax = new JLabel("Fax");
lblFax.setBounds(24, 146, 46, 14);
contentPane.add(lblFax);
JLabel lblEmail = new JLabel("Email");
lblEmail.setBounds(24, 177, 46, 14);
contentPane.add(lblEmail);
JLabel lblAddress = new JLabel("Address");
lblAddress.setBounds(10, 204, 46, 14);
contentPane.add(lblAddress);
JLabel lblPhone_1 = new JLabel("Phone II\r\n");
lblPhone_1.setBounds(249, 115, 46, 14);
contentPane.add(lblPhone_1);
JComboBox<String> comboBox = new JComboBox();
comboBox.setBounds(80, 19, 370, 20);
for (int i = 0; i < vendors.size(); i++) {
comboBox.addItem(vendors.get(i).getName());
}
if (!vendors.isEmpty()) {
comboBox.setSelectedIndex(0);
}
comboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (comboBox.getSelectedIndex() != -1) {
sel = comboBox.getSelectedIndex();
textField.setText(Integer.toString(vendors.get(sel).getID()));
textField_1.setText(vendors.get(sel).getName());
textField_2.setText(vendors.get(sel).getPhone1());
textField_3.setText(vendors.get(sel).getPhone2());
textField_4.setText(vendors.get(sel).getFax());
textField_5.setText(vendors.get(sel).getEmail());
textField_6.setText(vendors.get(sel).getAddress()[0]);
textField_7.setText(vendors.get(sel).getAddress()[1]);
textField_8.setText(vendors.get(sel).getAddress()[2]);
textField_9.setText(vendors.get(sel).getAddress()[3]);
}
}
});
contentPane.add(comboBox);
JLabel lblVendor = new JLabel("Vendor");
lblVendor.setBounds(24, 22, 46, 14);
contentPane.add(lblVendor);
}
}
| [
"keithjohn1020@gmail.com"
] | keithjohn1020@gmail.com |
78ef2aed9d71c5f57630f258e43e885d5c94a39f | ef9962d2f3fdac7f6a32a441795ac0997f51847f | /src/constantes/LocalDoArquivo.java | 5d1854c6cc89bed49f0e785bfde6377604d00f8c | [] | no_license | ThiagoKakoSilveira/DesafioStefaniniServerLog | a08d12020bf3b2eeb73eb73d067461bfd3a6f321 | 06392f7f2d3660897c2523f598e0fc145a2b2ecc | refs/heads/master | 2021-01-10T15:15:52.772045 | 2016-04-06T16:49:17 | 2016-04-06T16:49:17 | 55,186,328 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 226 | java | package constantes;
import java.io.File;
public class LocalDoArquivo {
final String user = System.getProperty("user.home");
public final File folder = new File(user + File.separator + "accessLog" + File.separator);
}
| [
"tmsilveira@stefanini.com"
] | tmsilveira@stefanini.com |
11865f08bbc4ce4238d08a4a2769813675b2a1eb | 7317aaf8bdb6d78a8c4c788f2e8826d5c55af5b3 | /src/day040/AtTheBank.java | b5f618a66f86020436f8797962b368f6c1394300 | [] | no_license | ayamilo/javaprogrammingb15online | 8ba9e1f793a127d1cbe4d578cd1a6e9e3a1918e3 | 74a18a0af46e45036988c069f3d2940884340a0e | refs/heads/master | 2020-11-27T23:22:00.292060 | 2020-02-23T22:06:39 | 2020-02-23T22:06:39 | 229,643,895 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 576 | java | package day040;
public class AtTheBank {
public static void main(String[] args) {
BankAccount b1 = new BankAccount();
b1.setAllTheValue("Saving", "Hasan", 123456789, 10000);
b1.showAccountBalance();
b1.showAccountHolderAccountType();
b1.deposit(3000);
System.out.println("b1 = " + b1);
b1.withdraw100$Cash();
System.out.println("b1 = " + b1);
b1.withdraw(12000);
System.out.println("b1 = " + b1);
b1.purchaseProduct(120, 3);
System.out.println("b1 = " + b1);
}
}
| [
"ayamilo2000@gmail.com"
] | ayamilo2000@gmail.com |
2d9f71ea08d39c8ce7fd20df03914a77593ee827 | f7e949cb73986d2af7691c0e47c239f6770f1f1a | /src/com/copa/utils/GeraBancoSQLite.java | ef19fd78351117ff29208722c5489f6b826acab7 | [] | no_license | jordanohenrique/jogoscopa | 0805abcf5c5750d8e1f1edf97a57a6991f99c750 | 514b60606ce050ce4c0363613a1e91081a224b30 | refs/heads/master | 2016-08-05T23:54:36.311190 | 2015-07-14T13:17:00 | 2015-07-14T13:17:00 | 39,074,634 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 48,686 | java | package com.copa.utils;
import com.copa.DAO.DadosBD;
import com.copa.jogoscopa.R;
import com.copa.Model.Parametros;
public class GeraBancoSQLite {
public GeraBancoSQLite() {
PARAMETROS();
if(populateParametros()){
DadosBD.getInstance().setParametros();
if(Parametros.getParVersaoBD().equalsIgnoreCase("1.0")){
Grupo();
Selecao();
Jogador();
Resultado();
Oitavas();
Quartas();
Semifinal();
Final();
ESTADIOS();
POPULATETABLE();
}
}
}
// Classes Clientes
public boolean Grupo()
{
Utils.setSQL("");
try {
Utils.db.execSQL("CREATE TABLE IF NOT EXISTS GRUPO("+
" idGrupo INTEGER primary key, "+
" gruDescricao NVarchar(50) NULL);");
Utils.db.execSQL(Utils.getSQL());
return true;
} catch (Exception e) {
return false;
}
}
// Clientes
public Boolean Selecao()
{
Utils.setSQL(null);
try {
Utils.setSQL("CREATE TABLE IF NOT EXISTS SELECAO(" +
"idSelecao INTEGER Primary Key NOT NULL, "+
"selNome nvarchar(50) NULL, " +
"selPontos int NULL, "+
"selVitorias int NULL, "+
"selDerrotas int NULL, " +
"selSaldoGols int NULL, " +
"selNumJogos int NULL, "+
"selEmpates int NULL, " +
"selGolsPro int NULL, " +
"selGolsCont int NULL, "+
"selFlagID integer NULL, "+
"GrupoId int CONSTRAINT [FK_Grupo_Selecao] REFERENCES Grupo(idGrupo));");
// cria o tabela
Utils.db.execSQL(Utils.getSQL());
return true;
} catch (Exception e) {
return false;
}
}
public boolean Jogador()
{
Utils.setSQL("");
try {
Utils.setSQL("CREATE TABLE IF NOT EXISTS JOGADOR("+
" idJogador INTEGER primary key, "+
" jogNome nvarchar(50) NULL,"+
" jogPosicao nvarchar(50) NULL,"+
" jogStatus nvarchar(1) DEFAULT ('A'),"+
" SelecaoId int CONSTRAINT [FK_Selecao_Jogador] REFERENCES Selecao(idSelecao));");
Utils.db.execSQL(Utils.getSQL());
return true;
} catch (Exception e) {
return false;
}
}
// Clientes
public Boolean Resultado()
{
Utils.setSQL(null);
try {
Utils.setSQL("CREATE TABLE IF NOT EXISTS RESULTADO(" +
"IdJogos INTEGER Primary Key NOT NULL, "+
"jgIdSelecao1 int NULL, " +
"jgIdSelecao2 int NULL, "+
"jgSelecao1 nvarchar(50) NULL, " +
"jgSelecao2 nvarchar(50) NULL, " +
"jgReferencia nvarchar(20) NULL, "+
"jgResultado1 int NULL, " +
"jgResultado2 int NULL, " +
"jgData nvarchar(10) NULL, " +
"jgSituacao nvarchar(1) DEFAULT('A'), "+
"jgLocal nvarchar(120) NULL, "+
"GrupoId int CONSTRAINT [FK_Grupo_Resultado] REFERENCES Grupo(idGrupo));");
// cria o tabela
Utils.db.execSQL(Utils.getSQL());
return true;
} catch (Exception e) {
return false;
}
}
public boolean Oitavas()
{
Utils.setSQL("");
try {
Utils.setSQL("CREATE TABLE IF NOT EXISTS OITAVAS("+
" idOitavas INTEGER primary key, "+
" oitIdSelecao int NULL,"+
" oitSelNome nvarchar(100) NULL,"+
" oitResultado int NULL,"+
" oitIdGrupo int NULL,"+
" oitReferencia int NULL,"+
" oitLocal nvarchar(120) NULL,"+
" oitPosicao int NULL);");
Utils.db.execSQL(Utils.getSQL());
return true;
} catch (Exception e) {
return false;
}
}
public boolean Quartas()
{
Utils.setSQL("");
try {
Utils.setSQL("CREATE TABLE IF NOT EXISTS QUARTAS("+
" idQuartas INTEGER primary key, "+
" quaIdSelecao int NULL,"+
" quaSelNome nvarchar(100) NULL,"+
" quaResultado int NULL,"+
" quaReferencia int NULL,"+
" quaIdGrupo int NULL,"+
" quaLocal nvarchar(120) NULL);");
Utils.db.execSQL(Utils.getSQL());
return true;
} catch (Exception e) {
return false;
}
}
public boolean Semifinal()
{
Utils.setSQL("");
try {
Utils.setSQL("CREATE TABLE IF NOT EXISTS SEMIFINAL("+
" idSemi INTEGER primary key, "+
" semiIdSelecao int NULL,"+
" semiSelNome nvarchar(100) NULL,"+
" semiResultado int NULL,"+
" semiReferencia int NULL,"+
" semiIdGrupo int NULL,"+
" semiLocal nvarchar(120) NULL);");
Utils.db.execSQL(Utils.getSQL());
return true;
} catch (Exception e) {
return false;
}
}
public boolean Final()
{
Utils.setSQL("");
try {
Utils.setSQL("CREATE TABLE IF NOT EXISTS FINAL("+
" idFinal INTEGER primary key, "+
" finIdSelecao int NULL,"+
" finSelNome nvarchar(80),"+
" finIdGrupo int NULL,"+
" finResultado int NULL,"+
" finLocal nvarchar(120) NULL,"+
" finPosicao int NULL);");
Utils.db.execSQL(Utils.getSQL());
return true;
} catch (Exception e) {
return false;
}
}
public boolean PARAMETROS()
{
Utils.setSQL("");
try {
Utils.setSQL("CREATE TABLE IF NOT EXISTS PARAMETROS("+
" idParametro INTEGER primary key, "+
" parURL nvarchar(120) DEFAULT('www'),"+
" parVersao nvarchar(10) DEFAULT('1.0'),"+
" parVersaoBD nvarchar(10) DEFAULT('1.0'),"+
" parOitavas nvarchar(1) DEFAULT('F'),"+
" parQuartas nvarchar(1) DEFAULT('F'),"+
" parSemi nvarchar(1) DEFAULT('F'),"+
" parClassif nvarchar(1) DEFAULT('F'));");
Utils.db.execSQL(Utils.getSQL());
return true;
} catch (Exception e) {
return false;
}
}
public boolean ESTADIOS()
{
Utils.setSQL("");
try {
Utils.setSQL("CREATE TABLE IF NOT EXISTS ESTADIO("+
" idEstadio INTEGER primary key, "+
" estCidade nvarchar(120) null,"+
" estEndereco nvarchar(10) null,"+
" estNome nvarchar(100) null,"+
" estApelido nvarchar(60) null,"+
" estCapacidade nvarchar(10) null,"+
" estVagas nvarchar(8) null,"+
" estImagem integer);");
Utils.db.execSQL(Utils.getSQL());
return true;
} catch (Exception e) {
return false;
}
}
public boolean POPULATETABLE()
{
Utils.setSQL("");
try {
//GRUPOS
Utils.db.execSQL("Insert into GRUPO (gruDescricao) SELECT 'GRUPO A' WHERE NOT EXISTS(SELECT 1 FROM GRUPO WHERE gruDescricao = 'GRUPO A');");
Utils.db.execSQL("Insert into GRUPO (gruDescricao) SELECT 'GRUPO B' WHERE NOT EXISTS(SELECT 1 FROM GRUPO WHERE gruDescricao = 'GRUPO B');");
Utils.db.execSQL("Insert into GRUPO (gruDescricao) SELECT 'GRUPO C' WHERE NOT EXISTS(SELECT 1 FROM GRUPO WHERE gruDescricao = 'GRUPO C');");
Utils.db.execSQL("Insert into GRUPO (gruDescricao) SELECT 'GRUPO D' WHERE NOT EXISTS(SELECT 1 FROM GRUPO WHERE gruDescricao = 'GRUPO D');");
Utils.db.execSQL("Insert into GRUPO (gruDescricao) SELECT 'GRUPO E' WHERE NOT EXISTS(SELECT 1 FROM GRUPO WHERE gruDescricao = 'GRUPO E');");
Utils.db.execSQL("Insert into GRUPO (gruDescricao) SELECT 'GRUPO F' WHERE NOT EXISTS(SELECT 1 FROM GRUPO WHERE gruDescricao = 'GRUPO F');");
Utils.db.execSQL("Insert into GRUPO (gruDescricao) SELECT 'GRUPO G' WHERE NOT EXISTS(SELECT 1 FROM GRUPO WHERE gruDescricao = 'GRUPO G');");
Utils.db.execSQL("Insert into GRUPO (gruDescricao) SELECT 'GRUPO H' WHERE NOT EXISTS(SELECT 1 FROM GRUPO WHERE gruDescricao = 'GRUPO H');");
//SELECOES
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'BRASIL',0,0,0,0,0,0,0,0,0,1 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'BRASIL');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'CROÁCIA',0,0,0,0,0,0,0,0,0,1 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'CROÁCIA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'MÉXICO',0,0,0,0,0,0,0,0,0,1 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'MÉXICO');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'CAMARÕES',0,0,0,0,0,0,0,0,0,1 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'CAMARÕES');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'ESPANHA',0,0,0,0,0,0,0,0,0,2 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'ESPANHA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'HOLANDA',0,0,0,0,0,0,0,0,0,2 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'HOLANDA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'CHILE',0,0,0,0,0,0,0,0,0,2 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'CHILE');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'AUSTRÁLIA',0,0,0,0,0,0,0,0,0,2 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'AUSTRÁLIA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'COLÔMBIA',0,0,0,0,0,0,0,0,0,3 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'COLÔMBIA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'GRÉSSIA',0,0,0,0,0,0,0,0,0,3 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'GRÉSSIA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'COSTA DO MARFIM',0,0,0,0,0,0,0,0,0,3 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'COSTA DO MARFIM');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'JAPÃO',0,0,0,0,0,0,0,0,0,3 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'JAPÃO');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'URUGUAI',0,0,0,0,0,0,0,0,0,4 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'URUGUAI');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'COSTA RICA',0,0,0,0,0,0,0,0,0,4 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'COSTA RICA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'INGLATERRA',0,0,0,0,0,0,0,0,0,4 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'INGLATERRA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'ITÁLIA',0,0,0,0,0,0,0,0,0,4 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'ITÁLIA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'SUIÇA',0,0,0,0,0,0,0,0,0,5 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'SUIÇA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'EQUADOR',0,0,0,0,0,0,0,0,0,5 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'EQUADOR');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'FRANÇA',0,0,0,0,0,0,0,0,0,5 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'FRANÇA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'HONDURAS',0,0,0,0,0,0,0,0,0,5 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'HONDURAS');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'ARGENTINA',0,0,0,0,0,0,0,0,0,6 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'ARGENTINA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'BÓSNIA',0,0,0,0,0,0,0,0,0,6 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'BÓSNIA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'IRÃ',0,0,0,0,0,0,0,0,0,6 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'IRÃ');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'NIGERIA',0,0,0,0,0,0,0,0,0,6 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'NIGERIA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'ALEMANHA',0,0,0,0,0,0,0,0,0,7 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'ALEMANHA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'PORTUGAL',0,0,0,0,0,0,0,0,0,7 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'PORTUGAL');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'GANA',0,0,0,0,0,0,0,0,0,7 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'GANA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'EUA',0,0,0,0,0,0,0,0,0,7 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'EUA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'BÉLGICA',0,0,0,0,0,0,0,0,0,8 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'BÉLGICA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'ARGÉLIA',0,0,0,0,0,0,0,0,0,8 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'ARGÉLIA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'RUSSIA',0,0,0,0,0,0,0,0,0,8 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'RUSSIA');");
Utils.db.execSQL("Insert into SELECAO (selNome, selPontos, selVitorias, selDerrotas, selSaldoGols, selNumJogos, selEmpates,"+
"selGolsPro, selGolsCont, selFlagID, GrupoId) SELECT 'COREIA DO SUL',0,0,0,0,0,0,0,0,0,8 WHERE NOT EXISTS(SELECT 1 FROM SELECAO WHERE selNome = 'COREIA DO SUL');");
//RESULTADO
//RODADAS GRUPO A
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 1,2,'BRASIL','CROÁCIA',121,0,0,'12/06/2014', 'Qui 12/06/2014 - 17:00 Arena Corinthians',1 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='121');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 3,4,'MÉXICO','CAMARÕES',341,0,0,'13/06/2014', 'Sex 13/06/2014 - 13:00 Arena das Dunas',1 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='341');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 1,3,'BRASIL','MÉXICO',131,0,0,'17/06/2014', 'Ter 17/06/2014 - 16:00 Castelão (CE)', 1 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='131');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 2,4,'CROÁCIA','CAMARÕES',241,0,0,'18/06/2014', 'Qua 18/06/2014 - 19:00 Arena da Amazônia',1 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='241');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 1,4,'BRASIL','CAMARÕES',141,0,0,'23/06/2014', 'Seg 23/06/2014 - 17:00 Mané Garrincha',1 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='141');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 2,3,'CROÁCIA','MÉXICO',231,0,0,'23/06/2014', 'Seg 23/06/2014 - 17:00 Arena Pernambuco',1 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='231');");
//RODADAS GRUPO B
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 5,6,'ESPANHA','HOLANDA',562,0,0,'13/06/2014', 'Sex 13/06/2014 - 16:00 Fonte Nova',2 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='562');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 7,8,'CHILE','AUSTRÁLIA',782,0,0,'13/06/2014', 'Sex 13/06/2014 - 19:00 Arena Pantanal',2 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='782');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 5,7,'ESPANHA','CHILE',572,0,0,'18/06/2014', 'Qua 18/06/2014 - 16:00 Maracanã',2 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='572');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 6,8,'HOLANDA','AUSTRÁLIA',682,0,0,'18/06/2014', 'Qua 18/06/2014 - 13:00 Beira Rio',2 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='682');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 5,8,'ESPANHA','AUSTRÁLIA',582,0,0,'23/06/2014', 'Seg 23/06/2014 - 13:00 Arena da Baixada',2 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='582');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 6,7,'HOLANDA','CHILE',672,0,0,'23/06/2014', 'Seg 23/06/2014 - 13:00 Arena Corinthians',2 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='672');");
//RODADAS GRUPO C
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 9,10,'COLÔMBIA','GRÉSSIA',9103,0,0,'14/06/2014', 'Sab 14/06/2014 - 13:00 Mineirão',3 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='9103');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 11,12,'COSTA DO MARFIM','JAPÃO',11123,0,0,'14/06/2014', 'Sab 14/06/2014 - 22:00 Arena Pernambuco',3 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='11123');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 9,11,'COLÔMBIA','COSTA DO MARFIM',9113,0,0,'19/06/2014', 'Qui 19/06/2014 - 13:00 Mané Garrincha',3 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='9113');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 10,12,'GRÉSSIA','JAPÃO',10123,0,0,'19/06/2014', 'Qui 19/06/2014 - 19:00 Arena das Dunas',3 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='10123');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 9,12,'COLÔMBIA','JAPÃO',9123,0,0,'24/06/2014', 'Ter 24/06/2014 - 17:00 Arena Pantanal',3 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='9123');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 10,11,'GRÉSSIA','COSTA DO MARFIM',10113,0,0,'24/06/2014', 'Ter 24/06/2014 - 17:00 Castelão (CE)',3 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='10113');");
//RODADAS GRUPO D
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 13,14,'URUGUAI','COSTA RICA',13144,0,0,'14/06/2014', 'Sab 14/06/2014 - 16:00 Castelão (CE)',4 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='13144');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 15,16,'INGLATERRA','ITÁLIA',15164,0,0,'14/06/2014', 'Sab 14/06/2014 - 19:00 Arena da Amazônia',4 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='15164');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 13,15,'URUGUAI','INGLATERRA',13154,0,0,'19/06/2014', 'Qui 19/06/2014 - 16:00 Arena Corinthians',4 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='13154');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 14,16,'COSTA RICA','ITÁLIA',14164,0,0,'20/06/2014', 'Sex 20/06/2014 - 13:00 Arena Pernambuco',4 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='14164');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 13,16,'URUGUAI','ITÁLIA',13164,0,0,'24/06/2014', 'Ter 24/06/2014 - 13:00 Arena das Dunas',4 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='13164');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 14,15,'COSTA RICA','INGLATERRA',14154,0,0,'24/06/2014', 'Ter 24/06/2014 - 13:00 Mineirão',4 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='14154');");
//RODADAS GRUPO E
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 17,18,'SUIÇA','EQUADOR',17185,0,0,'15/06/2014', 'Dom 15/06/2014 - 13:00 Mané Garrincha',5 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='17185');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 19,20,'FRANÇA','HONDURAS',19205,0,0,'15/06/2014', 'Dom 15/06/2014 - 16:00 Beira Rio',5 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='19205');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 17,19,'SUIÇA','FRANÇA',17195,0,0,'20/06/2014', 'Sex 20/06/2014 - 16:00 Fonte Nova',5 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='17195');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 18,20,'EQUADOR','HONDURAS',18205,0,0,'20/06/2014', 'Sex 20/06/2014 - 19:00 Arena da Baixada',5 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='18205');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 17,20,'SUIÇA','HONDURAS',17205,0,0,'25/06/2014', 'Qua 25/06/2014 - 17:00 Arena da Amazônia',5 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='17205');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 18,19,'EQUADOR','FRANÇA',18195,0,0,'25/06/2014', 'Qua 25/06/2014 - 17:00 Maracanã',5 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='18195');");
//RODADAS GRUPO F
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 21,22,'ARGENTINA','BÓSNIA',21226,0,0,'15/06/2014', 'Dom 15/06/2014 - 19:00 Maracanã',6 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='21226');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 23,24,'IRÃ','NIGERIA',23246,0,0,'16/06/2014', 'Seg 16/06/2014 - 16:00 Arena da Baixada',6 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='23246');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 21,23,'ARGENTINA','IRÃ',21236,0,0,'21/06/2014', 'Sab 21/06/2014 - 13:00 Mineirão',6 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='21236');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 22,24,'BÓSNIA','NIGERIA',22246,0,0,'21/06/2014', 'Sab 21/06/2014 - 19:00 Arena Pantanal',6 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='22246');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 21,24,'ARGENTINA','NIGERIA',21246,0,0,'25/06/2014', 'Qua 25/06/2014 - 13:00 Beira Rio',6 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='21246');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 22,23,'BÓSNIA','IRÃ',22236,0,0,'25/06/2014', 'Qua 25/06/2014 - 13:00 Fonte Nova',6 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='22236');");
//RODADAS GRUPO G
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 25,26,'ALEMANHA','PORTUGAL',25267,0,0,'16/06/2014', 'Seg 16/06/2014 - 13:00 Fonte Nova',7 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='25267');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 27,28,'GANA','EUA',27287,0,0,'16/06/2014', 'Seg 16/06/2014 - 19:00 Arena das Dunas',7 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='27287');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 25,27,'ALEMANHA','GANA',25277,0,0,'21/06/2014', 'Sab 21/06/2014 - 16:00 Castelão (CE)',7 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='25277');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 26,28,'PORTUGAL','EUA',26287,0,0,'22/06/2014', 'Dom 22/06/2014 - 19:00 Arena da Amazônia',7 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='26287');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 25,28,'ALEMANHA','EUA',25287,0,0,'26/06/2014', 'Qui 26/06/2014 - 13:00 Arena Pernambuco',7 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='25287');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 26,27,'PORTUGAL','GANA',26277,0,0,'26/06/2014', 'Qui 26/06/2014 - 13:00 Mané Garrincha',7 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='26277');");
//RODADAS GRUPO H
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 29,30,'BÉLGICA','ARGÉLIA',29308,0,0,'17/06/2014', 'Ter 17/06/2014 - 13:00 Mineirão',8 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='29308');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 31,32,'RUSSIA','COREIA DO SUL',31328,0,0,'17/06/2014', 'Ter 17/06/2014 - 19:00 Arena Pantanal',8 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='31328');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 29,31,'BÉLGICA','RUSSIA',29318,0,0,'22/06/2014', 'Dom 22/06/2014 - 13:00 Maracanã',8 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='29318');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 30,32,'ARGÉLIA','COREIA DO SUL',30328,0,0,'22/06/2014', 'Dom 22/06/2014 - 16:00 Beira Rio',8 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='30328');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 29,32,'BÉLGICA','COREIA DO SUL',29328,0,0,'26/06/2014', 'Qui 26/06/2014 - 17:00 Arena Corinthians',8 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='29328');");
Utils.db.execSQL("Insert into RESULTADO (jgIdSelecao1, jgIdSelecao2, jgSelecao1, jgSelecao2, jgReferencia, jgResultado1,"+
"jgResultado2, jgData, jgLocal, GrupoId) SELECT 30,31,'ARGÉLIA','RUSSIA',30318,0,0,'26/06/2014', 'Qui 26/06/2014 - 17:00 Arena da Baixada',8 WHERE NOT EXISTS(SELECT 1 FROM RESULTADO WHERE jgReferencia ='30318');");
//Inserindo ID Flags
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.brasil+" where idSelecao = 1;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.croacia+" where idSelecao = 2;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.mexico+" where idSelecao = 3;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.camaroes+" where idSelecao = 4;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.espanha+" where idSelecao = 5;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.holanda+" where idSelecao = 6;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.chile+" where idSelecao = 7;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.australia+" where idSelecao = 8;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.colombia+" where idSelecao = 9;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.grecia+" where idSelecao = 10;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.costamarfim+" where idSelecao = 11;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.japao+" where idSelecao = 12;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.uruguai+" where idSelecao = 13;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.costarica+" where idSelecao = 14;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.inglaterra+" where idSelecao = 15;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.italia+" where idSelecao = 16;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.suica+" where idSelecao = 17;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.equador+" where idSelecao = 18;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.franca+" where idSelecao = 19;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.honduras+" where idSelecao = 20;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.argentina+" where idSelecao = 21;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.bosnia+" where idSelecao = 22;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.ira+" where idSelecao = 23;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.nigeria+" where idSelecao = 24;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.alemanha+" where idSelecao = 25;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.portugal+" where idSelecao = 26;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.gana+" where idSelecao = 27;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.estadosunidos+" where idSelecao = 28;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.belgica+" where idSelecao = 29;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.argelia+" where idSelecao = 30;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.russia+" where idSelecao = 31;");
Utils.db.execSQL("Update Selecao set selFlagID = "+R.drawable.korea+" where idSelecao = 32;");
//Seta referncias para oitavas de final
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 1,1,1,0,1,'Sab 28/06/2014 - 13:00 Mineirão' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 1);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 2,2,2,0,1,'Sab 28/06/2014 - 13:00 Mineirão' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 2);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 3,1,3,0,2,'Sab 28/06/2014 - 17:00 Maracanã' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 3);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 4,2,4,0,2,'Sab 28/06/2014 - 17:00 Maracanã' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 4);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 5,1,5,0,3,'Seg 30/06/2014 - 13:00 Mané Garrincha' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 5);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 6,2,6,0,3,'Seg 30/06/2014 - 13:00 Mané Garrincha' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 6);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 7,1,7,0,4,'Seg 30/06/2014 - 17:00 Beira Rio' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 7);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 8,2,8,0,4,'Seg 30/06/2014 - 17:00 Beira Rio' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 8);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 9,1,2,0,5,'Dom 29/06/2014 - 13:00 Castelão (CE)' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 9);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 10,2,1,0,5,'Dom 29/06/2014 - 13:00 Castelão (CE)' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 10);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 11,1,4,0,6,'Dom 29/06/2014 - 17:00 Arena Pernambuco'WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 11);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 12,2,3,0,6,'Dom 29/06/2014 - 17:00 Arena Pernambuco' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 12);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 13,1,6,0,7,'Ter 01/07/2014 - 13:00 Arena Corinthians' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 13);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 14,2,5,0,7,'Ter 01/07/2014 - 13:00 Arena Corinthians' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 14);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 15,1,8,0,8,'Ter 01/07/2014 - 17:00 Fonte Nova' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 15);");
Utils.db.execSQL("Insert into Oitavas(idOitavas, oitPosicao, oitIdGrupo, oitResultado, oitReferencia, oitLocal) SELECT 16,2,7,0,8,'Ter 01/07/2014 - 17:00 Fonte Nova' WHERE NOT EXISTS(SELECT 1 FROM Oitavas WHERE idOitavas = 16);");
//seta quartas de final
Utils.db.execSQL("Insert into QUARTAS(idQuartas, quaReferencia, quaLocal) SELECT 1,1,'Sex 04/07/2014 - 17:00 Castelão (CE)' WHERE NOT EXISTS(SELECT 1 FROM QUARTAS WHERE idQuartas = 1);");
Utils.db.execSQL("Insert into QUARTAS(idQuartas, quaReferencia, quaLocal) SELECT 2,2,'Sex 04/07/2014 - 17:00 Castelão (CE)' WHERE NOT EXISTS(SELECT 1 FROM QUARTAS WHERE idQuartas = 2);");
Utils.db.execSQL("Insert into QUARTAS(idQuartas, quaReferencia, quaLocal) SELECT 3,3,'Sex 04/07/2014 - 13:00 Maracanã' WHERE NOT EXISTS(SELECT 1 FROM QUARTAS WHERE idQuartas = 3);");
Utils.db.execSQL("Insert into QUARTAS(idQuartas, quaReferencia, quaLocal) SELECT 4,4,'Sex 04/07/2014 - 13:00 Maracanã' WHERE NOT EXISTS(SELECT 1 FROM QUARTAS WHERE idQuartas = 4);");
Utils.db.execSQL("Insert into QUARTAS(idQuartas, quaReferencia, quaLocal) SELECT 5,5,'Sab 05/07/2014 - 17:00 Fonte Nova' WHERE NOT EXISTS(SELECT 1 FROM QUARTAS WHERE idQuartas = 5);");
Utils.db.execSQL("Insert into QUARTAS(idQuartas, quaReferencia, quaLocal) SELECT 6,6,'Sab 05/07/2014 - 17:00 Fonte Nova' WHERE NOT EXISTS(SELECT 1 FROM QUARTAS WHERE idQuartas = 6);");
Utils.db.execSQL("Insert into QUARTAS(idQuartas, quaReferencia, quaLocal) SELECT 7,7,'Sab 05/07/2014 - 13:00 Mané Garrincha' WHERE NOT EXISTS(SELECT 1 FROM QUARTAS WHERE idQuartas = 7);");
Utils.db.execSQL("Insert into QUARTAS(idQuartas, quaReferencia, quaLocal) SELECT 8,8,'Sab 05/07/2014 - 13:00 Mané Garrincha' WHERE NOT EXISTS(SELECT 1 FROM QUARTAS WHERE idQuartas = 8);");
//seta semifinal
Utils.db.execSQL("Insert into SEMIFINAL(idSemi, semiReferencia, semiLocal) SELECT 1,12,'Ter 08/07/2014 - 17:00 Mineirão' WHERE NOT EXISTS(SELECT 1 FROM SEMIFINAL WHERE idSemi= 1);");
Utils.db.execSQL("Insert into SEMIFINAL(idSemi, semiReferencia, semiLocal) SELECT 2,34,'Ter 08/07/2014 - 17:00 Mineirão' WHERE NOT EXISTS(SELECT 1 FROM SEMIFINAL WHERE idSemi= 2);");
Utils.db.execSQL("Insert into SEMIFINAL(idSemi, semiReferencia, semiLocal) SELECT 3,56,'Qua 09/07/2014 - 17:00 Arena Corinthians' WHERE NOT EXISTS(SELECT 1 FROM SEMIFINAL WHERE idSemi= 3);");
Utils.db.execSQL("Insert into SEMIFINAL(idSemi, semiReferencia, semiLocal) SELECT 4,78,'Qua 09/07/2014 - 17:00 Arena Corinthians' WHERE NOT EXISTS(SELECT 1 FROM SEMIFINAL WHERE idSemi= 4);");
//seta final
Utils.db.execSQL("Insert into FINAL(idFinal, finPosicao, finLocal) SELECT 1,0,'Dom 13/07/2014 - 16:00 Maracanã' WHERE NOT EXISTS(SELECT 1 FROM FINAL WHERE idFinal = 1);");
Utils.db.execSQL("Insert into FINAL(idFinal, finPosicao, finLocal) SELECT 2,1,'Dom 13/07/2014 - 16:00 Maracanã' WHERE NOT EXISTS(SELECT 1 FROM FINAL WHERE idFinal = 2);");
//seta Estadios
Utils.db.execSQL("Insert into ESTADIO(estCidade, estEndereco, estNome, estApelido, estCapacidade, estVagas, estImagem)"
+ " SELECT 'BELO HORIZONTE-MG', 'Av. Antônio Abrahão Caram - 1001 - São Luis - 31275000',"
+ " 'Estádio Gov. Magalhães Pinto' , 'MINEIRÃO', '62.547', '2.670', "+R.drawable.mineirao+" WHERE NOT EXISTS(SELECT 1 FROM ESTADIO WHERE idEstadio = 1);");
Utils.db.execSQL("Insert into ESTADIO(estCidade, estEndereco, estNome, estApelido, estCapacidade, estVagas, estImagem)"
+ " SELECT 'BRASÍLIA-DF', 'Complexo Poliesportivo Ayrton Senna - Asa Norte - 70077-000',"
+ " 'Estádio Nacional Mané Garrincha' , 'MANÉ GARRINCHA', '70.064', '8.557', "+R.drawable.estadiomanegarrincha+" WHERE NOT EXISTS(SELECT 1 FROM ESTADIO WHERE idEstadio = 2);");
Utils.db.execSQL("Insert into ESTADIO(estCidade, estEndereco, estNome, estApelido, estCapacidade, estVagas, estImagem)"
+ " SELECT 'CUIABÁ-MT', 'Av. Agrícola Paes de Barros - s/nº, Verdão - 78030-210',"
+ " 'Estádio José Fragelli' , 'ARENA PANTANAL', '42.968', '2.831', "+R.drawable.arenapantanal+" WHERE NOT EXISTS(SELECT 1 FROM ESTADIO WHERE idEstadio = 3);");
Utils.db.execSQL("Insert into ESTADIO(estCidade, estEndereco, estNome, estApelido, estCapacidade, estVagas, estImagem)"
+ " SELECT 'CURITIBA-PR', 'Rua Buenos Aires - s/nº - Água Verde - 80250-070',"
+ " 'Estádio Joaquim Américo Guimarães' , 'ARENA DA BAIXADA', '41.456', '1.908', "+R.drawable.arenabaixada+" WHERE NOT EXISTS(SELECT 1 FROM ESTADIO WHERE idEstadio = 4);");
Utils.db.execSQL("Insert into ESTADIO(estCidade, estEndereco, estNome, estApelido, estCapacidade, estVagas, estImagem)"
+ " SELECT 'FORTALEZA-CE', 'Av. Alberto Craveiro - 2901 - Castelão - 60861-211',"
+ " 'Estádio Governador Plácido Castelo' , 'CASTELÃO', '64.846', '1.900', "+R.drawable.castelao+" WHERE NOT EXISTS(SELECT 1 FROM ESTADIO WHERE idEstadio = 5);");
Utils.db.execSQL("Insert into ESTADIO(estCidade, estEndereco, estNome, estApelido, estCapacidade, estVagas, estImagem)"
+ " SELECT 'MANAUS-AM', 'Av. Constantino Nery - s/nº - Flores - 69058-795',"
+ " 'Arena Amazônia' , 'ARENA AMAZÔNIA', '62.374', '400', "+R.drawable.arenaamazonia+" WHERE NOT EXISTS(SELECT 1 FROM ESTADIO WHERE idEstadio = 6);");
Utils.db.execSQL("Insert into ESTADIO(estCidade, estEndereco, estNome, estApelido, estCapacidade, estVagas, estImagem)"
+ " SELECT 'NATAL-RN', 'Avenida Presidente Prudente de Morais - 5121 - Lagoa Nova - 59056-200',"
+ " 'Arena Das Dunas' , 'ARENA DA DUNAS', '42.086', '2.617', "+R.drawable.arenadunas+" WHERE NOT EXISTS(SELECT 1 FROM ESTADIO WHERE idEstadio = 7);");
Utils.db.execSQL("Insert into ESTADIO(estCidade, estEndereco, estNome, estApelido, estCapacidade, estVagas, estImagem)"
+ " SELECT 'PORTO ALEGRE-RS', 'Av. Padre Cacique - 891 - Praia de Belas - 90810-240',"
+ " 'Estádio José Pinheiro Borda' , 'BEIRA-RIO', '48.849', '7.000', "+R.drawable.beirario+" WHERE NOT EXISTS(SELECT 1 FROM ESTADIO WHERE idEstadio = 8);");
Utils.db.execSQL("Insert into ESTADIO(estCidade, estEndereco, estNome, estApelido, estCapacidade, estVagas, estImagem)"
+ " SELECT 'RECIFE-PE', 'Rua Deus é Fiel, 01 - Jardim Tenedo - em São Lourenço da Mata - 54710-010',"
+ " 'Arena Pernambuco' , 'ARENA PERNAMBUCO', '44.248', '4.700', "+R.drawable.arenapernambuco+" WHERE NOT EXISTS(SELECT 1 FROM ESTADIO WHERE idEstadio = 9);");
Utils.db.execSQL("Insert into ESTADIO(estCidade, estEndereco, estNome, estApelido, estCapacidade, estVagas, estImagem)"
+ " SELECT 'RIO DE JANEIRO-RJ', 'Rua Professor Eurico Rabelo - Maracanã - 20271-150',"
+ " 'Estádio Mário Filho' , 'MARACANÃ', '78.639', '328', "+R.drawable.maracana+" WHERE NOT EXISTS(SELECT 1 FROM ESTADIO WHERE idEstadio = 10);");
Utils.db.execSQL("Insert into ESTADIO(estCidade, estEndereco, estNome, estApelido, estCapacidade, estVagas, estImagem)"
+ " SELECT 'SALVADOR-BA', 'Av. Pres. Costa e Silva - Nazare - 40050-360',"
+ " 'Estádio Otávio Mangabeira' , 'FONTE NOVA', '48.747', '1.978', "+R.drawable.arenafontenova+" WHERE NOT EXISTS(SELECT 1 FROM ESTADIO WHERE idEstadio = 11);");
Utils.db.execSQL("Insert into ESTADIO(estCidade, estEndereco, estNome, estApelido, estCapacidade, estVagas, estImagem)"
+ " SELECT 'SAO PAULO-SP', 'Rua Doutor Luís Aires - s/n - Itaquera - Itaquera - 08295-005',"
+ " 'ARENA CORINTHIANS' , 'ITAQUERAO', '69.160', '3.500', "+R.drawable.arenacorinthians+" WHERE NOT EXISTS(SELECT 1 FROM ESTADIO WHERE idEstadio = 12);");
Utils.db.execSQL("Update Parametros set parVersaoBD = '1.1' WHERE idParametro = 1;");
return true;
} catch (Exception e) {
return false;
}
}
private boolean populateParametros(){
try {
//seta parametros
Utils.db.execSQL("Insert into Parametros(idParametro, parURL, parVersao, parVersaoBD, parOitavas, parQuartas, parSemi, parClassif) "
+ "SELECT 1,'www', '1.0','1.0','F','F','F','F' WHERE NOT EXISTS(SELECT 1 FROM Parametros WHERE idParametro = 1);");
return true;
} catch (Exception e) {
return false;
}
}
}
| [
"jordanohenrique@bol.com.br"
] | jordanohenrique@bol.com.br |
d220b8263af05a395ec0c39cbf00cf4d9242735b | 8efe629a0f82901e855cd79b905c8416bada38f2 | /ejb/src/main/java/com/mmj/data/ejb/model/EmployeeEN.java | b437d5927026efa112cd3dfbbf10358d9cc960fd | [] | no_license | klind/420 | c85fad4f2c60023119dd6f71de066490cf5d641c | 3266e1712dc03dd40238d73cf9fcd250281749a1 | refs/heads/master | 2021-01-24T17:07:53.747513 | 2016-09-14T07:32:06 | 2016-09-14T07:32:06 | 67,904,195 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,220 | java | package com.mmj.data.ejb.model;
import com.mmj.data.core.dto.entity.EmployeeBaseDTO;
import com.mmj.data.core.dto.entity.EmployeeFullDTO;
import com.mmj.data.core.dto.entity.EmployeePartialDTO;
import com.mmj.data.core.dto.entity.PassengerDTO;
import com.mmj.data.core.dto.entity.SuspensionDTO;
import com.mmj.data.core.util.DateTimeUtil;
import org.hibernate.validator.constraints.Length;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
/**
* Employee Entity.
*/
@Entity
@Table(name = "employee")
public class EmployeeEN implements Serializable {
private static final long serialVersionUID = 1L;
// Employee Id's are controlled by pipeline, so we don't generate our own. It is also String, because it can have leading 0s.
@Id
@Column(name = "employee_id", length = 6)
@NotNull
private String employeeId;
@Column(name = "salutation", length = 5)
@Length(max = 5)
private String salutation;
@Column(name = "suffix", length = 10)
@Length(max = 10)
private String suffix;
@Column(name = "first_name", length = 30)
@Length(min = 2, max = 30)
@NotNull
private String firstName;
@Column(name = "middle_name", length = 30)
@Length(min = 0, max = 30)
private String middleName;
@Column(name = "last_name", length = 30)
@Length(min = 1, max = 30)
@NotNull
private String lastName;
@Column(name = "email", length = 50)
@Length(min = 5, max = 50)
@NotNull
private String email;
@Temporal(TemporalType.DATE)
@NotNull
private Date dob;
@Column(name = "last_hire_date")
@Temporal(TemporalType.DATE)
@NotNull
private Date lastHireDate;
@Column(name = "term_date")
@Temporal(TemporalType.DATE)
private Date termDate;
@Column(name = "phone", length = 30)
//@NotNull
private String phone;
@Column(name = "title", length = 50)
@Length(max = 50)
@NotNull
private String title;
@Column(name = "status", length = 1)
@NotNull
private String status;
@Column(name = "guest_passes_alloted")
private Integer guestPassesAlloted;
@Column(name = "guest_passes_booked")
private Integer guestPassesBooked;
@Column(name = "vacation_passes_alloted")
private Integer vacationPassesAlloted;
@Column(name = "vacation_passes_used")
private Integer vacationPassesUsed;
@Column(name = "job_code", length = 4)
//@NotNull should be NotNull, but old data from CMSDB have null values
private String jobCode;
@Column(length = 4)
@NotNull
private String location;
@Column(name = "department_id", length = 3)
@NotNull
private String departmentId;
@Column(name = "department_name", length = 50)
@NotNull
private String departmentName;
@Column(name = "manager_id", length = 6)
@NotNull
private String managerId;
@Column(name = "employee_type", length = 1)
@NotNull
private String employeeType;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "employee", fetch = FetchType.EAGER)
@OrderBy("id")
private Set<PassengerEN> passengers = new HashSet<>();
@OneToMany(cascade = CascadeType.ALL, mappedBy = "employee", fetch = FetchType.EAGER)
@OrderBy("id")
private Set<SuspensionEN> suspensions = new HashSet<>();
@OneToMany(cascade = CascadeType.ALL, mappedBy = "employee", fetch = FetchType.EAGER)
@OrderBy("id")
private Set<GuestEN> guests = new HashSet<>();
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name="sa_code_id")
private SaCodeEN saCode;
@Column(name = "gender", length = 1)
//@NotNull // TODO: Make this Not Null once we get the info from pipeline. Commenting out as per Krisitian's request.
private String gender;
public String getEmployeeId() {
return employeeId;
}
public void setEmployeeId(String employeeId) {
this.employeeId = employeeId;
}
public String getSalutation() {
return salutation;
}
public void setSalutation(String salutation) {
this.salutation = salutation;
}
public String getSuffix() {
return suffix;
}
public void setSuffix(String suffix) {
this.suffix = suffix;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getMiddleName() {
return middleName;
}
public void setMiddleName(String middleName) {
this.middleName = middleName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Date getDob() {
return dob;
}
public void setDob(Date dob) {
this.dob = dob;
}
public Date getLastHireDate() {
return lastHireDate;
}
public void setLastHireDate(Date lastHireDate) {
this.lastHireDate = lastHireDate;
}
public Date getTermDate() {
return termDate;
}
public void setTermDate(Date termDate) {
this.termDate = termDate;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Integer getGuestPassesAlloted() {
return guestPassesAlloted;
}
public void setGuestPassesAlloted(Integer guestPassesAlloted) {
this.guestPassesAlloted = guestPassesAlloted;
}
public Integer getGuestPassesBooked() {
return guestPassesBooked;
}
public void setGuestPassesBooked(Integer guestPassesBooked) {
this.guestPassesBooked = guestPassesBooked;
}
public Integer getVacationPassesAlloted() {
return vacationPassesAlloted;
}
public void setVacationPassesAlloted(Integer vacationPassesAlloted) {
this.vacationPassesAlloted = vacationPassesAlloted;
}
public Integer getVacationPassesUsed() {
return vacationPassesUsed;
}
public void setVacationPassesUsed(Integer vacationPassesUsed) {
this.vacationPassesUsed = vacationPassesUsed;
}
public String getJobCode() {
return jobCode;
}
public void setJobCode(String jobCode) {
this.jobCode = jobCode;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getDepartmentId() {
return departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getManagerId() {
return managerId;
}
public void setManagerId(String managerId) {
this.managerId = managerId;
}
public String getEmployeeType() {
return employeeType;
}
public void setEmployeeType(String employeeType) {
this.employeeType = employeeType;
}
public Set<PassengerEN> getPassengers() {
return passengers;
}
public void setPassengers(Set<PassengerEN> passengers) {
this.passengers = passengers;
}
public Set<SuspensionEN> getSuspensions() {
return suspensions;
}
public void setSuspensions(Set<SuspensionEN> suspensions) {
this.suspensions = suspensions;
}
public SaCodeEN getSaCode() {
return saCode;
}
public void setSaCode(SaCodeEN saCode) {
this.saCode = saCode;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
/**
* Returns an instance of EmployeeFullDTO with passengers and suspensions.
*
* @return EmployeeFullDTO
*/
public EmployeeFullDTO getEmployeeDTO() {
Set<PassengerDTO> passengerDTOs = new HashSet<>();
for (PassengerEN passenger : passengers) {
passengerDTOs.add(passenger.getPassengerDTO());
}
boolean travelStatus = true;
Set<SuspensionDTO> suspensionDTOs = new HashSet<>();
for (SuspensionEN suspension : suspensions) {
if (travelStatus) {
travelStatus = !DateTimeUtil.isNowBetween(suspension.getBegin(), suspension.getEnd());
}
suspensionDTOs.add(suspension.getSuspensionDTO());
}
return new EmployeeFullDTO(getEmployeeId(), getSalutation(), getSuffix(), getFirstName(), getMiddleName(), getLastName(), getEmail(), getTitle(), getStatus(), DateTimeUtil.dateToLocalDate(getDob()), DateTimeUtil.dateToLocalDate(getLastHireDate()), DateTimeUtil.dateToLocalDate(getTermDate()), getPhone(), getJobCode(), getLocation(), getDepartmentId(), getDepartmentName(), getManagerId(), "", getEmployeeType(), travelStatus, passengerDTOs, suspensionDTOs, getGuestPassesAlloted(), getGuestPassesBooked(), getVacationPassesAlloted(), getVacationPassesUsed(), getSaCode() != null ? getSaCode().getSaCodeDTO() : null, getGender());
}
/**
* Returns an instance of EmployeeBaseDTO.
*
* @return EmployeeBaseDTO
*/
public EmployeeBaseDTO getEmployeeBaseDTO() {
return new EmployeeBaseDTO(getEmployeeId(), getSalutation(), getSuffix(), getFirstName(), getMiddleName(), getLastName(), getEmail(), getTitle(), getStatus(), getGender(), getLocation());
}
/**
* Returns an instance of EmployeePartialDTO.
* This is the instance that will be returned to the search result
*
* @return EmployeePartialDTO
*/
public EmployeePartialDTO getEmployeePartialDTO() {
return new EmployeePartialDTO(getEmployeeId(), getSalutation(), getSuffix(), getFirstName(), getMiddleName(), getLastName(), getEmail(), getTitle(), getStatus(), DateTimeUtil.dateToLocalDate(getDob()), DateTimeUtil.dateToLocalDate(getLastHireDate()), DateTimeUtil.dateToLocalDate(getTermDate()), getPhone(), getJobCode(), getLocation(), getDepartmentId(), getDepartmentName(), getManagerId(), "", getEmployeeType(), getGender());
}
}
| [
"kristian.lind@allegiantair.com"
] | kristian.lind@allegiantair.com |
0db267dd222def84a435f623c0dbb197f84f15fd | 472e5f813fd362a8dfaa10146929e90123876a59 | /src/main/java/com/vertex/academy/arrays/ArraysExperiments.java | 611ce31d013199f1e76125c72cc988d3f7bc1657 | [] | no_license | backumich/prof0619 | b3e6e42460685576d2ab6beb8c97e30893c09939 | b6826e903f86e8f371d083c1c768c19551d780ce | refs/heads/master | 2022-06-28T20:34:58.452036 | 2019-09-14T11:22:16 | 2019-09-14T11:22:16 | 193,577,505 | 0 | 1 | null | 2022-06-21T01:51:52 | 2019-06-24T20:44:18 | Java | UTF-8 | Java | false | false | 935 | java | package com.vertex.academy.arrays;
import java.util.Arrays;
public class ArraysExperiments {
public static void main(String[] args) {
A a = new A();
B b = new B();
A[] arrayOfA = new A[8];
B[] arrayOfB = new B[9];
arrayOfB[3] = new B();
System.out.println(arrayOfB[3]);
// has different clases
// System.out.println(a.getClass());
// System.out.println(arrayOfA.getClass());
//
//transitive extension
// System.out.println(arrayOfB instanceof A[]);
// System.out.println(arrayOfA);
// System.out.println(a instanceof A[]);
// System.out.println(arrayOfA instanceof A);
System.out.println(arrayOfA.length);
arrayOfA = Arrays.copyOfRange(arrayOfB, 0, 20);
System.out.println(arrayOfA.length);
System.out.println(Arrays.toString(arrayOfA));
}
}
class A {
}
class B extends A {
}
| [
"backumich@gmail.com"
] | backumich@gmail.com |
8ec517e56e33f9cfce3e1490aa1ab41abf262df2 | c2b12072b79f3d43822800cb142d23a72ea74660 | /shop-common/src/main/java/cn/liuyiyou/shop/common/mq/MessageHandlerSelector.java | 06112ba66928cd04a89ad065e19acd7b349eac04 | [] | no_license | liuyiyou/cn.liuyiyou.shop | 22de58e2dbeab55919a78705e858b9fc6b68e07e | 621f34be114dfe95e886008fc50831e6ba0c12fc | refs/heads/master | 2022-07-19T11:00:43.827780 | 2019-10-08T08:37:17 | 2019-10-08T08:37:17 | 157,149,471 | 0 | 1 | null | 2022-06-21T01:03:33 | 2018-11-12T03:08:23 | CSS | UTF-8 | Java | false | false | 395 | java | package cn.liuyiyou.shop.common.mq;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
/***
*
* @author: liuyiyou.cn
* @date: 2019/4/18
* @Copyright 2019 liuyiyou.cn Inc. All rights reserved
*/
public class MessageHandlerSelector {
@Autowired
private List<IConsumerHandler> messageHandlers = new ArrayList<>();
}
| [
"liuyiyou@daojia.com"
] | liuyiyou@daojia.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.