blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
f142602233ccdb0d9e657ad42ff44981fc72a46e
f4d47e69622dd4d4ea8a68004a3fe3dbca3c047e
/SparkArtName/src/main/java/utilities/KafkaSetup.java
eb8aac06f87bfab8a0f4799d12444bed13cee024
[]
no_license
gevago01/StreamingQBP
ad3779fe28de921756269ccb9448fad8267e4cf6
a98fc81843618102f553f5587742c4f42951ddd1
refs/heads/master
2020-04-19T11:53:00.499327
2019-01-29T15:37:37
2019-01-29T15:37:37
168,178,842
0
0
null
null
null
null
UTF-8
Java
false
false
1,640
java
package utilities; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.common.serialization.StringDeserializer; import org.apache.spark.streaming.api.java.JavaInputDStream; import org.apache.spark.streaming.api.java.JavaStreamingContext; import org.apache.spark.streaming.kafka010.ConsumerStrategies; import org.apache.spark.streaming.kafka010.KafkaUtils; import org.apache.spark.streaming.kafka010.LocationStrategies; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Map; /** * Created by giannis on 28/01/19. */ public class KafkaSetup { public static JavaInputDStream<ConsumerRecord<String, String>> setup(JavaStreamingContext ssc) { Map<String, Object> kafkaParams = new HashMap<>(); // kafkaParams.put("bootstrap.servers", "146.169.47.109:9092"); kafkaParams.put("bootstrap.servers", "localhost:9092"); kafkaParams.put("key.deserializer", StringDeserializer.class); kafkaParams.put("value.deserializer", StringDeserializer.class); kafkaParams.put("group.id", "groupID"); kafkaParams.put("auto.offset.reset", "latest"); kafkaParams.put("enable.auto.commit", false); Collection<String> topics = Arrays.asList("queries"); JavaInputDStream<ConsumerRecord<String, String>> queryStream = KafkaUtils.createDirectStream( ssc, LocationStrategies.PreferConsistent(), ConsumerStrategies.<String, String>Subscribe(topics, kafkaParams) ); return queryStream; } }
[ "gevagorou@gmail.com" ]
gevagorou@gmail.com
fba861a508e154576ddf32343aa0c29aa3346763
bb9d69432743437ae9797863c24ad8e1a0490418
/NeuralNetwork/src/entity/util/cost_function/PartialDerivation.java
7a546154398aa7fc87b8012fce40fcf7e229cc4c
[]
no_license
murilocg/NeuralNetwork
6d3e8e07dd8cabe60f3c1bb3d52b7845a7852982
7dceeaa54b5c7ae69efc4ed5b8705463698a975f
refs/heads/master
2021-06-24T16:49:56.537059
2017-09-07T21:53:02
2017-09-07T21:53:02
100,420,398
0
0
null
2017-09-07T21:54:51
2017-08-15T21:21:52
Java
UTF-8
Java
false
false
1,032
java
package entity.util.cost_function; import org.jblas.DoubleMatrix; import entity.util.activation_function.Sigmoid; /* * This class has the responsibility of calculate the following equation: * p1 = m∑i=1 K∑k=1 [y(i)k log( (hΘ( x(i) ))k ) * * + * * p2 = (1 − y(i)k ) log(1 − ( hΘ( x(i) ))k )] * * -(p1 + p2) / m * * This equation is the base to the cost function. */ public class PartialDerivation { public static double derive(DoubleMatrix X, DoubleMatrix Y, int K, int m) { double sum = 0; for (int i = 0; i < m; i++) { DoubleMatrix y = Y.getRow(i); DoubleMatrix x = X.getRow(i); DoubleMatrix sigmoid_x = Sigmoid.sigmoid(x); for (int k = 0; k < K; k++) { /* * p1 = y(i)k log( (hΘ( x(i) ))k ) */ double p1 = y.get(k) * Math.log(sigmoid_x.get(k) / Math.log(2)); /* * p2 = (1 − y(i)k ) log(1 − ( hΘ( x(i) ))k ) */ double p2 = (1 - y.get(k)) * Math.log(1 - sigmoid_x.get(k)) / Math.log(2); sum += (p1 + p2); } } return -sum / m; } }
[ "murilocosta21@yahoo.com.br" ]
murilocosta21@yahoo.com.br
cdb51c440b30fb936597fe30034951390348416e
3f169749adceb8a84803c561467e391ef381d7d0
/workspace/mail/src/persistence/AnswerCommandProxi.java
2b27b90fb2098ca1ec6fec9f0d672913b80ca7fc
[]
no_license
Cryzas/FHDW2
969619012ad05f455d04dce0f3413f53cedd9351
8bc31d4072cc9ed7ddf86154cdf08f0f9a55454b
refs/heads/master
2021-01-23T05:25:00.249669
2017-10-11T06:24:17
2017-10-11T06:24:17
86,296,546
3
0
null
null
null
null
UTF-8
Java
false
false
6,369
java
package persistence; import model.visitor.*; public class AnswerCommandProxi extends PersistentProxi implements PersistentAnswerCommand{ public AnswerCommandProxi(long objectId) { super(objectId); } public AnswerCommandProxi(PersistentInCacheProxi object) { super(object); } public long getClassId() { return 141; } public MailEntry4Public getMail() throws PersistenceException { return ((PersistentAnswerCommand)this.getTheObject()).getMail(); } public void setMail(MailEntry4Public newValue) throws PersistenceException { ((PersistentAnswerCommand)this.getTheObject()).setMail(newValue); } public String getSubject() throws PersistenceException { return ((PersistentAnswerCommand)this.getTheObject()).getSubject(); } public void setSubject(String newValue) throws PersistenceException { ((PersistentAnswerCommand)this.getTheObject()).setSubject(newValue); } public String getText() throws PersistenceException { return ((PersistentAnswerCommand)this.getTheObject()).getText(); } public void setText(String newValue) throws PersistenceException { ((PersistentAnswerCommand)this.getTheObject()).setText(newValue); } public Invoker getInvoker() throws PersistenceException { return ((PersistentAnswerCommand)this.getTheObject()).getInvoker(); } public void setInvoker(Invoker newValue) throws PersistenceException { ((PersistentAnswerCommand)this.getTheObject()).setInvoker(newValue); } public AccountManager4Public getCommandReceiver() throws PersistenceException { return ((PersistentAnswerCommand)this.getTheObject()).getCommandReceiver(); } public void setCommandReceiver(AccountManager4Public newValue) throws PersistenceException { ((PersistentAnswerCommand)this.getTheObject()).setCommandReceiver(newValue); } public PersistentCommonDate getMyCommonDate() throws PersistenceException { return ((PersistentAnswerCommand)this.getTheObject()).getMyCommonDate(); } public void setMyCommonDate(PersistentCommonDate newValue) throws PersistenceException { ((PersistentAnswerCommand)this.getTheObject()).setMyCommonDate(newValue); } public java.sql.Date getCreateDate() throws PersistenceException { return ((PersistentAnswerCommand)this.getTheObject()).getCreateDate(); } public void setCreateDate(java.sql.Date newValue) throws PersistenceException { ((PersistentAnswerCommand)this.getTheObject()).setCreateDate(newValue); } public java.sql.Date getCommitDate() throws PersistenceException { return ((PersistentAnswerCommand)this.getTheObject()).getCommitDate(); } public void setCommitDate(java.sql.Date newValue) throws PersistenceException { ((PersistentAnswerCommand)this.getTheObject()).setCommitDate(newValue); } public void accept(CommonDateVisitor visitor) throws PersistenceException { visitor.handleAnswerCommand(this); } public <R> R accept(CommonDateReturnVisitor<R> visitor) throws PersistenceException { return visitor.handleAnswerCommand(this); } public <E extends model.UserException> void accept(CommonDateExceptionVisitor<E> visitor) throws PersistenceException, E { visitor.handleAnswerCommand(this); } public <R, E extends model.UserException> R accept(CommonDateReturnExceptionVisitor<R, E> visitor) throws PersistenceException, E { return visitor.handleAnswerCommand(this); } public void accept(AnythingVisitor visitor) throws PersistenceException { visitor.handleAnswerCommand(this); } public <R> R accept(AnythingReturnVisitor<R> visitor) throws PersistenceException { return visitor.handleAnswerCommand(this); } public <E extends model.UserException> void accept(AnythingExceptionVisitor<E> visitor) throws PersistenceException, E { visitor.handleAnswerCommand(this); } public <R, E extends model.UserException> R accept(AnythingReturnExceptionVisitor<R, E> visitor) throws PersistenceException, E { return visitor.handleAnswerCommand(this); } public void accept(CommandVisitor visitor) throws PersistenceException { visitor.handleAnswerCommand(this); } public <R> R accept(CommandReturnVisitor<R> visitor) throws PersistenceException { return visitor.handleAnswerCommand(this); } public <E extends model.UserException> void accept(CommandExceptionVisitor<E> visitor) throws PersistenceException, E { visitor.handleAnswerCommand(this); } public <R, E extends model.UserException> R accept(CommandReturnExceptionVisitor<R, E> visitor) throws PersistenceException, E { return visitor.handleAnswerCommand(this); } public void accept(AccountManagerCommandVisitor visitor) throws PersistenceException { visitor.handleAnswerCommand(this); } public <R> R accept(AccountManagerCommandReturnVisitor<R> visitor) throws PersistenceException { return visitor.handleAnswerCommand(this); } public <E extends model.UserException> void accept(AccountManagerCommandExceptionVisitor<E> visitor) throws PersistenceException, E { visitor.handleAnswerCommand(this); } public <R, E extends model.UserException> R accept(AccountManagerCommandReturnExceptionVisitor<R, E> visitor) throws PersistenceException, E { return visitor.handleAnswerCommand(this); } public void checkException() throws model.UserException, PersistenceException{ ((PersistentAnswerCommand)this.getTheObject()).checkException(); } public void execute() throws PersistenceException{ ((PersistentAnswerCommand)this.getTheObject()).execute(); } public Invoker fetchInvoker() throws PersistenceException{ return ((PersistentAnswerCommand)this.getTheObject()).fetchInvoker(); } public void sendException(final PersistenceException exception) throws PersistenceException{ ((PersistentAnswerCommand)this.getTheObject()).sendException(exception); } public void sendResult() throws PersistenceException{ ((PersistentAnswerCommand)this.getTheObject()).sendResult(); } }
[ "jensburczyk96@gmail.com" ]
jensburczyk96@gmail.com
1abb46fc63e87a4106ed3d780d4095cdfe9ab1cb
db64bec77500bb4ba95f413ba0724d2dc3db5418
/game/model/src/main/java/org/civmmo/model/autogenerate/RiverImpl.java
eea9b97e71729a28ae286c5b3e8b10d17a24ec8f
[]
no_license
mattysek/Civ-mmo
bcd7ac7318019bbae377e076f0a7899ff0a779ec
3a0b0c7f1cd8ffeebcfa691c82c901152f7c59e1
refs/heads/master
2021-01-01T16:00:08.788160
2015-02-03T06:27:02
2015-02-03T06:27:02
16,487,290
0
0
null
null
null
null
UTF-8
Java
false
false
672
java
package org.civmmo.model.autogenerate; import org.civmmo.model.*; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** * Entity implementation class for Entity: River * */ public class RiverImpl extends River implements Serializable { private long id; private List<TileImpl> tiles; private static final long serialVersionUID = 1L; public RiverImpl() { super(); } public long getId() { return this.id; } public void setId(long id) { this.id = id; } public List<Tile> getTiles() { return new ArrayList<>(tiles); } public void setTiles(List<Tile> tiles) { this.tiles = (List<TileImpl>)(List<?>)tiles; } }
[ "matej.skrabanek@gmail.com" ]
matej.skrabanek@gmail.com
1f02289a5787f3867afe717a399cdb89985d5672
ffeaf567e9b1aadb4c00d95cd3df4e6484f36dcd
/Talagram/org/telegram/messenger/-$$Lambda$MessagesController$jTdTCyaMv8piU9ZLJgP2zBdvr4Y.java
f5363b4552e2f3a0ad186a2d48ac7dd747d4528f
[]
no_license
danielperez9430/Third-party-Telegram-Apps-Spy
dfe541290c8512ca366e401aedf5cc5bfcaa6c3e
f6fc0f9c677bd5d5cd3585790b033094c2f0226d
refs/heads/master
2020-04-11T23:26:06.025903
2018-12-18T10:07:20
2018-12-18T10:07:20
162,166,647
0
0
null
null
null
null
UTF-8
Java
false
false
730
java
package org.telegram.messenger; import org.telegram.tgnet.TLRPC$TL_channels_editBanned; import org.telegram.tgnet.TLRPC$TL_error; import org.telegram.ui.ActionBar.BaseFragment; public final class -$$Lambda$MessagesController$jTdTCyaMv8piU9ZLJgP2zBdvr4Y implements Runnable { public -$$Lambda$MessagesController$jTdTCyaMv8piU9ZLJgP2zBdvr4Y(MessagesController arg1, TL_error arg2, BaseFragment arg3, TL_channels_editBanned arg4, boolean arg5) { super(); this.f$0 = arg1; this.f$1 = arg2; this.f$2 = arg3; this.f$3 = arg4; this.f$4 = arg5; } public final void run() { MessagesController.lambda$null$39(this.f$0, this.f$1, this.f$2, this.f$3, this.f$4); } }
[ "dpefe@hotmail.es" ]
dpefe@hotmail.es
64af745016f33455e60e207d43abce9717c473e3
b7ba751387fe1723a3a97fa0fe6af784fa6890c0
/src/main/java/com/umuttepe/studentalumni/dao/UserJobDao.java
095cc684924fd676ade09f942cbf3cb8544185e6
[]
no_license
tepeumut/student-alumni
e707657e919f90c6ef2495b9d67dcf81e9876d14
7ba776efd5b67eaa538fb77cde634088fcf14292
refs/heads/master
2023-03-18T10:42:22.362752
2021-03-03T10:11:20
2021-03-03T10:11:20
337,565,829
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
package com.umuttepe.studentalumni.dao; import com.umuttepe.studentalumni.dao.entity.UserEntity; import com.umuttepe.studentalumni.dao.entity.UserJobEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface UserJobDao extends JpaRepository<UserJobEntity, Long> { UserJobEntity findByIdAndUser(Long id, UserEntity user); }
[ "tepeumut1@gmail.com" ]
tepeumut1@gmail.com
cc466a6d8d3582235baf729e60c177cdee66cbc1
156ee2c8a3b7cae95c86dd9b1d0d42eb89e932ef
/gooddata-java/src/main/java/com/gooddata/sdk/service/retry/GetServerErrorRetryStrategy.java
b1a6cc7fa2dd9bff947f359b3aa7b738c2735c6a
[ "BSD-3-Clause" ]
permissive
helobinvn/gooddata-java
95aceeab2177996622e0e73192e1fc699607a015
667ab62931c3f6db78f7f9fbf94943387fe9f897
refs/heads/master
2023-07-21T14:00:30.720092
2021-07-12T06:21:40
2021-07-12T06:21:40
383,708,496
0
0
NOASSERTION
2021-07-08T10:17:52
2021-07-07T07:15:50
Java
UTF-8
Java
false
false
1,015
java
/* * Copyright (C) 2007-2019, GoodData(R) Corporation. All rights reserved. * This source code is licensed under the BSD-style license found in the * LICENSE.txt file in the root directory of this source tree. */ package com.gooddata.sdk.service.retry; import java.net.URI; import java.util.Collection; import java.util.Collections; import static java.util.Arrays.asList; /** * Allows retry for GET method and some HTTP 5XX states mentioned in {@link GetServerErrorRetryStrategy#RETRYABLE_STATES}. */ public class GetServerErrorRetryStrategy implements RetryStrategy { public static final Collection<Integer> RETRYABLE_STATES = Collections.unmodifiableCollection(asList(500, 502, 503, 504, 507)); public static final Collection<String> RETRYABLE_METHODS = Collections.unmodifiableCollection(asList("GET")); @Override public boolean retryAllowed(String method, int statusCode, URI uri) { return RETRYABLE_STATES.contains(statusCode) && RETRYABLE_METHODS.contains(method); } }
[ "adam.stulpa@gooddata.com" ]
adam.stulpa@gooddata.com
46e9267730092894a8e5e1fa56d43605435c0bad
0524570edad83d4727c413904ab3afdd096674d1
/hadoop-2.6.5-src/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileStatus.java
1c9aff028802b8455ea59fcfcf43e1a2250b9501
[ "LicenseRef-scancode-unknown", "BSD-3-Clause", "BSD-2-Clause-Views", "LicenseRef-scancode-protobuf", "CDDL-1.0", "CDDL-1.1", "MIT", "EPL-1.0", "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "BSD-2-Clause", "Classpath-exception-2.0", "LGPL-2.1-only", "LicenseRef-scancode-oth...
permissive
lsds/sgx-spark
559426f71be03ad3cd12ac4856fb1af686f2c64c
7ce0009050b30ba63e5090635925fbe86f5a3e2d
refs/heads/v1
2023-08-22T16:48:53.818334
2019-04-24T16:51:01
2019-04-24T16:51:01
179,549,243
25
9
Apache-2.0
2022-12-05T23:36:45
2019-04-04T17:58:03
Java
UTF-8
Java
false
false
12,727
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.hdfs; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Random; import java.util.concurrent.TimeoutException; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.impl.Log4JLogger; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileContext; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.RemoteIterator; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hdfs.protocol.HdfsConstants; import org.apache.hadoop.hdfs.protocol.HdfsFileStatus; import org.apache.hadoop.hdfs.server.namenode.FSNamesystem; import org.apache.hadoop.hdfs.server.namenode.NameNode; import org.apache.hadoop.hdfs.web.HftpFileSystem; import org.apache.hadoop.ipc.RemoteException; import org.apache.hadoop.security.UserGroupInformation; import org.apache.log4j.Level; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; /** * This class tests the FileStatus API. */ public class TestFileStatus { { ((Log4JLogger)LogFactory.getLog(FSNamesystem.class)).getLogger().setLevel(Level.ALL); ((Log4JLogger)FileSystem.LOG).getLogger().setLevel(Level.ALL); } static final long seed = 0xDEADBEEFL; static final int blockSize = 8192; static final int fileSize = 16384; private static Configuration conf; private static MiniDFSCluster cluster; private static FileSystem fs; private static FileContext fc; private static HftpFileSystem hftpfs; private static DFSClient dfsClient; private static Path file1; @BeforeClass public static void testSetUp() throws Exception { conf = new HdfsConfiguration(); conf.setInt(DFSConfigKeys.DFS_LIST_LIMIT, 2); cluster = new MiniDFSCluster.Builder(conf).build(); fs = cluster.getFileSystem(); fc = FileContext.getFileContext(cluster.getURI(0), conf); hftpfs = cluster.getHftpFileSystem(0); dfsClient = new DFSClient(NameNode.getAddress(conf), conf); file1 = new Path("filestatus.dat"); writeFile(fs, file1, 1, fileSize, blockSize); } @AfterClass public static void testTearDown() throws Exception { fs.close(); cluster.shutdown(); } private static void writeFile(FileSystem fileSys, Path name, int repl, int fileSize, int blockSize) throws IOException { // Create and write a file that contains three blocks of data FSDataOutputStream stm = fileSys.create(name, true, HdfsConstants.IO_FILE_BUFFER_SIZE, (short)repl, (long)blockSize); byte[] buffer = new byte[fileSize]; Random rand = new Random(seed); rand.nextBytes(buffer); stm.write(buffer); stm.close(); } private void checkFile(FileSystem fileSys, Path name, int repl) throws IOException, InterruptedException, TimeoutException { DFSTestUtil.waitReplication(fileSys, name, (short) repl); } /** Test calling getFileInfo directly on the client */ @Test public void testGetFileInfo() throws IOException { // Check that / exists Path path = new Path("/"); assertTrue("/ should be a directory", fs.getFileStatus(path).isDirectory()); // Make sure getFileInfo returns null for files which do not exist HdfsFileStatus fileInfo = dfsClient.getFileInfo("/noSuchFile"); assertEquals("Non-existant file should result in null", null, fileInfo); Path path1 = new Path("/name1"); Path path2 = new Path("/name1/name2"); assertTrue(fs.mkdirs(path1)); FSDataOutputStream out = fs.create(path2, false); out.close(); fileInfo = dfsClient.getFileInfo(path1.toString()); assertEquals(1, fileInfo.getChildrenNum()); fileInfo = dfsClient.getFileInfo(path2.toString()); assertEquals(0, fileInfo.getChildrenNum()); // Test getFileInfo throws the right exception given a non-absolute path. try { dfsClient.getFileInfo("non-absolute"); fail("getFileInfo for a non-absolute path did not throw IOException"); } catch (RemoteException re) { assertTrue("Wrong exception for invalid file name", re.toString().contains("Invalid file name")); } } /** Test the FileStatus obtained calling getFileStatus on a file */ @Test public void testGetFileStatusOnFile() throws Exception { checkFile(fs, file1, 1); // test getFileStatus on a file FileStatus status = fs.getFileStatus(file1); assertFalse(file1 + " should be a file", status.isDirectory()); assertEquals(blockSize, status.getBlockSize()); assertEquals(1, status.getReplication()); assertEquals(fileSize, status.getLen()); assertEquals(file1.makeQualified(fs.getUri(), fs.getWorkingDirectory()).toString(), status.getPath().toString()); } /** Test the FileStatus obtained calling listStatus on a file */ @Test public void testListStatusOnFile() throws IOException { FileStatus[] stats = fs.listStatus(file1); assertEquals(1, stats.length); FileStatus status = stats[0]; assertFalse(file1 + " should be a file", status.isDirectory()); assertEquals(blockSize, status.getBlockSize()); assertEquals(1, status.getReplication()); assertEquals(fileSize, status.getLen()); assertEquals(file1.makeQualified(fs.getUri(), fs.getWorkingDirectory()).toString(), status.getPath().toString()); RemoteIterator<FileStatus> itor = fc.listStatus(file1); status = itor.next(); assertEquals(stats[0], status); assertFalse(file1 + " should be a file", status.isDirectory()); } /** Test getting a FileStatus object using a non-existant path */ @Test public void testGetFileStatusOnNonExistantFileDir() throws IOException { Path dir = new Path("/test/mkdirs"); try { fs.listStatus(dir); fail("listStatus of non-existent path should fail"); } catch (FileNotFoundException fe) { assertEquals("File " + dir + " does not exist.",fe.getMessage()); } try { fc.listStatus(dir); fail("listStatus of non-existent path should fail"); } catch (FileNotFoundException fe) { assertEquals("File " + dir + " does not exist.", fe.getMessage()); } try { fs.getFileStatus(dir); fail("getFileStatus of non-existent path should fail"); } catch (FileNotFoundException fe) { assertTrue("Exception doesn't indicate non-existant path", fe.getMessage().startsWith("File does not exist")); } } /** Test FileStatus objects obtained from a directory */ @Test public void testGetFileStatusOnDir() throws Exception { // Create the directory Path dir = new Path("/test/mkdirs"); assertTrue("mkdir failed", fs.mkdirs(dir)); assertTrue("mkdir failed", fs.exists(dir)); // test getFileStatus on an empty directory FileStatus status = fs.getFileStatus(dir); assertTrue(dir + " should be a directory", status.isDirectory()); assertTrue(dir + " should be zero size ", status.getLen() == 0); assertEquals(dir.makeQualified(fs.getUri(), fs.getWorkingDirectory()).toString(), status.getPath().toString()); // test listStatus on an empty directory FileStatus[] stats = fs.listStatus(dir); assertEquals(dir + " should be empty", 0, stats.length); assertEquals(dir + " should be zero size ", 0, fs.getContentSummary(dir).getLength()); assertEquals(dir + " should be zero size using hftp", 0, hftpfs.getContentSummary(dir).getLength()); RemoteIterator<FileStatus> itor = fc.listStatus(dir); assertFalse(dir + " should be empty", itor.hasNext()); // create another file that is smaller than a block. Path file2 = new Path(dir, "filestatus2.dat"); writeFile(fs, file2, 1, blockSize/4, blockSize); checkFile(fs, file2, 1); // verify file attributes status = fs.getFileStatus(file2); assertEquals(blockSize, status.getBlockSize()); assertEquals(1, status.getReplication()); file2 = fs.makeQualified(file2); assertEquals(file2.toString(), status.getPath().toString()); // Create another file in the same directory Path file3 = new Path(dir, "filestatus3.dat"); writeFile(fs, file3, 1, blockSize/4, blockSize); checkFile(fs, file3, 1); file3 = fs.makeQualified(file3); // Verify that the size of the directory increased by the size // of the two files final int expected = blockSize/2; assertEquals(dir + " size should be " + expected, expected, fs.getContentSummary(dir).getLength()); assertEquals(dir + " size should be " + expected + " using hftp", expected, hftpfs.getContentSummary(dir).getLength()); // Test listStatus on a non-empty directory stats = fs.listStatus(dir); assertEquals(dir + " should have two entries", 2, stats.length); assertEquals(file2.toString(), stats[0].getPath().toString()); assertEquals(file3.toString(), stats[1].getPath().toString()); itor = fc.listStatus(dir); assertEquals(file2.toString(), itor.next().getPath().toString()); assertEquals(file3.toString(), itor.next().getPath().toString()); assertFalse("Unexpected addtional file", itor.hasNext()); // Test iterative listing. Now dir has 2 entries, create one more. Path dir3 = fs.makeQualified(new Path(dir, "dir3")); fs.mkdirs(dir3); dir3 = fs.makeQualified(dir3); stats = fs.listStatus(dir); assertEquals(dir + " should have three entries", 3, stats.length); assertEquals(dir3.toString(), stats[0].getPath().toString()); assertEquals(file2.toString(), stats[1].getPath().toString()); assertEquals(file3.toString(), stats[2].getPath().toString()); itor = fc.listStatus(dir); assertEquals(dir3.toString(), itor.next().getPath().toString()); assertEquals(file2.toString(), itor.next().getPath().toString()); assertEquals(file3.toString(), itor.next().getPath().toString()); assertFalse("Unexpected addtional file", itor.hasNext()); // Now dir has 3 entries, create two more Path dir4 = fs.makeQualified(new Path(dir, "dir4")); fs.mkdirs(dir4); dir4 = fs.makeQualified(dir4); Path dir5 = fs.makeQualified(new Path(dir, "dir5")); fs.mkdirs(dir5); dir5 = fs.makeQualified(dir5); stats = fs.listStatus(dir); assertEquals(dir + " should have five entries", 5, stats.length); assertEquals(dir3.toString(), stats[0].getPath().toString()); assertEquals(dir4.toString(), stats[1].getPath().toString()); assertEquals(dir5.toString(), stats[2].getPath().toString()); assertEquals(file2.toString(), stats[3].getPath().toString()); assertEquals(file3.toString(), stats[4].getPath().toString()); itor = fc.listStatus(dir); assertEquals(dir3.toString(), itor.next().getPath().toString()); assertEquals(dir4.toString(), itor.next().getPath().toString()); assertEquals(dir5.toString(), itor.next().getPath().toString()); assertEquals(file2.toString(), itor.next().getPath().toString()); assertEquals(file3.toString(), itor.next().getPath().toString()); assertFalse(itor.hasNext()); { //test permission error on hftp fs.setPermission(dir, new FsPermission((short)0)); try { final String username = UserGroupInformation.getCurrentUser().getShortUserName() + "1"; final HftpFileSystem hftp2 = cluster.getHftpFileSystemAs(username, conf, 0, "somegroup"); hftp2.getContentSummary(dir); fail(); } catch(IOException ioe) { FileSystem.LOG.info("GOOD: getting an exception", ioe); } } fs.delete(dir, true); } }
[ "fkelbert@acm.org" ]
fkelbert@acm.org
5373eb55ec3db463df3e39537363394c8385e0ff
dff27a30645072b94f499b104cd4cb68593c5199
/app/src/main/java/com/jit/shuichan/ui/message/EZMessageListAdapter2.java
e495842d2960f74a005196a7f70dac248991a17c
[]
no_license
ydBen/shuichanapp
297cef1f29f9bce816d5484152cfe1c5c8a01a7e
9c987b2a07bebdba50ca2e99358342d1706e8b65
refs/heads/master
2020-05-20T22:27:32.052378
2017-04-06T07:18:35
2017-04-06T07:18:35
84,536,323
0
2
null
null
null
null
UTF-8
Java
false
false
17,522
java
package com.jit.shuichan.ui.message; import android.app.AlertDialog; import android.content.Context; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; import android.view.View.OnCreateContextMenuListener; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.ImageView; import android.widget.TextView; import com.jit.shuichan.R; import com.jit.shuichan.ui.util.VerifyCodeInput; import com.videogo.openapi.bean.EZAlarmInfo; import com.jit.shuichan.ui.util.DataManager; import com.jit.shuichan.ui.util.EZUtils; import com.jit.shuichan.widget.PinnedSectionListView.PinnedSectionListAdapter; import java.text.DateFormat; import java.text.DateFormatSymbols; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.Set; //import com.videogo.leavemessage.LeaveMessageItem; public class EZMessageListAdapter2 extends BaseAdapter implements View.OnClickListener, OnCreateContextMenuListener, OnCheckedChangeListener, PinnedSectionListAdapter { /** 删除菜单 */ public static final int MENU_DEL_ID = Menu.FIRST + 1; /** 更多菜单 */ public static final int MENU_MORE_ID = Menu.FIRST + 2; private AlertDialog mAlertDialog; private MyVerifyCodeInputListener mMyVerifyCodeInputListener; private VerifyCodeInput.VerifyCodeErrorListener mMyVerifyCodeErrorListener; private boolean isShowVerifyCodeDialog = true; private class ViewHolder { CheckBox check; TextView timeText; ImageView image; TextView fromTip; TextView from; TextView type; ViewGroup layout; ImageView unread; } private final DateFormat mDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()); private final String[] mWeekdayNames = DateFormatSymbols.getInstance(Locale.getDefault()).getWeekdays(); private Context mContext; private List<Object> mObjects; private Map<String, Boolean> mCheckStates = new HashMap<String, Boolean>(); private Calendar mLastDate; private String mDeviceSerial; /** 监听对象 */ private OnClickListener mOnClickListener; private boolean mCheckMode; private boolean mNoMenu; private boolean mDataSetChanged; private EZMessageListAdapter2(Context context, String deviceSerial, VerifyCodeInput.VerifyCodeErrorListener verifyCodeErrorListener) { mContext = context; mDeviceSerial = deviceSerial; mMyVerifyCodeInputListener = new MyVerifyCodeInputListener(); mMyVerifyCodeErrorListener = verifyCodeErrorListener; } public EZMessageListAdapter2(Context context, List<? extends Object> list, String deviceSerial,VerifyCodeInput.VerifyCodeErrorListener verifyCodeErrorListener) { this(context, deviceSerial,verifyCodeErrorListener); mDeviceSerial = deviceSerial; setList(list); } public void setList(List<? extends Object> list) { if (list == null) { return; } List<Object> objects = new ArrayList<Object>(); Map<String, Boolean> preCheckStates = mCheckStates; mCheckStates = new HashMap<String, Boolean>(); mLastDate = null; Calendar tempDate = Calendar.getInstance(); try { // if(list.size() == 1)//mj // return; for (Object item : list) { // String id = item instanceof LeaveMessageItem ? ((LeaveMessageItem) item).getMessageId() // : ((EZAlarmInfo) item).getAlarmLogId(); // String time = item instanceof LeaveMessageItem ? ((LeaveMessageItem) item).getCreateTime() // : ((EZAlarmInfo) item).getAlarmStartTime(); String id = ((EZAlarmInfo) item).getAlarmId(); //mj String time = ((EZAlarmInfo) item).getAlarmStartTime(); String time = ((EZAlarmInfo) item).getAlarmStartTime(); try { tempDate.setTime(mDateFormat.parse(time)); } catch (ParseException e) { //tempDate.setTime(mDateFormat.parse(time)); e.printStackTrace(); } if (mLastDate == null || !isSameDate(mLastDate, tempDate)) { mLastDate = (Calendar) tempDate.clone(); objects.add(mLastDate); } objects.add(item); Boolean check = preCheckStates.get(id); if (check != null && check) mCheckStates.put(id, true); } } catch (Exception e) { } mObjects = objects; } private boolean isSameDate(Calendar firstDate, Calendar secondDate) { return (firstDate.get(Calendar.DAY_OF_YEAR) == secondDate.get(Calendar.DAY_OF_YEAR) && firstDate .get(Calendar.YEAR) == secondDate.get(Calendar.YEAR)); } public void setOnClickListener(OnClickListener l) { mOnClickListener = l; } public void setNoMenu(boolean noMenu) { mNoMenu = noMenu; } public void setCheckMode(boolean checkMode) { if (mCheckMode != checkMode) { mCheckMode = checkMode; if (!checkMode) { uncheckAll(); } } } public boolean isCheckAll() { for (Object item : mObjects) { String id = null; if (item instanceof EZAlarmInfo) id = ((EZAlarmInfo) item).getAlarmId(); // else if (item instanceof LeaveMessageItem) // id = ((LeaveMessageItem) item).getMessageId(); if (id != null) { Boolean check = mCheckStates.get(id); if (check == null || !check) return false; } } return true; } public void checkAll() { for (Object item : mObjects) { String id = null; if (item instanceof EZAlarmInfo) id = ((EZAlarmInfo) item).getAlarmId(); // else if (item instanceof LeaveMessageItem) // id = ((LeaveMessageItem) item).getMessageId(); if (id != null) mCheckStates.put(id, true); } notifyDataSetChanged(); } public void uncheckAll() { mCheckStates.clear(); notifyDataSetChanged(); } public List<String> getCheckedIds() { List<String> ids = new ArrayList<String>(); Set<Entry<String, Boolean>> entries = mCheckStates.entrySet(); for (Entry<String, Boolean> entry : entries) { if (entry.getValue() != null && entry.getValue()) ids.add(entry.getKey()); } return ids; } @Override public int getCount() { return mObjects.size(); } @Override public int getViewTypeCount() { return 2; } @Override public int getItemViewType(int position) { return (mObjects.get(position) instanceof Calendar) ? 0 : 1; } @Override public boolean isItemViewTypePinned(int viewType) { return viewType == 0; } @Override public Object getItem(int position) { return mObjects.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { int viewType = getItemViewType(position); final ViewHolder viewHolder; if (convertView == null) { viewHolder = new ViewHolder(); if (viewType == 0) { convertView = LayoutInflater.from(mContext).inflate(R.layout.ez_message_list_section, parent, false); // 获取控件对象 viewHolder.timeText = (TextView) convertView.findViewById(R.id.message_time); } else { convertView = LayoutInflater.from(mContext).inflate(R.layout.ez_message_list_item, parent, false); // 获取控件对象 viewHolder.check = (CheckBox) convertView.findViewById(R.id.message_check); viewHolder.timeText = (TextView) convertView.findViewById(R.id.message_time); viewHolder.layout = (ViewGroup) convertView.findViewById(R.id.message_layout); viewHolder.image = (ImageView) convertView.findViewById(R.id.message_image); viewHolder.fromTip = (TextView) convertView.findViewById(R.id.message_from_tip); viewHolder.from = (TextView) convertView.findViewById(R.id.message_from); viewHolder.type = (TextView) convertView.findViewById(R.id.message_type); viewHolder.unread = (ImageView) convertView.findViewById(R.id.message_unread); // 点击弹出菜单的监听 viewHolder.layout.setOnCreateContextMenuListener(this); // 内容区域的点击响应 viewHolder.layout.setOnClickListener(this); viewHolder.check.setOnClickListener(this); viewHolder.check.setOnCheckedChangeListener(this); } // 设置控件集到convertView convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } if (viewType == 0) { // 获取数据 Calendar date = (Calendar) getItem(position); String displayText; if (isSameDate(date, Calendar.getInstance())) { displayText = mContext.getString(R.string.today); } else { displayText = (date.get(Calendar.MONTH) + 1) + mContext.getString(R.string.month) + date.get(Calendar.DAY_OF_MONTH) + mContext.getString(R.string.day) + ' ' + mWeekdayNames[date.get(Calendar.DAY_OF_WEEK)]; } viewHolder.timeText.setText(displayText); } else { // 设置position viewHolder.layout.setTag(R.id.tag_key_position, position); viewHolder.check.setTag(R.id.tag_key_position, position); viewHolder.check.setVisibility(mCheckMode ? View.VISIBLE : View.GONE); Object item = getItem(position); if (item instanceof EZAlarmInfo) { EZAlarmInfo alarmLogInfo = (EZAlarmInfo) item; if (mCheckMode) { Boolean checked = mCheckStates.get(alarmLogInfo.getAlarmId()); viewHolder.check.setChecked(checked == null ? false : checked); } // 消息类型 // AlarmType alarmType = alarmLogInfo.getEnumAlarmType(); // // viewHolder.type.setText(alarmType == AlarmType.DOORBELL_ALARM ? alarmLogInfo.getSampleName() : mContext // .getString(alarmType.getTextResId())); AlarmType alarmType = AlarmType.BODY_ALARM; viewHolder.type.setText(mContext.getString(alarmType.getTextResId())); // 消息来源 viewHolder.from.setText(alarmLogInfo.getAlarmName()); // 消息时间 if (alarmLogInfo.getAlarmStartTime() != null) viewHolder.timeText.setText(alarmLogInfo.getAlarmStartTime().split(" ")[1]); else viewHolder.timeText.setText(null); // 消息查看状态 viewHolder.unread.setVisibility(alarmLogInfo.getIsRead() == 0 ? View.VISIBLE : View.INVISIBLE); //mj AlarmLogInfo relAlarm = alarmLogInfo.getRelationAlarms(); EZAlarmInfo relAlarm = null; // 消息图片 //boolean detector_ipc_link = relAlarm.getEnumAlarmType() == AlarmType.DETECTOR_IPC_LINK; boolean detector_ipc_link = false; boolean alarm_has_camera = true; if (detector_ipc_link) { if (!mDataSetChanged) { EZUtils.loadImage(mContext, viewHolder.image, alarmLogInfo.getAlarmPicUrl(),mDeviceSerial,mMyVerifyCodeErrorListener); } } else if (alarm_has_camera) { if (!mDataSetChanged) { EZUtils.loadImage(mContext, viewHolder.image, alarmLogInfo.getAlarmPicUrl(), mDeviceSerial,mMyVerifyCodeErrorListener); } } else { viewHolder.image.setBackgroundResource(R.drawable.message_a1_bg); viewHolder.image.setImageResource(alarmType.getDrawableResId()); } } /*else if (item instanceof LeaveMessageItem) { LeaveMessageItem leaveMessage = (LeaveMessageItem) item; if (mCheckMode) { Boolean checked = mCheckStates.get(leaveMessage.getMessageId()); viewHolder.check.setChecked(checked == null ? false : checked); } // 消息类型 viewHolder.type.setText(R.string.video_leave_message); // 消息来源 viewHolder.from.setText(leaveMessage.getDeviceName()); // 消息时间 if (leaveMessage.getCreateTime() != null) viewHolder.timeText.setText(leaveMessage.getCreateTime().split(" ")[1]); else viewHolder.timeText.setText(null); // 消息查看状态 viewHolder.unread.setVisibility(leaveMessage.getStatus() == 0 ? View.VISIBLE : View.INVISIBLE); // 消息图片 mImageLoader.cancelDisplayTask(viewHolder.image); viewHolder.image.setImageResource(R.drawable.message_f1); viewHolder.imageProgress.setVisibility(View.GONE); }*/ } return convertView; } class MyVerifyCodeInputListener implements VerifyCodeInput.VerifyCodeInputListener{ @Override public void onInputVerifyCode(String verifyCode) { DataManager.getInstance().setDeviceSerialVerifyCode(mDeviceSerial,verifyCode); notifyDataSetChanged(); } } public void setVerifyCodeDialog(){ DataManager.getInstance().setDeviceSerialVerifyCode(mDeviceSerial,null); if (isShowVerifyCodeDialog){ isShowVerifyCodeDialog = false; if (mAlertDialog == null){ mAlertDialog = VerifyCodeInput.VerifyCodeInputDialog(mContext,mMyVerifyCodeInputListener); } if (!mAlertDialog.isShowing()){ mAlertDialog.show(); } } } @Override public void onClick(View v) { int position; switch (v.getId()) { case R.id.message_layout: position = (Integer) v.getTag(R.id.tag_key_position); if (mCheckMode) { CheckBox checkBox = (CheckBox) v.findViewById(R.id.message_check); checkBox.toggle(); if (mOnClickListener != null) mOnClickListener .onCheckClick(EZMessageListAdapter2.this, checkBox, position, checkBox.isChecked()); } else { if (mOnClickListener != null) mOnClickListener.onItemClick(EZMessageListAdapter2.this, v, position); } break; case R.id.message_check: position = (Integer) v.getTag(R.id.tag_key_position); boolean check = ((CheckBox) v).isChecked(); if (mOnClickListener != null) mOnClickListener.onCheckClick(EZMessageListAdapter2.this, v, position, check); break; } } @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { if (!mCheckMode && !mNoMenu) { menu.add(Menu.NONE, MENU_DEL_ID, Menu.NONE, mContext.getString(R.string.delete)); int position = (Integer) v.getTag(R.id.tag_key_position); // menu.add(Menu.NONE, MENU_MORE_ID, Menu.NONE, mContext.getString(R.string.tab_more)); if (mOnClickListener != null) mOnClickListener.onItemLongClick(EZMessageListAdapter2.this, v, position); } } @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { int position = (Integer) buttonView.getTag(R.id.tag_key_position); Object item = getItem(position); if (item instanceof EZAlarmInfo) mCheckStates.put(((EZAlarmInfo) item).getAlarmId(), isChecked); } public interface OnClickListener { public void onCheckClick(BaseAdapter adapter, View view, int position, boolean checked); public void onItemLongClick(BaseAdapter adapter, View view, int position); public void onItemClick(BaseAdapter adapter, View view, int position); } }
[ "18951799052@163.com" ]
18951799052@163.com
877da0787732a3750c4c1a4258c8dba28784d2d7
df9c19da027f7d714e939cbfa92053eb70d92af4
/jj-service-web/src/main/java/com/xnjr/home/front/req/XN806142Req.java
052e7c6167753f7f9224700b5ba78682777c4006
[]
no_license
chaofanHb/jj-service-web
1d84d5b4f324f3c6eab40ed7674a337ab0640111
e8d7581d56b7e499e3b6654205317ef9d98d8201
refs/heads/master
2021-06-12T03:23:37.304825
2016-11-14T06:26:06
2016-11-14T06:26:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
350
java
package com.xnjr.home.front.req; public class XN806142Req { private String code; private String userId; public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } }
[ "291157472@qq.com" ]
291157472@qq.com
17bbc9f686438d7638862240a4c3f76bc50ab6e8
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_d97c9b6052fb0542e672453231da8be59a97dcff/ZoneRenderer/4_d97c9b6052fb0542e672453231da8be59a97dcff_ZoneRenderer_s.java
9857d2b6d48aa1082d8df002d9557e10f18cc44a
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
100,868
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.rptools.maptool.client.ui.zone; import java.awt.AlphaComposite; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Composite; import java.awt.Dimension; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Paint; import java.awt.Point; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.Stroke; import java.awt.Transparency; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; import java.awt.dnd.DnDConstants; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; import java.awt.dnd.DropTargetListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; import java.awt.geom.AffineTransform; import java.awt.geom.Area; import java.awt.geom.GeneralPath; import java.awt.geom.QuadCurve2D; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.awt.image.ImageObserver; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Map.Entry; import javax.swing.JComponent; import javax.swing.SwingUtilities; import javax.swing.Timer; import net.rptools.lib.MD5Key; import net.rptools.lib.image.ImageUtil; import net.rptools.lib.swing.ImageBorder; import net.rptools.lib.swing.ImageLabel; import net.rptools.lib.swing.SwingUtil; import net.rptools.maptool.client.AppActions; import net.rptools.maptool.client.AppPreferences; import net.rptools.maptool.client.AppState; import net.rptools.maptool.client.AppStyle; import net.rptools.maptool.client.AppUtil; import net.rptools.maptool.client.MapTool; import net.rptools.maptool.client.MapToolUtil; import net.rptools.maptool.client.ScreenPoint; import net.rptools.maptool.client.TransferableHelper; import net.rptools.maptool.client.TransferableToken; import net.rptools.maptool.client.ui.Scale; import net.rptools.maptool.client.ui.token.AbstractTokenOverlay; import net.rptools.maptool.client.ui.token.BarTokenOverlay; import net.rptools.maptool.client.ui.token.NewTokenDialog; import net.rptools.maptool.client.ui.token.TokenTemplate; import net.rptools.maptool.client.walker.ZoneWalker; import net.rptools.maptool.model.Asset; import net.rptools.maptool.model.AssetManager; import net.rptools.maptool.model.CellPoint; import net.rptools.maptool.model.GUID; import net.rptools.maptool.model.Grid; import net.rptools.maptool.model.GridCapabilities; import net.rptools.maptool.model.Label; import net.rptools.maptool.model.ModelChangeEvent; import net.rptools.maptool.model.ModelChangeListener; import net.rptools.maptool.model.Path; import net.rptools.maptool.model.Player; import net.rptools.maptool.model.Token; import net.rptools.maptool.model.TokenFootprint; import net.rptools.maptool.model.Zone; import net.rptools.maptool.model.ZonePoint; import net.rptools.maptool.model.drawing.DrawableTexturePaint; import net.rptools.maptool.model.drawing.DrawnElement; import net.rptools.maptool.util.GraphicsUtil; import net.rptools.maptool.util.ImageManager; import net.rptools.maptool.util.StringUtil; import net.rptools.maptool.util.TokenUtil; /** */ public class ZoneRenderer extends JComponent implements DropTargetListener, Comparable { private static final long serialVersionUID = 3832897780066104884L; public static final int MIN_GRID_SIZE = 10; protected Zone zone; private ZoneView zoneView; private Scale zoneScale; private DrawableRenderer backgroundDrawableRenderer = new PartitionedDrawableRenderer(); private DrawableRenderer objectDrawableRenderer = new BackBufferDrawableRenderer(); private DrawableRenderer tokenDrawableRenderer = new BackBufferDrawableRenderer(); private DrawableRenderer gmDrawableRenderer = new BackBufferDrawableRenderer(); private List<ZoneOverlay> overlayList = new ArrayList<ZoneOverlay>(); private Map<Zone.Layer , List<TokenLocation>> tokenLocationMap = new HashMap<Zone.Layer, List<TokenLocation>>(); private Set<GUID> selectedTokenSet = new HashSet<GUID>(); private List<Set<GUID>> selectedTokenSetHistory = new ArrayList<Set<GUID>>(); private List<LabelLocation> labelLocationList = new LinkedList<LabelLocation>(); private Set<Area> coveredTokenSet = new HashSet<Area>(); private Map<GUID, SelectionSet> selectionSetMap = new HashMap<GUID, SelectionSet>(); private Map<Token, TokenLocation> tokenLocationCache = new HashMap<Token, TokenLocation>(); private List<TokenLocation> markerLocationList = new ArrayList<TokenLocation>(); private GeneralPath facingArrow; private List<Token> showPathList = new ArrayList<Token>(); // Optimizations private Map<Token, BufferedImage> replacementImageMap = new HashMap<Token, BufferedImage>(); private Token tokenUnderMouse; private ScreenPoint pointUnderMouse; private Zone.Layer activeLayer; private Timer repaintTimer; private String loadingProgress; private boolean isLoaded; private BufferedImage fogBuffer; private boolean flushFog = true; private BufferedImage miniImage; private BufferedImage backbuffer; private boolean drawBackground = true; private int lastX; private int lastY; private BufferedImage cellShape; private double lastScale; private Area visibleScreenArea; // I don't like this, at all, but it'll work for now, basically keep track of when the fog cache // needs to be flushed in the case of switching views private PlayerView lastView; public ZoneRenderer(Zone zone) { if (zone == null) { throw new IllegalArgumentException("Zone cannot be null"); } this.zone = zone; zone.addModelChangeListener(new ZoneModelChangeListener()); setFocusable(true); setZoneScale(new Scale()); zoneView = new ZoneView(zone); // DnD new DropTarget(this, this); // Focus addMouseListener(new MouseAdapter(){ public void mousePressed(MouseEvent e) { requestFocusInWindow(); } @Override public void mouseExited(MouseEvent e) { pointUnderMouse = null; } @Override public void mouseEntered(MouseEvent e) { } }); addMouseMotionListener(new MouseMotionAdapter() { @Override public void mouseMoved(MouseEvent e) { pointUnderMouse = new ScreenPoint(e.getX(), e.getY()); } }); // fps.start(); } public void setRepaintTimer(Timer timer) { repaintTimer = timer; } public void showPath(Token token, boolean show) { if (show) { showPathList.add(token); } else { showPathList.remove(token); } } public ZonePoint getCenterPoint() { return new ScreenPoint(getSize().width/2, getSize().height/2).convertToZone(this); } public boolean isPathShowing(Token token) { return showPathList.contains(token); } public void clearShowPaths() { showPathList.clear(); repaint(); } public Scale getZoneScale() { return zoneScale; } public void setZoneScale(Scale scale) { zoneScale = scale; scale.addPropertyChangeListener (new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (Scale.PROPERTY_SCALE.equals(evt.getPropertyName())) { tokenLocationCache.clear(); flushFog = true; } if (Scale.PROPERTY_OFFSET.equals(evt.getPropertyName())) { // flushFog = true; } visibleScreenArea = null; repaint(); } }); } /** * I _hate_ this method. But couldn't think of a better way to tell the drawable renderer that a new image had arrived * TODO: FIX THIS ! Perhaps add a new app listener for when new images show up, add the drawable renderer as a listener */ public void flushDrawableRenderer() { backgroundDrawableRenderer.flush (); objectDrawableRenderer.flush(); tokenDrawableRenderer.flush(); gmDrawableRenderer.flush(); } public ScreenPoint getPointUnderMouse() { return pointUnderMouse; } public void setMouseOver(Token token) { if (tokenUnderMouse == token) { return; } tokenUnderMouse = token; repaint(); } @Override public boolean isOpaque() { return false; } public void addMoveSelectionSet (String playerId, GUID keyToken, Set<GUID> tokenList, boolean clearLocalSelected) { // I'm not supposed to be moving a token when someone else is already moving it if (clearLocalSelected) { for (GUID guid : tokenList) { selectedTokenSet.remove (guid); } } selectionSetMap.put (keyToken, new SelectionSet(playerId, keyToken, tokenList)); repaint(); } public boolean hasMoveSelectionSetMoved(GUID keyToken, ZonePoint point) { SelectionSet set = selectionSetMap.get (keyToken); if (set == null) { return false; } Token token = zone.getToken(keyToken); int x = point.x - token.getX(); int y = point.y - token.getY (); return set.offsetX != x || set.offsetY != y; } public void updateMoveSelectionSet (GUID keyToken, ZonePoint offset) { SelectionSet set = selectionSetMap.get(keyToken); if (set == null) { return; } Token token = zone.getToken(keyToken); // int tokenWidth = (int)(TokenSize.getWidth(token, zone.getGrid().getSize()) * getScale()); // int tokenHeight = (int)(TokenSize.getHeight(token, zone.getGrid().getSize()) * getScale()); // // // figure out screen bounds // ScreenPoint tsp = ScreenPoint.fromZonePoint(this, token.getX(), token.getY()); // ScreenPoint dsp = ScreenPoint.fromZonePoint(this, offset.x, offset.y); // ScreenPoint osp = ScreenPoint.fromZonePoint(this, token.getX() + set.offsetX, token.getY() + set.offsetY ); // // int strWidth = SwingUtilities.computeStringWidth(fontMetrics, set.getPlayerId()); // // int x = Math.min(tsp.x, dsp.x) - strWidth/2-4/*playername*/; // int y = Math.min (tsp.y, dsp.y); // int width = Math.abs(tsp.x - dsp.x)+ tokenWidth + strWidth+8/*playername*/; // int height = Math.abs(tsp.y - dsp.y)+ tokenHeight + 45/*labels*/; // Rectangle newBounds = new Rectangle(x, y, width, height); // // x = Math.min(tsp.x, osp.x) - strWidth/2-4/*playername*/; // y = Math.min(tsp.y, osp.y); // width = Math.abs(tsp.x - osp.x)+ tokenWidth + strWidth+8/*playername*/; // height = Math.abs(tsp.y - osp.y)+ tokenHeight + 45/*labels*/; // Rectangle oldBounds = new Rectangle(x, y, width, height); // // newBounds = newBounds.union(oldBounds); // set.setOffset (offset.x - token.getX(), offset.y - token.getY()); //repaint(newBounds.x, newBounds.y, newBounds.width, newBounds.height); repaint(); } public void toggleMoveSelectionSetWaypoint(GUID keyToken, ZonePoint location) { SelectionSet set = selectionSetMap.get(keyToken); if (set == null) { return; } set.toggleWaypoint(location); repaint(); } public void removeMoveSelectionSet (GUID keyToken) { SelectionSet set = selectionSetMap.remove(keyToken); if (set == null) { return; } repaint(); } public void commitMoveSelectionSet (GUID keyTokenId) { // TODO: Quick hack to handle updating server state SelectionSet set = selectionSetMap.get(keyTokenId); removeMoveSelectionSet(keyTokenId); MapTool.serverCommand().stopTokenMove(getZone().getId(), keyTokenId); Token keyToken = zone.getToken(keyTokenId); CellPoint originPoint = zone.getGrid().convert(new ZonePoint(keyToken.getX (), keyToken.getY())); Path path = set.getWalker() != null ? set.getWalker().getPath() : set.gridlessPath != null ? set.gridlessPath : null; for (GUID tokenGUID : set.getTokens()) { Token token = zone.getToken (tokenGUID); CellPoint tokenCell = zone.getGrid().convert(new ZonePoint(token.getX(), token.getY())); int cellOffX = originPoint.x - tokenCell.x; int cellOffY = originPoint.y - tokenCell.y; token.applyMove(set.getOffsetX(), set.getOffsetY(), path != null ? path.derive(cellOffX, cellOffY) : null); // No longer need this version replacementImageMap.remove(token); flush(token); MapTool.serverCommand().putToken(zone.getId(), token); zone.putToken(token); } MapTool.getFrame().updateTokenTree(); } public boolean isTokenMoving(Token token) { for (SelectionSet set : selectionSetMap.values()) { if (set.contains(token)) { return true; } } return false; } protected void setViewOffset(int x, int y) { zoneScale.setOffset(x, y); } public void centerOn(ZonePoint point) { int x = point.x; int y = point.y; x = getSize().width/2 - (int)(x*getScale())-1; y = getSize().height/2 - (int)(y*getScale())-1; setViewOffset(x, y); repaint(); } public void centerOn(CellPoint point) { centerOn(zone.getGrid().convert(point)); } public void flush(Token token) { tokenLocationCache.remove(token); // This should be smarter, but whatever visibleScreenArea = null; flushFog = true; } public ZoneView getZoneView() { return zoneView; } /** * Clear internal caches and backbuffers */ public void flush() { if (zone.getBackgroundPaint() instanceof DrawableTexturePaint) { ImageManager.flushImage(((DrawableTexturePaint)zone.getBackgroundPaint()).getAssetId()); } ImageManager.flushImage(zone.getMapAssetId()); flushDrawableRenderer(); replacementImageMap.clear(); fogBuffer = null; isLoaded = false; } public void flushFog() { flushFog = true; repaint(); } public Zone getZone() { return zone; } public void addOverlay(ZoneOverlay overlay) { overlayList.add(overlay); } public void removeOverlay(ZoneOverlay overlay) { overlayList.remove(overlay); } public void moveViewBy(int dx, int dy) { setViewOffset(getViewOffsetX() + dx, getViewOffsetY() + dy); } public void zoomReset() { zoneScale.reset(); MapTool.getFrame().getZoomStatusBar().update(); } public void zoomIn(int x, int y) { zoneScale.zoomIn(x, y); MapTool.getFrame().getZoomStatusBar().update(); } public void zoomOut(int x, int y) { zoneScale.zoomOut(x, y); MapTool.getFrame().getZoomStatusBar().update(); } public void setView(int x, int y, double scale) { setViewOffset(x, y); zoneScale.setScale(scale); MapTool.getFrame().getZoomStatusBar().update(); } public BufferedImage getMiniImage(int size) { // if (miniImage == null && getTileImage() != ImageManager.UNKNOWN_IMAGE) { // miniImage = new BufferedImage(size, size, Transparency.OPAQUE); // Graphics2D g = miniImage.createGraphics(); // g.setPaint(new TexturePaint(getTileImage(), new Rectangle(0, 0, miniImage.getWidth(), miniImage.getHeight()))); // g.fillRect(0, 0, size, size); // g.dispose(); // } return miniImage; } public void paintComponent(Graphics g) { if (repaintTimer != null) { repaintTimer.restart(); } Graphics2D g2d = (Graphics2D) g; Player.Role role = MapTool.getPlayer().getRole(); if (role == Player.Role.GM && AppState.isShowAsPlayer()) { role = Player.Role.PLAYER; } renderZone(g2d, new PlayerView(role)); if (!zone.isVisible()) { GraphicsUtil.drawBoxedString(g2d, "Map not visible to players", getSize().width/2, 20); } if (AppState.isShowAsPlayer()) { GraphicsUtil.drawBoxedString(g2d, "Player View", getSize().width/2, 20); } } public void renderZone(Graphics2D g2d, PlayerView view) { g2d.setFont(AppStyle.labelFont); Object oldAA = SwingUtil.useAntiAliasing(g2d); // Are we still waiting to show the zone ? if (isLoading()) { Dimension size = getSize(); g2d.setColor(Color.black); g2d.fillRect(0, 0, size.width , size.height); GraphicsUtil.drawBoxedString(g2d, loadingProgress, size.width/2, size.height/2); return; } if (MapTool.getCampaign ().isBeingSerialized()) { Dimension size = getSize(); g2d.setColor(Color.black); g2d.fillRect(0, 0, size.width, size.height); GraphicsUtil.drawBoxedString (g2d, " Please Wait ", size.width/2, size.height/2); return; } if (zone == null) { return; } // Clear internal state tokenLocationMap.clear(); coveredTokenSet.clear(); markerLocationList.clear(); // Calculations if (zoneView.isUsingVision() && zoneView.getVisibleArea(view) != null && visibleScreenArea == null) { AffineTransform af = new AffineTransform(); af.translate(zoneScale.getOffsetX(), zoneScale.getOffsetY()); af.scale(getScale(), getScale()); visibleScreenArea = zoneView.getVisibleArea(view).createTransformedArea(af); } // Rendering pipeline renderBoard(g2d, view); renderDrawableOverlay(g2d, backgroundDrawableRenderer, view, zone.getBackgroundDrawnElements()); renderTokens(g2d, zone.getBackgroundStamps(), view); renderDrawableOverlay(g2d, objectDrawableRenderer, view, zone.getObjectDrawnElements()); renderLights(g2d, view); renderTokenTemplates(g2d, view); renderGrid(g2d, view); if (view.isGMView()) { renderTokens(g2d, zone.getGMStamps(), view); renderDrawableOverlay(g2d, gmDrawableRenderer, view, zone.getGMDrawnElements()); } renderTokens(g2d, zone.getStampTokens(), view); renderDrawableOverlay(g2d, tokenDrawableRenderer, view, zone.getDrawnElements()); renderPlayerVisionOverlay(g2d, view); renderTokens(g2d, zone.getTokens(), view); renderMoveSelectionSets(g2d, view); renderLabels(g2d, view); renderFog(g2d, view); renderGMVisionOverlay(g2d, view); for (int i = 0; i < overlayList.size(); i++) { ZoneOverlay overlay = overlayList.get(i); overlay.paintOverlay(this, g2d); } renderCoordinates(g2d, view); // if (lightSourceArea != null) { // g2d.setColor(Color.yellow); // g2d.fill(lightSourceArea.createTransformedArea(AffineTransform.getScaleInstance (getScale(), getScale()))); // } // // g2d.setColor(Color.red); // for (AreaMeta meta : getTopologyAreaData().getAreaList()) { // // Area area = new Area(meta.getArea().getBounds()).createTransformedArea(AffineTransform.getScaleInstance (getScale(), getScale())); // area = area.createTransformedArea(AffineTransform.getTranslateInstance(zoneScale.getOffsetX(), zoneScale.getOffsetY())); // g2d.draw(area); // } SwingUtil.restoreAntiAliasing(g2d, oldAA); lastView = view; } private void renderLights(Graphics2D g, PlayerView view) { // Setup Graphics2D newG = (Graphics2D)g.create(); Area clip = new Area(g.getClip()); if (visibleScreenArea != null) { clip.intersect(visibleScreenArea); } newG.setClip(clip); SwingUtil.useAntiAliasing(newG); AffineTransform af = g.getTransform(); af.translate(getViewOffsetX(), getViewOffsetY()); af.scale(getScale(), getScale()); newG.setTransform(af); newG.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, AppPreferences.getVisionOverlayOpacity()/255.0f)); // Organize Map<Paint, List<Area>> colorMap = new HashMap<Paint, List<Area>>(); for (DrawableLight light : zoneView.getDrawableLights()) { List<Area> areaList = colorMap.get(light.getPaint().getPaint()); if (areaList == null) { areaList = new ArrayList<Area>(); colorMap.put(light.getPaint().getPaint(), areaList); } areaList.add(new Area(light.getArea())); } // Combine same colors to avoid ugly overlap for (List<Area> areaList : colorMap.values()) { while (areaList.size() > 1) { Area a1 = areaList.remove(0); Area a2 = areaList.remove(0); a1.add(a2); areaList.add(a1); } // Cut out the bright light if (areaList.size() > 0) { Area area = areaList.get(0); for (Area brightArea : zoneView.getBrightLights()) { area.subtract(brightArea); } } } // Draw for (Entry<Paint, List<Area>> entry : colorMap.entrySet()) { newG.setPaint(entry.getKey()); for (Area area : entry.getValue()) { newG.fill(area); } } } private void renderPlayerVisionOverlay(Graphics2D g, PlayerView view) { if (!view.isGMView()) { renderVisionOverlay(g, view); } } private void renderGMVisionOverlay(Graphics2D g, PlayerView view) { if (view.isGMView()) { renderVisionOverlay(g, view); } } private void renderVisionOverlay(Graphics2D g, PlayerView view) { Area currentTokenVisionArea = zoneView.getVisibleArea(tokenUnderMouse); if (currentTokenVisionArea == null) { return; } AffineTransform af = new AffineTransform(); af.translate(zoneScale.getOffsetX(), zoneScale.getOffsetY()); af.scale(getScale(), getScale()); Area area = currentTokenVisionArea.createTransformedArea(af); SwingUtil.useAntiAliasing(g); g.setColor(new Color(200, 200, 200)); g.draw(area); boolean useHaloColor = tokenUnderMouse.getHaloColor() != null && AppPreferences.getUseHaloColorOnVisionOverlay(); if (tokenUnderMouse.getVisionOverlayColor() != null || useHaloColor) { Color visionColor = useHaloColor ? tokenUnderMouse.getHaloColor() : tokenUnderMouse.getVisionOverlayColor(); g.setColor(new Color(visionColor.getRed(), visionColor.getGreen(), visionColor.getBlue(), AppPreferences.getVisionOverlayOpacity())); g.fill(area); } } private void renderPlayerVision(Graphics2D g, PlayerView view) { // Object oldAntiAlias = g.getRenderingHint(RenderingHints.KEY_ANTIALIASING ); // g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // // // // if (currentTokenVisionArea != null && !view.isGMView()) { // // Draw the outline under the fog // g.setColor(new Color(200, 200, 200)); // g.draw(currentTokenVisionArea); // } // // g.setRenderingHint(RenderingHints.KEY_ANTIALIASING , oldAntiAlias); } /** * Paint all of the token templates for selected tokens. * * @param g Paint on this graphic object. */ private void renderTokenTemplates(Graphics2D g, PlayerView view) { double scale = zoneScale.getScale(); int scaledGridSize = (int) getScaledGridSize(); // Find tokens with template state // TODO: I really don't like this, it should be optimized AffineTransform old = g.getTransform(); AffineTransform t = new AffineTransform(); g.setTransform(t); for (Token token : zone.getAllTokens()) { for (String state : token.getStatePropertyNames()) { Object value = token.getState(state); if (value instanceof TokenTemplate) { // Only show if selected if (!AppState.isShowLightRadius()) { continue; } // Calculate the token bounds Rectangle size = token.getBounds(zone); int width = (int) (size.width * scale) - 1; int height = (int) (size.height * scale) - 1; ScreenPoint tokenScreenLocation = ScreenPoint.fromZonePointRnd(this, token.getX(), token.getY()); int x = (int)(tokenScreenLocation.x + 1); int y = (int)(tokenScreenLocation.y); if (width < scaledGridSize) { x += (scaledGridSize - width) / 2; } if (height < scaledGridSize) { y += (scaledGridSize - height) / 2; } Rectangle bounds = new Rectangle(x, y, width, height); // Set up the graphics, paint the template, restore the graphics t.setTransform(old); t.translate(bounds.x, bounds.y); t.scale(getScale(), getScale()); g.setTransform(t); ((TokenTemplate)value).paintTemplate(g, token, bounds, this); } } } g.setTransform(old); } private void renderLabels(Graphics2D g, PlayerView view) { labelLocationList.clear(); for (Label label : zone.getLabels()) { ZonePoint zp = new ZonePoint(label.getX(), label.getY()); if (!zone.isPointVisible(zp, view.getRole())) { continue; } ScreenPoint sp = ScreenPoint.fromZonePointRnd(this, zp.x, zp.y); Rectangle bounds = null; if (label.isShowBackground()) { bounds = GraphicsUtil.drawBoxedString(g, label.getLabel(), (int)sp.x, (int)sp.y, SwingUtilities.CENTER, GraphicsUtil.GREY_LABEL, label.getForegroundColor()); } else { FontMetrics fm = g.getFontMetrics(); int strWidth = SwingUtilities.computeStringWidth(fm, label.getLabel()); int x = (int)(sp.x - strWidth/2); int y = (int)(sp.y - fm.getAscent()); g.setColor(label.getForegroundColor()); g.drawString(label.getLabel(), x, y + fm.getAscent()); bounds = new Rectangle(x, y, strWidth, fm.getHeight()); } labelLocationList.add(new LabelLocation(bounds, label)); } } Integer fogX = null; Integer fogY = null; private void renderFog(Graphics2D g, PlayerView view) { if (!zone.hasFog()) { return; } if (lastView == null || view.isGMView() != lastView.isGMView()) { flushFog = true; } Dimension size = getSize(); // Optimization for panning Area fogClip = null; if (!flushFog && fogX != null && fogY != null && (fogX != getViewOffsetX() || fogY != getViewOffsetY())) { // This optimization does not seem to keep the alpha channel correctly, and sometimes leaves // lines on some graphics boards, we'll leave it out for now // if (Math.abs(fogX - getViewOffsetX()) < size.width && Math.abs(fogY - getViewOffsetY()) < size.height) { // int deltaX = getViewOffsetX() - fogX; // int deltaY = getViewOffsetY() - fogY; // // Graphics2D buffG = fogBuffer.createGraphics(); // // buffG.setComposite(AlphaComposite.Src); // buffG.copyArea(0, 0, size.width, size.height, deltaX, deltaY); // // buffG.dispose(); // // fogClip = new Area(); // if (deltaX < 0) { // fogClip.add(new Area(new Rectangle(size.width+deltaX, 0, -deltaX, size.height))); // } else if (deltaX > 0){ // fogClip.add(new Area(new Rectangle(0, 0, deltaX, size.height))); // } // // if (deltaY < 0) { // fogClip.add(new Area(new Rectangle(0, size.height + deltaY, size.width, -deltaY))); // } else if (deltaY > 0) { // fogClip.add(new Area(new Rectangle(0, 0, size.width, deltaY))); // } // // } flushFog = true; } if (flushFog || fogBuffer == null || fogBuffer.getWidth() != size.width || fogBuffer.getHeight() != size.height) { fogX = getViewOffsetX(); fogY = getViewOffsetY(); boolean newImage = false; if (fogBuffer == null || fogBuffer.getWidth() != size.width || fogBuffer.getHeight() != size.height) { newImage = true; fogBuffer = new BufferedImage(size.width, size.height, view.isGMView() ? Transparency.TRANSLUCENT : Transparency.BITMASK); } Graphics2D buffG = fogBuffer.createGraphics(); buffG.setClip(fogClip != null ? fogClip : new Rectangle(0, 0, size.width, size.height)); SwingUtil.useAntiAliasing(buffG); if (!newImage){ Composite oldComposite = buffG.getComposite(); buffG.setComposite(AlphaComposite.Clear); buffG.fillRect(0, 0, size.width, size.height); buffG.setComposite(oldComposite); } // Fill buffG.setPaint(zone.getFogPaint().getPaint(getViewOffsetX(), getViewOffsetY(), getScale())); buffG.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, view.isGMView() ? .6f : 1f)); buffG.fillRect(0, 0, size.width, size.height); // Cut out the exposed area AffineTransform af = new AffineTransform(); af.translate(getViewOffsetX(), getViewOffsetY()); af.scale(getScale(), getScale()); buffG.setTransform(af); buffG.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR)); buffG.fill(zone.getExposedArea()); // Soft fog if (zoneView.isUsingVision()) { buffG.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC)); Area visibleArea = zoneView.getVisibleArea(view); if (visibleArea != null) { buffG.setColor(new Color(0, 0, 0, 100)); if (zone.hasFog ()) { // Fill in the exposed area buffG.fill(zone.getExposedArea()); buffG.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR)); Shape oldClip = buffG.getClip(); buffG.setClip(zone.getExposedArea()); buffG.fill(visibleArea); buffG.setClip(oldClip); } else { buffG.setColor(new Color(255, 255, 255, 40)); buffG.fill(visibleArea); } } else { if (zone.hasFog()) { buffG.setColor(new Color(0, 0, 0, 80)); buffG.fill(zone.getExposedArea()); } } } // Outline if (false && AppPreferences.getUseSoftFogEdges()) { GraphicsUtil.renderSoftClipping(buffG, zone.getExposedArea(), (int)(zone.getGrid().getSize() * getScale()*.25), view.isGMView() ? .6 : 1); } else { buffG.setTransform(new AffineTransform()); buffG.setComposite(AlphaComposite.Src); buffG.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); buffG.setStroke(new BasicStroke(1)); buffG.setColor(Color.black); buffG.draw(zone.getExposedArea().createTransformedArea(af)); } buffG.dispose(); flushFog = false; } g.drawImage(fogBuffer, 0, 0, this); } public Area getVisibleArea(Token token) { return zoneView.getVisibleArea(token); } public boolean isLoading() { if (isLoaded) { // We're done, until the cache is cleared return false; } // Get a list of all the assets in the zone Set<MD5Key> assetSet = zone.getAllAssetIds(); assetSet.remove(null); // remove bad data // Make sure they are loaded int downloadCount = 0; int cacheCount = 0; boolean loaded = true; for (MD5Key id : assetSet) { // Have we gotten the actual data yet ? Asset asset = AssetManager.getAsset(id); if (asset == null) { loaded = false; continue; } downloadCount ++; // Have we loaded the image into memory yet ? Image image = ImageManager.getImage(asset, new ImageObserver[]{}); if (image == null || image == ImageManager.UNKNOWN_IMAGE ) { loaded = false; continue; } cacheCount ++; } loadingProgress = String.format(" Loading Map '%s' - %d/%d Loaded %d/%d Cached", zone.getName(), downloadCount, assetSet.size(), cacheCount, assetSet.size()); isLoaded = loaded; if (isLoaded) { // Notify the token tree that it should update MapTool.getFrame().updateTokenTree(); } return !isLoaded; } protected void renderDrawableOverlay(Graphics g, DrawableRenderer renderer, PlayerView view, List<DrawnElement> drawnElements) { Rectangle viewport = new Rectangle(zoneScale.getOffsetX (), zoneScale.getOffsetY(), getSize().width, getSize().height); List<DrawnElement> list = new ArrayList<DrawnElement>(); list.addAll(drawnElements); renderer.renderDrawables (g, list, viewport, getScale()); } protected void renderBoard(Graphics2D g, PlayerView view) { Dimension size = getSize(); if (backbuffer == null || backbuffer.getWidth() != size.width || backbuffer.getHeight() != size.height) { backbuffer = new BufferedImage(size.width, size.height, Transparency.OPAQUE); drawBackground = true; } Scale scale = getZoneScale(); if (scale.getOffsetX() != lastX || scale.getOffsetY() != lastY || scale.getScale() != lastScale) { drawBackground = true; } if (drawBackground) { Graphics2D bbg = backbuffer.createGraphics(); // Background texture Paint paint = zone.getBackgroundPaint().getPaint(getViewOffsetX(), getViewOffsetY(), getScale()); bbg.setPaint(paint); bbg.fillRect(0, 0, size.width, size.height); // Map if (zone.getMapAssetId() != null) { BufferedImage mapImage = ImageManager.getImage(AssetManager.getAsset(zone.getMapAssetId()), this); bbg.drawImage(mapImage, getViewOffsetX(), getViewOffsetY(), (int)(mapImage.getWidth()*getScale()), (int)(mapImage.getHeight()*getScale()), null); } bbg.dispose(); drawBackground = false; } lastX = scale.getOffsetX(); lastY = scale.getOffsetY(); lastScale = scale.getScale(); g.drawImage(backbuffer, 0, 0, this); } protected void renderGrid(Graphics2D g, PlayerView view) { int gridSize = (int) ( zone.getGrid().getSize() * getScale()); if (!AppState.isShowGrid() || gridSize < MIN_GRID_SIZE) { return; } zone.getGrid().draw(this, g, g.getClipBounds()); } protected void renderCoordinates(Graphics2D g, PlayerView view) { if (AppState.isShowCoordinates()) { zone.getGrid().drawCoordinatesOverlay(g, this); } } protected void renderMoveSelectionSets(Graphics2D g, PlayerView view) { Grid grid = zone.getGrid(); double scale = zoneScale.getScale(); Set<SelectionSet> selections = new HashSet<SelectionSet>(); selections.addAll(selectionSetMap.values()); for (SelectionSet set : selections) { Token keyToken = zone.getToken(set.getKeyToken()); ZoneWalker walker = set.getWalker(); // Hide the hidden layer if (keyToken.getLayer() == Zone.Layer.GM && !view.isGMView()) { continue; } for (GUID tokenGUID : set.getTokens()) { Token token = zone.getToken(tokenGUID); boolean isOwner = token.isOwner(MapTool.getPlayer().getName()); // Perhaps deleted ? if (token == null) { continue; } // Don't bother if it's not visible if (!token.isVisible() && !view.isGMView()) { continue; } Asset asset = AssetManager.getAsset(token.getImageAssetId()); if (asset == null) { continue; } // OPTIMIZE: combine this with the code in renderTokens() Rectangle footprintBounds = token.getBounds(zone); ScreenPoint newScreenPoint = ScreenPoint.fromZonePoint(this, footprintBounds.x + set.getOffsetX(), footprintBounds.y + set.getOffsetY()); BufferedImage image = ImageManager.getImage(AssetManager.getAsset(token.getImageAssetId())); int scaledWidth = (int)(footprintBounds.width * scale); int scaledHeight = (int)(footprintBounds.height * scale); // Tokens are centered on the image center point int x = (int)(newScreenPoint.x); int y = (int)(newScreenPoint.y); // Vision visibility Rectangle clip = g.getClipBounds(); if (!view.isGMView() && !isOwner && zoneView.isUsingVision() && visibleScreenArea != null) { // Only show the part of the path that is visible Area clipArea = new Area(clip); clipArea.intersect(visibleScreenArea); g.setClip(clipArea); } // Show path only on the key token if (token == keyToken) { if (!token.isStamp()) { if (!token.isObjectStamp() && zone.getGrid().getCapabilities().isPathingSupported() && token.isSnapToGrid()) { renderPath(g, walker.getPath(), token.getFootprint(zone.getGrid())); } else { // Line Color highlight = new Color(255, 255, 255, 80); Stroke highlightStroke = new BasicStroke(9); Stroke oldStroke = g.getStroke(); Object oldAA = SwingUtil.useAntiAliasing(g); ScreenPoint lastPoint = ScreenPoint.fromZonePointRnd(this, token.getX()+footprintBounds.width/2, token.getY()+footprintBounds.height/2); for (ZonePoint zp : set.gridlessPath.getCellPath()) { ScreenPoint nextPoint = ScreenPoint.fromZonePoint(this, zp.x, zp.y); g.setColor(highlight); g.setStroke(highlightStroke); g.drawLine((int)lastPoint.x, (int)lastPoint.y , (int)nextPoint.x, (int)nextPoint.y); g.setStroke(oldStroke); g.setColor(Color.blue); g.drawLine((int)lastPoint.x, (int)lastPoint.y , (int)nextPoint.x, (int)nextPoint.y); lastPoint = nextPoint; } g.setColor(highlight); g.setStroke(highlightStroke); g.drawLine((int)lastPoint.x, (int)lastPoint.y, x + scaledWidth/2, y + scaledHeight/2); g.setStroke(oldStroke); g.setColor(Color.blue); g.drawLine((int)lastPoint.x, (int)lastPoint.y, x + scaledWidth/2, y + scaledHeight/2); SwingUtil.restoreAntiAliasing(g, oldAA); // Waypoints for (ZonePoint p : set.gridlessPath.getCellPath()) { p = new ZonePoint(p.x, p.y); highlightCell(g, p, AppStyle.cellWaypointImage, .333f); } } } } // handle flipping BufferedImage workImage = image; if (token.isFlippedX() || token.isFlippedY()) { workImage = new BufferedImage(image.getWidth(), image.getHeight(), image.getTransparency()); int workW = image.getWidth() * (token.isFlippedX() ? -1 : 1); int workH = image.getHeight() * (token.isFlippedY() ? -1 : 1); int workX = token.isFlippedX() ? image.getWidth() : 0; int workY = token.isFlippedY() ? image.getHeight() : 0; Graphics2D wig = workImage.createGraphics(); wig.drawImage(image, workX, workY, workW, workH, null); wig.dispose(); } // Draw token Dimension imgSize = new Dimension(workImage.getWidth(), workImage.getHeight()); SwingUtil.constrainTo(imgSize, footprintBounds.width, footprintBounds.height); int offsetx = 0; int offsety = 0; if (token.isSnapToScale()) { offsetx = (int)(imgSize.width < footprintBounds.width ? (footprintBounds.width - imgSize.width)/2 * getScale() : 0); offsety = (int)(imgSize.height < footprintBounds.height ? (footprintBounds.height - imgSize.height)/2 * getScale() : 0); } int tx = x + offsetx; int ty = y + offsety; AffineTransform at = new AffineTransform(); at.translate(tx, ty); if (token.hasFacing() && token.getShape() == Token.TokenShape.TOP_DOWN) { at.rotate(Math.toRadians (-token.getFacing() - 90), scaledWidth/2 - token.getAnchor().x*scale - offsetx, scaledHeight/2 - token.getAnchor().y*scale - offsety); // facing defaults to down, or -90 degrees } if (token.isSnapToScale()) { at.scale((double) imgSize.width / workImage.getWidth(), (double) imgSize.height / workImage.getHeight()); at.scale(getScale(), getScale()); } else { at.scale((double) scaledWidth / workImage.getWidth(), (double) scaledHeight / workImage.getHeight()); } g.drawImage(workImage, at, this); // Other details if (token == keyToken) { // if the token is visible on the screen it will be in the location cache if (tokenLocationCache.containsKey(token)) { y += 10 + scaledHeight; x += scaledWidth/2; if (!token.isStamp()) { if (AppState.getShowMovementMeasurements ()) { String distance = ""; if (zone.getGrid().getCapabilities().isPathingSupported() && token.isSnapToGrid()) { if (walker.getDistance() >= 1) { distance = Integer.toString(walker.getDistance()); } } else { double c = 0; ZonePoint lastPoint = new ZonePoint(token.getX()+footprintBounds.width/2, token.getY()+footprintBounds.height/2); for (ZonePoint zp : set.gridlessPath.getCellPath()) { int a = lastPoint.x - zp.x; int b = lastPoint.y - zp.y; c += Math.hypot(a, b); lastPoint = zp; } ZonePoint finalPoint = new ZonePoint((set.offsetX + token.getX())+footprintBounds.width/2, (set.offsetY + token.getY())+footprintBounds.height/2); int a = lastPoint.x - finalPoint.x; int b = lastPoint.y - finalPoint.y; c += Math.hypot(a, b); c /= zone.getGrid().getSize(); // Number of "cells" c *= zone.getUnitsPerCell(); // "actual" distance traveled distance = String.format("%.1f", c); } if (distance.length() > 0) { GraphicsUtil.drawBoxedString(g, distance, x, y); y += 20; } } } if (set.getPlayerId() != null && set.getPlayerId().length() >= 1) { GraphicsUtil.drawBoxedString (g, set.getPlayerId(), x, y); } } } g.setClip(clip); } } } public void renderPath(Graphics2D g, Path path, TokenFootprint footprint) { Object oldRendering = g.getRenderingHint(RenderingHints.KEY_ANTIALIASING); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); CellPoint previousPoint = null; Point previousHalfPoint = null; Grid grid = zone.getGrid(); double scale = getScale(); Rectangle footprintBounds = footprint.getBounds(grid); List<CellPoint> cellPath = path.getCellPath(); Set<CellPoint> pathSet = new HashSet<CellPoint>(); List<ZonePoint> waypointList = new LinkedList<ZonePoint>(); for (CellPoint p : cellPath) { pathSet.addAll(footprint.getOccupiedCells(p)); if (path.isWaypoint(p) && previousPoint != null) { ZonePoint zp = grid.convert(p); zp.x += footprintBounds.width/2; zp.y += footprintBounds.height/2; waypointList.add(zp); } previousPoint = p; } // Don't show the final path point as a waypoint, it's redundant, and ugly if (waypointList.size() > 0) { waypointList.remove(waypointList.size()-1); } Dimension cellOffset = zone.getGrid().getCellOffset(); for (CellPoint p : pathSet) { ZonePoint zp = grid.convert(p); zp.x += grid.getCellWidth()/2 + cellOffset.width; zp.y += grid.getCellHeight()/2 + cellOffset.height; highlightCell(g, zp, grid.getCellHighlight(), 1.0f); } for (ZonePoint p : waypointList) { ZonePoint zp = new ZonePoint(p.x + cellOffset.width, p.y + cellOffset.height); highlightCell(g, zp, AppStyle.cellWaypointImage, .333f); } // Line path if (grid.getCapabilities().isPathLineSupported() ) { ZonePoint lineOffset = new ZonePoint(footprintBounds.x + footprintBounds.width/2 - grid.getOffsetX(), footprintBounds.y + footprintBounds.height/2 - grid.getOffsetY()); int xOffset = (int)(lineOffset.x * scale); int yOffset = (int)(lineOffset.y * scale); g.setColor(Color.blue); previousPoint = null; for (CellPoint p : cellPath) { if (previousPoint != null) { ZonePoint ozp = grid.convert(previousPoint); int ox = ozp.x; int oy = ozp.y; ZonePoint dzp = grid.convert(p); int dx = dzp.x; int dy = dzp.y; ScreenPoint origin = ScreenPoint.fromZonePoint(this, ox, oy); ScreenPoint destination = ScreenPoint.fromZonePoint(this, dx, dy); int halfx = (int)(( origin.x + destination.x)/2); int halfy = (int)((origin.y + destination.y)/2); Point halfPoint = new Point(halfx, halfy); if (previousHalfPoint != null) { int x1 = previousHalfPoint.x+xOffset; int y1 = previousHalfPoint.y+yOffset; int x2 = (int)origin.x+xOffset; int y2 = (int)origin.y+yOffset; int xh = halfPoint.x+xOffset; int yh = halfPoint.y+yOffset; QuadCurve2D curve = new QuadCurve2D.Float(x1, y1, x2, y2, xh, yh); g.draw(curve); } previousHalfPoint = halfPoint; } previousPoint = p; } } g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, oldRendering); } public void highlightCell(Graphics2D g, ZonePoint point, BufferedImage image, float size) { Grid grid = zone.getGrid(); double cwidth = grid.getCellWidth() * getScale(); double cheight = grid.getCellHeight() * getScale(); double iwidth = cwidth * size; double iheight = cheight * size; ScreenPoint sp = ScreenPoint.fromZonePoint(this, point); g.drawImage (image, (int)(sp.x - iwidth/2), (int)(sp.y - iheight/2), (int)iwidth, (int)iheight, this); } /** * Get a list of tokens currently visible on the screen. The list is ordered by location starting * in the top left and going to the bottom right * @return */ public List<Token> getTokensOnScreen() { List<Token> list = new ArrayList<Token>(); // Always assume tokens, for now List<TokenLocation> tokenLocationListCopy = new ArrayList<TokenLocation>(); tokenLocationListCopy.addAll(getTokenLocations(Zone.Layer.TOKEN)); for (TokenLocation location : tokenLocationListCopy) { list.add(location.token); } // Sort by location on screen, top left to bottom right Collections.sort(list, new Comparator<Token>(){ public int compare(Token o1, Token o2) { if (o1.getY() < o2.getY()) { return -1; } if (o1.getY() > o2.getY()) { return 1; } if (o1.getX() < o2.getX()) { return -1; } if (o1.getX() > o2.getX()) { return 1; } return 0; } }); return list; } public Zone.Layer getActiveLayer() { return activeLayer != null ? activeLayer : Zone.Layer.TOKEN; } public void setActiveLayer(Zone.Layer layer) { activeLayer = layer; selectedTokenSet.clear(); repaint(); } /** * Get the token locations for the given layer, creates an empty list * if there are not locations for the given layer */ private List<TokenLocation> getTokenLocations(Zone.Layer layer) { List<TokenLocation> list = tokenLocationMap.get(layer); if (list != null) { return list; } list = new LinkedList<TokenLocation>(); tokenLocationMap.put(layer, list); return list; } // TODO: I don't like this hardwiring protected Shape getCircleFacingArrow(int angle, int size) { int base = (int)(size * .75); int width = (int)(size * .35); facingArrow = new GeneralPath(); facingArrow.moveTo(base, -width); facingArrow.lineTo(size, 0); facingArrow.lineTo(base, width); facingArrow.lineTo(base, -width); return ((GeneralPath)facingArrow.createTransformedShape( AffineTransform.getRotateInstance(-Math.toRadians(angle)))).createTransformedShape(AffineTransform.getScaleInstance(getScale(), getScale())); } // TODO: I don't like this hardwiring protected Shape getSquareFacingArrow(int angle, int size) { int base = (int)(size * .75); int width = (int)(size * .35); facingArrow = new GeneralPath(); facingArrow.moveTo(0, 0); facingArrow.lineTo(-(size - base), -width); facingArrow.lineTo(-(size - base), width); facingArrow.lineTo(0, 0); return ((GeneralPath)facingArrow.createTransformedShape(AffineTransform.getRotateInstance(-Math.toRadians(angle)))).createTransformedShape( AffineTransform.getScaleInstance(getScale(), getScale())); } protected void renderTokens(Graphics2D g, List<Token> tokenList, PlayerView view) { Rectangle viewport = new Rectangle(0, 0, getSize().width, getSize().height); Rectangle clipBounds = g.getClipBounds(); double scale = zoneScale.getScale(); for (Token token : tokenList) { if (token.isStamp() && isTokenMoving(token)) { continue; } TokenLocation location = tokenLocationCache.get(token); if (location != null && !location.maybeOnscreen(viewport)) { continue; } // Don't bother if it's not visible // NOTE: Not going to use zone.isTokenVisible as it is very slow. In fact, it's faster // to just draw the tokens and let them be clipped if (!token.isVisible() && !view.isGMView()) { continue; } Rectangle footprintBounds = token.getBounds(zone); BufferedImage image = null; Asset asset = AssetManager.getAsset(token.getImageAssetId ()); if (asset == null) { // In the mean time, show a placeholder image = ImageManager.UNKNOWN_IMAGE; } else { image = ImageManager.getImage(AssetManager.getAsset(token.getImageAssetId()), this); } double scaledWidth = (footprintBounds.width*scale); double scaledHeight = (footprintBounds.height*scale); // if (!token.isStamp()) { // // Fit inside the grid // scaledWidth --; // scaledHeight --; // } ScreenPoint tokenScreenLocation = ScreenPoint.fromZonePoint (this, footprintBounds.x, footprintBounds.y); // Tokens are centered on the image center point double x = tokenScreenLocation.x; double y = tokenScreenLocation.y; Rectangle2D origBounds = new Rectangle2D.Double(x, y, scaledWidth, scaledHeight); Area tokenBounds = new Area(origBounds); if (token.hasFacing() && token.getShape() == Token.TokenShape.TOP_DOWN) { tokenBounds.transform(AffineTransform.getRotateInstance(Math.toRadians(-token.getFacing() - 90), scaledWidth/2 + x - (token.getAnchor().x*scale), scaledHeight/2 + y - (token.getAnchor().y*scale))); // facing defaults to down, or -90 degrees } location = new TokenLocation(tokenBounds, origBounds, token, x, y, footprintBounds.width, footprintBounds.height, scaledWidth, scaledHeight); tokenLocationCache.put(token, location); // General visibility if (!view.isGMView() && !token.isVisible()) { continue; } // Vision visibility if (!view.isGMView() && token.isToken() && zoneView.isUsingVision()) { if (!GraphicsUtil.intersects(visibleScreenArea, location.bounds)) { continue; } } // Markers if (token.isMarker() && canSeeMarker(token)) { markerLocationList.add(location); } if (!location.bounds.intersects(clipBounds)) { // Not on the screen, don't have to worry about it continue; } // Stacking check if (!token.isStamp()) { for (TokenLocation currLocation : getTokenLocations(Zone.Layer.TOKEN)) { Area r1 = currLocation.bounds; // Are we covering anyone ? if (location.boundsCache.contains(currLocation.boundsCache) && GraphicsUtil.contains(location.bounds, r1)) { // Are we covering someone that is covering someone ? Area oldRect = null; for (Area r2 : coveredTokenSet) { if (location.bounds.getBounds().contains(r2.getBounds ())) { oldRect = r2; break; } } if (oldRect != null) { coveredTokenSet.remove(oldRect); } coveredTokenSet.add(location.bounds); } } } // Keep track of the location on the screen // Note the order where the top most token is at the end of the list List<TokenLocation> locationList = null; if (!token.isStamp()) { locationList = getTokenLocations(Zone.Layer.TOKEN); } else { if (token.isObjectStamp()) { locationList = getTokenLocations(Zone.Layer.OBJECT); } if (token.isBackgroundStamp()) { locationList = getTokenLocations(Zone.Layer.BACKGROUND); } if (token.isGMStamp()) { locationList = getTokenLocations(Zone.Layer.GM); } } if (locationList != null) { locationList.add(location); } // Only draw if we're visible // NOTE: this takes place AFTER resizing the image, that's so that the user // sufferes a pause only once while scaling, and not as new tokens are // scrolled onto the screen if (!location.bounds.intersects(clipBounds)) { continue; } // Moving ? if (isTokenMoving(token)) { BufferedImage replacementImage = replacementImageMap.get(token); if (replacementImage == null) { replacementImage = ImageUtil.rgbToGrayscale(image); replacementImageMap.put(token, replacementImage); } image = replacementImage; } // Previous path if (showPathList.contains(token) && token.getLastPath() != null) { renderPath(g, token.getLastPath(), token.getFootprint(zone.getGrid())); } Shape clip = g.getClipBounds(); if (token.isToken() && !view.isGMView() && !token.isOwner(MapTool.getPlayer().getName()) && visibleScreenArea != null) { Area clipArea = new Area(clip); clipArea.intersect(visibleScreenArea); g.setClip(clipArea); } // Halo (TOPDOWN, CIRCLE) if (token.hasHalo() && (token.getShape() == Token.TokenShape.TOP_DOWN || token.getShape() == Token.TokenShape.CIRCLE)) { Stroke oldStroke = g.getStroke(); g.setStroke( new BasicStroke(AppPreferences.getHaloLineWidth())); g.setColor(token.getHaloColor()); g.draw(new Rectangle2D.Double(location.x, location.y, location.scaledWidth, location.scaledHeight)); g.setStroke(oldStroke); } // handle flipping BufferedImage workImage = image; if (token.isFlippedX() || token.isFlippedY()) { workImage = new BufferedImage( image.getWidth(), image.getHeight(), image.getTransparency()); int workW = image.getWidth() * (token.isFlippedX() ? -1 : 1); int workH = image.getHeight() * (token.isFlippedY () ? -1 : 1); int workX = token.isFlippedX() ? image.getWidth() : 0; int workY = token.isFlippedY() ? image.getHeight() : 0; Graphics2D wig = workImage.createGraphics (); wig.drawImage(image, workX, workY, workW, workH, null); wig.dispose(); } // Position Dimension imgSize = new Dimension(workImage.getWidth(), workImage.getHeight()); SwingUtil.constrainTo(imgSize, footprintBounds.width, footprintBounds.height); int offsetx = 0; int offsety = 0; if (token.isSnapToScale()) { offsetx = (int)(imgSize.width < footprintBounds.width ? (footprintBounds.width - imgSize.width)/2 * getScale() : 0); offsety = (int)(imgSize.height < footprintBounds.height ? (footprintBounds.height - imgSize.height)/2 * getScale() : 0); } double tx = location.x + offsetx; double ty = location.y + offsety; AffineTransform at = new AffineTransform(); at.translate(tx, ty); // Rotated if (token.hasFacing() && token.getShape() == Token.TokenShape.TOP_DOWN) { at.rotate(Math.toRadians(-token.getFacing() - 90), location.scaledWidth/2 - (token.getAnchor().x*scale) - offsetx, location.scaledHeight/2 - (token.getAnchor().y*scale) - offsety); // facing defaults to down, or -90 degrees } // Draw the token if (token.isSnapToScale()) { at.scale(((double) imgSize.width) / workImage.getWidth(), ((double) imgSize.height) / workImage.getHeight()); at.scale(getScale(), getScale()); } else { at.scale(((double) scaledWidth) / workImage.getWidth(), ((double) scaledHeight) / workImage.getHeight()); } g.drawImage(workImage, at, this); // Halo (SQUARE) if (token.hasHalo() && token.getShape() == Token.TokenShape.SQUARE) { Stroke oldStroke = g.getStroke(); g.setStroke(new BasicStroke(AppPreferences.getHaloLineWidth())); g.setColor (token.getHaloColor()); g.draw(new Rectangle2D.Double(location.x, location.y, location.scaledWidth, location.scaledHeight)); g.setStroke(oldStroke); } g.setClip(clip); // Facing ? // TODO: Optimize this by doing it once per token per facing if (token.hasFacing()) { Token.TokenShape tokenType = token.getShape(); switch(tokenType) { case CIRCLE: Shape arrow = getCircleFacingArrow(token.getFacing(), footprintBounds.width/2); double cx = location.x + location.scaledWidth/2; double cy = location.y + location.scaledHeight/2; g.translate(cx, cy); g.setColor(Color.yellow); g.fill(arrow); g.setColor(Color.darkGray); g.draw(arrow); g.translate(-cx, -cy); break; case SQUARE: int facing = token.getFacing(); while (facing < 0) {facing += 360;} // TODO: this should really be done in Token.setFacing() but I didn't want to take the chance of breaking something, so change this when it's safe to break stuff facing %= 360; arrow = getSquareFacingArrow(facing, footprintBounds.width/2); cx = location.x + location.scaledWidth/2; cy = location.y + location.scaledHeight/2; // Find the edge of the image // TODO: Man, this is horrible, there's gotta be a better way to do this double xp = location.scaledWidth/2; double yp = location.scaledHeight/2; if (facing >= 45 && facing <= 135 || facing >= 225 && facing <= 315) { xp = (int)(yp / Math.tan(Math.toRadians(facing))); if (facing > 180 ) { xp = -xp; yp = -yp; } } else { yp = (int)(xp * Math.tan(Math.toRadians(facing))); if (facing > 90 && facing < 270) { xp = -xp; yp = -yp; } } cx += xp; cy -= yp; g.translate (cx, cy); g.setColor(Color.yellow); g.fill(arrow); g.setColor(Color.darkGray); g.draw(arrow); g.translate(-cx, -cy); break; } } // Set up the graphics so that the overlay can just be painted. clip = g.getClip(); AffineTransform transform = new AffineTransform(); transform.translate(location.x+g.getTransform().getTranslateX(), location.y+g.getTransform().getTranslateY()); Graphics2D locg = (Graphics2D)g.create(); locg.setTransform(transform); Rectangle bounds = new Rectangle(0, 0, (int)Math.ceil(location.scaledWidth), (int)Math.ceil(location.scaledHeight)); Rectangle overlayClip = locg.getClipBounds().intersection(bounds); locg.setClip(overlayClip); // Check each of the set values for (String state : MapTool.getCampaign().getTokenStatesMap().keySet()) { Object stateValue = token.getState(state); AbstractTokenOverlay overlay = MapTool.getCampaign().getTokenStatesMap().get(state); if (stateValue instanceof AbstractTokenOverlay) overlay = (AbstractTokenOverlay)stateValue; if (overlay == null || overlay.isMouseover() && token != tokenUnderMouse || !overlay.showPlayer(token, MapTool.getPlayer())) continue; overlay.paintOverlay(locg, token, bounds, stateValue); } for (String bar : MapTool.getCampaign().getTokenBarsMap().keySet()) { Object barValue = token.getState(bar); BarTokenOverlay overlay = MapTool.getCampaign().getTokenBarsMap().get(bar); if (overlay == null || overlay.isMouseover() && token != tokenUnderMouse || !overlay.showPlayer(token, MapTool.getPlayer())) continue; overlay.paintOverlay(locg, token, bounds, barValue); } // endfor // DEBUGGING // ScreenPoint tmpsp = ScreenPoint.fromZonePoint(this, new ZonePoint(token.getX(), token.getY())); // g.setColor(Color.red); // g.drawLine(tmpsp.x, 0, tmpsp.x, getSize().height); // g.drawLine(0, tmpsp.y, getSize().width, tmpsp.y); } // Selection and labels for (TokenLocation location : getTokenLocations(getActiveLayer())) { Area bounds = location.bounds; Rectangle2D origBounds = location.origBounds; // TODO: This isn't entirely accurate as it doesn't account for the actual text // to be in the clipping bounds, but I'll fix that later if (!location.bounds.getBounds().intersects(clipBounds)) { continue; } Token token = location.token; boolean isSelected = selectedTokenSet.contains(token.getId()); if (isSelected) { Rectangle footprintBounds = token.getBounds(zone); ScreenPoint sp = ScreenPoint.fromZonePoint(this, footprintBounds.x, footprintBounds.y); double width = footprintBounds.width * getScale(); double height = footprintBounds.height * getScale(); ImageBorder selectedBorder = token.isStamp() ? AppStyle.selectedStampBorder : AppStyle.selectedBorder; // Border if (token.hasFacing() && (token.getShape() == Token.TokenShape.TOP_DOWN || token.isStamp ())) { AffineTransform oldTransform = g.getTransform(); // Rotated g.translate(sp.x, sp.y); g.rotate(Math.toRadians(-token.getFacing() - 90), width/2 - (token.getAnchor().x*scale), height/2 - (token.getAnchor().y*scale)); // facing defaults to down, or -90 degrees selectedBorder.paintAround(g, 0, 0, (int)width, (int)height); g.setTransform(oldTransform); } else { selectedBorder.paintAround(g, (int)sp.x, (int)sp.y, (int)width, (int)height); } } // Name if (AppState.isShowTokenNames() || isSelected || token == tokenUnderMouse) { String name = token.getName(); if (view.isGMView () && token.getGMName() != null && token.getGMName().length() > 0) { name += " (" + token.getGMName() + ")"; } ImageLabel background = token.isVisible() ? token.getType() == Token.Type.NPC ? GraphicsUtil.BLUE_LABEL : GraphicsUtil.GREY_LABEL : GraphicsUtil.DARK_GREY_LABEL; Color foreground = token.isVisible() ? token.getType() == Token.Type.NPC ? Color.white : Color.black : Color.white; int offset = 10 + (isSelected ? 3 : 0); GraphicsUtil.drawBoxedString(g, name, bounds.getBounds().x + bounds.getBounds ().width/2, bounds.getBounds().y + bounds.getBounds().height + offset, SwingUtilities.CENTER, background, foreground); if (token.getLabel() != null && token.getLabel().trim().length() > 0) { offset += 16 + (isSelected ? 3 : 0); GraphicsUtil.drawBoxedString(g, token.getLabel(), bounds.getBounds().x + bounds.getBounds ().width/2, bounds.getBounds().y + bounds.getBounds().height + offset, SwingUtilities.CENTER, background, foreground); } } } // Stacks Shape clip = g.getClipBounds(); if (!view.isGMView() && visibleScreenArea != null) { Area clipArea = new Area(clip); clipArea.intersect(visibleScreenArea); g.setClip(clipArea); } for (Area rect : coveredTokenSet) { BufferedImage stackImage = AppStyle.stackImage ; g.drawImage(stackImage, rect.getBounds().x + rect.getBounds().width - stackImage.getWidth() + 2, rect.getBounds().y - 2, null); } // // Markers // for (TokenLocation location : getMarkerLocations() ) { // BufferedImage stackImage = AppStyle.markerImage; // g.drawImage(stackImage, location.bounds.getBounds().x, location.bounds.getBounds().y, null); // } g.setClip(clip); } private boolean canSeeMarker(Token token) { return MapTool.getPlayer().isGM() || !StringUtil.isEmpty(token.getNotes()); } public Set<GUID> getSelectedTokenSet() { return selectedTokenSet; } /** * A convienence method to get selected tokens ordered by name * @return List<Token> */ public List<Token> getSelectedTokensList() { List<Token> tokenList = new ArrayList<Token>(); for (GUID g : selectedTokenSet) { tokenList.add(zone.getToken(g)); } Collections.sort(tokenList, Token.NAME_COMPARATOR); return tokenList; } public boolean isTokenSelectable(GUID tokenGUID) { if (tokenGUID == null) { return false; } Token token = zone.getToken(tokenGUID); if (token == null) { return false; } if (!AppUtil.playerOwns(token)) { return false; } // FOR NOW: if you own the token, you can select it // if (!AppUtil.playerOwns(token) && !zone.isTokenVisible(token)) { // return false; // } // return true; } public void deselectToken(GUID tokenGUID) { addToSelectionHistory(selectedTokenSet); selectedTokenSet.remove(tokenGUID); MapTool.getFrame().updateSelectionPanel(); MapTool.getFrame().updateImpersonatePanel(getSelectedTokensList()); repaint(); } public boolean selectToken(GUID tokenGUID) { if (!isTokenSelectable(tokenGUID)) { return false; } addToSelectionHistory(selectedTokenSet); selectedTokenSet.add(tokenGUID); repaint(); MapTool.getFrame().updateSelectionPanel(); MapTool.getFrame().updateImpersonatePanel(getSelectedTokensList()); return true; } /** * Screen space rectangle */ public void selectTokens(Rectangle rect) { for (TokenLocation location : getTokenLocations(getActiveLayer())) { if (rect.intersects (location.bounds.getBounds())) { selectToken(location.token.getId()); } } } public void clearSelectedTokens() { addToSelectionHistory(selectedTokenSet); clearShowPaths(); selectedTokenSet.clear(); MapTool.getFrame().updateSelectionPanel(); MapTool.getFrame().updateImpersonatePanel(getSelectedTokensList()); repaint(); } public void undoSelectToken() { // System.out.println("num history items: " + selectedTokenSetHistory.size()); /* for (Set<GUID> set : selectedTokenSetHistory) { System.out.println("history item"); for (GUID guid : set) { System.out.println(zone.getToken(guid).getName()); } }*/ if (selectedTokenSetHistory.size() > 0) { selectedTokenSet = selectedTokenSetHistory.remove(0); // user may have deleted some of the tokens that are contained in the selection history. // find them and filter them otherwise the selectionSet will have orphaned GUIDs and // they will cause NPE Set<GUID> invalidTokenSet = new HashSet<GUID>(); for (GUID guid : selectedTokenSet) { if (zone.getToken(guid) == null) { invalidTokenSet.add(guid); } } selectedTokenSet.removeAll(invalidTokenSet); // if there is no token left in the set, undo again if (selectedTokenSet.size() == 0) { undoSelectToken(); } } //TODO: if selection history is empty, notify the selection panel to disable the undo button. MapTool.getFrame().updateSelectionPanel(); MapTool.getFrame().updateImpersonatePanel(getSelectedTokensList()); repaint(); } private void addToSelectionHistory(Set<GUID> selectionSet) { // don't add empty selections to history if (selectionSet.size() == 0) { return; } Set<GUID> history = new HashSet<GUID>(selectionSet); selectedTokenSetHistory.add(0, history); // limit the history to a certain size if (selectedTokenSetHistory.size() > 20) { selectedTokenSetHistory.subList(20, selectedTokenSetHistory.size() - 1).clear(); } } public void cycleSelectedToken(int direction) { List<Token> visibleTokens = getTokensOnScreen(); Set<GUID> selectedTokenSet = getSelectedTokenSet(); Integer newSelection = null; if (visibleTokens.size() == 0) { return; } if (selectedTokenSet.size() == 0) { newSelection = 0; } else { // Find the first selected token on the screen for (int i = 0; i < visibleTokens.size(); i++) { Token token = visibleTokens.get(i); if (!isTokenSelectable(token.getId())) { continue; } if (getSelectedTokenSet().contains(token.getId())) { newSelection = i; break; } } // Pick the next newSelection += direction; } if (newSelection < 0) { newSelection = visibleTokens.size() - 1; } if (newSelection >= visibleTokens.size()) { newSelection = 0; } // Make the selection clearSelectedTokens(); selectToken(visibleTokens.get(newSelection).getId()); } public Area getTokenBounds(Token token) { TokenLocation location = tokenLocationCache.get(token); return location != null ? location.bounds : null; } public Area getMarkerBounds(Token token) { for (TokenLocation location : markerLocationList) { if (location.token == token) { return location.bounds; } } return null; } public Rectangle getLabelBounds(Label label) { for (LabelLocation location : labelLocationList) { if (location.label == label) { return location.bounds; } } return null; } /** * Returns the token at screen location x, y (not cell location). To get * the token at a cell location, use getGameMap() and use that. * * @param x * @param y * @return */ public Token getTokenAt (int x, int y) { List<TokenLocation> locationList = new ArrayList<TokenLocation>(); locationList.addAll(getTokenLocations(getActiveLayer())); Collections.reverse(locationList); for (TokenLocation location : locationList) { if (location.bounds.contains(x, y)) { return location.token; } } return null; } public Token getMarkerAt (int x, int y) { List<TokenLocation> locationList = new ArrayList<TokenLocation>(); locationList.addAll(markerLocationList); Collections.reverse(locationList); for (TokenLocation location : locationList) { if (location.bounds.contains(x, y)) { return location.token; } } return null; } public List<Token> getTokenStackAt (int x, int y) { List<Area> stackList = new ArrayList<Area>(); stackList.addAll(coveredTokenSet); for (Area bounds : stackList) { if (bounds.contains(x, y)) { List<Token> tokenList = new ArrayList<Token>(); for (TokenLocation location : getTokenLocations(getActiveLayer())) { if (location.bounds.getBounds().intersects(bounds.getBounds())) { tokenList.add(location.token); } } return tokenList; } } return null; } /** * Returns the label at screen location x, y (not cell location). To get * the token at a cell location, use getGameMap() and use that. * * @param x * @param y * @return */ public Label getLabelAt (int x, int y) { List<LabelLocation> labelList = new ArrayList<LabelLocation>(); labelList.addAll(labelLocationList); Collections.reverse(labelList); for (LabelLocation location : labelList) { if (location.bounds.contains(x, y)) { return location.label; } } return null; } public int getViewOffsetX() { return zoneScale.getOffsetX(); } public int getViewOffsetY() { return zoneScale.getOffsetY(); } public void adjustGridSize(int delta) { zone.getGrid().setSize(Math.max(0, zone.getGrid().getSize() + delta)); repaint(); } public void moveGridBy(int dx, int dy) { int gridOffsetX = zone.getGrid().getOffsetX(); int gridOffsetY = zone.getGrid().getOffsetY(); gridOffsetX += dx; gridOffsetY += dy; if (gridOffsetY > 0) { gridOffsetY = gridOffsetY - (int)zone.getGrid().getCellHeight(); } if (gridOffsetX > 0) { gridOffsetX = gridOffsetX - (int)zone.getGrid().getCellWidth(); } zone.getGrid().setOffset(gridOffsetX, gridOffsetY); repaint(); } /** * Since the map can be scaled, this is a convenience method to find out * what cell is at this location. * * @param screenPoint Find the cell for this point. * @return The cell coordinates of the passed screen point. */ public CellPoint getCellAt(ScreenPoint screenPoint) { ZonePoint zp = screenPoint.convertToZone(this); return zone.getGrid().convert(zp); } public void setScale(double scale) { zoneScale.setScale(scale); } public double getScale() { return zoneScale.getScale(); } public double getScaledGridSize() { // Optimize: only need to calc this when grid size or scale changes return getScale() * zone.getGrid().getSize(); } /** * This makes sure that any image updates get refreshed. This could be a little smarter. */ @Override public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) { repaint(); return super.imageUpdate(img, infoflags, x, y, w, h); } /** * Represents a movement set */ private class SelectionSet { private HashSet<GUID> selectionSet = new HashSet<GUID>(); private GUID keyToken; private String playerId; private ZoneWalker walker; private Token token; private Path<ZonePoint> gridlessPath; // Pixel distance from keyToken's origin private int offsetX; private int offsetY; public SelectionSet(String playerId, GUID tokenGUID, Set<GUID> selectionList) { selectionSet.addAll(selectionList); keyToken = tokenGUID; this.playerId = playerId; token = zone.getToken(tokenGUID); if (token.isSnapToGrid() && zone.getGrid().getCapabilities().isSnapToGridSupported()) { if (ZoneRenderer.this.zone.getGrid().getCapabilities().isPathingSupported()) { CellPoint tokenPoint = zone.getGrid().convert(new ZonePoint(token.getX(), token.getY())); walker = ZoneRenderer.this.zone.getGrid().createZoneWalker(); walker.setWaypoints(tokenPoint, tokenPoint); } } else { gridlessPath = new Path<ZonePoint>(); } } public ZoneWalker getWalker() { return walker; } public GUID getKeyToken() { return keyToken; } public Set<GUID> getTokens() { return selectionSet; } public boolean contains(Token token) { return selectionSet.contains(token.getId()); } public void setOffset(int x, int y) { offsetX = x; offsetY = y; if (ZoneRenderer.this.zone.getGrid().getCapabilities().isPathingSupported() && token.isSnapToGrid()) { CellPoint point = zone.getGrid().convert(new ZonePoint( token.getX()+x, token.getY()+y)); walker.replaceLastWaypoint(point); } } /** * Add the waypoint if it is a new waypoint. If it is * an old waypoint remove it. * * @param location The point where the waypoint is toggled. */ public void toggleWaypoint(ZonePoint location) { // CellPoint cp = renderer.getZone().getGrid().convert(new ZonePoint(dragStartX, dragStartY)); if (token.isSnapToGrid()) { walker.toggleWaypoint(getZone().getGrid().convert(location)); } else { gridlessPath.addWayPoint(location); gridlessPath.addPathCell(location); } } public int getOffsetX() { return offsetX; } public int getOffsetY() { return offsetY; } public String getPlayerId() { return playerId; } } private class TokenLocation { public Area bounds; public Rectangle2D origBounds; public Token token; public Rectangle boundsCache; public int height; public int width; public double scaledHeight; public double scaledWidth; public double x; public double y; public int offsetX; public int offsetY; public TokenLocation(Area bounds, Rectangle2D origBounds, Token token, double x, double y, int width, int height, double scaledWidth, double scaledHeight) { this.bounds = bounds; this.token = token; this.origBounds = origBounds; this.width = width; this.height = height; this.scaledWidth = scaledWidth; this.scaledHeight = scaledHeight; this.x = x; this.y = y; offsetX = getViewOffsetX(); offsetY = getViewOffsetY(); boundsCache = bounds.getBounds(); } public boolean maybeOnscreen(Rectangle viewport) { int deltaX = getViewOffsetX() - offsetX; int deltaY = getViewOffsetY() - offsetY; boundsCache.x += deltaX; boundsCache.y += deltaY; offsetX = getViewOffsetX(); offsetY = getViewOffsetY(); if (!boundsCache.intersects(viewport)) { return false; } return true; } } private static class LabelLocation { public Rectangle bounds; public Label label; public LabelLocation(Rectangle bounds, Label label) { this.bounds = bounds; this.label = label; } } //// // DROP TARGET LISTENER /* (non-Javadoc) * @see java.awt.dnd.DropTargetListener#dragEnter(java.awt.dnd.DropTargetDragEvent) */ public void dragEnter(DropTargetDragEvent dtde) {} /* (non-Javadoc) * @see java.awt.dnd.DropTargetListener#dragExit(java.awt.dnd.DropTargetEvent) */ public void dragExit(DropTargetEvent dte) {} /* (non-Javadoc) * @see java.awt.dnd.DropTargetListener#dragOver (java.awt.dnd.DropTargetDragEvent) */ public void dragOver(DropTargetDragEvent dtde) { } private void addTokens(List<Token> tokens, ZonePoint zp, boolean configureToken) { GridCapabilities gridCaps = zone.getGrid().getCapabilities(); boolean isGM = MapTool.getPlayer().isGM(); ScreenPoint sp = ScreenPoint.fromZonePoint(this, zp); Point dropPoint = new Point((int)sp.x, (int)sp.y); SwingUtilities.convertPointToScreen(dropPoint, this); for (Token token : tokens) { // Get the snap to grid value for the current prefs and abilities token.setSnapToGrid(gridCaps.isSnapToGridSupported() && AppPreferences.getTokensStartSnapToGrid()); if (gridCaps.isSnapToGridSupported() && token.isSnapToGrid()) { zp = zone.getGrid().convert(zone.getGrid().convert(zp)); } token.setX(zp.x); token.setY(zp.y); // Set the image properties if (configureToken) { BufferedImage image = ImageManager.getImageAndWait(AssetManager.getAsset(token.getImageAssetId())); token.setShape(TokenUtil.guessTokenType((BufferedImage)image)); token.setWidth(image.getWidth(null)); token.setHeight(image.getHeight(null)); token.setFootprint(zone.getGrid(), zone.getGrid().getDefaultFootprint()); } // Always set the layer token.setLayer(getActiveLayer()); // He who drops, owns, if there are not players already set if (!token.hasOwners() && !isGM) { token.addOwner(MapTool.getPlayer().getName()); } // Token type Rectangle size = token.getBounds(zone); switch (getActiveLayer()) { case TOKEN: { // Players can't drop invisible tokens token.setVisible(!isGM || AppPreferences.getNewTokensVisible()); if (AppPreferences.getTokensStartFreesize()) { token.setSnapToScale(false); } break; } case BACKGROUND: { token.setShape (Token.TokenShape.TOP_DOWN); token.setSnapToScale(!AppPreferences.getBackgroundsStartFreesize()); token.setSnapToGrid(AppPreferences.getBackgroundsStartSnapToGrid()); token.setVisible(AppPreferences.getNewBackgroundsVisible()); // Center on drop point if (!token.isSnapToScale() && !token.isSnapToGrid()) { token.setX(token.getX() - size.width/2); token.setY(token.getY() - size.height/2); } break; } case OBJECT: { token.setShape(Token.TokenShape.TOP_DOWN); token.setSnapToScale(!AppPreferences.getObjectsStartFreesize()); token.setSnapToGrid(AppPreferences.getObjectsStartSnapToGrid()); token.setVisible(AppPreferences.getNewObjectsVisible()); // Center on drop point if (!token.isSnapToScale() && !token.isSnapToGrid()) { token.setX(token.getX() - size.width/2); token.setY(token.getY() - size.height/2); } break; } } // Check the name (after Token layer is set as name relies on layer) token.setName(MapToolUtil.nextTokenId(zone, token)); // Token type if (isGM) { token.setType(Token.Type.NPC); if (getActiveLayer() == Zone.Layer.TOKEN) { if (AppPreferences.getShowDialogOnNewToken()) { NewTokenDialog dialog = new NewTokenDialog(token, dropPoint.x, dropPoint.y); dialog.showDialog(); if (!dialog.isSuccess()) { continue; } } } } else { // Player dropped, player token token.setType(Token.Type.PC); } // Save the token and tell everybody about it zone.putToken(token); MapTool.serverCommand().putToken(zone.getId(), token); } // For convenience, select them clearSelectedTokens(); for (Token token : tokens) { selectToken(token.getId()); } // Copy them to the clipboard so that we can quickly copy them onto the map AppActions.copyTokens(tokens); requestFocusInWindow(); repaint(); } /* * (non-Javadoc) * * @see java.awt.dnd.DropTargetListener#drop (java.awt.dnd.DropTargetDropEvent) */ public void drop(DropTargetDropEvent dtde) { final ZonePoint zp = new ScreenPoint((int) dtde.getLocation().getX(), (int) dtde.getLocation().getY()).convertToZone(this); Transferable t = dtde.getTransferable(); if (!(TransferableHelper.isSupportedAssetFlavor(t) || TransferableHelper.isSupportedTokenFlavor(t)) || (dtde.getDropAction () & DnDConstants.ACTION_COPY_OR_MOVE) == 0) { dtde.rejectDrop(); // Not a supported flavor or not a copy/move return; } dtde.acceptDrop(dtde.getDropAction()); List<Token> tokens = null; List assets = TransferableHelper.getAsset(dtde); if (assets != null) { tokens = new ArrayList<Token>(assets.size()); for (Object working : assets) { if (working instanceof Asset) { Asset asset = (Asset)working; tokens.add(new Token(asset.getName(), asset.getId())); } else if (working instanceof Token) { tokens.add(new Token((Token)working)); } } addTokens(tokens, zp, true); } else { if (t.isDataFlavorSupported(TransferableToken.dataFlavor)) { try { // Make a copy so that it gets a new unique GUID tokens = Collections.singletonList(new Token((Token)t.getTransferData(TransferableToken.dataFlavor))); addTokens(tokens, zp, false); } catch (UnsupportedFlavorException ufe) { ufe.printStackTrace(); } catch (IOException ioe) { ioe.printStackTrace(); } } else { tokens = TransferableHelper.getTokens(dtde.getTransferable ()); addTokens(tokens, zp, true); } } dtde.dropComplete(tokens != null); } /* (non-Javadoc) * @see java.awt.dnd.DropTargetListener#dropActionChanged (java.awt.dnd.DropTargetDragEvent) */ public void dropActionChanged(DropTargetDragEvent dtde) { // TODO Auto-generated method stub } //// // ZONE MODEL CHANGE LISTENER private class ZoneModelChangeListener implements ModelChangeListener { public void modelChanged(ModelChangeEvent event) { Object evt = event.getEvent(); if (evt == Zone.Event.TOPOLOGY_CHANGED) { flushFog = true; visibleScreenArea = null; } if (evt == Zone.Event.TOKEN_CHANGED || evt == Zone.Event.TOKEN_REMOVED) { flush((Token)event.getArg()); } if (evt == Zone.Event.FOG_CHANGED) { flushFog = true; } MapTool.getFrame().updateTokenTree(); repaint(); } } //// // COMPARABLE public int compareTo(Object o) { if (!(o instanceof ZoneRenderer)) { return 0; } return zone.getCreationTime() < ((ZoneRenderer)o).zone.getCreationTime() ? -1 : 1; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
e44f1737ef759597d065f1b9e94379375318db85
d1cf6e57ba346219347fdfae98e585eb9190cdcc
/MyAVL.java
3193d75e26fc0247ae72190616254e129c119e32
[]
no_license
SYM1000/algorithms-and-data-structures
8ca3afa1d2a58ec1e05d29fb0604460bf4b6a916
15cc146bb19ccd9a0b544a64821eba4b5f9ef689
refs/heads/master
2020-06-18T13:49:23.514598
2020-02-24T15:18:58
2020-02-24T15:18:58
196,323,414
2
0
null
null
null
null
UTF-8
Java
false
false
6,817
java
import java.io.IOException; import java.util.HashMap; import java.util.NoSuchElementException; import java.util.Stack; public class MyAVL<E extends Comparable<E>> { private NodoAVL<E> root; private int size; public MyAVL() { super(); } //Metodo altura public int altura(NodoAVL<E> raiz){ try { if(raiz == null) { return 0; }else { if(raiz.left != null && raiz.right != null) { //Escoger el subarbol mayor int hIzq = altura(raiz.left); int hDer = altura(raiz.right); if(hIzq > hDer) { return hIzq +1; }else { return hDer + 1; } }else if(raiz.left != null && raiz.right == null){ return altura(raiz.left) +1; }else if(raiz.left == null && raiz.right != null) { return altura(raiz.right) +1; }else { return 0; } } }catch (NullPointerException e) { return 0; } } //Rotación simple Izquierda public void rotacionSimpleIzquierda(NodoAVL<E> pivote) { NodoAVL<E> nuevoPivote = pivote.right; NodoAVL<E> medio = nuevoPivote.left; nuevoPivote.left = pivote; pivote.right = medio; pivote.factorBalanceo = (altura(pivote.right) - altura(pivote.left)); nuevoPivote.factorBalanceo = (altura(nuevoPivote.right) - altura(nuevoPivote.left)); //medio.factorBalanceo = (altura(medio.right) - altura(medio.left)); System.out.println("Nuevo pivote en RSI:" + nuevoPivote.value); } //Rotacion simple Derecha public void rotacioneSimpleDerecha(NodoAVL<E> pivote) { NodoAVL<E> nuevoPivote = pivote.left; NodoAVL<E> medio = nuevoPivote.right; pivote.left = medio; nuevoPivote.right = pivote; pivote.factorBalanceo = (altura(pivote.right) - altura(pivote.left)); nuevoPivote.factorBalanceo = (altura(nuevoPivote.right) - altura(nuevoPivote.left)); System.out.println("Nuevo pivote en RSD:" + nuevoPivote.value); } //Rotacion Doble Izquierda public void rotacioneDobleIzquierda(NodoAVL<E> pivote){ NodoAVL<E> subpivote = pivote.right; rotacioneSimpleDerecha(subpivote); rotacionSimpleIzquierda(pivote); } //Rotacioón doble Derecha public void rotacioneDobleDerecha(NodoAVL<E> pivote, NodoAVL<E> current ){ } //Metodo Insert public void insert(E value) { Stack<NodoAVL<E>> pila = new Stack<NodoAVL<E>>(); NodoAVL<E> current = this.root; NodoAVL<E> NodoNuevo = new NodoAVL<E>(value, null, null); if(this.root == null) { this.root = new NodoAVL<E>(value, null, null); }else { while(current != null) { pila.add(current); //Se añade el nodo a la pila if(value.compareTo(current.value)<0) { if(current.left != null) { current = current.left; }else { current.left = NodoNuevo; break; } }else { if(current.right != null) { current = current.right; }else { current.right = NodoNuevo; break; } } } } size++; //Termina el Insert Normal //Inicia el equilibrio del arbol current = NodoNuevo; int FactorBalanceoNuevo = -1; NodoAVL<E> NodoPop = new NodoAVL<E>(value, null, null); while(!pila.isEmpty() && FactorBalanceoNuevo != 0) { NodoPop = pila.pop(); FactorBalanceoNuevo = NodoPop.factorBalanceo; if(current == NodoPop.left) { FactorBalanceoNuevo-=1; }else { FactorBalanceoNuevo+=1; } NodoPop.factorBalanceo = FactorBalanceoNuevo; //En caso de que el factor de balanceo esté fuera de los rangos, se hace una rotación if(FactorBalanceoNuevo < -1 || FactorBalanceoNuevo > 1) { //Rotacion simple a la izquierda if(NodoPop.factorBalanceo > 1 && current.factorBalanceo >=0) { System.out.println("Se hace una rotacion simple a la izquierda en el nodo " + NodoPop.value + " que tiene un factor de balanceo de " + NodoPop.factorBalanceo); this.rotacionSimpleIzquierda(NodoPop); NodoAVL<E> aux = current; current = NodoPop; NodoPop = aux; System.out.println("Se hace una rotacion simple a la izquierda en el nodo " + NodoPop.value + " que tiene un factor de balanceo de " + NodoPop.factorBalanceo); System.out.println("Nodo pivote es: " + NodoPop.value + " fb: " + NodoPop.factorBalanceo ); System.out.println("Nodo current es: " + current.value + " fb: " + current.factorBalanceo ); //Rotacion simple a la derecha }else if(NodoPop.factorBalanceo < 1 && current.factorBalanceo <=0) { System.out.println("Se hace una rotacion simple a la derecha en el nodo " + NodoPop.value + " que tiene un factor de balanceo de " + NodoPop.factorBalanceo); rotacioneSimpleDerecha(NodoPop); NodoAVL<E> aux = current; current = NodoPop; NodoPop = aux; System.out.println("Nodo pivote es: " + NodoPop.value + " fb: " + NodoPop.factorBalanceo ); System.out.println("Nodo current es: " + current.value + " fb: " + current.factorBalanceo ); //Rotacion doble a la izquierda }else if(NodoPop.factorBalanceo > 1 && current.factorBalanceo <0) { System.out.println("Se hace una rotacion doble a la izquierda en el nodo " + NodoPop.value + " que tiene un factor de balanceo de " + NodoPop.factorBalanceo); rotacioneDobleIzquierda(NodoPop); System.out.println("Se hace una rotacion doble a la izquierda en el nodo " + NodoPop.value + " que tiene un factor de balanceo de " + NodoPop.factorBalanceo); //Rotacion doble a la derecha }else if(NodoPop.factorBalanceo < 1 && current.factorBalanceo <0) { System.out.println("Se hace una rotacion doble a la derecha en el nodo " + NodoPop.value + " que tiene un factor de balanceo de " + NodoPop.factorBalanceo); } } current = NodoPop; } } public static void main(String[] args) { MyAVL<Integer> arbol = new MyAVL<Integer>(); /* arbol.insert(25); arbol.insert(30); arbol.insert(18); arbol.insert(15); arbol.insert(22); arbol.insert(35); arbol.insert(33); */ arbol.insert(5); arbol.insert(3); arbol.insert(2); System.out.println(arbol.root.value); /* arbol.insert(10); arbol.insert(5); arbol.insert(15); arbol.insert(13); arbol.insert(20); arbol.insert(14); */ } } class NodoAVL<E extends Comparable<E>>{ final E value; int factorBalanceo; NodoAVL<E> left; NodoAVL<E> right; public NodoAVL(E value, NodoAVL<E> left, NodoAVL<E> right) { super(); this.value = value; this.left = left; this.right = right; } public E getValue() { return value; } public NodoAVL<E> getLeft() { return left; } public void setLeft(NodoAVL<E> left) { this.left = left; } public NodoAVL<E> getRight() { return right; } public void setRight(NodoAVL<E> right) { this.right = right; } }
[ "noreply@github.com" ]
noreply@github.com
0a45bb28031798be034159ea695b86f087d16500
3729763ddb479b21c7f3a5f1e0a9954500850b52
/Sources/com/workday/sources/WorkerInsuranceCoverageDataType.java
c1fdfdcd46af806d815309b9788145956d3eb80f
[]
no_license
SANDEEPERUMALLA/workdayscanner
fe0816e9a95de73a598d6e29be5b20aeeca6cb60
8a4c3660cc588402aa49f948afe2168c4faa9df5
refs/heads/master
2020-03-18T22:30:21.218489
2018-05-29T20:24:36
2018-05-29T20:24:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,415
java
package com.workday.sources; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * Contains the insurance election information for the employee. * * <p>Java class for Worker_Insurance_Coverage_DataType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="Worker_Insurance_Coverage_DataType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Insurance_Coverage_Level_Data" type="{urn:com.workday/bsvc}Insurance_Coverage_Level_DataType"/> * &lt;element name="Benefit_Election_Data" type="{urn:com.workday/bsvc}Worker_Benefit_Election_DataType"/> * &lt;element name="Dependent_Coverage_Data" type="{urn:com.workday/bsvc}Dependent_Coverage_DataType" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="Beneficiary_Designation_Data" type="{urn:com.workday/bsvc}Beneficiary_Designation_DataType" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Worker_Insurance_Coverage_DataType", propOrder = { "insuranceCoverageLevelData", "benefitElectionData", "dependentCoverageData", "beneficiaryDesignationData" }) public class WorkerInsuranceCoverageDataType { @XmlElement(name = "Insurance_Coverage_Level_Data", required = true) protected InsuranceCoverageLevelDataType insuranceCoverageLevelData; @XmlElement(name = "Benefit_Election_Data", required = true) protected WorkerBenefitElectionDataType benefitElectionData; @XmlElement(name = "Dependent_Coverage_Data") protected List<DependentCoverageDataType> dependentCoverageData; @XmlElement(name = "Beneficiary_Designation_Data") protected List<BeneficiaryDesignationDataType> beneficiaryDesignationData; /** * Gets the value of the insuranceCoverageLevelData property. * * @return * possible object is * {@link InsuranceCoverageLevelDataType } * */ public InsuranceCoverageLevelDataType getInsuranceCoverageLevelData() { return insuranceCoverageLevelData; } /** * Sets the value of the insuranceCoverageLevelData property. * * @param value * allowed object is * {@link InsuranceCoverageLevelDataType } * */ public void setInsuranceCoverageLevelData(InsuranceCoverageLevelDataType value) { this.insuranceCoverageLevelData = value; } /** * Gets the value of the benefitElectionData property. * * @return * possible object is * {@link WorkerBenefitElectionDataType } * */ public WorkerBenefitElectionDataType getBenefitElectionData() { return benefitElectionData; } /** * Sets the value of the benefitElectionData property. * * @param value * allowed object is * {@link WorkerBenefitElectionDataType } * */ public void setBenefitElectionData(WorkerBenefitElectionDataType value) { this.benefitElectionData = value; } /** * Gets the value of the dependentCoverageData property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the dependentCoverageData property. * * <p> * For example, to add a new item, do as follows: * <pre> * getDependentCoverageData().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link DependentCoverageDataType } * * */ public List<DependentCoverageDataType> getDependentCoverageData() { if (dependentCoverageData == null) { dependentCoverageData = new ArrayList<DependentCoverageDataType>(); } return this.dependentCoverageData; } /** * Gets the value of the beneficiaryDesignationData property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the beneficiaryDesignationData property. * * <p> * For example, to add a new item, do as follows: * <pre> * getBeneficiaryDesignationData().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link BeneficiaryDesignationDataType } * * */ public List<BeneficiaryDesignationDataType> getBeneficiaryDesignationData() { if (beneficiaryDesignationData == null) { beneficiaryDesignationData = new ArrayList<BeneficiaryDesignationDataType>(); } return this.beneficiaryDesignationData; } }
[ "p.sandeepkumargupta@gmail.com" ]
p.sandeepkumargupta@gmail.com
ebe5f5a9c8889250afe8906d19ac8040b543af8d
2c3e635c0c322a8bc104f57b27463314e47332ac
/src/com/example/helloworld/HelloWorldService.java
c6ce6093021f539fdfbe1632afd200ef95f1222b
[]
no_license
dharmeshkakadia/Hello-Dropwizard
a63ea7602b750cad325379358d43763eb65320a6
b6e195b291c41f1a6222d8854adad3b6e129927c
refs/heads/master
2021-01-19T08:20:57.511772
2014-10-09T19:04:37
2014-10-09T19:04:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,016
java
package com.example.helloworld; import com.example.helloworld.health.TemplateHealthCheck; import com.example.helloworld.resources.HelloWorldResource; import com.yammer.dropwizard.Service; import com.yammer.dropwizard.config.Bootstrap; import com.yammer.dropwizard.config.Environment; public class HelloWorldService extends Service<HelloWorldConfiguration> { public static void main(String[] args) throws Exception { new HelloWorldService().run(args); } @Override public void initialize(Bootstrap<HelloWorldConfiguration> bootstrap) { bootstrap.setName("hello-world"); } @Override public void run(HelloWorldConfiguration configuration, Environment environment) { final String template = configuration.getTemplate(); final String defaultName = configuration.getDefaultName(); environment.addResource(new HelloWorldResource(template,defaultName)); environment.addHealthCheck(new TemplateHealthCheck(template)); } }
[ "dharmesh.kakadia@gmail.com" ]
dharmesh.kakadia@gmail.com
82e1d65cf8c260401588c65e79c6f4341a4da986
e086ce70685307d348c89f5abcd3283891213674
/poc/src/main/java/net/fvogel/repo/AccountRepository.java
501e78d908a0a3e6adfa4045025baa44f98325b6
[]
no_license
radyak/ssg
3590e5711ba2358e764a30afd7e4c0f9033a7791
daf18e39125202cfc18df28e62f3e06eba7ee4fe
refs/heads/master
2021-09-16T05:38:55.624909
2018-01-16T17:21:48
2018-01-16T17:21:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
285
java
package net.fvogel.repo; import net.fvogel.model.Account; import org.springframework.data.jpa.repository.JpaRepository; public interface AccountRepository extends JpaRepository<Account, Long> { Account findByUserName(String userName); Account findByEmail(String email); }
[ "florian.vogel@iteratec.de" ]
florian.vogel@iteratec.de
2929b810dde2e5fe45eba078b1f109676666af13
bf35259ca4a6f7410d6b28cf85f3075e5f84525f
/messageboard-dao/src/test/java/com/hzit/test/Test_Userinfo.java
749b9bba315679624f7466e7778ac47add673799
[]
no_license
huangkangluan/messageboard
d34bd21885dd2ceb3bb461f80fca6224511b1227
b88c54b6787a0e848514f3da4a292baae29d3ee6
refs/heads/master
2021-01-11T03:06:47.078114
2016-10-17T08:24:32
2016-10-17T08:24:32
71,115,836
1
0
null
null
null
null
UTF-8
Java
false
false
2,534
java
package com.hzit.test; import com.hzit.dao.entity.Messageboard; import com.hzit.dao.entity.Userinfo; import com.hzit.dao.mapper.MessageboardMapper; import com.hzit.dao.mapper.UserinfoMapper; import com.hzit.dao.vo.MessageboardVo; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; import org.junit.Before; import org.junit.Test; import java.io.IOException; import java.io.Reader; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; /** * Created by Administrator on 2016/9/14. */ public class Test_Userinfo { UserinfoMapper userinfoMapper; MessageboardMapper messageboardMapper; SqlSession session; @Before public void init(){ try { //有一个配置文件,需要利用输入流读取到这配置文件 Reader reader= Resources.getResourceAsReader("conf.xml"); //有这个输入流,通过这个输入流创建session工厂 SqlSessionFactory sessionFactory=new SqlSessionFactoryBuilder().build(reader); session=sessionFactory.openSession(); //通过session获取到UserinfoMapper接口的实现类对象 userinfoMapper=session.getMapper(UserinfoMapper.class); messageboardMapper=session.getMapper(MessageboardMapper.class); } catch (IOException e) { e.printStackTrace(); } } @Test public void one(){ Userinfo u=userinfoMapper.find_userName_userPwd("xiaobai","123"); System.out.println(u); } @Test public void two(){ Messageboard m=new Messageboard(); m.setBoardId(UUID.randomUUID().toString()); m.setSenduserId(1); m.setReceiveuserId(2); m.setMessageContext(""); messageboardMapper.addMessageboard(m); session.commit(); } @Test public void three(){ messageboardMapper.deleteMessageboard("0e439db8-4ea0-4b5c-a58a-c5af495c28eb"); session.commit(); } @Test public void four(){ Map map=new HashMap(); //map.put("boardId","3"); List<MessageboardVo> list=messageboardMapper.searchUserinfoByParams(map,1); for (MessageboardVo m:list){ System.out.println(m.getSendusername()); } } @Test public void five(){ int num=messageboardMapper.getcount(1); System.out.println(num); } }
[ "853854757@qq.com" ]
853854757@qq.com
11bc9f43d58043280da396da86f6cd2d4dcae6d0
2141fdaeea294da986f7325a4b0a62a9f58abe43
/language/src/main/java/org/jaitools/jiffle/parser/UndefinedOptionException.java
3155272ab98e734193f5feee100f6cdbdd2b27c3
[]
no_license
mbedward/jiffle
e1a63209e281f97aed86dc1be5584605c04886a2
05e54357c1eec59a7a9f1791ab55bb89386eb311
refs/heads/master
2022-10-13T16:19:08.500055
2022-09-22T04:38:10
2022-09-22T04:38:10
7,638,504
8
1
null
2013-08-14T00:49:44
2013-01-16T03:29:38
Java
UTF-8
Java
false
false
2,003
java
/* * Copyright (c) 2011, Michael Bedward. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jaitools.jiffle.parser; /** * An exception thrown by {@link OptionLookup} when the Jiffle compiler * is attempting to parse a call to an undefined option. * * @author Michael Bedward * @since 0.1 * @version $Id$ */ public class UndefinedOptionException extends Exception { /** * Creates a new exception with the unrecognized option name in * the message. * * @param optionName unrecognized function name */ public UndefinedOptionException(String optionName) { super("Undefined option: " + optionName); } }
[ "michael.bedward@63c71440-3485-52f5-eb52-b97a624288c4" ]
michael.bedward@63c71440-3485-52f5-eb52-b97a624288c4
c9c50eb02adab03926caeecac4a561c2afce226e
6e6a0127dc06e0744ac52b2a71a976415033863c
/08-log/daisyfs/daisy/src/main/java/daisy/Utility.java
045a8c3bd8b03a206cb3b154f828da0ad2d71eaf
[]
no_license
jiriklepl/NproVyvoj-2019
8e6a684b8736300fe0a9eddc01ddd49eb988296f
862a9a252cefddc2a8df3fce30d8b3c2a2b1713a
refs/heads/master
2022-01-06T12:30:34.989365
2021-12-11T02:53:28
2021-12-11T02:53:28
217,521,138
1
0
null
2022-01-04T16:35:48
2019-10-25T11:41:20
C
UTF-8
Java
false
false
905
java
/* * This file is part of the Daisy distribution. This software is * distributed 'as is' without any guarantees whatsoever. It may be * used freely for research but may not be used in any commercial * products. The contents of this distribution should not be posted * on the web or distributed without the consent of the authors. * * Authors: Cormac Flanagan, Stephen N. Freund, Shaz Qadeer * Contact: Shaz Qadeer (qadeer@microsoft.com) */ package daisy; public class Utility { public static void longToBytes(long n, byte b[], int offset) { for (int i = 0; i < 8; i++) { b[offset + i] = (byte)(n & 0xff); n = n >> 8; } } public static long bytesToLong(byte b[], int offset) { long n = 0; for (int i = 7; i >= 0; i--) { n = (n << 8) + (b[offset + i] & 0xff); } return n; } }
[ "jiriklepl@seznam.cz" ]
jiriklepl@seznam.cz
9b2a07ae82ca9d70b3cd8911ecea24cdbb858e1b
6ecc2ce9e9b2549e44d2a54d620dcd4fc0766428
/Card.java
8c66655689c47978debe7dfcf0583156497d7563
[ "MIT" ]
permissive
emgoinv/first-Java
08f9780c141075827254613c2360651789ca48ec
57fd011fcab9aa9335334a496edca7498fa444db
refs/heads/master
2020-03-11T11:40:52.859522
2018-08-17T12:47:25
2018-08-17T12:47:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
967
java
/** * contains data for a single card * * @author (Madeline Holda) * @version (02/22/2018) */ public class Card{ private int number, suit; /** 0=♥, 1=♦, 2=♣, 3=♠ * A-10 = 1-10; J = 11; Q = 12; K = 13 */ public Card(int num, int s){ number = num; suit = s; } public int getNum(){ return number; } public String toString(){ String str = ""; if(number<11 && number>1){ str += number; } else{ switch(number){ case 1: str += "A"; break; case 11: str += "J"; break; case 12: str += "Q"; break; case 13: str += "K"; break; } } switch(suit){ case 0: str += "♥"; break; case 1: str += "♦"; break; case 2: str += "♣"; break; case 3: str += "♠"; break; } return str; } }
[ "noreply@github.com" ]
noreply@github.com
0fc16bb79da12e7dfc59732f1f734c169623657a
2f375df7c86f8f94f80199422e15098f765be28b
/spring_w_akcji/spring-w-akcji-wydanie-iv-craig-walls/Chapter_08/SpringPizza/src/main/java/com/springinaction/pizza/domain/PizzaSize.java
9f9af37bf3acd55676093cd994a9bd83da45f17f
[]
no_license
Krzypio/code
b792996898584be786f52936050f3d27e1c4cc96
f890f408b0670ef7898118a26a4450c41f9645c4
refs/heads/main
2023-06-02T19:06:03.889808
2021-06-20T08:49:37
2021-06-20T08:49:37
318,825,450
0
1
null
null
null
null
UTF-8
Java
false
false
156
java
package com.springinaction.pizza.domain; import java.io.Serializable; public enum PizzaSize implements Serializable { MAŁA, ŚREDNIA, DUŻA, GIGANT; }
[ "krzysztofp10git@op.pl" ]
krzysztofp10git@op.pl
21779068388f7a6249931d003964fab52ea2f054
33e674bf24c6c43123c64535468f602e1476160a
/Assignment_2/test/Business/CarListTest.java
c3a67cc04a0ceaef06e95afd4240904770c1a453
[]
no_license
Bohan-Feng/Bohan_Feng_001564249
931b42aefae813c470d5244a2e4be57d1d9e13cb
ae76edaaefea642f465279645e8cf1a00a943489
refs/heads/master
2023-01-07T01:43:15.954865
2020-11-09T00:01:41
2020-11-09T00:01:41
296,948,037
0
0
null
2020-10-10T17:50:44
2020-09-19T20:39:08
Java
UTF-8
Java
false
false
8,155
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Business; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; /** * * @author Bohan */ public class CarListTest { private static List<List<String>> cars; private static CarList carList; public CarListTest() { } @BeforeClass public static void setUpClass() throws IOException { readFile(); carList = getCars(); } public static void readFile() throws FileNotFoundException, IOException{ cars = new ArrayList<>(); try (BufferedReader br = new BufferedReader(new FileReader("carsData\\out.csv"))) { String line; br.readLine(); while ((line = br.readLine()) != null) { String COMMA_DELIMITER = ","; String[] values = line.split(COMMA_DELIMITER); cars.add(Arrays.asList(values)); } } int i = 0; while(i < 5){ for(String s : cars.get(i)){ System.out.print(s + ","); } System.out.println(); i++; } System.out.println(); } public static CarList getCars(){ CarList carlist = new CarList(); for(List<String> carInfo : cars){ Car carToAdd = new Car(); String[] uptime = carInfo.get(7).split("/"); String[] maintaintime = carInfo.get(8).split("/"); carToAdd.setIsAvaliable(carInfo.get(0).equals("True")); carToAdd.setMaker(carInfo.get(1)); carToAdd.setManufactureYear(Integer.parseInt(carInfo.get(2))); carToAdd.setSeatNum(Integer.parseInt(carInfo.get(3))); carToAdd.setSeriesNum(carInfo.get(4)); carToAdd.setModel(carInfo.get(5)); carToAdd.setCity(carInfo.get(6)); carToAdd.setUpdateTime(new Date(Integer.parseInt(uptime[2])-1900,Integer.parseInt(uptime[0])-1,Integer.parseInt(uptime[1]))); carToAdd.setMaintanceExpiredDate(new Date(Integer.parseInt(maintaintime[2])-1900,Integer.parseInt(maintaintime[0])-1,Integer.parseInt(maintaintime[1]))); carlist.add(carToAdd); } return carlist; } @AfterClass public static void tearDownClass() { } @Before public void setUp() { } @After public void tearDown() { } @Test public void testCarInfoLoaded(){ System.out.println("testCarInfoLoaded"); int i = 0; while(i < 5){ System.out.println(carList.get(i)); i++; } System.out.println(); } /** * Test of getFirstAvaliabeCar method, of class CarList. */ @Test public void testGetFirstAvaliabeCar() { System.out.println("getFirstAvaliabeCar"); Car result = carList.getFirstAvaliabeCar(); assertNotNull(result); System.out.println(result); System.out.println(); } /** * Test of getNumOfAvaliableCars method, of class CarList. */ @Test public void testGetNumOfAvaliableCars() { System.out.println("getNumOfAvaliableCars"); int result = carList.getNumOfAvaliableCars(); assertEquals(1890, result); System.out.println(result); System.out.println(); } /** * Test of getNumOfUnavaliableCars method, of class CarList. */ @Test public void testGetNumOfUnavaliableCars() { System.out.println("getNumOfUnavaliableCars"); int result = carList.getNumOfUnavaliableCars(); assertEquals(2499 - 1890, result); System.out.println(result + "\n"); } /** * Test of getCarsByMaker method, of class CarList. */ @Test public void testGetCarsByMaker() { System.out.println("getCarsByMaker"); String maker = "ford"; CarList result = carList.getCarsByMaker(maker); assertNotNull(result); for(int i = 0; i < 5; i++){ System.out.println(result.get(i)); } System.out.println(); } /** * Test of getCarsByYear method, of class CarList. */ @Test public void testGetCarsByYear() { System.out.println("getCarsByYear"); int year = 2011; CarList result = carList.getCarsByYear(year); assertNotNull(result); for(int i = 0; i < 5; i++){ System.out.println(result.get(i)); } System.out.println(); } /** * Test of getCarsBySeats method, of class CarList. */ @Test public void testGetCarsBySeats() { System.out.println("getCarsBySeats"); int min = 1; int max = 4; CarList result = carList.getCarsBySeats(min, max); assertNotNull(result); for(int i = 0; i < 5; i++){ System.out.println(result.get(i)); } System.out.println(); } /** * Test of getCarBySerialNum method, of class CarList. */ @Test public void testGetCarBySerialNum() { System.out.println("getCarBySerialNum"); String serial = "2fmdk3gc4bbb02217"; String expResult = "Car{isAvaliable=false, maker=ford, manufactureYear=2011, seatNum=1, SeriesNum=2fmdk3gc4bbb02217, model=se, city=tennessee, updateTime=2016-04-15, maintanceExpiredDate=2022-07-04}"; Car result = carList.getCarBySerialNum(serial); assertEquals(expResult, result.toString()); System.out.println(result + "\n"); } /** * Test of getCarsByModel method, of class CarList. */ @Test public void testGetCarsByModel() { System.out.println("getCarsByModel"); String model = "door"; CarList result = carList.getCarsByModel(model); assertNotNull(result); for(int i = 0; i < 5; i++){ System.out.println(result.get(i)); } System.out.println(); } /** * Test of getAllMakers method, of class CarList. */ @Test public void testGetAllMakers() { System.out.println("getAllMakers"); ArrayList<String> result = carList.getAllMakers(); assertNotNull(result); for(int i = 0; i < 5; i++){ System.out.println(result.get(i)); } System.out.println(); } /** * Test of getLatestUpdate method, of class CarList. */ @Test public void testGetLatestUpdate() { System.out.println("getLatestUpdate"); CarList instance = carList; Date result = instance.getLatestUpdate(); assertNotNull(result); System.out.println(result + "\n"); } /** * Test of getCarsByLocation method, of class CarList. */ @Test public void testGetCarsByLocation() { System.out.println("getCarsByLocation"); String location = "ohio"; CarList instance = carList; CarList result = instance.getCarsByLocation(location); assertNotNull(result); for(int i = 0; i < 5; i++){ System.out.println(result.get(i)); } System.out.println(); } /** * Test of getExperiedCars method, of class CarList. */ @Test public void testGetExperiedCars() { System.out.println("getExsperiedCars"); CarList instance = carList; CarList result = instance.getExperiedCars(); assertNotNull( result); for(int i = 0; i < 5; i++){ System.out.println(result.get(i)); } System.out.println(); } }
[ "fengb3@gmail.com" ]
fengb3@gmail.com
b99095d4a38bf369a1f8d9912f05b8d23a7755bf
d4f9bcfc3ef740b146dd3cc06e5532dd2bd17578
/JavaFX/src/ch/makery/address/MainApp.java
3eb7bc3062907f6b6df2fe03e0792db67a8e0aa2
[]
no_license
parthmodi1996/PS4
39b77a05b7789443c7517ea33412087293db4fe1
c0811c685a59b8ed51d56ade5dfa3b6db04327d8
refs/heads/master
2021-01-10T05:23:40.817477
2015-10-07T06:44:19
2015-10-07T06:44:19
43,799,052
0
0
null
null
null
null
UTF-8
Java
false
false
10,505
java
package ch.makery.address; import java.io.File; import java.io.IOException; import java.util.prefs.Preferences; import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; import javafx.application.Application; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.scene.control.Alert.AlertType; import javafx.scene.image.Image; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.BorderPane; import javafx.stage.Modality; import javafx.stage.Stage; import ch.makery.address.model.Person; import ch.makery.address.model.PersonListWrapper; import ch.makery.address.view.BirthdayStatisticsController; import ch.makery.address.view.PersonEditDialogController; import ch.makery.address.view.PersonOverviewController; import ch.makery.address.view.RootLayoutController; public class MainApp extends Application { private Stage primaryStage; private BorderPane rootLayout; // ... AFTER THE OTHER VARIABLES ... /** * The data as an observable list of Persons. */ private ObservableList<Person> personData = FXCollections.observableArrayList(); /** * Constructor */ public MainApp() { // Add some sample data personData.add(new Person("Hans", "Muster")); personData.add(new Person("Ruth", "Mueller")); personData.add(new Person("Heinz", "Kurz")); personData.add(new Person("Cornelia", "Meier")); personData.add(new Person("Werner", "Meyer")); personData.add(new Person("Lydia", "Kunz")); personData.add(new Person("Anna", "Best")); personData.add(new Person("Stefan", "Meier")); personData.add(new Person("Martin", "Mueller")); } /** * Returns the data as an observable list of Persons. * @return */ public ObservableList<Person> getPersonData() { return personData; } // ... THE REST OF THE CLASS ... @Override public void start(Stage primaryStage) { this.primaryStage = primaryStage; this.primaryStage.setTitle("AddressApp"); // Set application icon this.primaryStage.getIcons().add(new Image("file:resources/images/1443657185_Address_Book_Alt_blue.png")); initRootLayout(); showPersonOverview(); } /** * Initializes the root layout and tries to load the last opened * person file. */ public void initRootLayout() { try { // Load root layout from fxml file. FXMLLoader loader = new FXMLLoader(); loader.setLocation(MainApp.class .getResource("view/RootLayout.fxml")); rootLayout = (BorderPane) loader.load(); // Show the scene containing the root layout. Scene scene = new Scene(rootLayout); primaryStage.setScene(scene); // Give the controller access to the main app. RootLayoutController controller = loader.getController(); controller.setMainApp(this); primaryStage.show(); } catch (IOException e) { e.printStackTrace(); } // Try to load last opened person file. File file = getPersonFilePath(); if (file != null) { loadPersonDataFromFile(file); } } /** * Shows the person overview inside the root layout. */ public void showPersonOverview() { try { // Load person overview. FXMLLoader loader = new FXMLLoader(); loader.setLocation(MainApp.class.getResource("view/PersonOverview.fxml")); AnchorPane personOverview = (AnchorPane) loader.load(); // Set person overview into the center of root layout. rootLayout.setCenter(personOverview); // Give the controller access to the main app. PersonOverviewController controller = loader.getController(); controller.setMainApp(this); } catch (IOException e) { e.printStackTrace(); } } /** * Returns the main stage. * @return */ public Stage getPrimaryStage() { return primaryStage; } public static void main(String[] args) { launch(args); } /** * Opens a dialog to edit details for the specified person. If the user * clicks OK, the changes are saved into the provided person object and true * is returned. * * @param person the person object to be edited * @return true if the user clicked OK, false otherwise. */ public boolean showPersonEditDialog(Person person) { try { // Load the fxml file and create a new stage for the popup dialog. FXMLLoader loader = new FXMLLoader(); loader.setLocation(MainApp.class.getResource("view/PersonEditDialog.fxml")); AnchorPane page = (AnchorPane) loader.load(); // Create the dialog Stage. Stage dialogStage = new Stage(); dialogStage.setTitle("Edit Person"); dialogStage.initModality(Modality.WINDOW_MODAL); dialogStage.initOwner(primaryStage); Scene scene = new Scene(page); dialogStage.setScene(scene); // Set the person into the controller. PersonEditDialogController controller = loader.getController(); controller.setDialogStage(dialogStage); controller.setPerson(person); // Show the dialog and wait until the user closes it dialogStage.showAndWait(); return controller.isOkClicked(); } catch (IOException e) { e.printStackTrace(); return false; } } /** * Returns the person file preference, i.e. the file that was last opened. * The preference is read from the OS specific registry. If no such * preference can be found, null is returned. * * @return */ public File getPersonFilePath() { Preferences prefs = Preferences.userNodeForPackage(MainApp.class); String filePath = prefs.get("filePath", null); if (filePath != null) { return new File(filePath); } else { return null; } } /** * Sets the file path of the currently loaded file. The path is persisted in * the OS specific registry. * * @param file the file or null to remove the path */ public void setPersonFilePath(File file) { Preferences prefs = Preferences.userNodeForPackage(MainApp.class); if (file != null) { prefs.put("filePath", file.getPath()); // Update the stage title. primaryStage.setTitle("AddressApp - " + file.getName()); } else { prefs.remove("filePath"); // Update the stage title. primaryStage.setTitle("AddressApp"); } } /** * Loads person data from the specified file. The current person data will * be replaced. * * @param file */ public void loadPersonDataFromFile(File file) { try { JAXBContext context = JAXBContext .newInstance(PersonListWrapper.class); Unmarshaller um = context.createUnmarshaller(); // Reading XML from the file and unmarshalling. PersonListWrapper wrapper = (PersonListWrapper) um.unmarshal(file); personData.clear(); personData.addAll(wrapper.getPersons()); // Save the file path to the registry. setPersonFilePath(file); } catch (Exception e) { // catches ANY exception Alert alert = new Alert(AlertType.ERROR); alert.setTitle("Error"); alert.setHeaderText("Could not load data"); alert.setContentText("Could not load data from file:\n" + file.getPath()); alert.showAndWait(); } } /** * Saves the current person data to the specified file. * * @param file */ public void savePersonDataToFile(File file) { try { JAXBContext context = JAXBContext .newInstance(PersonListWrapper.class); Marshaller m = context.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); // Wrapping our person data. PersonListWrapper wrapper = new PersonListWrapper(); wrapper.setPersons(personData); // Marshalling and saving XML to the file. m.marshal(wrapper, file); // Save the file path to the registry. setPersonFilePath(file); } catch (Exception e) { // catches ANY exception Alert alert = new Alert(AlertType.ERROR); alert.setTitle("Error"); alert.setHeaderText("Could not save data"); alert.setContentText("Could not save data to file:\n" + file.getPath()); alert.showAndWait(); } } /** * Opens a dialog to show birthday statistics. */ public void showBirthdayStatistics() { try { // Load the fxml file and create a new stage for the popup. FXMLLoader loader = new FXMLLoader(); loader.setLocation(MainApp.class.getResource("view/BirthdayStatistics.fxml")); AnchorPane page = (AnchorPane) loader.load(); Stage dialogStage = new Stage(); dialogStage.setTitle("Birthday Statistics"); dialogStage.initModality(Modality.WINDOW_MODAL); dialogStage.initOwner(primaryStage); Scene scene = new Scene(page); dialogStage.setScene(scene); // Set the persons into the controller. BirthdayStatisticsController controller = loader.getController(); controller.setPersonData(personData); dialogStage.show(); } catch (IOException e) { e.printStackTrace(); } } }
[ "parth@udel.edu" ]
parth@udel.edu
5f04c6e67ad40f282030b56a7106eab35acacf98
af76efa622dc75513e3acbd23c5bcfe99355231b
/src/main/java/com/gsyndic/syndyc/domain/AbstractAuditingEntity.java
7fcad138e46e4d80a9df28881ad1e2243f9dce1f
[]
no_license
sarah-hammami/sarah-gst-application
d02e06f563cba5cc083a378e94608aceb4781a52
58709a6b6c8f557a74b60ad647aed2ef5bfdbfd5
refs/heads/master
2020-03-24T15:46:17.614543
2018-07-29T22:49:57
2018-07-29T22:49:57
142,800,963
0
0
null
null
null
null
UTF-8
Java
false
false
2,233
java
package com.gsyndic.syndyc.domain; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.hibernate.envers.Audited; import org.springframework.data.annotation.CreatedBy; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import java.time.Instant; import javax.persistence.Column; import javax.persistence.EntityListeners; import javax.persistence.MappedSuperclass; /** * Base abstract class for entities which will hold definitions for created, last modified by and created, * last modified by date. */ @MappedSuperclass @Audited @EntityListeners(AuditingEntityListener.class) public abstract class AbstractAuditingEntity implements Serializable { private static final long serialVersionUID = 1L; @CreatedBy @Column(name = "created_by", nullable = false, length = 50, updatable = false) @JsonIgnore private String createdBy; @CreatedDate @Column(name = "created_date", nullable = false, updatable = false) @JsonIgnore private Instant createdDate = Instant.now(); @LastModifiedBy @Column(name = "last_modified_by", length = 50) @JsonIgnore private String lastModifiedBy; @LastModifiedDate @Column(name = "last_modified_date") @JsonIgnore private Instant lastModifiedDate = Instant.now(); public String getCreatedBy() { return createdBy; } public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } public Instant getCreatedDate() { return createdDate; } public void setCreatedDate(Instant createdDate) { this.createdDate = createdDate; } public String getLastModifiedBy() { return lastModifiedBy; } public void setLastModifiedBy(String lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; } public Instant getLastModifiedDate() { return lastModifiedDate; } public void setLastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
ccbcd84bc4aa7f184c916ec3ff28f54f6afd4442
f4e7541cfb40bd821da95566e5a3e17ab48b16fd
/common/src/main/java/com/tang/common/zxing/decode/DecodeThread.java
f9cb16fd1eee3b95342e55d19c089e7f43542377
[]
no_license
wangtotang/MyBaseLibrary
959157e5e2b51570eebde7cc5909ed6e57ce30ae
83d31ef55beb310d35df0f630538074551a7343f
refs/heads/master
2023-02-14T16:59:38.940644
2021-01-13T01:09:55
2021-01-13T01:09:55
274,122,597
0
0
null
null
null
null
UTF-8
Java
false
false
3,025
java
/* * Copyright (C) 2008 ZXing 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 com.tang.common.zxing.decode; import android.os.Handler; import android.os.Looper; import com.google.zxing.BarcodeFormat; import com.google.zxing.DecodeHintType; import com.tang.common.zxing.activity.CaptureActivity; import java.util.ArrayList; import java.util.Collection; import java.util.EnumMap; import java.util.EnumSet; import java.util.Map; import java.util.concurrent.CountDownLatch; /** * This thread does all the heavy lifting of decoding the images. * * @author dswitkin@google.com (Daniel Switkin) */ public class DecodeThread extends Thread { public static final String BARCODE_BITMAP = "barcode_bitmap"; public static final int BARCODE_MODE = 0X100; public static final int QRCODE_MODE = 0X200; public static final int ALL_MODE = 0X300; private final CaptureActivity activity; private final Map<DecodeHintType, Object> hints; private final CountDownLatch handlerInitLatch; private Handler handler; public DecodeThread(CaptureActivity activity, int decodeMode) { this.activity = activity; handlerInitLatch = new CountDownLatch(1); hints = new EnumMap<DecodeHintType, Object>(DecodeHintType.class); Collection<BarcodeFormat> decodeFormats = new ArrayList<BarcodeFormat>(); decodeFormats.addAll(EnumSet.of(BarcodeFormat.AZTEC)); decodeFormats.addAll(EnumSet.of(BarcodeFormat.PDF_417)); switch (decodeMode) { case BARCODE_MODE: decodeFormats.addAll(DecodeFormatManager.getBarCodeFormats()); break; case QRCODE_MODE: decodeFormats.addAll(DecodeFormatManager.getQrCodeFormats()); break; case ALL_MODE: decodeFormats.addAll(DecodeFormatManager.getBarCodeFormats()); decodeFormats.addAll(DecodeFormatManager.getQrCodeFormats()); break; default: break; } hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats); } public Handler getHandler() { try { handlerInitLatch.await(); } catch (InterruptedException ie) { // continue? } return handler; } @Override public void run() { Looper.prepare(); handler = new DecodeHandler(activity, hints); handlerInitLatch.countDown(); Looper.loop(); } }
[ "tanghongtu@ut.cn" ]
tanghongtu@ut.cn
dc93f2044f2dfb8b44dc41a255883a0ff8757045
36bbde826ff3e123716dce821020cf2a931abf6e
/tt2/core/src/main/gen/com/perl5/lang/tt2/psi/PsiArrayExpr.java
d12112a088f78b82c2c392e8e141dd821cad36a5
[ "Apache-2.0" ]
permissive
Camelcade/Perl5-IDEA
0332dd4794aab5ed91126a2c1ecd608f9c801447
deecc3c4fcdf93b4ff35dd31b4c7045dd7285407
refs/heads/master
2023-08-08T07:47:31.489233
2023-07-27T05:18:40
2023-07-27T06:17:04
33,823,684
323
79
NOASSERTION
2023-09-13T04:36:15
2015-04-12T16:09:15
Java
UTF-8
Java
false
true
285
java
// This is a generated file. Not intended for manual editing. package com.perl5.lang.tt2.psi; import java.util.List; import org.jetbrains.annotations.*; import com.intellij.psi.PsiElement; public interface PsiArrayExpr extends PsiExpr { @NotNull List<PsiExpr> getExprList(); }
[ "hurricup@gmail.com" ]
hurricup@gmail.com
9a2401bc783f60f3478cbb77eac254e83989765b
fa1600b0b0e17ffdd5ef7572277a4a58e9d29e6c
/2004/rts-mail-service/src/com/hps/july/rts/mail/template/OnFactCompletedDateAfterRequiredDateTemplate.java
eb288df859429e61e09138761b8b65cccddbacd5
[]
no_license
ildar66/WSAD_Collaboration
0e034960f98647f069aca867bba939d6ea43b33f
a2b5b8cea2bf5201e72d8210e9e0395fa69c23e3
refs/heads/master
2020-12-02T23:53:09.383736
2017-07-01T08:56:17
2017-07-01T08:56:17
95,952,957
0
0
null
null
null
null
WINDOWS-1251
Java
false
false
4,322
java
/* * $Id: OnFactCompletedDateAfterRequiredDateTemplate.java,v 1.1 2007/04/15 16:54:51 vglushkov Exp $ * Copyright (c) 2003 - 2006 ОАО Вымпелком */ package com.hps.july.rts.mail.template; import com.hps.july.rts.object.request.ElementaryRequest; import com.hps.july.rts.object.request.ConsolidatedRequest; import com.hps.july.rts.object.request.InitiatorRequest; import com.hps.july.mail.text.TextFormatter; import com.hps.july.mail.text.InputSource; import com.hps.april.auth.object.Person; import com.hps.april.common.utils.FormatUtils; import java.util.Collection; import java.util.List; import java.util.ArrayList; import java.util.Iterator; /** * RFC 060727 * При указании Исполнителем фактической даты исполнения, превышающей требуемую дату (инициатора) * проверка только при исполнеии всех заявок * оповещение: оповещение: РМ, КМ, Инициатора, пользователей из списка оповещения * @author <a href="mailto:vadim.glushkov@sntru.com">Vadim Glushkov</a> * @version $Revision: 1.1 $ $Date: 2007/04/15 16:54:51 $ * */ public class OnFactCompletedDateAfterRequiredDateTemplate extends RTSMailTemplate { protected ConsolidatedRequest consolidatedRequest; protected InitiatorRequest initiatorRequest; protected Collection mailPersonList; protected Collection visaMailPersonList; public OnFactCompletedDateAfterRequiredDateTemplate(ConsolidatedRequest cRequest, InitiatorRequest initiatorRequest, Collection mailPersonList, Collection visaPersonList) { this.consolidatedRequest = cRequest; this.initiatorRequest = initiatorRequest; this.mailPersonList = mailPersonList; this.visaMailPersonList = visaPersonList; } public void validateProperties() { if (consolidatedRequest == null) throw new IllegalArgumentException("ConsolidatedRequest must be defined"); if (initiatorRequest == null) throw new IllegalArgumentException("InitiatorRequest must be defined"); } public List getTo() { List recipientEmails = new ArrayList(); //список оповещения Person person = null; if(mailPersonList != null) { for (Iterator iter = mailPersonList.iterator(); iter.hasNext();) { person = (Person)iter.next(); if(person != null && person.getEmail() != null && !recipientEmails.contains(person.getEmail())) recipientEmails.add(person.getEmail()); } } return recipientEmails; } public List getCC() { List recipientEmails = new ArrayList(); //список оповещения Person person = null; if(visaMailPersonList != null) { for (Iterator iter = visaMailPersonList.iterator(); iter.hasNext();) { person = (Person)iter.next(); if(person != null && person.getEmail() != null && !recipientEmails.contains(person.getEmail())) recipientEmails.add(person.getEmail()); } } return recipientEmails; } public String getSubject() { StringBuffer msg = new StringBuffer(); msg.append("Внимание: Изменение планируемой даты исполнения заявки "); msg.append(consolidatedRequest.getNumber()); return msg.toString(); } public String getBody() { TextFormatter formatter = new TextFormatter(); formatter.addParameter("request", consolidatedRequest); formatter.addParameter("created", FormatUtils.formatDate(consolidatedRequest.getCreated(), "dd.MM.yyyy")); formatter.addParameter("requiredDate", FormatUtils.formatDate(initiatorRequest.getCompleteDate(), "dd.MM.yyyy")); formatter.addParameter("initiator", initiatorRequest.getInitiator().getName()); formatter.addParameter("initiatorPerson", initiatorRequest.getInitiatorPerson().getName()); return formatter.format(new InputSource(MailTemplateFactory.findTemplate(this))); } }
[ "ildar66@inbox.ru" ]
ildar66@inbox.ru
a27aff3914f6665fc0ea3e10d6f8d317e44505e7
50cfe726aaa36c70ac1e8f3267799175deb4ec9d
/weishi/src/main/java/com/atguigu/weishi/util/MsUtils.java
e75b92d709dd32bf4f1874fd81ff6392c822321e
[]
no_license
zzlllqqqq/shuojiweishi
7a345ce7e2f0be493de80698eb3ebe23a936d404
8938b4e455667abc850f9c73cfc89747737e1108
refs/heads/master
2021-01-18T15:06:56.779273
2016-01-14T14:24:03
2016-01-14T14:24:03
49,651,968
0
0
null
null
null
null
UTF-8
Java
false
false
5,588
java
package com.atguigu.weishi.util; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.graphics.drawable.Drawable; import android.media.MediaPlayer; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.telephony.SmsManager; import android.telephony.TelephonyManager; import android.widget.Toast; import com.atguigu.weishi.R; import com.atguigu.weishi.bean.AppInfo; import java.security.MessageDigest; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created by admin on 2015/12/25. */ public final class MsUtils { public static String getVersion(Context context) { String versionName = "版本未知"; PackageManager packageManager = context.getPackageManager(); try { PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0); versionName = packageInfo.versionName; } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } return versionName; } public static boolean isconnect(Context context) { boolean connect = false; ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo info = manager.getActiveNetworkInfo(); if(info != null) { connect = info.isConnected(); } return connect; } public static void showMsg(Context context, String msg) { Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); } public static String md5(String pwd) { StringBuffer sb = new StringBuffer(); try { //创建用于加密的加密对象 MessageDigest digest = MessageDigest.getInstance("md5"); //将字符串转换为一个16位的byte[] byte[] bytes = digest.digest(pwd.getBytes("utf-8")); for(byte b : bytes) {//遍历 //与255(0xff)做与运算(&)后得到一个255以内的数值 int number = b & 255;//也可以& 0xff //转化为16进制形式的字符串, 不足2位前面补0 String numberString = Integer.toHexString(number); if(numberString.length()==1) { numberString = 0+numberString; } //连接成密文 sb.append(numberString); } } catch (Exception e) { e.printStackTrace(); } return sb.toString(); } public static String getSimNumber(Context context) { TelephonyManager manager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); return manager.getSimSerialNumber(); } public static void sendSms(String number, String contant) { SmsManager.getDefault().sendTextMessage(number, null, contant, null, null); } public static void playAlert(Context context) { MediaPlayer player = MediaPlayer.create(context, R.raw.alert); player.setVolume(1, 1); player.setLooping(true); player.start(); } public static void resetPhone(Context context) { DevicePolicyManager manager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); manager.wipeData(0); } public static void lockScreen(Context context) { DevicePolicyManager manager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); manager.lockNow(); manager.resetPassword("123321", 0); } public static Map<Boolean, List<AppInfo>> getAllAppInfos(Context context) { Map<Boolean, List<AppInfo>> map = new HashMap<>(); List<AppInfo> systemInfos = new ArrayList<>(); List<AppInfo> userInfos = new ArrayList<>(); map.put(true, systemInfos); map.put(false, userInfos); PackageManager packageManager = context.getPackageManager(); Intent intent = new Intent();//匹配所有应用的主Activity intent.setAction(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); List<ResolveInfo> resolveInfos = packageManager.queryIntentActivities(intent, 0); for (ResolveInfo ri : resolveInfos) { //包名 String packageName = ri.activityInfo.packageName; //应用图标 Drawable icon = ri.loadIcon(packageManager); //应用名称 String appName = ri.loadLabel(packageManager).toString(); //是否是系统应用 boolean isSystemApp = false; try { isSystemApp = isSystemApp(packageManager, packageName); } catch (Exception e) { e.printStackTrace(); } AppInfo appInfo = new AppInfo(packageName, appName, icon, isSystemApp); if (appInfo.isSystem()) { systemInfos.add(appInfo); } else { userInfos.add(appInfo); } } return map; } private static boolean isSystemApp(PackageManager pm, String packageName) throws Exception { PackageInfo packageInfo = pm.getPackageInfo(packageName, 0); return (packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) > 0; } }
[ "zlq62199300" ]
zlq62199300
d82d6638dc37fefc6b201c0d2ed405babb847b2e
8de920261e0c11de884d508cf5236f7c75eafeb6
/Ch07/src/sub1/Account.java
fe2a2756fd8d3984e6a85736d2b77a73b191c322
[]
no_license
LK920/java
941167853afe686800554d921f9494ff509e4cbb
537c6349d792e371f11e293e7eaeeb3baecc1c0e
refs/heads/master
2023-01-05T18:41:54.591531
2020-10-28T03:28:57
2020-10-28T03:28:57
259,795,649
0
0
null
null
null
null
UHC
Java
false
false
1,105
java
package sub1; //Account(계좌)가 가지고 있는 특성과 기능 예시 public class Account { //특성(멤버변수) : 객체가 가지고 있는 정보 // - 접근권한 private 선언으로 무조건 캡슐화한다. // - 자식클래스에서 참조의 대상이 될대는 protected선언으로 수정 protected String bank; //은행이름 특성 protected String id; protected String name; protected int money; // 생성자 : 객체를 생성할 때 멤버변수를 초기화하는 메서드 Account (String bank, String id, String name, int money){ this.bank = bank; this.id = id; this.name = name; this.money = money; } //기능(메서드) public void deposit(int money) { this.money += money; //this는 account 클래스를 지시하는 지시대명사 } public void withdraw(int money) { this.money -= money; } public void info() { System.out.println("=============="); System.out.println("은행명 : "+bank); System.out.println("계좌번호 : "+id); System.out.println("입금 주 : "+name); System.out.println("전체금액 : "+money); } }
[ "hopeone1214@gmail.com" ]
hopeone1214@gmail.com
2d9045f38de4ab9af7d9beaaa805ed3b0b674374
5a5ad1283e545baa9456dca30f43a2198574a8e1
/app/src/main/java/com/imammuhtadi/weatheraround/screen/DashboardPresenter.java
f7d529859d912a6152b17c18bde8da1d83e1c6a9
[]
no_license
imammuhtadi/WheatherAround
ab114c247f81a17134bd6e1a59325f89ab32cbef
62c04ff963081513354c37cc670ffde735c6376c
refs/heads/master
2021-05-02T09:08:50.054698
2016-11-21T12:20:42
2016-11-21T12:20:42
72,844,929
0
0
null
null
null
null
UTF-8
Java
false
false
154
java
package com.imammuhtadi.weatheraround.screen; /** * Created by ADI on 21/11/2016. */ public interface DashboardPresenter { void loadWeather(); }
[ "muhtadiimam05@gmail.com" ]
muhtadiimam05@gmail.com
3e2c6317aa070ef7cc3b8d84ea9460641596a032
0261a6280f487bdea6f4d162ed24390f8f6eee57
/src/com/qianfeng/gl4study/snssdk/adapter/TutorialPagerAdapter.java
d670f1a16e6820598c7ca20b796745c512b12f00
[]
no_license
gurecn/Snssdk
8cca6dbbeb3582424e15ca789bbd50e57546128f
23fe28924ffde891bb3719f7119ec16b25f4a425
refs/heads/master
2021-10-27T09:44:19.992271
2016-10-09T06:30:11
2016-10-09T06:30:11
31,959,792
2
0
null
null
null
null
UTF-8
Java
false
false
862
java
package com.qianfeng.gl4study.snssdk.adapter; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import com.qianfeng.gl4study.snssdk.fragment.TutorialFragment; /** * Created with IntelliJ IDEA. * I'm glad to share my knowledge with you all. * User:Gaolei * Date:2015/3/20 * Email:pdsfgl@live.com */ public class TutorialPagerAdapter extends FragmentPagerAdapter { public TutorialPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int i) { Fragment fragment = null; fragment = new TutorialFragment(); Bundle args = new Bundle(); args.putInt("position",i); fragment.setArguments(args); return fragment; } @Override public int getCount() { return 3; } }
[ "pdsfgl@live.com" ]
pdsfgl@live.com
b3d9acc7cd2bea2a6d7101ec2f324d7df27d39d6
83436380fe01acf30dd154294b3da930e58c5ceb
/BelejanorProject/src/com/belejanor/switcher/bimo/pacs/camt_998_322/HeaderData.java
315d36ebc573adeb398123b2e59a89e47a6d0a60
[]
no_license
jmptrader/BelejanorSwitch
83e847ee3dc6a555a40e6347f40af4e106c9054f
ce11d46b5ed52b89d22b5890f1e4fad29730125a
refs/heads/master
2023-02-07T07:22:42.266465
2020-12-27T05:07:15
2020-12-27T05:07:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,308
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2018.03.01 at 02:23:08 PM COT // package com.belejanor.switcher.bimo.pacs.camt_998_322; import java.io.Serializable; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for HeaderData complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="HeaderData"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="OrigId" type="{urn:iso:std:iso:20022:tech:xsd:camt.998.322}OrigIdData"/> * &lt;element name="Sender" type="{urn:iso:std:iso:20022:tech:xsd:camt.998.322}EntityCode"/> * &lt;element name="Receiver" type="{urn:iso:std:iso:20022:tech:xsd:camt.998.322}EntityCode"/> * &lt;element name="Mge" type="{urn:iso:std:iso:20022:tech:xsd:camt.998.322}MjeData"/> * &lt;element name="CpyDplct" type="{urn:iso:std:iso:20022:tech:xsd:camt.998.322}CopyDuplicate1Code" minOccurs="0"/> * &lt;element name="PssblDplct" type="{urn:iso:std:iso:20022:tech:xsd:camt.998.322}Indicator"/> * &lt;element name="Prty" type="{urn:iso:std:iso:20022:tech:xsd:camt.998.322}Priority"/> * &lt;element name="Sgntr" type="{urn:iso:std:iso:20022:tech:xsd:camt.998.322}SignatureData" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @SuppressWarnings("serial") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "HeaderData", propOrder = { "origId", "sender", "receiver", "mge", "cpyDplct", "pssblDplct", "prty", "sgntr" }) public class HeaderData implements Serializable{ @XmlElement(name = "OrigId", required = true) protected OrigIdData origId; @XmlElement(name = "Sender", required = true) protected String sender; @XmlElement(name = "Receiver", required = true) protected String receiver; @XmlElement(name = "Mge", required = true) protected MjeData mge; @XmlElement(name = "CpyDplct") protected String cpyDplct; @XmlElement(name = "PssblDplct") protected boolean pssblDplct; @XmlElement(name = "Prty", required = true) protected Priority prty; @XmlElement(name = "Sgntr") protected SignatureData sgntr; /** * Gets the value of the origId property. * * @return * possible object is * {@link OrigIdData } * */ public OrigIdData getOrigId() { return origId; } /** * Sets the value of the origId property. * * @param value * allowed object is * {@link OrigIdData } * */ public void setOrigId(OrigIdData value) { this.origId = value; } /** * Gets the value of the sender property. * * @return * possible object is * {@link String } * */ public String getSender() { return sender; } /** * Sets the value of the sender property. * * @param value * allowed object is * {@link String } * */ public void setSender(String value) { this.sender = value; } /** * Gets the value of the receiver property. * * @return * possible object is * {@link String } * */ public String getReceiver() { return receiver; } /** * Sets the value of the receiver property. * * @param value * allowed object is * {@link String } * */ public void setReceiver(String value) { this.receiver = value; } /** * Gets the value of the mge property. * * @return * possible object is * {@link MjeData } * */ public MjeData getMge() { return mge; } /** * Sets the value of the mge property. * * @param value * allowed object is * {@link MjeData } * */ public void setMge(MjeData value) { this.mge = value; } /** * Gets the value of the cpyDplct property. * * @return * possible object is * {@link String } * */ public String getCpyDplct() { return cpyDplct; } /** * Sets the value of the cpyDplct property. * * @param value * allowed object is * {@link String } * */ public void setCpyDplct(String value) { this.cpyDplct = value; } /** * Gets the value of the pssblDplct property. * */ public boolean isPssblDplct() { return pssblDplct; } /** * Sets the value of the pssblDplct property. * */ public void setPssblDplct(boolean value) { this.pssblDplct = value; } /** * Gets the value of the prty property. * * @return * possible object is * {@link Priority } * */ public Priority getPrty() { return prty; } /** * Sets the value of the prty property. * * @param value * allowed object is * {@link Priority } * */ public void setPrty(Priority value) { this.prty = value; } /** * Gets the value of the sgntr property. * * @return * possible object is * {@link SignatureData } * */ public SignatureData getSgntr() { return sgntr; } /** * Sets the value of the sgntr property. * * @param value * allowed object is * {@link SignatureData } * */ public void setSgntr(SignatureData value) { this.sgntr = value; } }
[ "jorellana29@gmail.com" ]
jorellana29@gmail.com
834dc9bc61d6bd97cf926abb3bc6f7858360dfec
61339ce9984010d59ebcc2782e51674e81b9923f
/src/uk/ac/uclan/cs/erunner/RunnerThread.java
eb22a98666c41cd6ec11ed6e38d282cd7d30a54a
[]
no_license
batemanm/exprunner
c26657e63de9fb3988dbb8fc77391a4f0da78990
620d9b555341fdb4954b0362ea410289a4b13e2d
refs/heads/master
2021-01-12T08:25:14.265936
2016-12-15T15:07:39
2016-12-15T15:07:39
76,569,565
0
0
null
null
null
null
UTF-8
Java
false
false
1,928
java
package uk.ac.uclan.cs.erunner; import java.util.concurrent.Callable; import java.io.InputStream; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.List; import java.util.Random; public class RunnerThread implements Callable { private List <Parameters> parameters; private Runner runner = null; private Integer[] options; private Random random; public RunnerThread (Runner runner, Integer[] options, List<Parameters> parameters) { this.runner = runner; this.parameters = parameters; this.options = options; random = new Random (); } public String readStream (InputStream stream) { StringBuffer buffer = new StringBuffer (); try { String line = null; BufferedReader br = new BufferedReader (new InputStreamReader (stream)); while (br.ready ()) { line = br.readLine (); buffer.append (line); buffer.append ("\n"); } } catch (Exception e) { e.printStackTrace (); } return buffer.toString (); } public String call () { String line = ""; String command = runner.getCommand (); for (int i = 0; i < options.length; i ++) { try { String tag = parameters.get (i).getTag (); int index = options[i]; Object value = parameters.get (i).get (index); command = command.replaceAll (tag, value.toString ()); } catch (Exception e) { e.printStackTrace (); } } command = command.replaceAll ("%RANDOM%", new Integer (random.nextInt()).toString ()); if (!runner.isDone (command)) { runner.logStarted (command); try { Process process = Runtime.getRuntime ().exec (command); process.waitFor (); String stdOut = readStream (process.getInputStream ()); String stdErr = readStream (process.getErrorStream ()); process.getInputStream ().close (); process.getErrorStream ().close (); runner.logFinished (command, stdOut, stdErr); } catch (Exception e) { runner.logError (command); e.printStackTrace (); } } return null; } }
[ "batemanm@gmail.com" ]
batemanm@gmail.com
d7a1ec2ba72bf82638004cb7d6d0ce0038cf3a5e
5120b826c0b659cc609e7cecdf9718aba243dfb0
/b2b_acc/hybris/bin/platform/bootstrap/gensrc/de/hybris/platform/cms2lib/model/components/AbstractBannerComponentModel.java
63e3e056a71ddc433c5e75cb044173eabee3f321
[]
no_license
miztli/hybris
8447c85555676742b524aee901a5f559189a469a
ff84a5089a0d99899672e60c3a60436ab8bf7554
refs/heads/master
2022-10-26T07:21:44.657487
2019-05-28T20:30:10
2019-05-28T20:30:10
186,463,896
1
0
null
2022-09-16T18:38:27
2019-05-13T17:13:05
Java
UTF-8
Java
false
false
7,106
java
/* * ---------------------------------------------------------------- * --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! --- * --- Generated at May 28, 2019 3:18:54 PM --- * ---------------------------------------------------------------- * * [y] hybris Platform * Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.cms2lib.model.components; import de.hybris.bootstrap.annotations.Accessor; import de.hybris.platform.catalog.model.CatalogVersionModel; import de.hybris.platform.cms2.model.contents.components.SimpleCMSComponentModel; import de.hybris.platform.core.model.ItemModel; import de.hybris.platform.core.model.media.MediaModel; import de.hybris.platform.servicelayer.model.ItemModelContext; import java.util.Locale; /** * Generated model class for type AbstractBannerComponent first defined at extension cms2lib. */ @SuppressWarnings("all") public class AbstractBannerComponentModel extends SimpleCMSComponentModel { /**<i>Generated model type code constant.</i>*/ public static final String _TYPECODE = "AbstractBannerComponent"; /** <i>Generated constant</i> - Attribute key of <code>AbstractBannerComponent.media</code> attribute defined at extension <code>cms2lib</code>. */ public static final String MEDIA = "media"; /** <i>Generated constant</i> - Attribute key of <code>AbstractBannerComponent.urlLink</code> attribute defined at extension <code>cms2lib</code>. */ public static final String URLLINK = "urlLink"; /** <i>Generated constant</i> - Attribute key of <code>AbstractBannerComponent.external</code> attribute defined at extension <code>cms2lib</code>. */ public static final String EXTERNAL = "external"; /** * <i>Generated constructor</i> - Default constructor for generic creation. */ public AbstractBannerComponentModel() { super(); } /** * <i>Generated constructor</i> - Default constructor for creation with existing context * @param ctx the model context to be injected, must not be null */ public AbstractBannerComponentModel(final ItemModelContext ctx) { super(ctx); } /** * <i>Generated constructor</i> - Constructor with all mandatory attributes. * @deprecated since 4.1.1 Please use the default constructor without parameters * @param _catalogVersion initial attribute declared by type <code>CMSItem</code> at extension <code>cms2</code> * @param _external initial attribute declared by type <code>AbstractBannerComponent</code> at extension <code>cms2lib</code> * @param _uid initial attribute declared by type <code>CMSItem</code> at extension <code>cms2</code> */ @Deprecated public AbstractBannerComponentModel(final CatalogVersionModel _catalogVersion, final boolean _external, final String _uid) { super(); setCatalogVersion(_catalogVersion); setExternal(_external); setUid(_uid); } /** * <i>Generated constructor</i> - for all mandatory and initial attributes. * @deprecated since 4.1.1 Please use the default constructor without parameters * @param _catalogVersion initial attribute declared by type <code>CMSItem</code> at extension <code>cms2</code> * @param _external initial attribute declared by type <code>AbstractBannerComponent</code> at extension <code>cms2lib</code> * @param _owner initial attribute declared by type <code>Item</code> at extension <code>core</code> * @param _uid initial attribute declared by type <code>CMSItem</code> at extension <code>cms2</code> */ @Deprecated public AbstractBannerComponentModel(final CatalogVersionModel _catalogVersion, final boolean _external, final ItemModel _owner, final String _uid) { super(); setCatalogVersion(_catalogVersion); setExternal(_external); setOwner(_owner); setUid(_uid); } /** * <i>Generated method</i> - Getter of the <code>AbstractBannerComponent.media</code> attribute defined at extension <code>cms2lib</code>. * @return the media */ @Accessor(qualifier = "media", type = Accessor.Type.GETTER) public MediaModel getMedia() { return getMedia(null); } /** * <i>Generated method</i> - Getter of the <code>AbstractBannerComponent.media</code> attribute defined at extension <code>cms2lib</code>. * @param loc the value localization key * @return the media * @throws IllegalArgumentException if localization key cannot be mapped to data language */ @Accessor(qualifier = "media", type = Accessor.Type.GETTER) public MediaModel getMedia(final Locale loc) { return getPersistenceContext().getLocalizedValue(MEDIA, loc); } /** * <i>Generated method</i> - Getter of the <code>AbstractBannerComponent.urlLink</code> attribute defined at extension <code>cms2lib</code>. * @return the urlLink */ @Accessor(qualifier = "urlLink", type = Accessor.Type.GETTER) public String getUrlLink() { return getPersistenceContext().getPropertyValue(URLLINK); } /** * <i>Generated method</i> - Getter of the <code>AbstractBannerComponent.external</code> attribute defined at extension <code>cms2lib</code>. * @return the external */ @Accessor(qualifier = "external", type = Accessor.Type.GETTER) public boolean isExternal() { return toPrimitive((Boolean)getPersistenceContext().getPropertyValue(EXTERNAL)); } /** * <i>Generated method</i> - Setter of <code>AbstractBannerComponent.external</code> attribute defined at extension <code>cms2lib</code>. * * @param value the external */ @Accessor(qualifier = "external", type = Accessor.Type.SETTER) public void setExternal(final boolean value) { getPersistenceContext().setPropertyValue(EXTERNAL, toObject(value)); } /** * <i>Generated method</i> - Setter of <code>AbstractBannerComponent.media</code> attribute defined at extension <code>cms2lib</code>. * * @param value the media */ @Accessor(qualifier = "media", type = Accessor.Type.SETTER) public void setMedia(final MediaModel value) { setMedia(value,null); } /** * <i>Generated method</i> - Setter of <code>AbstractBannerComponent.media</code> attribute defined at extension <code>cms2lib</code>. * * @param value the media * @param loc the value localization key * @throws IllegalArgumentException if localization key cannot be mapped to data language */ @Accessor(qualifier = "media", type = Accessor.Type.SETTER) public void setMedia(final MediaModel value, final Locale loc) { getPersistenceContext().setLocalizedValue(MEDIA, loc, value); } /** * <i>Generated method</i> - Setter of <code>AbstractBannerComponent.urlLink</code> attribute defined at extension <code>cms2lib</code>. * * @param value the urlLink */ @Accessor(qualifier = "urlLink", type = Accessor.Type.SETTER) public void setUrlLink(final String value) { getPersistenceContext().setPropertyValue(URLLINK, value); } }
[ "miztlimelgoza@miztlis-MacBook-Pro.local" ]
miztlimelgoza@miztlis-MacBook-Pro.local
d987c4f15e6b94f998017fba390c8fa103fe0fa1
5a030aa8d76f0f10e70ebddd5db8e346a45d61b3
/app/src/main/java/br/com/rangeldev/consultacnpj/views/custom/CreatePDF.java
31825461f1f0570103f9087ec0db0f86ad661e9e
[]
no_license
correiarangel/app_consulta_cnpj
2a4b9010e349825c9324959ae0bf16d273855edf
02a847fa68a945f24c7fab271a6a189b336571b9
refs/heads/master
2021-06-22T10:58:39.149903
2021-03-28T20:07:24
2021-03-28T20:07:24
209,199,866
2
0
null
null
null
null
UTF-8
Java
false
false
4,735
java
package br.com.rangeldev.consultacnpj.views.custom; import android.annotation.SuppressLint; import android.os.Environment; import android.util.Log; import androidx.appcompat.app.AppCompatActivity; import br.com.rangeldev.consultacnpj.views.model.CnpjEmpresa; import com.itextpdf.text.Document; import com.itextpdf.text.PageSize; import com.itextpdf.text.Paragraph; import com.itextpdf.text.pdf.PdfWriter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.UUID; public class CreatePDF extends AppCompatActivity { private CnpjEmpresa empresa; public CreatePDF( CnpjEmpresa empresa) { this.empresa = empresa; } public void gerar( ) throws Exception { Document doc = null; FileOutputStream os = null; try { //cria o documento tamanho A4, margens de 2,54cm doc = new Document(PageSize.A4, 72, 72, 72, 72); //local do arquivo gerado String directory_path = Environment.getExternalStorageDirectory().getPath() + "/"; File file = new File(directory_path); if (!file.exists()) { file.mkdirs(); } //cria a stream de saída com nome unico UUID uuid = UUID.randomUUID(); String n_arq = uuid.toString(); String arq = "ConsulaCNPJ:"+n_arq+".pdf"; String targetPdf = directory_path + arq ; File filePath = new File(targetPdf); try { //cria a stream de saída associa a stream de saída os = new FileOutputStream(filePath); PdfWriter.getInstance(doc, os); //abre o documento doc.open(); //set OK em MSG KEY System.setProperty("MSG","OK"); System.setProperty("KEY_NAME_FILE",arq); } catch (IOException e) { Log.e("main", "error "+e.toString()); System.setProperty("MSG","ERROR"); } //capitura data e formata @SuppressLint("SimpleDateFormat") SimpleDateFormat dateFormat = new SimpleDateFormat ( "dd/MM/yyyy HH:mm:ss" ); Calendar cal = Calendar.getInstance ( ); Date data_atual = cal.getTime ( ); String dataAtual = dateFormat.format ( data_atual ); //adiciona o texto ao PDF Paragraph p = new Paragraph("CONSULTA DE CNPJ :"+dataAtual+"\n"+"\n"); p.add("CNPJ :"+empresa.getCnpj()+"\n"); p.add("Razão Social :"+empresa.getNome()+"\n"); p.add("Nome Fantasia:"+empresa.getFantasia()+"\n"); p.add("Status :"+empresa.getStatus()+"\n"); p.add("Ultima Atualização :"+ empresa.getUltima_atualizacao()+"\n"); p.add("Tipo :"+empresa.getTipo()+"\n"); p.add("Data Abetura :"+ empresa.getAbertura()+"\n"); p.add("Atividade principal:"+empresa.getAtividade_principal()+"\n"); p.add("Natureza Juridica :"+empresa.getNatureza_juridica()+"\n"); p.add("Longradouro:"+ empresa.getLogradouro()+"\n"); p.add("Numero :"+ empresa.getNumero()+"\n"); p.add("Complemento :"+ empresa.getComplemento()+"\n"); p.add("Bairro :"+ empresa.getBairro()+"\n"); p.add("CEP :"+ empresa.getCep()+"\n"); p.add("Municipio :"+ empresa.getMunicipio()+"\n"); p.add("Estado :"+ empresa.getUf()+"\n"); p.add("Porte :"+ empresa.getPorte()+"\n"); p.add("Email :"+ empresa.getEmail()+"\n"); p.add("Fone :"+ empresa.getTelefone()+"\n"); p.add("Situação :"+ empresa.getSituacao()+"\n"); p.add("Motivo Situação:"+ empresa.getMotivo_situacao()+"\n"); p.add("Situação Especial :"+ empresa.getSituacao_especial()+"\n"); p.add("Capital Social :"+ empresa.getQsa()+"\n"); p.add("Quadro de Socios :"+ empresa.getCapital_social()+"\n"); p.add("\n\n"); p.add("Desenvolvido por : Marcos F C Rangel e Wendreo Fernandes\n"); p.add("Contato:\n"); p.add("E-mail: correiarangel@bol.com.br ,Marcos F C Rangel\n"); p.add("E-mail: wendreolf@gmail.com ,Wendreo Fernandes"); doc.add( p ); } finally { if (doc != null) { //fechamento do documento doc.close(); } if (os != null) { //fechamento da stream de saída os.close(); } } } }
[ "correiarangel@bol.com.br" ]
correiarangel@bol.com.br
b4b81568945f38cc44e665daa57714d5958da290
7304252a4a5ae63c4adb905a311932588caeb255
/src/task_3/MusicDocument.java
841a686fbf5a8d270915d9421ad7d782d7fca9b5
[]
no_license
stinger679/prac10
cc122f0406b8ae957d9af0b43f57ce2bc4282c17
97f453991e0b83c0927489732f29c09cfb724eed
refs/heads/master
2023-01-09T14:52:51.733054
2020-11-06T19:51:37
2020-11-06T19:51:37
310,692,385
0
0
null
null
null
null
UTF-8
Java
false
false
283
java
package task_3; public class MusicDocument implements IDocument { @Override public void openDocument() { System.out.println("Opening MUSIC document"); } @Override public void newDocument() { System.out.println("Creating MUSIC document"); } }
[ "sundevice679@mail.ru" ]
sundevice679@mail.ru
cf0b66e505563c1d7b6041a13321eee7641be6be
7f0a3d828461ee81676f85a963e671c591096733
/55-Jump-Game/solution.java
0324ed9cd8f421be4f7ccadf7a46eaa954547f1d
[]
no_license
sundaram66/leetcode
b87c4a69afa5e6638cda544119cab32aa3907f04
a013ea4e2ade1289d3c6c6a5de38265e61a966c8
refs/heads/master
2020-05-21T17:39:33.333498
2016-10-18T11:04:26
2016-10-18T11:04:26
60,600,699
1
0
null
null
null
null
UTF-8
Java
false
false
646
java
public class Solution { public boolean canJump(int[] nums) { int n = nums.length; int maxIndex = nums[0]; for(int i=0;i<n;i++) { if(maxIndex >= n-1) return true; // Go only till the range(maxIndex) from Current Index if(i > maxIndex) return false; //maxIndex that can be reached from the currentIndex i, maxIndex = Math.max(maxIndex,i+nums[i]); } if(maxIndex >= n-1 || (maxIndex == 0 && n == 1)) return true; return false; } }
[ "seetharam.sundaram@imaginea.com" ]
seetharam.sundaram@imaginea.com
e10b68a057289e3ff3bd34e9e5602d22d4cda7d3
53b2063a4cd2ae22b61ebe09d292f92f0dc75417
/applications/appunorganized/appunorganized-plugins/org.csstudio.dct/src-vdct/com/cosylab/vdct/about/VisualDCTAboutDialogEngine.java
fc635c738227543b203dcec95a57b3cab665c77d
[]
no_license
ATNF/cs-studio
886d6cb2a3d626b761d4486f4243dd04cb21c055
f3ef004fd1566b8b47161b13a65990e8c741086a
refs/heads/master
2021-01-21T08:29:54.345483
2015-05-29T04:04:33
2015-05-29T04:04:33
11,189,876
1
0
null
null
null
null
UTF-8
Java
false
false
3,029
java
package com.cosylab.vdct.about; import java.awt.Component; import javax.swing.JFrame; /** * @author administrator * * To change this generated comment edit the template variable "typecomment": * Window>Preferences>Java>Templates. * To enable and disable the creation of type comments go to * Window>Preferences>Java>Code Generation. */ public class VisualDCTAboutDialogEngine extends AboutDialogEngine { /** * Constructor for DefaultAboutDialogEngine. * @param toAbout */ public VisualDCTAboutDialogEngine(Object toAbout) { super(toAbout); } /** * @see com.cosylab.gui.components.about.AboutDialogEngine#initializeReceiver() */ protected void initializeReceiver() { if (getAboutedObject() instanceof javax.swing.JFrame) { javax.swing.JFrame jf = (javax.swing.JFrame) aboutedObject; receiver = (new AboutDialog(jf, true)); instanceOfJFrame(jf); } else if (getAboutedObject() instanceof Component) { Component c = (Component) getAboutedObject(); while (c.getParent() != null) { c = c.getParent(); } //receiver = new AboutDialog(c, true); if (c instanceof JFrame) { javax.swing.JFrame jf = (javax.swing.JFrame) c; receiver = (new AboutDialog(jf, true)); instanceOfJFrame(jf); } else instanceOfComponent(c); } else { receiver = new AboutDialog(); } } /** * @see com.cosylab.gui.components.about.AboutDialogEngine#perform() */ protected void perform() { aquireDefaultTabs(); arrangeTabs(); } protected void aquireDefaultTabs(){ ProgramTabPanel ptp = new ProgramTabPanel(new VisualDCTProgramTabModel(aboutedObject)); receiver.setTitle("About " + ptp.getTitle()); addAboutTab(ptp); addAboutTab(new LicenseTabPanel(new VisualDCTLicenseTabModel(aboutedObject))); addAboutTab(new SystemTabPanel(new VisualDCTSystemTabModel())); } protected void instanceOfJFrame(javax.swing.JFrame jf) { int x = (int) (jf.getX() + 0.5 * jf.getWidth() - 0.5 * ((AboutDialog)receiver).getWidth()); int y = (int) (jf.getY() + 0.5 * jf.getHeight() - 0.5 * ((AboutDialog)receiver).getHeight()); if (x < 0) x = 0; if (y < 0) y = 0; ((AboutDialog)receiver).setBounds(x,y,((AboutDialog)receiver).getWidth(),((AboutDialog)receiver).getHeight()); } protected void instanceOfComponent(Component c) { int x = (int) (c.getX() + 0.5 * c.getWidth() - 0.5 * ((AboutDialog)receiver).getWidth()); int y = (int) (c.getY() + 0.5 * c.getHeight() - 0.5 * ((AboutDialog)receiver).getHeight()); if (x < 0) x = 0; if (y < 0) y = 0; ((AboutDialog)receiver).setBounds(x,y,((AboutDialog)receiver).getWidth(),((AboutDialog)receiver).getHeight()); } }
[ "eric.berryman@gmail.com" ]
eric.berryman@gmail.com
82cf05b41877bca8d4dd52bef9a38a77ea037750
a209e637995cc4f746834d621ecd61f47022986c
/publish-subscribe/src/main/java/com/rs/Send.java
28fa8b024f371569cf6409f6e61ad0502ef110d0
[]
no_license
WJDBJ/rabbitmq-parent
b6ec12ba388bb42c44a5e63eabd8e2e0a63d2834
8024192764571c5f0128b0e193e9c2f2bce95390
refs/heads/master
2022-12-25T21:55:59.276062
2020-03-12T04:41:55
2020-03-12T04:41:55
246,744,869
0
0
null
2022-12-15T23:26:00
2020-03-12T04:39:45
Java
UTF-8
Java
false
false
929
java
package com.rs; import com.ConnectionUtils; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import java.io.IOException; import java.util.concurrent.TimeoutException; /** * @author XJ */ public class Send { //定义交换器名称 private static final String EXCHANGE_NAME = "exchange"; public static void main(String[] args) { try (Connection connection = ConnectionUtils.getConnection(); Channel channel = connection.createChannel()){ //声明一个交换机 fanout 分发 channel.exchangeDeclare(EXCHANGE_NAME,"fanout"); String msg = "hello ps"; channel.basicPublish(EXCHANGE_NAME,"",null,msg.getBytes()); System.out.println("msg = " + msg); } catch (TimeoutException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }
[ "1286270834@qq.com" ]
1286270834@qq.com
924b557e68342c638144136b506a8a28efea68c4
59de555fe06e316c1885c2ed8a49d38d71b7f4ae
/Programacion_15/src/programacion_15/ejercicio5.java
48ea66357c89e88b3b34e54736df25e7111d3053
[]
no_license
istloja/ProgramacionOORafaelRodriguez
ad07b493bc674abf2fdb127f6b24e58cf23ca2c5
619204d6b364d8ed27007de288eaf65c7eaf8c27
refs/heads/master
2022-02-27T23:50:23.472365
2019-10-05T09:22:57
2019-10-05T09:22:57
197,848,041
0
0
null
null
null
null
UTF-8
Java
false
false
671
java
package programacion_15; import java.util.Scanner; public class ejercicio5 { // posicion public static void main(String[] args) { Scanner scan = new Scanner(System.in); String texto; System.out.println("Ingrese un el 1r Texto"); texto = scan.nextLine(); if (texto.length() > 10) { System.out.println("Su palabra tiene más de 10 Carácteres"); // texto.SetCharAt(0,"0"); // texto.SetCharAt(1,"0"); // System.out.println("Su NUEVA palabra es: "+texto); } else { System.out.println("Su palabra tiene: "+texto.length()+" Carácteres"); } } }
[ "noreply@github.com" ]
noreply@github.com
b65acc3b853478f2f9df4734371cfe0bae0573ca
a8ba67e6ff34178063651d8c29f496f2ea6ad97b
/src/array/sort/_179_largest_number.java
81477ca37994a81ec60ef463203670da4c445f83
[]
no_license
cyberwt/Leetcode
d7985043582708341c5e5e147a58f2f0d881c288
0bdb72d7e0612b0a16eee4fa3b4f29edea7434e0
refs/heads/master
2023-05-06T17:50:15.282777
2021-05-24T03:36:49
2021-05-24T03:36:49
269,114,359
0
0
null
null
null
null
UTF-8
Java
false
false
1,388
java
package array.sort; import java.util.Arrays; import java.util.Comparator; /** * 几个注意 * > 新建的 要是Integer数组,compareTo才好用 * > * Arrays.sort(n, new Comparator<Integer>){ * @override * public int compare(Integer val1, Integer val2){ * * } * } * * * 8/18/20. */ public class _179_largest_number { public String largestNumber(int[] nums) { Integer[] n = new Integer[nums.length]; for (int i = 0; i < nums.length; i++) { n[i] = nums[i]; } Arrays.sort(n, new Comparator<Integer>() { @Override public int compare(Integer n1, Integer n2) { String s1 = n1 + "" + n2; String s2 = n2 + "" + n1; //compareTo 方法 //如果参数是一个按字典顺序排列等于该字符串的字符串,则返回值为0; //如果参数是按字典顺序大于此字符串的字符串,则返回值小于0; //如果参数是按字典顺序小于此字符串的字符串,则返回值大于0。 return s2.compareTo(s1); } }); StringBuilder sb = new StringBuilder(); for (int i = 0; i < nums.length; i++) { sb.append(n[i]); } String res = sb.toString(); return res.charAt(0) == '0' ? "0" : res; } }
[ "weitonw@uci.edu" ]
weitonw@uci.edu
6c58aae656e9f2bc07cc331f2bb22c1a5439ca84
700d57b48a3b769819bc8b773affb84d740d9851
/src/main/java/ru/sfedu/course_project/api/DataProviderCSV.java
221d6a635af11bebe5ec4bf11a6463a5ddc16f25
[]
no_license
denisgridin/presitor-backend
0b0fffd9ab145baf873d62a8d351385fde3230a9
d6ead4c546f00c2ab498018040edccd96ebaa10f
refs/heads/master
2023-02-12T18:46:33.367073
2021-01-11T16:54:48
2021-01-11T16:54:48
315,736,114
0
0
null
null
null
null
UTF-8
Java
false
false
4,746
java
package ru.sfedu.course_project.api; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import ru.sfedu.course_project.api.csv.*; import ru.sfedu.course_project.bean.*; import ru.sfedu.course_project.enums.CollectionType; import ru.sfedu.course_project.enums.Status; import ru.sfedu.course_project.tools.*; import java.io.IOException; import java.util.*; public class DataProviderCSV implements DataProvider { private static Logger log = LogManager.getLogger(DataProviderCSV.class); public DataProviderCSV () {} public String getName () { return "CSV"; } /// Presentations section \\\ @Override public Result createPresentation(HashMap arguments) { return CSVPresentationMethods.createPresentation(arguments); } @Override public Result getPresentations () { return CSVPresentationMethods.getPresentations(); } @Override public Result getPresentationById (HashMap arguments) { return CSVPresentationMethods.getPresentationById(arguments); } @Override public Result removePresentationById (HashMap arguments) { return CSVPresentationMethods.removePresentationById(arguments); } @Override public Result editPresentationOptions (HashMap arguments) throws IOException { return CSVPresentationMethods.editPresentationOptions(arguments); } /// Slides section \\\ @Override public Result createPresentationSlide (HashMap arguments) { return CSVSlideMethods.createPresentationSlide(arguments); } @Override public Result getPresentationSlides (HashMap arguments) { return CSVSlideMethods.getPresentationSlides(arguments); } @Override public Result getSlideById (HashMap args) { return CSVSlideMethods.getSlideById(args); } @Override public Result editPresentationSlideById (HashMap args) { return CSVSlideMethods.editPresentationSlideById(args); } @Override public Result removePresentationSlideById (HashMap arguments) { return CSVSlideMethods.removePresentationSlideById(arguments); } @Override public Result commentPresentation (HashMap arguments) { return CSVCommentMethods.commentPresentation(arguments); } @Override public Result getPresentationComments (HashMap arguments) { return CSVCommentMethods.getPresentationComments(arguments); } public static Status writeCommentsCollection (Comment comment) { try { ArrayList comments = (ArrayList) CSVCommonMethods.getCollection(CollectionType.comment, Comment.class).orElse(new ArrayList()); comments.add(comment); Status status = CSVCommonMethods.writeCollection(comments, Comment.class, CollectionType.comment); return status; } catch (RuntimeException e) { log.error(e); return Status.error; } } @Override public Result editPresentationComment (HashMap arguments) { return CSVCommentMethods.editPresentationComment(arguments); } @Override public Result removePresentationCommentById (HashMap arguments) { return CSVCommentMethods.removePresentationCommentById(arguments); } @Override public Result addElementInSlide (HashMap args) { return CSVElementMethods.addElementInSlide(args); } @Override public Result removeSlideElement (HashMap args) { return CSVElementMethods.removeSlideElement(args); } @Override public Result editSlideElement (HashMap args) { return CSVElementMethods.editSlideElement(args); } @Override public Result getSlideElementById (HashMap arguments) { return CSVElementMethods.getSlideElementById(arguments); } @Override public Result getSlideElements (HashMap arguments) { return CSVElementMethods.getSlideElements(arguments); } @Override public Result rateByMark(HashMap arguments) { return CSVAssessmentMethods.rateByMark(arguments); } @Override public Result getPresentationMarks (HashMap args) { return CSVAssessmentMethods.getPresentationMarks(args); } @Override public Result removePresentationMarkById (HashMap args) { return CSVAssessmentMethods.removePresentationMarkById(args); } @Override public Result getMarkById (HashMap args) { return CSVAssessmentMethods.getMarkById(args); } @Override public Result editPresentationMark(HashMap arguments) { return CSVAssessmentMethods.editPresentationMark(arguments); } }
[ "denisgridin6@gmail.com" ]
denisgridin6@gmail.com
848dbfb347e8543af8085d78bd30645b4015b185
d9477e8e6e0d823cf2dec9823d7424732a7563c4
/plugins/XML/tags/release-2.8.7/xml/EditTagDialog.java
a5499d0b086fef2fcee4a2648ac43bdd1a127f98
[]
no_license
RobertHSchmidt/jedit
48fd8e1e9527e6f680de334d1903a0113f9e8380
2fbb392d6b569aefead29975b9be12e257fbe4eb
refs/heads/master
2023-08-30T02:52:55.676638
2018-07-11T13:28:01
2018-07-11T13:28:01
140,587,948
1
0
null
null
null
null
UTF-8
Java
false
false
16,815
java
/* * EditTagDialog.java * :tabSize=4:indentSize=4:noTabs=false: * :folding=explicit:collapseFolds=1: * * Copyright (C) 2000, 2003 Slava Pestov * * The XML plugin is licensed under the GNU General Public License, with * the following exception: * * "Permission is granted to link this code with software released under * the Apache license version 1.1, for example used by the Xerces XML * parser package." */ package xml; //{{{ Imports import javax.swing.table.*; import javax.swing.border.*; import javax.swing.*; import java.awt.event.*; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.util.*; import org.gjt.sp.jedit.gui.*; import org.gjt.sp.jedit.*; import org.gjt.sp.util.StandardUtilities; import xml.completion.*; import xml.completion.ElementDecl.AttributeDecl; import org.xml.sax.helpers.NamespaceSupport; //}}} public class EditTagDialog extends EnhancedDialog { //{{{ EditTagDialog constructor /** * elementName might not equal element.name due to case insensitivity * in HTML files. */ EditTagDialog(View view, String elementName, ElementDecl element, Map<String, Object> attributeValues, boolean elementEmpty, Map entityHash, List ids, boolean html, NamespaceBindings namespaces, NamespaceBindings namespacesToInsert) { super(view,jEdit.getProperty("xml-edit-tag.title"),true); this.elementName = elementName; this.element = element; this.entityHash = entityHash; this.html = html; this.namespaces = namespaces; this.namespacesToInsert = namespacesToInsert; JPanel content = new JPanel(new BorderLayout()); content.setBorder(new EmptyBorder(12,12,12,12)); setContentPane(content); //{{{ Top panel with element name, empty toggle JPanel top = new JPanel(new BorderLayout(6,0)); top.setBorder(new EmptyBorder(0,0,12,0)); top.add(BorderLayout.WEST,new JLabel( jEdit.getProperty("xml-edit-tag.element-name"))); top.add(BorderLayout.CENTER,new JLabel(element.name)); empty = new JCheckBox(jEdit.getProperty("xml-edit-tag.empty")); if(element.empty) { empty.setSelected(true); empty.setEnabled(false); } else empty.setSelected(elementEmpty); empty.addActionListener(new ActionHandler()); top.add(BorderLayout.EAST,empty); content.add(BorderLayout.NORTH,top); //}}} //{{{ Attribute table JPanel center = new JPanel(new BorderLayout()); attributeModel = createAttributeModel(element.attributes, attributeValues,ids); attributes = new AttributeTable(); attributes.setModel(new AttributeTableModel()); attributes.setRowHeight(new JComboBox(new String[] { "template" }) .getPreferredSize().height); attributes.getTableHeader().setReorderingAllowed(false); attributes.getColumnModel().getColumn(0).setPreferredWidth(30); attributes.setColumnSelectionAllowed(false); attributes.setRowSelectionAllowed(false); attributes.setCellSelectionEnabled(false); JScrollPane scroller = new JScrollPane(attributes); Dimension size = scroller.getPreferredSize(); size.height = Math.min(size.width,200); scroller.setPreferredSize(size); center.add(BorderLayout.CENTER,scroller); //}}} //{{{ Preview field JPanel previewPanel = new JPanel(new BorderLayout()); previewPanel.setBorder(new EmptyBorder(12,0,0,0)); previewPanel.add(BorderLayout.NORTH,new JLabel(jEdit.getProperty( "xml-edit-tag.preview"))); preview = new JTextArea(5,5); preview.setLineWrap(true); preview.setWrapStyleWord(true); preview.setEditable(false); previewPanel.add(BorderLayout.CENTER,new JScrollPane(preview)); center.add(BorderLayout.SOUTH,previewPanel); //}}} content.add(BorderLayout.CENTER,center); //{{{ Buttons JPanel buttons = new JPanel(); buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS)); buttons.setBorder(new EmptyBorder(12,0,0,0)); buttons.add(Box.createGlue()); buttons.add(ok = new JButton(jEdit.getProperty("common.ok"))); ok.addActionListener(new ActionHandler()); getRootPane().setDefaultButton(ok); buttons.add(Box.createHorizontalStrut(6)); buttons.add(cancel = new JButton(jEdit.getProperty("common.cancel"))); cancel.addActionListener(new ActionHandler()); buttons.add(cancel); buttons.add(Box.createGlue()); content.add(BorderLayout.SOUTH,buttons); //}}} updateTag(); setDefaultCloseOperation(DISPOSE_ON_CLOSE); pack(); setLocationRelativeTo(view); // request focus so the dialog can be disposed of by hitting Escape key SwingUtilities.invokeLater(new Runnable(){ @Override public void run() { requestFocus(); } }); setVisible(true); } //}}} //{{{ ok() method public void ok() { int row = attributes.getSelectedRow(); int column = attributes.getSelectedColumn(); if(row != -1 && column != -1) { if(attributes.getCellEditor(row,column) != null) attributes.getCellEditor(row,column).stopCellEditing(); } isOK = true; dispose(); } //}}} //{{{ cancel() method public void cancel() { isOK = false; dispose(); } //}}} //{{{ getNewTag() method public String getNewTag() { return (isOK ? newTag : null); } //}}} //{{{ isEmpty() method public boolean isEmpty() { return empty.isSelected(); } //}}} //{{{ Private members //{{{ Instance variables private boolean html; private String elementName; private ElementDecl element; private Map entityHash; private JCheckBox empty; private List<Attribute> attributeModel; private JTable attributes; private JTextArea preview; private JButton ok; private JButton cancel; private String newTag; private boolean isOK; private NamespaceBindings namespaces; private NamespaceBindings namespacesToInsert; //}}} //{{{ createAttributeModel() method private ArrayList<Attribute> createAttributeModel(List declaredAttributes, Map<String,Object> attributeValues, List ids) { ArrayList<String> stringIDs = new ArrayList<String>(ids.size()); for(int i = 0; i < ids.size(); i++) { stringIDs.add(((IDDecl)ids.get(i)).id); } ArrayList<Attribute> attributeModel = new ArrayList<Attribute>(); // keep original list of namespaces to insert, otherwise it gets polluted by namespaces of attributes not inserted NamespaceBindings localNamespacesToInsert = new NamespaceBindings(namespacesToInsert); for(int i = 0; i < declaredAttributes.size(); i++) { AttributeDecl attr = (AttributeDecl) declaredAttributes.get(i); String attrName = NamespaceBindings.composeName(attr.name, attr.namespace, namespaces, localNamespacesToInsert, false); boolean set; String value = (String)attributeValues.get(attrName); if(value == null) { set = false; value = attr.value; } else set = true; if(attr.required) set = true; ArrayList values; if(attr.type.equals("IDREF") && stringIDs.size() > 0) { values = stringIDs; if(value == null) value = (String)stringIDs.get(0); } else { values = attr.values; if(value == null && values != null && values.size() > 0) value = (String)values.get(0); } attributeModel.add(new Attribute(set,attrName,attr.namespace, value,values,attr.type,attr.required)); } Collections.sort(attributeModel,new AttributeCompare()); return attributeModel; } //}}} //{{{ updateTag() method private void updateTag() { int tagNameCase = TextUtilities.getStringCase(elementName); // only append namespaces really used or in the original namespacesToInsert NamespaceBindings localNamespacesToInsert = new NamespaceBindings(namespacesToInsert); StringBuilder buf = new StringBuilder("<"); buf.append(elementName); for(int i = 0; i < attributeModel.size(); i++) { Attribute attr = (Attribute)attributeModel.get(i); if(!attr.set) continue; buf.append(' '); String attrName = attr.name; if(html) { switch(tagNameCase) { case TextUtilities.UPPER_CASE: attrName = attr.name.toUpperCase(); break; case TextUtilities.LOWER_CASE: attrName = attr.name.toLowerCase(); break; case TextUtilities.TITLE_CASE: attrName = TextUtilities.toTitleCase( attr.name); break; } } else { String prefix = XmlParsedData.getElementNamePrefix(attrName); if(attr.namespace!=null && !"".equals(attr.namespace) && !NamespaceSupport.XMLNS.equals(attr.namespace) && !namespaces.containsNamespace(attr.namespace) && !localNamespacesToInsert.containsNamespace(attr.namespace)) { localNamespacesToInsert.put(attr.namespace,prefix); } } buf.append(attrName); if(html && attr.name.equals(attr.value.value)) { continue; } buf.append("=\""); if(attr.value.value != null) { buf.append(XmlActions.charactersToEntities( attr.value.value,entityHash)); } buf.append("\""); } localNamespacesToInsert.appendNamespaces(buf); if(empty.isSelected() && !html) buf.append("/"); buf.append(">"); newTag = buf.toString(); preview.setText(newTag); } //}}} //}}} //{{{ Inner classes //{{{ ActionHandler class class ActionHandler implements ActionListener { public void actionPerformed(ActionEvent evt) { if(evt.getSource() == empty) updateTag(); else if(evt.getSource() == ok) ok(); else if(evt.getSource() == cancel) cancel(); } } //}}} //{{{ Attribute class static class Attribute { //{{{ Instance variables boolean set; String name; String namespace; Value value; String type; boolean required; //}}} //{{{ Attribute constructor Attribute(boolean set, String name, String namespace, String value, ArrayList values, String type, boolean required) { this.set = set; this.name = name; this.namespace = namespace; this.value = new Value(value,values); this.type = type; this.required = required; } //}}} //{{{ Value class static class Value { String value; ArrayList values; Value(String value, ArrayList values) { this.value = value; this.values = values; } public String toString() { return value; } } //}}} } //}}} //{{{ AttributeCompare class static class AttributeCompare implements java.util.Comparator<Attribute> { public int compare(Attribute attr1, Attribute attr2) { // put required attributes at the top if(attr1.required && !attr2.required) return -1; else if(!attr1.required && attr2.required) return 1; else { return StandardUtilities.compareStrings( attr1.name,attr2.name,true); } } } //}}} static ComboValueRenderer comboRenderer = new ComboValueRenderer(); //{{{ AttributeTable class class AttributeTable extends JTable { //{{{ getCellEditor() method public TableCellEditor getCellEditor(int row, int column) { Object value = getModel().getValueAt(row,column); if(value instanceof Attribute.Value) return comboRenderer; return super.getCellEditor(row,column); } //}}} //{{{ getCellRenderer() method public TableCellRenderer getCellRenderer(int row, int column) { Object value = getModel().getValueAt(row,column); if(value instanceof Attribute.Value) return comboRenderer; return super.getCellRenderer(row,column); } //}}} } //}}} //{{{ AttributeTableModel class class AttributeTableModel extends AbstractTableModel { //{{{ getColumnCount() method public int getColumnCount() { return 4; } //}}} //{{{ getRowCount() method public int getRowCount() { return attributeModel.size(); } //}}} //{{{ getColumnClass() method public Class getColumnClass(int col) { if(col == 0) return Boolean.class; else return String.class; } //}}} //{{{ getColumnName() method public String getColumnName(int col) { switch(col) { case 0: return jEdit.getProperty("xml-edit-tag.set"); case 1: return jEdit.getProperty("xml-edit-tag.attribute"); case 2: return jEdit.getProperty("xml-edit-tag.type"); case 3: return jEdit.getProperty("xml-edit-tag.value"); default: throw new InternalError(); } } //}}} //{{{ isCellEditable() method public boolean isCellEditable(int row, int col) { if(col != 1 && col != 2) return true; else return false; } //}}} //{{{ getValueAt() method public Object getValueAt(int row, int col) { Attribute attr = (Attribute)attributeModel.get(row); switch(col) { case 0: return new Boolean(attr.set); case 1: return attr.name; case 2: if(attr.required) { if(attr.type.startsWith("(")) return jEdit.getProperty("xml-edit-tag.required"); else return attr.type + ", " + jEdit.getProperty("xml-edit-tag.required"); } else if(attr.type.startsWith("(")) return ""; else return attr.type; case 3: if(attr.value.values != null) return attr.value; else return attr.value.value; default: throw new InternalError(); } } //}}} //{{{ setValueAt() method public void setValueAt(Object value, int row, int col) { Attribute attr = (Attribute)attributeModel.get(row); switch(col) { case 0: if(attr.required) return; attr.set = ((Boolean)value).booleanValue(); break; case 3: String sValue; if(value instanceof IDDecl) sValue = ((IDDecl)value).id; else sValue = value.toString(); if(equal(attr.value.value,sValue)) return; attr.set = true; attr.value.value = sValue; break; } fireTableRowsUpdated(row,row); updateTag(); } //}}} //{{{ equal() method private boolean equal(String str1, String str2) { if(str1 == null || str1.length() == 0) { if(str2 == null || str2.length() == 0) return true; else return false; } else { if(str2 == null) return false; else return str1.equals(str2); } } //}}} } //}}} //{{{ ComboValueRenderer class static class ComboValueRenderer extends DefaultCellEditor implements TableCellRenderer { JComboBox editorCombo; JComboBox renderCombo; //{{{ ComboValueRenderer constructor ComboValueRenderer() { this(new JComboBox()); } //}}} //{{{ ComboValueRenderer constructor // this is stupid. why can't you reference instance vars // in a super() invocation? ComboValueRenderer(JComboBox comboBox) { super(comboBox); this.editorCombo = comboBox; editorCombo.setEditable(true); this.renderCombo = new JComboBox(); renderCombo.setEditable(true); } //}}} //{{{ getTableCellEditorComponent() method public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { Attribute.Value _value = (Attribute.Value)value; editorCombo.setModel(new DefaultComboBoxModel( _value.values.toArray())); return super.getTableCellEditorComponent(table, _value.value,isSelected,row,column); } //}}} //{{{ getTableCellRendererComponent() method public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Attribute.Value _value = (Attribute.Value)value; renderCombo.setModel(new DefaultComboBoxModel( _value.values.toArray())); renderCombo.setSelectedItem(_value.value); return renderCombo; } //}}} } //}}} //}}} /** * create open and close tags for an ElementDecl (with required attributes but without starting &lt; angle bracket). * if elementDecl.isEmpty, close tag will be empty and open tag will be standalone (if not html) * @param data * @param elementDecl element to create tags for * @param namespaces namespaces in scope (no need to redeclare them) * @param namespacesToInsert namespaces needed but not declared (will be declared) * @param withEndOfTag shall the '>' be appended at the end of open tag ? * @return {openTag,closeTag} */ public static StringBuilder[] composeTag(XmlParsedData data, ElementDecl elementDecl, NamespaceBindings namespaces, NamespaceBindings namespacesToInsert, boolean withEndOfTag){ StringBuilder buf = new StringBuilder(); StringBuilder close = new StringBuilder(); String ns = elementDecl.completionInfo.namespace; String elementName = NamespaceBindings.composeName(elementDecl.name, ns, namespaces, namespacesToInsert, true); buf.append(elementName); buf.append(elementDecl.getRequiredAttributesString(namespaces, namespacesToInsert)); namespacesToInsert.appendNamespaces(buf); if(withEndOfTag) { if(elementDecl.empty) { if(data.html) buf.append(">"); else buf.append(XmlActions.getStandaloneEnd()); } else { buf.append(">"); close.append("</").append(elementName).append(">"); } } return new StringBuilder[]{buf, close}; } }
[ "kerik-sf@6b1eeb88-9816-0410-afa2-b43733a0f04e" ]
kerik-sf@6b1eeb88-9816-0410-afa2-b43733a0f04e
a797d246b533abbefb3d2f446f9adcd617046b99
c14dd8eb767636ad9430705547753d07eb43afdc
/src/main/java/com/lee/springbootdemo/entity/PcProject.java
492172262eec374d95bd44b554ed6213a3b0eb95
[]
no_license
lideqiang01/springboot-demo
badf20b148fbcb3889fc2228312d1ad9695dd14f
ec7ef1dc04fd54336dd8a949a89b2f64ce7c990f
refs/heads/master
2022-06-25T10:40:09.203223
2019-09-21T01:16:27
2019-09-21T01:16:27
209,905,677
0
0
null
2022-06-21T01:54:34
2019-09-21T01:13:04
Java
UTF-8
Java
false
false
949
java
package com.lee.springbootdemo.entity; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * <p> * v2项目申报关系表 * </p> * * @author admin * @since 2019-09-20 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) public class PcProject implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ private String proId; /** * 学会表id */ private Long orgId; /** * 办事机构党组织id */ private String cpoId; /** * 学会党委id */ private String cponId; /** * 排序 */ private Integer sort; /** * 标识 */ private String mark; /** * 等级 */ private Integer level; /** * 是否删除(0未删除,1已删除) */ private Integer wDelete; }
[ "lideqiang0909@163.com" ]
lideqiang0909@163.com
534088b22dece8df85266ec6e9c888b7ae2117d3
fa820042ff770ce5610b0c50417a671870cf392a
/app/src/main/java/com/gpp/firstapp/ListView_Test/ViewHolder.java
e324c9237d7b84060085e71b65cf279ea5595de7
[]
no_license
guhihi2007/firstapp
678b79e0135db8054187b52e71fe02e4cab894c1
c7edc3de9fc698b6b62930023807fe89093245fa
refs/heads/master
2021-04-29T08:16:37.956750
2017-04-29T07:10:46
2017-04-29T07:10:46
77,652,154
0
0
null
null
null
null
UTF-8
Java
false
false
276
java
package com.gpp.firstapp.ListView_Test; import android.widget.Button; import android.widget.TextView; /** * Created by Administrator on 2017/1/1. */ public final class ViewHolder { public TextView textView1; public TextView textView2; public Button button; }
[ "464955343@qq.com" ]
464955343@qq.com
440d4d2feb624a1aaa82e1636b2a2c46e6b05fa6
11cfdcb988470ca62067f5b582bc9917e1ecbe16
/src/main/java/com/stackroute/movieservice/service/MovieService.java
abb46ea87feb667db9f5a59b7e21897b53bcd69e
[]
no_license
sangeet4/movieservice
ffe3e87961d618281836bd3ee10cc87b2e866dfe
279df7f04ccf73c74abccdabb8061ee15537f347
refs/heads/master
2020-03-31T06:08:12.097542
2018-11-28T13:22:50
2018-11-28T13:22:50
151,969,449
0
0
null
null
null
null
UTF-8
Java
false
false
892
java
package com.stackroute.movieservice.service; import com.stackroute.movieservice.domain.Movie; import com.stackroute.movieservice.exceptions.MovieAlreadyExistsException; import com.stackroute.movieservice.exceptions.MovieListEmptyExpception; import com.stackroute.movieservice.exceptions.MovieNotFoundException; import java.util.List; public interface MovieService { public List<Movie> saveAllMovie(List<Movie> movie); public Movie saveMovie(Movie movie) throws MovieAlreadyExistsException; public List<Movie> getAllMovies() throws MovieListEmptyExpception; public Movie getMovieById(int id) throws MovieNotFoundException; public List<Movie> getMovieByTitle(String title) throws MovieNotFoundException; public List<Movie> deleteMovie(int id) throws MovieNotFoundException; public Movie updateMovie(int id, String comment) throws MovieNotFoundException; }
[ "and.sangeet@gmail.com" ]
and.sangeet@gmail.com
4fd5509326a5ea528f07d8e8d6043b732ab3bd81
ae53b682ba629d9d1a95ec71e62cf352090c083a
/src/main/java/com/prep/SubSequenceTest.java
7cf27d25cf5c918705fa589838c72ddb358d705d
[]
no_license
NareshChinthakindi/Java9
af0d83eadd1d0eb4fca454d8666d3d1ae8dd9242
e06041df42bd461fe4f01ef036b6b383afa1e05d
refs/heads/master
2022-08-01T16:32:24.689910
2020-05-22T03:48:30
2020-05-22T03:48:30
258,566,455
0
0
null
null
null
null
UTF-8
Java
false
false
1,412
java
package com.prep; import java.math.BigInteger; public class SubSequenceTest { // 1 // 2 // 1 2 // 3 // 1 3 // 2 3 // 1 2 3 // 4 // 1 4 // 2 4 // 1 2 4 // 3 4 // 1 3 4 // 2 3 4 // 1 2 3 4 static int arr[] = new int[]{1, 2, 3, 4}; static void printSubsequences(int n) { // int opSize = (int)Math.pow(2 , n); //// //// for ( int counter = 1; counter < opSize; counter++) { //// //// for (int j =0; j < n; j++) { //// //// if (BigInteger.valueOf(counter).testBit(j)) { //// System.out.print(arr[j]+" "); //// } //// } //// System.out.println(); //// } int opSize = (int)Math.pow(2 ,n); for(int counter = 0; counter < opSize; counter++) { for( int j =0; j<n; j++) { if(BigInteger.valueOf(counter).testBit(j)) { System.out.print(arr[j]+" "); } } System.out.println(); } } // Driver method to test the above function public static void main(String[] args) { System.out.println("All Non-empty Subsequences"); printSubsequences(arr.length); } }
[ "naresh.chinthakindi@gmail.com" ]
naresh.chinthakindi@gmail.com
9a385cc452b8ceb59dcedb82e301134581f40812
fb470e4b425744a8d0043f159bc41ea20abaca71
/src/main/java/com/caf/valididty/service/dto/MobileValidationDTO.java
7749b90c92869a38866ac7f623f5c88484b95d0f
[]
no_license
BulkSecurityGeneratorProject/andhra-mobile-validation
71f546d05e8240337f326907f86df7d6c56276cf
70411566624ea420508275723411e49ff4f5ca0b
refs/heads/master
2022-12-17T19:25:40.038804
2020-05-10T12:10:37
2020-05-10T12:10:37
296,708,846
0
0
null
2020-09-18T19:10:27
2020-09-18T19:10:26
null
UTF-8
Java
false
false
2,590
java
package com.caf.valididty.service.dto; import java.time.LocalDateTime; import java.io.Serializable; import java.util.Objects; /** * A DTO for the MobileValidation entity. */ public class MobileValidationDTO implements Serializable { private Long id; private Long mobilenumber; private String activationDate; private String customerName; private String colorCode; private String user; private LocalDateTime userDate; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getMobilenumber() { return mobilenumber; } public void setMobilenumber(Long mobilenumber) { this.mobilenumber = mobilenumber; } public String getActivationDate() { return activationDate; } public void setActivationDate(String activationDate) { this.activationDate = activationDate; } public String getCustomerName() { return customerName; } public void setCustomerName(String customerName) { this.customerName = customerName; } public String getColorCode() { return colorCode; } public void setColorCode(String colorCode) { this.colorCode = colorCode; } public String getUser() { return user; } public void setUser(String user) { this.user = user; } public LocalDateTime getUserDate() { return userDate; } public void setUserDate(LocalDateTime userDate) { this.userDate = userDate; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MobileValidationDTO mobileValidationDTO = (MobileValidationDTO) o; if(mobileValidationDTO.getId() == null || getId() == null) { return false; } return Objects.equals(getId(), mobileValidationDTO.getId()); } @Override public int hashCode() { return Objects.hashCode(getId()); } @Override public String toString() { return "MobileValidationDTO{" + "id=" + getId() + ", mobilenumber='" + getMobilenumber() + "'" + ", activationDate='" + getActivationDate() + "'" + ", customerName='" + getCustomerName() + "'" + ", colorCode='" + getColorCode() + "'" + ", user='" + getUser() + "'" + ", userDate='" + getUserDate() + "'" + "}"; } }
[ "raghavendraprasad.gudipalli@gmail.com" ]
raghavendraprasad.gudipalli@gmail.com
aac52c2139b99bf92e04114b44ff0f51c0bf5bd5
fcdb1126cffcdf2ecd85fc5b0ac5951148655edb
/src/hashTables/TopK.java
ab5329fd0b9516962e202e8c6223daeb9a63ca77
[]
no_license
lukemxd/EPI
52d53695788c9553acf7c1bf687c3c9a307ad6e9
a9e733f9867af18fd17a2db2462e95c0568dce14
refs/heads/master
2021-01-11T15:45:20.471066
2017-03-21T03:24:01
2017-03-21T03:24:01
79,922,700
0
0
null
null
null
null
UTF-8
Java
false
false
1,276
java
package hashTables; import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.PriorityQueue; //Problem 13.5 public class TopK { public static List<String> findKMostUsed(List<String> input, int k){ Map<String, Integer> numOfStrings = new HashMap<>(); for(String s : input){ if(!numOfStrings.containsKey(s)) numOfStrings.put(s, 1); else numOfStrings.put(s, numOfStrings.get(s) + 1); } PriorityQueue<Map.Entry<String, Integer>> minHeap = new PriorityQueue<>(k, new Comparator<Map.Entry<String, Integer>>() { @Override public int compare(Map.Entry<String, Integer> e1, Map.Entry<String, Integer> e2){ return Integer.compare(e1.getValue(), e2.getValue()); } }); for(Map.Entry<String, Integer> e : numOfStrings.entrySet()){ if(minHeap.size() < k) minHeap.add(e); else{ Map.Entry<String, Integer> first = minHeap.peek(); if(e.getValue() > first.getValue()){ minHeap.poll(); minHeap.add(e); } } } List<String> result = new ArrayList<>(); for(Map.Entry<String, Integer> e : minHeap){ result.add(e.getKey()); } return result; } }
[ "Lukemxd@Lukemxd-PC" ]
Lukemxd@Lukemxd-PC
9dcae821d733526a649a1791a80afe6201d752ad
8b43f555ab9353368977f3f561586b595802527e
/YoctoLib/src/main/java/com/yoctopuce/YoctoAPI/yHTTPRequest.java
c4b62fd73859b78540d197d89fc2bc040f3ccb43
[]
no_license
astonmarty/YoctoLib.android.24765
3855f957e09e8cfff77e250dc2e0c1e801bc2462
b8bd21d49a4999af8fd4adda393bbd22d927299a
refs/heads/master
2021-01-19T03:04:57.524737
2016-08-10T13:11:54
2016-08-10T13:11:54
65,383,570
0
0
null
null
null
null
UTF-8
Java
false
false
16,275
java
/********************************************************************* * * $Id: yHTTPRequest.java 24281 2016-04-29 09:40:53Z seb $ * * internal yHTTPRequest object * * - - - - - - - - - License information: - - - - - - - - - * * Copyright (C) 2011 and beyond by Yoctopuce Sarl, Switzerland. * * Yoctopuce Sarl (hereafter Licensor) grants to you a perpetual * non-exclusive license to use, modify, copy and integrate this * file into your software for the sole purpose of interfacing * with Yoctopuce products. * * You may reproduce and distribute copies of this file in * source or object form, as long as the sole purpose of this * code is to interface with Yoctopuce products. You must retain * this notice in the distributed source file. * * You should refer to Yoctopuce General Terms and Conditions * for additional information regarding your rights and * obligations. * * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING * WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO * EVENT SHALL LICENSOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL, * INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, * COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR * SERVICES, ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT * LIMITED TO ANY DEFENSE THEREOF), ANY CLAIMS FOR INDEMNITY OR * CONTRIBUTION, OR OTHER SIMILAR COSTS, WHETHER ASSERTED ON THE * BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF * WARRANTY, OR OTHERWISE. *********************************************************************/ package com.yoctopuce.YoctoAPI; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.*; class yHTTPRequest implements Runnable { public static final int MAX_REQUEST_MS = 5000; private static final int YIO_IDLE_TCP_TIMEOUT = 5000; private Object _context; private YGenericHub.RequestAsyncResult _resultCallback; public void kill() { _requestStop(); } private enum State { AVAIL, IN_REQUEST, STOPPED; } private final YHTTPHub _hub; private Socket _socket = null; private boolean _reuse_socket = false; private OutputStream _out = null; private InputStream _in = null; private State _state = State.AVAIL; private boolean _eof; private String _firstLine; private byte[] _rest_of_request; private final String _dbglabel; private final StringBuilder _header = new StringBuilder(1024); private Boolean _header_found; private final ByteArrayOutputStream _result = new ByteArrayOutputStream(1024); private long _startRequestTime; private long _lastReceiveTime; private long _requestTimeout; yHTTPRequest(YHTTPHub hub, String dbglabel) { _hub = hub; _dbglabel = dbglabel; } synchronized void _requestReserve() throws YAPI_Exception { long timeout = YAPI.GetTickCount() + MAX_REQUEST_MS + 1000; while (timeout > YAPI.GetTickCount() && _state != State.AVAIL) { try { long toWait = timeout - YAPI.GetTickCount(); wait(toWait); } catch (InterruptedException ie) { throw new YAPI_Exception(YAPI.TIMEOUT, "Last Http request did not finished"); } } if (_state != State.AVAIL) throw new YAPI_Exception(YAPI.TIMEOUT, "Last Http request did not finished"); _state = State.IN_REQUEST; } synchronized void _requestRelease() { _state = State.AVAIL; notify(); } void _requestStart(String firstLine, byte[] rest_of_request, long mstimeout, Object context, YGenericHub.RequestAsyncResult resultCallback) throws YAPI_Exception { byte[] full_request; _firstLine = firstLine; _rest_of_request = rest_of_request; _context = context; _startRequestTime = System.currentTimeMillis(); _requestTimeout = mstimeout; _resultCallback = resultCallback; String persistent_tag = firstLine.substring(firstLine.length() - 2); if (persistent_tag.equals("&.")) { firstLine += " \r\n"; } else { firstLine += " \r\nConnection: close\r\n"; } if (rest_of_request == null) { String str_request = firstLine + _hub.getAuthorization(firstLine) + "\r\n"; full_request = str_request.getBytes(); } else { String str_request = firstLine + _hub.getAuthorization(firstLine); int len = str_request.length(); full_request = new byte[len + rest_of_request.length]; System.arraycopy(str_request.getBytes(), 0, full_request, 0, len); System.arraycopy(rest_of_request, 0, full_request, len, rest_of_request.length); } boolean retry; do { retry = false; try { if (!_reuse_socket) { InetAddress addr = InetAddress.getByName(_hub.getHost()); SocketAddress sockaddr = new InetSocketAddress(addr, _hub.getPort()); // Creates an unconnected socket _socket = new Socket(); _socket.connect(sockaddr, (int) mstimeout); _socket.setTcpNoDelay(true); _out = _socket.getOutputStream(); _in = _socket.getInputStream(); } _result.reset(); _header.setLength(0); _header_found = false; _eof = false; } catch (UnknownHostException e) { _requestStop(); throw new YAPI_Exception(YAPI.INVALID_ARGUMENT, "Unknown host(" + _hub.getHost() + ")"); } catch (SocketException e) { _requestStop(); throw new YAPI_Exception(YAPI.IO_ERROR, e.getLocalizedMessage()); } catch (IOException e) { _requestStop(); throw new YAPI_Exception(YAPI.IO_ERROR, e.getLocalizedMessage()); } // write request try { _out.write(full_request); _out.flush(); _lastReceiveTime = -1; if (_reuse_socket) { // it's a reusable socket read some data // to ensure socket is not closed by remote host _socket.setSoTimeout(1); int b = _in.read(); if (b < 0) { // end of connection retry = true; } else { _header.append((char) b); } } } catch (SocketTimeoutException ignored) { } catch (IOException e) { e.printStackTrace(); if (_reuse_socket) { retry = true; } else { _requestStop(); throw new YAPI_Exception(YAPI.IO_ERROR, e.getLocalizedMessage()); } } _reuse_socket = false; } while (retry); } void _requestStop() { if (!_reuse_socket) { if (_out != null) { try { _out.close(); } catch (IOException ignored) { } _out = null; } if (_in != null) { try { _in.close(); } catch (IOException ignored) { } _in = null; } if (_socket != null) { try { _socket.close(); } catch (IOException ignored) { } _socket = null; } } } void _requestReset() throws YAPI_Exception { _requestStop(); _requestStart(_firstLine, _rest_of_request, _requestTimeout, _context, _resultCallback); } int _requestProcesss() throws YAPI_Exception { boolean retry; int read = 0; if (_eof) return -1; do { retry = false; byte[] buffer = new byte[1024]; try { if (_requestTimeout > 0) { long read_timeout = _startRequestTime + _requestTimeout - System.currentTimeMillis(); if (read_timeout < 0) { throw new YAPI_Exception(YAPI.TIMEOUT, String.format("Hub did not send data during %dms", System.currentTimeMillis() - _lastReceiveTime)); } if (read_timeout > YIO_IDLE_TCP_TIMEOUT) { read_timeout = YIO_IDLE_TCP_TIMEOUT; } _socket.setSoTimeout((int) read_timeout); } else { _socket.setSoTimeout(YIO_IDLE_TCP_TIMEOUT); } read = _in.read(buffer, 0, buffer.length); } catch (SocketTimeoutException e) { long nowTime = System.currentTimeMillis(); if (_lastReceiveTime < 0 || nowTime - _lastReceiveTime < YIO_IDLE_TCP_TIMEOUT) { retry = true; continue; } long duration = nowTime - _startRequestTime; // global request timeout if (duration > _requestTimeout) { throw new YAPI_Exception(YAPI.TIMEOUT, String.format("TCP request on %s took too long (%dms)", _hub.getHost(), duration)); } else if (duration > (_requestTimeout - _requestTimeout / 4)) { _hub._yctx._Log(String.format("Slow TCP request on %s (%dms)\n", _hub.getHost(), duration)); } retry = true; continue; } catch (IOException e) { throw new YAPI_Exception(YAPI.IO_ERROR, e.getLocalizedMessage()); } if (read < 0) { // end of connection _reuse_socket = false; _eof = true; } else if (read > 0) { _lastReceiveTime = System.currentTimeMillis(); synchronized (_result) { if (!_header_found) { String partial_head = new String(buffer, 0, read, _hub._yctx._deviceCharset); _header.append(partial_head); int pos = _header.indexOf("\r\n\r\n"); if (pos > 0) { pos += 4; try { _result.write(_header.substring(pos).getBytes(_hub._yctx._deviceCharset)); } catch (IOException ex) { throw new YAPI_Exception(YAPI.IO_ERROR, ex.getLocalizedMessage()); } _header_found = true; _header.setLength(pos); if (_header.indexOf("0K\r\n") == 0) { _reuse_socket = true; } else if (_header.indexOf("OK\r\n") != 0) { int lpos = _header.indexOf("\r\n"); if (_header.indexOf("HTTP/1.1 ") != 0) throw new YAPI_Exception(YAPI.IO_ERROR, "Invalid HTTP response header"); String parts[] = _header.substring(9, lpos).split(" "); if (parts[0].equals("401")) { if (!_hub.needRetryWithAuth()) { // No credential provided, give up immediately throw new YAPI_Exception(YAPI.UNAUTHORIZED, "Authentication required"); } else { _hub.parseWWWAuthenticate(_header.toString()); _requestReset(); break; } } if (!parts[0].equals("200") && !parts[0].equals("304")) { throw new YAPI_Exception(YAPI.IO_ERROR, "Received HTTP status " + parts[0] + " (" + parts[1] + ")"); } } _hub.authSucceded(); } } else { _result.write(buffer, 0, read); } if (_reuse_socket) { if (_result.toString().endsWith("\r\n")) { _eof = true; } } } } } while (retry); return read; } byte[] getPartialResult() throws YAPI_Exception { byte[] res; synchronized (_result) { if (!_header_found) return null; if (_result.size() == 0) { if (_eof) throw new YAPI_Exception(YAPI.NO_MORE_DATA, "end of file reached"); return null; } res = _result.toByteArray(); _result.reset(); } return res; } byte[] RequestSync(String req_first_line, byte[] req_head_and_body, int mstimeout) throws YAPI_Exception { byte[] res; _requestReserve(); try { _requestStart(req_first_line, req_head_and_body, mstimeout, null, null); int read; do { read = _requestProcesss(); } while (read >= 0); synchronized (_result) { res = _result.toByteArray(); _result.reset(); } } catch (YAPI_Exception ex) { _requestStop(); _requestRelease(); throw ex; } _requestStop(); _requestRelease(); return res; } public void run() { byte[] res = null; int errorType = YAPI.SUCCESS; String errmsg = null; try { _requestProcesss(); int read; do { read = _requestProcesss(); } while (read >= 0); synchronized (_result) { res = _result.toByteArray(); _result.reset(); } } catch (YAPI_Exception ex) { errorType = ex.errorType; errmsg = ex.getMessage(); _hub._yctx._Log("ASYNC request " + _firstLine + "failed:" + errmsg + "\n"); } _requestStop(); if (_resultCallback != null) { _resultCallback.RequestAsyncDone(_context, res, errorType, errmsg); } _requestRelease(); } void RequestAsync(String req_first_line, byte[] req_head_and_body, YGenericHub.RequestAsyncResult callback, Object context) throws YAPI_Exception { _requestReserve(); try { _requestStart(req_first_line, req_head_and_body, YHTTPHub.YIO_DEFAULT_TCP_TIMEOUT, context, callback);//fixme Thread t = new Thread(this); t.setName(_dbglabel); t.start(); } catch (YAPI_Exception ex) { _requestRelease(); throw ex; } } synchronized void WaitRequestEnd(long mstimeout) throws InterruptedException { long timeout = YAPI.GetTickCount() + mstimeout; while (timeout > YAPI.GetTickCount() && _state == State.IN_REQUEST) { long toWait = timeout - YAPI.GetTickCount(); wait(toWait); } if (_state == State.IN_REQUEST) _hub._yctx._Log("WARNING: Last Http request did not finished"); // ensure that we close all socket _reuse_socket = false; _requestStop(); _state = State.STOPPED; } }
[ "astonmarty@gmail.com" ]
astonmarty@gmail.com
eb30b0c77469ab8d56c2e8b993a8125826c8b65f
b85c96bdfdc8daa77b3398d13330e4fc2eb797f6
/src/main/java/com/payroll/microservices/roleservice/EmployeeRoleRepository.java
407c0238cbe0b72741f01343f0ec3f45bed84885
[]
no_license
microservices-api-apps/role-service
30b8e54647fc02df7242dd694b2b6eb6d42f6e59
df19a00e714f958f397ab1dc57a1bb7ff6674f90
refs/heads/master
2020-09-13T10:11:03.156234
2019-11-20T11:27:59
2019-11-20T11:27:59
222,737,352
0
0
null
null
null
null
UTF-8
Java
false
false
254
java
package com.payroll.microservices.roleservice; import org.springframework.data.jpa.repository.JpaRepository; public interface EmployeeRoleRepository extends JpaRepository<EmployeeRole, Long> { public EmployeeRole findByRoleName(String roleName); }
[ "arockiaanandraj@gmail.com" ]
arockiaanandraj@gmail.com
c659e8a3713bf91850bd1543eed68d89b7cde73f
81611315acbbc9cb7ebb8d66174b4fed801a695e
/app/src/main/java/com/example/proyectomodular/view/fragment/EditPreguntaConcretaFragment.java
2568286b631369fcef3aeca8fb7b11dc1bc25332
[]
no_license
vicmog/ProyectoModular
d0019a6a9f2b3ce773abf418090e45e4925e7bf3
976cbec6cdbf8b28130e1149b0259fc7742341b2
refs/heads/master
2023-02-24T22:33:41.434333
2021-02-01T09:25:06
2021-02-01T09:25:06
321,919,889
0
0
null
null
null
null
UTF-8
Java
false
false
3,316
java
package com.example.proyectomodular.view.fragment; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelStoreOwner; import androidx.navigation.NavController; import androidx.navigation.Navigation; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.example.proyectomodular.R; import com.example.proyectomodular.model.room.entity.Carta; import com.example.proyectomodular.model.room.entity.Pregunta; import com.example.proyectomodular.viewmodel.ViewModel; public class EditPreguntaConcretaFragment extends Fragment { private Carta carta; private Pregunta pregunta; private EditText etPregunta; private EditText res1; private EditText res2; private EditText res3; private EditText res4; private Button atras; private Button guardar; private NavController navController; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_edit_pregunta_concreta, container, false); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); ViewModel vm = new ViewModelProvider((ViewModelStoreOwner) getContext()).get(ViewModel.class); carta = vm.getEditarCarta(); pregunta = vm.getEditarPregunta(); etPregunta = view.findViewById(R.id.etPreguntaEdit); res1 = view.findViewById(R.id.etResCorrectaEdit); res2 = view.findViewById(R.id.etRes2); res3 = view.findViewById(R.id.etRes3); res4 = view.findViewById(R.id.etRes4); atras = view.findViewById(R.id.btBack); guardar = view.findViewById(R.id.btSave); etPregunta.setText(pregunta.getPregunta()); res1.setText(pregunta.getOpcion1()); res2.setText(pregunta.getOpcion2()); res3.setText(pregunta.getOpcion3()); res4.setText(pregunta.getOpcion4()); navController = Navigation.findNavController(view); atras.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { navController.navigate(R.id.editCardFragment); } }); guardar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { pregunta.setPregunta(etPregunta.getText().toString()); pregunta.setOpcion1(res1.getText().toString()); pregunta.setOpcion2(res2.getText().toString()); pregunta.setOpcion3(res3.getText().toString()); pregunta.setOpcion4(res4.getText().toString()); vm.updatePregunta(pregunta); Toast.makeText(getContext(), "Guardado", Toast.LENGTH_SHORT).show(); navController.navigate(R.id.editCardFragment); } }); } }
[ "73299712+EAlba188@users.noreply.github.com" ]
73299712+EAlba188@users.noreply.github.com
dd586b89519fe2baabaafa62c742c3a1c7bf6c36
30b5d28e140bfb568ecc371066fcdb9d6ebabac8
/webservice-principal/src/test/java/br/com/maicon/pratica/webserviceprincipal/WebservicePrincipalApplicationTests.java
9396133985fbb2d7de41164967045889e5b5a3ca
[]
no_license
MaiconCanedo/multi-tenant-multi-module-master
fe395a744631257ec80fcb90cff4f36cb2c51ad9
861c608ee29f701ffcf7b24e774b38270e8df1f5
refs/heads/master
2020-06-02T17:03:22.179230
2019-06-23T23:16:18
2019-06-23T23:16:18
190,830,754
0
0
null
null
null
null
UTF-8
Java
false
false
380
java
package br.com.maicon.pratica.webserviceprincipal; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class WebservicePrincipalApplicationTests { @Test public void contextLoads() { } }
[ "maicon.rocha2013@outlook.com" ]
maicon.rocha2013@outlook.com
8e5f8a72db14537b378f0e0e7cc8ec1767ec86b9
ad2817a2c1842c7e45301863f054524fa3c17679
/db-4.8.30/java/src/com/sleepycat/db/PanicHandler.java
7d0edeac10edbaf11943016ede712b6602a6b44b
[ "MIT", "BSD-3-Clause", "Sleepycat" ]
permissive
kobake/bitcoin-msvc
37235582d0ac1a60999b03307cdf80b41b1500af
a2cb2cf6814e0f3274add1b76bf6342ee013ac22
refs/heads/master
2021-01-22T05:49:08.309061
2020-05-28T19:49:58
2020-05-28T19:49:58
81,691,930
28
26
MIT
2020-04-26T16:14:58
2017-02-12T00:14:41
C++
UTF-8
Java
false
false
1,300
java
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997-2009 Oracle. All rights reserved. * * $Id$ */ package com.sleepycat.db; /** An interface specifying a function to be called if the database environment panics. */ public interface PanicHandler { /** A function to be called if the database environment panics. <p> Errors can occur in the Berkeley DB library where the only solution is to shut down the application and run recovery (for example, if Berkeley DB is unable to allocate heap memory). In such cases, the Berkeley DB methods will throw a {@link com.sleepycat.db.RunRecoveryException RunRecoveryException}. <p> It is often easier to simply exit the application when such errors occur rather than gracefully return up the stack. The panic callback function is a function called when {@link com.sleepycat.db.RunRecoveryException RunRecoveryException} is about to be thrown from a from a Berkeley DB method. <p> @param environment The enclosing database environment handle. <p> @param e The {@link com.sleepycat.db.DatabaseException DatabaseException} that would have been thrown to the calling method. */ void panic(Environment environment, DatabaseException e); }
[ "kobake@users.sourceforge.net" ]
kobake@users.sourceforge.net
a773e0069054ebe7a256bb978f7fb3500a0a96e1
c8d326c7466a294694dce08346a7fe8cb72d268c
/DoItAndroid_Source/Part2/chapter12/SampleBluetoothChat/app/src/main/java/org/androidtown/bluetooth/BluetoothChatService.java
3d045fd850365a6645eaeaad043f209d1c7bddf6
[]
no_license
lipnus/android-example
859c284e9d33459f82cc58b4dddf54235685695b
9976bbdb49f5d9ea40518304eb40ae587466deff
refs/heads/master
2020-04-03T18:49:48.718364
2018-10-31T04:44:21
2018-10-31T04:44:21
155,499,399
1
0
null
null
null
null
UTF-8
Java
false
false
17,380
java
package org.androidtown.bluetooth; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothServerSocket; import android.bluetooth.BluetoothSocket; import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.UUID; /** * This class does all the work for setting up and managing Bluetooth * connections with other devices. It has a thread that listens for * incoming connections, a thread for connecting with a device, and a * thread for performing data transmissions when connected. */ public class BluetoothChatService { // Debugging private static final String TAG = "BluetoothChatService"; private static final boolean D = true; // Name for the SDP record when creating server socket private static final String NAME_SECURE = "BluetoothChatSecure"; private static final String NAME_INSECURE = "BluetoothChatInsecure"; // Unique UUID for this application private static final UUID MY_UUID_SECURE = UUID.fromString("fa87c0d0-afac-11de-8a39-0800200c9a66"); private static final UUID MY_UUID_INSECURE = UUID.fromString("8ce255c0-200a-11e0-ac64-0800200c9a66"); // Member fields private final BluetoothAdapter mAdapter; private final Handler mHandler; private AcceptThread mSecureAcceptThread; private AcceptThread mInsecureAcceptThread; private ConnectThread mConnectThread; private ConnectedThread mConnectedThread; private int mState; // Constants that indicate the current connection state public static final int STATE_NONE = 0; // we're doing nothing public static final int STATE_LISTEN = 1; // now listening for incoming connections public static final int STATE_CONNECTING = 2; // now initiating an outgoing connection public static final int STATE_CONNECTED = 3; // now connected to a remote device /** * Constructor. Prepares a new BluetoothChat session. * @param context The UI Activity Context * @param handler A Handler to send messages back to the UI Activity */ public BluetoothChatService(Context context, Handler handler) { mAdapter = BluetoothAdapter.getDefaultAdapter(); mState = STATE_NONE; mHandler = handler; } /** * Set the current state of the chat connection * @param state An integer defining the current connection state */ private synchronized void setState(int state) { if (D) Log.d(TAG, "setState() " + mState + " -> " + state); mState = state; // Give the new state to the Handler so the UI Activity can update mHandler.obtainMessage(MainActivity.MESSAGE_STATE_CHANGE, state, -1).sendToTarget(); } /** * Return the current connection state. */ public synchronized int getState() { return mState; } /** * Start the chat service. Specifically start AcceptThread to begin a * session in listening (server) mode. Called by the Activity onResume() */ public synchronized void start() { if (D) Log.d(TAG, "start"); // Cancel any thread attempting to make a connection if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;} // Cancel any thread currently running a connection if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;} setState(STATE_LISTEN); // Start the thread to listen on a BluetoothServerSocket if (mSecureAcceptThread == null) { mSecureAcceptThread = new AcceptThread(true); mSecureAcceptThread.start(); } if (mInsecureAcceptThread == null) { mInsecureAcceptThread = new AcceptThread(false); mInsecureAcceptThread.start(); } } /** * Start the ConnectThread to initiate a connection to a remote device. * @param device The BluetoothDevice to connect * @param secure Socket Security type - Secure (true) , Insecure (false) */ public synchronized void connect(BluetoothDevice device, boolean secure) { if (D) Log.d(TAG, "connect to: " + device); // Cancel any thread attempting to make a connection if (mState == STATE_CONNECTING) { if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;} } // Cancel any thread currently running a connection if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;} // Start the thread to connect with the given device mConnectThread = new ConnectThread(device, secure); mConnectThread.start(); setState(STATE_CONNECTING); } /** * Start the ConnectedThread to begin managing a Bluetooth connection * @param socket The BluetoothSocket on which the connection was made * @param device The BluetoothDevice that has been connected */ public synchronized void connected(BluetoothSocket socket, BluetoothDevice device, final String socketType) { if (D) Log.d(TAG, "connected, Socket Type:" + socketType); // Cancel the thread that completed the connection if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;} // Cancel any thread currently running a connection if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;} // Cancel the accept thread because we only want to connect to one device if (mSecureAcceptThread != null) { mSecureAcceptThread.cancel(); mSecureAcceptThread = null; } if (mInsecureAcceptThread != null) { mInsecureAcceptThread.cancel(); mInsecureAcceptThread = null; } // Start the thread to manage the connection and perform transmissions mConnectedThread = new ConnectedThread(socket, socketType); mConnectedThread.start(); // Send the name of the connected device back to the UI Activity Message msg = mHandler.obtainMessage(MainActivity.MESSAGE_DEVICE_NAME); Bundle bundle = new Bundle(); bundle.putString(MainActivity.DEVICE_NAME, device.getName()); msg.setData(bundle); mHandler.sendMessage(msg); setState(STATE_CONNECTED); } /** * Stop all threads */ public synchronized void stop() { if (D) Log.d(TAG, "stop"); if (mConnectThread != null) { mConnectThread.cancel(); mConnectThread = null; } if (mConnectedThread != null) { mConnectedThread.cancel(); mConnectedThread = null; } if (mSecureAcceptThread != null) { mSecureAcceptThread.cancel(); mSecureAcceptThread = null; } if (mInsecureAcceptThread != null) { mInsecureAcceptThread.cancel(); mInsecureAcceptThread = null; } setState(STATE_NONE); } /** * Write to the ConnectedThread in an unsynchronized manner * @param out The bytes to write * @see org.androidtown.bluetooth.BluetoothChatService.ConnectedThread#write(byte[]) */ public void write(byte[] out) { // Create temporary object ConnectedThread r; // Synchronize a copy of the ConnectedThread synchronized (this) { if (mState != STATE_CONNECTED) return; r = mConnectedThread; } // Perform the write unsynchronized r.write(out); } /** * Indicate that the connection attempt failed and notify the UI Activity. */ private void connectionFailed() { // Send a failure message back to the Activity Message msg = mHandler.obtainMessage(MainActivity.MESSAGE_TOAST); Bundle bundle = new Bundle(); bundle.putString(MainActivity.TOAST, "Unable to connect device"); msg.setData(bundle); mHandler.sendMessage(msg); // Start the service over to restart listening mode BluetoothChatService.this.start(); } /** * Indicate that the connection was lost and notify the UI Activity. */ private void connectionLost() { // Send a failure message back to the Activity Message msg = mHandler.obtainMessage(MainActivity.MESSAGE_TOAST); Bundle bundle = new Bundle(); bundle.putString(MainActivity.TOAST, "Device connection was lost"); msg.setData(bundle); mHandler.sendMessage(msg); // Start the service over to restart listening mode BluetoothChatService.this.start(); } /** * This thread runs while listening for incoming connections. It behaves * like a server-side client. It runs until a connection is accepted * (or until cancelled). */ private class AcceptThread extends Thread { // The local server socket private final BluetoothServerSocket mmServerSocket; private String mSocketType; public AcceptThread(boolean secure) { BluetoothServerSocket tmp = null; mSocketType = secure ? "Secure":"Insecure"; // Create a new listening server socket try { if (secure) { tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME_SECURE, MY_UUID_SECURE); } else { tmp = mAdapter.listenUsingInsecureRfcommWithServiceRecord( NAME_INSECURE, MY_UUID_INSECURE); } } catch (IOException e) { Log.e(TAG, "Socket Type: " + mSocketType + "listen() failed", e); } mmServerSocket = tmp; } public void run() { if (D) Log.d(TAG, "Socket Type: " + mSocketType + "BEGIN mAcceptThread" + this); setName("AcceptThread" + mSocketType); BluetoothSocket socket = null; // Listen to the server socket if we're not connected while (mState != STATE_CONNECTED) { try { // This is a blocking call and will only return on a // successful connection or an exception socket = mmServerSocket.accept(); } catch (IOException e) { Log.e(TAG, "Socket Type: " + mSocketType + "accept() failed", e); break; } // If a connection was accepted if (socket != null) { synchronized (BluetoothChatService.this) { switch (mState) { case STATE_LISTEN: case STATE_CONNECTING: // Situation normal. Start the connected thread. connected(socket, socket.getRemoteDevice(), mSocketType); break; case STATE_NONE: case STATE_CONNECTED: // Either not ready or already connected. Terminate new socket. try { socket.close(); } catch (IOException e) { Log.e(TAG, "Could not close unwanted socket", e); } break; } } } } if (D) Log.i(TAG, "END mAcceptThread, socket Type: " + mSocketType); } public void cancel() { if (D) Log.d(TAG, "Socket Type" + mSocketType + "cancel " + this); try { mmServerSocket.close(); } catch (IOException e) { Log.e(TAG, "Socket Type" + mSocketType + "close() of server failed", e); } } } /** * This thread runs while attempting to make an outgoing connection * with a device. It runs straight through; the connection either * succeeds or fails. */ private class ConnectThread extends Thread { private final BluetoothSocket mmSocket; private final BluetoothDevice mmDevice; private String mSocketType; public ConnectThread(BluetoothDevice device, boolean secure) { mmDevice = device; BluetoothSocket tmp = null; mSocketType = secure ? "Secure" : "Insecure"; // Get a BluetoothSocket for a connection with the // given BluetoothDevice try { if (secure) { tmp = device.createRfcommSocketToServiceRecord( MY_UUID_SECURE); } else { tmp = device.createInsecureRfcommSocketToServiceRecord( MY_UUID_INSECURE); } } catch (IOException e) { Log.e(TAG, "Socket Type: " + mSocketType + "create() failed", e); } mmSocket = tmp; } public void run() { Log.i(TAG, "BEGIN mConnectThread SocketType:" + mSocketType); setName("ConnectThread" + mSocketType); // Always cancel discovery because it will slow down a connection mAdapter.cancelDiscovery(); // Make a connection to the BluetoothSocket try { // This is a blocking call and will only return on a // successful connection or an exception mmSocket.connect(); } catch (IOException e) { // Close the socket try { mmSocket.close(); } catch (IOException e2) { Log.e(TAG, "unable to close() " + mSocketType + " socket during connection failure", e2); } connectionFailed(); return; } // Reset the ConnectThread because we're done synchronized (BluetoothChatService.this) { mConnectThread = null; } // Start the connected thread connected(mmSocket, mmDevice, mSocketType); } public void cancel() { try { mmSocket.close(); } catch (IOException e) { Log.e(TAG, "close() of connect " + mSocketType + " socket failed", e); } } } /** * This thread runs during a connection with a remote device. * It handles all incoming and outgoing transmissions. */ private class ConnectedThread extends Thread { private final BluetoothSocket mmSocket; private final InputStream mmInStream; private final OutputStream mmOutStream; public ConnectedThread(BluetoothSocket socket, String socketType) { Log.d(TAG, "create ConnectedThread: " + socketType); mmSocket = socket; InputStream tmpIn = null; OutputStream tmpOut = null; // Get the BluetoothSocket input and output streams try { tmpIn = socket.getInputStream(); tmpOut = socket.getOutputStream(); } catch (IOException e) { Log.e(TAG, "temp sockets not created", e); } mmInStream = tmpIn; mmOutStream = tmpOut; } public void run() { Log.i(TAG, "BEGIN mConnectedThread"); byte[] buffer = new byte[1024]; int bytes; // Keep listening to the InputStream while connected while (true) { try { // Read from the InputStream bytes = mmInStream.read(buffer); // Send the obtained bytes to the UI Activity mHandler.obtainMessage(MainActivity.MESSAGE_READ, bytes, -1, buffer) .sendToTarget(); } catch (IOException e) { Log.e(TAG, "disconnected", e); connectionLost(); // Start the service over to restart listening mode BluetoothChatService.this.start(); break; } } } /** * Write to the connected OutStream. * @param buffer The bytes to write */ public void write(byte[] buffer) { try { mmOutStream.write(buffer); // Share the sent message back to the UI Activity mHandler.obtainMessage(MainActivity.MESSAGE_WRITE, -1, -1, buffer) .sendToTarget(); } catch (IOException e) { Log.e(TAG, "Exception during write", e); } } public void cancel() { try { mmSocket.close(); } catch (IOException e) { Log.e(TAG, "close() of connect socket failed", e); } } } }
[ "sunpil13@korea.ac.kr" ]
sunpil13@korea.ac.kr
18042ddf970dc750ae4b1e2317d3d8cec22c0f39
f32104c60e1019a846550a53d1fa7f16abc02e2d
/app/src/main/java/addysden/doctor/doxtar/ClientRegisterFragment.java
f1f761ca62fb179f32152eb5322d577b81073125
[]
no_license
addysinha/Doxtar
ce39ae77d8d10c5829ec5e12ea157a30aefc8f15
c26d69f9bfc2002f0a6a79b8bdac9df60b837a7a
refs/heads/master
2020-03-19T18:49:38.879904
2018-06-10T17:00:59
2018-06-10T17:00:59
136,827,029
0
0
null
null
null
null
UTF-8
Java
false
false
41,476
java
package addysden.doctor.doxtar; import android.Manifest; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.annotation.TargetApi; import android.content.ContentResolver; import android.content.Context; import android.content.ContextWrapper; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.content.res.Resources; import android.content.res.TypedArray; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; import android.support.annotation.Nullable; import android.support.design.widget.Snackbar; import android.support.v4.app.ActivityCompat; import android.support.v4.app.Fragment; import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.util.Base64; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; import android.widget.Button; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.Spinner; import android.widget.Toast; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdView; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLEncoder; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; public class ClientRegisterFragment extends Fragment { private Spinner mClientRegCountryCodeSpnr, mClientRegTypeSpnr; private AutoCompleteTextView mClientRegDescTextView, mClientRegNameTextView, mClientRegAddressTextView, mClientRegPinTextView; private AutoCompleteTextView mClientRegPhone1TextView, mClientRegPhone2TextView, mClientRegLicNumTextView, mClientRegSpecTextView; private AutoCompleteTextView mClientRegEmailTextView; private Button mClientRegSaveButton; private ImageButton mClientRegCameraButton; private ImageView mClientRegProfileImageView, mClientLicenseHintImageView; private LinearLayout mClientRegFormView; private ArrayList<String> fCode, fClientTypeCode; private ArrayList<String> fCountry, fClientType; private CheckInternetConnection internetConn = null; private ClientRegisterTask crt = null; private ProgressBar mClientRegProgressBar; private String userName, userCode; private static final Integer REQUEST_CAMERA = 0; private static final Integer REQUEST_STORAGE = 1; private static final Integer RESULT_LOAD_IMAGE = 1; private static final Integer RESULT_CLICK_LOAD_IMAGE = 2; private static Integer CHECK=0; private File imgFile = null; private Uri selectedImageUri = null; private final static String CAPTURED_PHOTO_URI_KEY = "mClientRegProfileImageView"; private final static String CAPTURED_PHOTO_CHECK_FLAG = "flag"; private String mImageName = null; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.fragment_client_register, container, false); mClientRegProgressBar = (ProgressBar) rootView.findViewById(R.id.client_register_progressBar); mClientRegFormView = (LinearLayout) rootView.findViewById(R.id.client_register_det_linear_layout); mClientRegDescTextView = (AutoCompleteTextView) rootView.findViewById(R.id.client_register_descr_textView); mClientRegNameTextView = (AutoCompleteTextView) rootView.findViewById(R.id.client_register_name_textView); mClientRegAddressTextView = (AutoCompleteTextView) rootView.findViewById(R.id.client_register_address_textView); mClientRegPinTextView = (AutoCompleteTextView) rootView.findViewById(R.id.client_register_pincode_textView); mClientRegPhone1TextView = (AutoCompleteTextView) rootView.findViewById(R.id.client_register_phone1_textView); mClientRegPhone2TextView = (AutoCompleteTextView) rootView.findViewById(R.id.client_register_phone2_textView); mClientRegLicNumTextView = (AutoCompleteTextView) rootView.findViewById(R.id.client_register_lic_num_textView); mClientRegSpecTextView = (AutoCompleteTextView) rootView.findViewById(R.id.client_register_speclty_textView); mClientRegEmailTextView = (AutoCompleteTextView) rootView.findViewById(R.id.client_register_email_textView); mClientRegSaveButton = (Button) rootView.findViewById(R.id.client_register_save_button); mClientRegCameraButton = (ImageButton) rootView.findViewById(R.id.client_register_photo_image_btn); mClientRegProfileImageView = (ImageView) rootView.findViewById(R.id.client_register_photo_image_view); mClientLicenseHintImageView = (ImageView) rootView.findViewById(R.id.client_register_lic_hint_image_view); AdView mAdView = (AdView) rootView.findViewById(R.id.fragment_register_adView); AdRequest adRequest = new AdRequest.Builder().build(); mAdView.loadAd(adRequest); mClientLicenseHintImageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Snackbar.make(rootView, R.string.optional_field_required, Snackbar.LENGTH_INDEFINITE) .setAction(R.string.ok, new View.OnClickListener() { @Override public void onClick(View view) { } }).show(); } }); Bundle userParamBundle = this.getArguments(); userName = userParamBundle.getString("userName"); userCode = userParamBundle.getString("userCode"); setCountryCode(rootView); setClientType(rootView); showProgress(false); internetConn = new CheckInternetConnection(getActivity()); mClientRegSaveButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (internetConn.isNetworkConnected() == true) { attemptRegister(rootView); } else { displayAlert(); } } }); mClientRegCameraButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { selectImage(rootView); } }); if(savedInstanceState != null) { if (savedInstanceState.containsKey(CAPTURED_PHOTO_URI_KEY)) { selectedImageUri = Uri.parse(savedInstanceState.getString(CAPTURED_PHOTO_URI_KEY)); if(selectedImageUri == null) { selectedImageUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + getResources().getResourcePackageName(R.mipmap.no_photo) + '/' + getResources().getResourceTypeName(R.mipmap.no_photo) + '/' + getResources().getResourceEntryName(R.mipmap.no_photo)); } } if (savedInstanceState.containsKey(CAPTURED_PHOTO_CHECK_FLAG)) { CHECK = savedInstanceState.getInt(CAPTURED_PHOTO_CHECK_FLAG); } showImage(); } return rootView; } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); Snackbar.make(getView(), R.string.optional_field_required, Snackbar.LENGTH_INDEFINITE) .setAction(R.string.ok, new View.OnClickListener() { @Override public void onClick(View view) { } }).show(); } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); if(selectedImageUri != null) { outState.putString(CAPTURED_PHOTO_URI_KEY, selectedImageUri.toString()); } if (CHECK != 0) { outState.putInt(CAPTURED_PHOTO_CHECK_FLAG, CHECK); } } private File getFileName() { File mediaStorageDir= null; if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) { mediaStorageDir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + getContext().getPackageName() + File.separator + "Images"); } else { ContextWrapper cw = new ContextWrapper(getContext()); // path to /data/data/yourapp/app_data/imageDir mediaStorageDir = cw.getDir("Images", Context.MODE_PRIVATE); } if (! mediaStorageDir.exists()){ if (! mediaStorageDir.mkdirs()){ return null; } } String timeStamp = new SimpleDateFormat("ddMMyyyy_HHmmssSS").format(new Date()); mImageName="GM_"+ timeStamp +".jpg"; return new File(mediaStorageDir.getPath() + '/' + mImageName); } private void showCamera(View rootView) { // BEGIN_INCLUDE(camera_permission) // Check if the Camera permission is already available. if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) { // Camera permission has not been granted. requestCameraPermission(rootView); ///requestStoragePermission(rootView); } else { // Camera permissions is already available, show the camera preview. Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); imgFile = getFileName(); if(imgFile == null) { requestStoragePermission(rootView); return; } intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(imgFile)); try { FileOutputStream imageOutputStream = new FileOutputStream(imgFile); startActivityForResult(intent, RESULT_CLICK_LOAD_IMAGE); } catch (FileNotFoundException e) { requestStoragePermission(rootView); e.printStackTrace(); } } // END_INCLUDE(camera_permission) } private void requestCameraPermission(View rootView) { // BEGIN_INCLUDE(camera_permission_request) if (ActivityCompat.shouldShowRequestPermissionRationale(getActivity(), Manifest.permission.CAMERA)) { // Provide an additional rationale to the user if the permission was not granted // and the user would benefit from additional context for the use of the permission. // For example if the user has previously denied the permission. Snackbar.make(rootView, R.string.permission_camera_rationale, Snackbar.LENGTH_INDEFINITE) .setAction(R.string.ok, new View.OnClickListener() { @Override public void onClick(View view) { ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.CAMERA}, REQUEST_CAMERA); } }) .show(); } else { // Camera permission has not been granted yet. Request it directly. ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.CAMERA}, REQUEST_CAMERA); } // END_INCLUDE(camera_permission_request) } private void requestStoragePermission(View rootView) { // BEGIN_INCLUDE(camera_permission_request) // BEGIN_INCLUDE(camera_permission_request) if (ActivityCompat.shouldShowRequestPermissionRationale(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) && ActivityCompat.shouldShowRequestPermissionRationale(getActivity(), Manifest.permission.READ_EXTERNAL_STORAGE)) { //if((ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) // && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { // Provide an additional rationale to the user if the permission was not granted // and the user would benefit from additional context for the use of the permission. // For example if the user has previously denied the permission. Snackbar.make(rootView, R.string.permission_storage_rationale, Snackbar.LENGTH_INDEFINITE) .setAction(R.string.ok, new View.OnClickListener() { @Override public void onClick(View view) { ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_STORAGE); } }) .show(); } else { // storage permission has not been granted yet. Request it directly. // storage permission has not been granted yet. Request it directly. ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_STORAGE); } // END_INCLUDE(storage_permission_request) } private void selectImage(final View rootView) { final CharSequence[] options = { "Click Photo", "Choose from Gallery","Cancel" }; AlertDialog.Builder builder = new AlertDialog.Builder(this.getActivity()); builder.setTitle("Add Photo!"); builder.setItems(options, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int item) { if (options[item].equals("Click Photo")) { showCamera(rootView); } else if (options[item].equals("Choose from Gallery")) { Intent galleryIntent = new Intent(Intent.ACTION_PICK); File pictureDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); String photoPath = pictureDirectory.getPath(); Uri photoUri = Uri.parse(photoPath); galleryIntent.setDataAndType(photoUri, "image/*"); startActivityForResult(galleryIntent, RESULT_LOAD_IMAGE); } else if (options[item].equals("Cancel")) { dialog.dismiss(); } } }); builder.show(); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { try { CHECK = 0; if(requestCode == RESULT_LOAD_IMAGE && data != null && resultCode == getActivity().RESULT_OK) { if (data.getData() == null) { selectedImageUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + getResources().getResourcePackageName(R.mipmap.no_photo) + '/' + getResources().getResourceTypeName(R.mipmap.no_photo) + '/' + getResources().getResourceEntryName(R.mipmap.no_photo)); } else { selectedImageUri = data.getData(); CHECK = RESULT_LOAD_IMAGE; mImageName = new File("" + selectedImageUri).getName().toString(); } } else if (requestCode == RESULT_CLICK_LOAD_IMAGE && resultCode == getActivity().RESULT_OK) { if(Uri.fromFile(imgFile) == null) { selectedImageUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + getResources().getResourcePackageName(R.mipmap.no_photo) + '/' + getResources().getResourceTypeName(R.mipmap.no_photo) + '/' + getResources().getResourceEntryName(R.mipmap.no_photo)); } else { selectedImageUri = Uri.fromFile(imgFile); CHECK = RESULT_CLICK_LOAD_IMAGE; } } else { selectedImageUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + getResources().getResourcePackageName(R.mipmap.no_photo) + '/' + getResources().getResourceTypeName(R.mipmap.no_photo) + '/' + getResources().getResourceEntryName(R.mipmap.no_photo)); } showImage(); } catch (Exception e) { e.printStackTrace(); } super.onActivityResult(requestCode, resultCode, data); } public void showImage () { Bitmap capturePhotoBitmap = null; int srcHeight, srcWidth, inSampleSize; BitmapFactory.Options mClientRegBitmapOptions = new BitmapFactory.Options(); mClientRegBitmapOptions.inPreferredConfig = Bitmap.Config.ARGB_8888; mClientRegBitmapOptions.inJustDecodeBounds=true; if (CHECK == 0) { mClientRegProfileImageView.setImageURI(selectedImageUri); } else { BitmapFactory.decodeFile(getRealPathFromUri(getContext(), selectedImageUri, CHECK), mClientRegBitmapOptions); // if(new File(getRealPathFromUri(getContext(), selectedImageUri, CHECK)).exists()) { // System.out.println("File Already Existssss"); // } else { // System.out.println("File NOT Existssss"); // } srcHeight = mClientRegBitmapOptions.outHeight; srcWidth = mClientRegBitmapOptions.outWidth; inSampleSize = calculateInSampleSize(mClientRegBitmapOptions, 400, 400); mClientRegBitmapOptions.inSampleSize = inSampleSize; mClientRegBitmapOptions.inDensity = srcWidth; mClientRegBitmapOptions.inTargetDensity = 400 * mClientRegBitmapOptions.inSampleSize; mClientRegBitmapOptions.inJustDecodeBounds=false; capturePhotoBitmap = BitmapFactory.decodeFile(getRealPathFromUri(getContext(), selectedImageUri, CHECK), mClientRegBitmapOptions); mClientRegProfileImageView.setImageBitmap(capturePhotoBitmap); } } public static String getRealPathFromUri(Context context, Uri contentUri, int CHECK) { Cursor cursor = null; try { if (CHECK == RESULT_LOAD_IMAGE) { String[] proj = {MediaStore.Images.Media.DATA}; cursor = context.getContentResolver().query(contentUri, proj, null, null, null); int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); return cursor.getString(column_index); } else if (CHECK == RESULT_CLICK_LOAD_IMAGE) { return contentUri.getPath().toString(); } return null; } finally { if (cursor != null) { cursor.close(); } } } private static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) { final int height = options.outHeight; final int width = options.outWidth; int inSampleSize = 1; if (height > reqHeight || width > reqWidth) { // Calculate ratios of height and width to requested height and // width final int heightRatio = Math.round((float) height / (float) reqHeight); final int widthRatio = Math.round((float) width / (float) reqWidth); // Choose the smallest ratio as inSampleSize value, this will // guarantee // a final image with both dimensions larger than or equal to the // requested height and width. inSampleSize = heightRatio < widthRatio ? heightRatio : widthRatio; } return inSampleSize; } private void setCountryCode (View rootView) { mClientRegCountryCodeSpnr = (Spinner) rootView.findViewById(R.id.client_register_country_spinner); Resources resources = getResources(); TypedArray countryCode = resources.obtainTypedArray(R.array.countries); ArrayList<String> country = new ArrayList<String>(); ArrayList<String> code = new ArrayList<String>(); int countryArrLen = countryCode.length(); for (int i=0; i < countryArrLen; i++) { int countryId = countryCode.getResourceId(i, 0); code.add(resources.getStringArray(countryId)[0]); country.add(resources.getStringArray(countryId)[1]); } countryCode.recycle(); fCode = code; fCountry = country; ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this.getActivity(), android.R.layout.simple_spinner_item, country); mClientRegCountryCodeSpnr.setAdapter(dataAdapter); mClientRegCountryCodeSpnr.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { String selectedCountry = (String) mClientRegCountryCodeSpnr.getSelectedItem(); int selectedPosition = fCountry.indexOf(selectedCountry); String correspondingCode = fCode.get(selectedPosition); } @Override public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub } }); } private void setClientType (View rootView) { mClientRegTypeSpnr = (Spinner) rootView.findViewById(R.id.client_register_type_spinner); Resources resources = getResources(); TypedArray clientTypeArr = resources.obtainTypedArray(R.array.clientType); ArrayList<String> type = new ArrayList<String>(); ArrayList<String> code = new ArrayList<String>(); int clientTypArrLen = clientTypeArr.length(); for (int i=0; i < clientTypArrLen; i++) { int clientTypeId = clientTypeArr.getResourceId(i, 0); code.add(resources.getStringArray(clientTypeId)[0]); type.add(resources.getStringArray(clientTypeId)[1]); } clientTypeArr.recycle(); fClientTypeCode = code; fClientType = type; ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this.getActivity(), android.R.layout.simple_spinner_item, type); mClientRegTypeSpnr.setAdapter(dataAdapter); mClientRegTypeSpnr.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { String selectedType = (String) mClientRegTypeSpnr.getSelectedItem(); int selectedPosition = fClientType.indexOf(selectedType); String correspondingCode = fClientTypeCode.get(selectedPosition); } @Override public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub } }); } public void displayAlert() { new AlertDialog.Builder(getActivity()).setMessage("Please Check Your Internet Connection and Try Again") .setTitle("Network Error") .setCancelable(true) .setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton){ getActivity().finish(); } }) .show(); } private void attemptRegister(View rootView) { try { if (crt != null) { return; } String errorStr = ""; // Reset errors. mClientRegDescTextView.setError(null); mClientRegNameTextView.setError(null); mClientRegAddressTextView.setError(null); mClientRegPinTextView.setError(null); mClientRegPhone1TextView.setError(null); mClientRegPhone2TextView.setError(null); mClientRegLicNumTextView.setError(null); mClientRegSpecTextView.setError(null); mClientRegEmailTextView.setError(null); // Store values at the time of the login attempt. String description = mClientRegDescTextView.getText().toString(); String name = mClientRegNameTextView.getText().toString(); String address = mClientRegAddressTextView.getText().toString(); String pincode = mClientRegPinTextView.getText().toString(); String phone1 = mClientRegPhone1TextView.getText().toString(); String phone2 = mClientRegPhone2TextView.getText().toString(); String licenseNum = mClientRegLicNumTextView.getText().toString(); String speciality = mClientRegSpecTextView.getText().toString(); String email = mClientRegEmailTextView.getText().toString(); Bitmap profilePhoto = ((BitmapDrawable) mClientRegProfileImageView.getDrawable()).getBitmap(); String profilePhotoFileNm = mImageName; boolean cancel = false; View focusView = null; // Check if Description entered if (TextUtils.isEmpty(description)) { mClientRegDescTextView.setError(getString(R.string.error_field_required)); focusView = mClientRegDescTextView; cancel = true; } // Check if Name entered. if (TextUtils.isEmpty(name)) { mClientRegNameTextView.setError(getString(R.string.error_field_required)); focusView = mClientRegNameTextView; cancel = true; } else if (!isNameValid(name)) { mClientRegNameTextView.setError(getString(R.string.error_invalid_name)); focusView = mClientRegNameTextView; cancel = true; } // Check if Address entered if (TextUtils.isEmpty(address)) { mClientRegAddressTextView.setError(getString(R.string.error_field_required)); focusView = mClientRegAddressTextView; cancel = true; } // Check if PinCode entered if (TextUtils.isEmpty(pincode)) { mClientRegAddressTextView.setError(getString(R.string.error_field_required)); focusView = mClientRegPinTextView; cancel = true; } // Check for a valid Phone1. if (TextUtils.isEmpty(phone1)) { mClientRegPhone1TextView.setError(getString(R.string.error_field_required)); focusView = mClientRegPhone1TextView; cancel = true; } else if (!isPhoneValid(phone1)) { mClientRegPhone1TextView.setError(getString(R.string.error_invalid_phone)); focusView = mClientRegPhone1TextView; cancel = true; } // Check for a valid Phone2. if (!isPhoneValid(phone2)) { mClientRegPhone2TextView.setError(getString(R.string.error_invalid_phone)); focusView = mClientRegPhone2TextView; cancel = true; } // Check for a valid Email. if (TextUtils.isEmpty(email)) { mClientRegEmailTextView.setError(getString(R.string.error_field_required)); focusView = mClientRegEmailTextView; cancel = true; } else if (!isEmailValid(email)) { mClientRegEmailTextView.setError(getString(R.string.error_invalid_email)); focusView = mClientRegEmailTextView; cancel = true; } // Check if License Number entered if (TextUtils.isEmpty(licenseNum)) { mClientRegLicNumTextView.setError(getString(R.string.error_field_required)); focusView = mClientRegLicNumTextView; cancel = true; } // Check if Speciality entered if (TextUtils.isEmpty(speciality)) { mClientRegSpecTextView.setError(getString(R.string.error_field_required)); focusView = mClientRegSpecTextView; cancel = true; } String selectedRegType = (String) mClientRegTypeSpnr.getSelectedItem(); int selectedTypePosition = fClientType.indexOf(selectedRegType); String correspondingRegTypeCode = fClientTypeCode.get(selectedTypePosition); if (correspondingRegTypeCode.equals("0")) { errorStr += " RegistrationType"; focusView = mClientRegTypeSpnr; cancel = true; } String selectedCountry = (String) mClientRegCountryCodeSpnr.getSelectedItem(); int selectedPosition = fCountry.indexOf(selectedCountry); String correspondingCode = fCode.get(selectedPosition); if (correspondingCode.equals("0")) { errorStr += " Country"; focusView = mClientRegCountryCodeSpnr; cancel = true; } if (cancel) { // There was an error; don't attempt login and focus the first // form field with an error. if (!errorStr.equals("")) { errorStr += " should be selected."; Toast.makeText(getActivity().getApplicationContext(), errorStr, Toast.LENGTH_LONG).show(); } focusView.requestFocus(); } else { // Show a progress spinner, and kick off a background task to // perform the user login attempt. showProgress(true); crt = new ClientRegisterTask(name, address, pincode, correspondingCode, phone1, phone2, email, licenseNum, speciality, selectedRegType, description, userName, userCode, profilePhotoFileNm, profilePhoto); crt.execute(name, address, pincode, correspondingCode, phone1, phone2, email, licenseNum, speciality, selectedRegType, description, userName, userCode, profilePhotoFileNm); } } catch (Exception e) { e.printStackTrace(); } } private boolean isPhoneValid(String phone) { return ((phone.length() >= 10)&&(phone.matches("[0-9]+"))); } private boolean isNameValid(String name) { return ((name.length() > 2)&&(name.matches("[a-zA-Z .]+"))); } private boolean isEmailValid(String email) { //TODO: Replace this with your own logic return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches(); } @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) private void showProgress(final boolean show) { // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow // for very easy animations. If available, use these APIs to fade-in // the progress spinner. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime); mClientRegFormView.setVisibility(show ? View.GONE : View.VISIBLE); mClientRegFormView.animate().setDuration(shortAnimTime).alpha( show ? 0 : 1).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mClientRegFormView.setVisibility(show ? View.GONE : View.VISIBLE); } }); mClientRegProgressBar.setVisibility(show ? View.VISIBLE : View.GONE); mClientRegProgressBar.animate().setDuration(shortAnimTime).alpha( show ? 1 : 0).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mClientRegProgressBar.setVisibility(show ? View.VISIBLE : View.GONE); } }); } else { // The ViewPropertyAnimator APIs are not available, so simply show // and hide the relevant UI components. mClientRegProgressBar.setVisibility(show ? View.VISIBLE : View.GONE); mClientRegFormView.setVisibility(show ? View.GONE : View.VISIBLE); } } public class ClientRegisterTask extends AsyncTask<String, String, String> { //crt = new ClientRegisterTask(userName, firstName, middleName, lastName, mClientRegGenderRadioBtn.getText(), //dob, selectedCountry, correspondingCode, phone, email, address); private final String mClientName, mClientAddress, mClientPin, mClientCountryCode, mClientPhoneNum1, mClientPhoneNum2; private final String mClientEmail, mClientLicenseNum, mClientSpeciality, mClientType, mClientDesc, mUserName, mUserCode, mClientProfilePhotoNm; private final Bitmap mClientPhoto; ClientRegisterTask(String clientName, String clientAddress, String clientPin, String clientCountryCode, String clientPhoneNum1, String clientPhoneNum2, String clientEmail, String clientLicenseNum, String clientSpeciality, String clientType, String clientDesc, String userName, String userCode, String clientProfilePhotoNm, Bitmap clientPhoto) { mClientName=clientName; mClientAddress=clientAddress; mClientPin=clientPin; mClientCountryCode=clientCountryCode; mClientPhoneNum1=clientPhoneNum1; mClientPhoneNum2=clientPhoneNum2; mClientEmail=clientEmail; mClientLicenseNum=clientLicenseNum; mClientSpeciality=clientSpeciality; mClientType=clientType; mClientDesc=clientDesc; mUserName=userName; mUserCode=userCode; mClientProfilePhotoNm = clientProfilePhotoNm; mClientPhoto = clientPhoto; } @Override protected String doInBackground(String... params) { // TODO: attempt authentication against a network service. String loginResponse = ""; ByteArrayOutputStream clientPhotoByteArrOpStream = null; String encodedPhoto = ""; if(params[13] != null) { clientPhotoByteArrOpStream = new ByteArrayOutputStream(); mClientPhoto.compress(Bitmap.CompressFormat.JPEG, 100, clientPhotoByteArrOpStream); encodedPhoto = Base64.encodeToString(clientPhotoByteArrOpStream.toByteArray(), Base64.DEFAULT); } try { // Simulate network access. Thread.sleep(2000); final String login_url = getString(R.string.url) + "/clientRegister.php"; try { URL loginURL = new URL(login_url); HttpURLConnection loginHTTP = (HttpURLConnection) loginURL.openConnection(); loginHTTP.setRequestMethod("POST"); loginHTTP.setDoOutput(true); OutputStream loginOS = loginHTTP.getOutputStream(); BufferedWriter loginWriter = new BufferedWriter(new OutputStreamWriter(loginOS,"UTF-8")); String loginData = URLEncoder.encode("client_name", "UTF-8") + "=" + URLEncoder.encode(params[0],"UTF-8") + "&" + URLEncoder.encode("client_address", "UTF-8") + "=" + URLEncoder.encode(params[1],"UTF-8") + "&" + URLEncoder.encode("client_pin", "UTF-8") + "=" + URLEncoder.encode(params[2],"UTF-8") + "&" + URLEncoder.encode("client_country_cd", "UTF-8") + "=" + URLEncoder.encode(params[3],"UTF-8") + "&" + URLEncoder.encode("client_phone1", "UTF-8") + "=" + URLEncoder.encode(params[4],"UTF-8") + "&" + URLEncoder.encode("client_phone2", "UTF-8") + "=" + URLEncoder.encode(params[5],"UTF-8") + "&" + URLEncoder.encode("client_email", "UTF-8") + "=" + URLEncoder.encode(params[6],"UTF-8") + "&" + URLEncoder.encode("client_lic_num", "UTF-8") + "=" + URLEncoder.encode(params[7],"UTF-8") + "&" + URLEncoder.encode("client_speciality", "UTF-8") + "=" + URLEncoder.encode(params[8],"UTF-8") + "&" + URLEncoder.encode("client_type", "UTF-8") + "=" + URLEncoder.encode(params[9], "UTF-8") + "&" + URLEncoder.encode("client_descr", "UTF-8") + "=" + URLEncoder.encode(params[10], "UTF-8") + "&" + URLEncoder.encode("user_code", "UTF-8") + "=" + URLEncoder.encode(params[12], "UTF-8"); if(params[13] == null) { loginData += "&" + URLEncoder.encode("client_photo_path", "UTF-8") + "=&" + URLEncoder.encode("client_photo", "UTF-8") + "="; } else { loginData += "&" + URLEncoder.encode("client_photo_path", "UTF-8") + "=" + URLEncoder.encode(params[13], "UTF-8") + "&" + URLEncoder.encode("client_photo", "UTF-8") + "=" + URLEncoder.encode(encodedPhoto, "UTF-8"); } loginWriter.write(loginData); loginWriter.flush(); loginWriter.close(); loginOS.close(); InputStream loginIS = loginHTTP.getInputStream(); BufferedReader loginReader = new BufferedReader(new InputStreamReader(loginIS,"iso-8859-1")); String line = ""; while ((line = loginReader.readLine()) != null) { loginResponse += line; } loginReader.close(); loginIS.close(); loginHTTP.disconnect(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } catch (InterruptedException e) { return "Something unfortunate happened."; } return loginResponse; } @Override protected void onPostExecute(final String result) { crt = null; showProgress(false); if(result.startsWith("Client registration completed")) { Bundle userParamBundle = new Bundle(); userParamBundle.putString("userName", userName); userParamBundle.putString("userCode", userCode); ClientListFragment fragment2 = new ClientListFragment(); fragment2.setArguments(userParamBundle); android.support.v4.app.FragmentManager fragmentManager = getFragmentManager(); android.support.v4.app.FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.docDirContentFrame, fragment2, "MED_LIST"); // fragmentTransaction.add(R.id.docDirContentLinearLayout, fragment2, "MED_LIST"); fragmentTransaction.addToBackStack("MED_LIST"); fragmentTransaction.commit(); } Toast.makeText(getActivity().getApplicationContext(), result, Toast.LENGTH_LONG).show(); } @Override protected void onCancelled() { crt = null; showProgress(false); } } }
[ "abhyudaya.sinha.addy@gmail.com" ]
abhyudaya.sinha.addy@gmail.com
c68eecb0eb4ddb239d2ca399720e61c5f7384648
b2f216aabc23f7c598a56579deb2afd0f2a871fb
/UML/src/Jiemian/Main.java
68b2dd6d324475ac5e3b8b3ae25294cb50a30516
[]
no_license
GYSml/JavaFrameAtmSystem
7e85ff1188bf993c2b241f0f22e783af5a5e8ce5
fda45a89af640a290511330e56f605342a29e7e6
refs/heads/master
2016-09-13T18:18:46.062323
2016-05-14T11:22:52
2016-05-14T11:22:52
56,765,110
0
0
null
null
null
null
UTF-8
Java
false
false
106
java
package Jiemian; public class Main { public static void main(String[] args) { new TestFrame(); } }
[ "1358121691@qq.com" ]
1358121691@qq.com
8c17695a3e0538f81854a55e6b6d7c3e99828b12
57fb6b377eda45f337ee15126866d6f122bb9aac
/service-core/src/main/java/com/atguigu/srb/core/service/LendReturnService.java
5ee0e91f5524a1390a7d38b310ea08f4a2668680
[]
no_license
taofeng1994/srb0914
c4c7d1156a9a8bd108770887b725a36c38b14007
7704dbc31d06b958d4210e92bf6e9b74ae59eab6
refs/heads/main
2023-08-24T10:07:07.398247
2021-10-15T06:02:02
2021-10-15T06:02:02
406,208,104
0
0
null
null
null
null
UTF-8
Java
false
false
318
java
package com.atguigu.srb.core.service; import com.atguigu.srb.core.pojo.entity.LendReturn; import com.baomidou.mybatisplus.extension.service.IService; /** * <p> * 还款记录表 服务类 * </p> * * @author ${author} * @since 2021-09-22 */ public interface LendReturnService extends IService<LendReturn> { }
[ "765060305@qq.com" ]
765060305@qq.com
d31990b9ecd9d22c9f6bf4aa5b5d12d5c20a6af8
cf5fa493f7f48743baf98726770d9af1e12590be
/app/src/main/java/com/huupt/clonetiki/utils/Constants.java
3e2a715193e3202f70dff245b77412e2bf1e2dd5
[]
no_license
huuphong91/CloneTiki
4b5686b6114e745e4c59e1851020675178e7e68f
ba68ebbed3d6d8f51be4bc8f118fbbf3e3347c4d
refs/heads/master
2022-11-23T16:40:27.875286
2020-08-02T07:57:37
2020-08-02T07:58:32
284,417,319
0
0
null
null
null
null
UTF-8
Java
false
false
129
java
package com.huupt.clonetiki.utils; public class Constants { public static final String BASE_URL = "https://api.tiki.vn"; }
[ "huuphong91@gmail.com" ]
huuphong91@gmail.com
544bcabd2050e2f2f4349c7e71a1e03d6c43b9fa
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/33/33_528bffe1426eeb59e1bf5d04998222f5a176252e/JDIStackFrame/33_528bffe1426eeb59e1bf5d04998222f5a176252e_JDIStackFrame_s.java
0572a967136c71f0b5e6b79f280672ac36aaf8e7
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
28,549
java
package org.eclipse.jdt.internal.debug.core; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.IDebugElement; import org.eclipse.debug.core.model.IRegisterGroup; import org.eclipse.debug.core.model.IStackFrame; import org.eclipse.debug.core.model.ITerminate; import org.eclipse.debug.core.model.IThread; import org.eclipse.debug.core.model.IVariable; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.eval.IEvaluationContext; import org.eclipse.jdt.debug.core.IJavaClassType; import org.eclipse.jdt.debug.core.IJavaEvaluate; import org.eclipse.jdt.debug.core.IJavaEvaluationListener; import org.eclipse.jdt.debug.core.IJavaModifiers; import org.eclipse.jdt.debug.core.IJavaObject; import org.eclipse.jdt.debug.core.IJavaStackFrame; import org.eclipse.jdt.debug.core.IJavaThread; import org.eclipse.jdt.debug.core.IJavaVariable; import com.sun.jdi.AbsentInformationException; import com.sun.jdi.Field; import com.sun.jdi.LocalVariable; import com.sun.jdi.Location; import com.sun.jdi.Method; import com.sun.jdi.NativeMethodException; import com.sun.jdi.ObjectReference; import com.sun.jdi.StackFrame; import com.sun.jdi.ThreadReference; import com.sun.jdi.Type; import com.sun.jdi.VirtualMachine; /** * Proxy to a stack frame on the target. */ public class JDIStackFrame extends JDIDebugElement implements IJavaStackFrame { /** * Underlying JDI stack frame */ private StackFrame fStackFrame; /** * The last (previous) underlying stack frame */ private StackFrame fLastStackFrame; /** * Containing thread */ private JDIThread fThread; /** * Visible variables */ private List fVariables; /** * The method this stack frame is associated with. Cached * lazily on first access. */ private Method fMethod= null; /** * The underlying Object associated with this stack frame. Cached lazily on * first access. */ private ObjectReference fThisObject; /** * The name of the type in which the method for this stack frame was * declared (implemented). Cached on lazily first access. */ private String fDeclaringTypeName; /** * The name of the type of the object that received the method call associated * with this stack frame. Cached on lazily first access. */ private String fReceivingTypeName; /** * Whether the variables need refreshing */ private boolean fRefreshVariables= true; /** * Whether this stack frame has been declared out of synch */ private boolean fIsOutOfSynch= false; /** * Creates a new stack frame in the given thread. * * @param thread The parent JDI thread * @param stackFrame The underlying stack frame */ public JDIStackFrame(JDIThread thread, StackFrame stackFrame) { super((JDIDebugTarget)thread.getDebugTarget()); setUnderlyingStackFrame(stackFrame); setThread(thread); } /** * @see IDebugElement#getElementType() */ public int getElementType() { return STACK_FRAME; } /** * @see IStackFrame#getThread() */ public IThread getThread() { return fThread; } /** * @see ISuspendResume#canResume() */ public boolean canResume() { return getThread().canResume(); } /** * @see ISuspendResume#canSuspend() */ public boolean canSuspend() { return getThread().canSuspend(); } /** * @see IStep#canStepInto() */ public boolean canStepInto() { try { return exists() && isTopStackFrame() && getThread().canStepInto(); } catch (DebugException e) { logError(e); return false; } } /** * @see IStep#canStepOver() */ public boolean canStepOver() { try { return exists() && getThread().canStepOver(); } catch (DebugException e) { logError(e); return false; } } /** * @see IStep#canStepReturn() */ public boolean canStepReturn() { try { List frames = ((JDIThread)getThread()).computeStackFrames(); if (frames != null && !frames.isEmpty()) { Object bottomFrame = frames.get(frames.size() - 1); return exists() && !this.equals(bottomFrame) && getThread().canStepReturn(); } } catch (DebugException e) { logError(e); } return false; } /** * Returns the underlying method associated with this stack frame, * retreiving the method is necessary. */ protected Method getUnderlyingMethod() throws DebugException { if (fMethod == null) { try { fMethod= getUnderlyingStackFrame().location().method(); } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retrieving_method"), new String[] {e.toString()}), e); //$NON-NLS-1$ } } return fMethod; } /** * @see IStackFrame#getVariables() */ public IVariable[] getVariables() throws DebugException { List list = getVariables0(); return (IVariable[])list.toArray(new IVariable[list.size()]); } protected synchronized List getVariables0() throws DebugException { if (fVariables == null) { Method method= getUnderlyingMethod(); fVariables= new ArrayList(); // #isStatic() does not claim to throw any exceptions - so it is not try/catch coded if (method.isStatic()) { // add statics List allFields= null; try { allFields= method.declaringType().allFields(); } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retrieving_fields"),new String[] {e.toString()}), e); //$NON-NLS-1$ // execution will not reach this line, as // #targetRequestFailed will throw an exception return Collections.EMPTY_LIST; } if (allFields != null) { Iterator fields= allFields.iterator(); while (fields.hasNext()) { Field field= (Field) fields.next(); if (field.isStatic()) { fVariables.add(new JDIFieldVariable((JDIDebugTarget)getDebugTarget(), field, null)); } } Collections.sort(fVariables, new Comparator() { public int compare(Object a, Object b) { JDIFieldVariable v1= (JDIFieldVariable)a; JDIFieldVariable v2= (JDIFieldVariable)b; try { return v1.getName().compareToIgnoreCase(v2.getName()); } catch (DebugException de) { logError(de); return -1; } } }); } } else { // add "this" ObjectReference t= getUnderlyingThisObject(); if (t != null) { fVariables.add(new JDIThisVariable((JDIDebugTarget)getDebugTarget(), t)); } } // add locals Iterator variables= getUnderlyingVisibleVariables().iterator(); while (variables.hasNext()) { LocalVariable var= (LocalVariable) variables.next(); fVariables.add(new JDILocalVariable(this, var)); } } else if (fRefreshVariables) { updateVariables(); } fRefreshVariables = false; return fVariables; } /** * @see org.eclipse.debug.core.model.IStackFrame#getName() */ public String getName() throws DebugException { return getMethodName(); } /** * @see IJavaStackFrame#getArgumentTypeNames() */ public List getArgumentTypeNames() throws DebugException { try { return getUnderlyingMethod().argumentTypeNames(); } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retrieving_argument_type_names"), new String[] {e.toString()}), e); //$NON-NLS-1$ // execution will never reach this line, as // #targetRequestFailed will throw an exception return null; } } /** * @see IStackFrame#getLineNumber() */ public int getLineNumber() throws DebugException { if (isSuspended()) { try { Location location= getUnderlyingStackFrame().location(); if (location != null) { return location.lineNumber(); } } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retrieving_line_number"), new String[] {e.toString()}), e); //$NON-NLS-1$ } } return -1; } /** * @see IStep#isStepping() */ public boolean isStepping() { return getThread().isStepping(); } /** * @see ISuspendResume#isSuspended() */ public boolean isSuspended() { return getThread().isSuspended(); } /** * @see ISuspendResume#resume() */ public void resume() throws DebugException { getThread().resume(); } /** * @see IStep#stepInto() */ public void stepInto() throws DebugException { if (!canStepInto()) { return; } getThread().stepInto(); } /** * @see IStep#stepOver() */ public void stepOver() throws DebugException { if (!canStepOver()) { return; } if (isTopStackFrame()) { getThread().stepOver(); } else { ((JDIThread)getThread()).stepToFrame(this); } } /** * @see IStep#stepReturn() */ public void stepReturn() throws DebugException { if (!canStepReturn()) { return; } if (isTopStackFrame()) { getThread().stepReturn(); } else { List frames = ((JDIThread)getThread()).computeStackFrames(); int index = frames.indexOf(this); if (index >= 0 && index < frames.size() - 1) { IStackFrame nextFrame = (IStackFrame)frames.get(index + 1); ((JDIThread)getThread()).stepToFrame(nextFrame); } } } /** * @see ISuspendResume#suspend() */ public void suspend() throws DebugException { getThread().suspend(); } /** * Incrementally updates this stack frames variables. * * @see JDIDebugElement#targetRequestFailed(String, RuntimeException) */ protected void updateVariables() throws DebugException { if (fVariables == null) { return; } Method method= getUnderlyingMethod(); int index= 0; if (!method.isStatic()) { // update "this" ObjectReference thisObject= getUnderlyingThisObject(); JDIThisVariable oldThisObject= null; if (!fVariables.isEmpty() && fVariables.get(0) instanceof JDIThisVariable) { oldThisObject= (JDIThisVariable) fVariables.get(0); } if (thisObject == null && oldThisObject != null) { // removal of 'this' fVariables.remove(0); index= 0; } else { if (oldThisObject == null && thisObject != null) { // creation of 'this' oldThisObject= new JDIThisVariable((JDIDebugTarget)getDebugTarget(),thisObject); fVariables.add(0, oldThisObject); index= 1; } else { if (oldThisObject != null) { // 'this' still exists index= 1; } } } } List locals= null; try { locals= getUnderlyingStackFrame().visibleVariables(); } catch (AbsentInformationException e) { locals= new ArrayList(0); } catch (NativeMethodException e) { locals= new ArrayList(0); } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retrieving_visible_variables"),new String[] {e.toString()}), e); //$NON-NLS-1$ // execution will not reach this line, as // #targetRequestFailed will throw an exception return; } int localIndex= -1; while (index < fVariables.size()) { Object var= fVariables.get(index); if (var instanceof JDILocalVariable) { JDILocalVariable local= (JDILocalVariable) fVariables.get(index); localIndex= locals.indexOf(local.getLocal()); if (localIndex >= 0) { // update variable with new underling JDI LocalVariable local.setLocal((LocalVariable) locals.get(localIndex)); locals.remove(localIndex); index++; } else { // remove variable fVariables.remove(index); } } else { //field variable of a static frame index++; } } // add any new locals Iterator newOnes= locals.iterator(); while (newOnes.hasNext()) { JDILocalVariable local= new JDILocalVariable(this, (LocalVariable) newOnes.next()); fVariables.add(local); } } /** * @see IJavaStackFrame#supportsDropToFrame() */ public boolean supportsDropToFrame() { //FIXME 1GH3XDA: ITPDUI:ALL - Drop to frame hangs if after invoke JDIThread thread= (JDIThread) getThread(); boolean jdkSupport= getVM().canPopFrames(); boolean j9Support= false; try { j9Support= (thread.getUnderlyingThread() instanceof org.eclipse.jdi.hcr.ThreadReference) && ((org.eclipse.jdi.hcr.VirtualMachine) ((JDIDebugTarget) getDebugTarget()).getVM()).canDoReturn(); } catch (UnsupportedOperationException uoe) { j9Support= false; } try { boolean supported = !thread.isTerminated() && thread.isSuspended() && (jdkSupport || j9Support); if (supported) { // Also ensure that this frame and no frames above this // frame are native. Unable to pop native stack frames. List frames= thread.computeStackFrames(); Iterator iter= frames.iterator(); JDIStackFrame frame= null; while (iter.hasNext()) { frame= (JDIStackFrame) iter.next(); if (frame.isNative()) { return false; } if (frame.equals(this)) { return true; } } } return false; } catch (DebugException e) { logError(e); } catch (UnsupportedOperationException e) { // drop to frame not supported - this is an expected // exception for VMs that do not support drop to frame return false; } catch (RuntimeException e) { internalError(e); } return false; } /** * @see IJavaStackFrame#dropToFrame() */ public void dropToFrame() throws DebugException { if (supportsDropToFrame()) { ((JDIThread) getThread()).dropToFrame(this); } else { notSupported(JDIDebugModelMessages.getString("JDIStackFrame.Drop_to_frame_not_supported")); //$NON-NLS-1$ } } /** * @see IJavaStackFrame#findVariable(String) */ public IVariable findVariable(String varName) throws DebugException { IVariable[] variables = getVariables(); JDIThisVariable thisVariable= null; for (int i = 0; i < variables.length; i++) { IVariable var= (IVariable) variables[i]; if (var.getName().equals(varName)) { return var; } if (var instanceof JDIThisVariable) { // save for later - check for instance and static vars thisVariable= (JDIThisVariable)var; } } if (thisVariable != null) { Iterator thisChildren = ((JDIValue)thisVariable.getValue()).getVariables0().iterator(); while (thisChildren.hasNext()) { IVariable var= (IVariable) thisChildren.next(); if (var.getName().equals(varName)) { return var; } } } return null; } /** * Retrieves visible varialbes in this stack frame * handling any exceptions. Returns an empty list if there are no * variables. * * @see JDIDebugElement#targetRequestFailed(String, RuntimeException) */ protected List getUnderlyingVisibleVariables() throws DebugException { List variables= Collections.EMPTY_LIST; try { variables= getUnderlyingStackFrame().visibleVariables(); } catch (AbsentInformationException e) { } catch (NativeMethodException e) { } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retrieving_visible_variables_2"),new String[] {e.toString()}), e); //$NON-NLS-1$ } return variables; } /** * Retrieves 'this' from the underlying stack frame. * Returns <code>null</code> for static stack frames. * * @see JDIDebugElement#targetRequestFailed(String, RuntimeException) */ protected ObjectReference getUnderlyingThisObject() throws DebugException { if (fThisObject == null) { try { fThisObject = getUnderlyingStackFrame().thisObject(); } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retrieving_this"),new String[] {e.toString()}), e); //$NON-NLS-1$ // execution will not reach this line, as // #targetRequestFailed will throw an exception return null; } } return fThisObject; } /** * @see IAdaptable#getAdapter(java.lang.Class) */ public Object getAdapter(Class adapter) { if (adapter == IJavaStackFrame.class || adapter == IJavaModifiers.class) { return this; } return super.getAdapter(adapter); } /** * * @see IJavaEvaluate#evaluate(String, IJavaEvaluationListener, IJavaProject) */ public void evaluate(String snippet, IJavaEvaluationListener listener, IJavaProject project) throws DebugException { IEvaluationContext underlyingContext = ((JDIDebugTarget)getDebugTarget()).getEvaluationContext(project); evaluate(snippet, listener, underlyingContext); } /** * @see IJavaEvaluate#evaluate(String, IJavaEvaluationListener, IEvaluationContext) */ public void evaluate(String snippet, IJavaEvaluationListener listener, IEvaluationContext evaluationContext) throws DebugException { ((JDIThread)getThread()).verifyEvaluation(evaluationContext); StackFrameEvaluationContext context = new StackFrameEvaluationContext(this, evaluationContext); context.evaluate(snippet, listener); } /** * @see IJavaEvaluate#canPerformEvaluation() */ public boolean canPerformEvaluation() { return ((IJavaThread)getThread()).canPerformEvaluation(); } /** * @see IJavaStackFrame#getSignature() */ public String getSignature() throws DebugException { try { return getUnderlyingMethod().signature(); } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retrieving_method_signature"), new String[] {e.toString()}), e); //$NON-NLS-1$ // execution will not reach this line, as // #targetRequestFailed will throw an exception return null; } } /** * @see IJavaStackFrame#getDeclaringTypeName() */ public String getDeclaringTypeName() throws DebugException { if (fDeclaringTypeName == null) { try { Method underlyingMethod= getUnderlyingMethod(); if (underlyingMethod.isObsolete()) { fDeclaringTypeName= JDIDebugModelMessages.getString("JDIStackFrame.<unknown_declaring_type>_1"); //$NON-NLS-1$ } else { fDeclaringTypeName= getUnderlyingMethod().declaringType().name(); } } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retrieving_declaring_type"), new String[] {e.toString()}), e); //$NON-NLS-1$ // execution will not reach this line, as // #targetRequestFailed will throw an exception return null; } } return getUnderlyingMethod().declaringType().name(); } /** * @see IJavaStackFrame#getReceivingTypeName() */ public String getReceivingTypeName() throws DebugException { if (fReceivingTypeName == null) { try { if (getUnderlyingMethod().isObsolete()) { fReceivingTypeName=JDIDebugModelMessages.getString("JDIStackFrame.<unknown_receiving_type>_2"); //$NON-NLS-1$ } else { ObjectReference thisObject = getUnderlyingThisObject(); if (thisObject == null) { fReceivingTypeName = getDeclaringTypeName(); } else { fReceivingTypeName = thisObject.referenceType().name(); } } } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retrieving_receiving_type"), new String[] {e.toString()}), e); //$NON-NLS-1$ // execution will not reach this line, as // #targetRequestFailed will throw an exception return null; } } return fReceivingTypeName; } /** * @see IJavaStackFrame#getMethodName() */ public String getMethodName() throws DebugException { try { return getUnderlyingMethod().name(); } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retrieving_method_name"), new String[] {e.toString()}), e); //$NON-NLS-1$ // execution will not reach this line, as // #targetRequestFailed will throw an exception return null; } } /** * @see IJavaStackFrame#isNative() */ public boolean isNative() throws DebugException { return getUnderlyingMethod().isNative(); } /** * @see IJavaStackFrame#isConstructor() */ public boolean isConstructor() throws DebugException { return getUnderlyingMethod().isConstructor(); } /** * @see IJavaStackFrame#isStaticInitializer() */ public boolean isStaticInitializer() throws DebugException { return getUnderlyingMethod().isStaticInitializer(); } /** * @see IJavaModifiers#isFinal() */ public boolean isFinal() throws DebugException { return getUnderlyingMethod().isFinal(); } /** * @see IJavaStackFrame#isSynchronized() */ public boolean isSynchronized() throws DebugException { return getUnderlyingMethod().isSynchronized(); } /** * @see IJavaModifiers#isSynthetic() */ public boolean isSynthetic() throws DebugException { return getUnderlyingMethod().isSynthetic(); } /** * @see IJavaModifiers#isPublic() */ public boolean isPublic() throws DebugException { return getUnderlyingMethod().isPublic(); } /** * @see IJavaModifiers#isPrivate() */ public boolean isPrivate() throws DebugException { return getUnderlyingMethod().isPrivate(); } /** * @see IJavaModifiers#isProtected() */ public boolean isProtected() throws DebugException { return getUnderlyingMethod().isProtected(); } /** * @see IJavaModifiers#isPackagePrivate() */ public boolean isPackagePrivate() throws DebugException { return getUnderlyingMethod().isPackagePrivate(); } /** * @see IJavaModifiers#isStatic() */ public boolean isStatic() throws DebugException { return getUnderlyingMethod().isStatic(); } /** * @see IJavaStackFrame#getSourceName() */ public String getSourceName() throws DebugException { try { Location l = getUnderlyingMethod().location(); if (l != null) { return l.sourceName(); } } catch (AbsentInformationException e) { } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retrieving_source_name"), new String[] {e.toString()}), e); //$NON-NLS-1$ } return null; } protected boolean isTopStackFrame() throws DebugException { IStackFrame tos = getThread().getTopStackFrame(); return tos != null && tos.equals(this); } public void setOutOfSynch(boolean outOfSynch) { fIsOutOfSynch= outOfSynch; fireChangeEvent(); } /** * @see IJavaStackFrame#isOutOfSynch() */ public boolean isOutOfSynch() throws DebugException { if (fIsOutOfSynch) { return true; } if (((JDIDebugTarget)getDebugTarget()).isOutOfSynch(getUnderlyingMethod().declaringType())) { fIsOutOfSynch= true; return true; } return false; } /** * @see IJavaStackFrame#isObsolete() */ public boolean isObsolete() throws DebugException { return getUnderlyingMethod().isObsolete(); } protected boolean exists() throws DebugException { return ((JDIThread)getThread()).computeStackFrames().indexOf(this) != -1; } /** * @see ITerminate#canTerminate() */ public boolean canTerminate() { boolean exists= false; try { exists= exists(); } catch (DebugException e) { logError(e); } return exists && getThread().canTerminate() || getDebugTarget().canTerminate(); } /** * @see ITerminate#isTerminated() */ public boolean isTerminated() { return getThread().isTerminated(); } /** * @see ITerminate#terminate() */ public void terminate() throws DebugException { if (getThread().canTerminate()) { getThread().terminate(); } else { getDebugTarget().terminate(); } } /** * Returns this stack frame's underlying JDI frame. * * @exception DebugException if this stack frame does * not currently have an underlying frame (is in an * interim state where this frame's thead has been * resumed, and is not yet suspended). */ protected StackFrame getUnderlyingStackFrame() throws DebugException { if (fStackFrame == null) { // In the case of preserved stack frames, the underlying stack frame // could have been set via a call to JDIThread#updateStackFrames ((JDIThread)getThread()).computeStackFrames(); if (fStackFrame == null) { requestFailed(JDIDebugModelMessages.getString("JDIStackFrame.Thread_not_suspended,_stack_frame_unavailable._3"), null); //$NON-NLS-1$ } } return fStackFrame; } /** * The underlying stack frame that existed before the current underlying * stack frame. Used only so that equality can be checked on stack frame * after the new one has been set. */ protected StackFrame getLastUnderlyingStackFrame() { return fLastStackFrame; } /** * Sets the underlying JDI StackFrame. Called by a thread * when incrementally updating after a step has completed. * * @param frame The underlying stack frame */ protected void setUnderlyingStackFrame(StackFrame frame) { if (frame != null) { fLastStackFrame = frame; } else { fLastStackFrame = fStackFrame; } fStackFrame = frame; fRefreshVariables = true; } protected void setThread(JDIThread thread) { fThread = thread; } protected void setVariables(List variables) { fVariables = variables; } /** * @see IJavaStackFrame#getLocalVariables() */ public IJavaVariable[] getLocalVariables() throws DebugException { List list = getUnderlyingVisibleVariables(); IJavaVariable[] locals = new IJavaVariable[list.size()]; for (int i = 0; i < list.size(); i++) { locals[i] = new JDILocalVariable(this, (LocalVariable)list.get(i)); } return locals; } /** * @see IJavaStackFrame#getThis() */ public IJavaObject getThis() throws DebugException { IJavaObject receiver = null; ObjectReference thisObject = getUnderlyingThisObject(); if (thisObject != null) { receiver = (IJavaObject)JDIValue.createValue((JDIDebugTarget)getDebugTarget(), thisObject); } return receiver; } /** * Java stack frames do not support registers * * @see IStackFrame#getRegisterGroups() */ public IRegisterGroup[] getRegisterGroups() throws DebugException { return new IRegisterGroup[0]; } /** * @see IJavaStackFrame#getDeclaringType() */ public IJavaClassType getDeclaringType() throws DebugException { Method method = getUnderlyingMethod(); try { Type type = method.declaringType(); return (IJavaClassType)JDIType.createType((JDIDebugTarget)getDebugTarget(), type); } catch (RuntimeException e) { targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIStackFrame.exception_retreiving_declaring_type"), new String[] {e.toString()}), e); //$NON-NLS-1$ } return null; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
beb70374f410631e54a8bdbadb842b56197d7f63
9bfd982699fb017922406e9902b2a91864964163
/calendar-finished/src/com/android/alvin/adapter/AlarmSettingAdapter.java
34c8c50186b88f0dc8aab89e76bd78a795b63c07
[]
no_license
evelyn-yin/Android-Projects
bbde940bf2a6bee9e492513079120a191c3d218a
f1d02b8e5f8a3f8ecafef7ba1f85bbd311b4c58d
refs/heads/master
2020-09-10T23:38:37.242897
2016-09-01T19:57:16
2016-09-01T19:57:16
67,160,586
0
0
null
null
null
null
UTF-8
Java
false
false
1,592
java
package com.android.alvin.adapter; import java.util.List; import net.blogjava.mobile.calendar.R; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; public class AlarmSettingAdapter extends BaseAdapter { private List<String> items; private List<String> values; private LayoutInflater inflater; public AlarmSettingAdapter(Context context,List<String> items,List<String> values){ inflater = LayoutInflater.from(context); this.items = items; this.values = values; } public int getCount() { return items.size(); } public Object getItem(int position) { return items.get(position); } public long getItemId(int position) { return position; } public View getView(int position, View view, ViewGroup group) { ViewHolder holder = new ViewHolder(); if(view==null){ // view = inflater.inflate(R.layout.alarm_setting_item_layout, null); holder.item = (TextView)view.findViewById(R.id.alarm_item); holder.item_value = (TextView)view.findViewById(R.id.alarm_item_value); view.setTag(holder); }else{ holder = (ViewHolder)view.getTag(); } String title = items.get(position); title = title.length()>15 ? title.substring(0, 15)+"..." : title; holder.item.setText(title); holder.item_value.setText(values.get(position)); return view; } private class ViewHolder{ private TextView item; private TextView item_value; } }
[ "junyin.java@gmail.com" ]
junyin.java@gmail.com
183bfba4d8850ad92d6812f106d61e5612479dc7
4c29d4349e2262d5745ceedf642ff976b44832b5
/Solution/src/WinningLotteryTicket.java
2fafaf6ed3f45870e572898b541e8fd9da3ceaea
[]
no_license
klimkina/Java
f9651644cb62a3fa06e7deaba4798f281c1570b3
fda9d4d498ced2f1b80e59b34c56fa4a71b1f2cb
refs/heads/master
2021-06-15T09:48:39.118071
2019-12-15T06:35:49
2019-12-15T06:35:49
110,410,265
2
2
null
null
null
null
UTF-8
Java
false
false
2,146
java
/* The SuperBowl Lottery is about to commence, and there are several lottery tickets being sold, and each ticket is identified with a ticket ID. In one of the many winning scenarios in the Superbowl lottery, a winning pair of tickets is: Concatenation of the two ticket IDs in the pair, in any order, contains each digit from to at least once. For example, if there are distinct tickets with ticket ID and , is a winning pair. NOTE: The ticket IDs can be concantenated in any order. Digits in the ticket ID can occur in any order. Your task is to find the number of winning pairs of distinct tickets, such that concatenation of their ticket IDs (in any order) makes for a winning scenario. Complete the function winningLotteryTicket which takes a string array of ticket IDs as input, and return the number of winning pairs. */ public class WinningLotteryTicket { //(1111111111)2 = (1023)10 static long winningLotteryTicket(String[] tickets) { // Complete this function long res = 0; long[] dp = new long[1024]; for(int i = 0; i < tickets.length; i++) dp[stringToBits(tickets[i])]++; for(int i = 0; i < 1024; i++){ for(int j = i+1; j < 1024; j++) if((i|j) == 1023) { res += dp[i]* dp[j]; } } res += dp[1023]*(dp[1023]-1)/2; return res; } private static int stringToBits(String s) { char[] charr = s.toCharArray(); int res = 0; for(int i = 0; i < charr.length; i++) res |= (1 << (charr[i]) - '0'); return res; } public static void main(String[] args) { /*Scanner in = new Scanner(System.in); int n = in.nextInt(); String[] tickets = new String[n]; for(int tickets_i = 0; tickets_i < n; tickets_i++){ tickets[tickets_i] = in.next(); }*/ String[] tickets = {"0123456789", "1023456789", "1023456789", "129300455", "12930045", "129304550", "5559948277", "012334556", "56789", "5678955", "0123456879"}; long result = winningLotteryTicket(tickets); System.out.println(result); //in.close(); } }
[ "klimkina@gmail.com" ]
klimkina@gmail.com
786dd4890ab31346d6b5a51e090d38cc22c993fe
73ee260282290d0c418283382e6e922247abba59
/core/src/test/java/org/hisp/dhis/android/core/trackedentity/TrackedEntityAttributeHandlerTests.java
ffdfc94c71d26493fc7a43b5fbb5871f16ab4bf1
[ "BSD-3-Clause" ]
permissive
prempalsingh/dhis2-android-sdk
0a24455d743344125f9ed9127b7e19c9166efc7b
076fdbf617534d373f25df6980cd3250b032348c
refs/heads/master
2020-02-26T13:41:58.106507
2017-10-28T06:30:33
2017-10-28T06:30:33
63,017,669
0
1
null
2017-10-28T06:30:34
2016-07-10T20:42:37
Java
UTF-8
Java
false
false
9,515
java
/* * Copyright (c) 2017, University of Oslo * * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * Neither the name of the HISP project nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.hisp.dhis.android.core.trackedentity; import org.hisp.dhis.android.core.common.ValueType; import org.hisp.dhis.android.core.option.OptionSet; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import java.util.Date; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyBoolean; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.never; import static org.mockito.Mockito.timeout; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @RunWith(JUnit4.class) public class TrackedEntityAttributeHandlerTests { @Mock private TrackedEntityAttributeStore trackedEntityAttributeStore; @Mock private TrackedEntityAttribute trackedEntityAttribute; @Mock private OptionSet optionSet; // object to test private TrackedEntityAttributeHandler trackedEntityAttributeHandler; @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); trackedEntityAttributeHandler = new TrackedEntityAttributeHandler(trackedEntityAttributeStore); when(trackedEntityAttribute.uid()).thenReturn("test_tracked_entity_attribute_uid"); when(optionSet.uid()).thenReturn("test_option_set_uid"); when(trackedEntityAttribute.optionSet()).thenReturn(optionSet); } @Test public void doNothing_shouldDoNothingWhenPassingInNull() throws Exception { trackedEntityAttributeHandler.handleTrackedEntityAttribute(null); // verify that store is never called verify(trackedEntityAttributeStore, never()).delete(anyString()); verify(trackedEntityAttributeStore, never()).update(anyString(), anyString(), anyString(), anyString(), any(Date.class), any(Date.class), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), anyString(), any(ValueType.class), anyString(), any(TrackedEntityAttributeSearchScope.class), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyString()); verify(trackedEntityAttributeStore, never()).insert(anyString(), anyString(), anyString(), anyString(), any(Date.class), any(Date.class), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), anyString(), any(ValueType.class), anyString(), any(TrackedEntityAttributeSearchScope.class), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean()); } @Test public void delete_shouldDeleteTrackedEntityAttribute() throws Exception { when(trackedEntityAttribute.deleted()).thenReturn(Boolean.TRUE); trackedEntityAttributeHandler.handleTrackedEntityAttribute(trackedEntityAttribute); // verify that delete is called once verify(trackedEntityAttributeStore, times(1)).delete(anyString()); // verify that update and insert is never called verify(trackedEntityAttributeStore, never()).update(anyString(), anyString(), anyString(), anyString(), any(Date.class), any(Date.class), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), anyString(), any(ValueType.class), anyString(), any(TrackedEntityAttributeSearchScope.class), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyString()); verify(trackedEntityAttributeStore, never()).insert(anyString(), anyString(), anyString(), anyString(), any(Date.class), any(Date.class), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), anyString(), any(ValueType.class), anyString(), any(TrackedEntityAttributeSearchScope.class), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean()); } @Test public void update_shouldUpdateTrackedEntityAttribute() throws Exception { when(trackedEntityAttributeStore.update(anyString(), anyString(), anyString(), anyString(), any(Date.class), any(Date.class), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), anyString(), any(ValueType.class), anyString(), any(TrackedEntityAttributeSearchScope.class), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyString())).thenReturn(1); trackedEntityAttributeHandler.handleTrackedEntityAttribute(trackedEntityAttribute); // verify that update is called once verify(trackedEntityAttributeStore, timeout(1)).update(anyString(), anyString(), anyString(), anyString(), any(Date.class), any(Date.class), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), anyString(), any(ValueType.class), anyString(), any(TrackedEntityAttributeSearchScope.class), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyString()); // verify that insert and delete is never called verify(trackedEntityAttributeStore, never()).insert(anyString(), anyString(), anyString(), anyString(), any(Date.class), any(Date.class), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), anyString(), any(ValueType.class), anyString(), any(TrackedEntityAttributeSearchScope.class), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean()); verify(trackedEntityAttributeStore, never()).delete(anyString()); } @Test public void insert_shouldInsertTrackedEntityAttribute() throws Exception { when(trackedEntityAttributeStore.update(anyString(), anyString(), anyString(), anyString(), any(Date.class), any(Date.class), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), anyString(), any(ValueType.class), anyString(), any(TrackedEntityAttributeSearchScope.class), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyString())).thenReturn(0); trackedEntityAttributeHandler.handleTrackedEntityAttribute(trackedEntityAttribute); // verify that insert is called once verify(trackedEntityAttributeStore, times(1)).insert(anyString(), anyString(), anyString(), anyString(), any(Date.class), any(Date.class), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), anyString(), any(ValueType.class), anyString(), any(TrackedEntityAttributeSearchScope.class), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean()); // verify that update is called once since we try to update before we insert verify(trackedEntityAttributeStore, times(1)).update(anyString(), anyString(), anyString(), anyString(), any(Date.class), any(Date.class), anyString(), anyString(), anyString(), anyString(), anyString(), anyInt(), anyString(), any(ValueType.class), anyString(), any(TrackedEntityAttributeSearchScope.class), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyString()); // verify that delete is never called verify(trackedEntityAttributeStore, never()).delete(anyString()); } }
[ "erlingfjelstad@gmail.com" ]
erlingfjelstad@gmail.com
680d4acc8ccbee7e6859f8bf4fde11a3e2859dad
0c759ae696ce09ff9098a074fe2fe68ed7d1ddcc
/src/objets_metiers/Reservation.java
3762332b431cd4fd7f16fbb136b082f700c146a5
[]
no_license
MYacinedouaouria/Gestion-bibliotheque
bd99c7d629cea6a22fefa70876a136682581f923
e591c8dd1d1353579b10dcd6e2b44fe7a7727990
refs/heads/master
2022-08-31T14:56:53.926876
2020-02-05T11:18:21
2020-02-05T11:18:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,405
java
package objets_metiers; import Utility.BibalExceptions; import Utility.DBConnection; import static Utility.Utility.YMDtoDMY; import static Utility.Utility.closeStatement; import static Utility.Utility.closeStatementResultSet; import static Utility.Utility.dateToStr; import static Utility.Utility.initialiseRequetePreparee; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.time.Instant; import java.util.ArrayList; import java.util.Date; /** * * @author Aymen Souelmi */ public class Reservation { private int id; private Date dateReservation; private Date dateAnnulation; private Usager usagerReservation; private Oeuvre oeuvresReservation; // static final String SQL_SELECT_JOINTURE= "SELECT reservation.*, o.titre, u.nom," // + " u.prenom FROM reservation, oeuvre o, usager u" // + " WHERE OeuvreID = o.id" // + " AND UsagerID = u.id" // + " AND "; public Reservation() { this.dateReservation = Date.from(Instant.now()); this.dateAnnulation = null; this.usagerReservation = new Usager(); this.oeuvresReservation = new Oeuvre(); } public Reservation(Usager usager, Oeuvre oeuvre, Date dateJour) { this.usagerReservation = usager; this.oeuvresReservation = oeuvre; this.dateReservation = dateJour; this.dateAnnulation = null; } public int getId() { return id; } public void setId(int id) throws BibalExceptions { if (id <= 0) { throw new BibalExceptions("Identifiant Reservation non valide !"); } this.id = id; } public Date getDateReservation() { return dateReservation; } public void setDateReservation(Date dateReservation) { this.dateReservation = dateReservation; } public Date getDateAnnulation() { return dateAnnulation; } public void setDateAnnulation(Date dateAnnulation) { this.dateAnnulation = dateAnnulation; } public Oeuvre getOeuvresReservation() { return oeuvresReservation; } public void setOeuvresReservation(Oeuvre oeuvresReservation) { this.oeuvresReservation = oeuvresReservation; } public Usager getUsagerReservation() { return usagerReservation; } public void setUsagerReservation(Usager usagerReservation) { this.usagerReservation = usagerReservation; } public void reserver(Usager usager, Oeuvre oeuvre, Date dateJour) throws BibalExceptions { Reservation reservation = findByReservation(usager, oeuvre); if (null != reservation) { throw new BibalExceptions("Vous avez déjà réservé l'oeuvre '" + oeuvre.getTitre() + "'\n le '" + YMDtoDMY(reservation.getDateReservation().toString(),"-") + "'"); } final String SQL_INSERT = "INSERT INTO Reservation " + "(OeuvreID, UsagerID, dateReservation, DateAnnulation) " + "VALUES (?, ?, ?, ?)"; PreparedStatement preparedStatement = null; String formatedDateJour = dateToStr(dateJour); try { preparedStatement = initialiseRequetePreparee(DBConnection.getConnection(), SQL_INSERT, oeuvre.getId(), usager.getId(), formatedDateJour, null); int statut = preparedStatement.executeUpdate(); if (statut == 0) { throw new BibalExceptions("Echec lors de l'enregistrement de la réservation"); } } catch (SQLException e) { throw new BibalExceptions("Erreurs lors de l'enregistrement de la réservation", e.getCause()); } catch (BibalExceptions e) { throw new BibalExceptions("Erreurs lors de l'enregistrement de la réservation ", e.getCause()); } finally { closeStatement(preparedStatement); } } public void annuler(Usager usager, Oeuvre oeuvre, Reservation reservation) throws BibalExceptions { final String SQL_UPDATE_RES = "UPDATE reservation SET DateAnnulation = ?" + " WHERE OeuvreID = ? AND UsagerID = ?"; PreparedStatement preparedStatement = null; try { String formatedDateAnnulation = dateToStr(reservation.getDateAnnulation()); preparedStatement = initialiseRequetePreparee(DBConnection.getConnection(), SQL_UPDATE_RES, formatedDateAnnulation, oeuvre.getId(), usager.getId()); int statut = preparedStatement.executeUpdate(); if (statut == 0) { throw new BibalExceptions("Echec de l'annulation de la réservation"); } } catch (SQLException | BibalExceptions e) { throw new BibalExceptions("Erreurs lors de l'annulation de la réservation", e.getCause()); } finally { closeStatement(preparedStatement); } } public Reservation findById(int id) throws BibalExceptions { final String SQL_SELECT_BY_ID = "SELECT reservation.*, o.titre, u.nom," + " u.prenom FROM reservation, oeuvre o, usager u" + " WHERE OeuvreID = o.id" + " AND UsagerID = u.id" + " AND reservation.id = ?"; ArrayList<Reservation> reservations = find(SQL_SELECT_BY_ID, id); return reservations.isEmpty() ? null : reservations.get(0); } public ArrayList<Reservation> findByDateReservaton(Date dateRes) throws BibalExceptions { final String SQL_SELECT_BY_DATE_RES = "SELECT reservation.*, o.titre, u.nom," + " u.prenom FROM reservation, oeuvre o, usager u" + " WHERE OeuvreID = o.id" + " AND UsagerID = u.id" + " AND dateReservation = ?" + " AND dateAnnulation IS NULL"; String formatedDateRes = dateToStr(dateRes); ArrayList<Reservation> reservations = find(SQL_SELECT_BY_DATE_RES, formatedDateRes); return reservations; } public Reservation findByReservation(Usager usager, Oeuvre oeuvre) throws BibalExceptions { final String SQL_SELECT_BY_ID_OEUVRE_USAGER = "SELECT reservation.*, o.titre, u.nom," + " u.prenom FROM reservation, oeuvre o, usager u" + " WHERE OeuvreID = o.id" + " AND UsagerID = u.id" + " AND UsagerID = ?" + " AND OeuvreID = ? " + " AND DateAnnulation IS NULL"; ArrayList<Reservation> reservations = find(SQL_SELECT_BY_ID_OEUVRE_USAGER, usager.getId(), oeuvre.getId()); return reservations.isEmpty() ? null : reservations.get(0); } public ArrayList<Reservation> findByReservation(Oeuvre oeuvre) throws BibalExceptions { final String SQL_SELECT_BY_ID_OEUVRE = "SELECT reservation.*, o.titre, u.nom," + " u.prenom FROM reservation, oeuvre o, usager u" + " WHERE OeuvreID = o.id" + " AND UsagerID = u.id" + " AND OeuvreID = ? " + " AND DateAnnulation IS NULL"; ArrayList<Reservation> reservations = find(SQL_SELECT_BY_ID_OEUVRE, oeuvre.getId()); return (reservations == null || reservations.isEmpty()) ? null : reservations; } private ArrayList<Reservation> find(String sql, Object... objets) throws BibalExceptions { PreparedStatement preparedStatement = null; ResultSet resultSet = null; ArrayList<Reservation> listReservations = new ArrayList<>(); try { preparedStatement = initialiseRequetePreparee(DBConnection.getConnection(), sql, objets); resultSet = preparedStatement.executeQuery(); while (resultSet.next()) { listReservations.add(mappingReservation(resultSet)); } } catch (SQLException e) { throw new BibalExceptions("Aucun enregistrement trouvé " + e.getMessage()); } finally { closeStatementResultSet(preparedStatement, resultSet); } return listReservations; } private static Reservation mappingReservation(ResultSet resultSet) throws SQLException { Reservation reservation = new Reservation(); try { reservation.id = resultSet.getInt("id"); reservation.dateReservation = resultSet.getDate("dateReservation"); reservation.dateAnnulation = resultSet.getDate("DateAnnulation"); reservation.oeuvresReservation.setId(resultSet.getInt("OeuvreID")); reservation.oeuvresReservation.setTitre(resultSet.getString("Titre")); reservation.usagerReservation.setId(resultSet.getInt("UsagerID")); reservation.usagerReservation.setNom(resultSet.getString("nom")); reservation.usagerReservation.setPrenom(resultSet.getString("prenom")); } catch (BibalExceptions e) { System.out.println(e.getMessage()); } return reservation; } @Override public String toString() { return "Reservation{" + "id=" + id + ", dateReservation=" + dateReservation + ", dateAnnulation=" + dateAnnulation + ", usagerReservation=" + usagerReservation + ", oeuvresReservation=" + oeuvresReservation + "}\n"; } }
[ "aymensoual@users.noreply.github.com" ]
aymensoual@users.noreply.github.com
d57e72c25366037aed06355066d11712bae4ad64
d4d1913c17af6b76873e65086f1dbb5ade7ec2e5
/app/src/main/java/com/example/cafe/helper/Base64Custom.java
5a1184c93ea453492ef51fb6dda5d81e11cd2e6d
[ "Apache-2.0" ]
permissive
alexsanderfr/Cafe
89616669657ecd16fa51b1fa25685290a722b1f2
b9983f48c196f041cbdcd6f5a833c9ea9b9e8834
refs/heads/master
2021-01-20T14:43:40.008424
2019-09-13T19:23:25
2019-09-13T19:23:25
90,654,446
0
1
null
2017-06-04T01:40:34
2017-05-08T17:25:40
Java
UTF-8
Java
false
false
412
java
package com.example.cafe.helper; import android.util.Base64; public class Base64Custom { public static String encodeBase64(String text) { return Base64.encodeToString(text.getBytes(), Base64.DEFAULT).trim(); } public static String decodeBase64(String encodedText) { byte[] decodedBytes = Base64.decode(encodedText, Base64.DEFAULT); return new String(decodedBytes); } }
[ "alexsanderfrancorosa@gmail.com" ]
alexsanderfrancorosa@gmail.com
1831bb220eb889e1239f29552d0e13fc9bda2b8b
8f29e0f8232dbe32bf9625972913a28cb66d7c88
/src/main/java/com/accp/filter/tsy/TSY.java
bd53fbf909fe4b1350336ded257128b16da0c537
[]
no_license
yanfayibu/yphting
aa197ab238e4e1f948e07d4013e70089d2965842
0857b68b6929d1fe483ab472eb01d37f97cdda32
refs/heads/master
2020-04-16T16:52:51.751228
2019-03-29T02:22:31
2019-03-29T02:22:31
165,753,330
0
0
null
null
null
null
UTF-8
Java
false
false
384
java
/** * @Title: TSY.java * @Package com.accp.filter.tsy * @Description: TODO(用一句话描述该文件做什么) * @author 荔枝 * @date 2019年2月18日 * @version V1.0 */ package com.accp.filter.tsy; /** * @ClassName: TSY * @Description: TODO(这里用一句话描述这个类的作用) * @author 荔枝 * @date 2019年2月18日 * */ public class TSY { }
[ "1239071811@qq.com" ]
1239071811@qq.com
b86b4fc7333a9b601364497ceb3157cdc4f90c2b
db36ac56011247e66767664a642b006b6e50e66c
/src/main/java/com/jincai/JincaiApplication.java
da47d3639f2e81a1ee281ba9e38e8a3ace3de270
[]
no_license
trevorFeng/jincai
d15aac3230fd6ce6cbcb7a7653a8fbbf756d8624
97cbef3b03a06b685636c1d79ef480874f6b790f
refs/heads/master
2020-04-03T19:50:17.944854
2018-10-31T17:18:23
2018-10-31T17:18:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
302
java
package com.jincai; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class JincaiApplication { public static void main(String[] args) { SpringApplication.run(JincaiApplication.class, args); } }
[ "liubing@ebigdata.org" ]
liubing@ebigdata.org
e8afb4300828c2cc5aa10cd11f0780deba65f05c
d161a74870a1dad993f2eb429074cbdc138db2c1
/kodilla-exception/src/main/java/com/kodilla/exception/NullPointer/MessageSender.java
bdcb3b6c14ae3b9bec36cd0111ac2f7910aac452
[]
no_license
HoneyRum/Konrad-Celinski-kodilla-java
056ce70b5122ba30bba2f95cb0c764340a2f03ad
2caf6ea752462772bf87c0e2ebc3a890327783f4
refs/heads/master
2020-05-18T14:54:44.137243
2019-07-27T16:41:05
2019-07-27T16:41:05
184,482,811
0
0
null
null
null
null
UTF-8
Java
false
false
388
java
package com.kodilla.exception.NullPointer; public class MessageSender { public void sendMessageTo(User user, String message) throws MessageNotSentException { if (user != null) { System.out.println("Sending message: " + message + " to: " + user.getName()); } else { throw new MessageNotSentException("Object user was null!"); } } }
[ "celinski.konrad95@gmail.com" ]
celinski.konrad95@gmail.com
045328955234a4565f3633009dd10ea3ca903ebb
60252008e79507e6894f4a62728bb901407f968b
/src/command/GarageDoor.java
8063e8f09ad5602a0558c890f5df9bba1da5ded1
[]
no_license
eugink82/observers
20b7edc3547459dc5fa2b63e17508b542af4eaae
1bf155b98e02d86cff7737c8561533f36a30bd8c
refs/heads/master
2020-08-07T10:47:05.146677
2019-10-22T06:51:03
2019-10-22T06:51:03
213,418,408
0
0
null
2020-04-07T14:13:05
2019-10-07T15:21:58
Java
UTF-8
Java
false
false
346
java
package command; public class GarageDoor { public void up(){ System.out.println("Дверь гаража поднята"); } public void down(){ } public void stop(){ } public void lightOn(){ System.out.println("Свет в гараже включен"); } public void lightOff(){ } }
[ "eugink82@mail.ru" ]
eugink82@mail.ru
5087e91f3e77d321d0478711afeeb707884f5b30
d60e287543a95a20350c2caeabafbec517cabe75
/NLPCCd/Camel/911_2.java
03572b741a21aca163551881c68a5ad7830ac2fe
[ "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
653
java
//,temp,sample_5893.java,2,14,temp,sample_6639.java,2,12 //,3 public class xxx { protected void doCreateService(Exchange exchange, String operation) throws Exception { Service service = null; String serviceName = exchange.getIn().getHeader( KubernetesConstants.KUBERNETES_SERVICE_NAME, String.class); String namespaceName = exchange.getIn().getHeader( KubernetesConstants.KUBERNETES_NAMESPACE_NAME, String.class); ServiceSpec serviceSpec = exchange.getIn().getHeader( KubernetesConstants.KUBERNETES_SERVICE_SPEC, ServiceSpec.class); if (ObjectHelper.isEmpty(serviceName)) { log.info("create a specific service require specify a service name"); } } };
[ "SHOSHIN\\sgholamian@shoshin.uwaterloo.ca" ]
SHOSHIN\sgholamian@shoshin.uwaterloo.ca
7d322012982f2b4445156eda9ab7ea382601c547
8edee90cb9610c51539e0e6b126de7c9145c57bc
/datastructures-trie/src/main/java/org/xbib/datastructures/trie/radix/DuplicateKeyException.java
8e09e74ac2dcca8ee513eede224c01973626463c
[ "Apache-2.0" ]
permissive
jprante/datastructures
05f3907c2acba8f743639bd8b64bde1e771bb074
efbce5bd1c67a09b9e07d2f0d4e795531cdc583b
refs/heads/main
2023-08-14T18:44:35.734136
2023-04-25T15:47:23
2023-04-25T15:47:23
295,021,623
2
0
null
null
null
null
UTF-8
Java
false
false
293
java
package org.xbib.datastructures.trie.radix; /** * Exception thrown if a duplicate key is inserted in a {@link RadixTree} */ @SuppressWarnings("serial") public class DuplicateKeyException extends RuntimeException { public DuplicateKeyException(String msg) { super(msg); } }
[ "joergprante@gmail.com" ]
joergprante@gmail.com
9f4c885a919d2eb5ad468cf604cdf6992accd7f5
970937ff4a93d0ce945afdab49fd1b8f4981e028
/common/src/main/java/org/aggregatortech/dindora/common/service/AwsRegionService.java
d181265ca16ef80a7cfab1e30dc1945abb570b7a
[]
no_license
Aggregator-Tech/dindora
fc4b23cc2730d7169d18fb60afd7f8339a1c61be
50bfbdb7600a33405f4de1ade18a60a096d991e1
refs/heads/master
2020-03-12T03:19:48.092651
2019-03-14T22:48:34
2019-03-14T22:48:34
130,422,434
0
1
null
2019-03-14T22:48:35
2018-04-20T23:26:37
Groovy
UTF-8
Java
false
false
537
java
package org.aggregatortech.dindora.common.service; import org.aggregatortech.dindora.common.ConfigProperty; import org.aggregatortech.dindora.common.io.system.SystemHelper; import org.jvnet.hk2.annotations.Service; import javax.inject.Inject; @Service public class AwsRegionService { enum AwsRegionConfigProperty implements ConfigProperty { AWS_REGION; } @Inject SystemHelper systemHelper; public String getRegion() { return systemHelper.readConfigurationProperty(AwsRegionConfigProperty.AWS_REGION).get(); } }
[ "ajeet.aggregatortech@gmail.com" ]
ajeet.aggregatortech@gmail.com
1d6b3c2b7a129827599bbe336965d87693d03c0c
db3dd155fb906aa1ebdf8c1f77c3e8fa84f44f55
/Week_07/src/test/java/com/example/demo/aspectj/AspectjTest.java
9b793724d0b6002c3b86aa8e4f0f81c36bfe769d
[]
no_license
zyk1995/JAVA-000
9b2eaf123618409bca400372f71a43ae2bd1f59e
d0ea71a29f3a054af5e574a38fe62cff655d4393
refs/heads/main
2023-08-12T02:44:07.318836
2021-10-17T03:04:26
2021-10-17T03:04:26
390,771,629
0
0
null
2021-07-29T15:36:36
2021-07-29T15:36:35
null
UTF-8
Java
false
false
1,015
java
package com.example.demo.aspectj; import com.example.demo.Aspectj.Account; import com.example.demo.customAnnotation.SecuredMethod; import org.junit.Before; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; public class AspectjTest { private Account account; @Before public void before() { account = new Account(); System.out.println(account.toString()); } @Test public void given20AndMin10_whenWithdraw5_thenSuccess() { Account myAccount = new Account(); assertTrue(myAccount.withdraw(5)); } @Test public void given20AndMin10_whenWithdraw100_thenFail() { Account myAccount = new Account(); assertFalse(myAccount.withdraw(100)); } @Test public void testMethod() throws Exception { SecuredMethod service = new SecuredMethod(); service.unlockedMethod(); service.lockedMethod(); } }
[ "1251134350@qq.com" ]
1251134350@qq.com
6b72d8fb0a3e78faaa1f247308a0dd5d6cbe9345
e4cb2d1981b27c0fa05f2757f3f0ad59e97fd85d
/PersonaUnidad5/src/personaunidad5/Persona.java
6ae6d2d36353a16241b02a29bb175944e9a91530
[]
no_license
DanloisTovar/Curso-Java-Codo-a-codo-Gobierno-de-Buenos-Aires
f549479b3d2bb49cf5aa1f957ee497f940d28b6d
dddda8f2385d2bda9989adfbd216bbcb693a1d31
refs/heads/master
2020-06-23T05:08:50.151551
2019-07-24T01:17:12
2019-07-24T01:17:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,311
java
package personaunidad5; import static javafx.scene.input.KeyCode.H; import static javafx.scene.input.KeyCode.M; public class Persona { public String nombre; public int edad; public int dni; public char sexo; public Persona() { } public Persona(String nombre, int edad, char sexo) { this.nombre = nombre = " "; this.edad = edad = 0; this.sexo = sexo = 'H'; } public Persona(String nombre, int edad, int dni, char sexo) { this.nombre = nombre = " "; this.edad = 0; this.dni = 0; this.sexo = 'H'; } public boolean esMayorDeEdad () { if (this.edad >= 18) { System.out.println("Es mayo de edad"); return true; } else { System.out.println("Es menor de edad"); return false; } private char comprobarSexo (char sexo) { if (sexo == 'H' || sexo == 'M') { return sexo; } else { return 'H'; } } } }
[ "noreply@github.com" ]
noreply@github.com
8f27e95e3cf4433cbfcee3d1acf351be7f7d65b6
68c8e73781bdc6834b145ae791d904b395644cc3
/app/src/main/java/com/wkq/order/modlue/move/ui/ProcessImgsActivity.java
d7459b224289b3767046fec339dff014ee6f551f
[]
no_license
wukuiqing49/order
03c2e439d77bcd3debd807e268cd5f14a1d2c61a
3cd794432813e297288a57bd67e6a31ad0bb4603
refs/heads/master
2020-09-11T13:18:34.761935
2020-02-16T14:33:10
2020-02-16T14:33:10
222,076,130
1
1
null
null
null
null
UTF-8
Java
false
false
2,479
java
package com.wkq.order.modlue.move.ui; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import androidx.annotation.NonNull; import com.wkq.base.frame.activity.MvpBindingActivity; import com.wkq.baseLib.utlis.PermissionChecker; import com.wkq.order.R; import com.wkq.order.databinding.ActivityProcessImgsBinding; import com.wkq.order.modlue.move.frame.presenter.ProcessImgsPresenter; import com.wkq.order.modlue.move.frame.view.ProcessImgsView; import com.wkq.order.utils.Constant; /** * 作者:吴奎庆 * <p> * 时间:2020-01-03 * <p> * 用途: */ public class ProcessImgsActivity extends MvpBindingActivity<ProcessImgsView, ProcessImgsPresenter, ActivityProcessImgsBinding> { public String imgUrl; public int REQUEST_CODE_PERMISSION_CODE = 10010; public static void startActivity(Context context, String imgUrl) { Intent intent = new Intent(context, ProcessImgsActivity.class); intent.putExtra("imgUrl", imgUrl); Activity activity = (Activity) context; activity.startActivity(intent); activity.overridePendingTransition(R.anim.preview_activity_in, R.anim.preview_activity_out); } @Override protected int getLayoutId() { return R.layout.activity_process_imgs; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); imgUrl = getIntent().getStringExtra("imgUrl"); if (!TextUtils.isEmpty(imgUrl)) imgUrl = Constant.MOVE_DB_IMG_BASE_500.concat(imgUrl); if (getMvpView() != null) getMvpView().initView(); } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode == REQUEST_CODE_PERMISSION_CODE) { boolean hasPermission = PermissionChecker.onRequestPermissionsResult(this, requestCode, permissions, grantResults, false, R.string.string_permission_save_pic)[0]; if (hasPermission) { if (getMvpView() != null) getMvpView().saveImg(); } } } @Override public void finish() { super.finish(); overridePendingTransition(R.anim.preview_activity_in, R.anim.preview_activity_out); } }
[ "1571478933@qq.com" ]
1571478933@qq.com
6aa3344532e9889763edb897e41836e304f69e86
b73873cc99bfb60351b8dcc868d8bf91956bc94f
/consumer/src/main/java/yitgogo/consumer/local/ui/LocalStoreServiceFragment.java
ddd950fc05666bf46acdf4ba28d06742184e4ca9
[]
no_license
KungFuBrother/yitgogo_consumer
6a18101ffb0201400fcc2cfdc941006f8ff9361d
4eec5090b3377992b188035dc379bb41596da23a
refs/heads/master
2016-08-12T19:00:32.113188
2016-01-18T09:17:22
2016-01-18T09:17:22
47,446,309
0
0
null
null
null
null
UTF-8
Java
false
false
22,606
java
package yitgogo.consumer.local.ui; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.AbsListView.LayoutParams; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.BaseAdapter; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.ScrollView; import android.widget.TextView; import com.handmark.pulltorefresh.library.PullToRefreshBase; import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; import com.handmark.pulltorefresh.library.PullToRefreshBase.OnRefreshListener2; import com.handmark.pulltorefresh.library.PullToRefreshScrollView; import com.nostra13.universalimageloader.core.ImageLoader; import com.smartown.controller.mission.MissionController; import com.smartown.controller.mission.MissionMessage; import com.smartown.controller.mission.Request; import com.smartown.controller.mission.RequestListener; import com.smartown.controller.mission.RequestMessage; import com.smartown.yitian.gogo.R; import com.umeng.analytics.MobclickAgent; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.List; import yitgogo.consumer.base.BaseNormalFragment; import yitgogo.consumer.base.BaseNotifyFragment; import yitgogo.consumer.local.model.ModelLocalService; import yitgogo.consumer.local.model.ModelLocalServiceClass; import yitgogo.consumer.store.model.Store; import yitgogo.consumer.tools.API; import yitgogo.consumer.tools.Parameters; import yitgogo.consumer.view.InnerGridView; /** * @author Tiger * @Description 易商圈-本地服务 */ public class LocalStoreServiceFragment extends BaseNotifyFragment implements OnClickListener { TextView selectorClasses, selectorSort; PullToRefreshScrollView refreshScrollView; InnerGridView serviceList; FrameLayout selectorFragmentLayout; LinearLayout selectorLayout; List<ModelLocalService> localServices; ServiceAdapter serviceAdapter; PriceSort priceSort; PriceSortAdapter priceSortAdapter; LocalServiceClass localServiceClass; ServiceClassAdapter serviceClassAdapter; String classId = ""; String storeId = ""; public LocalStoreServiceFragment(String storeId) { this.storeId = storeId; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment_local_business_service); init(); findViews(); } @Override public void onResume() { super.onResume(); MobclickAgent.onPageStart(LocalStoreServiceFragment.class.getName()); } @Override public void onPause() { super.onPause(); MobclickAgent.onPageEnd(LocalStoreServiceFragment.class.getName()); } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); getServiceClasses(); refresh(); } private void init() { measureScreen(); localServices = new ArrayList<ModelLocalService>(); serviceAdapter = new ServiceAdapter(); localServiceClass = new LocalServiceClass(); serviceClassAdapter = new ServiceClassAdapter(); priceSort = new PriceSort(); priceSortAdapter = new PriceSortAdapter(); } @Override protected void findViews() { selectorClasses = (TextView) contentView .findViewById(R.id.local_business_selector_classes); selectorSort = (TextView) contentView .findViewById(R.id.local_business_selector_sort); refreshScrollView = (PullToRefreshScrollView) contentView .findViewById(R.id.local_business_content_refresh); serviceList = (InnerGridView) contentView .findViewById(R.id.local_business_content_list); selectorFragmentLayout = (FrameLayout) contentView .findViewById(R.id.local_business_selector_fragment); selectorLayout = (LinearLayout) contentView .findViewById(R.id.local_business_selector_layout); initViews(); registerViews(); } @Override protected void initViews() { refreshScrollView.setMode(Mode.BOTH); serviceList.setAdapter(serviceAdapter); } @Override protected void registerViews() { selectorLayout.setOnClickListener(this); selectorClasses.setOnClickListener(this); selectorSort.setOnClickListener(this); refreshScrollView .setOnRefreshListener(new OnRefreshListener2<ScrollView>() { @Override public void onPullDownToRefresh(PullToRefreshBase<ScrollView> refreshView) { refresh(); } @Override public void onPullUpToRefresh( PullToRefreshBase<ScrollView> refreshView) { getService(); } }); serviceList.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> paramAdapterView, View paramView, int paramInt, long paramLong) { Bundle bundle = new Bundle(); bundle.putString("productId", localServices.get(paramInt) .getId()); jump(LocalServiceDetailFragment.class.getName(), localServices .get(paramInt).getProductName(), bundle); } }); } private void refresh() { hideSelector(); refreshScrollView.setMode(Mode.BOTH); pagenum = 0; localServices.clear(); serviceAdapter.notifyDataSetChanged(); getService(); } private void showSelector(Fragment fragment) { getFragmentManager().beginTransaction() .replace(R.id.local_service_selector_fragment, fragment) .commit(); selectorLayout.setVisibility(View.VISIBLE); } public void hideSelector() { selectorLayout.setVisibility(View.GONE); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.local_business_selector_layout: hideSelector(); break; case R.id.local_business_selector_classes: showSelector(new ServiceClassSelector()); break; case R.id.local_business_selector_sort: showSelector(new PriceSortSelector()); break; default: break; } } class ServiceClassSelector extends BaseNormalFragment { ListView listView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override @Nullable public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate( R.layout.selector_local_business_service_class, null); findViews(view); return view; } @Override public void onResume() { super.onResume(); if (localServiceClass.getServiceClasses().isEmpty()) { getServiceClasses(); } } @Override protected void findViews(View view) { listView = (ListView) view .findViewById(R.id.selector_service_class); initViews(); registerViews(); } @Override protected void initViews() { listView.setAdapter(serviceClassAdapter); } @Override protected void registerViews() { listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { localServiceClass.setSelection(arg2); classId = localServiceClass.getServiceClasses().get(arg2) .getId(); refresh(); } }); } } class PriceSortSelector extends BaseNormalFragment { ListView listView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override @Nullable public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate( R.layout.selector_local_business_service_class, null); findViews(view); return view; } @Override public void onResume() { super.onResume(); } @Override protected void findViews(View view) { listView = (ListView) view .findViewById(R.id.selector_service_class); initViews(); registerViews(); } @Override protected void initViews() { listView.setAdapter(priceSortAdapter); } @Override protected void registerViews() { listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { priceSort.setSelection(arg2); refresh(); } }); } } class ServiceAdapter extends BaseAdapter { @Override public int getCount() { return localServices.size(); } @Override public Object getItem(int position) { return localServices.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { holder = new ViewHolder(); convertView = layoutInflater.inflate(R.layout.grid_product, null); holder.imageView = (ImageView) convertView .findViewById(R.id.grid_product_image); holder.nameTextView = (TextView) convertView .findViewById(R.id.grid_product_name); holder.priceTextView = (TextView) convertView .findViewById(R.id.grid_product_price); LayoutParams params = new LayoutParams( LayoutParams.MATCH_PARENT, screenWidth / 3 * 2); convertView.setLayoutParams(params); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } final ModelLocalService localService = localServices.get(position); holder.nameTextView.setText(localService.getProductName()); holder.priceTextView.setText(Parameters.CONSTANT_RMB + decimalFormat.format(localService.getProductPrice())); ImageLoader.getInstance().displayImage( getSmallImageUrl(localService.getImg()), holder.imageView); return convertView; } class ViewHolder { ImageView imageView; TextView priceTextView, nameTextView; } } class PriceSortAdapter extends BaseAdapter { @Override public int getCount() { return priceSort.getPriceSort().length; } @Override public Object getItem(int position) { return priceSort.getPriceSort()[position]; } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder viewHolder; if (convertView == null) { viewHolder = new ViewHolder(); convertView = layoutInflater.inflate( R.layout.list_local_business_class, null); viewHolder.selector = convertView .findViewById(R.id.local_business_class_selector); viewHolder.serviceClassName = (TextView) convertView .findViewById(R.id.local_business_class_name); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } viewHolder.serviceClassName .setText(priceSort.getPriceSort()[position]); if (position == priceSort.getSelection()) { viewHolder.selector .setBackgroundResource(R.color.textColorCompany); viewHolder.serviceClassName.setTextColor(getResources() .getColor(R.color.textColorCompany)); } else { viewHolder.selector.setBackgroundResource(android.R.color.transparent); viewHolder.serviceClassName.setTextColor(getResources() .getColor(R.color.textColorSecond)); } return convertView; } class ViewHolder { TextView serviceClassName; View selector; } } class ServiceClassAdapter extends BaseAdapter { @Override public int getCount() { return localServiceClass.getServiceClasses().size(); } @Override public Object getItem(int position) { return localServiceClass.getServiceClasses().get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder viewHolder; if (convertView == null) { viewHolder = new ViewHolder(); convertView = layoutInflater.inflate( R.layout.list_local_business_class, null); viewHolder.selector = convertView .findViewById(R.id.local_business_class_selector); viewHolder.serviceClassName = (TextView) convertView .findViewById(R.id.local_business_class_name); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } viewHolder.serviceClassName.setText(localServiceClass .getServiceClasses().get(position).getClassValueName()); if (position == localServiceClass.getSelection()) { viewHolder.selector .setBackgroundResource(R.color.textColorCompany); viewHolder.serviceClassName.setTextColor(getResources() .getColor(R.color.textColorCompany)); } else { viewHolder.selector.setBackgroundResource(android.R.color.transparent); viewHolder.serviceClassName.setTextColor(getResources() .getColor(R.color.textColorSecond)); } return convertView; } class ViewHolder { TextView serviceClassName; View selector; } } private void getServiceClasses() { Request request = new Request(); request.setUrl(API.API_LOCAL_BUSINESS_SERVICE_CLASS); request.addRequestParam("organizationId", Store.getStore().getStoreId()); request.addRequestParam("providerId", storeId); MissionController.startRequestMission(getActivity(), request, new RequestListener() { @Override protected void onStart() { } @Override protected void onFail(MissionMessage missionMessage) { } @Override protected void onSuccess(RequestMessage requestMessage) { if (!TextUtils.isEmpty(requestMessage.getResult())) { localServiceClass = new LocalServiceClass(requestMessage.getResult()); serviceClassAdapter.notifyDataSetChanged(); } } @Override protected void onFinish() { } }); } class PriceSort { String[] priceSort = {"默认排序", "价格由低到高", "价格由高到低"}; int selection = 0; public String[] getPriceSort() { return priceSort; } public int getSelection() { return selection; } public void setSelection(int selection) { this.selection = selection; } } class LocalServiceClass { List<ModelLocalServiceClass> serviceClasses = new ArrayList<ModelLocalServiceClass>(); int selection = 0; public LocalServiceClass() { } public LocalServiceClass(String result) { if (result.length() > 0) { serviceClasses.add(new ModelLocalServiceClass()); JSONObject object; try { object = new JSONObject(result); if (object.optString("state").equalsIgnoreCase("SUCCESS")) { JSONArray array = object.optJSONArray("dataList"); if (array != null) { for (int i = 0; i < array.length(); i++) { JSONObject jsonObject = array.optJSONObject(i); if (jsonObject != null) { serviceClasses .add(new ModelLocalServiceClass( jsonObject)); } } } } } catch (JSONException e) { e.printStackTrace(); } } } public int getSelection() { return selection; } public void setSelection(int selection) { this.selection = selection; } public List<ModelLocalServiceClass> getServiceClasses() { return serviceClasses; } } private void getService() { pagenum++; Request request = new Request(); request.setUrl(API.API_LOCAL_BUSINESS_SERVICE); request.addRequestParam("pageNo", pagenum + ""); request.addRequestParam("pageSize", pagesize + ""); request.addRequestParam("organizationId", Store .getStore().getStoreId()); request.addRequestParam("providerId", storeId); if (classId.length() > 0) { request.addRequestParam("classValueId", classId); } if (priceSort.getSelection() > 0) { request.addRequestParam("pricePaixu", (priceSort .getSelection() - 1) + ""); } MissionController.startRequestMission(getActivity(), request, new RequestListener() { @Override protected void onStart() { if (pagenum == 0) { showLoading(); } } @Override protected void onFail(MissionMessage missionMessage) { loadingFailed(); } @Override protected void onSuccess(RequestMessage requestMessage) { if (!TextUtils.isEmpty(requestMessage.getResult())) { JSONObject object; try { object = new JSONObject(requestMessage.getResult()); if (object.optString("state").equalsIgnoreCase("SUCCESS")) { JSONArray array = object.optJSONArray("dataList"); if (array != null) { if (array.length() > 0) { if (array.length() < pagesize) { refreshScrollView .setMode(Mode.PULL_FROM_START); } for (int i = 0; i < array.length(); i++) { JSONObject jsonObject = array .optJSONObject(i); if (jsonObject != null) { localServices .add(new ModelLocalService( jsonObject)); } } serviceAdapter.notifyDataSetChanged(); return; } else { refreshScrollView.setMode(Mode.PULL_FROM_START); } } } } catch (JSONException e) { e.printStackTrace(); } if (localServices.size() == 0) { loadingEmpty(); } } } @Override protected void onFinish() { hideLoading(); refreshScrollView.onRefreshComplete(); } }); } }
[ "1076192306@qq.com" ]
1076192306@qq.com
d7c79ba69af8ccce5b6412279801f8e5345f20af
1b451394a3bc3a26b074828d3d20401a5b006272
/projects/SleepTracker/sas-ejbservice/src/main/java/hu/sas/ejbservice/converter/FeelConverter.java
3dfbddc4036215ad9ee444e2de76cce250e90d03
[]
no_license
Trambulin/oejee2015
8f9d51fadcf70e50819c5b25d52bd858e64f66fb
0c25cb5a3d851936a1ff56110c628a045b56b041
refs/heads/master
2020-12-28T23:15:31.080599
2015-12-17T14:44:18
2015-12-17T14:44:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
243
java
package hu.sas.ejbservice.converter; import java.util.List; import hu.sas.ejbservice.domain.FeelStub; import hu.sas.persistance.entity.Feel; public interface FeelConverter { FeelStub to(Feel feel); List<FeelStub> to(List<Feel> feels); }
[ "zelenkagabor@gmail.com" ]
zelenkagabor@gmail.com
77bd3bd45e01d2d8949adbe11c4816e07364ba2a
9bdbe1c655113fd857c186d007392fb57397d47f
/app/src/main/java/com/example/paco/projecte_integrat/Model/DBControl.java
80c298d4034680cfc350bba3bcc27f77d70cd78c
[]
no_license
maruian/Projecte_Integrat
1dfe8a13fc8b118dd42f0b8075c13d0ccc3e309b
4ec590671b6c59329de4800fab6898560bb4de91
refs/heads/master
2021-05-03T11:49:06.602436
2018-02-05T19:06:25
2018-02-05T19:06:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,546
java
package com.example.paco.projecte_integrat.Model; import android.app.Activity; import android.content.Context; import android.net.Uri; import android.support.annotation.NonNull; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.Query; import com.google.firebase.database.ValueEventListener; import com.google.firebase.storage.FirebaseStorage; import com.google.firebase.storage.StorageReference; import com.google.firebase.storage.UploadTask; /** * Created by Paco on 07/01/2018. */ public class DBControl { private Context context; // private interfazLogin comunicacionLogin; private FirebaseStorage storage; private FirebaseAuth auth; private StorageReference imagesRef, nameRef; private UploadTask uploadTask; //En el constructor obtenemos contexto de la actividad por si se necesita public DBControl(Context c){ context = c; } /* * Métodos */ //Método para registrar un usuario public void registrarUsuario(String correo, String pass){ //Obtenemos instancia de FireBaseAuth auth = FirebaseAuth.getInstance(); //Registramos al usuario auth.createUserWithEmailAndPassword(correo, pass).addOnCompleteListener((Activity) context, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()) { //No queremos que se quede logueado el usuario, por lo que desautenticaremos auth.signOut(); Toast.makeText(context, "Usuario registrado con éxito", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(context, "No se ha podido registrar el usuario", Toast.LENGTH_SHORT).show(); } } }); } //Método para loguear un usuario public void loginUsuario(String correo, String pass){ //Obtenemos instancia auth = FirebaseAuth.getInstance(); auth.signInWithEmailAndPassword(correo, pass) .addOnCompleteListener((Activity) context, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()) { //Si se loguea correctamente //comunicarnos con el activity } else { //Si no se loguea correctamente //comunicarnos con el activity } } }); } //Método para guardar una imagen de la galería public void guardarImagen(Uri file){ //Inicializamos objetos necesarios storage = FirebaseStorage.getInstance(); imagesRef = storage.getReference().child("imagenesProductos"); //Referencia a "directorio" imágenes para guardarlas ahí nameRef = imagesRef.child(file.getLastPathSegment()); uploadTask = nameRef.putFile(file); //Con esto comprobamos si se ha añadido con éxito o no uploadTask.addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception exception) { //Si no se ha podido almacenar Toast.makeText(context, "No se ha podido guardar la imagen", Toast.LENGTH_SHORT).show(); } }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { //Si se ha subido correctamente Toast.makeText(context, "Imagen almacenada con éxito", Toast.LENGTH_SHORT).show(); } }); } /* public void getLoginContext(Context c){ comunicacionLogin = (interfazLogin) c; } public interface interfazLogin{ void loginCorrecto(); void loginIncorrecto(); void sendUsername(String username); } */ }
[ "maravilleta097@gmail.com" ]
maravilleta097@gmail.com
99827657b13b8de05038fd4ea9c933d6806b1a16
2c0b8d85819739d05a7f83e72af7d7dce0c77825
/day03/src/Demo04.java
2a3d4573288860f97a59b9f3f4359cdbff48a681
[]
no_license
JinLeiGao/test01
9abf9386104fdb449a1d2947ec306ee773ddb81f
e57a74791562f2152d1c15f3b126dca586bc7494
refs/heads/master
2021-07-25T15:24:33.469233
2017-11-06T02:28:02
2017-11-06T02:28:02
109,638,204
0
0
null
null
null
null
UTF-8
Java
false
false
718
java
/** * 强制转换 : 较大类型数据 强制转为较小类型的数据 * */ public class Demo04 { public static void main(String[] args) { /* * 合理的的数据转换 未出现进度丢失 */ int a = 12; short b = (short)a; byte c =(byte) b; System.out.println(c); /** * int ---> byte [数据类型的范围 ---》 数据错误] */ int d = 130; byte e = (byte)d; System.out.println(e); // 注意点 [数据没有问题 在计算过程 数据溢出] int i = 1000000000; int j = 30; long k = 1L * i * j ; System.out.println(k); /** * double ----> float 强制类型转换 */ double m = 3.14; float n = (float)m; System.out.println(n); } }
[ "2253291256@qq.com" ]
2253291256@qq.com
50cb688696bfae21893571a59378a11dcd2a4053
66c0b63f7ce0cf973d88b2c6710162759cf45543
/src/main/java/com/csy/testblog/config/scheduledCronConfig.java
57fdec0f67fc3b3a47b93752b697fc80e2160027
[ "Apache-2.0" ]
permissive
chensiyou123/test-blog
c255ddf0a01155a2e87ef9f0a80a43120ae8edc7
63e53732c94b00133a7912ef1cc467094d3eadee
refs/heads/master
2020-05-16T16:15:43.320933
2019-04-25T07:15:46
2019-04-25T07:15:46
183,154,415
0
0
null
null
null
null
UTF-8
Java
false
false
333
java
package com.csy.testblog.config; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Date; // // @Component public class scheduledCronConfig { @Scheduled(cron = "0/5 * * * * *") public void cron() { System.out.println(new Date()); } }
[ "905630790@qq.com" ]
905630790@qq.com
21b2a7127d6fa578a264a8382ba30f0bb2fc04f1
4e9c06ff59fe91f0f69cb3dd80a128f466885aea
/src/o/mn.java
43139123c91acdd2b441f7f6095c65b3e545c98d
[]
no_license
reverseengineeringer/com.eclipsim.gpsstatus2
5ab9959cc3280d2dc96f2247c1263d14c893fc93
800552a53c11742c6889836a25b688d43ae68c2e
refs/heads/master
2021-01-17T07:26:14.357187
2016-07-21T03:33:07
2016-07-21T03:33:07
63,834,134
0
0
null
null
null
null
UTF-8
Java
false
false
273
java
package o; final class mn extends mk<Long> { mn(int paramInt, String paramString, Long paramLong) { super(paramInt, paramString, paramLong, (byte)0); } } /* Location: * Qualified Name: o.mn * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
a728d4e23fb831dbfc56c4188bee9665d1d68be5
2c1bf6ceb05bf351a41a86415f3dda1efbf6a434
/Lab9Silva/app/src/main/java/com/example/lab9silva/Gyro.java
a6a64679ceca991e2b3d7ccfc5f41d0781987f43
[]
no_license
nrs011/Android-Dev-Projects
dd865123158da6af0b7c46f6572fe8d074954742
6dff6a68c84cd38554f4cbace4540f71c7bdbe71
refs/heads/master
2022-05-30T10:57:42.224310
2020-04-30T17:51:44
2020-04-30T17:51:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
416
java
package com.example.lab9silva; public class Gyro { //Protect the Data private float GyroX, GyroY, GyroZ; //Setters and Getters public float getX() { return GyroX; } public void setX(float _x) {this.GyroX = _x;} public float getY() {return GyroY;} public void setY(float _y) {this.GyroY = _y;} public float getZ() { return GyroZ; } public void setZ(float _z) {this.GyroZ = _z;} }
[ "nimeshsilva@gmail.com" ]
nimeshsilva@gmail.com
87689a78b06bae2fec5e79418891bcb95195ef9f
24e23478747617da8fb484a804b51f7c2be9ae24
/cs478proj3app1and2_SaiTejaKarnati/cs478proj3/app/build/generated/not_namespaced_r_class_sources/debug/r/androidx/appcompat/R.java
cfdb1cb27db55ca3093db5562cfe9ce04bc516be
[]
no_license
saitejagroove/AndroidExampleProjects_UIC
f2b4d0a2005316739c81a7432c8850949c602672
10a556004dbccc9818dd989fc8dfeb6e49dd31b3
refs/heads/main
2023-01-06T19:53:47.842211
2020-11-02T22:52:47
2020-11-02T22:52:47
309,477,886
2
0
null
null
null
null
UTF-8
Java
false
false
120,804
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package androidx.appcompat; public final class R { private R() {} public static final class anim { private anim() {} public static final int abc_fade_in = 0x7f010000; public static final int abc_fade_out = 0x7f010001; public static final int abc_grow_fade_in_from_bottom = 0x7f010002; public static final int abc_popup_enter = 0x7f010003; public static final int abc_popup_exit = 0x7f010004; public static final int abc_shrink_fade_out_from_bottom = 0x7f010005; public static final int abc_slide_in_bottom = 0x7f010006; public static final int abc_slide_in_top = 0x7f010007; public static final int abc_slide_out_bottom = 0x7f010008; public static final int abc_slide_out_top = 0x7f010009; public static final int abc_tooltip_enter = 0x7f01000a; public static final int abc_tooltip_exit = 0x7f01000b; } public static final class attr { private attr() {} public static final int actionBarDivider = 0x7f020000; public static final int actionBarItemBackground = 0x7f020001; public static final int actionBarPopupTheme = 0x7f020002; public static final int actionBarSize = 0x7f020003; public static final int actionBarSplitStyle = 0x7f020004; public static final int actionBarStyle = 0x7f020005; public static final int actionBarTabBarStyle = 0x7f020006; public static final int actionBarTabStyle = 0x7f020007; public static final int actionBarTabTextStyle = 0x7f020008; public static final int actionBarTheme = 0x7f020009; public static final int actionBarWidgetTheme = 0x7f02000a; public static final int actionButtonStyle = 0x7f02000b; public static final int actionDropDownStyle = 0x7f02000c; public static final int actionLayout = 0x7f02000d; public static final int actionMenuTextAppearance = 0x7f02000e; public static final int actionMenuTextColor = 0x7f02000f; public static final int actionModeBackground = 0x7f020010; public static final int actionModeCloseButtonStyle = 0x7f020011; public static final int actionModeCloseDrawable = 0x7f020012; public static final int actionModeCopyDrawable = 0x7f020013; public static final int actionModeCutDrawable = 0x7f020014; public static final int actionModeFindDrawable = 0x7f020015; public static final int actionModePasteDrawable = 0x7f020016; public static final int actionModePopupWindowStyle = 0x7f020017; public static final int actionModeSelectAllDrawable = 0x7f020018; public static final int actionModeShareDrawable = 0x7f020019; public static final int actionModeSplitBackground = 0x7f02001a; public static final int actionModeStyle = 0x7f02001b; public static final int actionModeWebSearchDrawable = 0x7f02001c; public static final int actionOverflowButtonStyle = 0x7f02001d; public static final int actionOverflowMenuStyle = 0x7f02001e; public static final int actionProviderClass = 0x7f02001f; public static final int actionViewClass = 0x7f020020; public static final int activityChooserViewStyle = 0x7f020021; public static final int alertDialogButtonGroupStyle = 0x7f020022; public static final int alertDialogCenterButtons = 0x7f020023; public static final int alertDialogStyle = 0x7f020024; public static final int alertDialogTheme = 0x7f020025; public static final int allowStacking = 0x7f020026; public static final int alpha = 0x7f020027; public static final int alphabeticModifiers = 0x7f020028; public static final int arrowHeadLength = 0x7f020029; public static final int arrowShaftLength = 0x7f02002a; public static final int autoCompleteTextViewStyle = 0x7f02002b; public static final int autoSizeMaxTextSize = 0x7f02002c; public static final int autoSizeMinTextSize = 0x7f02002d; public static final int autoSizePresetSizes = 0x7f02002e; public static final int autoSizeStepGranularity = 0x7f02002f; public static final int autoSizeTextType = 0x7f020030; public static final int background = 0x7f020031; public static final int backgroundSplit = 0x7f020032; public static final int backgroundStacked = 0x7f020033; public static final int backgroundTint = 0x7f020034; public static final int backgroundTintMode = 0x7f020035; public static final int barLength = 0x7f020036; public static final int borderlessButtonStyle = 0x7f020039; public static final int buttonBarButtonStyle = 0x7f02003a; public static final int buttonBarNegativeButtonStyle = 0x7f02003b; public static final int buttonBarNeutralButtonStyle = 0x7f02003c; public static final int buttonBarPositiveButtonStyle = 0x7f02003d; public static final int buttonBarStyle = 0x7f02003e; public static final int buttonGravity = 0x7f02003f; public static final int buttonIconDimen = 0x7f020040; public static final int buttonPanelSideLayout = 0x7f020041; public static final int buttonStyle = 0x7f020042; public static final int buttonStyleSmall = 0x7f020043; public static final int buttonTint = 0x7f020044; public static final int buttonTintMode = 0x7f020045; public static final int checkboxStyle = 0x7f020047; public static final int checkedTextViewStyle = 0x7f020048; public static final int closeIcon = 0x7f020049; public static final int closeItemLayout = 0x7f02004a; public static final int collapseContentDescription = 0x7f02004b; public static final int collapseIcon = 0x7f02004c; public static final int color = 0x7f02004d; public static final int colorAccent = 0x7f02004e; public static final int colorBackgroundFloating = 0x7f02004f; public static final int colorButtonNormal = 0x7f020050; public static final int colorControlActivated = 0x7f020051; public static final int colorControlHighlight = 0x7f020052; public static final int colorControlNormal = 0x7f020053; public static final int colorError = 0x7f020054; public static final int colorPrimary = 0x7f020055; public static final int colorPrimaryDark = 0x7f020056; public static final int colorSwitchThumbNormal = 0x7f020057; public static final int commitIcon = 0x7f020058; public static final int contentDescription = 0x7f02005c; public static final int contentInsetEnd = 0x7f02005d; public static final int contentInsetEndWithActions = 0x7f02005e; public static final int contentInsetLeft = 0x7f02005f; public static final int contentInsetRight = 0x7f020060; public static final int contentInsetStart = 0x7f020061; public static final int contentInsetStartWithNavigation = 0x7f020062; public static final int controlBackground = 0x7f020063; public static final int coordinatorLayoutStyle = 0x7f020064; public static final int customNavigationLayout = 0x7f020065; public static final int defaultQueryHint = 0x7f020066; public static final int dialogCornerRadius = 0x7f020067; public static final int dialogPreferredPadding = 0x7f020068; public static final int dialogTheme = 0x7f020069; public static final int displayOptions = 0x7f02006a; public static final int divider = 0x7f02006b; public static final int dividerHorizontal = 0x7f02006c; public static final int dividerPadding = 0x7f02006d; public static final int dividerVertical = 0x7f02006e; public static final int drawableSize = 0x7f02006f; public static final int drawerArrowStyle = 0x7f020070; public static final int dropDownListViewStyle = 0x7f020071; public static final int dropdownListPreferredItemHeight = 0x7f020072; public static final int editTextBackground = 0x7f020073; public static final int editTextColor = 0x7f020074; public static final int editTextStyle = 0x7f020075; public static final int elevation = 0x7f020076; public static final int expandActivityOverflowButtonDrawable = 0x7f020078; public static final int firstBaselineToTopHeight = 0x7f020079; public static final int font = 0x7f02007a; public static final int fontFamily = 0x7f02007b; public static final int fontProviderAuthority = 0x7f02007c; public static final int fontProviderCerts = 0x7f02007d; public static final int fontProviderFetchStrategy = 0x7f02007e; public static final int fontProviderFetchTimeout = 0x7f02007f; public static final int fontProviderPackage = 0x7f020080; public static final int fontProviderQuery = 0x7f020081; public static final int fontStyle = 0x7f020082; public static final int fontVariationSettings = 0x7f020083; public static final int fontWeight = 0x7f020084; public static final int gapBetweenBars = 0x7f020085; public static final int goIcon = 0x7f020086; public static final int height = 0x7f020087; public static final int hideOnContentScroll = 0x7f020088; public static final int homeAsUpIndicator = 0x7f020089; public static final int homeLayout = 0x7f02008a; public static final int icon = 0x7f02008b; public static final int iconTint = 0x7f02008c; public static final int iconTintMode = 0x7f02008d; public static final int iconifiedByDefault = 0x7f02008e; public static final int imageButtonStyle = 0x7f02008f; public static final int indeterminateProgressStyle = 0x7f020090; public static final int initialActivityCount = 0x7f020091; public static final int isLightTheme = 0x7f020092; public static final int itemPadding = 0x7f020093; public static final int keylines = 0x7f020094; public static final int lastBaselineToBottomHeight = 0x7f020095; public static final int layout = 0x7f020096; public static final int layout_anchor = 0x7f020097; public static final int layout_anchorGravity = 0x7f020098; public static final int layout_behavior = 0x7f020099; public static final int layout_dodgeInsetEdges = 0x7f0200c3; public static final int layout_insetEdge = 0x7f0200cc; public static final int layout_keyline = 0x7f0200cd; public static final int lineHeight = 0x7f0200cf; public static final int listChoiceBackgroundIndicator = 0x7f0200d0; public static final int listDividerAlertDialog = 0x7f0200d1; public static final int listItemLayout = 0x7f0200d2; public static final int listLayout = 0x7f0200d3; public static final int listMenuViewStyle = 0x7f0200d4; public static final int listPopupWindowStyle = 0x7f0200d5; public static final int listPreferredItemHeight = 0x7f0200d6; public static final int listPreferredItemHeightLarge = 0x7f0200d7; public static final int listPreferredItemHeightSmall = 0x7f0200d8; public static final int listPreferredItemPaddingLeft = 0x7f0200d9; public static final int listPreferredItemPaddingRight = 0x7f0200da; public static final int logo = 0x7f0200db; public static final int logoDescription = 0x7f0200dc; public static final int maxButtonHeight = 0x7f0200dd; public static final int measureWithLargestChild = 0x7f0200de; public static final int multiChoiceItemLayout = 0x7f0200df; public static final int navigationContentDescription = 0x7f0200e0; public static final int navigationIcon = 0x7f0200e1; public static final int navigationMode = 0x7f0200e2; public static final int numericModifiers = 0x7f0200e3; public static final int overlapAnchor = 0x7f0200e4; public static final int paddingBottomNoButtons = 0x7f0200e5; public static final int paddingEnd = 0x7f0200e6; public static final int paddingStart = 0x7f0200e7; public static final int paddingTopNoTitle = 0x7f0200e8; public static final int panelBackground = 0x7f0200e9; public static final int panelMenuListTheme = 0x7f0200ea; public static final int panelMenuListWidth = 0x7f0200eb; public static final int popupMenuStyle = 0x7f0200ec; public static final int popupTheme = 0x7f0200ed; public static final int popupWindowStyle = 0x7f0200ee; public static final int preserveIconSpacing = 0x7f0200ef; public static final int progressBarPadding = 0x7f0200f0; public static final int progressBarStyle = 0x7f0200f1; public static final int queryBackground = 0x7f0200f2; public static final int queryHint = 0x7f0200f3; public static final int radioButtonStyle = 0x7f0200f4; public static final int ratingBarStyle = 0x7f0200f5; public static final int ratingBarStyleIndicator = 0x7f0200f6; public static final int ratingBarStyleSmall = 0x7f0200f7; public static final int searchHintIcon = 0x7f0200f8; public static final int searchIcon = 0x7f0200f9; public static final int searchViewStyle = 0x7f0200fa; public static final int seekBarStyle = 0x7f0200fb; public static final int selectableItemBackground = 0x7f0200fc; public static final int selectableItemBackgroundBorderless = 0x7f0200fd; public static final int showAsAction = 0x7f0200fe; public static final int showDividers = 0x7f0200ff; public static final int showText = 0x7f020100; public static final int showTitle = 0x7f020101; public static final int singleChoiceItemLayout = 0x7f020102; public static final int spinBars = 0x7f020103; public static final int spinnerDropDownItemStyle = 0x7f020104; public static final int spinnerStyle = 0x7f020105; public static final int splitTrack = 0x7f020106; public static final int srcCompat = 0x7f020107; public static final int state_above_anchor = 0x7f020108; public static final int statusBarBackground = 0x7f020109; public static final int subMenuArrow = 0x7f02010a; public static final int submitBackground = 0x7f02010b; public static final int subtitle = 0x7f02010c; public static final int subtitleTextAppearance = 0x7f02010d; public static final int subtitleTextColor = 0x7f02010e; public static final int subtitleTextStyle = 0x7f02010f; public static final int suggestionRowLayout = 0x7f020110; public static final int switchMinWidth = 0x7f020111; public static final int switchPadding = 0x7f020112; public static final int switchStyle = 0x7f020113; public static final int switchTextAppearance = 0x7f020114; public static final int textAllCaps = 0x7f020115; public static final int textAppearanceLargePopupMenu = 0x7f020116; public static final int textAppearanceListItem = 0x7f020117; public static final int textAppearanceListItemSecondary = 0x7f020118; public static final int textAppearanceListItemSmall = 0x7f020119; public static final int textAppearancePopupMenuHeader = 0x7f02011a; public static final int textAppearanceSearchResultSubtitle = 0x7f02011b; public static final int textAppearanceSearchResultTitle = 0x7f02011c; public static final int textAppearanceSmallPopupMenu = 0x7f02011d; public static final int textColorAlertDialogListItem = 0x7f02011e; public static final int textColorSearchUrl = 0x7f02011f; public static final int theme = 0x7f020120; public static final int thickness = 0x7f020121; public static final int thumbTextPadding = 0x7f020122; public static final int thumbTint = 0x7f020123; public static final int thumbTintMode = 0x7f020124; public static final int tickMark = 0x7f020125; public static final int tickMarkTint = 0x7f020126; public static final int tickMarkTintMode = 0x7f020127; public static final int tint = 0x7f020128; public static final int tintMode = 0x7f020129; public static final int title = 0x7f02012a; public static final int titleMargin = 0x7f02012b; public static final int titleMarginBottom = 0x7f02012c; public static final int titleMarginEnd = 0x7f02012d; public static final int titleMarginStart = 0x7f02012e; public static final int titleMarginTop = 0x7f02012f; public static final int titleMargins = 0x7f020130; public static final int titleTextAppearance = 0x7f020131; public static final int titleTextColor = 0x7f020132; public static final int titleTextStyle = 0x7f020133; public static final int toolbarNavigationButtonStyle = 0x7f020134; public static final int toolbarStyle = 0x7f020135; public static final int tooltipForegroundColor = 0x7f020136; public static final int tooltipFrameBackground = 0x7f020137; public static final int tooltipText = 0x7f020138; public static final int track = 0x7f020139; public static final int trackTint = 0x7f02013a; public static final int trackTintMode = 0x7f02013b; public static final int ttcIndex = 0x7f02013c; public static final int viewInflaterClass = 0x7f02013d; public static final int voiceIcon = 0x7f02013e; public static final int windowActionBar = 0x7f02013f; public static final int windowActionBarOverlay = 0x7f020140; public static final int windowActionModeOverlay = 0x7f020141; public static final int windowFixedHeightMajor = 0x7f020142; public static final int windowFixedHeightMinor = 0x7f020143; public static final int windowFixedWidthMajor = 0x7f020144; public static final int windowFixedWidthMinor = 0x7f020145; public static final int windowMinWidthMajor = 0x7f020146; public static final int windowMinWidthMinor = 0x7f020147; public static final int windowNoTitle = 0x7f020148; } public static final class bool { private bool() {} public static final int abc_action_bar_embed_tabs = 0x7f030000; public static final int abc_allow_stacked_button_bar = 0x7f030001; public static final int abc_config_actionMenuItemAllCaps = 0x7f030002; } public static final class color { private color() {} public static final int abc_background_cache_hint_selector_material_dark = 0x7f040000; public static final int abc_background_cache_hint_selector_material_light = 0x7f040001; public static final int abc_btn_colored_borderless_text_material = 0x7f040002; public static final int abc_btn_colored_text_material = 0x7f040003; public static final int abc_color_highlight_material = 0x7f040004; public static final int abc_hint_foreground_material_dark = 0x7f040005; public static final int abc_hint_foreground_material_light = 0x7f040006; public static final int abc_input_method_navigation_guard = 0x7f040007; public static final int abc_primary_text_disable_only_material_dark = 0x7f040008; public static final int abc_primary_text_disable_only_material_light = 0x7f040009; public static final int abc_primary_text_material_dark = 0x7f04000a; public static final int abc_primary_text_material_light = 0x7f04000b; public static final int abc_search_url_text = 0x7f04000c; public static final int abc_search_url_text_normal = 0x7f04000d; public static final int abc_search_url_text_pressed = 0x7f04000e; public static final int abc_search_url_text_selected = 0x7f04000f; public static final int abc_secondary_text_material_dark = 0x7f040010; public static final int abc_secondary_text_material_light = 0x7f040011; public static final int abc_tint_btn_checkable = 0x7f040012; public static final int abc_tint_default = 0x7f040013; public static final int abc_tint_edittext = 0x7f040014; public static final int abc_tint_seek_thumb = 0x7f040015; public static final int abc_tint_spinner = 0x7f040016; public static final int abc_tint_switch_track = 0x7f040017; public static final int accent_material_dark = 0x7f040018; public static final int accent_material_light = 0x7f040019; public static final int background_floating_material_dark = 0x7f04001a; public static final int background_floating_material_light = 0x7f04001b; public static final int background_material_dark = 0x7f04001c; public static final int background_material_light = 0x7f04001d; public static final int bright_foreground_disabled_material_dark = 0x7f04001e; public static final int bright_foreground_disabled_material_light = 0x7f04001f; public static final int bright_foreground_inverse_material_dark = 0x7f040020; public static final int bright_foreground_inverse_material_light = 0x7f040021; public static final int bright_foreground_material_dark = 0x7f040022; public static final int bright_foreground_material_light = 0x7f040023; public static final int button_material_dark = 0x7f040024; public static final int button_material_light = 0x7f040025; public static final int dim_foreground_disabled_material_dark = 0x7f040029; public static final int dim_foreground_disabled_material_light = 0x7f04002a; public static final int dim_foreground_material_dark = 0x7f04002b; public static final int dim_foreground_material_light = 0x7f04002c; public static final int error_color_material_dark = 0x7f04002d; public static final int error_color_material_light = 0x7f04002e; public static final int foreground_material_dark = 0x7f04002f; public static final int foreground_material_light = 0x7f040030; public static final int highlighted_text_material_dark = 0x7f040031; public static final int highlighted_text_material_light = 0x7f040032; public static final int material_blue_grey_800 = 0x7f040033; public static final int material_blue_grey_900 = 0x7f040034; public static final int material_blue_grey_950 = 0x7f040035; public static final int material_deep_teal_200 = 0x7f040036; public static final int material_deep_teal_500 = 0x7f040037; public static final int material_grey_100 = 0x7f040038; public static final int material_grey_300 = 0x7f040039; public static final int material_grey_50 = 0x7f04003a; public static final int material_grey_600 = 0x7f04003b; public static final int material_grey_800 = 0x7f04003c; public static final int material_grey_850 = 0x7f04003d; public static final int material_grey_900 = 0x7f04003e; public static final int notification_action_color_filter = 0x7f04003f; public static final int notification_icon_bg_color = 0x7f040040; public static final int primary_dark_material_dark = 0x7f040041; public static final int primary_dark_material_light = 0x7f040042; public static final int primary_material_dark = 0x7f040043; public static final int primary_material_light = 0x7f040044; public static final int primary_text_default_material_dark = 0x7f040045; public static final int primary_text_default_material_light = 0x7f040046; public static final int primary_text_disabled_material_dark = 0x7f040047; public static final int primary_text_disabled_material_light = 0x7f040048; public static final int ripple_material_dark = 0x7f040049; public static final int ripple_material_light = 0x7f04004a; public static final int secondary_text_default_material_dark = 0x7f04004b; public static final int secondary_text_default_material_light = 0x7f04004c; public static final int secondary_text_disabled_material_dark = 0x7f04004d; public static final int secondary_text_disabled_material_light = 0x7f04004e; public static final int switch_thumb_disabled_material_dark = 0x7f04004f; public static final int switch_thumb_disabled_material_light = 0x7f040050; public static final int switch_thumb_material_dark = 0x7f040051; public static final int switch_thumb_material_light = 0x7f040052; public static final int switch_thumb_normal_material_dark = 0x7f040053; public static final int switch_thumb_normal_material_light = 0x7f040054; public static final int tooltip_background_dark = 0x7f040055; public static final int tooltip_background_light = 0x7f040056; } public static final class dimen { private dimen() {} public static final int abc_action_bar_content_inset_material = 0x7f050000; public static final int abc_action_bar_content_inset_with_nav = 0x7f050001; public static final int abc_action_bar_default_height_material = 0x7f050002; public static final int abc_action_bar_default_padding_end_material = 0x7f050003; public static final int abc_action_bar_default_padding_start_material = 0x7f050004; public static final int abc_action_bar_elevation_material = 0x7f050005; public static final int abc_action_bar_icon_vertical_padding_material = 0x7f050006; public static final int abc_action_bar_overflow_padding_end_material = 0x7f050007; public static final int abc_action_bar_overflow_padding_start_material = 0x7f050008; public static final int abc_action_bar_stacked_max_height = 0x7f050009; public static final int abc_action_bar_stacked_tab_max_width = 0x7f05000a; public static final int abc_action_bar_subtitle_bottom_margin_material = 0x7f05000b; public static final int abc_action_bar_subtitle_top_margin_material = 0x7f05000c; public static final int abc_action_button_min_height_material = 0x7f05000d; public static final int abc_action_button_min_width_material = 0x7f05000e; public static final int abc_action_button_min_width_overflow_material = 0x7f05000f; public static final int abc_alert_dialog_button_bar_height = 0x7f050010; public static final int abc_alert_dialog_button_dimen = 0x7f050011; public static final int abc_button_inset_horizontal_material = 0x7f050012; public static final int abc_button_inset_vertical_material = 0x7f050013; public static final int abc_button_padding_horizontal_material = 0x7f050014; public static final int abc_button_padding_vertical_material = 0x7f050015; public static final int abc_cascading_menus_min_smallest_width = 0x7f050016; public static final int abc_config_prefDialogWidth = 0x7f050017; public static final int abc_control_corner_material = 0x7f050018; public static final int abc_control_inset_material = 0x7f050019; public static final int abc_control_padding_material = 0x7f05001a; public static final int abc_dialog_corner_radius_material = 0x7f05001b; public static final int abc_dialog_fixed_height_major = 0x7f05001c; public static final int abc_dialog_fixed_height_minor = 0x7f05001d; public static final int abc_dialog_fixed_width_major = 0x7f05001e; public static final int abc_dialog_fixed_width_minor = 0x7f05001f; public static final int abc_dialog_list_padding_bottom_no_buttons = 0x7f050020; public static final int abc_dialog_list_padding_top_no_title = 0x7f050021; public static final int abc_dialog_min_width_major = 0x7f050022; public static final int abc_dialog_min_width_minor = 0x7f050023; public static final int abc_dialog_padding_material = 0x7f050024; public static final int abc_dialog_padding_top_material = 0x7f050025; public static final int abc_dialog_title_divider_material = 0x7f050026; public static final int abc_disabled_alpha_material_dark = 0x7f050027; public static final int abc_disabled_alpha_material_light = 0x7f050028; public static final int abc_dropdownitem_icon_width = 0x7f050029; public static final int abc_dropdownitem_text_padding_left = 0x7f05002a; public static final int abc_dropdownitem_text_padding_right = 0x7f05002b; public static final int abc_edit_text_inset_bottom_material = 0x7f05002c; public static final int abc_edit_text_inset_horizontal_material = 0x7f05002d; public static final int abc_edit_text_inset_top_material = 0x7f05002e; public static final int abc_floating_window_z = 0x7f05002f; public static final int abc_list_item_padding_horizontal_material = 0x7f050030; public static final int abc_panel_menu_list_width = 0x7f050031; public static final int abc_progress_bar_height_material = 0x7f050032; public static final int abc_search_view_preferred_height = 0x7f050033; public static final int abc_search_view_preferred_width = 0x7f050034; public static final int abc_seekbar_track_background_height_material = 0x7f050035; public static final int abc_seekbar_track_progress_height_material = 0x7f050036; public static final int abc_select_dialog_padding_start_material = 0x7f050037; public static final int abc_switch_padding = 0x7f050038; public static final int abc_text_size_body_1_material = 0x7f050039; public static final int abc_text_size_body_2_material = 0x7f05003a; public static final int abc_text_size_button_material = 0x7f05003b; public static final int abc_text_size_caption_material = 0x7f05003c; public static final int abc_text_size_display_1_material = 0x7f05003d; public static final int abc_text_size_display_2_material = 0x7f05003e; public static final int abc_text_size_display_3_material = 0x7f05003f; public static final int abc_text_size_display_4_material = 0x7f050040; public static final int abc_text_size_headline_material = 0x7f050041; public static final int abc_text_size_large_material = 0x7f050042; public static final int abc_text_size_medium_material = 0x7f050043; public static final int abc_text_size_menu_header_material = 0x7f050044; public static final int abc_text_size_menu_material = 0x7f050045; public static final int abc_text_size_small_material = 0x7f050046; public static final int abc_text_size_subhead_material = 0x7f050047; public static final int abc_text_size_subtitle_material_toolbar = 0x7f050048; public static final int abc_text_size_title_material = 0x7f050049; public static final int abc_text_size_title_material_toolbar = 0x7f05004a; public static final int compat_button_inset_horizontal_material = 0x7f05004b; public static final int compat_button_inset_vertical_material = 0x7f05004c; public static final int compat_button_padding_horizontal_material = 0x7f05004d; public static final int compat_button_padding_vertical_material = 0x7f05004e; public static final int compat_control_corner_material = 0x7f05004f; public static final int compat_notification_large_icon_max_height = 0x7f050050; public static final int compat_notification_large_icon_max_width = 0x7f050051; public static final int disabled_alpha_material_dark = 0x7f050052; public static final int disabled_alpha_material_light = 0x7f050053; public static final int highlight_alpha_material_colored = 0x7f050054; public static final int highlight_alpha_material_dark = 0x7f050055; public static final int highlight_alpha_material_light = 0x7f050056; public static final int hint_alpha_material_dark = 0x7f050057; public static final int hint_alpha_material_light = 0x7f050058; public static final int hint_pressed_alpha_material_dark = 0x7f050059; public static final int hint_pressed_alpha_material_light = 0x7f05005a; public static final int notification_action_icon_size = 0x7f05005b; public static final int notification_action_text_size = 0x7f05005c; public static final int notification_big_circle_margin = 0x7f05005d; public static final int notification_content_margin_start = 0x7f05005e; public static final int notification_large_icon_height = 0x7f05005f; public static final int notification_large_icon_width = 0x7f050060; public static final int notification_main_column_padding_top = 0x7f050061; public static final int notification_media_narrow_margin = 0x7f050062; public static final int notification_right_icon_size = 0x7f050063; public static final int notification_right_side_padding_top = 0x7f050064; public static final int notification_small_icon_background_padding = 0x7f050065; public static final int notification_small_icon_size_as_large = 0x7f050066; public static final int notification_subtext_size = 0x7f050067; public static final int notification_top_pad = 0x7f050068; public static final int notification_top_pad_large_text = 0x7f050069; public static final int tooltip_corner_radius = 0x7f05006a; public static final int tooltip_horizontal_padding = 0x7f05006b; public static final int tooltip_margin = 0x7f05006c; public static final int tooltip_precise_anchor_extra_offset = 0x7f05006d; public static final int tooltip_precise_anchor_threshold = 0x7f05006e; public static final int tooltip_vertical_padding = 0x7f05006f; public static final int tooltip_y_offset_non_touch = 0x7f050070; public static final int tooltip_y_offset_touch = 0x7f050071; } public static final class drawable { private drawable() {} public static final int abc_ab_share_pack_mtrl_alpha = 0x7f060001; public static final int abc_action_bar_item_background_material = 0x7f060002; public static final int abc_btn_borderless_material = 0x7f060003; public static final int abc_btn_check_material = 0x7f060004; public static final int abc_btn_check_to_on_mtrl_000 = 0x7f060005; public static final int abc_btn_check_to_on_mtrl_015 = 0x7f060006; public static final int abc_btn_colored_material = 0x7f060007; public static final int abc_btn_default_mtrl_shape = 0x7f060008; public static final int abc_btn_radio_material = 0x7f060009; public static final int abc_btn_radio_to_on_mtrl_000 = 0x7f06000a; public static final int abc_btn_radio_to_on_mtrl_015 = 0x7f06000b; public static final int abc_btn_switch_to_on_mtrl_00001 = 0x7f06000c; public static final int abc_btn_switch_to_on_mtrl_00012 = 0x7f06000d; public static final int abc_cab_background_internal_bg = 0x7f06000e; public static final int abc_cab_background_top_material = 0x7f06000f; public static final int abc_cab_background_top_mtrl_alpha = 0x7f060010; public static final int abc_control_background_material = 0x7f060011; public static final int abc_dialog_material_background = 0x7f060012; public static final int abc_edit_text_material = 0x7f060013; public static final int abc_ic_ab_back_material = 0x7f060014; public static final int abc_ic_arrow_drop_right_black_24dp = 0x7f060015; public static final int abc_ic_clear_material = 0x7f060016; public static final int abc_ic_commit_search_api_mtrl_alpha = 0x7f060017; public static final int abc_ic_go_search_api_material = 0x7f060018; public static final int abc_ic_menu_copy_mtrl_am_alpha = 0x7f060019; public static final int abc_ic_menu_cut_mtrl_alpha = 0x7f06001a; public static final int abc_ic_menu_overflow_material = 0x7f06001b; public static final int abc_ic_menu_paste_mtrl_am_alpha = 0x7f06001c; public static final int abc_ic_menu_selectall_mtrl_alpha = 0x7f06001d; public static final int abc_ic_menu_share_mtrl_alpha = 0x7f06001e; public static final int abc_ic_search_api_material = 0x7f06001f; public static final int abc_ic_star_black_16dp = 0x7f060020; public static final int abc_ic_star_black_36dp = 0x7f060021; public static final int abc_ic_star_black_48dp = 0x7f060022; public static final int abc_ic_star_half_black_16dp = 0x7f060023; public static final int abc_ic_star_half_black_36dp = 0x7f060024; public static final int abc_ic_star_half_black_48dp = 0x7f060025; public static final int abc_ic_voice_search_api_material = 0x7f060026; public static final int abc_item_background_holo_dark = 0x7f060027; public static final int abc_item_background_holo_light = 0x7f060028; public static final int abc_list_divider_material = 0x7f060029; public static final int abc_list_divider_mtrl_alpha = 0x7f06002a; public static final int abc_list_focused_holo = 0x7f06002b; public static final int abc_list_longpressed_holo = 0x7f06002c; public static final int abc_list_pressed_holo_dark = 0x7f06002d; public static final int abc_list_pressed_holo_light = 0x7f06002e; public static final int abc_list_selector_background_transition_holo_dark = 0x7f06002f; public static final int abc_list_selector_background_transition_holo_light = 0x7f060030; public static final int abc_list_selector_disabled_holo_dark = 0x7f060031; public static final int abc_list_selector_disabled_holo_light = 0x7f060032; public static final int abc_list_selector_holo_dark = 0x7f060033; public static final int abc_list_selector_holo_light = 0x7f060034; public static final int abc_menu_hardkey_panel_mtrl_mult = 0x7f060035; public static final int abc_popup_background_mtrl_mult = 0x7f060036; public static final int abc_ratingbar_indicator_material = 0x7f060037; public static final int abc_ratingbar_material = 0x7f060038; public static final int abc_ratingbar_small_material = 0x7f060039; public static final int abc_scrubber_control_off_mtrl_alpha = 0x7f06003a; public static final int abc_scrubber_control_to_pressed_mtrl_000 = 0x7f06003b; public static final int abc_scrubber_control_to_pressed_mtrl_005 = 0x7f06003c; public static final int abc_scrubber_primary_mtrl_alpha = 0x7f06003d; public static final int abc_scrubber_track_mtrl_alpha = 0x7f06003e; public static final int abc_seekbar_thumb_material = 0x7f06003f; public static final int abc_seekbar_tick_mark_material = 0x7f060040; public static final int abc_seekbar_track_material = 0x7f060041; public static final int abc_spinner_mtrl_am_alpha = 0x7f060042; public static final int abc_spinner_textfield_background_material = 0x7f060043; public static final int abc_switch_thumb_material = 0x7f060044; public static final int abc_switch_track_mtrl_alpha = 0x7f060045; public static final int abc_tab_indicator_material = 0x7f060046; public static final int abc_tab_indicator_mtrl_alpha = 0x7f060047; public static final int abc_text_cursor_material = 0x7f060048; public static final int abc_text_select_handle_left_mtrl_dark = 0x7f060049; public static final int abc_text_select_handle_left_mtrl_light = 0x7f06004a; public static final int abc_text_select_handle_middle_mtrl_dark = 0x7f06004b; public static final int abc_text_select_handle_middle_mtrl_light = 0x7f06004c; public static final int abc_text_select_handle_right_mtrl_dark = 0x7f06004d; public static final int abc_text_select_handle_right_mtrl_light = 0x7f06004e; public static final int abc_textfield_activated_mtrl_alpha = 0x7f06004f; public static final int abc_textfield_default_mtrl_alpha = 0x7f060050; public static final int abc_textfield_search_activated_mtrl_alpha = 0x7f060051; public static final int abc_textfield_search_default_mtrl_alpha = 0x7f060052; public static final int abc_textfield_search_material = 0x7f060053; public static final int abc_vector_test = 0x7f060054; public static final int notification_action_background = 0x7f060057; public static final int notification_bg = 0x7f060058; public static final int notification_bg_low = 0x7f060059; public static final int notification_bg_low_normal = 0x7f06005a; public static final int notification_bg_low_pressed = 0x7f06005b; public static final int notification_bg_normal = 0x7f06005c; public static final int notification_bg_normal_pressed = 0x7f06005d; public static final int notification_icon_background = 0x7f06005e; public static final int notification_template_icon_bg = 0x7f06005f; public static final int notification_template_icon_low_bg = 0x7f060060; public static final int notification_tile_bg = 0x7f060061; public static final int notify_panel_notification_icon_bg = 0x7f060062; public static final int tooltip_frame_dark = 0x7f060063; public static final int tooltip_frame_light = 0x7f060064; } public static final class id { private id() {} public static final int action_bar = 0x7f070006; public static final int action_bar_activity_content = 0x7f070007; public static final int action_bar_container = 0x7f070008; public static final int action_bar_root = 0x7f070009; public static final int action_bar_spinner = 0x7f07000a; public static final int action_bar_subtitle = 0x7f07000b; public static final int action_bar_title = 0x7f07000c; public static final int action_container = 0x7f07000d; public static final int action_context_bar = 0x7f07000e; public static final int action_divider = 0x7f07000f; public static final int action_image = 0x7f070010; public static final int action_menu_divider = 0x7f070011; public static final int action_menu_presenter = 0x7f070012; public static final int action_mode_bar = 0x7f070013; public static final int action_mode_bar_stub = 0x7f070014; public static final int action_mode_close_button = 0x7f070015; public static final int action_text = 0x7f070016; public static final int actions = 0x7f070017; public static final int activity_chooser_view_content = 0x7f070018; public static final int add = 0x7f070019; public static final int alertTitle = 0x7f07001a; public static final int async = 0x7f07001d; public static final int blocking = 0x7f070020; public static final int bottom = 0x7f070021; public static final int buttonPanel = 0x7f070024; public static final int checkbox = 0x7f070029; public static final int chronometer = 0x7f07002a; public static final int content = 0x7f07002e; public static final int contentPanel = 0x7f07002f; public static final int custom = 0x7f070030; public static final int customPanel = 0x7f070031; public static final int decor_content_parent = 0x7f070032; public static final int default_activity_button = 0x7f070033; public static final int edit_query = 0x7f070037; public static final int end = 0x7f070038; public static final int expand_activities_button = 0x7f070039; public static final int expanded_menu = 0x7f07003a; public static final int forever = 0x7f07003e; public static final int group_divider = 0x7f070040; public static final int home = 0x7f070042; public static final int icon = 0x7f070044; public static final int icon_group = 0x7f070045; public static final int image = 0x7f070047; public static final int info = 0x7f070048; public static final int italic = 0x7f07004a; public static final int left = 0x7f07004b; public static final int line1 = 0x7f07004c; public static final int line3 = 0x7f07004d; public static final int listMode = 0x7f07004e; public static final int list_item = 0x7f07004f; public static final int message = 0x7f070050; public static final int multiply = 0x7f070052; public static final int none = 0x7f070054; public static final int normal = 0x7f070055; public static final int notification_background = 0x7f070056; public static final int notification_main_column = 0x7f070057; public static final int notification_main_column_container = 0x7f070058; public static final int parentPanel = 0x7f07005b; public static final int progress_circular = 0x7f07005d; public static final int progress_horizontal = 0x7f07005e; public static final int radio = 0x7f07005f; public static final int right = 0x7f070060; public static final int right_icon = 0x7f070061; public static final int right_side = 0x7f070062; public static final int screen = 0x7f070063; public static final int scrollIndicatorDown = 0x7f070064; public static final int scrollIndicatorUp = 0x7f070065; public static final int scrollView = 0x7f070066; public static final int search_badge = 0x7f070067; public static final int search_bar = 0x7f070068; public static final int search_button = 0x7f070069; public static final int search_close_btn = 0x7f07006a; public static final int search_edit_frame = 0x7f07006b; public static final int search_go_btn = 0x7f07006c; public static final int search_mag_icon = 0x7f07006d; public static final int search_plate = 0x7f07006e; public static final int search_src_text = 0x7f07006f; public static final int search_voice_btn = 0x7f070070; public static final int select_dialog_listview = 0x7f070071; public static final int shortcut = 0x7f070072; public static final int spacer = 0x7f070076; public static final int split_action_bar = 0x7f070077; public static final int src_atop = 0x7f07007a; public static final int src_in = 0x7f07007b; public static final int src_over = 0x7f07007c; public static final int start = 0x7f07007e; public static final int submenuarrow = 0x7f07007f; public static final int submit_area = 0x7f070080; public static final int tabMode = 0x7f070081; public static final int tag_transition_group = 0x7f070082; public static final int tag_unhandled_key_event_manager = 0x7f070083; public static final int tag_unhandled_key_listeners = 0x7f070084; public static final int text = 0x7f070085; public static final int text2 = 0x7f070086; public static final int textSpacerNoButtons = 0x7f070087; public static final int textSpacerNoTitle = 0x7f070088; public static final int time = 0x7f07008b; public static final int title = 0x7f07008c; public static final int titleDividerNoCustom = 0x7f07008d; public static final int title_template = 0x7f07008e; public static final int top = 0x7f07008f; public static final int topPanel = 0x7f070090; public static final int uniform = 0x7f070091; public static final int up = 0x7f070092; public static final int wrap_content = 0x7f070096; } public static final class integer { private integer() {} public static final int abc_config_activityDefaultDur = 0x7f080000; public static final int abc_config_activityShortDur = 0x7f080001; public static final int cancel_button_image_alpha = 0x7f080002; public static final int config_tooltipAnimTime = 0x7f080003; public static final int status_bar_notification_info_maxnum = 0x7f080004; } public static final class layout { private layout() {} public static final int abc_action_bar_title_item = 0x7f090000; public static final int abc_action_bar_up_container = 0x7f090001; public static final int abc_action_menu_item_layout = 0x7f090002; public static final int abc_action_menu_layout = 0x7f090003; public static final int abc_action_mode_bar = 0x7f090004; public static final int abc_action_mode_close_item_material = 0x7f090005; public static final int abc_activity_chooser_view = 0x7f090006; public static final int abc_activity_chooser_view_list_item = 0x7f090007; public static final int abc_alert_dialog_button_bar_material = 0x7f090008; public static final int abc_alert_dialog_material = 0x7f090009; public static final int abc_alert_dialog_title_material = 0x7f09000a; public static final int abc_cascading_menu_item_layout = 0x7f09000b; public static final int abc_dialog_title_material = 0x7f09000c; public static final int abc_expanded_menu_layout = 0x7f09000d; public static final int abc_list_menu_item_checkbox = 0x7f09000e; public static final int abc_list_menu_item_icon = 0x7f09000f; public static final int abc_list_menu_item_layout = 0x7f090010; public static final int abc_list_menu_item_radio = 0x7f090011; public static final int abc_popup_menu_header_item_layout = 0x7f090012; public static final int abc_popup_menu_item_layout = 0x7f090013; public static final int abc_screen_content_include = 0x7f090014; public static final int abc_screen_simple = 0x7f090015; public static final int abc_screen_simple_overlay_action_mode = 0x7f090016; public static final int abc_screen_toolbar = 0x7f090017; public static final int abc_search_dropdown_item_icons_2line = 0x7f090018; public static final int abc_search_view = 0x7f090019; public static final int abc_select_dialog_material = 0x7f09001a; public static final int abc_tooltip = 0x7f09001b; public static final int notification_action = 0x7f09001d; public static final int notification_action_tombstone = 0x7f09001e; public static final int notification_template_custom_big = 0x7f09001f; public static final int notification_template_icon_group = 0x7f090020; public static final int notification_template_part_chronometer = 0x7f090021; public static final int notification_template_part_time = 0x7f090022; public static final int select_dialog_item_material = 0x7f090023; public static final int select_dialog_multichoice_material = 0x7f090024; public static final int select_dialog_singlechoice_material = 0x7f090025; public static final int support_simple_spinner_dropdown_item = 0x7f090026; } public static final class string { private string() {} public static final int abc_action_bar_home_description = 0x7f0b0000; public static final int abc_action_bar_up_description = 0x7f0b0001; public static final int abc_action_menu_overflow_description = 0x7f0b0002; public static final int abc_action_mode_done = 0x7f0b0003; public static final int abc_activity_chooser_view_see_all = 0x7f0b0004; public static final int abc_activitychooserview_choose_application = 0x7f0b0005; public static final int abc_capital_off = 0x7f0b0006; public static final int abc_capital_on = 0x7f0b0007; public static final int abc_font_family_body_1_material = 0x7f0b0008; public static final int abc_font_family_body_2_material = 0x7f0b0009; public static final int abc_font_family_button_material = 0x7f0b000a; public static final int abc_font_family_caption_material = 0x7f0b000b; public static final int abc_font_family_display_1_material = 0x7f0b000c; public static final int abc_font_family_display_2_material = 0x7f0b000d; public static final int abc_font_family_display_3_material = 0x7f0b000e; public static final int abc_font_family_display_4_material = 0x7f0b000f; public static final int abc_font_family_headline_material = 0x7f0b0010; public static final int abc_font_family_menu_material = 0x7f0b0011; public static final int abc_font_family_subhead_material = 0x7f0b0012; public static final int abc_font_family_title_material = 0x7f0b0013; public static final int abc_menu_alt_shortcut_label = 0x7f0b0014; public static final int abc_menu_ctrl_shortcut_label = 0x7f0b0015; public static final int abc_menu_delete_shortcut_label = 0x7f0b0016; public static final int abc_menu_enter_shortcut_label = 0x7f0b0017; public static final int abc_menu_function_shortcut_label = 0x7f0b0018; public static final int abc_menu_meta_shortcut_label = 0x7f0b0019; public static final int abc_menu_shift_shortcut_label = 0x7f0b001a; public static final int abc_menu_space_shortcut_label = 0x7f0b001b; public static final int abc_menu_sym_shortcut_label = 0x7f0b001c; public static final int abc_prepend_shortcut_label = 0x7f0b001d; public static final int abc_search_hint = 0x7f0b001e; public static final int abc_searchview_description_clear = 0x7f0b001f; public static final int abc_searchview_description_query = 0x7f0b0020; public static final int abc_searchview_description_search = 0x7f0b0021; public static final int abc_searchview_description_submit = 0x7f0b0022; public static final int abc_searchview_description_voice = 0x7f0b0023; public static final int abc_shareactionprovider_share_with = 0x7f0b0024; public static final int abc_shareactionprovider_share_with_application = 0x7f0b0025; public static final int abc_toolbar_collapse_description = 0x7f0b0026; public static final int search_menu_title = 0x7f0b002a; public static final int status_bar_notification_info_overflow = 0x7f0b002b; } public static final class style { private style() {} public static final int AlertDialog_AppCompat = 0x7f0c0000; public static final int AlertDialog_AppCompat_Light = 0x7f0c0001; public static final int Animation_AppCompat_Dialog = 0x7f0c0002; public static final int Animation_AppCompat_DropDownUp = 0x7f0c0003; public static final int Animation_AppCompat_Tooltip = 0x7f0c0004; public static final int Base_AlertDialog_AppCompat = 0x7f0c0006; public static final int Base_AlertDialog_AppCompat_Light = 0x7f0c0007; public static final int Base_Animation_AppCompat_Dialog = 0x7f0c0008; public static final int Base_Animation_AppCompat_DropDownUp = 0x7f0c0009; public static final int Base_Animation_AppCompat_Tooltip = 0x7f0c000a; public static final int Base_DialogWindowTitleBackground_AppCompat = 0x7f0c000c; public static final int Base_DialogWindowTitle_AppCompat = 0x7f0c000b; public static final int Base_TextAppearance_AppCompat = 0x7f0c000d; public static final int Base_TextAppearance_AppCompat_Body1 = 0x7f0c000e; public static final int Base_TextAppearance_AppCompat_Body2 = 0x7f0c000f; public static final int Base_TextAppearance_AppCompat_Button = 0x7f0c0010; public static final int Base_TextAppearance_AppCompat_Caption = 0x7f0c0011; public static final int Base_TextAppearance_AppCompat_Display1 = 0x7f0c0012; public static final int Base_TextAppearance_AppCompat_Display2 = 0x7f0c0013; public static final int Base_TextAppearance_AppCompat_Display3 = 0x7f0c0014; public static final int Base_TextAppearance_AppCompat_Display4 = 0x7f0c0015; public static final int Base_TextAppearance_AppCompat_Headline = 0x7f0c0016; public static final int Base_TextAppearance_AppCompat_Inverse = 0x7f0c0017; public static final int Base_TextAppearance_AppCompat_Large = 0x7f0c0018; public static final int Base_TextAppearance_AppCompat_Large_Inverse = 0x7f0c0019; public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0c001a; public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0c001b; public static final int Base_TextAppearance_AppCompat_Medium = 0x7f0c001c; public static final int Base_TextAppearance_AppCompat_Medium_Inverse = 0x7f0c001d; public static final int Base_TextAppearance_AppCompat_Menu = 0x7f0c001e; public static final int Base_TextAppearance_AppCompat_SearchResult = 0x7f0c001f; public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0c0020; public static final int Base_TextAppearance_AppCompat_SearchResult_Title = 0x7f0c0021; public static final int Base_TextAppearance_AppCompat_Small = 0x7f0c0022; public static final int Base_TextAppearance_AppCompat_Small_Inverse = 0x7f0c0023; public static final int Base_TextAppearance_AppCompat_Subhead = 0x7f0c0024; public static final int Base_TextAppearance_AppCompat_Subhead_Inverse = 0x7f0c0025; public static final int Base_TextAppearance_AppCompat_Title = 0x7f0c0026; public static final int Base_TextAppearance_AppCompat_Title_Inverse = 0x7f0c0027; public static final int Base_TextAppearance_AppCompat_Tooltip = 0x7f0c0028; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0c0029; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0c002a; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0c002b; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0c002c; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0c002d; public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0c002e; public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0c002f; public static final int Base_TextAppearance_AppCompat_Widget_Button = 0x7f0c0030; public static final int Base_TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 0x7f0c0031; public static final int Base_TextAppearance_AppCompat_Widget_Button_Colored = 0x7f0c0032; public static final int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f0c0033; public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0c0034; public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Header = 0x7f0c0035; public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0c0036; public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0c0037; public static final int Base_TextAppearance_AppCompat_Widget_Switch = 0x7f0c0038; public static final int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0c0039; public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0c003a; public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0c003b; public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0c003c; public static final int Base_ThemeOverlay_AppCompat = 0x7f0c004b; public static final int Base_ThemeOverlay_AppCompat_ActionBar = 0x7f0c004c; public static final int Base_ThemeOverlay_AppCompat_Dark = 0x7f0c004d; public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0c004e; public static final int Base_ThemeOverlay_AppCompat_Dialog = 0x7f0c004f; public static final int Base_ThemeOverlay_AppCompat_Dialog_Alert = 0x7f0c0050; public static final int Base_ThemeOverlay_AppCompat_Light = 0x7f0c0051; public static final int Base_Theme_AppCompat = 0x7f0c003d; public static final int Base_Theme_AppCompat_CompactMenu = 0x7f0c003e; public static final int Base_Theme_AppCompat_Dialog = 0x7f0c003f; public static final int Base_Theme_AppCompat_DialogWhenLarge = 0x7f0c0043; public static final int Base_Theme_AppCompat_Dialog_Alert = 0x7f0c0040; public static final int Base_Theme_AppCompat_Dialog_FixedSize = 0x7f0c0041; public static final int Base_Theme_AppCompat_Dialog_MinWidth = 0x7f0c0042; public static final int Base_Theme_AppCompat_Light = 0x7f0c0044; public static final int Base_Theme_AppCompat_Light_DarkActionBar = 0x7f0c0045; public static final int Base_Theme_AppCompat_Light_Dialog = 0x7f0c0046; public static final int Base_Theme_AppCompat_Light_DialogWhenLarge = 0x7f0c004a; public static final int Base_Theme_AppCompat_Light_Dialog_Alert = 0x7f0c0047; public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize = 0x7f0c0048; public static final int Base_Theme_AppCompat_Light_Dialog_MinWidth = 0x7f0c0049; public static final int Base_V21_ThemeOverlay_AppCompat_Dialog = 0x7f0c0056; public static final int Base_V21_Theme_AppCompat = 0x7f0c0052; public static final int Base_V21_Theme_AppCompat_Dialog = 0x7f0c0053; public static final int Base_V21_Theme_AppCompat_Light = 0x7f0c0054; public static final int Base_V21_Theme_AppCompat_Light_Dialog = 0x7f0c0055; public static final int Base_V22_Theme_AppCompat = 0x7f0c0057; public static final int Base_V22_Theme_AppCompat_Light = 0x7f0c0058; public static final int Base_V23_Theme_AppCompat = 0x7f0c0059; public static final int Base_V23_Theme_AppCompat_Light = 0x7f0c005a; public static final int Base_V26_Theme_AppCompat = 0x7f0c005b; public static final int Base_V26_Theme_AppCompat_Light = 0x7f0c005c; public static final int Base_V26_Widget_AppCompat_Toolbar = 0x7f0c005d; public static final int Base_V28_Theme_AppCompat = 0x7f0c005e; public static final int Base_V28_Theme_AppCompat_Light = 0x7f0c005f; public static final int Base_V7_ThemeOverlay_AppCompat_Dialog = 0x7f0c0064; public static final int Base_V7_Theme_AppCompat = 0x7f0c0060; public static final int Base_V7_Theme_AppCompat_Dialog = 0x7f0c0061; public static final int Base_V7_Theme_AppCompat_Light = 0x7f0c0062; public static final int Base_V7_Theme_AppCompat_Light_Dialog = 0x7f0c0063; public static final int Base_V7_Widget_AppCompat_AutoCompleteTextView = 0x7f0c0065; public static final int Base_V7_Widget_AppCompat_EditText = 0x7f0c0066; public static final int Base_V7_Widget_AppCompat_Toolbar = 0x7f0c0067; public static final int Base_Widget_AppCompat_ActionBar = 0x7f0c0068; public static final int Base_Widget_AppCompat_ActionBar_Solid = 0x7f0c0069; public static final int Base_Widget_AppCompat_ActionBar_TabBar = 0x7f0c006a; public static final int Base_Widget_AppCompat_ActionBar_TabText = 0x7f0c006b; public static final int Base_Widget_AppCompat_ActionBar_TabView = 0x7f0c006c; public static final int Base_Widget_AppCompat_ActionButton = 0x7f0c006d; public static final int Base_Widget_AppCompat_ActionButton_CloseMode = 0x7f0c006e; public static final int Base_Widget_AppCompat_ActionButton_Overflow = 0x7f0c006f; public static final int Base_Widget_AppCompat_ActionMode = 0x7f0c0070; public static final int Base_Widget_AppCompat_ActivityChooserView = 0x7f0c0071; public static final int Base_Widget_AppCompat_AutoCompleteTextView = 0x7f0c0072; public static final int Base_Widget_AppCompat_Button = 0x7f0c0073; public static final int Base_Widget_AppCompat_ButtonBar = 0x7f0c0079; public static final int Base_Widget_AppCompat_ButtonBar_AlertDialog = 0x7f0c007a; public static final int Base_Widget_AppCompat_Button_Borderless = 0x7f0c0074; public static final int Base_Widget_AppCompat_Button_Borderless_Colored = 0x7f0c0075; public static final int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f0c0076; public static final int Base_Widget_AppCompat_Button_Colored = 0x7f0c0077; public static final int Base_Widget_AppCompat_Button_Small = 0x7f0c0078; public static final int Base_Widget_AppCompat_CompoundButton_CheckBox = 0x7f0c007b; public static final int Base_Widget_AppCompat_CompoundButton_RadioButton = 0x7f0c007c; public static final int Base_Widget_AppCompat_CompoundButton_Switch = 0x7f0c007d; public static final int Base_Widget_AppCompat_DrawerArrowToggle = 0x7f0c007e; public static final int Base_Widget_AppCompat_DrawerArrowToggle_Common = 0x7f0c007f; public static final int Base_Widget_AppCompat_DropDownItem_Spinner = 0x7f0c0080; public static final int Base_Widget_AppCompat_EditText = 0x7f0c0081; public static final int Base_Widget_AppCompat_ImageButton = 0x7f0c0082; public static final int Base_Widget_AppCompat_Light_ActionBar = 0x7f0c0083; public static final int Base_Widget_AppCompat_Light_ActionBar_Solid = 0x7f0c0084; public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0c0085; public static final int Base_Widget_AppCompat_Light_ActionBar_TabText = 0x7f0c0086; public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f0c0087; public static final int Base_Widget_AppCompat_Light_ActionBar_TabView = 0x7f0c0088; public static final int Base_Widget_AppCompat_Light_PopupMenu = 0x7f0c0089; public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f0c008a; public static final int Base_Widget_AppCompat_ListMenuView = 0x7f0c008b; public static final int Base_Widget_AppCompat_ListPopupWindow = 0x7f0c008c; public static final int Base_Widget_AppCompat_ListView = 0x7f0c008d; public static final int Base_Widget_AppCompat_ListView_DropDown = 0x7f0c008e; public static final int Base_Widget_AppCompat_ListView_Menu = 0x7f0c008f; public static final int Base_Widget_AppCompat_PopupMenu = 0x7f0c0090; public static final int Base_Widget_AppCompat_PopupMenu_Overflow = 0x7f0c0091; public static final int Base_Widget_AppCompat_PopupWindow = 0x7f0c0092; public static final int Base_Widget_AppCompat_ProgressBar = 0x7f0c0093; public static final int Base_Widget_AppCompat_ProgressBar_Horizontal = 0x7f0c0094; public static final int Base_Widget_AppCompat_RatingBar = 0x7f0c0095; public static final int Base_Widget_AppCompat_RatingBar_Indicator = 0x7f0c0096; public static final int Base_Widget_AppCompat_RatingBar_Small = 0x7f0c0097; public static final int Base_Widget_AppCompat_SearchView = 0x7f0c0098; public static final int Base_Widget_AppCompat_SearchView_ActionBar = 0x7f0c0099; public static final int Base_Widget_AppCompat_SeekBar = 0x7f0c009a; public static final int Base_Widget_AppCompat_SeekBar_Discrete = 0x7f0c009b; public static final int Base_Widget_AppCompat_Spinner = 0x7f0c009c; public static final int Base_Widget_AppCompat_Spinner_Underlined = 0x7f0c009d; public static final int Base_Widget_AppCompat_TextView_SpinnerItem = 0x7f0c009e; public static final int Base_Widget_AppCompat_Toolbar = 0x7f0c009f; public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation = 0x7f0c00a0; public static final int Platform_AppCompat = 0x7f0c00a1; public static final int Platform_AppCompat_Light = 0x7f0c00a2; public static final int Platform_ThemeOverlay_AppCompat = 0x7f0c00a3; public static final int Platform_ThemeOverlay_AppCompat_Dark = 0x7f0c00a4; public static final int Platform_ThemeOverlay_AppCompat_Light = 0x7f0c00a5; public static final int Platform_V21_AppCompat = 0x7f0c00a6; public static final int Platform_V21_AppCompat_Light = 0x7f0c00a7; public static final int Platform_V25_AppCompat = 0x7f0c00a8; public static final int Platform_V25_AppCompat_Light = 0x7f0c00a9; public static final int Platform_Widget_AppCompat_Spinner = 0x7f0c00aa; public static final int RtlOverlay_DialogWindowTitle_AppCompat = 0x7f0c00ab; public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 0x7f0c00ac; public static final int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 0x7f0c00ad; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem = 0x7f0c00ae; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 0x7f0c00af; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Shortcut = 0x7f0c00b0; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_SubmenuArrow = 0x7f0c00b1; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 0x7f0c00b2; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Title = 0x7f0c00b3; public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 0x7f0c00b9; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown = 0x7f0c00b4; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 0x7f0c00b5; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 0x7f0c00b6; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 0x7f0c00b7; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 0x7f0c00b8; public static final int RtlUnderlay_Widget_AppCompat_ActionButton = 0x7f0c00ba; public static final int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 0x7f0c00bb; public static final int TextAppearance_AppCompat = 0x7f0c00bc; public static final int TextAppearance_AppCompat_Body1 = 0x7f0c00bd; public static final int TextAppearance_AppCompat_Body2 = 0x7f0c00be; public static final int TextAppearance_AppCompat_Button = 0x7f0c00bf; public static final int TextAppearance_AppCompat_Caption = 0x7f0c00c0; public static final int TextAppearance_AppCompat_Display1 = 0x7f0c00c1; public static final int TextAppearance_AppCompat_Display2 = 0x7f0c00c2; public static final int TextAppearance_AppCompat_Display3 = 0x7f0c00c3; public static final int TextAppearance_AppCompat_Display4 = 0x7f0c00c4; public static final int TextAppearance_AppCompat_Headline = 0x7f0c00c5; public static final int TextAppearance_AppCompat_Inverse = 0x7f0c00c6; public static final int TextAppearance_AppCompat_Large = 0x7f0c00c7; public static final int TextAppearance_AppCompat_Large_Inverse = 0x7f0c00c8; public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 0x7f0c00c9; public static final int TextAppearance_AppCompat_Light_SearchResult_Title = 0x7f0c00ca; public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0c00cb; public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0c00cc; public static final int TextAppearance_AppCompat_Medium = 0x7f0c00cd; public static final int TextAppearance_AppCompat_Medium_Inverse = 0x7f0c00ce; public static final int TextAppearance_AppCompat_Menu = 0x7f0c00cf; public static final int TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0c00d0; public static final int TextAppearance_AppCompat_SearchResult_Title = 0x7f0c00d1; public static final int TextAppearance_AppCompat_Small = 0x7f0c00d2; public static final int TextAppearance_AppCompat_Small_Inverse = 0x7f0c00d3; public static final int TextAppearance_AppCompat_Subhead = 0x7f0c00d4; public static final int TextAppearance_AppCompat_Subhead_Inverse = 0x7f0c00d5; public static final int TextAppearance_AppCompat_Title = 0x7f0c00d6; public static final int TextAppearance_AppCompat_Title_Inverse = 0x7f0c00d7; public static final int TextAppearance_AppCompat_Tooltip = 0x7f0c00d8; public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0c00d9; public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0c00da; public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0c00db; public static final int TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0c00dc; public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0c00dd; public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0c00de; public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 0x7f0c00df; public static final int TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0c00e0; public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 0x7f0c00e1; public static final int TextAppearance_AppCompat_Widget_Button = 0x7f0c00e2; public static final int TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 0x7f0c00e3; public static final int TextAppearance_AppCompat_Widget_Button_Colored = 0x7f0c00e4; public static final int TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f0c00e5; public static final int TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0c00e6; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Header = 0x7f0c00e7; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0c00e8; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0c00e9; public static final int TextAppearance_AppCompat_Widget_Switch = 0x7f0c00ea; public static final int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0c00eb; public static final int TextAppearance_Compat_Notification = 0x7f0c00ec; public static final int TextAppearance_Compat_Notification_Info = 0x7f0c00ed; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c00ee; public static final int TextAppearance_Compat_Notification_Time = 0x7f0c00ef; public static final int TextAppearance_Compat_Notification_Title = 0x7f0c00f0; public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0c00f1; public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0c00f2; public static final int TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0c00f3; public static final int ThemeOverlay_AppCompat = 0x7f0c0109; public static final int ThemeOverlay_AppCompat_ActionBar = 0x7f0c010a; public static final int ThemeOverlay_AppCompat_Dark = 0x7f0c010b; public static final int ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0c010c; public static final int ThemeOverlay_AppCompat_Dialog = 0x7f0c010d; public static final int ThemeOverlay_AppCompat_Dialog_Alert = 0x7f0c010e; public static final int ThemeOverlay_AppCompat_Light = 0x7f0c010f; public static final int Theme_AppCompat = 0x7f0c00f4; public static final int Theme_AppCompat_CompactMenu = 0x7f0c00f5; public static final int Theme_AppCompat_DayNight = 0x7f0c00f6; public static final int Theme_AppCompat_DayNight_DarkActionBar = 0x7f0c00f7; public static final int Theme_AppCompat_DayNight_Dialog = 0x7f0c00f8; public static final int Theme_AppCompat_DayNight_DialogWhenLarge = 0x7f0c00fb; public static final int Theme_AppCompat_DayNight_Dialog_Alert = 0x7f0c00f9; public static final int Theme_AppCompat_DayNight_Dialog_MinWidth = 0x7f0c00fa; public static final int Theme_AppCompat_DayNight_NoActionBar = 0x7f0c00fc; public static final int Theme_AppCompat_Dialog = 0x7f0c00fd; public static final int Theme_AppCompat_DialogWhenLarge = 0x7f0c0100; public static final int Theme_AppCompat_Dialog_Alert = 0x7f0c00fe; public static final int Theme_AppCompat_Dialog_MinWidth = 0x7f0c00ff; public static final int Theme_AppCompat_Light = 0x7f0c0101; public static final int Theme_AppCompat_Light_DarkActionBar = 0x7f0c0102; public static final int Theme_AppCompat_Light_Dialog = 0x7f0c0103; public static final int Theme_AppCompat_Light_DialogWhenLarge = 0x7f0c0106; public static final int Theme_AppCompat_Light_Dialog_Alert = 0x7f0c0104; public static final int Theme_AppCompat_Light_Dialog_MinWidth = 0x7f0c0105; public static final int Theme_AppCompat_Light_NoActionBar = 0x7f0c0107; public static final int Theme_AppCompat_NoActionBar = 0x7f0c0108; public static final int Widget_AppCompat_ActionBar = 0x7f0c0110; public static final int Widget_AppCompat_ActionBar_Solid = 0x7f0c0111; public static final int Widget_AppCompat_ActionBar_TabBar = 0x7f0c0112; public static final int Widget_AppCompat_ActionBar_TabText = 0x7f0c0113; public static final int Widget_AppCompat_ActionBar_TabView = 0x7f0c0114; public static final int Widget_AppCompat_ActionButton = 0x7f0c0115; public static final int Widget_AppCompat_ActionButton_CloseMode = 0x7f0c0116; public static final int Widget_AppCompat_ActionButton_Overflow = 0x7f0c0117; public static final int Widget_AppCompat_ActionMode = 0x7f0c0118; public static final int Widget_AppCompat_ActivityChooserView = 0x7f0c0119; public static final int Widget_AppCompat_AutoCompleteTextView = 0x7f0c011a; public static final int Widget_AppCompat_Button = 0x7f0c011b; public static final int Widget_AppCompat_ButtonBar = 0x7f0c0121; public static final int Widget_AppCompat_ButtonBar_AlertDialog = 0x7f0c0122; public static final int Widget_AppCompat_Button_Borderless = 0x7f0c011c; public static final int Widget_AppCompat_Button_Borderless_Colored = 0x7f0c011d; public static final int Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f0c011e; public static final int Widget_AppCompat_Button_Colored = 0x7f0c011f; public static final int Widget_AppCompat_Button_Small = 0x7f0c0120; public static final int Widget_AppCompat_CompoundButton_CheckBox = 0x7f0c0123; public static final int Widget_AppCompat_CompoundButton_RadioButton = 0x7f0c0124; public static final int Widget_AppCompat_CompoundButton_Switch = 0x7f0c0125; public static final int Widget_AppCompat_DrawerArrowToggle = 0x7f0c0126; public static final int Widget_AppCompat_DropDownItem_Spinner = 0x7f0c0127; public static final int Widget_AppCompat_EditText = 0x7f0c0128; public static final int Widget_AppCompat_ImageButton = 0x7f0c0129; public static final int Widget_AppCompat_Light_ActionBar = 0x7f0c012a; public static final int Widget_AppCompat_Light_ActionBar_Solid = 0x7f0c012b; public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 0x7f0c012c; public static final int Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0c012d; public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 0x7f0c012e; public static final int Widget_AppCompat_Light_ActionBar_TabText = 0x7f0c012f; public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f0c0130; public static final int Widget_AppCompat_Light_ActionBar_TabView = 0x7f0c0131; public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 0x7f0c0132; public static final int Widget_AppCompat_Light_ActionButton = 0x7f0c0133; public static final int Widget_AppCompat_Light_ActionButton_CloseMode = 0x7f0c0134; public static final int Widget_AppCompat_Light_ActionButton_Overflow = 0x7f0c0135; public static final int Widget_AppCompat_Light_ActionMode_Inverse = 0x7f0c0136; public static final int Widget_AppCompat_Light_ActivityChooserView = 0x7f0c0137; public static final int Widget_AppCompat_Light_AutoCompleteTextView = 0x7f0c0138; public static final int Widget_AppCompat_Light_DropDownItem_Spinner = 0x7f0c0139; public static final int Widget_AppCompat_Light_ListPopupWindow = 0x7f0c013a; public static final int Widget_AppCompat_Light_ListView_DropDown = 0x7f0c013b; public static final int Widget_AppCompat_Light_PopupMenu = 0x7f0c013c; public static final int Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f0c013d; public static final int Widget_AppCompat_Light_SearchView = 0x7f0c013e; public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 0x7f0c013f; public static final int Widget_AppCompat_ListMenuView = 0x7f0c0140; public static final int Widget_AppCompat_ListPopupWindow = 0x7f0c0141; public static final int Widget_AppCompat_ListView = 0x7f0c0142; public static final int Widget_AppCompat_ListView_DropDown = 0x7f0c0143; public static final int Widget_AppCompat_ListView_Menu = 0x7f0c0144; public static final int Widget_AppCompat_PopupMenu = 0x7f0c0145; public static final int Widget_AppCompat_PopupMenu_Overflow = 0x7f0c0146; public static final int Widget_AppCompat_PopupWindow = 0x7f0c0147; public static final int Widget_AppCompat_ProgressBar = 0x7f0c0148; public static final int Widget_AppCompat_ProgressBar_Horizontal = 0x7f0c0149; public static final int Widget_AppCompat_RatingBar = 0x7f0c014a; public static final int Widget_AppCompat_RatingBar_Indicator = 0x7f0c014b; public static final int Widget_AppCompat_RatingBar_Small = 0x7f0c014c; public static final int Widget_AppCompat_SearchView = 0x7f0c014d; public static final int Widget_AppCompat_SearchView_ActionBar = 0x7f0c014e; public static final int Widget_AppCompat_SeekBar = 0x7f0c014f; public static final int Widget_AppCompat_SeekBar_Discrete = 0x7f0c0150; public static final int Widget_AppCompat_Spinner = 0x7f0c0151; public static final int Widget_AppCompat_Spinner_DropDown = 0x7f0c0152; public static final int Widget_AppCompat_Spinner_DropDown_ActionBar = 0x7f0c0153; public static final int Widget_AppCompat_Spinner_Underlined = 0x7f0c0154; public static final int Widget_AppCompat_TextView_SpinnerItem = 0x7f0c0155; public static final int Widget_AppCompat_Toolbar = 0x7f0c0156; public static final int Widget_AppCompat_Toolbar_Button_Navigation = 0x7f0c0157; public static final int Widget_Compat_NotificationActionContainer = 0x7f0c0158; public static final int Widget_Compat_NotificationActionText = 0x7f0c0159; public static final int Widget_Support_CoordinatorLayout = 0x7f0c015a; } public static final class styleable { private styleable() {} public static final int[] ActionBar = { 0x7f020031, 0x7f020032, 0x7f020033, 0x7f02005d, 0x7f02005e, 0x7f02005f, 0x7f020060, 0x7f020061, 0x7f020062, 0x7f020065, 0x7f02006a, 0x7f02006b, 0x7f020076, 0x7f020087, 0x7f020088, 0x7f020089, 0x7f02008a, 0x7f02008b, 0x7f020090, 0x7f020093, 0x7f0200db, 0x7f0200e2, 0x7f0200ed, 0x7f0200f0, 0x7f0200f1, 0x7f02010c, 0x7f02010f, 0x7f02012a, 0x7f020133 }; public static final int ActionBar_background = 0; public static final int ActionBar_backgroundSplit = 1; public static final int ActionBar_backgroundStacked = 2; public static final int ActionBar_contentInsetEnd = 3; public static final int ActionBar_contentInsetEndWithActions = 4; public static final int ActionBar_contentInsetLeft = 5; public static final int ActionBar_contentInsetRight = 6; public static final int ActionBar_contentInsetStart = 7; public static final int ActionBar_contentInsetStartWithNavigation = 8; public static final int ActionBar_customNavigationLayout = 9; public static final int ActionBar_displayOptions = 10; public static final int ActionBar_divider = 11; public static final int ActionBar_elevation = 12; public static final int ActionBar_height = 13; public static final int ActionBar_hideOnContentScroll = 14; public static final int ActionBar_homeAsUpIndicator = 15; public static final int ActionBar_homeLayout = 16; public static final int ActionBar_icon = 17; public static final int ActionBar_indeterminateProgressStyle = 18; public static final int ActionBar_itemPadding = 19; public static final int ActionBar_logo = 20; public static final int ActionBar_navigationMode = 21; public static final int ActionBar_popupTheme = 22; public static final int ActionBar_progressBarPadding = 23; public static final int ActionBar_progressBarStyle = 24; public static final int ActionBar_subtitle = 25; public static final int ActionBar_subtitleTextStyle = 26; public static final int ActionBar_title = 27; public static final int ActionBar_titleTextStyle = 28; public static final int[] ActionBarLayout = { 0x10100b3 }; public static final int ActionBarLayout_android_layout_gravity = 0; public static final int[] ActionMenuItemView = { 0x101013f }; public static final int ActionMenuItemView_android_minWidth = 0; public static final int[] ActionMenuView = { }; public static final int[] ActionMode = { 0x7f020031, 0x7f020032, 0x7f02004a, 0x7f020087, 0x7f02010f, 0x7f020133 }; public static final int ActionMode_background = 0; public static final int ActionMode_backgroundSplit = 1; public static final int ActionMode_closeItemLayout = 2; public static final int ActionMode_height = 3; public static final int ActionMode_subtitleTextStyle = 4; public static final int ActionMode_titleTextStyle = 5; public static final int[] ActivityChooserView = { 0x7f020078, 0x7f020091 }; public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 0; public static final int ActivityChooserView_initialActivityCount = 1; public static final int[] AlertDialog = { 0x10100f2, 0x7f020040, 0x7f020041, 0x7f0200d2, 0x7f0200d3, 0x7f0200df, 0x7f020101, 0x7f020102 }; public static final int AlertDialog_android_layout = 0; public static final int AlertDialog_buttonIconDimen = 1; public static final int AlertDialog_buttonPanelSideLayout = 2; public static final int AlertDialog_listItemLayout = 3; public static final int AlertDialog_listLayout = 4; public static final int AlertDialog_multiChoiceItemLayout = 5; public static final int AlertDialog_showTitle = 6; public static final int AlertDialog_singleChoiceItemLayout = 7; public static final int[] AnimatedStateListDrawableCompat = { 0x101011c, 0x1010194, 0x1010195, 0x1010196, 0x101030c, 0x101030d }; public static final int AnimatedStateListDrawableCompat_android_dither = 0; public static final int AnimatedStateListDrawableCompat_android_visible = 1; public static final int AnimatedStateListDrawableCompat_android_variablePadding = 2; public static final int AnimatedStateListDrawableCompat_android_constantSize = 3; public static final int AnimatedStateListDrawableCompat_android_enterFadeDuration = 4; public static final int AnimatedStateListDrawableCompat_android_exitFadeDuration = 5; public static final int[] AnimatedStateListDrawableItem = { 0x10100d0, 0x1010199 }; public static final int AnimatedStateListDrawableItem_android_id = 0; public static final int AnimatedStateListDrawableItem_android_drawable = 1; public static final int[] AnimatedStateListDrawableTransition = { 0x1010199, 0x1010449, 0x101044a, 0x101044b }; public static final int AnimatedStateListDrawableTransition_android_drawable = 0; public static final int AnimatedStateListDrawableTransition_android_toId = 1; public static final int AnimatedStateListDrawableTransition_android_fromId = 2; public static final int AnimatedStateListDrawableTransition_android_reversible = 3; public static final int[] AppCompatImageView = { 0x1010119, 0x7f020107, 0x7f020128, 0x7f020129 }; public static final int AppCompatImageView_android_src = 0; public static final int AppCompatImageView_srcCompat = 1; public static final int AppCompatImageView_tint = 2; public static final int AppCompatImageView_tintMode = 3; public static final int[] AppCompatSeekBar = { 0x1010142, 0x7f020125, 0x7f020126, 0x7f020127 }; public static final int AppCompatSeekBar_android_thumb = 0; public static final int AppCompatSeekBar_tickMark = 1; public static final int AppCompatSeekBar_tickMarkTint = 2; public static final int AppCompatSeekBar_tickMarkTintMode = 3; public static final int[] AppCompatTextHelper = { 0x1010034, 0x101016d, 0x101016e, 0x101016f, 0x1010170, 0x1010392, 0x1010393 }; public static final int AppCompatTextHelper_android_textAppearance = 0; public static final int AppCompatTextHelper_android_drawableTop = 1; public static final int AppCompatTextHelper_android_drawableBottom = 2; public static final int AppCompatTextHelper_android_drawableLeft = 3; public static final int AppCompatTextHelper_android_drawableRight = 4; public static final int AppCompatTextHelper_android_drawableStart = 5; public static final int AppCompatTextHelper_android_drawableEnd = 6; public static final int[] AppCompatTextView = { 0x1010034, 0x7f02002c, 0x7f02002d, 0x7f02002e, 0x7f02002f, 0x7f020030, 0x7f020079, 0x7f02007b, 0x7f020095, 0x7f0200cf, 0x7f020115 }; public static final int AppCompatTextView_android_textAppearance = 0; public static final int AppCompatTextView_autoSizeMaxTextSize = 1; public static final int AppCompatTextView_autoSizeMinTextSize = 2; public static final int AppCompatTextView_autoSizePresetSizes = 3; public static final int AppCompatTextView_autoSizeStepGranularity = 4; public static final int AppCompatTextView_autoSizeTextType = 5; public static final int AppCompatTextView_firstBaselineToTopHeight = 6; public static final int AppCompatTextView_fontFamily = 7; public static final int AppCompatTextView_lastBaselineToBottomHeight = 8; public static final int AppCompatTextView_lineHeight = 9; public static final int AppCompatTextView_textAllCaps = 10; public static final int[] AppCompatTheme = { 0x1010057, 0x10100ae, 0x7f020000, 0x7f020001, 0x7f020002, 0x7f020003, 0x7f020004, 0x7f020005, 0x7f020006, 0x7f020007, 0x7f020008, 0x7f020009, 0x7f02000a, 0x7f02000b, 0x7f02000c, 0x7f02000e, 0x7f02000f, 0x7f020010, 0x7f020011, 0x7f020012, 0x7f020013, 0x7f020014, 0x7f020015, 0x7f020016, 0x7f020017, 0x7f020018, 0x7f020019, 0x7f02001a, 0x7f02001b, 0x7f02001c, 0x7f02001d, 0x7f02001e, 0x7f020021, 0x7f020022, 0x7f020023, 0x7f020024, 0x7f020025, 0x7f02002b, 0x7f020039, 0x7f02003a, 0x7f02003b, 0x7f02003c, 0x7f02003d, 0x7f02003e, 0x7f020042, 0x7f020043, 0x7f020047, 0x7f020048, 0x7f02004e, 0x7f02004f, 0x7f020050, 0x7f020051, 0x7f020052, 0x7f020053, 0x7f020054, 0x7f020055, 0x7f020056, 0x7f020057, 0x7f020063, 0x7f020067, 0x7f020068, 0x7f020069, 0x7f02006c, 0x7f02006e, 0x7f020071, 0x7f020072, 0x7f020073, 0x7f020074, 0x7f020075, 0x7f020089, 0x7f02008f, 0x7f0200d0, 0x7f0200d1, 0x7f0200d4, 0x7f0200d5, 0x7f0200d6, 0x7f0200d7, 0x7f0200d8, 0x7f0200d9, 0x7f0200da, 0x7f0200e9, 0x7f0200ea, 0x7f0200eb, 0x7f0200ec, 0x7f0200ee, 0x7f0200f4, 0x7f0200f5, 0x7f0200f6, 0x7f0200f7, 0x7f0200fa, 0x7f0200fb, 0x7f0200fc, 0x7f0200fd, 0x7f020104, 0x7f020105, 0x7f020113, 0x7f020116, 0x7f020117, 0x7f020118, 0x7f020119, 0x7f02011a, 0x7f02011b, 0x7f02011c, 0x7f02011d, 0x7f02011e, 0x7f02011f, 0x7f020134, 0x7f020135, 0x7f020136, 0x7f020137, 0x7f02013d, 0x7f02013f, 0x7f020140, 0x7f020141, 0x7f020142, 0x7f020143, 0x7f020144, 0x7f020145, 0x7f020146, 0x7f020147, 0x7f020148 }; public static final int AppCompatTheme_android_windowIsFloating = 0; public static final int AppCompatTheme_android_windowAnimationStyle = 1; public static final int AppCompatTheme_actionBarDivider = 2; public static final int AppCompatTheme_actionBarItemBackground = 3; public static final int AppCompatTheme_actionBarPopupTheme = 4; public static final int AppCompatTheme_actionBarSize = 5; public static final int AppCompatTheme_actionBarSplitStyle = 6; public static final int AppCompatTheme_actionBarStyle = 7; public static final int AppCompatTheme_actionBarTabBarStyle = 8; public static final int AppCompatTheme_actionBarTabStyle = 9; public static final int AppCompatTheme_actionBarTabTextStyle = 10; public static final int AppCompatTheme_actionBarTheme = 11; public static final int AppCompatTheme_actionBarWidgetTheme = 12; public static final int AppCompatTheme_actionButtonStyle = 13; public static final int AppCompatTheme_actionDropDownStyle = 14; public static final int AppCompatTheme_actionMenuTextAppearance = 15; public static final int AppCompatTheme_actionMenuTextColor = 16; public static final int AppCompatTheme_actionModeBackground = 17; public static final int AppCompatTheme_actionModeCloseButtonStyle = 18; public static final int AppCompatTheme_actionModeCloseDrawable = 19; public static final int AppCompatTheme_actionModeCopyDrawable = 20; public static final int AppCompatTheme_actionModeCutDrawable = 21; public static final int AppCompatTheme_actionModeFindDrawable = 22; public static final int AppCompatTheme_actionModePasteDrawable = 23; public static final int AppCompatTheme_actionModePopupWindowStyle = 24; public static final int AppCompatTheme_actionModeSelectAllDrawable = 25; public static final int AppCompatTheme_actionModeShareDrawable = 26; public static final int AppCompatTheme_actionModeSplitBackground = 27; public static final int AppCompatTheme_actionModeStyle = 28; public static final int AppCompatTheme_actionModeWebSearchDrawable = 29; public static final int AppCompatTheme_actionOverflowButtonStyle = 30; public static final int AppCompatTheme_actionOverflowMenuStyle = 31; public static final int AppCompatTheme_activityChooserViewStyle = 32; public static final int AppCompatTheme_alertDialogButtonGroupStyle = 33; public static final int AppCompatTheme_alertDialogCenterButtons = 34; public static final int AppCompatTheme_alertDialogStyle = 35; public static final int AppCompatTheme_alertDialogTheme = 36; public static final int AppCompatTheme_autoCompleteTextViewStyle = 37; public static final int AppCompatTheme_borderlessButtonStyle = 38; public static final int AppCompatTheme_buttonBarButtonStyle = 39; public static final int AppCompatTheme_buttonBarNegativeButtonStyle = 40; public static final int AppCompatTheme_buttonBarNeutralButtonStyle = 41; public static final int AppCompatTheme_buttonBarPositiveButtonStyle = 42; public static final int AppCompatTheme_buttonBarStyle = 43; public static final int AppCompatTheme_buttonStyle = 44; public static final int AppCompatTheme_buttonStyleSmall = 45; public static final int AppCompatTheme_checkboxStyle = 46; public static final int AppCompatTheme_checkedTextViewStyle = 47; public static final int AppCompatTheme_colorAccent = 48; public static final int AppCompatTheme_colorBackgroundFloating = 49; public static final int AppCompatTheme_colorButtonNormal = 50; public static final int AppCompatTheme_colorControlActivated = 51; public static final int AppCompatTheme_colorControlHighlight = 52; public static final int AppCompatTheme_colorControlNormal = 53; public static final int AppCompatTheme_colorError = 54; public static final int AppCompatTheme_colorPrimary = 55; public static final int AppCompatTheme_colorPrimaryDark = 56; public static final int AppCompatTheme_colorSwitchThumbNormal = 57; public static final int AppCompatTheme_controlBackground = 58; public static final int AppCompatTheme_dialogCornerRadius = 59; public static final int AppCompatTheme_dialogPreferredPadding = 60; public static final int AppCompatTheme_dialogTheme = 61; public static final int AppCompatTheme_dividerHorizontal = 62; public static final int AppCompatTheme_dividerVertical = 63; public static final int AppCompatTheme_dropDownListViewStyle = 64; public static final int AppCompatTheme_dropdownListPreferredItemHeight = 65; public static final int AppCompatTheme_editTextBackground = 66; public static final int AppCompatTheme_editTextColor = 67; public static final int AppCompatTheme_editTextStyle = 68; public static final int AppCompatTheme_homeAsUpIndicator = 69; public static final int AppCompatTheme_imageButtonStyle = 70; public static final int AppCompatTheme_listChoiceBackgroundIndicator = 71; public static final int AppCompatTheme_listDividerAlertDialog = 72; public static final int AppCompatTheme_listMenuViewStyle = 73; public static final int AppCompatTheme_listPopupWindowStyle = 74; public static final int AppCompatTheme_listPreferredItemHeight = 75; public static final int AppCompatTheme_listPreferredItemHeightLarge = 76; public static final int AppCompatTheme_listPreferredItemHeightSmall = 77; public static final int AppCompatTheme_listPreferredItemPaddingLeft = 78; public static final int AppCompatTheme_listPreferredItemPaddingRight = 79; public static final int AppCompatTheme_panelBackground = 80; public static final int AppCompatTheme_panelMenuListTheme = 81; public static final int AppCompatTheme_panelMenuListWidth = 82; public static final int AppCompatTheme_popupMenuStyle = 83; public static final int AppCompatTheme_popupWindowStyle = 84; public static final int AppCompatTheme_radioButtonStyle = 85; public static final int AppCompatTheme_ratingBarStyle = 86; public static final int AppCompatTheme_ratingBarStyleIndicator = 87; public static final int AppCompatTheme_ratingBarStyleSmall = 88; public static final int AppCompatTheme_searchViewStyle = 89; public static final int AppCompatTheme_seekBarStyle = 90; public static final int AppCompatTheme_selectableItemBackground = 91; public static final int AppCompatTheme_selectableItemBackgroundBorderless = 92; public static final int AppCompatTheme_spinnerDropDownItemStyle = 93; public static final int AppCompatTheme_spinnerStyle = 94; public static final int AppCompatTheme_switchStyle = 95; public static final int AppCompatTheme_textAppearanceLargePopupMenu = 96; public static final int AppCompatTheme_textAppearanceListItem = 97; public static final int AppCompatTheme_textAppearanceListItemSecondary = 98; public static final int AppCompatTheme_textAppearanceListItemSmall = 99; public static final int AppCompatTheme_textAppearancePopupMenuHeader = 100; public static final int AppCompatTheme_textAppearanceSearchResultSubtitle = 101; public static final int AppCompatTheme_textAppearanceSearchResultTitle = 102; public static final int AppCompatTheme_textAppearanceSmallPopupMenu = 103; public static final int AppCompatTheme_textColorAlertDialogListItem = 104; public static final int AppCompatTheme_textColorSearchUrl = 105; public static final int AppCompatTheme_toolbarNavigationButtonStyle = 106; public static final int AppCompatTheme_toolbarStyle = 107; public static final int AppCompatTheme_tooltipForegroundColor = 108; public static final int AppCompatTheme_tooltipFrameBackground = 109; public static final int AppCompatTheme_viewInflaterClass = 110; public static final int AppCompatTheme_windowActionBar = 111; public static final int AppCompatTheme_windowActionBarOverlay = 112; public static final int AppCompatTheme_windowActionModeOverlay = 113; public static final int AppCompatTheme_windowFixedHeightMajor = 114; public static final int AppCompatTheme_windowFixedHeightMinor = 115; public static final int AppCompatTheme_windowFixedWidthMajor = 116; public static final int AppCompatTheme_windowFixedWidthMinor = 117; public static final int AppCompatTheme_windowMinWidthMajor = 118; public static final int AppCompatTheme_windowMinWidthMinor = 119; public static final int AppCompatTheme_windowNoTitle = 120; public static final int[] ButtonBarLayout = { 0x7f020026 }; public static final int ButtonBarLayout_allowStacking = 0; public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f020027 }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] CompoundButton = { 0x1010107, 0x7f020044, 0x7f020045 }; public static final int CompoundButton_android_button = 0; public static final int CompoundButton_buttonTint = 1; public static final int CompoundButton_buttonTintMode = 2; public static final int[] CoordinatorLayout = { 0x7f020094, 0x7f020109 }; public static final int CoordinatorLayout_keylines = 0; public static final int CoordinatorLayout_statusBarBackground = 1; public static final int[] CoordinatorLayout_Layout = { 0x10100b3, 0x7f020097, 0x7f020098, 0x7f020099, 0x7f0200c3, 0x7f0200cc, 0x7f0200cd }; public static final int CoordinatorLayout_Layout_android_layout_gravity = 0; public static final int CoordinatorLayout_Layout_layout_anchor = 1; public static final int CoordinatorLayout_Layout_layout_anchorGravity = 2; public static final int CoordinatorLayout_Layout_layout_behavior = 3; public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4; public static final int CoordinatorLayout_Layout_layout_insetEdge = 5; public static final int CoordinatorLayout_Layout_layout_keyline = 6; public static final int[] DrawerArrowToggle = { 0x7f020029, 0x7f02002a, 0x7f020036, 0x7f02004d, 0x7f02006f, 0x7f020085, 0x7f020103, 0x7f020121 }; public static final int DrawerArrowToggle_arrowHeadLength = 0; public static final int DrawerArrowToggle_arrowShaftLength = 1; public static final int DrawerArrowToggle_barLength = 2; public static final int DrawerArrowToggle_color = 3; public static final int DrawerArrowToggle_drawableSize = 4; public static final int DrawerArrowToggle_gapBetweenBars = 5; public static final int DrawerArrowToggle_spinBars = 6; public static final int DrawerArrowToggle_thickness = 7; public static final int[] FontFamily = { 0x7f02007c, 0x7f02007d, 0x7f02007e, 0x7f02007f, 0x7f020080, 0x7f020081 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f02007a, 0x7f020082, 0x7f020083, 0x7f020084, 0x7f02013c }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; public static final int[] LinearLayoutCompat = { 0x10100af, 0x10100c4, 0x1010126, 0x1010127, 0x1010128, 0x7f02006b, 0x7f02006d, 0x7f0200de, 0x7f0200ff }; public static final int LinearLayoutCompat_android_gravity = 0; public static final int LinearLayoutCompat_android_orientation = 1; public static final int LinearLayoutCompat_android_baselineAligned = 2; public static final int LinearLayoutCompat_android_baselineAlignedChildIndex = 3; public static final int LinearLayoutCompat_android_weightSum = 4; public static final int LinearLayoutCompat_divider = 5; public static final int LinearLayoutCompat_dividerPadding = 6; public static final int LinearLayoutCompat_measureWithLargestChild = 7; public static final int LinearLayoutCompat_showDividers = 8; public static final int[] LinearLayoutCompat_Layout = { 0x10100b3, 0x10100f4, 0x10100f5, 0x1010181 }; public static final int LinearLayoutCompat_Layout_android_layout_gravity = 0; public static final int LinearLayoutCompat_Layout_android_layout_width = 1; public static final int LinearLayoutCompat_Layout_android_layout_height = 2; public static final int LinearLayoutCompat_Layout_android_layout_weight = 3; public static final int[] ListPopupWindow = { 0x10102ac, 0x10102ad }; public static final int ListPopupWindow_android_dropDownHorizontalOffset = 0; public static final int ListPopupWindow_android_dropDownVerticalOffset = 1; public static final int[] MenuGroup = { 0x101000e, 0x10100d0, 0x1010194, 0x10101de, 0x10101df, 0x10101e0 }; public static final int MenuGroup_android_enabled = 0; public static final int MenuGroup_android_id = 1; public static final int MenuGroup_android_visible = 2; public static final int MenuGroup_android_menuCategory = 3; public static final int MenuGroup_android_orderInCategory = 4; public static final int MenuGroup_android_checkableBehavior = 5; public static final int[] MenuItem = { 0x1010002, 0x101000e, 0x10100d0, 0x1010106, 0x1010194, 0x10101de, 0x10101df, 0x10101e1, 0x10101e2, 0x10101e3, 0x10101e4, 0x10101e5, 0x101026f, 0x7f02000d, 0x7f02001f, 0x7f020020, 0x7f020028, 0x7f02005c, 0x7f02008c, 0x7f02008d, 0x7f0200e3, 0x7f0200fe, 0x7f020138 }; public static final int MenuItem_android_icon = 0; public static final int MenuItem_android_enabled = 1; public static final int MenuItem_android_id = 2; public static final int MenuItem_android_checked = 3; public static final int MenuItem_android_visible = 4; public static final int MenuItem_android_menuCategory = 5; public static final int MenuItem_android_orderInCategory = 6; public static final int MenuItem_android_title = 7; public static final int MenuItem_android_titleCondensed = 8; public static final int MenuItem_android_alphabeticShortcut = 9; public static final int MenuItem_android_numericShortcut = 10; public static final int MenuItem_android_checkable = 11; public static final int MenuItem_android_onClick = 12; public static final int MenuItem_actionLayout = 13; public static final int MenuItem_actionProviderClass = 14; public static final int MenuItem_actionViewClass = 15; public static final int MenuItem_alphabeticModifiers = 16; public static final int MenuItem_contentDescription = 17; public static final int MenuItem_iconTint = 18; public static final int MenuItem_iconTintMode = 19; public static final int MenuItem_numericModifiers = 20; public static final int MenuItem_showAsAction = 21; public static final int MenuItem_tooltipText = 22; public static final int[] MenuView = { 0x10100ae, 0x101012c, 0x101012d, 0x101012e, 0x101012f, 0x1010130, 0x1010131, 0x7f0200ef, 0x7f02010a }; public static final int MenuView_android_windowAnimationStyle = 0; public static final int MenuView_android_itemTextAppearance = 1; public static final int MenuView_android_horizontalDivider = 2; public static final int MenuView_android_verticalDivider = 3; public static final int MenuView_android_headerBackground = 4; public static final int MenuView_android_itemBackground = 5; public static final int MenuView_android_itemIconDisabledAlpha = 6; public static final int MenuView_preserveIconSpacing = 7; public static final int MenuView_subMenuArrow = 8; public static final int[] PopupWindow = { 0x1010176, 0x10102c9, 0x7f0200e4 }; public static final int PopupWindow_android_popupBackground = 0; public static final int PopupWindow_android_popupAnimationStyle = 1; public static final int PopupWindow_overlapAnchor = 2; public static final int[] PopupWindowBackgroundState = { 0x7f020108 }; public static final int PopupWindowBackgroundState_state_above_anchor = 0; public static final int[] RecycleListView = { 0x7f0200e5, 0x7f0200e8 }; public static final int RecycleListView_paddingBottomNoButtons = 0; public static final int RecycleListView_paddingTopNoTitle = 1; public static final int[] SearchView = { 0x10100da, 0x101011f, 0x1010220, 0x1010264, 0x7f020049, 0x7f020058, 0x7f020066, 0x7f020086, 0x7f02008e, 0x7f020096, 0x7f0200f2, 0x7f0200f3, 0x7f0200f8, 0x7f0200f9, 0x7f02010b, 0x7f020110, 0x7f02013e }; public static final int SearchView_android_focusable = 0; public static final int SearchView_android_maxWidth = 1; public static final int SearchView_android_inputType = 2; public static final int SearchView_android_imeOptions = 3; public static final int SearchView_closeIcon = 4; public static final int SearchView_commitIcon = 5; public static final int SearchView_defaultQueryHint = 6; public static final int SearchView_goIcon = 7; public static final int SearchView_iconifiedByDefault = 8; public static final int SearchView_layout = 9; public static final int SearchView_queryBackground = 10; public static final int SearchView_queryHint = 11; public static final int SearchView_searchHintIcon = 12; public static final int SearchView_searchIcon = 13; public static final int SearchView_submitBackground = 14; public static final int SearchView_suggestionRowLayout = 15; public static final int SearchView_voiceIcon = 16; public static final int[] Spinner = { 0x10100b2, 0x1010176, 0x101017b, 0x1010262, 0x7f0200ed }; public static final int Spinner_android_entries = 0; public static final int Spinner_android_popupBackground = 1; public static final int Spinner_android_prompt = 2; public static final int Spinner_android_dropDownWidth = 3; public static final int Spinner_popupTheme = 4; public static final int[] StateListDrawable = { 0x101011c, 0x1010194, 0x1010195, 0x1010196, 0x101030c, 0x101030d }; public static final int StateListDrawable_android_dither = 0; public static final int StateListDrawable_android_visible = 1; public static final int StateListDrawable_android_variablePadding = 2; public static final int StateListDrawable_android_constantSize = 3; public static final int StateListDrawable_android_enterFadeDuration = 4; public static final int StateListDrawable_android_exitFadeDuration = 5; public static final int[] StateListDrawableItem = { 0x1010199 }; public static final int StateListDrawableItem_android_drawable = 0; public static final int[] SwitchCompat = { 0x1010124, 0x1010125, 0x1010142, 0x7f020100, 0x7f020106, 0x7f020111, 0x7f020112, 0x7f020114, 0x7f020122, 0x7f020123, 0x7f020124, 0x7f020139, 0x7f02013a, 0x7f02013b }; public static final int SwitchCompat_android_textOn = 0; public static final int SwitchCompat_android_textOff = 1; public static final int SwitchCompat_android_thumb = 2; public static final int SwitchCompat_showText = 3; public static final int SwitchCompat_splitTrack = 4; public static final int SwitchCompat_switchMinWidth = 5; public static final int SwitchCompat_switchPadding = 6; public static final int SwitchCompat_switchTextAppearance = 7; public static final int SwitchCompat_thumbTextPadding = 8; public static final int SwitchCompat_thumbTint = 9; public static final int SwitchCompat_thumbTintMode = 10; public static final int SwitchCompat_track = 11; public static final int SwitchCompat_trackTint = 12; public static final int SwitchCompat_trackTintMode = 13; public static final int[] TextAppearance = { 0x1010095, 0x1010096, 0x1010097, 0x1010098, 0x101009a, 0x101009b, 0x1010161, 0x1010162, 0x1010163, 0x1010164, 0x10103ac, 0x7f02007b, 0x7f020115 }; public static final int TextAppearance_android_textSize = 0; public static final int TextAppearance_android_typeface = 1; public static final int TextAppearance_android_textStyle = 2; public static final int TextAppearance_android_textColor = 3; public static final int TextAppearance_android_textColorHint = 4; public static final int TextAppearance_android_textColorLink = 5; public static final int TextAppearance_android_shadowColor = 6; public static final int TextAppearance_android_shadowDx = 7; public static final int TextAppearance_android_shadowDy = 8; public static final int TextAppearance_android_shadowRadius = 9; public static final int TextAppearance_android_fontFamily = 10; public static final int TextAppearance_fontFamily = 11; public static final int TextAppearance_textAllCaps = 12; public static final int[] Toolbar = { 0x10100af, 0x1010140, 0x7f02003f, 0x7f02004b, 0x7f02004c, 0x7f02005d, 0x7f02005e, 0x7f02005f, 0x7f020060, 0x7f020061, 0x7f020062, 0x7f0200db, 0x7f0200dc, 0x7f0200dd, 0x7f0200e0, 0x7f0200e1, 0x7f0200ed, 0x7f02010c, 0x7f02010d, 0x7f02010e, 0x7f02012a, 0x7f02012b, 0x7f02012c, 0x7f02012d, 0x7f02012e, 0x7f02012f, 0x7f020130, 0x7f020131, 0x7f020132 }; public static final int Toolbar_android_gravity = 0; public static final int Toolbar_android_minHeight = 1; public static final int Toolbar_buttonGravity = 2; public static final int Toolbar_collapseContentDescription = 3; public static final int Toolbar_collapseIcon = 4; public static final int Toolbar_contentInsetEnd = 5; public static final int Toolbar_contentInsetEndWithActions = 6; public static final int Toolbar_contentInsetLeft = 7; public static final int Toolbar_contentInsetRight = 8; public static final int Toolbar_contentInsetStart = 9; public static final int Toolbar_contentInsetStartWithNavigation = 10; public static final int Toolbar_logo = 11; public static final int Toolbar_logoDescription = 12; public static final int Toolbar_maxButtonHeight = 13; public static final int Toolbar_navigationContentDescription = 14; public static final int Toolbar_navigationIcon = 15; public static final int Toolbar_popupTheme = 16; public static final int Toolbar_subtitle = 17; public static final int Toolbar_subtitleTextAppearance = 18; public static final int Toolbar_subtitleTextColor = 19; public static final int Toolbar_title = 20; public static final int Toolbar_titleMargin = 21; public static final int Toolbar_titleMarginBottom = 22; public static final int Toolbar_titleMarginEnd = 23; public static final int Toolbar_titleMarginStart = 24; public static final int Toolbar_titleMarginTop = 25; public static final int Toolbar_titleMargins = 26; public static final int Toolbar_titleTextAppearance = 27; public static final int Toolbar_titleTextColor = 28; public static final int[] View = { 0x1010000, 0x10100da, 0x7f0200e6, 0x7f0200e7, 0x7f020120 }; public static final int View_android_theme = 0; public static final int View_android_focusable = 1; public static final int View_paddingEnd = 2; public static final int View_paddingStart = 3; public static final int View_theme = 4; public static final int[] ViewBackgroundHelper = { 0x10100d4, 0x7f020034, 0x7f020035 }; public static final int ViewBackgroundHelper_android_background = 0; public static final int ViewBackgroundHelper_backgroundTint = 1; public static final int ViewBackgroundHelper_backgroundTintMode = 2; public static final int[] ViewStubCompat = { 0x10100d0, 0x10100f2, 0x10100f3 }; public static final int ViewStubCompat_android_id = 0; public static final int ViewStubCompat_android_layout = 1; public static final int ViewStubCompat_android_inflatedId = 2; } }
[ "saiteja.groovey@gmail.com" ]
saiteja.groovey@gmail.com
e75bed6072ea78b91eae3befea6f03ce20586ea4
41bac86d728e5f900e3d60b5a384e7f00c966f5b
/communote/api/src/main/java/com/communote/server/model/config/LdapGroupSyncConfigurationImpl.java
f48a5d247ad2c9fbd5d166767aeb2cf9516fe91f
[ "Apache-2.0" ]
permissive
Communote/communote-server
f6698853aa382a53d43513ecc9f7f2c39f527724
e6a3541054baa7ad26a4eccbbdd7fb8937dead0c
refs/heads/master
2021-01-20T19:13:11.466831
2019-02-02T18:29:16
2019-02-02T18:29:16
61,822,650
27
4
Apache-2.0
2018-12-08T19:19:06
2016-06-23T17:06:40
Java
UTF-8
Java
false
false
501
java
package com.communote.server.model.config; /** * @see com.communote.server.model.config.LdapGroupSyncConfiguration * * @author Communote GmbH - <a href="http://www.communote.com/">http://www.communote.com/</a> */ public class LdapGroupSyncConfigurationImpl extends com.communote.server.model.config.LdapGroupSyncConfiguration { /** * The serial version UID of this class. Needed for serialization. */ private static final long serialVersionUID = 7361115550846186836L; }
[ "ronny.winkler@communote.com" ]
ronny.winkler@communote.com
10ba5e1faf66056195661ec88801d5d1acdac27c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_9aee8eddc61a354423dbca31977f03aa14c4735f/HRMID/16_9aee8eddc61a354423dbca31977f03aa14c4735f_HRMID_t.java
30b5cf41679c322e1e63094ca5dcffd4f3c4c5f4
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,343
java
/******************************************************************************* * Forwarding on Gates Simulator/Emulator - Hierarchical Routing Management * Copyright (c) 2012, Integrated Communication Systems Group, TU Ilmenau. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html. ******************************************************************************/ package de.tuilmenau.ics.fog.routing.naming.hierarchical; import java.math.BigInteger; import de.tuilmenau.ics.fog.facade.Namespace; import de.tuilmenau.ics.fog.routing.hierarchical.HRMConfig; import de.tuilmenau.ics.fog.routing.hierarchical.management.HierarchyLevel; /** * This class is used to identify a node in the HRM graph. * * An HRMID can identify: * 1.) a physical node, e.g., "1.1.5" * 2.) a coordinator or a cluster as a whole, e.g., "1.1.0" * */ public class HRMID extends HRMName implements Comparable<HRMID> { private static final long serialVersionUID = -8441496024628988477L; public static Namespace HRMNamespace = new Namespace("HRM", false); /** * Create an HRMID instance based on a BigInteger value. * * @param pAddress the BigInteger value which is used for HRMID address generation. */ private HRMID(BigInteger pAddress) { super(pAddress); } /** * Create an HRMID instance based on a long value. * * @param pAddress the long value which used for HRMID address generation. */ public HRMID(long pAddress) { super(BigInteger.valueOf(pAddress)); } /** * Factory function: create an HRMID for broadcasts. * * @return the new HRMID for broadcasts */ public static HRMID createBroadcast() { return new HRMID(HRMConfig.Addressing.BROADCAST_ADDRESS); } /** * Determine the address part at a specific hierarchical level. * * @param pHierarchyLevel the hierarchy level * * @return the determined address of the specified hierarchical level */ private BigInteger getLevelAddress(int pHierarchyLevel) { return (mAddress.mod((BigInteger.valueOf(2)).pow(HRMConfig.Hierarchy.USED_BITS_PER_LEVEL * (pHierarchyLevel + 1))).shiftRight((HRMConfig.Hierarchy.USED_BITS_PER_LEVEL * (pHierarchyLevel)))); } /** * Set the address part for a specific hierarchy level. * * @param pHierarchyLevel the hierarchy level * @param pAddress the address part for the given hierarchy level */ public void setLevelAddress(HierarchyLevel pHierarchyLevel, BigInteger pAddress) { int tLevel = pHierarchyLevel.getValue(); BigInteger tLevelAddr = getLevelAddress(tLevel); if(pHierarchyLevel.isHigherLevel()) { // higher hierarchy level if(!tLevelAddr.equals(BigInteger.valueOf(0))) { mAddress = mAddress.subtract(mAddress.mod(BigInteger.valueOf((tLevel + 1) * HRMConfig.Hierarchy.USED_BITS_PER_LEVEL)).divide(BigInteger.valueOf(tLevel * HRMConfig.Hierarchy.USED_BITS_PER_LEVEL))); } } else {// base hierarchy level if(!tLevelAddr.equals(BigInteger.valueOf(0))) { mAddress = mAddress.subtract(mAddress.mod(BigInteger.valueOf((tLevel + 1) * HRMConfig.Hierarchy.USED_BITS_PER_LEVEL))); } } mAddress = mAddress.add(pAddress.shiftLeft(tLevel * HRMConfig.Hierarchy.USED_BITS_PER_LEVEL)); } /** * Creates an instance clone with the same address. * * @return the cloned object */ public HRMID clone() { // create new instance with the same address HRMID tID = new HRMID(mAddress); return tID; } //TODO @Override public int getSerialisedSize() { return mAddress.bitLength(); } /** * Use this method to find out the descending difference in relation to another address. * * @param pAddressToCompare Provide the address that should be compared to this entity, here. * @return The first occurrence at which a difference was found will be returned. */ //TODO private int getDescendingDifference(HRMID pAddressToCompare) { for(int i = HRMConfig.Hierarchy.HEIGHT; i >= 0; i--) { BigInteger tOtherAddress = pAddressToCompare.getLevelAddress(i); BigInteger tMyAddress = getLevelAddress(i); if(tOtherAddress.equals(tMyAddress)) { /* * Do nothing, just continue */ } else { /* * return value where addresses differ */ return i; } } return -1; } @Override //TODO public int compareTo(HRMID pCompareTo) { return getLevelAddress(pCompareTo.getDescendingDifference(this)).subtract(pCompareTo.getLevelAddress(pCompareTo.getDescendingDifference(this))).intValue(); } @Override public Namespace getNamespace() { return HRMNamespace; } /** * Compares the address value of both class instances and return true if they are equal to each other. * * @return true or false */ @Override public boolean equals(Object pObj) { if(pObj instanceof HRMID) { // compare the addresses by the help of getAddress() return getComplexAddress().equals(((HRMID)pObj).getComplexAddress()); } return false; } /** * Determines if this HRMID has a valid prefix, e.g., "1.3.0" * * @return true or false */ public boolean isZero() { return (mAddress.longValue() == 0); } /** * Determines if this HRMID has a valid prefix, e.g., "1.3.0" * * @return true or false */ public boolean isRelativeAddress() { // true if the first character is a leading zero return toString().startsWith("0"); } /** * Generate an HRMID output, e.g., "4.7.2.3" */ @Override public String toString() { String tOutput = new String(); for(int i = HRMConfig.Hierarchy.HEIGHT - 1; i > 0; i--){ tOutput += (mAddress.mod((BigInteger.valueOf(2)).pow(HRMConfig.Hierarchy.USED_BITS_PER_LEVEL * (i + 1))).shiftRight((HRMConfig.Hierarchy.USED_BITS_PER_LEVEL * i))).toString(); tOutput += "."; } tOutput += (mAddress.mod((BigInteger.valueOf(2)).pow(HRMConfig.Hierarchy.USED_BITS_PER_LEVEL * 1)).shiftRight((HRMConfig.Hierarchy.USED_BITS_PER_LEVEL * 0))).toString(); return tOutput; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1bac399818105d9adeb2a2b7101a242cc319ff00
9766f079195441ba49eec7bfe5c7678c969266c9
/src/main/java/com/qingclass/bigbay/mapper/config/SellPageItemMapper.java
44cd2357ad6c2170af872f935504fef2fae09b58
[]
no_license
denvens/bigbay-payment
bbb9d422227504a09626fa538e19d61a8df0f723
1f94ad6904ac2c850ba99ec238257103258b307a
refs/heads/master
2022-12-19T00:06:48.746361
2020-09-20T04:50:34
2020-09-20T04:50:34
297,003,975
0
0
null
null
null
null
UTF-8
Java
false
false
4,216
java
package com.qingclass.bigbay.mapper.config; import java.util.List; import java.util.Map; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Options; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import org.springframework.stereotype.Component; import com.qingclass.bigbay.entity.config.SellPageItem; import com.qingclass.bigbay.mapper.BigbayCacheableMapper; @Mapper @Component public interface SellPageItemMapper extends BigbayCacheableMapper<SellPageItem> { @Select("SELECT id, sellPageId,sellPageItemConfig, name, itemBody, description, callbackConfig, price,state, updatedAt, createdAt,distributionDiscount,distributionPercentage,toUrl,distributionBlockedDay,distributionDiscountType,distributionDiscountPrice,distributionState,huabeiPaySuccessToUrl,assembleRuleConfig,isGroupBuy FROM sell_page_items a where a.state='1' order by a.id;") public List<SellPageItem> selectAll(); @Select("select * from sell_page_items where id = #{id}") SellPageItem selectByPrimaryKey(@Param("id") long id); @Insert("insert into sell_page_items(" + "huabeiPaySuccessToUrl,isHiddenOnZebra,remark,sellpageid,sellPageItemConfig, name, price," + "distributionDescribe, distributionDiscountType, distributionDiscount, distributionDiscountPrice, distributionPercentage,distributionState, " + "callbackconfig,description,state,tourl,itemBody) " + "values" + "(#{huabeiPaySuccessToUrl},#{isHiddenOnZebra},#{remark},#{sellPageId},#{sellPageItemConfig},#{name}, #{price}, " + "#{distributionDescribe}, #{distributionDiscountType}, #{distributionDiscount}, #{distributionDiscountPrice}, #{distributionPercentage},#{distributionState}," + " #{callbackConfig}, #{description}, #{state}, #{toUrl},#{itemBody})") @Options(useGeneratedKeys = true, keyProperty = "id") int insert(Map<String, Object> map); @Update("update sell_page_items set huabeiPaySuccessToUrl=#{huabeiPaySuccessToUrl},isHiddenOnZebra=#{isHiddenOnZebra}," + "remark=#{remark},sellpageid=#{sellPageId},sellPageItemConfig=#{sellPageItemConfig}, name=#{name}, price=#{price}," + "callbackconfig=#{callbackConfig},description=#{description},state=#{state},tourl=#{toUrl},itemBody=#{itemBody}," + "distributionDescribe=#{distributionDescribe}, distributionDiscountType=#{distributionDiscountType}, " + "distributionDiscount=#{distributionDiscount}, distributionDiscountPrice=#{distributionDiscountPrice}, " + "distributionPercentage=#{distributionPercentage},distributionState=#{distributionState},updatedAt=now() " + "where id=#{id}") int update(Map<String, Object> map); @Select("select a.*,b.state as sellPageState,b.itemname " + "from sell_page_items a,sell_pages b " + "where a.sellpageid=b.id and a.sellpageid=#{sellPageId} " + "order by displayOrder asc,id desc") List<SellPageItem> selectBySellPageId(Long sellPageId); @Select("<script>" + "select a.*,b.state as sellPageState,b.itemname " + "from sell_page_items a,sell_pages b " + "where a.sellpageid=b.id and a.sellpageid=#{sellPageId} " + "order by a.id desc " + "<if test='startRow != null and endRow != null '>" + "limit #{startRow},#{endRow}" + "</if>" + "</script>") List<SellPageItem> selectBySellPageIdWithPage(@Param("sellPageId")Long sellPageId, @Param("startRow")Integer startRow, @Param("endRow")Integer endRow); @Select("<script>" + "select count(1) from sell_page_items where name = #{name}" + "<if test='id != null'>" + "and id != #{id} " + "</if>" + "</script>") int countByName(@Param("name") String name, @Param("id")Long id); /** * @return */ @Select("SELECT id, sellPageId,sellPageItemConfig, name, itemBody, description, callbackConfig, price,state, updatedAt, createdAt,distributionDiscount,distributionPercentage,toUrl,distributionBlockedDay,distributionDiscountType,distributionDiscountPrice,distributionState,huabeiPaySuccessToUrl,assembleRuleConfig,isGroupBuy FROM sell_page_items a where a.state='1' and a.isGroupBuy = 1 order by a.id;") public List<SellPageItem> selectAssembleGoods(); }
[ "ls_suiss@163.com" ]
ls_suiss@163.com
244a89566a93f62546edb02e475af6739b626cd8
66ef83660729980ca40171c591750ff8eb517a3d
/src/main/java/com/jayden/mall/common/Constant.java
b83c0ca88d5f531601768ee3d36a51a6aa979345
[]
no_license
BruceLee12013/mall
b24bab18109fcbd715d9683d88b4f18742d1a957
8838a1f2a3a39c0f2cc089e392ece53e8695bea9
refs/heads/master
2023-01-18T16:46:46.619486
2020-11-11T09:37:49
2020-11-11T09:37:49
311,924,301
0
0
null
null
null
null
UTF-8
Java
false
false
2,215
java
package com.jayden.mall.common; import com.jayden.mall.exception.BusinessException; import com.jayden.mall.exception.BusinessExceptionEnum; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import java.util.Set; /** * 描述: 常量值 */ @Component public class Constant { public static final String MALL_USER = "mall_user"; public static final String SALT = "8svbsvjkweDF,.03["; public static String FILE_UPLOAD_DIR; @Value("${file.upload.dir}") public void setFileUploadDir(String fileUploadDir) { FILE_UPLOAD_DIR = fileUploadDir; } public interface ProductListOrderBy { // Set<String> PRICE_ASC_DESC = Sets.newHashSet("price desc", "price asc"); } public interface SaleStatus { int NOT_SALE = 0;//商品下架状态 int SALE = 1;//商品上架状态 } public interface Cart { int UN_CHECKED = 0;//购物车未选中状态 int CHECKED = 1;//购物车选中状态 } public enum OrderStatusEnum { CANCELED(0, "用户已取消"), NOT_PAID(10, "未付款"), PAID(20, "已付款"), DELIVERED(30, "已发货"), FINISHED(40, "交易完成"); private String value; private int code; OrderStatusEnum(int code, String value) { this.value = value; this.code = code; } public static OrderStatusEnum codeOf(int code) { for (OrderStatusEnum orderStatusEnum : values()) { if (orderStatusEnum.getCode() == code) { return orderStatusEnum; } } throw new BusinessException(BusinessExceptionEnum.NO_ENUM); } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } } public static String ICODE; @Value("${icode}") public void setICODE(String icode) { ICODE = icode; } }
[ "brucelee_123@163.com" ]
brucelee_123@163.com
472b68108dd45f6dc148fb3158b9825513b8b376
aacff33017b788d9ff3647eb53f6f3db84e314de
/code/credit/credit-Web/src/main/java/com/castiel/web/sys/SysParamController.java
8e17448ea596659ac719f304b035ae464c6d5bdb
[]
no_license
lingede/creadit
45f544c1867e4271f8a7129ecab8bc6f0b7339e8
7f974500e0cd0f8dea344c86cb038ad9a11362aa
refs/heads/master
2021-04-09T18:01:23.458376
2018-03-17T06:41:52
2018-03-17T06:41:52
125,601,098
0
0
null
null
null
null
UTF-8
Java
false
false
3,038
java
package com.castiel.web.sys; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.apache.shiro.authz.annotation.RequiresPermissions; import com.castiel.core.base.BaseController; import com.castiel.core.util.Request2ModelUtil; import com.castiel.core.util.WebUtil; import com.castiel.model.generator.SysParam; import com.castiel.service.sys.SysParamService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.github.pagehelper.PageInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; /** * 参数管理 * * @author ShenHuaJie * @version 2016年5月20日 下午3:15:19 */ @RestController @Api(value = "系统参数管理", description = "系统参数管理") @RequestMapping(value = "param", method = RequestMethod.POST) public class SysParamController extends BaseController { @Autowired private SysParamService sysParamService; @ApiOperation(value = "查询系统参数") @RequestMapping(value = "/read/list") @RequiresPermissions("sys.param.read") public Object get(HttpServletRequest request, ModelMap modelMap) { Map<String, Object> params = WebUtil.getParameterMap(request); PageInfo<?> list = sysParamService.query(params); return setSuccessModelMap(modelMap, list); } // 详细信息 @ApiOperation(value = "系统参数详情") @RequiresPermissions("sys.param.read") @RequestMapping(value = "/read/detail") public Object detail(ModelMap modelMap, @RequestParam(value = "id", required = false) String id) { SysParam record = sysParamService.queryById(id); return setSuccessModelMap(modelMap, record); } // 新增 @ApiOperation(value = "添加系统参数") @RequiresPermissions("sys.param.add") @RequestMapping(value = "/add", method = RequestMethod.POST) public Object add(HttpServletRequest request, ModelMap modelMap) { SysParam record = Request2ModelUtil.covert(SysParam.class, request); sysParamService.add(record); return setSuccessModelMap(modelMap); } // 修改 @ApiOperation(value = "修改系统参数") @RequiresPermissions("sys.param.update") @RequestMapping(value = "/update", method = RequestMethod.POST) public Object update(HttpServletRequest request, ModelMap modelMap) { SysParam record = Request2ModelUtil.covert(SysParam.class, request); sysParamService.update(record); return setSuccessModelMap(modelMap); } // 删除 @ApiOperation(value = "删除系统参数") @RequiresPermissions("sys.param.delete") @RequestMapping(value = "/delete", method = RequestMethod.POST) public Object delete(HttpServletRequest request, ModelMap modelMap, @RequestParam(value = "id", required = false) String id) { sysParamService.delete(id); return setSuccessModelMap(modelMap); } }
[ "364649852@qq.com" ]
364649852@qq.com
604f68110c4e763173b08fe32f3b380533933a76
d75c2df89a24fa1eced953b2dfcaa028c359892a
/task1/src/main/java/ru/netology/MainClient.java
f6ca7ed3602aa4a6fd0f8a71312c107164cf8173
[]
no_license
bayurich/core8
cb3040e47f6bc2ea9e8db9b02986ad97b54272dd
0e3ca37a2a89786400d678b93442dc99aab58557
refs/heads/master
2023-08-28T21:19:23.697133
2021-10-31T17:10:19
2021-10-31T17:10:19
423,210,345
0
0
null
null
null
null
UTF-8
Java
false
false
799
java
package ru.netology; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; public class MainClient { public static void main(String[] args) { String host = "127.0.0.1"; int port = 5555; try (Socket clientSocket = new Socket(host, port); PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true); BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()))) { out.println("TASK1\n"); String response = in.readLine(); System.out.println("Response: " + response); } catch (Exception e) { System.out.println("client error while connection: " +e.getMessage()); } } }
[ "beilis@mail.ru" ]
beilis@mail.ru
6daa09588bbfda18a59b03d5a84b7af0e37f63ea
d19ee885d1941c8de7f739210b83fb92b1858cf4
/week05/1.Monday/vatTaxCalc/CountryData.java
8e972d0fb3f0e0da538e4ba1a8c301c77c090f8d
[]
no_license
ronnnito85/Programming101-Java
e1d9ce86d8712ae590f7f76bde8106e95bc8e555
66d352ee38d1a12277e4b69c228336d5c13b0a28
refs/heads/master
2021-01-18T20:54:26.622602
2016-01-18T19:02:14
2016-01-18T19:02:14
49,897,041
0
0
null
2016-01-18T18:41:06
2016-01-18T18:41:05
null
UTF-8
Java
false
false
1,093
java
package monday.vatTaxCalc; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class CountryData { public static void main(String[] args) { //test CountryData d=new CountryData(); d.print(); System.out.println(d.createHashMap()); } List<Country> db; Map<String, Double> map; // Country mCountry; public CountryData() { fill(); } private void fill(){ db=new ArrayList<>(); db.add(new Country("bgn", "Bulgaria", .2, true)); db.add(new Country("uk","United Kingdom", .21, false)); db.add(new Country("aus", "Austria", .19, false)); db.add(new Country("du", "Germany", .18, false)); } public Map <String,Double> createHashMap(){ map=new HashMap<>(); for(Country t:db){ map.put(t.getCountryId(), t.getVATTax()); } return map; } public Country getDefaultCountry(){ CountryData db=new CountryData(); for(Country c:db.db){ if(c.getIsDefault()){ return c; } } return null; } private void print(){ for(Country c:db){ System.out.println(c.toString()); } } }
[ "partsaleva@gmail.com" ]
partsaleva@gmail.com
b5ea8d97073ccb0361b4cad9dd7f424e708ed165
c7d646e11f7547d374d62baba9f80802838adbbb
/Bai69HocOOP_KeThua/src/kieunga/com/model/NhanVienThoiVu.java
a9e0da489b793a330ea6a2a90e1b9e99580dcb27
[]
no_license
KieuNga064/Bai69
6193b56b63fbc66601a4589bb168f8e123c86153
858fdeb7cecfb89f7eb524ed5ee23cfb89c72d3d
refs/heads/master
2021-01-13T23:53:53.775250
2020-02-23T14:49:13
2020-02-23T14:49:13
242,534,241
0
0
null
null
null
null
UTF-8
Java
false
false
318
java
package kieunga.com.model; public class NhanVienThoiVu extends NhanVien{ public NhanVienThoiVu() { super(); } public NhanVienThoiVu(int ma, String ten) { super(ma, ten); } public void tinhLuong() { super.tinhLuong(); System.out.println("==> đây là nhân viên thời vụ."); } }
[ "KieuNga@kieunga-is" ]
KieuNga@kieunga-is
5966a7eedbc6836ac383a4358cde49c2a9c09766
cd8c9f60ecb2a726bf1ebe2737cb7ce36f408dcf
/jar-filter/src/test/resources/annotations/java/net/corda/gradle/jarfilter/DeleteJava.java
9ce70a6cc0dc1705546f500eb0f6347533e4c91b
[ "Apache-2.0" ]
permissive
corda/corda-gradle-plugins
d3c5f6e48c119b4f32a04855f24bea6454c05676
291b698be4ea15ef2b1482406f54a29fe817a57d
refs/heads/master
2023-08-06T07:06:28.676499
2023-07-28T13:27:02
2023-07-28T13:27:02
120,318,601
23
37
NOASSERTION
2023-09-12T09:27:47
2018-02-05T14:52:11
Kotlin
UTF-8
Java
false
false
325
java
package net.corda.gradle.jarfilter; import java.lang.annotation.Retention; import java.lang.annotation.Target; import static java.lang.annotation.ElementType.*; import static java.lang.annotation.RetentionPolicy.*; @Target({TYPE, CONSTRUCTOR, METHOD, FIELD, PACKAGE}) @Retention(RUNTIME) public @interface DeleteJava { }
[ "noreply@github.com" ]
noreply@github.com
7f2b07aea3a14b529ba5249b06bad650ee11e983
fd9e711117aafbdc7e9bff7fa686246ae7c5fa66
/src/AddCourse.java
c51928bd4c4295346c22c181bcae92dc8423f978
[]
no_license
SiddharthKumar02/Student_Diary
96df29a8c2d606aa031bd0941053e9f98e762c37
5438b0359728b134b0e5d77e9b7ddb04c788da0f
refs/heads/master
2021-09-06T02:24:12.663163
2018-02-01T17:16:48
2018-02-01T17:16:48
109,286,035
0
1
null
null
null
null
UTF-8
Java
false
false
556
java
import java.util.*; public class AddCourse extends CourseEdit{ Course newcourse; AddCourse(){ newcourse=new Course(); newcourse.setDetails(); courseList=new ArrayList<Course>(); } AddCourse(Course c){ newcourse=c; } public void Add(){ if(check("Courses")==true){ courseList=Course.get(); for(Course obj:courseList){ if(newcourse.equals(obj)){ System.out.println("Course Exists !"); return; } } } courseList.add(newcourse); Course.put(courseList); } }
[ "=" ]
=
4a15f3b32e0085acfc15fcb33e6a83baed89c12d
b6e00302ce378dfedc87a6c7210323a29a1bcf38
/java110-core/src/main/java/com/java110/core/base/controller/BaseController.java
db6c2d7c08829a820b70eb76841a775e875928b2
[ "Apache-2.0" ]
permissive
iweisi/MicroCommunity
8b984d2725b3ba7b4f8b82b1a20445ca12351c0a
f8d8dea93547f00c73de8f2fac71560b50632524
refs/heads/master
2020-04-06T19:47:21.938467
2018-10-14T09:41:38
2018-10-14T09:41:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,320
java
package com.java110.core.base.controller; import com.alibaba.fastjson.JSONObject; import com.java110.common.constant.CommonConstant; import com.java110.common.constant.ResponseConstant; import com.java110.common.exception.InitDataFlowContextException; import com.java110.common.exception.NoAuthorityException; import com.java110.common.util.StringUtil; import com.java110.core.base.AppBase; import com.java110.core.context.BusinessServiceDataFlow; import com.java110.core.factory.DataFlowFactory; import com.java110.entity.service.PageData; import org.springframework.ui.Model; import javax.servlet.http.HttpServletRequest; import java.util.*; /** * 所有控制类的父类,统一参数处理 * 或公用逻辑处理 * Created by wuxw on 2017/2/23. */ public class BaseController extends AppBase { /** * 检查用户登录 * @throws NoAuthorityException */ protected void checkLogin(PageData pd) throws NoAuthorityException{ if(StringUtil.isNullOrNone(pd.getUserId())){ throw new NoAuthorityException(ResponseConstant.RESULT_CODE_NO_AUTHORITY_ERROR,"用户未登录,请登录!"); } } /** * 将url参数写到header map中 * @param request */ protected void initUrlParam(HttpServletRequest request,Map headers) { /*put real ip address*/ Map readOnlyMap = request.getParameterMap(); StringBuffer queryString = new StringBuffer(request.getRequestURL()!=null?request.getRequestURL():""); if (readOnlyMap != null && !readOnlyMap.isEmpty()) { queryString.append("?"); Set<String> keys = readOnlyMap.keySet(); for (Iterator it = keys.iterator(); it.hasNext();) { String key = (String) it.next(); String[] value = (String[]) readOnlyMap.get(key); // String[] value = (String[]) readOnlyMap.get(key); if(value.length>1) { headers.put(key, value[0]); for(int j =0 ;j<value.length;j++){ queryString.append(key); queryString.append("="); queryString.append(value[j]); queryString.append("&"); } } else { headers.put(key, value[0]); queryString.append(key); queryString.append("="); queryString.append(value[0]); queryString.append("&"); } } } /*put requst url*/ if (readOnlyMap != null && !readOnlyMap.isEmpty()){ headers.put("REQUEST_URL",queryString.toString().substring(0, queryString.toString().length() - 1)); }else{ headers.put("REQUEST_URL",queryString.toString()); } } protected void initHeadParam(HttpServletRequest request,Map headers) { Enumeration reqHeaderEnum = request.getHeaderNames(); while( reqHeaderEnum.hasMoreElements() ) { String headerName = (String)reqHeaderEnum.nextElement(); headers.put(headerName, request.getHeader(headerName)); } headers.put("IP",getIpAddr(request)); headers.put("hostName",request.getLocalName()); headers.put("port",request.getLocalPort()+""); } /** * 获取IP地址 * @param request * @return */ protected String getIpAddr(HttpServletRequest request) { String ip = request.getHeader("X-Forwarded-For"); if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_CLIENT_IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_X_FORWARDED_FOR"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); } return ip; } /** * 创建 PageData 对象 * @param request * @return * @throws IllegalArgumentException */ protected PageData getPageData(HttpServletRequest request){ if(request.getAttribute(CommonConstant.CONTEXT_PAGE_DATA) == null){ throw new IllegalArgumentException("请求参数错误"); } return (PageData) request.getAttribute(CommonConstant.CONTEXT_PAGE_DATA); } /** * 查询菜单 * @param model * @param pd */ protected void getMenus(Model model,PageData pd,List<Map> menuItems){ List<Map> removeMenuItems = new ArrayList<Map>(); for(Map menuItem : menuItems){ if(!"-1".equals(menuItem.get("parentId")) && !"1".equals(menuItem.get("level"))){ Map parentMenuItem = this.getMenuItemFromList(menuItems,menuItem.get("parentId").toString()); if(parentMenuItem == null){ continue; } if(parentMenuItem.containsKey("subMenus")){ List<Map> subMenus = (List<Map>) parentMenuItem.get("subMenus"); subMenus.add(menuItem); }else{ List<Map> subMenus = new ArrayList<Map>(); subMenus.add(menuItem); parentMenuItem.put("subMenus",subMenus); } //removeMenuItems.add(menuItem); } } //bug 20180510 如果在一级菜单下面没有挂二级菜单报错问题处理 ifNoSubMenusToRemove(menuItems,removeMenuItems); removeMap(menuItems,removeMenuItems); model.addAttribute("menus",menuItems); } private Map getMenuItemFromList(List<Map> menuItems,String parentId){ for(Map menuItem : menuItems){ if(menuItem.get("mId").toString().equals(parentId)){ return menuItem; } } return null; } /** * 删除map * @param menuItems * @param removeMenuItems */ private void removeMap(List<Map> menuItems,List<Map> removeMenuItems){ if(removeMenuItems == null || removeMenuItems.size() == 0){ return; } for(Map removeMenuItem : removeMenuItems){ menuItems.remove(removeMenuItem); } } private void ifNoSubMenusToRemove(List<Map> menuItems,List<Map> removeMenuItems){ for(Map menu :menuItems){ if(!menu.containsKey("subMenus")){ removeMenuItems.add(menu); } } } /** * 封装数据 * @param reqJson * @param headers * @return * @throws Exception */ protected BusinessServiceDataFlow writeDataToDataFlowContext(String reqJson, Map<String,String> headers) throws Exception { BusinessServiceDataFlow businessServiceDataFlow = DataFlowFactory.newInstance(BusinessServiceDataFlow.class).builder(reqJson,headers); return businessServiceDataFlow; } }
[ "wuxw7@asiainfo.com" ]
wuxw7@asiainfo.com
8b810a96db99246621b8169e4f8129187aeb56d3
ef0c1514e9af6de3ba4a20e0d01de7cc3a915188
/sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/package-info.java
43bbc71b1064ea9fea1b4f04158b38c63c073621
[ "MIT", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-unknown-license-reference", "LGPL-2.1-or-later", "CC0-1.0", "BSD-3-Clause", "UPL-1.0", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "LicenseRef-scancode-generic-cla" ]
permissive
Azure/azure-sdk-for-java
0902d584b42d3654b4ce65b1dad8409f18ddf4bc
789bdc6c065dc44ce9b8b630e2f2e5896b2a7616
refs/heads/main
2023-09-04T09:36:35.821969
2023-09-02T01:53:56
2023-09-02T01:53:56
2,928,948
2,027
2,084
MIT
2023-09-14T21:37:15
2011-12-06T23:33:56
Java
UTF-8
Java
false
false
343
java
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. /** * Package containing the classes for AzureBotService. Azure Bot Service is a platform for creating smart conversational * agents. */ package com.azure.resourcemanager.botservice;
[ "noreply@github.com" ]
noreply@github.com
012e242eecd61d00d1480d4488ef882fbfd1fc47
5d263a4b5efb4f4223b5f9bc9c0f503c3ed3e7eb
/core/src/shapes1_5_5/gui/Text.java
338d44a1ab05aaf0cea1c6a428acb2827778238f
[]
no_license
ranger2242/GROW
8511f2bd70fc58a10067103fb67c841018284607
163880d14064621b9437582b4c1355be2f5739d1
refs/heads/master
2020-04-02T04:41:15.622705
2018-10-21T16:35:13
2018-10-21T16:35:13
154,029,234
0
0
null
null
null
null
UTF-8
Java
false
false
2,613
java
package shapes1_5_5.gui; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; 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.freetype.FreeTypeFontGenerator; import com.badlogic.gdx.math.Vector2; import shapes1_5_5.files.FilePaths; import shapes1_5_5.states.State; import static shapes1_5_5.states.State.scr; /** * Created by range_000 on 1/5/2017. */ public class Text { public int size; public Color c; public Vector2 pos; public String text; public Text(String s,Vector2 v,Color c, int size){ text=s; pos=v; this.c=c; this.size=size; } public Text(String s,Vector2 v){ this(s,v,Color.WHITE,1); } //STATICS============================================= public static final BitmapFont[] fonts = new BitmapFont[6]; public static BitmapFont font; static String fontFilePath ="fonts\\prstart.ttf"; static FileHandle file = Gdx.files.internal(FilePaths.getPath(fontFilePath)); static FreeTypeFontGenerator generator = new FreeTypeFontGenerator(file); static FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter(); public Text(String highscores, float i, float v) { this(highscores,new Vector2(i,v)); } public static void generateFonts(){ for(int i=0;i<6;i++) fonts[i] = createFont(8+(i*2)); setFontSize(5); } private static BitmapFont createFont(int x) { parameter.size = x; return generator.generateFont(parameter); } public static float strWidth(String s){ CharSequence cs=s; GlyphLayout gl = new GlyphLayout(getFont(),cs); return gl.width; } public static float centerString(String s){ return (State.getView().x+scr.size.x/2)- (strWidth(s)/2); } public static float[] fitLineToWord(String s){ //x1,y1,x2,y2 float[] arr=new float[8]; arr[0]= -10; arr[1]=-15; arr[2]=strWidth(s)+20; arr[3]=-15; arr[4]= -10; arr[5]=-12; arr[6]=strWidth(s)+35; arr[7]=-12; return arr; } public static void setFontSize(int x) { font = fonts[x]; } public static BitmapFont getFont() { return font; } public static void resetFont() { for(BitmapFont f: fonts){ Color c= new Color(1,1,1,1); f.setColor(c); } } }
[ "ranger2242@gmail.com" ]
ranger2242@gmail.com
c46044a1c47c026be960d5c12b6534ec3e67e3d7
6dc524e00003d13788ecfb9a33b4387228203c16
/predavanjas02d01/src/predavanjas02d01/Sum.java
d7f12f291c6d84c95e516447c4746946d7f4c242
[]
no_license
Eminaae/Killer
d67bdc97b83fe5662e2139b00b9cda34f93b4123
0011b18fb44fb523b228cc5397ea4c3ef4ed8d54
refs/heads/master
2021-01-02T08:45:33.054983
2015-11-16T12:12:35
2015-11-16T12:12:35
37,134,907
0
0
null
null
null
null
UTF-8
Java
false
false
250
java
package predavanjas02d01; public class Sum { public static void main(String[] args) { int brojeva = 100; int suma = 0; int broj = 1; do { suma += broj; broj++; } while (broj <= brojeva); System.out.println(suma); } }
[ "kristina.pupavac@bitcamp.ba" ]
kristina.pupavac@bitcamp.ba
1e5c00287e45efd7460948be1c34e4f8363d8337
faf76439613c57f09dcfd75be737e6dc8fa21e2b
/FRC2019/src/main/java/frc/robot/components/FakeTalon.java
94faa90519ea655fa1b80c50f4f3d4ab70be847a
[ "MIT" ]
permissive
first95/FRC2019
b8fd805cd7af683641869baae89838a23ab27201
cde98839bbafb631a914d8de217438738fdb04d4
refs/heads/master
2021-06-17T11:36:15.118709
2019-03-20T23:27:39
2019-03-20T23:27:39
132,536,472
0
0
MIT
2018-10-11T02:06:30
2018-05-08T01:28:54
Java
UTF-8
Java
false
false
12,539
java
package frc.robot.components; import com.ctre.phoenix.ErrorCode; import com.ctre.phoenix.ParamEnum; import com.ctre.phoenix.motion.MotionProfileStatus; import com.ctre.phoenix.motion.TrajectoryPoint; import com.ctre.phoenix.motorcontrol.ControlFrame; import com.ctre.phoenix.motorcontrol.ControlMode; import com.ctre.phoenix.motorcontrol.DemandType; import com.ctre.phoenix.motorcontrol.Faults; import com.ctre.phoenix.motorcontrol.FeedbackDevice; import com.ctre.phoenix.motorcontrol.IMotorController; import com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced; import com.ctre.phoenix.motorcontrol.LimitSwitchNormal; import com.ctre.phoenix.motorcontrol.LimitSwitchSource; import com.ctre.phoenix.motorcontrol.NeutralMode; import com.ctre.phoenix.motorcontrol.RemoteFeedbackDevice; import com.ctre.phoenix.motorcontrol.RemoteLimitSwitchSource; import com.ctre.phoenix.motorcontrol.RemoteSensorSource; import com.ctre.phoenix.motorcontrol.SensorCollection; import com.ctre.phoenix.motorcontrol.SensorTerm; import com.ctre.phoenix.motorcontrol.StatusFrame; import com.ctre.phoenix.motorcontrol.StatusFrameEnhanced; import com.ctre.phoenix.motorcontrol.StickyFaults; import com.ctre.phoenix.motorcontrol.VelocityMeasPeriod; public class FakeTalon implements IMotorControllerEnhanced { @Override public void set(ControlMode Mode, double demand) { } @Override public void set(ControlMode Mode, double demand0, double demand1) { } @Override public void set(ControlMode Mode, double demand0, DemandType demand1Type, double demand1) { } @Override public void neutralOutput() { } @Override public void setNeutralMode(NeutralMode neutralMode) { } @Override public void setSensorPhase(boolean PhaseSensor) { } @Override public void setInverted(boolean invert) { } @Override public boolean getInverted() { return false; } @Override public ErrorCode configOpenloopRamp(double secondsFromNeutralToFull, int timeoutMs) { return null; } @Override public ErrorCode configClosedloopRamp(double secondsFromNeutralToFull, int timeoutMs) { return null; } @Override public ErrorCode configPeakOutputForward(double percentOut, int timeoutMs) { return null; } @Override public ErrorCode configPeakOutputReverse(double percentOut, int timeoutMs) { return null; } @Override public ErrorCode configNominalOutputForward(double percentOut, int timeoutMs) { return null; } @Override public ErrorCode configNominalOutputReverse(double percentOut, int timeoutMs) { return null; } @Override public ErrorCode configNeutralDeadband(double percentDeadband, int timeoutMs) { return null; } @Override public ErrorCode configVoltageCompSaturation(double voltage, int timeoutMs) { return null; } @Override public ErrorCode configVoltageMeasurementFilter(int filterWindowSamples, int timeoutMs) { return null; } @Override public void enableVoltageCompensation(boolean enable) { } @Override public double getBusVoltage() { return 0; } @Override public double getMotorOutputPercent() { return 0; } @Override public double getMotorOutputVoltage() { return 0; } @Override public double getTemperature() { return 0; } @Override public ErrorCode configSelectedFeedbackSensor(RemoteFeedbackDevice feedbackDevice, int pidIdx, int timeoutMs) { return null; } @Override public ErrorCode configSelectedFeedbackCoefficient(double coefficient, int pidIdx, int timeoutMs) { return null; } @Override public ErrorCode configRemoteFeedbackFilter(int deviceID, RemoteSensorSource remoteSensorSource, int remoteOrdinal, int timeoutMs) { return null; } @Override public ErrorCode configSensorTerm(SensorTerm sensorTerm, FeedbackDevice feedbackDevice, int timeoutMs) { return null; } @Override public int getSelectedSensorPosition(int pidIdx) { return 0; } @Override public int getSelectedSensorVelocity(int pidIdx) { return 0; } @Override public ErrorCode setSelectedSensorPosition(int sensorPos, int pidIdx, int timeoutMs) { return null; } @Override public ErrorCode setControlFramePeriod(ControlFrame frame, int periodMs) { return null; } @Override public ErrorCode setStatusFramePeriod(StatusFrame frame, int periodMs, int timeoutMs) { return null; } @Override public int getStatusFramePeriod(StatusFrame frame, int timeoutMs) { return 0; } @Override public ErrorCode configForwardLimitSwitchSource(RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int deviceID, int timeoutMs) { return null; } @Override public ErrorCode configReverseLimitSwitchSource(RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int deviceID, int timeoutMs) { return null; } @Override public void overrideLimitSwitchesEnable(boolean enable) { } @Override public ErrorCode configForwardSoftLimitThreshold(int forwardSensorLimit, int timeoutMs) { return null; } @Override public ErrorCode configReverseSoftLimitThreshold(int reverseSensorLimit, int timeoutMs) { return null; } @Override public ErrorCode configForwardSoftLimitEnable(boolean enable, int timeoutMs) { return null; } @Override public ErrorCode configReverseSoftLimitEnable(boolean enable, int timeoutMs) { return null; } @Override public void overrideSoftLimitsEnable(boolean enable) { } @Override public ErrorCode config_kP(int slotIdx, double value, int timeoutMs) { return null; } @Override public ErrorCode config_kI(int slotIdx, double value, int timeoutMs) { return null; } @Override public ErrorCode config_kD(int slotIdx, double value, int timeoutMs) { return null; } @Override public ErrorCode config_kF(int slotIdx, double value, int timeoutMs) { return null; } @Override public ErrorCode config_IntegralZone(int slotIdx, int izone, int timeoutMs) { return null; } @Override public ErrorCode configAllowableClosedloopError(int slotIdx, int allowableCloseLoopError, int timeoutMs) { return null; } @Override public ErrorCode configMaxIntegralAccumulator(int slotIdx, double iaccum, int timeoutMs) { return null; } @Override public ErrorCode configClosedLoopPeakOutput(int slotIdx, double percentOut, int timeoutMs) { return null; } @Override public ErrorCode configClosedLoopPeriod(int slotIdx, int loopTimeMs, int timeoutMs) { return null; } @Override public ErrorCode configAuxPIDPolarity(boolean invert, int timeoutMs) { return null; } @Override public ErrorCode setIntegralAccumulator(double iaccum, int pidIdx, int timeoutMs) { return null; } @Override public int getClosedLoopError(int pidIdx) { return 0; } @Override public double getIntegralAccumulator(int pidIdx) { return 0; } @Override public double getErrorDerivative(int pidIdx) { return 0; } @Override public void selectProfileSlot(int slotIdx, int pidIdx) { } @Override public double getClosedLoopTarget(int pidIdx) { return 0; } @Override public int getActiveTrajectoryPosition() { return 0; } @Override public int getActiveTrajectoryVelocity() { return 0; } @Override public double getActiveTrajectoryHeading() { return 0; } @Override public ErrorCode configMotionCruiseVelocity(int sensorUnitsPer100ms, int timeoutMs) { return null; } @Override public ErrorCode configMotionAcceleration(int sensorUnitsPer100msPerSec, int timeoutMs) { return null; } @Override public ErrorCode configMotionProfileTrajectoryPeriod(int baseTrajDurationMs, int timeoutMs) { return null; } @Override public ErrorCode clearMotionProfileTrajectories() { return null; } @Override public int getMotionProfileTopLevelBufferCount() { return 0; } @Override public ErrorCode pushMotionProfileTrajectory(TrajectoryPoint trajPt) { return null; } @Override public boolean isMotionProfileTopLevelBufferFull() { return false; } @Override public void processMotionProfileBuffer() { } @Override public ErrorCode getMotionProfileStatus(MotionProfileStatus statusToFill) { return null; } @Override public ErrorCode clearMotionProfileHasUnderrun(int timeoutMs) { return null; } @Override public ErrorCode changeMotionControlFramePeriod(int periodMs) { return null; } @Override public ErrorCode getLastError() { return null; } @Override public ErrorCode getFaults(Faults toFill) { return null; } @Override public ErrorCode getStickyFaults(StickyFaults toFill) { return null; } @Override public ErrorCode clearStickyFaults(int timeoutMs) { return null; } @Override public int getFirmwareVersion() { return 0; } @Override public boolean hasResetOccurred() { return false; } @Override public ErrorCode configSetCustomParam(int newValue, int paramIndex, int timeoutMs) { return null; } @Override public int configGetCustomParam(int paramIndex, int timoutMs) { return 0; } @Override public ErrorCode configSetParameter(ParamEnum param, double value, int subValue, int ordinal, int timeoutMs) { return null; } @Override public ErrorCode configSetParameter(int param, double value, int subValue, int ordinal, int timeoutMs) { return null; } @Override public double configGetParameter(ParamEnum paramEnum, int ordinal, int timeoutMs) { return 0; } @Override public double configGetParameter(int paramEnum, int ordinal, int timeoutMs) { return 0; } @Override public int getBaseID() { return 0; } @Override public int getDeviceID() { return 0; } @Override public ControlMode getControlMode() { return ControlMode.Disabled; } @Override public void follow(IMotorController masterToFollow) { } @Override public void valueUpdated() { } @Override public ErrorCode configSelectedFeedbackSensor(FeedbackDevice feedbackDevice, int pidIdx, int timeoutMs) { return null; } @Override public ErrorCode setStatusFramePeriod(StatusFrameEnhanced frame, int periodMs, int timeoutMs) { return null; } @Override public int getStatusFramePeriod(StatusFrameEnhanced frame, int timeoutMs) { return 0; } @Override public double getOutputCurrent() { return 0; } @Override public ErrorCode configVelocityMeasurementPeriod(VelocityMeasPeriod period, int timeoutMs) { return null; } @Override public ErrorCode configVelocityMeasurementWindow(int windowSize, int timeoutMs) { return null; } @Override public ErrorCode configForwardLimitSwitchSource(LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int timeoutMs) { return null; } @Override public ErrorCode configReverseLimitSwitchSource(LimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, int timeoutMs) { return null; } @Override public ErrorCode configPeakCurrentLimit(int amps, int timeoutMs) { return null; } @Override public ErrorCode configPeakCurrentDuration(int milliseconds, int timeoutMs) { return null; } @Override public ErrorCode configContinuousCurrentLimit(int amps, int timeoutMs) { return null; } @Override public void enableCurrentLimit(boolean enable) { } @Override public SensorCollection getSensorCollection() { return null; } }
[ "john.walthour@gmail.com" ]
john.walthour@gmail.com
c4301ac8d93b761841119bc7dda7a1b87a0461d8
5357bfb86af26221c87e90f5ba8c42ac1d11f505
/src/main/java/animals/birds/Raven.java
5032a9d9e87d1bf68ed7db1b3bc2977f62179611
[]
no_license
mikolajurbanek/PA
01a833e7c9adc339c5057a360af4ded399847322
bc8a29139917a64db89eae9472a710507b151a6c
refs/heads/master
2022-11-11T06:16:18.102865
2020-06-26T11:43:57
2020-06-26T11:43:57
274,898,963
0
0
null
null
null
null
UTF-8
Java
false
false
236
java
package animals.birds; public class Raven extends Bird { public Raven(String name, double mass) { super(name, mass); } @Override public String getMovement() { return "flies with fru fru!"; } }
[ "mikolaj.urbanek@gmail.com" ]
mikolaj.urbanek@gmail.com
12e29197cf2d2f16def7ad8abf76f3ce2fc2dc1a
0a96331e34c4164d7d823e86da7190d5f88764f8
/jsonMock/src/main/java/com/example/demo/HelloController.java
2695787f6c18948143e855463c2d6c4596ed5f4f
[]
no_license
aapiro/Spring-Boot-Generic-Mock
69086d971ccfa7654e7a9669e08ee9e429dea061
cdae9efe2da027f771b6f73c64937962aabc0920
refs/heads/master
2021-05-09T07:18:36.747319
2018-01-29T08:51:32
2018-01-29T08:51:32
119,355,911
0
0
null
null
null
null
UTF-8
Java
false
false
1,294
java
package com.example.demo; import org.springframework.web.bind.annotation.RestController; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; @RestController public class HelloController { @Value("${local.path}") String localPath; @Value("${ext.file}") String extFile; @RequestMapping(method = { RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE }, produces = "application/json") @ResponseBody public String allFallback(HttpServletRequest request) { String uri = request.getRequestURI().concat("/"); String jsonResource = localPath + uri + request.getMethod() + extFile; return readFile(jsonResource, StandardCharsets.UTF_8); } public String readFile(String path, Charset encoding) { byte[] encoded = null; try { encoded = Files.readAllBytes(Paths.get(path)); } catch (Exception e) { e.printStackTrace(); } return new String(encoded, encoding); } }
[ "noreply@github.com" ]
noreply@github.com
f6d993339b33ba3f61d696bd9a7d2131732e9493
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebFluxTestAllControllersIntegrationTests.java
0b9de1c47b02e9942ff8d36b8f35853212f34efd
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
2,013
java
/** * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.test.autoconfigure.web.reactive.webclient; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.reactive.server.WebTestClient; /** * Tests for {@link WebFluxTest} when no explicit controller is defined. * * @author Stephane Nicoll */ @RunWith(SpringRunner.class) @WithMockUser @WebFluxTest public class WebFluxTestAllControllersIntegrationTests { @Autowired private WebTestClient webClient; @Test public void shouldFindController1() { this.webClient.get().uri("/one").exchange().expectStatus().isOk().expectBody(String.class).isEqualTo("one"); } @Test public void shouldFindController2() { this.webClient.get().uri("/two").exchange().expectStatus().isOk().expectBody(String.class).isEqualTo("two"); } @Test public void webExceptionHandling() { this.webClient.get().uri("/one/error").exchange().expectStatus().isBadRequest(); } @Test public void shouldFindJsonController() { this.webClient.get().uri("/json").exchange().expectStatus().isOk(); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr