blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d6ef492313392827ea955efa2624be10a1574fea | 833e0ff7708a4a028b174659af5ab097e71b3cee | /gcb-vm/src/main/java/com/doingdevops/hellogcb/HelloGcbApplication.java | 8e93742126269311f1f5cf22d1296c86642f88c4 | []
| no_license | davidstanke/samples | 1a68040b4a627cf64d16b613a8f4d45563dc4826 | 5869ecf5148331026518ebffc452c48309aa5d1e | refs/heads/master | 2020-04-23T00:31:57.803939 | 2020-02-25T17:52:53 | 2020-02-25T17:52:53 | 170,782,884 | 19 | 3 | null | null | null | null | UTF-8 | Java | false | false | 321 | java | package com.doingdevops.hellogcb;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class HelloGcbApplication {
public static void main(String[] args) {
SpringApplication.run(HelloGcbApplication.class, args);
}
}
| [
"[email protected]"
]
| |
e47ed4d9129c57788cf846fe8c0203e4cda5ad84 | acbe0597fb5ffc8b94cde6bcc4420bb8b78a3f5f | /week4/CycleDetection.java | b45d8b12031ae77dbfbb2546f85a4c1c90cc01a2 | []
| no_license | chetanakotgale/CycleDetection_4 | 044dea3a81feb38cf6df63f616957d70c4da61f9 | 83899ba65c0f0e00e42e3987e873f1f8c933adac | refs/heads/master | 2020-05-04T12:40:05.045638 | 2019-04-02T18:18:08 | 2019-04-02T18:18:08 | 179,128,833 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,611 | java | package week4;
import java.io.*;
import java.util.*;
public class CycleDetection
{
static class SinglyLinkedListNode {
public int data;
public SinglyLinkedListNode next;
public SinglyLinkedListNode(int nodeData) {
this.data = nodeData;
this.next = null;
}
}
static class SinglyLinkedList {
public SinglyLinkedListNode head;
public SinglyLinkedListNode tail;
public SinglyLinkedList() {
this.head = null;
this.tail = null;
}
public void insertNode(int nodeData) {
SinglyLinkedListNode node = new SinglyLinkedListNode(nodeData);
if (this.head == null) {
this.head = node;
} else {
this.tail.next = node;
}
this.tail = node;
}
}
public static void printSinglyLinkedList(SinglyLinkedListNode node, String sep, BufferedWriter bufferedWriter) throws IOException {
while (node != null) {
bufferedWriter.write(String.valueOf(node.data));
node = node.next;
if (node != null) {
bufferedWriter.write(sep);
}
}
}
// Complete the hasCycle function below.
/*
* For your reference:
*
* SinglyLinkedListNode {
* int data;
* SinglyLinkedListNode next;
* }
*
*/
static boolean hasCycle(SinglyLinkedListNode head) {
if(head==null)
{
return false;
}
SinglyLinkedListNode first=head; //1
SinglyLinkedListNode second=head.next ; //2
while(second != null && second.next !=null)
{
first=first.next; //2 ,3
second=second.next.next; //4 ,6
if(first == second)
{
return true;
}
}
return false;
}
private static final Scanner scanner = new Scanner(System.in);
public static void main(String[] args) throws IOException {
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));
int tests = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
for (int testsItr = 0; testsItr < tests; testsItr++) {
int index = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
SinglyLinkedList llist = new SinglyLinkedList();
int llistCount = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
for (int i = 0; i < llistCount; i++) {
int llistItem = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
llist.insertNode(llistItem);
}
SinglyLinkedListNode extra = new SinglyLinkedListNode(-1);
SinglyLinkedListNode temp = llist.head;
for (int i = 0; i < llistCount; i++) {
if (i == index) {
extra = temp;
}
if (i != llistCount-1) {
temp = temp.next;
}
}
temp.next = extra;
boolean result = hasCycle(llist.head);
bufferedWriter.write(String.valueOf(result ? 1 : 0));
bufferedWriter.newLine();
}
bufferedWriter.close();
scanner.close();
}
}
| [
"[email protected]"
]
| |
d395460a1ddc55c96876a090f0f536bf27f81372 | 70cde6af56e2e840f76fe6d0040237942d5dbae3 | /20180524/sample/src/com/internousdev/sample/action/CartItemAction.java | 5179ad6e40fd0eee8a7fef4a7d805b009c2dc5e3 | []
| no_license | nasu-hiroshi/test | 5cd268dc822685c315365f3f1bbe231806f7b5f6 | a1150463d8acc6c7422134cdaa1260f2fd92ce21 | refs/heads/master | 2020-03-18T08:28:50.115393 | 2018-05-24T08:43:48 | 2018-05-24T08:43:48 | 134,512,318 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,378 | java | package com.internousdev.sample.action;
import java.sql.SQLException;
import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;
import com.internousdev.sample.dao.CartItemCompleteDAO;
import com.opensymphony.xwork2.ActionSupport;
public class CartItemAction extends ActionSupport implements SessionAware
{
private String itemName;
private int itemPrice;
private int itemCount;
private Map<String, Object> session;
public String execute() throws SQLException
{
int itemId;
int totalPrice;
String userId;
itemId = Integer.parseInt((String) session.get("id"));
userId = (String) session.get("login_user_id");
totalPrice = (itemPrice * itemCount);
CartItemCompleteDAO cartItemInsert = new CartItemCompleteDAO();
cartItemInsert.setCartItem(itemId, itemName, itemPrice, itemCount, totalPrice, userId);
String result = SUCCESS;
return result;
}
public String getItemName()
{
return itemName;
}
public void setItemName(String itemName)
{
this.itemName = itemName;
}
public int getItemParice()
{
return itemPrice;
}
public void setItemPrice(int itemPrice)
{
this.itemPrice = itemPrice;
}
public int getItemCount()
{
return itemCount;
}
public void setItemCount(int itemCount)
{
this.itemCount = itemCount;
}
@Override
public void setSession(Map<String, Object> session)
{
this.session = session;
}
} | [
"[email protected]"
]
| |
6f7c3c130f4672b814a906efc874e3f49d3faf8c | 99ed1c68dc7cae9ef516c06daa9cd297a2e27e89 | /core/src/main/java/org/kohsuke/stapler/export/RubyDataWriter.java | 82b28538ee58742508d69bd3ee3a05a3d88cc8eb | [
"BSD-2-Clause"
]
| permissive | kevinsawicki/stapler | f04855e9274e5888d75cc79ac9256cadf3d96f65 | 82bf0eaa4d31cac77de7f02c8fb68cd363654f9c | refs/heads/master | 2021-01-24T02:06:32.810590 | 2011-07-06T01:48:20 | 2011-07-06T01:48:20 | 2,015,650 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,565 | java | /*
* Copyright (c) 2004-2010, Kohsuke Kawaguchi
* 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 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.kohsuke.stapler.export;
import org.kohsuke.stapler.StaplerResponse;
import java.io.Writer;
import java.io.IOException;
/**
* Writes out the format that can be <tt>eval</tt>-ed from Ruby.
*
* <p>
* Ruby uses a similar list and map literal syntax as JavaScript.
* The only differences are <tt>null</tt> vs <tt>nil</tt> and
* <tt>key:value</tt> vs <tt>key => value</tt>.
*
* @author Kohsuke Kawaguchi, Jim Meyer
*/
final class RubyDataWriter extends JSONDataWriter {
public RubyDataWriter(Writer out) throws IOException {
super(out);
}
public RubyDataWriter(StaplerResponse rsp) throws IOException {
super(rsp);
}
@Override
public void name(String name) throws IOException {
comma();
out.write('"'+name+"\" => ");
needComma = false;
}
public void valueNull() throws IOException {
data("nil");
}
@Override
public void startObject() throws IOException {
comma();
out.write("OpenStruct.new({");
needComma=false;
}
@Override
public void endObject() throws IOException {
out.write("})");
needComma=true;
}
}
| [
"kohsuke@@dev.java.net"
]
| kohsuke@@dev.java.net |
678403897d10e1d22ed2b51587bbbb941eae88cf | 81b79475ceb5a46b1ed8e5a530a5d2d3be2c6fc6 | /src/main/java/com/jm/muses/service/fhdb/brdb/BRdbManager.java | 973aedab910a898317537d9b383bac505cb26bb1 | []
| no_license | zhmz1326/muses | 453015aee3cacaeb04a0bb07d9e9703ddbc9357e | bd9c81cfe0db3ef1ab5d18af7acb15ff92b72057 | refs/heads/master | 2020-05-20T21:42:43.374231 | 2016-06-12T14:34:01 | 2016-06-12T14:34:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,059 | java | package com.jm.muses.service.fhdb.brdb;
import java.util.List;
import com.jm.muses.entity.Page;
import com.jm.muses.util.PageData;
/**
* 说明: 数据库管理接口
*
* 创建时间:2016-03-30
* @version
*/
public interface BRdbManager{
/**新增
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception;
/**删除
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception;
/**修改
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception;
/**列表
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception;
/**列表(全部)
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception;
/**通过id获取数据
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception;
/**批量删除
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
}
| [
"[email protected]"
]
| |
800ceaafc1e1c28ddf2fb421fb644c9413d11a7c | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_2ea85fb62b61a3f039151e3e455b3a69eb612201/GATKArgumentCollection/2_2ea85fb62b61a3f039151e3e455b3a69eb612201_GATKArgumentCollection_s.java | ea4eb391cee8718370d007c695c63a9056666881 | []
| 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 | 12,255 | java | package org.broadinstitute.sting.gatk;
import net.sf.samtools.SAMFileReader;
import org.broadinstitute.sting.utils.StingException;
import org.broadinstitute.sting.utils.cmdLine.Argument;
import org.simpleframework.xml.*;
import org.simpleframework.xml.core.Persister;
import org.simpleframework.xml.stream.Format;
import org.simpleframework.xml.stream.HyphenStyle;
import java.io.File;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* User: aaron
* Date: May 7, 2009
* Time: 11:46:21 AM
*
* The Broad Institute
* SOFTWARE COPYRIGHT NOTICE AGREEMENT
* This software and its documentation are copyright 2009 by the
* Broad Institute/Massachusetts Institute of Technology. All rights are reserved.
*
* This software is supplied without any warranty or guaranteed support whatsoever. Neither
* the Broad Institute nor MIT can be responsible for its use, misuse, or functionality.
*
*/
/**
* @author aaron
* @version 1.0
*/
@Root
public class GATKArgumentCollection {
/* our version number */
private float versionNumber = 1;
private String description = "GATK Arguments";
/** the constructor */
public GATKArgumentCollection() {
}
@ElementMap(entry = "analysis_argument", key = "key", attribute = true, inline = true, required = false)
public Map<String, String> walkerArgs = new HashMap<String, String>();
// parameters and their defaults
@ElementList(required = false)
@Argument(fullName = "input_file", shortName = "I", doc = "SAM or BAM file(s)", required = false)
public List<File> samFiles = new ArrayList<File>();
@ElementList(required = false)
@Argument(fullName = "read_filters", shortName = "rf", doc = "Specify filtration criteria on the each read.", required=false)
public List<String> readFilters = new ArrayList<String>();
@ElementList(required = false)
@Argument(fullName = "intervals", shortName = "L", doc = "A list of genomic intervals over which to operate. Can be explicitly specified on the command line or in a file.", required = false)
public List<String> intervals = null;
@Element(required = false)
@Argument(fullName = "reference_sequence", shortName = "R", doc = "Reference sequence file", required = false)
public File referenceFile = null;
@ElementList(required = false)
@Argument(fullName = "rodBind", shortName = "B", doc = "Bindings for reference-ordered data, in the form <name>,<type>,<file>", required = false)
public ArrayList<String> RODBindings = new ArrayList<String>();
@Element(required = false)
@Argument(fullName = "DBSNP", shortName = "D", doc = "DBSNP file", required = false)
public String DBSNPFile = null;
@Element(required = false)
@Argument(fullName = "hapmap", shortName = "H", doc = "Hapmap file", required = false)
public String HAPMAPFile = null;
@Element(required = false)
@Argument(fullName = "hapmap_chip", shortName = "hc", doc = "Hapmap chip file", required = false)
public String HAPMAPChipFile = null;
/** An output file presented to the walker. */
@Element(required = false)
@Argument(fullName = "out", shortName = "o", doc = "An output file presented to the walker. Will overwrite contents if file exists.", required = false)
public String outFileName = null;
/** An error output file presented to the walker. */
@Element(required = false)
@Argument(fullName = "err", shortName = "e", doc = "An error output file presented to the walker. Will overwrite contents if file exists.", required = false)
public String errFileName = null;
/** A joint file for both 'normal' and error output presented to the walker. */
@Element(required = false)
@Argument(fullName = "outerr", shortName = "oe", doc = "A joint file for 'normal' and error output presented to the walker. Will overwrite contents if file exists.", required = false)
public String outErrFileName = null;
@Element(required = false)
@Argument(fullName = "maximum_iterations", shortName = "M", doc = "Maximum number of iterations to process before exiting, the lower bound is zero. Intended only for testing", required = false)
public Integer maximumEngineIterations = -1;
@Element(required = false)
@Argument(fullName = "filterZeroMappingQualityReads", shortName = "fmq0", doc = "If true, mapping quality zero reads will be filtered at the lowest GATK level. Vastly improves performance at areas with abnormal depth due to mapping Q0 reads", required = false)
public Boolean filterZeroMappingQualityReads = false;
@Element(required = false)
@Argument(fullName = "downsample_to_fraction", shortName = "dfrac", doc = "Fraction [0.0-1.0] of reads to downsample to", required = false)
public Double downsampleFraction = null;
@Element(required = false)
@Argument(fullName = "downsample_to_coverage", shortName = "dcov", doc = "Coverage [integer] to downsample to", required = false)
public Integer downsampleCoverage = null;
@Element(required = false)
@Argument(fullName = "validation_strictness", shortName = "S", doc = "How strict should we be with validation (LENIENT|SILENT|STRICT)", required = false)
public SAMFileReader.ValidationStringency strictnessLevel = SAMFileReader.ValidationStringency.SILENT;
@Element(required = false)
@Argument(fullName = "unsafe", shortName = "U", doc = "If set, enables unsafe operations, nothing will be checked at runtime.", required = false)
public Boolean unsafe = false;
@Element(required = false)
@Argument(fullName = "max_reads_at_locus", shortName = "mrl", doc = "Sets the upper limit for the number of reads presented at a single locus. int.MAX_VALUE by default.", required = false)
public int readMaxPileup = Integer.MAX_VALUE;
@Element(required = false)
@Argument(fullName = "disablethreading", shortName = "dt", doc = "Disable experimental threading support.", required = false)
public Boolean disableThreading = false;
/** How many threads should be allocated to this analysis. */
@Element(required = false)
@Argument(fullName = "numthreads", shortName = "nt", doc = "How many threads should be allocated to running this analysis.", required = false)
public int numberOfThreads = 1;
/**
* marshal the data out to a object
*
* @param collection the GATKArgumentCollection to load into
* @param outputFile the file to write to
*/
public static void marshal( GATKArgumentCollection collection, String outputFile ) {
Serializer serializer = new Persister(new Format(new HyphenStyle()));
File result = new File(outputFile);
try {
serializer.write(collection, result);
} catch (Exception e) {
throw new StingException("Failed to marshal the data to the file " + outputFile, e);
}
}
/**
* marshal the data out to a object
*
* @param collection the GATKArgumentCollection to load into
* @param outputFile the stream to write to
*/
public static void marshal( GATKArgumentCollection collection, PrintStream outputFile ) {
Serializer serializer = new Persister(new Format(new HyphenStyle()));
try {
serializer.write(collection, outputFile);
} catch (Exception e) {
throw new StingException("Failed to marshal the data to the file " + outputFile, e);
}
}
/**
* unmashall the object from a configuration file
*
* @param filename the filename to marshal from
*/
public static GATKArgumentCollection unmarshal( String filename ) {
Serializer serializer = new Persister(new Format(new HyphenStyle()));
File source = new File(filename);
try {
GATKArgumentCollection example = serializer.read(GATKArgumentCollection.class, source);
return example;
} catch (Exception e) {
throw new StingException("Failed to marshal the data from file " + filename, e);
}
}
/**
* unmashall the object from a configuration file
*
* @param file the inputstream to marshal from
*/
public static GATKArgumentCollection unmarshal( InputStream file ) {
Serializer serializer = new Persister(new Format(new HyphenStyle()));
try {
GATKArgumentCollection example = serializer.read(GATKArgumentCollection.class, file);
return example;
} catch (Exception e) {
throw new StingException("Failed to marshal the data from file " + file.toString(), e);
}
}
/**
* test equality between two arg collections. This function defines the statement:
* "not fun to write"
*
* @param other the other collection
*
* @return true if they're equal
*/
public boolean equals( GATKArgumentCollection other ) {
if (other.samFiles.size() != samFiles.size()) {
return false;
}
for (int x = 0; x < samFiles.size(); x++) {
if (!samFiles.get(x).equals(other.samFiles.get(x))) {
return false;
}
}
if (other.walkerArgs.size() != walkerArgs.size()) {
return false;
}
for (String s : walkerArgs.keySet()) {
if (!other.walkerArgs.containsKey(s)) {
return false;
}
}
if (other.RODBindings.size() != RODBindings.size()) {
return false;
}
for (int x = 0; x < RODBindings.size(); x++) {
if (!RODBindings.get(x).equals(other.RODBindings.get(x))) {
return false;
}
}
if (!other.samFiles.equals(this.samFiles)) {
return false;
}
if (!other.maximumEngineIterations.equals(this.maximumEngineIterations)) {
return false;
}
if (!other.strictnessLevel.equals(this.strictnessLevel)) {
return false;
}
if (!other.referenceFile.equals(this.referenceFile)) {
return false;
}
if (!other.intervals.equals(this.intervals)) {
return false;
}
if (!other.DBSNPFile.equals(this.DBSNPFile)) {
return false;
}
if (!other.HAPMAPFile.equals(this.HAPMAPFile)) {
return false;
}
if (!other.HAPMAPChipFile.equals(this.HAPMAPChipFile)) {
return false;
}
if (!other.unsafe.equals(this.unsafe)) {
return false;
}
if (other.readMaxPileup != this.readMaxPileup) {
return false;
}
if (( other.filterZeroMappingQualityReads == null && this.filterZeroMappingQualityReads != null ) ||
( other.filterZeroMappingQualityReads != null && !other.filterZeroMappingQualityReads.equals(this.filterZeroMappingQualityReads) )) {
return false;
}
if (( other.downsampleFraction == null && this.downsampleFraction != null ) ||
( other.downsampleFraction != null && !other.downsampleFraction.equals(this.downsampleFraction) )) {
return false;
}
if (( other.downsampleCoverage == null && this.downsampleCoverage != null ) ||
( other.downsampleCoverage != null && !other.downsampleCoverage.equals(this.downsampleCoverage) )) {
return false;
}
if (!other.outFileName.equals(this.outFileName)) {
return false;
}
if (!other.errFileName.equals(this.errFileName)) {
return false;
}
if (!other.outErrFileName.equals(this.outErrFileName)) {
return false;
}
if (other.numberOfThreads != this.numberOfThreads) {
return false;
}
return true;
}
}
| [
"[email protected]"
]
| |
766b5f09c1ecdbcf3f9c46a9e41c1f1064bba1d7 | db78e520f5b240738999ccd51e9ae31dba22ad33 | /DateCounter.java | 1382c23ea77d197a8257e3cdd00b3527d3eaa149 | []
| no_license | annagotsis/cmsi186 | 04f48576bd6fc5c1c5fb7b07b31f293e74d174ba | 1d824476433bf86ddf409ea8258ca5b4e5ba327b | refs/heads/master | 2021-04-30T22:07:33.564345 | 2015-05-06T05:16:38 | 2015-05-06T05:16:38 | 29,322,717 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,268 | java | public class DateCounter {
public static boolean isLeapYear(int year) {
if (year % 400 == 0) || (year % 4 == 0) && (year % 100 == 0) && (year > 1582);
return true;
}
public static int daysInMonth(int year, int month) {
if (month == 01 || month == 03 || month == 05 || month == 07 || month == 08 || month == 10 || month == 12 ) {
return 31;
}
else if (month == 2) {
if (isLeapYear(year)) {
return 29;
} else {
return 28;
}
}
else {
return 30;
}
}
public static boolean isValidDate(int year, int month, int day) {
if (month == 01 || month == 03 || month == 05 || month == 07 || month == 08 || month == 10 || month == 12 )) && (day <= 31) && (year < 2016) {
return true;
} else if (month == 04 || month == 06 || month == 09 || month == 11) && (day <= 30) && (year < 2016) {
return true;
} else if (month == 02) {
if ((isLeapYear(year)) && (day <= 29) && (year < 2016)) {
return true;
} else {
if (day <=28) && (year < 2016) {
return true;
}
}
}
return false;
}
public static int daysBetween(int year0, int month0, int day0, int year1, int month1, int day1) {
if ((year0 >year1) || ((year1 == year0) && (month0 > month1)) || ((year1 == year0) && (month1 = month0)&& (day1 > day0))) {
int yearx = year0;
year0 = year1;
year1 = yearx;
int monthx = month0;
month0 = month1;
month1 = monthx;
int dayx = day0;
day0 = day1;
day1 = dayx;
}
int totalDays= 0;
while (year1 != year0 && month1 != month0 && day1 != day0) {
totalDays++;
day0 += 1;
if(month == 01 || month == 03 || month == 05 || month == 07 || month == 08 || month == 10 || month == 12 ) && (day ==31){
day0 = 1;
month0 += 1;
} else if (month == 04 || month == 06 || month == 09 || month == 11) && (day ==30){
day0 = 1;
month0 += 1;
}else if (month == 02) {
if ((isLeapYear(year)) && (day ==29) {
day0 = 1;
month0 += 1;
} else if (day = 28) {
day0 = 1;
month0 += 1;
}
}else(month0 > 12) {
month0 = 1;
year0 += 1;
}
}
return totalDays;
}
public static boolean hasLeapSecond(int year) {
if (int year = {1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1981, 1982, 1983, 1985, 1987, 1989, 1990, 1992, 1993, 1994, 1995, 1997, 1998, 2005, 2008, 2012, 2015})
return true;
}
public static boolean hasLeapSecond(int year, int month, int day) {
if (int month = 06 && int day = 30) {
{1972, 1981, 1982, 1983, 1985,1992, 1993, 1994, 1995, 1997, 1998, 2012,2015}
return true;
}
if (int month = 12 && int day = 31) {
{1972,1973,1974,1975,1976,1977,1978,1979,1987,1989,1990,1998, 2005, 2008,}
return true;
}
}
}
public static void main(String[] args) {
int year0 = Integer.parseInt(args[0]);
int month0 = Integer.parseInt(args[1]);
int day0 = Integer.parseInt(args[2]);
int year1 = Integer.parseInt(args[3]);
int month1 = Integer.parseInt(args[4]);
int day1 = Integer.parseInt(args[5]);
if (args.length == 0) {
System.out.println("Usage: java DateCounter <year0> <month0> <day0> <year1> <month1> <day1>");
} if (!(isValidDate(year0, month0, day0))) {
System.out.println("That is not a valid date!");
}
}
| [
"[email protected]"
]
| |
54acd5c04926df7ef5dd77582500911c96f4b2d5 | 3f9b24c318f900d43f403c76d50a77639a685461 | /src/main/java/testCaseFunction/TitleControl.java | cec72b947f814cca6b613adef72462b782e1dac1 | []
| no_license | ezgiiscioglu/TestAutomation | cf2330a2f3e350fafc59c6b6e7be8215b6e1be0e | 4b43a2eb9d6c7ad029c2b38de37312d6abedf314 | refs/heads/master | 2020-12-30T07:38:37.482133 | 2020-02-07T13:09:17 | 2020-02-07T13:09:17 | 238,911,078 | 0 | 0 | null | 2020-10-13T19:21:07 | 2020-02-07T11:57:00 | Java | UTF-8 | Java | false | false | 422 | java | package testCaseFunction;
import org.openqa.selenium.WebDriver;
import org.testng.Assert;
import utils.BasePage;
public class TitleControl extends BasePage {
public TitleControl(WebDriver driver) {
super(driver);
}
public String title() {
return driver.getTitle();
}
public void titleControl() {
Assert.assertEquals(title(),"n11.com - Alışverişin Uğurlu Adresi");
}
}
| [
"[email protected]"
]
| |
1ad31ec5bc9e9d1fb317c3dd5561c29db3293d59 | 21a091a9ebf6a8462f40ca141e9a3ec3c9ec7526 | /src/view/ColorStat.java | e3cfb1fcf0325d8bbbb1e9658984de228cc59e37 | [
"MIT"
]
| permissive | kepingwang/cell-society | f7f1a1daace96387c349a740435252f1aefa5331 | 353241e123ef2d4914fb3539b83bd5f0908bf607 | refs/heads/master | 2021-01-22T19:21:48.173835 | 2017-02-13T07:57:04 | 2017-02-13T07:57:04 | 102,418,160 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 296 | java | package view;
import javafx.scene.paint.Color;
public class ColorStat {
private Color color;
private double stat;
public ColorStat(Color color, double stat) {
this.color = color;
this.stat = stat;
}
public Color color() { return color; }
public double stat() { return stat; }
}
| [
"[email protected]"
]
| |
fccdb5aefb9d05c9c434ce5b41d538fe275b6bb7 | 6fd2b57bc94ecdc7db11641ff2dc4b08a14fb374 | /src/org/usfirst/frc/team1277/robot/commands/ClawPushCubeOut.java | 6e67c5a542882fa610171d93373786d74b157005 | []
| no_license | FRCTeam1277/Robot2018 | b5247bca0becdc4dd6b526c06fbfc0adc279a427 | 8d66a6cd1e03a9e806fe221ac244788a45e2d321 | refs/heads/master | 2021-04-18T20:16:49.087048 | 2018-03-24T00:02:48 | 2018-03-24T00:02:48 | 126,341,068 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 768 | java | package org.usfirst.frc.team1277.robot.commands;
import org.usfirst.frc.team1277.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
/**
*
*/
public class ClawPushCubeOut extends Command {
private final double PUSH_SPEED = -0.3;
private final double PUSH_TIME = 80;
private int counter;
public ClawPushCubeOut() {
requires(Robot.claw);
}
protected void initialize() {
counter = 0;
}
protected void execute() {
Robot.claw.dirveWheels(PUSH_SPEED, PUSH_SPEED);
counter++;
}
protected boolean isFinished() {
return (counter >= PUSH_TIME);
}
protected void end() {
Robot.claw.dirveWheels(0, 0);
}
protected void interrupted() {
Robot.claw.dirveWheels(0, 0);
}
}
| [
"[email protected]"
]
| |
0a01be483f245743d1970980b2c70b6e0d853aa7 | e4c3a11f7bbb17cf69acf1cf2a2eda576edb3c15 | /02.编码/1.申报/src/main/java/cs/repository/AbstractRepository.java | 60d61f3264d9252ced0c7b41258e7ffb39dc33bf | []
| no_license | 17688971686/ss | 00fc8d5736e593d07f6883f54b5fad15a824a11a | 7992e5b69777f34aa579739dd5e13e62ccd754db | refs/heads/master_1.6.0-lzs | 2022-12-21T16:01:32.289980 | 2019-10-10T08:33:17 | 2019-10-10T08:33:17 | 214,129,879 | 1 | 2 | null | 2022-12-16T10:57:36 | 2019-10-10T08:34:55 | JavaScript | UTF-8 | Java | false | false | 2,494 | java | package cs.repository;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.util.List;
import org.apache.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Criterion;
import org.springframework.beans.factory.annotation.Autowired;
import cs.repository.odata.ODataObj;
public class AbstractRepository<T,ID extends Serializable> implements IRepository<T, ID> {
protected static Logger logger = Logger.getLogger(AbstractRepository.class);
private Class<T> persistentClass;
private Session session;
@Autowired
private SessionFactory sessionFactory;
public Class<T> getPersistentClass(){
return persistentClass;
}
@SuppressWarnings("unchecked")
public AbstractRepository() {
this.persistentClass = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
}
@Override
public T findById(ID id) {
logger.debug("findById");
return getSession().load(this.getPersistentClass(), id);
}
@Override
public List<T> findAll() {
logger.debug("findAll");
return this.findByCriteria();
}
@Override
@SuppressWarnings({ "unchecked", "deprecation" })
public List<T> findByCriteria(Criterion ... criterion){
logger.debug("findByCriteria");
Criteria crit = this.getSession().createCriteria(this.getPersistentClass());
for(Criterion c: criterion){
crit.add(c);
}
return crit.list();
}
@Override
@SuppressWarnings({ "unchecked", "deprecation" })
public List<T> findByOdata(ODataObj oDataObj){
logger.debug("findByOdata");
Criteria crit = this.getSession().createCriteria(this.getPersistentClass());
List<T> list=oDataObj.buildQuery(crit).list();
return list;
}
@Override
public T save(T entity) {
logger.debug("save");
this.getSession().saveOrUpdate(entity);
return entity;
}
@Override
public void delete(T entity) {
logger.debug("delete");
this.getSession().delete(entity);
}
@Override
public void flush() {
logger.debug("flush");
this.getSession().flush();
}
@Override
public void clear() {
logger.debug("clear");
this.getSession().clear();
}
@Override
public void setSession(Session session) {
logger.debug("setSession");
this.session = session;
}
@Override
public Session getSession(){
logger.debug("getSession");
this.session = sessionFactory.getCurrentSession();
return this.session;
}
}
| [
"[email protected]"
]
| |
1dd758e39af6739d297ff8635482ef0f3df27984 | f121e10ab4ba1ac960402cdf97b3bb594acaf6da | /src/main/java/com/github/zuihoou/generator/VueGenerator.java | 6b51b28ed3ae65696b36f03f6d18d9cd5828c220 | []
| no_license | iQiuyu-0821/zuihou-generator | d7996f968a83f4d984a73f389e4b60029a70bfe7 | 437647759068f23e01abd2e397659452e4fd34f5 | refs/heads/master | 2023-01-18T16:44:04.048562 | 2020-11-11T08:23:22 | 2020-11-11T08:23:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,102 | java | package com.github.zuihoou.generator;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.FileOutConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.TemplateConfig;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.querys.DB2Query;
import com.baomidou.mybatisplus.generator.config.querys.DMQuery;
import com.baomidou.mybatisplus.generator.config.querys.H2Query;
import com.baomidou.mybatisplus.generator.config.querys.MariadbQuery;
import com.baomidou.mybatisplus.generator.config.querys.PostgreSqlQuery;
import com.baomidou.mybatisplus.generator.config.querys.SqlServerQuery;
import com.baomidou.mybatisplus.generator.config.querys.SqliteQuery;
import com.baomidou.mybatisplus.generator.config.rules.DateType;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.github.zuihoou.generator.config.CodeGeneratorConfig;
import com.github.zuihoou.generator.ext.FileOutConfigExt;
import com.github.zuihoou.generator.ext.FreemarkerTemplateEngineExt;
import com.github.zuihoou.generator.ext.MySqlQueryExt;
import com.github.zuihoou.generator.ext.OracleQueryExt;
import com.github.zuihoou.generator.type.GenerateType;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 代码生成
*
* @author zuihou
* @date 2019/05/25
*/
public class VueGenerator {
public static final String API_PATH = "Api";
public static final String PAGE_INDEX_PATH = "PageIndex";
public static final String TREE_INDEX_PATH = "TreeIndex";
public static final String EDIT_PATH = "Edit";
public static final String LANG_PATH = "Lang";
// public static final String QUERY_PATH = "Query";
// public static final String ENUM_PATH = "Enum";
// public static final String CONSTANT_PATH = "Constant";
// public static final String SAVE_DTO_PATH = "SaveDTO";
// public static final String UPDATE_DTO_PATH = "UpdateDTO";
// public static final String PAGE_DTO_PATH = "PageDTO";
// public static final String SRC_MAIN_JAVA = "src" + File.separator + "main" + File.separator + "java";
// public static final String SRC_MAIN_RESOURCE = "src" + File.separator + "main" + File.separator + "resources";
public static final String SRC = "src";
// public static final String SRC_API = "src" + File.separator + "api";
// public static final String SRC_VIEWS = "src" + File.separator + "views" + File.separator + "zuihou";
public static void run(final CodeGeneratorConfig config) {
// 代码生成器
AutoGenerator mpg = new AutoGenerator();
//项目的根路径
String projectRootPath = config.getProjectRootPath();
//全局配置
GlobalConfig gc = globalConfig(config, projectRootPath);
mpg.setGlobalConfig(gc);
// 数据源配置
DataSourceConfig dsc = dataSourceConfig(config);
mpg.setDataSource(dsc);
PackageConfig pc = packageConfig(config);
mpg.setPackageInfo(pc);
// 配置模板
TemplateConfig templateConfig = new TemplateConfig();
// 不生成下列文件
templateConfig.setController(null);
templateConfig.setServiceImpl(null);
templateConfig.setService(null);
templateConfig.setMapper(null);
templateConfig.setXml(null);
templateConfig.setEntity(null);
mpg.setTemplate(templateConfig);
// 自定义配置
InjectionConfig cfg = injectionConfig(config, projectRootPath, pc);
mpg.setCfg(cfg);
// 策略配置
StrategyConfig strategy = strategyConfig(config);
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngineExt(config));
mpg.execute();
System.err.println("前端代码生成完毕, 请在以上日志中查看生成文件的路径");
System.err.println("并将src/lang/lang.*.js中的配置按照文件提示,复制到en.js和zh.js, 否则页面无法显示中文标题");
}
/**
* 全局配置
*
* @param config 参数
* @param projectPath 项目根路径
* @return
*/
private static GlobalConfig globalConfig(final CodeGeneratorConfig config, String projectPath) {
GlobalConfig gc = new GlobalConfig();
gc.setOutputDir(String.format("%s/%s", projectPath, SRC));
gc.setAuthor(config.getAuthor());
gc.setOpen(false);
gc.setServiceName("%sService");
gc.setFileOverride(true);
gc.setBaseResultMap(true);
gc.setBaseColumnList(true);
gc.setDateType(DateType.TIME_PACK);
gc.setIdType(IdType.INPUT);
// 实体属性 Swagger2 注解
gc.setSwagger2(true);
return gc;
}
/**
* 数据库设置
*
* @param config
* @return
*/
private static DataSourceConfig dataSourceConfig(CodeGeneratorConfig config) {
DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl(config.getUrl());
dsc.setDriverName(config.getDriverName());
dsc.setUsername(config.getUsername());
dsc.setPassword(config.getPassword());
if (dsc.getDbType() == DbType.MYSQL) {
dsc.setDbQuery(new MySqlQueryExt());
}
// oracle 没完全测试
else if (dsc.getDbType() == DbType.ORACLE) {
dsc.setDbQuery(new OracleQueryExt());
}
// 以下的都没测试过
else if (dsc.getDbType() == DbType.DB2) {
dsc.setDbQuery(new DB2Query());
} else if (dsc.getDbType() == DbType.DM) {
dsc.setDbQuery(new DMQuery());
} else if (dsc.getDbType() == DbType.H2) {
dsc.setDbQuery(new H2Query());
} else if (dsc.getDbType() == DbType.MARIADB) {
dsc.setDbQuery(new MariadbQuery());
} else if (dsc.getDbType() == DbType.POSTGRE_SQL) {
dsc.setDbQuery(new PostgreSqlQuery());
} else if (dsc.getDbType() == DbType.SQLITE) {
dsc.setDbQuery(new SqliteQuery());
} else if (dsc.getDbType() == DbType.SQL_SERVER) {
dsc.setDbQuery(new SqlServerQuery());
}
return dsc;
}
private static PackageConfig packageConfig(final CodeGeneratorConfig config) {
PackageConfig pc = new PackageConfig();
// pc.setModuleName(config.getChildPackageName());
pc.setParent(config.getPackageBase());
pc.setMapper("dao");
if (StringUtils.isNotBlank(config.getChildPackageName())) {
pc.setMapper(pc.getMapper() + StringPool.DOT + config.getChildPackageName());
pc.setEntity(pc.getEntity() + StringPool.DOT + config.getChildPackageName());
pc.setService(pc.getService() + StringPool.DOT + config.getChildPackageName());
pc.setServiceImpl(pc.getService() + StringPool.DOT + "impl");
pc.setController(pc.getController() + StringPool.DOT + config.getChildPackageName());
}
// pc.setPathInfo(pathInfo(config));
return pc;
}
private static StrategyConfig strategyConfig(CodeGeneratorConfig pc) {
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
strategy.setEntityTableFieldAnnotationEnable(true);
strategy.setEntityLombokModel(true);
strategy.setChainModel(true);
strategy.setInclude(pc.getTableInclude());
strategy.setExclude(pc.getTableExclude());
strategy.setLikeTable(pc.getLikeTable());
strategy.setNotLikeTable(pc.getNotLikeTable());
strategy.setTablePrefix(pc.getTablePrefix());
strategy.setFieldPrefix(pc.getFieldPrefix());
strategy.setEntityColumnConstant(GenerateType.IGNORE.neq(pc.getFileCreateConfig().getGenerateConstant()));
strategy.setRestControllerStyle(true);
strategy.setSuperEntityClass(pc.getSuperEntity().getVal());
strategy.setSuperControllerClass(pc.getSuperControllerClass());
strategy.setSuperEntityColumns(pc.getSuperEntity().getColumns());
return strategy;
}
/**
* InjectionConfig 自定义配置 这里可以进行包路径的配置,自定义的代码生成器的接入配置。这里定义了xmlmapper 及query两个文件的自动生成配置
*/
private static InjectionConfig injectionConfig(final CodeGeneratorConfig config, String projectRootPath, PackageConfig pc) {
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
Map<String, Object> map = initImportPackageInfo(config);
this.setMap(map);
}
@Override
public void initTableMap(TableInfo tableInfo) {
this.initMap();
}
};
cfg.setFileCreate(config.getFileCreateConfig());
// 自定义输出配置
cfg.setFileOutConfigList(getFileConfig(config));
return cfg;
}
/**
* 配置包信息 配置规则是: parentPackage + "层" + "模块"
*/
public static Map<String, Object> initImportPackageInfo(CodeGeneratorConfig config) {
String parentPackage = config.getPackageBase();
String childPackageName = config.getChildPackageName();
Map<String, Object> packageMap = new HashMap<>();
packageMap.put("serviceName", config.getServiceName());
packageMap.put("childPackageName", childPackageName);
return packageMap;
}
private static List<FileOutConfig> getFileConfig(CodeGeneratorConfig config) {
List<FileOutConfig> focList = new ArrayList<>();
String projectRootPath = config.getProjectRootPath();
if (!projectRootPath.endsWith(File.separator)) {
projectRootPath += File.separator;
}
StringBuilder basePathSb = new StringBuilder(projectRootPath).append(SRC);
final String basePath = basePathSb.toString();
focList.add(new FileOutConfigExt(basePath, API_PATH, config));
focList.add(new FileOutConfigExt(basePath, PAGE_INDEX_PATH, config));
focList.add(new FileOutConfigExt(basePath, EDIT_PATH, config));
focList.add(new FileOutConfigExt(basePath, LANG_PATH, config));
focList.add(new FileOutConfigExt(basePath, TREE_INDEX_PATH, config));
return focList;
}
}
| [
"[email protected]"
]
| |
8ba6ca2bff39e68742637908e6117c4056c1a2ed | 8417fa7cf877d787e78ad0eb213d0a604c5a8a80 | /SHAdBST/src/main/java/com/bashi_group_01/www/util/PasueHeTongDetail.java | d086f1ca064f5a7bfe1f41aeaf83410e3d72832c | []
| no_license | JoeyChow1989/BitShare | f70e4bd2ecb4657188b1e8aad1b0c83c09e79ac3 | 77d2d95f40da3d9be9bca353555d5413cdfd209a | refs/heads/master | 2021-06-11T12:24:06.143044 | 2016-05-05T03:34:31 | 2016-05-05T03:34:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,676 | java | package com.bashi_group_01.www.util;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONObject;
import com.bashi_group_01.www.domain.HeTongDetail;
public class PasueHeTongDetail {
public static List<HeTongDetail> list = null;
public static List<HeTongDetail> Pasue(String result) {
try {
list = new ArrayList<HeTongDetail>();
JSONObject jsonObject = new JSONObject(result);
JSONObject jsonObject2 = jsonObject.getJSONObject("result");
HeTongDetail heTongDetail = new HeTongDetail();
heTongDetail.setContractId(jsonObject2.getString("ContractId"));
heTongDetail.setCutomer(jsonObject2.getString("Cutomer"));
heTongDetail.setMainObject(jsonObject2.getString("MainObject"));
heTongDetail.setAdContent(jsonObject2.getString("AdContent"));
heTongDetail.setContractType(jsonObject2.getString("ContractType"));
heTongDetail.setContractMoney(jsonObject2.getString("ContractMoney"));
heTongDetail.setStrartDate(jsonObject2.getString("StrartDate"));
heTongDetail.setEndDate(jsonObject2.getString("EndDate"));
heTongDetail.setPayType(jsonObject2.getString("PayType"));
heTongDetail.setSeller(jsonObject2.getString("Seller"));
heTongDetail.setKeywords(jsonObject2.getString("Keywords"));
heTongDetail.setSubmitType(jsonObject2.getString("SubmitType"));
heTongDetail.setSignDate(jsonObject2.getString("SignDate"));
heTongDetail.setBigType(jsonObject2.getString("BigType"));
heTongDetail.setKCFText(jsonObject2.getString("KCFText"));
heTongDetail.setPassflag(jsonObject2.getBoolean("passflag"));
list.add(heTongDetail);
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
}
| [
"[email protected]"
]
| |
66b06a784c03ae4df85ff2da10068668676ec520 | 0746224e3a819ca118a4fbc1fcba35a84a0a9262 | /TreasurePotA.java | 3ed065ce2cc36664eebfe11eacf713a6c8f97b37 | []
| no_license | wassgha/ChutesLaddersSimulator | 0e1931e4339cd59f1a44ece9d7187367226379fd | c97dc5d0eb10abcd64d2ef8bf909d6f18fe1b699 | refs/heads/master | 2021-05-30T19:34:09.926348 | 2016-03-08T16:00:31 | 2016-03-08T16:00:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,145 | java | /*
* This is the class for the treasure pot type A tile
*
* When a player enters the tile, he earns a number of coins
* When the player rolls the dice and leaves the tile, he leaves with
* the amount of the dice roll.
*
*/
public class TreasurePotA extends Components
{
public int bounty, maxBountiesGiven;
public TreasurePotA(int bounty, int maxBountiesGiven)
{
this.bounty = bounty;
this.maxBountiesGiven = maxBountiesGiven;
}
public int getBounty() {
return this.bounty;
}
public int getmaxBountiesGiven() {
return this.maxBountiesGiven;
}
public int leaveCell(Player player, int diceRoll) {
return diceRoll;
}
public int tryToLeaveCell(Player player, int diceRoll) {
return diceRoll;
}
public void enterCell(Player player, int diceRoll) {
player.addCoins(affectPlayerCoins(player, diceRoll));
}
public int affectPlayerCoins(Player player, int diceRoll) {
if(maxBountiesGiven > 0) {
maxBountiesGiven--;
return bounty;
}
return 0;
}
}
| [
"[email protected]"
]
| |
9fd2f856a914a5d8227b61f02af027c1439f1fd8 | a3e1d3e6387ae2f1d332b5a827e36fba63837a8c | /RecursionAndBackTracking/CountAllPaths.java | be8913d16ec008500baf579e67471648884096d9 | []
| no_license | mariyajosh/javaLocal | 30d6a9659d3a0d97304d314afae079577c0ba2eb | 940ad1d55fc8cebe2b76fd1b200a434e06ddbee5 | refs/heads/master | 2023-04-19T19:30:25.351711 | 2021-05-28T01:49:57 | 2021-05-28T01:49:57 | 371,551,131 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 550 | java | package RecursionAndBackTracking;
public class CountAllPaths {
public static int countPaths(int[][]mat,int dr,int dc){
for(int i=0;i<=dr;i++){
mat[i][0]=1;
}
for(int i=0;i<=dc;i++){
mat[0][i]=1;
}
for(int i=1;i<=dr;i++){
for(int j=1;j<=dc;j++){
mat[i][j]=mat[i-1][j]+mat[i][j-1];
}
}
return mat[dr][dc];
}
public static void main(String a[]){
int[][] mat=new int[5][4];
int dr=4;
int dc=3;
System.out.println(countPaths(mat,dr,dc));
}
}
| [
"[email protected]"
]
| |
81b794ea466eade5dc99ec4551d22ab4d3611555 | 2f92dfff9b9929b64e645fdc254815d06bf2b8d2 | /src/main/lee/code/code_862__Shortest_Subarray_with_Sum_at_Least_K/Solution.java | 43278d413708819722a66507b1cb964efa781e44 | [
"MIT"
]
| permissive | code543/leetcodequestions | fc5036d63e4c3e1b622fe73552fb33c039e63fb0 | 44cbfe6718ada04807b6600a5d62b9f0016d4ab2 | refs/heads/master | 2020-04-05T19:43:15.530768 | 2018-12-07T04:09:07 | 2018-12-07T04:09:07 | 157,147,529 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 912 | java | package lee.code.code_862__Shortest_Subarray_with_Sum_at_Least_K;
import java.util.*;
import lee.util.*;
/**
*
*
* 862.Shortest Subarray with Sum at Least K
*
* difficulty: Hard
* @see https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k/description/
* @see description_862.md
* @Similiar Topics
* -->Queue https://leetcode.com//tag/queue
* -->Binary Search https://leetcode.com//tag/binary-search
* @Similiar Problems
* Run solution from Unit Test:
* @see lee.codetest.code_862__Shortest_Subarray_with_Sum_at_Least_K.CodeTest
* Run solution from Main Judge Class:
* @see lee.code.code_862__Shortest_Subarray_with_Sum_at_Least_K.C862_MainClass
*
*/
class Solution {
public int shortestSubarray(int[] A, int K) {
return 0;
}
}
class Main1 {
public static void main(String[] args) {
//new Solution();
}
}
| [
"[email protected]"
]
| |
cb24ceb82e5fe65ab4ab619e28539b66e6d8ac3d | 1a8e8fc13f74906ac8aad616c01686d333f5bb77 | /src/main/java/com/vic/demo/property/WechatProperties.java | 3e12289b396bc5a2f4a94cec9cbbd65c77d75837 | []
| no_license | vincent12000/spring-boot-demo | 391f68aee8e2c668adeb9d26019c3def5dde652a | 993673005c8e13cbacaa01e4cd4bb961dd4a5f3b | refs/heads/master | 2022-04-28T14:21:00.689994 | 2022-03-08T08:32:26 | 2022-03-08T08:32:26 | 162,974,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 623 | java | package com.vic.demo.property;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@ConfigurationProperties(prefix = "wechat")
@Component
public class WechatProperties {
private String appid;
private String secret;
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid;
}
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
}
| [
"[email protected]"
]
| |
5e086a10f9a3ebccb71fee5c713bd023b4196ff4 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_319/Testnull_31832.java | d437faeb6ba4c5b7419de023657f505ab5277c30 | []
| no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 308 | java | package org.gradle.test.performancenull_319;
import static org.junit.Assert.*;
public class Testnull_31832 {
private final Productionnull_31832 production = new Productionnull_31832("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"[email protected]"
]
| |
8738a8608bdff0bdb90c77639a29eb2d3820491b | bd292f47546e43966b40cfa51e637c07ee49897d | /app/src/main/java/com/example/projektdyplomowyankiety/FragmentChangePassword.java | 6fddf4613cfcf5ac503d689fdc128152ef9eb154 | []
| no_license | przemek196/projektDyplomowyAnkiety | 30e3a5807f4df639e0f43312527527b1d6653c71 | be0d242fdbf81847e8e5309927040c47ca907b4d | refs/heads/master | 2022-12-24T20:03:32.695592 | 2020-10-12T14:53:15 | 2020-10-12T14:53:15 | 277,886,729 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,642 | java | package com.example.projektdyplomowyankiety;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.text.TextUtils;
import android.text.method.PasswordTransformationMethod;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
import com.example.projektdyplomowyankiety.EntryActivity;
import com.example.projektdyplomowyankiety.R;
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.AuthCredential;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.EmailAuthProvider;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.firestore.FirebaseFirestore;
import org.w3c.dom.Text;
public class FragmentChangePassword extends Fragment implements com.example.projektdyplomowyankiety.IOnBackPressed {
View view;
private static final String TAG = "FragmentRegisActivity";
EditText oldPass;
EditText newPass;
TextView emailUser;
Button btnChange;
TextView deleteAcount;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
view = inflater.inflate(R.layout.fragment_change_password, container, false);
Log.d(TAG, "onCreateView: started");
oldPass = view.findViewById(R.id.edTextOldPassword);
newPass = view.findViewById(R.id.edTextnewPass);
emailUser = view.findViewById(R.id.textViewEmailAdress);
btnChange = view.findViewById(R.id.changepssword);
deleteAcount = view.findViewById(R.id.tvDeleteAccount);
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
emailUser.setText(user.getEmail());
deleteAcount.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final AlertDialog dialogBuilder = new AlertDialog.Builder(getContext()).create();
LayoutInflater inflater = getActivity().getLayoutInflater();
View dialogView = inflater.inflate(R.layout.dialog_delete_account, null);
final EditText editTextpassword = (EditText) dialogView.findViewById(R.id.edt_comment);
Button button1 = (Button) dialogView.findViewById(R.id.buttonSubmit);
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//delete account
final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
AuthCredential credential = EmailAuthProvider
.getCredential(user.getEmail(), editTextpassword.getText().toString());
deletAllData(user);
user.reauthenticate(credential)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
user.delete()
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
Log.d(TAG, "User account deleted.");
}
}
});
}
});
dialogBuilder.dismiss();
FirebaseAuth.getInstance().signOut();
Intent intent = new Intent(getContext(), EntryActivity.class);
startActivity(intent);
Toast.makeText(getContext(), "Wylogowano", Toast.LENGTH_SHORT).show();
}
});
dialogBuilder.setView(dialogView);
dialogBuilder.show();
}
});
btnChange.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
AuthCredential credential = EmailAuthProvider
.getCredential(user.getEmail(), oldPass.getText().toString());
user.reauthenticate(credential)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
user.updatePassword(newPass.getText().toString()).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
FirebaseAuth.getInstance().signOut();
Intent intent = new Intent(getContext(), EntryActivity.class);
startActivity(intent);
Toast.makeText(getContext(), "Hasło zostało zmienione.", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getContext(), "Hasło nie zostało zmienione.", Toast.LENGTH_SHORT).show();
}
}
});
} else {
Toast.makeText(getContext(), "Błąd autoryzacji.", Toast.LENGTH_SHORT).show();
}
}
});
}
});
return view;
}
@Override
public boolean onBackPressed() {
((MainMenu) getActivity()).goToCalendarFragment();
return true;
}
private void deletAllData(FirebaseUser user) {
FirebaseFirestore db = FirebaseFirestore.getInstance();
//delete all data from firestore
/*
db.collection("Users").document(user.getUid())
.delete()
.addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Log.d(TAG, "DocumentSnapshot successfully deleted!");
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.w(TAG, "Error deleting document", e);
}
});
*/
}
//check internet connection
private boolean isConnectingToInternet(Context applicationContext) {
ConnectivityManager conectManager = (ConnectivityManager) this.getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netwInf = conectManager.getActiveNetworkInfo();
if (netwInf == null) {
return false;
} else
return true;
}
}
| [
"[email protected]"
]
| |
5935ff00b0809e06cfac75b8617228363c26654b | 7b413de2e619050db4645a80add0e445d9947f0f | /src/part01/sec01/exam02/Ex02_01.java | b33a36a6b6d848609a6cf0380ff8e47e917edb83 | []
| no_license | lovelybg0506/Chapter02 | 49cbd70db04ae0019826924bb68d2ba6c0b1bbe0 | b62a33a762181fe221de8da2470518173f28bf9c | refs/heads/master | 2023-03-11T16:47:34.337556 | 2021-02-26T08:05:20 | 2021-02-26T08:05:20 | null | 0 | 0 | null | null | null | null | UHC | Java | false | false | 467 | java | package part01.sec01.exam02;
public class Ex02_01 {
public static void main(String[] args) {
int a;
int b;
int result;
a=100;
b=50;
result =a+b;
System.out.println(a+b); //덧셈 연산
System.out.println(a+"+"+b+"="+result); // 변수(a)+"문자열" : +연결
result=a-b;
System.out.println(a+"-"+b+"="+result);
result=a*b;
System.out.println(a+"*"+b+"="+result);
result=a/b;
System.out.println(a+"/"+b+"="+result);
}
}
| [
"[email protected]"
]
| |
3e080ba831577ba7a85c7e03e52efe68eda68eed | 360c3af5ab01028ad60840f7ed23edf762b3d850 | /src/br/ufrn/ppgsc/backhoe/persistence/model/helper/Diff.java | 93671b9ecb0fb6a58d39717b67f5c4449de44d84 | []
| no_license | jalerson/backhoe | f54f2037c874ef27ca71c44366f10a300338db98 | 9999f08ab7062e3bf352388a78559c2126b02204 | refs/heads/master | 2016-09-06T03:08:20.482500 | 2015-07-31T00:00:38 | 2015-07-31T00:00:38 | 32,612,556 | 8 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,370 | java | package br.ufrn.ppgsc.backhoe.persistence.model.helper;
import java.util.LinkedList;
import java.util.List;
import br.ufrn.ppgsc.backhoe.persistence.model.ChangedPath;
import br.ufrn.ppgsc.backhoe.persistence.model.Task;
public class Diff {
// private TaskLog log;
private Task task;
private String fixingRevision;
private String previousRevision;
private String startRevision;
private ChangedPath changedPath;
private List<DiffChild> children;
public Diff(){
this.children = new LinkedList<DiffChild>();
}
public Diff(Task task, String fixingRevision, String previousRevision,
String startRevision, ChangedPath changedPath) {
this(task, fixingRevision, previousRevision, startRevision, changedPath, new LinkedList<DiffChild>());
}
public Diff(Task task, String fixingRevision, String previousRevision,
String startRevision, ChangedPath changedPath,
List<DiffChild> children) {
super();
this.task = task;
this.fixingRevision = fixingRevision;
this.previousRevision = previousRevision;
this.startRevision = startRevision;
this.changedPath = changedPath;
this.children = children;
}
public Task getTask() {
return task;
}
public void setTask(Task task) {
this.task = task;
}
public String getFixingRevision() {
return fixingRevision;
}
public void setFixingRevision(String fixingRevision) {
this.fixingRevision = fixingRevision;
}
public String getPreviousRevision() {
return previousRevision;
}
public void setPreviousRevision(String previousRevision) {
this.previousRevision = previousRevision;
}
public String getStartRevision() {
return startRevision;
}
public void setStartRevision(String startRevision) {
this.startRevision = startRevision;
}
public ChangedPath getChangedPath() {
return changedPath;
}
public void setChangedPath(ChangedPath changedPath) {
this.changedPath = changedPath;
}
public List<DiffChild> getChildren() {
return children;
}
public void setChildren(List<DiffChild> children) {
this.children = children;
}
@Override
public String toString() {
return "Diff [fixingRevision=" + fixingRevision + ", previousRevision="
+ previousRevision + ", startRevision=" + startRevision
+ ", changedPath=" + changedPath + ", children=" + children
+ "]";
}
}
| [
"[email protected]"
]
| |
ad373e480fa4b6955af2e117c3aa711f160317c7 | cafd3eabfb5eb2c3472cb51116430f934057513b | /src/main/java/com/dada/test/constructor/AbstractTest.java | e48c96002e958c6dd03d4a783cd7633f80ed28bf | []
| no_license | pisory/spring-content-test | 88bfa7b423363f8ba992a3cdda4cba94d3660414 | 82cfb70da70115656a8b2dfef2cedd3ae84490f6 | refs/heads/master | 2022-12-23T11:32:56.437452 | 2019-12-07T04:01:17 | 2019-12-07T04:01:17 | 210,639,806 | 0 | 0 | null | 2022-12-16T09:43:07 | 2019-09-24T15:43:27 | Java | UTF-8 | Java | false | false | 231 | java | package com.dada.test.constructor;
/**
* @author zhoudahua
* @date 2019/6/14
* @description
*/
public abstract class AbstractTest {
public int a = 5;
public abstract void method(int a);
public void method(){}
}
| [
"[email protected]"
]
| |
265b7e829d67ede41777839f45f8c7edfcadae93 | c47be256449a92767c90f9d4cd122188b1b90082 | /TI/Old/src/animation/GroupBox.java | eb66b70fc364b2b8f0118a06c713b163a68a2cb2 | []
| no_license | BoogieZero/School | e14e4a95065ddceb47e8a8f3f211c669e197245c | f9d2b12f574631abd29d3062fd9290c259565660 | refs/heads/master | 2020-04-08T16:39:07.636257 | 2018-11-28T16:00:44 | 2018-11-28T16:00:44 | 159,528,386 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 838 | java | package animation;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
public class GroupBox extends StackPane {
public GroupBox(String title, Node content) {
Label lbTitle = new Label(" " + title + " ");
lbTitle.setStyle( "-fx-translate-y: -10;"+
"-fx-background-color: white;");
//lbTitle.translateYProperty().set(-16);
setAlignment(lbTitle, Pos.TOP_CENTER);
StackPane contentPane = new StackPane();
content.setStyle("-fx-padding: 26 10 10 10;");
contentPane.getChildren().add(content);
setStyle( "-fx-content-display: top;"+
"-fx-border-insets: 20 15 15 15;"+
"-fx-border-color: black;"+
"-fx-border-width: 1;"+
"-fx-background-color: white;");
getChildren().addAll(lbTitle, contentPane);
}
}
| [
"[email protected]"
]
| |
804523c60fceeeabbaba5ed33c5fbe5d1d0a0e7f | 6ca007cfafb37a8f9166e2c9021992e93994da32 | /s4/b151304/Frequencer.java | e540a5f99aa5007be17970cdef12c5bd8cd264a0 | []
| no_license | tut173358/tut2017informationQuantity | 686488928adb5c6a1c1a972118a72a0dde9cac3a | e01b8c6c85f2db2e2bfdfd4858e3e2ecfb5fe00b | refs/heads/master | 2021-09-07T02:41:11.056649 | 2018-02-16T00:04:58 | 2018-02-16T00:04:58 | 113,954,715 | 0 | 0 | null | 2017-12-12T06:54:56 | 2017-12-12T06:54:55 | null | UTF-8 | Java | false | false | 2,347 | java | package s4.b151304; // Please modify to s4.Bnnnnnn, where nnnnnn is your student ID.
import java.lang.*;
import s4.specification.*;
/*
interface FrequencerInterface { // This interface provides the design for frequency counter.
void setTarget(byte[] target); // set the data to search.
void setSpace(byte[] space); // set the data to be searched target from.
int frequency(); //It return -1, when TARGET is not set or TARGET's length is zero
//Otherwise, it return 0, when SPACE is not set or Space's length is zero
//Otherwise, get the frequency of TAGET in SPACE
int subByteFrequency(int start, int end);
// get the frequency of subByte of taget, i.e target[start], taget[start+1], ... , target[end-1].
// For the incorrect value of START or END, the behavior is undefined.
*/
public class Frequencer implements FrequencerInterface{
// Code to Test, *warning: This code contains intentional problem*
byte [] myTarget;
byte [] mySpace;
public void setTarget(byte [] target) { myTarget = target;}
public void setSpace(byte []space) { mySpace = space; }
public int frequency() {
int targetLength = myTarget.length;
int spaceLength = mySpace.length;
int count = 0;
for(int start = 0; start<spaceLength; start++) { // Is it OK?
boolean abort = false;
for(int i = 0; i<targetLength; i++) {
if(myTarget[i] != mySpace[start+i]) { abort = true; break; }
}
if(abort == false) { count++; }
}
return count;
}
// I know that here is a potential problem in the declaration.
public int subByteFrequency(int start, int length) {
// Not yet, but it is not currently used by anyone.
return -1;
}
public static void main(String[] args) {
Frequencer myObject;
int freq;
try {
System.out.println("checking my Frequencer");
myObject = new Frequencer();
myObject.setSpace("Hi Ho Hi Ho".getBytes());
myObject.setTarget("H".getBytes());
freq = myObject.frequency();
System.out.print("\"H\" in \"Hi Ho Hi Ho\" appears "+freq+" times. ");
if(4 == freq) { System.out.println("OK"); } else {System.out.println("WRONG"); }
}
catch(Exception e) {
System.out.println("Exception occurred: STOP");
}
}
}
| [
"[email protected]"
]
| |
81a0f33cb8a2d949ca4d25f73a9bb46224d22896 | 7378949608fbecd16482c3e9150b2c7b207a3a72 | /src/userdefinedclass/Car.java | 9b3c33fefe0937bf3cffe0378ca1e421c0dcaf5e | []
| no_license | PeopleNTechJavaSelenium/core-java-ds | 0456b13bd6f2ed7a87b1d5396e4e6bbee01dcbc5 | 6ce77197f8bfc28605a5a7b37ab68962fe09564f | refs/heads/master | 2021-01-17T11:10:43.300877 | 2015-12-05T21:07:31 | 2015-12-05T21:07:31 | 47,472,542 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 258 | java | package userdefinedclass;
public class Car {
String carModel = "Acura" ;
public Car(String carModel){
this.carModel = carModel;
System.out.println(carModel);
}
public void driver(){
System.out.println("Need a driver to drive the car");
}
}
| [
"[email protected]"
]
| |
7d35fec2874d626afd04cc74c65e339b5b85bd39 | c6c391145d906bf895f82af13daca7a69403eb36 | /api/src/test/java/com/lhl/test/cxf20161216/TestProductClient.java | e1c203f4b1e59bd9994493eb853a0ee9a41f7e43 | []
| no_license | lunhengle/20161216 | c629e713e926f178eac16ddb0a0f80d8238a30f0 | 78508221a6894bde6078960aa8ff057abfea9aaf | refs/heads/master | 2021-01-12T05:51:44.386871 | 2017-03-22T02:04:27 | 2017-03-22T02:04:27 | 77,219,958 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,655 | java | package com.lhl.test.cxf20161216;
import com.lhl.api20161216.cxf.vo.Product;
import org.apache.cxf.jaxrs.client.WebClient;
import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.MediaType;
import java.util.ArrayList;
import java.util.List;
/**
* Created by lunhengle on 2016/12/22.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring/rs/cxf/applicationContext-rs-client.xml"})
public class TestProductClient {
private static Logger logger = LoggerFactory.getLogger(TestPersonClient.class);
private static String baseAddress = "http://localhost:8080/webservice";
private static List<Object> providerList = new ArrayList();
@Before
public void setup() {
providerList.add(new JacksonJsonProvider());
}
/**
* 根据id 获取产品.
*/
@Test
public void testProductById() {
Product product = WebClient.create(baseAddress, providerList).path("/product/get/id2").accept(MediaType.APPLICATION_JSON).get(Product.class);
logger.info(" id = " + product.getId() + " name = " + product.getName() + " level = " + product.getLevel() + " type = " + product.getType());
}
/**
* 根据id和name获取产品.
*/
@Test
public void testProductByIdAndName() {
Product product = WebClient.create(baseAddress, providerList).path("/product/get/id2/姓名2").accept(MediaType.APPLICATION_JSON).get(Product.class);
logger.info(" id = " + product.getId() + " name = " + product.getName() + " level = " + product.getLevel() + " type = " + product.getType());
}
/**
* 获取产品列表.
*/
@Test
public void testProducts() {
List<Product> products = WebClient.create(baseAddress, providerList).path("/product/get/products").accept(MediaType.APPLICATION_JSON).get(new GenericType<List<Product>>() {
});
for (Product product : products) {
logger.info(" id = " + product.getId() + " name = " + product.getName() + " level = " + product.getLevel() + " type = " + product.getType());
}
}
/**
* 测试更新.
*/
@Test
public void testUpdateProduct() {
Product product = WebClient.create(baseAddress, providerList).path("/product/get/id2").accept(MediaType.APPLICATION_JSON).get(Product.class);
logger.info("更新前!");
logger.info(" id = " + product.getId() + " name = " + product.getName() + " level = " + product.getLevel() + " type = " + product.getType());
product.setName("lunhengle");
WebClient.create(baseAddress, providerList).path("/product/update").accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).put(product, Product.class);
product = WebClient.create(baseAddress, providerList).path("/product/get/id2").accept(MediaType.APPLICATION_JSON).get(Product.class);
logger.info("更新后!");
logger.info(" id = " + product.getId() + " name = " + product.getName() + " level = " + product.getLevel() + " type = " + product.getType());
}
/**
* 测试增加.
*/
@Test
public void testAddProduct() {
Product product = new Product();
product.setId("id5");
product.setName("名字5");
product.setLevel("等级5");
product.setType("类型5");
WebClient.create(baseAddress, providerList).path("/product/add").accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).post(product, Product.class);
product = WebClient.create(baseAddress, providerList).path("/product/get/id5").accept(MediaType.APPLICATION_JSON).get(Product.class);
logger.info("更新后!");
logger.info(" id = " + product.getId() + " name = " + product.getName() + " level = " + product.getLevel() + " type = " + product.getType());
}
/**
* 删除资源.
*/
@Test
public void testDeleteProdcut() {
WebClient.create(baseAddress, providerList).path("/product/delete/id1").accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).delete();
Product product = WebClient.create(baseAddress, providerList).path("/product/get/id1").accept(MediaType.APPLICATION_JSON).get(Product.class);
Assert.assertEquals("删除成功!", null, product);
}
}
| [
"[email protected]"
]
| |
804e5212885897f7de86243dcff8db4370d6a6e2 | 4312a71c36d8a233de2741f51a2a9d28443cd95b | /RawExperiments/Lang/Lang40/1/AstorMain-lang40/src/variant-69/org/apache/commons/lang/StringUtils.java | 1d210af187fd7766704e33f26356e18c0234b7a1 | []
| no_license | SajjadZaidi/AutoRepair | 5c7aa7a689747c143cafd267db64f1e365de4d98 | e21eb9384197bae4d9b23af93df73b6e46bb749a | refs/heads/master | 2021-05-07T00:07:06.345617 | 2017-12-02T18:48:14 | 2017-12-02T18:48:14 | 112,858,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 71,681 | java | package org.apache.commons.lang;
public class StringUtils {
public static final java.lang.String EMPTY = "";
public static final int INDEX_NOT_FOUND = -1;
private static final int PAD_LIMIT = 8192;
public StringUtils() {
super();
}
public static boolean isEmpty(java.lang.CharSequence str) {
return (str == null) || ((str.length()) == 0);
}
public static boolean isNotEmpty(java.lang.CharSequence str) {
return !(org.apache.commons.lang.StringUtils.isEmpty(str));
}
public static boolean isBlank(java.lang.CharSequence str) {
int strLen;
if ((str == null) || ((strLen = str.length()) == 0)) {
return true;
}
for (int i = 0 ; i < strLen ; i++) {
if ((java.lang.Character.isWhitespace(str.charAt(i))) == false) {
return false;
}
}
return true;
}
public static boolean isNotBlank(java.lang.CharSequence str) {
return !(org.apache.commons.lang.StringUtils.isBlank(str));
}
public static java.lang.String trim(java.lang.String str) {
return str == null ? null : str.trim();
}
public static java.lang.String trimToNull(java.lang.String str) {
java.lang.String ts = org.apache.commons.lang.StringUtils.trim(str);
return org.apache.commons.lang.StringUtils.isEmpty(ts) ? null : ts;
}
public static java.lang.String trimToEmpty(java.lang.String str) {
return str == null ? org.apache.commons.lang.StringUtils.EMPTY : str.trim();
}
public static java.lang.String strip(java.lang.String str) {
return org.apache.commons.lang.StringUtils.strip(str, null);
}
public static java.lang.String stripToNull(java.lang.String str) {
if (str == null) {
return null;
}
str = org.apache.commons.lang.StringUtils.strip(str, null);
return (str.length()) == 0 ? null : str;
}
public static java.lang.String stripToEmpty(java.lang.String str) {
return str == null ? org.apache.commons.lang.StringUtils.EMPTY : org.apache.commons.lang.StringUtils.strip(str, null);
}
public static java.lang.String strip(java.lang.String str, java.lang.String stripChars) {
if (org.apache.commons.lang.StringUtils.isEmpty(str)) {
return str;
}
str = org.apache.commons.lang.StringUtils.stripStart(str, stripChars);
return org.apache.commons.lang.StringUtils.stripEnd(str, stripChars);
}
public static java.lang.String stripStart(java.lang.String str, java.lang.String stripChars) {
int strLen;
if ((str == null) || ((strLen = str.length()) == 0)) {
return str;
}
int start = 0;
if (stripChars == null) {
while ((start != strLen) && (java.lang.Character.isWhitespace(str.charAt(start)))) {
start++;
}
} else {
if ((stripChars.length()) == 0) {
return str;
} else {
while ((start != strLen) && ((stripChars.indexOf(str.charAt(start))) != (-1))) {
start++;
}
}
}
return str.substring(start);
}
public static java.lang.String stripEnd(java.lang.String str, java.lang.String stripChars) {
int end;
if ((str == null) || ((end = str.length()) == 0)) {
return str;
}
if (stripChars == null) {
while ((end != 0) && (java.lang.Character.isWhitespace(str.charAt((end - 1))))) {
end--;
}
} else {
if ((stripChars.length()) == 0) {
return str;
} else {
while ((end != 0) && ((stripChars.indexOf(str.charAt((end - 1)))) != (-1))) {
end--;
}
}
}
return str.substring(0, end);
}
public static java.lang.String[] stripAll(java.lang.String[] strs) {
return org.apache.commons.lang.StringUtils.stripAll(strs, null);
}
public static java.lang.String[] stripAll(java.lang.String[] strs, java.lang.String stripChars) {
int strsLen;
if ((strs == null) || ((strsLen = strs.length) == 0)) {
return strs;
}
java.lang.String[] newArr = new java.lang.String[strsLen];
for (int i = 0 ; i < strsLen ; i++) {
newArr[i] = org.apache.commons.lang.StringUtils.strip(strs[i], stripChars);
}
return newArr;
}
public static boolean equals(java.lang.String str1, java.lang.String str2) {
return str1 == null ? str2 == null : str1.equals(str2);
}
public static boolean equalsIgnoreCase(java.lang.String str1, java.lang.String str2) {
return str1 == null ? str2 == null : str1.equalsIgnoreCase(str2);
}
public static int indexOf(java.lang.String str, char searchChar) {
if (org.apache.commons.lang.StringUtils.isEmpty(str)) {
return -1;
}
return str.indexOf(searchChar);
}
public static int indexOf(java.lang.String str, char searchChar, int startPos) {
if (org.apache.commons.lang.StringUtils.isEmpty(str)) {
return -1;
}
return str.indexOf(searchChar, startPos);
}
public static int indexOf(java.lang.String str, java.lang.String searchStr) {
if ((str == null) || (searchStr == null)) {
return -1;
}
return str.indexOf(searchStr);
}
public static int ordinalIndexOf(java.lang.String str, java.lang.String searchStr, int ordinal) {
if (((str == null) || (searchStr == null)) || (ordinal <= 0)) {
return org.apache.commons.lang.StringUtils.INDEX_NOT_FOUND;
}
if ((searchStr.length()) == 0) {
return 0;
}
int found = 0;
int index = org.apache.commons.lang.StringUtils.INDEX_NOT_FOUND;
do {
index = str.indexOf(searchStr, (index + 1));
if (index < 0) {
return index;
}
found++;
} while (found < ordinal );
return index;
}
public static int indexOf(java.lang.String str, java.lang.String searchStr, int startPos) {
if ((str == null) || (searchStr == null)) {
return -1;
}
if (((searchStr.length()) == 0) && (startPos >= (str.length()))) {
return str.length();
}
return str.indexOf(searchStr, startPos);
}
public static int lastIndexOf(java.lang.String str, char searchChar) {
if (org.apache.commons.lang.StringUtils.isEmpty(str)) {
return -1;
}
return str.lastIndexOf(searchChar);
}
public static int lastIndexOf(java.lang.String str, char searchChar, int startPos) {
if (org.apache.commons.lang.StringUtils.isEmpty(str)) {
return -1;
}
return str.lastIndexOf(searchChar, startPos);
}
public static int lastIndexOf(java.lang.String str, java.lang.String searchStr) {
if ((str == null) || (searchStr == null)) {
return -1;
}
return str.lastIndexOf(searchStr);
}
public static int lastIndexOf(java.lang.String str, java.lang.String searchStr, int startPos) {
if ((str == null) || (searchStr == null)) {
return -1;
}
return str.lastIndexOf(searchStr, startPos);
}
public static boolean contains(java.lang.String str, char searchChar) {
if (org.apache.commons.lang.StringUtils.isEmpty(str)) {
return false;
}
return (str.indexOf(searchChar)) >= 0;
}
public static boolean contains(java.lang.String str, java.lang.String searchStr) {
if ((str == null) || (searchStr == null)) {
return false;
}
return (str.indexOf(searchStr)) >= 0;
org.apache.commons.lang.CharSet.COMMON.put("a-z", org.apache.commons.lang.CharSet.ASCII_ALPHA_LOWER);
}
public static boolean containsIgnoreCase(java.lang.String str, java.lang.String searchStr) {
if ((str == null) || (searchStr == null)) {
return false;
}
return org.apache.commons.lang.StringUtils.contains(str.toUpperCase(), searchStr.toUpperCase());
}
public static int indexOfAny(java.lang.String str, char[] searchChars) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (org.apache.commons.lang.ArrayUtils.isEmpty(searchChars))) {
return -1;
}
for (int i = 0 ; i < (str.length()) ; i++) {
char ch = str.charAt(i);
for (int j = 0 ; j < (searchChars.length) ; j++) {
if ((searchChars[j]) == ch) {
return i;
}
}
}
return -1;
}
public static int indexOfAny(java.lang.String str, java.lang.String searchChars) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (org.apache.commons.lang.StringUtils.isEmpty(searchChars))) {
return -1;
}
return org.apache.commons.lang.StringUtils.indexOfAny(str, searchChars.toCharArray());
}
public static boolean containsAny(java.lang.String str, char[] searchChars) {
if ((((str == null) || ((str.length()) == 0)) || (searchChars == null)) || ((searchChars.length) == 0)) {
return false;
}
for (int i = 0 ; i < (str.length()) ; i++) {
char ch = str.charAt(i);
for (int j = 0 ; j < (searchChars.length) ; j++) {
if ((searchChars[j]) == ch) {
return true;
}
}
}
return false;
}
public static boolean containsAny(java.lang.String str, java.lang.String searchChars) {
if (searchChars == null) {
return false;
}
return org.apache.commons.lang.StringUtils.containsAny(str, searchChars.toCharArray());
}
public static int indexOfAnyBut(java.lang.String str, char[] searchChars) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (org.apache.commons.lang.ArrayUtils.isEmpty(searchChars))) {
return -1;
}
outer : for (int i = 0 ; i < (str.length()) ; i++) {
char ch = str.charAt(i);
for (int j = 0 ; j < (searchChars.length) ; j++) {
if ((searchChars[j]) == ch) {
continue outer;
}
}
return i;
}
return -1;
}
public static int indexOfAnyBut(java.lang.String str, java.lang.String searchChars) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (org.apache.commons.lang.StringUtils.isEmpty(searchChars))) {
return -1;
}
for (int i = 0 ; i < (str.length()) ; i++) {
if ((searchChars.indexOf(str.charAt(i))) < 0) {
return i;
}
}
return -1;
}
public static boolean containsOnly(java.lang.String str, char[] valid) {
if ((valid == null) || (str == null)) {
return false;
}
if ((str.length()) == 0) {
return true;
}
if ((valid.length) == 0) {
return false;
}
return (org.apache.commons.lang.StringUtils.indexOfAnyBut(str, valid)) == (-1);
}
public static boolean containsOnly(java.lang.String str, java.lang.String validChars) {
if ((str == null) || (validChars == null)) {
return false;
}
return org.apache.commons.lang.StringUtils.containsOnly(str, validChars.toCharArray());
}
public static boolean containsNone(java.lang.String str, char[] invalidChars) {
if ((str == null) || (invalidChars == null)) {
return true;
}
int strSize = str.length();
int validSize = invalidChars.length;
for (int i = 0 ; i < strSize ; i++) {
char ch = str.charAt(i);
for (int j = 0 ; j < validSize ; j++) {
if ((invalidChars[j]) == ch) {
return false;
}
}
}
return true;
}
public static boolean containsNone(java.lang.String str, java.lang.String invalidChars) {
if ((str == null) || (invalidChars == null)) {
return true;
}
return org.apache.commons.lang.StringUtils.containsNone(str, invalidChars.toCharArray());
}
public static int indexOfAny(java.lang.String str, java.lang.String[] searchStrs) {
if ((str == null) || (searchStrs == null)) {
return -1;
}
int sz = searchStrs.length;
int ret = java.lang.Integer.MAX_VALUE;
int tmp = 0;
for (int i = 0 ; i < sz ; i++) {
java.lang.String search = searchStrs[i];
if (search == null) {
continue;
}
tmp = str.indexOf(search);
if (tmp == (-1)) {
continue;
}
if (tmp < ret) {
ret = tmp;
}
}
return ret == (java.lang.Integer.MAX_VALUE) ? -1 : ret;
}
public static int lastIndexOfAny(java.lang.String str, java.lang.String[] searchStrs) {
if ((str == null) || (searchStrs == null)) {
return -1;
}
int sz = searchStrs.length;
int ret = -1;
int tmp = 0;
for (int i = 0 ; i < sz ; i++) {
java.lang.String search = searchStrs[i];
if (search == null) {
continue;
}
tmp = str.lastIndexOf(search);
if (tmp > ret) {
ret = tmp;
}
}
return ret;
}
public static java.lang.String substring(java.lang.String str, int start) {
if (str == null) {
return null;
}
if (start < 0) {
start = (str.length()) + start;
}
if (start < 0) {
start = 0;
}
if (start > (str.length())) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
return str.substring(start);
}
public static java.lang.String substring(java.lang.String str, int start, int end) {
if (str == null) {
return null;
}
if (end < 0) {
end = (str.length()) + end;
}
if (start < 0) {
start = (str.length()) + start;
}
if (end > (str.length())) {
end = str.length();
}
if (start > end) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
if (start < 0) {
start = 0;
}
if (end < 0) {
end = 0;
}
return str.substring(start, end);
}
public static java.lang.String left(java.lang.String str, int len) {
if (str == null) {
return null;
}
if (len < 0) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
if ((str.length()) <= len) {
return str;
}
return str.substring(0, len);
}
public static java.lang.String right(java.lang.String str, int len) {
if (str == null) {
return null;
}
if (len < 0) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
if ((str.length()) <= len) {
return str;
}
return str.substring(((str.length()) - len));
}
public static java.lang.String mid(java.lang.String str, int pos, int len) {
if (str == null) {
return null;
}
if ((len < 0) || (pos > (str.length()))) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
if (pos < 0) {
pos = 0;
}
if ((str.length()) <= (pos + len)) {
return str.substring(pos);
}
return str.substring(pos, (pos + len));
}
public static java.lang.String substringBefore(java.lang.String str, java.lang.String separator) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (separator == null)) {
return str;
}
if ((separator.length()) == 0) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
int pos = str.indexOf(separator);
if (pos == (-1)) {
return str;
}
return str.substring(0, pos);
}
public static java.lang.String substringAfter(java.lang.String str, java.lang.String separator) {
if (org.apache.commons.lang.StringUtils.isEmpty(str)) {
return str;
}
if (separator == null) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
int pos = str.indexOf(separator);
if (pos == (-1)) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
return str.substring((pos + (separator.length())));
}
public static java.lang.String substringBeforeLast(java.lang.String str, java.lang.String separator) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (org.apache.commons.lang.StringUtils.isEmpty(separator))) {
return str;
}
int pos = str.lastIndexOf(separator);
if (pos == (-1)) {
return str;
}
return str.substring(0, pos);
}
public static java.lang.String substringAfterLast(java.lang.String str, java.lang.String separator) {
if (org.apache.commons.lang.StringUtils.isEmpty(str)) {
return str;
}
if (org.apache.commons.lang.StringUtils.isEmpty(separator)) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
int pos = str.lastIndexOf(separator);
if ((pos == (-1)) || (pos == ((str.length()) - (separator.length())))) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
return str.substring((pos + (separator.length())));
}
public static java.lang.String substringBetween(java.lang.String str, java.lang.String tag) {
return org.apache.commons.lang.StringUtils.substringBetween(str, tag, tag);
}
public static java.lang.String substringBetween(java.lang.String str, java.lang.String open, java.lang.String close) {
if (((str == null) || (open == null)) || (close == null)) {
return null;
}
int start = str.indexOf(open);
if (start != (-1)) {
int end = str.indexOf(close, (start + (open.length())));
if (end != (-1)) {
return str.substring((start + (open.length())), end);
}
}
return null;
}
public static java.lang.String[] substringsBetween(java.lang.String str, java.lang.String open, java.lang.String close) {
if (((str == null) || (org.apache.commons.lang.StringUtils.isEmpty(open))) || (org.apache.commons.lang.StringUtils.isEmpty(close))) {
return null;
}
int strLen = str.length();
if (strLen == 0) {
return org.apache.commons.lang.ArrayUtils.EMPTY_STRING_ARRAY;
}
int closeLen = close.length();
int openLen = open.length();
java.util.List<java.lang.String> list = new java.util.ArrayList<java.lang.String>();
int pos = 0;
while (pos < (strLen - closeLen)) {
int start = str.indexOf(open, pos);
if (start < 0) {
break;
}
start += openLen;
int end = str.indexOf(close, start);
if (end < 0) {
break;
}
list.add(str.substring(start, end));
pos = end + closeLen;
}
if (list.isEmpty()) {
return null;
}
return list.toArray(new java.lang.String[list.size()]);
}
public static java.lang.String[] split(java.lang.String str) {
return org.apache.commons.lang.StringUtils.split(str, null, (-1));
}
public static java.lang.String[] split(java.lang.String str, char separatorChar) {
return org.apache.commons.lang.StringUtils.splitWorker(str, separatorChar, false);
}
public static java.lang.String[] split(java.lang.String str, java.lang.String separatorChars) {
return org.apache.commons.lang.StringUtils.splitWorker(str, separatorChars, (-1), false);
}
public static java.lang.String[] split(java.lang.String str, java.lang.String separatorChars, int max) {
return org.apache.commons.lang.StringUtils.splitWorker(str, separatorChars, max, false);
}
public static java.lang.String[] splitByWholeSeparator(java.lang.String str, java.lang.String separator) {
return org.apache.commons.lang.StringUtils.splitByWholeSeparatorWorker(str, separator, (-1), false);
}
public static java.lang.String[] splitByWholeSeparator(java.lang.String str, java.lang.String separator, int max) {
return org.apache.commons.lang.StringUtils.splitByWholeSeparatorWorker(str, separator, max, false);
}
public static java.lang.String[] splitByWholeSeparatorPreserveAllTokens(java.lang.String str, java.lang.String separator) {
return org.apache.commons.lang.StringUtils.splitByWholeSeparatorWorker(str, separator, (-1), true);
}
public static java.lang.String[] splitByWholeSeparatorPreserveAllTokens(java.lang.String str, java.lang.String separator, int max) {
return org.apache.commons.lang.StringUtils.splitByWholeSeparatorWorker(str, separator, max, true);
}
private static java.lang.String[] splitByWholeSeparatorWorker(java.lang.String str, java.lang.String separator, int max, boolean preserveAllTokens) {
if (str == null) {
return null;
}
int len = str.length();
if (len == 0) {
return org.apache.commons.lang.ArrayUtils.EMPTY_STRING_ARRAY;
}
if ((separator == null) || (org.apache.commons.lang.StringUtils.EMPTY.equals(separator))) {
return org.apache.commons.lang.StringUtils.splitWorker(str, null, max, preserveAllTokens);
}
int separatorLength = separator.length();
java.util.ArrayList<java.lang.String> substrings = new java.util.ArrayList<java.lang.String>();
int numberOfSubstrings = 0;
int beg = 0;
int end = 0;
while (end < len) {
end = str.indexOf(separator, beg);
if (end > (-1)) {
if (end > beg) {
numberOfSubstrings += 1;
if (numberOfSubstrings == max) {
end = len;
substrings.add(str.substring(beg));
} else {
substrings.add(str.substring(beg, end));
beg = end + separatorLength;
}
} else {
if (preserveAllTokens) {
numberOfSubstrings += 1;
if (numberOfSubstrings == max) {
end = len;
substrings.add(str.substring(beg));
} else {
substrings.add(org.apache.commons.lang.StringUtils.EMPTY);
}
}
beg = end + separatorLength;
}
} else {
substrings.add(str.substring(beg));
end = len;
}
}
return substrings.toArray(new java.lang.String[substrings.size()]);
}
public static java.lang.String[] splitPreserveAllTokens(java.lang.String str) {
return org.apache.commons.lang.StringUtils.splitWorker(str, null, (-1), true);
}
public static java.lang.String[] splitPreserveAllTokens(java.lang.String str, char separatorChar) {
return org.apache.commons.lang.StringUtils.splitWorker(str, separatorChar, true);
}
private static java.lang.String[] splitWorker(java.lang.String str, char separatorChar, boolean preserveAllTokens) {
if (str == null) {
return null;
}
int len = str.length();
if (len == 0) {
return org.apache.commons.lang.ArrayUtils.EMPTY_STRING_ARRAY;
}
java.util.List<java.lang.String> list = new java.util.ArrayList<java.lang.String>();
int i = 0;
int start = 0;
boolean match = false;
boolean lastMatch = false;
while (i < len) {
if ((str.charAt(i)) == separatorChar) {
if (match || preserveAllTokens) {
list.add(str.substring(start, i));
match = false;
lastMatch = true;
}
start = ++i;
continue;
}
lastMatch = false;
match = true;
i++;
}
if (match || (preserveAllTokens && lastMatch)) {
list.add(str.substring(start, i));
}
return list.toArray(new java.lang.String[list.size()]);
}
public static java.lang.String[] splitPreserveAllTokens(java.lang.String str, java.lang.String separatorChars) {
return org.apache.commons.lang.StringUtils.splitWorker(str, separatorChars, (-1), true);
}
public static java.lang.String[] splitPreserveAllTokens(java.lang.String str, java.lang.String separatorChars, int max) {
return org.apache.commons.lang.StringUtils.splitWorker(str, separatorChars, max, true);
}
private static java.lang.String[] splitWorker(java.lang.String str, java.lang.String separatorChars, int max, boolean preserveAllTokens) {
if (str == null) {
return null;
}
int len = str.length();
if (len == 0) {
return org.apache.commons.lang.ArrayUtils.EMPTY_STRING_ARRAY;
}
java.util.List<java.lang.String> list = new java.util.ArrayList<java.lang.String>();
int sizePlus1 = 1;
int i = 0;
int start = 0;
boolean match = false;
boolean lastMatch = false;
if (separatorChars == null) {
while (i < len) {
if (java.lang.Character.isWhitespace(str.charAt(i))) {
if (match || preserveAllTokens) {
lastMatch = true;
if ((sizePlus1++) == max) {
i = len;
lastMatch = false;
}
list.add(str.substring(start, i));
match = false;
}
start = ++i;
continue;
}
lastMatch = false;
match = true;
i++;
}
} else {
if ((separatorChars.length()) == 1) {
char sep = separatorChars.charAt(0);
while (i < len) {
if ((str.charAt(i)) == sep) {
if (match || preserveAllTokens) {
lastMatch = true;
if ((sizePlus1++) == max) {
i = len;
lastMatch = false;
}
list.add(str.substring(start, i));
match = false;
}
start = ++i;
continue;
}
lastMatch = false;
match = true;
i++;
}
} else {
while (i < len) {
if ((separatorChars.indexOf(str.charAt(i))) >= 0) {
if (match || preserveAllTokens) {
lastMatch = true;
if ((sizePlus1++) == max) {
i = len;
lastMatch = false;
}
list.add(str.substring(start, i));
match = false;
}
start = ++i;
continue;
}
lastMatch = false;
match = true;
i++;
}
}
}
if (match || (preserveAllTokens && lastMatch)) {
list.add(str.substring(start, i));
}
return list.toArray(new java.lang.String[list.size()]);
}
public static java.lang.String[] splitByCharacterType(java.lang.String str) {
return org.apache.commons.lang.StringUtils.splitByCharacterType(str, false);
}
public static java.lang.String[] splitByCharacterTypeCamelCase(java.lang.String str) {
return org.apache.commons.lang.StringUtils.splitByCharacterType(str, true);
}
private static java.lang.String[] splitByCharacterType(java.lang.String str, boolean camelCase) {
if (str == null) {
return null;
}
if ((str.length()) == 0) {
return org.apache.commons.lang.ArrayUtils.EMPTY_STRING_ARRAY;
}
char[] c = str.toCharArray();
java.util.List<java.lang.String> list = new java.util.ArrayList<java.lang.String>();
int tokenStart = 0;
int currentType = java.lang.Character.getType(c[tokenStart]);
for (int pos = tokenStart + 1 ; pos < (c.length) ; pos++) {
int type = java.lang.Character.getType(c[pos]);
if (type == currentType) {
continue;
}
if ((camelCase && (type == (java.lang.Character.LOWERCASE_LETTER))) && (currentType == (java.lang.Character.UPPERCASE_LETTER))) {
int newTokenStart = pos - 1;
if (newTokenStart != tokenStart) {
list.add(new java.lang.String(c , tokenStart , (newTokenStart - tokenStart)));
tokenStart = newTokenStart;
}
} else {
list.add(new java.lang.String(c , tokenStart , (pos - tokenStart)));
tokenStart = pos;
}
currentType = type;
}
list.add(new java.lang.String(c , tokenStart , ((c.length) - tokenStart)));
return list.toArray(new java.lang.String[list.size()]);
}
public static java.lang.String join(java.lang.Object[] array) {
return org.apache.commons.lang.StringUtils.join(array, null);
}
public static java.lang.String join(java.lang.Object[] array, char separator) {
if (array == null) {
return null;
}
return org.apache.commons.lang.StringUtils.join(array, separator, 0, array.length);
}
public static java.lang.String join(java.lang.Object[] array, char separator, int startIndex, int endIndex) {
if (array == null) {
return null;
}
int bufSize = endIndex - startIndex;
if (bufSize <= 0) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
bufSize *= ((array[startIndex]) == null ? 16 : array[startIndex].toString().length()) + 1;
java.lang.StringBuilder buf = new java.lang.StringBuilder(bufSize);
for (int i = startIndex ; i < endIndex ; i++) {
if (i > startIndex) {
buf.append(separator);
}
if ((array[i]) != null) {
buf.append(array[i]);
}
}
return buf.toString();
}
public static java.lang.String join(java.lang.Object[] array, java.lang.String separator) {
if (array == null) {
return null;
}
return org.apache.commons.lang.StringUtils.join(array, separator, 0, array.length);
}
public static java.lang.String join(java.lang.Object[] array, java.lang.String separator, int startIndex, int endIndex) {
if (array == null) {
return null;
}
if (separator == null) {
separator = org.apache.commons.lang.StringUtils.EMPTY;
}
int bufSize = endIndex - startIndex;
if (bufSize <= 0) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
bufSize *= ((array[startIndex]) == null ? 16 : array[startIndex].toString().length()) + (separator.length());
java.lang.StringBuilder buf = new java.lang.StringBuilder(bufSize);
for (int i = startIndex ; i < endIndex ; i++) {
if (i > startIndex) {
buf.append(separator);
}
if ((array[i]) != null) {
buf.append(array[i]);
}
}
return buf.toString();
}
public static java.lang.String join(java.util.Iterator<?> iterator, char separator) {
if (iterator == null) {
return null;
}
if (!(iterator.hasNext())) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
java.lang.Object first = iterator.next();
if (!(iterator.hasNext())) {
return org.apache.commons.lang.ObjectUtils.toString(first);
}
java.lang.StringBuilder buf = new java.lang.StringBuilder(256);
if (first != null) {
buf.append(first);
}
while (iterator.hasNext()) {
buf.append(separator);
java.lang.Object obj = iterator.next();
if (obj != null) {
buf.append(obj);
}
}
return buf.toString();
}
public static java.lang.String join(java.util.Iterator<?> iterator, java.lang.String separator) {
if (iterator == null) {
return null;
}
if (!(iterator.hasNext())) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
java.lang.Object first = iterator.next();
if (!(iterator.hasNext())) {
return org.apache.commons.lang.ObjectUtils.toString(first);
}
java.lang.StringBuilder buf = new java.lang.StringBuilder(256);
if (first != null) {
buf.append(first);
}
while (iterator.hasNext()) {
if (separator != null) {
buf.append(separator);
}
java.lang.Object obj = iterator.next();
if (obj != null) {
buf.append(obj);
}
}
return buf.toString();
}
public static java.lang.String join(java.util.Collection<?> collection, char separator) {
if (collection == null) {
return null;
}
return org.apache.commons.lang.StringUtils.join(collection.iterator(), separator);
}
public static java.lang.String join(java.util.Collection<?> collection, java.lang.String separator) {
if (collection == null) {
return null;
}
return org.apache.commons.lang.StringUtils.join(collection.iterator(), separator);
}
public static java.lang.String deleteWhitespace(java.lang.String str) {
if (org.apache.commons.lang.StringUtils.isEmpty(str)) {
return str;
}
int sz = str.length();
char[] chs = new char[sz];
int count = 0;
for (int i = 0 ; i < sz ; i++) {
if (!(java.lang.Character.isWhitespace(str.charAt(i)))) {
chs[(count++)] = str.charAt(i);
}
}
if (count == sz) {
return str;
}
return new java.lang.String(chs , 0 , count);
}
public static java.lang.String removeStart(java.lang.String str, java.lang.String remove) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (org.apache.commons.lang.StringUtils.isEmpty(remove))) {
return str;
}
if (str.startsWith(remove)) {
return str.substring(remove.length());
}
return str;
}
public static java.lang.String removeStartIgnoreCase(java.lang.String str, java.lang.String remove) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (org.apache.commons.lang.StringUtils.isEmpty(remove))) {
return str;
}
if (org.apache.commons.lang.StringUtils.startsWithIgnoreCase(str, remove)) {
return str.substring(remove.length());
}
return str;
}
public static java.lang.String removeEnd(java.lang.String str, java.lang.String remove) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (org.apache.commons.lang.StringUtils.isEmpty(remove))) {
return str;
}
if (str.endsWith(remove)) {
return str.substring(0, ((str.length()) - (remove.length())));
}
return str;
}
public static java.lang.String removeEndIgnoreCase(java.lang.String str, java.lang.String remove) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (org.apache.commons.lang.StringUtils.isEmpty(remove))) {
return str;
}
if (org.apache.commons.lang.StringUtils.endsWithIgnoreCase(str, remove)) {
return str.substring(0, ((str.length()) - (remove.length())));
}
return str;
}
public static java.lang.String remove(java.lang.String str, java.lang.String remove) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (org.apache.commons.lang.StringUtils.isEmpty(remove))) {
return str;
}
return org.apache.commons.lang.StringUtils.replace(str, remove, org.apache.commons.lang.StringUtils.EMPTY, (-1));
}
public static java.lang.String remove(java.lang.String str, char remove) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || ((str.indexOf(remove)) == (-1))) {
return str;
}
char[] chars = str.toCharArray();
int pos = 0;
for (int i = 0 ; i < (chars.length) ; i++) {
if ((chars[i]) != remove) {
chars[(pos++)] = chars[i];
}
}
return new java.lang.String(chars , 0 , pos);
}
public static java.lang.String replaceOnce(java.lang.String text, java.lang.String searchString, java.lang.String replacement) {
return org.apache.commons.lang.StringUtils.replace(text, searchString, replacement, 1);
}
public static java.lang.String replace(java.lang.String text, java.lang.String searchString, java.lang.String replacement) {
return org.apache.commons.lang.StringUtils.replace(text, searchString, replacement, (-1));
}
public static java.lang.String replace(java.lang.String text, java.lang.String searchString, java.lang.String replacement, int max) {
if ((((org.apache.commons.lang.StringUtils.isEmpty(text)) || (org.apache.commons.lang.StringUtils.isEmpty(searchString))) || (replacement == null)) || (max == 0)) {
return text;
}
int start = 0;
int end = text.indexOf(searchString, start);
if (end == (-1)) {
return text;
}
int replLength = searchString.length();
int increase = (replacement.length()) - replLength;
increase = increase < 0 ? 0 : increase;
increase *= max < 0 ? 16 : max > 64 ? 64 : max;
java.lang.StringBuilder buf = new java.lang.StringBuilder(((text.length()) + increase));
while (end != (-1)) {
buf.append(text.substring(start, end)).append(replacement);
start = end + replLength;
if ((--max) == 0) {
break;
}
end = text.indexOf(searchString, start);
}
buf.append(text.substring(start));
return buf.toString();
}
public static java.lang.String replaceEach(java.lang.String text, java.lang.String[] searchList, java.lang.String[] replacementList) {
return org.apache.commons.lang.StringUtils.replaceEach(text, searchList, replacementList, false, 0);
}
public static java.lang.String replaceEachRepeatedly(java.lang.String text, java.lang.String[] searchList, java.lang.String[] replacementList) {
int timeToLive = searchList == null ? 0 : searchList.length;
return org.apache.commons.lang.StringUtils.replaceEach(text, searchList, replacementList, true, timeToLive);
}
private static java.lang.String replaceEach(java.lang.String text, java.lang.String[] searchList, java.lang.String[] replacementList, boolean repeat, int timeToLive) {
if ((((((text == null) || ((text.length()) == 0)) || (searchList == null)) || ((searchList.length) == 0)) || (replacementList == null)) || ((replacementList.length) == 0)) {
return text;
}
if (timeToLive < 0) {
throw new java.lang.IllegalStateException(((("TimeToLive of " + timeToLive) + " is less than 0: ") + text));
}
int searchLength = searchList.length;
int replacementLength = replacementList.length;
if (searchLength != replacementLength) {
throw new java.lang.IllegalArgumentException(((("Search and Replace array lengths don't match: " + searchLength) + " vs ") + replacementLength));
}
boolean[] noMoreMatchesForReplIndex = new boolean[searchLength];
int textIndex = -1;
int replaceIndex = -1;
int tempIndex = -1;
for (int i = 0 ; i < searchLength ; i++) {
if ((((noMoreMatchesForReplIndex[i]) || ((searchList[i]) == null)) || ((searchList[i].length()) == 0)) || ((replacementList[i]) == null)) {
continue;
}
tempIndex = text.indexOf(searchList[i]);
if (tempIndex == (-1)) {
noMoreMatchesForReplIndex[i] = true;
} else {
if ((textIndex == (-1)) || (tempIndex < textIndex)) {
textIndex = tempIndex;
replaceIndex = i;
}
}
}
if (textIndex == (-1)) {
return text;
}
int start = 0;
int increase = 0;
for (int i = 0 ; i < (searchList.length) ; i++) {
int greater = (replacementList[i].length()) - (searchList[i].length());
if (greater > 0) {
increase += 3 * greater;
}
}
increase = java.lang.Math.min(increase, ((text.length()) / 5));
java.lang.StringBuilder buf = new java.lang.StringBuilder(((text.length()) + increase));
while (textIndex != (-1)) {
for (int i = start ; i < textIndex ; i++) {
buf.append(text.charAt(i));
}
buf.append(replacementList[replaceIndex]);
start = textIndex + (searchList[replaceIndex].length());
textIndex = -1;
replaceIndex = -1;
tempIndex = -1;
for (int i = 0 ; i < searchLength ; i++) {
if ((((noMoreMatchesForReplIndex[i]) || ((searchList[i]) == null)) || ((searchList[i].length()) == 0)) || ((replacementList[i]) == null)) {
continue;
}
tempIndex = text.indexOf(searchList[i], start);
if (tempIndex == (-1)) {
noMoreMatchesForReplIndex[i] = true;
} else {
if ((textIndex == (-1)) || (tempIndex < textIndex)) {
textIndex = tempIndex;
replaceIndex = i;
}
}
}
}
int textLength = text.length();
for (int i = start ; i < textLength ; i++) {
buf.append(text.charAt(i));
}
java.lang.String result = buf.toString();
if (!repeat) {
return result;
}
return org.apache.commons.lang.StringUtils.replaceEach(result, searchList, replacementList, repeat, (timeToLive - 1));
}
public static java.lang.String replaceChars(java.lang.String str, char searchChar, char replaceChar) {
if (str == null) {
return null;
}
return str.replace(searchChar, replaceChar);
}
public static java.lang.String replaceChars(java.lang.String str, java.lang.String searchChars, java.lang.String replaceChars) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (org.apache.commons.lang.StringUtils.isEmpty(searchChars))) {
return str;
}
if (replaceChars == null) {
replaceChars = org.apache.commons.lang.StringUtils.EMPTY;
}
boolean modified = false;
int replaceCharsLength = replaceChars.length();
int strLength = str.length();
java.lang.StringBuilder buf = new java.lang.StringBuilder(strLength);
for (int i = 0 ; i < strLength ; i++) {
char ch = str.charAt(i);
int index = searchChars.indexOf(ch);
if (index >= 0) {
modified = true;
if (index < replaceCharsLength) {
buf.append(replaceChars.charAt(index));
}
} else {
buf.append(ch);
}
}
if (modified) {
return buf.toString();
}
return str;
}
public static java.lang.String overlay(java.lang.String str, java.lang.String overlay, int start, int end) {
if (str == null) {
return null;
}
if (overlay == null) {
overlay = org.apache.commons.lang.StringUtils.EMPTY;
}
int len = str.length();
if (start < 0) {
start = 0;
}
if (start > len) {
start = len;
}
if (end < 0) {
end = 0;
}
if (end > len) {
end = len;
}
if (start > end) {
int temp = start;
start = end;
end = temp;
}
return new java.lang.StringBuilder(((((len + start) - end) + (overlay.length())) + 1)).append(str.substring(0, start)).append(overlay).append(str.substring(end)).toString();
}
public static java.lang.String chomp(java.lang.String str) {
if (org.apache.commons.lang.StringUtils.isEmpty(str)) {
return str;
}
if ((str.length()) == 1) {
char ch = str.charAt(0);
if ((ch == (org.apache.commons.lang.CharUtils.CR)) || (ch == (org.apache.commons.lang.CharUtils.LF))) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
return str;
}
int lastIdx = (str.length()) - 1;
char last = str.charAt(lastIdx);
if (last == (org.apache.commons.lang.CharUtils.LF)) {
if ((str.charAt((lastIdx - 1))) == (org.apache.commons.lang.CharUtils.CR)) {
lastIdx--;
}
} else {
if (last != (org.apache.commons.lang.CharUtils.CR)) {
lastIdx++;
}
}
return str.substring(0, lastIdx);
}
public static java.lang.String chomp(java.lang.String str, java.lang.String separator) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (separator == null)) {
return str;
}
if (str.endsWith(separator)) {
return str.substring(0, ((str.length()) - (separator.length())));
}
return str;
}
public static java.lang.String chop(java.lang.String str) {
if (str == null) {
return null;
}
int strLen = str.length();
if (strLen < 2) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
int lastIdx = strLen - 1;
java.lang.String ret = str.substring(0, lastIdx);
char last = str.charAt(lastIdx);
if (last == (org.apache.commons.lang.CharUtils.LF)) {
if ((ret.charAt((lastIdx - 1))) == (org.apache.commons.lang.CharUtils.CR)) {
return ret.substring(0, (lastIdx - 1));
}
}
return ret;
}
public static java.lang.String repeat(java.lang.String str, int repeat) {
if (str == null) {
return null;
}
if (repeat <= 0) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
int inputLength = str.length();
if ((repeat == 1) || (inputLength == 0)) {
return str;
}
if ((inputLength == 1) && (repeat <= (org.apache.commons.lang.StringUtils.PAD_LIMIT))) {
return org.apache.commons.lang.StringUtils.padding(repeat, str.charAt(0));
}
int outputLength = inputLength * repeat;
switch (inputLength) {
case 1 :
char ch = str.charAt(0);
char[] output1 = new char[outputLength];
for (int i = repeat - 1 ; i >= 0 ; i--) {
output1[i] = ch;
}
return new java.lang.String(output1);
case 2 :
char ch0 = str.charAt(0);
char ch1 = str.charAt(1);
char[] output2 = new char[outputLength];
for (int i = (repeat * 2) - 2 ; i >= 0 ; i-- , i--) {
output2[i] = ch0;
output2[(i + 1)] = ch1;
}
return new java.lang.String(output2);
default :
java.lang.StringBuilder buf = new java.lang.StringBuilder(outputLength);
for (int i = 0 ; i < repeat ; i++) {
buf.append(str);
}
return buf.toString();
}
}
public static java.lang.String repeat(java.lang.String str, java.lang.String separator, int repeat) {
if ((str == null) || (separator == null)) {
return org.apache.commons.lang.StringUtils.repeat(str, repeat);
} else {
java.lang.String result = org.apache.commons.lang.StringUtils.repeat((str + separator), repeat);
return org.apache.commons.lang.StringUtils.removeEnd(result, separator);
}
}
private static java.lang.String padding(int repeat, char padChar) throws java.lang.IndexOutOfBoundsException {
if (repeat < 0) {
throw new java.lang.IndexOutOfBoundsException(("Cannot pad a negative amount: " + repeat));
}
final char[] buf = new char[repeat];
for (int i = 0 ; i < (buf.length) ; i++) {
buf[i] = padChar;
}
return new java.lang.String(buf);
}
public static java.lang.String rightPad(java.lang.String str, int size) {
return org.apache.commons.lang.StringUtils.rightPad(str, size, ' ');
}
public static java.lang.String rightPad(java.lang.String str, int size, char padChar) {
if (str == null) {
return null;
}
int pads = size - (str.length());
if (pads <= 0) {
return str;
}
if (pads > (org.apache.commons.lang.StringUtils.PAD_LIMIT)) {
return org.apache.commons.lang.StringUtils.rightPad(str, size, java.lang.String.valueOf(padChar));
}
return str.concat(org.apache.commons.lang.StringUtils.padding(pads, padChar));
}
public static java.lang.String rightPad(java.lang.String str, int size, java.lang.String padStr) {
if (str == null) {
return null;
}
if (org.apache.commons.lang.StringUtils.isEmpty(padStr)) {
padStr = " ";
}
int padLen = padStr.length();
int strLen = str.length();
int pads = size - strLen;
if (pads <= 0) {
return str;
}
if ((padLen == 1) && (pads <= (org.apache.commons.lang.StringUtils.PAD_LIMIT))) {
return org.apache.commons.lang.StringUtils.rightPad(str, size, padStr.charAt(0));
}
if (pads == padLen) {
return str.concat(padStr);
} else {
if (pads < padLen) {
return str.concat(padStr.substring(0, pads));
} else {
char[] padding = new char[pads];
char[] padChars = padStr.toCharArray();
for (int i = 0 ; i < pads ; i++) {
padding[i] = padChars[(i % padLen)];
}
return str.concat(new java.lang.String(padding));
}
}
}
public static java.lang.String leftPad(java.lang.String str, int size) {
return org.apache.commons.lang.StringUtils.leftPad(str, size, ' ');
}
public static java.lang.String leftPad(java.lang.String str, int size, char padChar) {
if (str == null) {
return null;
}
int pads = size - (str.length());
if (pads <= 0) {
return str;
}
if (pads > (org.apache.commons.lang.StringUtils.PAD_LIMIT)) {
return org.apache.commons.lang.StringUtils.leftPad(str, size, java.lang.String.valueOf(padChar));
}
return org.apache.commons.lang.StringUtils.padding(pads, padChar).concat(str);
}
public static java.lang.String leftPad(java.lang.String str, int size, java.lang.String padStr) {
if (str == null) {
return null;
}
if (org.apache.commons.lang.StringUtils.isEmpty(padStr)) {
padStr = " ";
}
int padLen = padStr.length();
int strLen = str.length();
int pads = size - strLen;
if (pads <= 0) {
return str;
}
if ((padLen == 1) && (pads <= (org.apache.commons.lang.StringUtils.PAD_LIMIT))) {
return org.apache.commons.lang.StringUtils.leftPad(str, size, padStr.charAt(0));
}
if (pads == padLen) {
return padStr.concat(str);
} else {
if (pads < padLen) {
return padStr.substring(0, pads).concat(str);
} else {
char[] padding = new char[pads];
char[] padChars = padStr.toCharArray();
for (int i = 0 ; i < pads ; i++) {
padding[i] = padChars[(i % padLen)];
}
return new java.lang.String(padding).concat(str);
}
}
}
public static int length(java.lang.String str) {
return str == null ? 0 : str.length();
}
public static java.lang.String center(java.lang.String str, int size) {
return org.apache.commons.lang.StringUtils.center(str, size, ' ');
}
public static java.lang.String center(java.lang.String str, int size, char padChar) {
if ((str == null) || (size <= 0)) {
return str;
}
int strLen = str.length();
int pads = size - strLen;
if (pads <= 0) {
return str;
}
str = org.apache.commons.lang.StringUtils.leftPad(str, (strLen + (pads / 2)), padChar);
str = org.apache.commons.lang.StringUtils.rightPad(str, size, padChar);
return str;
}
public static java.lang.String center(java.lang.String str, int size, java.lang.String padStr) {
if ((str == null) || (size <= 0)) {
return str;
}
if (org.apache.commons.lang.StringUtils.isEmpty(padStr)) {
padStr = " ";
}
int strLen = str.length();
int pads = size - strLen;
if (pads <= 0) {
return str;
}
str = org.apache.commons.lang.StringUtils.leftPad(str, (strLen + (pads / 2)), padStr);
str = org.apache.commons.lang.StringUtils.rightPad(str, size, padStr);
return str;
}
public static java.lang.String upperCase(java.lang.String str) {
if (str == null) {
return null;
}
return str.toUpperCase();
}
public static java.lang.String upperCase(java.lang.String str, java.util.Locale locale) {
if (str == null) {
return null;
}
return str.toUpperCase(locale);
}
public static java.lang.String lowerCase(java.lang.String str) {
if (str == null) {
return null;
}
return str.toLowerCase();
}
public static java.lang.String lowerCase(java.lang.String str, java.util.Locale locale) {
if (str == null) {
return null;
}
return str.toLowerCase(locale);
}
public static java.lang.String capitalize(java.lang.String str) {
int strLen;
if ((str == null) || ((strLen = str.length()) == 0)) {
return str;
}
return new java.lang.StringBuilder(strLen).append(java.lang.Character.toTitleCase(str.charAt(0))).append(str.substring(1)).toString();
}
public static java.lang.String uncapitalize(java.lang.String str) {
int strLen;
if ((str == null) || ((strLen = str.length()) == 0)) {
return str;
}
return new java.lang.StringBuilder(strLen).append(java.lang.Character.toLowerCase(str.charAt(0))).append(str.substring(1)).toString();
}
public static java.lang.String swapCase(java.lang.String str) {
int strLen;
if ((str == null) || ((strLen = str.length()) == 0)) {
return str;
}
java.lang.StringBuilder buffer = new java.lang.StringBuilder(strLen);
char ch = 0;
for (int i = 0 ; i < strLen ; i++) {
ch = str.charAt(i);
if (java.lang.Character.isUpperCase(ch)) {
ch = java.lang.Character.toLowerCase(ch);
} else {
if (java.lang.Character.isTitleCase(ch)) {
ch = java.lang.Character.toLowerCase(ch);
} else {
if (java.lang.Character.isLowerCase(ch)) {
ch = java.lang.Character.toUpperCase(ch);
}
}
}
buffer.append(ch);
}
return buffer.toString();
}
public static int countMatches(java.lang.String str, java.lang.String sub) {
if ((org.apache.commons.lang.StringUtils.isEmpty(str)) || (org.apache.commons.lang.StringUtils.isEmpty(sub))) {
return 0;
}
int count = 0;
int idx = 0;
while ((idx = str.indexOf(sub, idx)) != (-1)) {
count++;
idx += sub.length();
}
return count;
}
public static boolean isAlpha(java.lang.String str) {
if (str == null) {
return false;
}
int sz = str.length();
for (int i = 0 ; i < sz ; i++) {
if ((java.lang.Character.isLetter(str.charAt(i))) == false) {
return false;
}
}
return true;
}
public static boolean isAlphaSpace(java.lang.String str) {
if (str == null) {
return false;
}
int sz = str.length();
for (int i = 0 ; i < sz ; i++) {
if (((java.lang.Character.isLetter(str.charAt(i))) == false) && ((str.charAt(i)) != ' ')) {
return false;
}
}
return true;
}
public static boolean isAlphanumeric(java.lang.String str) {
if (str == null) {
return false;
}
int sz = str.length();
for (int i = 0 ; i < sz ; i++) {
if ((java.lang.Character.isLetterOrDigit(str.charAt(i))) == false) {
return false;
}
}
return true;
}
public static boolean isAlphanumericSpace(java.lang.String str) {
if (str == null) {
return false;
}
int sz = str.length();
for (int i = 0 ; i < sz ; i++) {
if (((java.lang.Character.isLetterOrDigit(str.charAt(i))) == false) && ((str.charAt(i)) != ' ')) {
return false;
}
}
return true;
}
public static boolean isAsciiPrintable(java.lang.String str) {
if (str == null) {
return false;
}
int sz = str.length();
for (int i = 0 ; i < sz ; i++) {
if ((org.apache.commons.lang.CharUtils.isAsciiPrintable(str.charAt(i))) == false) {
return false;
}
}
return true;
}
public static boolean isNumeric(java.lang.String str) {
if (str == null) {
return false;
}
int sz = str.length();
for (int i = 0 ; i < sz ; i++) {
if ((java.lang.Character.isDigit(str.charAt(i))) == false) {
return false;
}
}
return true;
}
public static boolean isNumericSpace(java.lang.String str) {
if (str == null) {
return false;
}
int sz = str.length();
for (int i = 0 ; i < sz ; i++) {
if (((java.lang.Character.isDigit(str.charAt(i))) == false) && ((str.charAt(i)) != ' ')) {
return false;
}
}
return true;
}
public static boolean isWhitespace(java.lang.String str) {
if (str == null) {
return false;
}
int sz = str.length();
for (int i = 0 ; i < sz ; i++) {
if ((java.lang.Character.isWhitespace(str.charAt(i))) == false) {
return false;
}
}
return true;
}
public static boolean isAllLowerCase(java.lang.String str) {
if ((str == null) || (org.apache.commons.lang.StringUtils.isEmpty(str))) {
return false;
}
int sz = str.length();
for (int i = 0 ; i < sz ; i++) {
if ((java.lang.Character.isLowerCase(str.charAt(i))) == false) {
return false;
}
}
return true;
}
public static boolean isAllUpperCase(java.lang.String str) {
if ((str == null) || (org.apache.commons.lang.StringUtils.isEmpty(str))) {
return false;
}
int sz = str.length();
for (int i = 0 ; i < sz ; i++) {
if ((java.lang.Character.isUpperCase(str.charAt(i))) == false) {
return false;
}
}
return true;
}
public static java.lang.String defaultString(java.lang.String str) {
return str == null ? org.apache.commons.lang.StringUtils.EMPTY : str;
}
public static java.lang.String defaultString(java.lang.String str, java.lang.String defaultStr) {
return str == null ? defaultStr : str;
}
public static java.lang.String defaultIfEmpty(java.lang.String str, java.lang.String defaultStr) {
return org.apache.commons.lang.StringUtils.isEmpty(str) ? defaultStr : str;
}
public static java.lang.String reverse(java.lang.String str) {
if (str == null) {
return null;
}
return new java.lang.StringBuilder(str).reverse().toString();
}
public static java.lang.String reverseDelimited(java.lang.String str, char separatorChar) {
if (str == null) {
return null;
}
java.lang.String[] strs = org.apache.commons.lang.StringUtils.split(str, separatorChar);
org.apache.commons.lang.ArrayUtils.reverse(strs);
return org.apache.commons.lang.StringUtils.join(strs, separatorChar);
}
public static java.lang.String abbreviate(java.lang.String str, int maxWidth) {
return org.apache.commons.lang.StringUtils.abbreviate(str, 0, maxWidth);
}
public static java.lang.String abbreviate(java.lang.String str, int offset, int maxWidth) {
if (str == null) {
return null;
}
if (maxWidth < 4) {
throw new java.lang.IllegalArgumentException("Minimum abbreviation width is 4");
}
if ((str.length()) <= maxWidth) {
return str;
}
if (offset > (str.length())) {
offset = str.length();
}
if (((str.length()) - offset) < (maxWidth - 3)) {
offset = (str.length()) - (maxWidth - 3);
}
if (offset <= 4) {
return (str.substring(0, (maxWidth - 3))) + "...";
}
if (maxWidth < 7) {
throw new java.lang.IllegalArgumentException("Minimum abbreviation width with offset is 7");
}
if ((offset + (maxWidth - 3)) < (str.length())) {
return "..." + (org.apache.commons.lang.StringUtils.abbreviate(str.substring(offset), (maxWidth - 3)));
}
return "..." + (str.substring(((str.length()) - (maxWidth - 3))));
}
public static java.lang.String difference(java.lang.String str1, java.lang.String str2) {
if (str1 == null) {
return str2;
}
if (str2 == null) {
return str1;
}
int at = org.apache.commons.lang.StringUtils.indexOfDifference(str1, str2);
if (at == (-1)) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
return str2.substring(at);
}
public static int indexOfDifference(java.lang.String str1, java.lang.String str2) {
if (str1 == str2) {
return -1;
}
if ((str1 == null) || (str2 == null)) {
return 0;
}
int i;
for (i = 0 ; (i < (str1.length())) && (i < (str2.length())) ; ++i) {
if ((str1.charAt(i)) != (str2.charAt(i))) {
break;
}
}
if ((i < (str2.length())) || (i < (str1.length()))) {
return i;
}
return -1;
}
public static int indexOfDifference(java.lang.String[] strs) {
if ((strs == null) || ((strs.length) <= 1)) {
return -1;
}
boolean anyStringNull = false;
boolean allStringsNull = true;
int arrayLen = strs.length;
int shortestStrLen = java.lang.Integer.MAX_VALUE;
int longestStrLen = 0;
for (int i = 0 ; i < arrayLen ; i++) {
if ((strs[i]) == null) {
anyStringNull = true;
shortestStrLen = 0;
} else {
allStringsNull = false;
shortestStrLen = java.lang.Math.min(strs[i].length(), shortestStrLen);
longestStrLen = java.lang.Math.max(strs[i].length(), longestStrLen);
}
}
if (allStringsNull || ((longestStrLen == 0) && (!anyStringNull))) {
return -1;
}
if (shortestStrLen == 0) {
return 0;
}
int firstDiff = -1;
for (int stringPos = 0 ; stringPos < shortestStrLen ; stringPos++) {
char comparisonChar = strs[0].charAt(stringPos);
for (int arrayPos = 1 ; arrayPos < arrayLen ; arrayPos++) {
if ((strs[arrayPos].charAt(stringPos)) != comparisonChar) {
firstDiff = stringPos;
break;
}
}
if (firstDiff != (-1)) {
break;
}
}
if ((firstDiff == (-1)) && (shortestStrLen != longestStrLen)) {
return shortestStrLen;
}
return firstDiff;
}
public static java.lang.String getCommonPrefix(java.lang.String[] strs) {
if ((strs == null) || ((strs.length) == 0)) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
int smallestIndexOfDiff = org.apache.commons.lang.StringUtils.indexOfDifference(strs);
if (smallestIndexOfDiff == (-1)) {
if ((strs[0]) == null) {
return org.apache.commons.lang.StringUtils.EMPTY;
}
return strs[0];
} else {
if (smallestIndexOfDiff == 0) {
return org.apache.commons.lang.StringUtils.EMPTY;
} else {
return strs[0].substring(0, smallestIndexOfDiff);
}
}
}
public static int getLevenshteinDistance(java.lang.String s, java.lang.String t) {
if ((s == null) || (t == null)) {
throw new java.lang.IllegalArgumentException("Strings must not be null");
}
int n = s.length();
int m = t.length();
if (n == 0) {
return m;
} else {
if (m == 0) {
return n;
}
}
if (n > m) {
java.lang.String tmp = s;
s = t;
t = tmp;
n = m;
m = t.length();
}
int[] p = new int[n + 1];
int[] d = new int[n + 1];
int[] _d;
int i;
int j;
char t_j;
int cost;
for (i = 0 ; i <= n ; i++) {
p[i] = i;
}
for (j = 1 ; j <= m ; j++) {
t_j = t.charAt((j - 1));
d[0] = j;
for (i = 1 ; i <= n ; i++) {
cost = (s.charAt((i - 1))) == t_j ? 0 : 1;
d[i] = java.lang.Math.min(java.lang.Math.min(((d[(i - 1)]) + 1), ((p[i]) + 1)), ((p[(i - 1)]) + cost));
}
_d = p;
p = d;
d = _d;
}
return p[n];
}
public static boolean startsWith(java.lang.String str, java.lang.String prefix) {
return org.apache.commons.lang.StringUtils.startsWith(str, prefix, false);
}
public static boolean startsWithIgnoreCase(java.lang.String str, java.lang.String prefix) {
return org.apache.commons.lang.StringUtils.startsWith(str, prefix, true);
}
private static boolean startsWith(java.lang.String str, java.lang.String prefix, boolean ignoreCase) {
if ((str == null) || (prefix == null)) {
return (str == null) && (prefix == null);
}
if ((prefix.length()) > (str.length())) {
return false;
}
return str.regionMatches(ignoreCase, 0, prefix, 0, prefix.length());
}
public static boolean startsWithAny(java.lang.String string, java.lang.String[] searchStrings) {
if ((org.apache.commons.lang.StringUtils.isEmpty(string)) || (org.apache.commons.lang.ArrayUtils.isEmpty(searchStrings))) {
return false;
}
for (int i = 0 ; i < (searchStrings.length) ; i++) {
java.lang.String searchString = searchStrings[i];
if (org.apache.commons.lang.StringUtils.startsWith(string, searchString)) {
return true;
}
}
return false;
}
public static boolean endsWith(java.lang.String str, java.lang.String suffix) {
return org.apache.commons.lang.StringUtils.endsWith(str, suffix, false);
}
public static boolean endsWithIgnoreCase(java.lang.String str, java.lang.String suffix) {
return org.apache.commons.lang.StringUtils.endsWith(str, suffix, true);
}
private static boolean endsWith(java.lang.String str, java.lang.String suffix, boolean ignoreCase) {
if ((str == null) || (suffix == null)) {
return (str == null) && (suffix == null);
}
if ((suffix.length()) > (str.length())) {
return false;
}
int strOffset = (str.length()) - (suffix.length());
return str.regionMatches(ignoreCase, strOffset, suffix, 0, suffix.length());
}
}
| [
"[email protected]"
]
| |
c53aff27027fc82924f447ac4c78ed2c38a386fe | f8d1c87e3e1985fa466c29490762d4574a2e9bc3 | /Chapter05/src/Ch02/MainTest1.java | 802a22fc4dd297bdc3e14ce84182fad09cd8b10a | []
| no_license | xhdlfkddl/GitTest1 | 4181d57a4b9fd429e8015744ecd0270bcafb6d47 | 47e71fc99f794523753f3b09dbedf602ffa91ce3 | refs/heads/main | 2023-09-02T23:04:38.158892 | 2021-11-12T05:04:20 | 2021-11-12T05:04:20 | 426,128,354 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,016 | java | package Ch02;
public class MainTest1 {
public static void main(String[] args) {
// 재료
Powder powder = new Powder();
Plastic plastic = new Plastic();
// 1. threeDPrinter -> 객체생성
// setter 메서드를 사용할 때 Powder
ThreeDPrinter1 printer1 = new ThreeDPrinter1();
printer1.setMaterial(powder);
System.out.println(printer1.getMaterial());
System.out.println("---------------------------------");
ThreeDPrinter2 printer2 = new ThreeDPrinter2();
printer2.setMaterial(plastic);
System.out.println(printer2.getMaterial());
System.out.println("---------------------------------");
ThreeDPrinter3 printer3 = new ThreeDPrinter3();
printer3.setMaterial(powder);
System.out.println(printer3.getMaterial());
// 변수에 ThreeDPrinter3의 재료를 저장해주세요
Powder temp1 = (Powder)printer3.getMaterial();
// 질문
System.out.println(printer3); // 주소값 -> toString을 재정의 하면 해당 String 값이 나옴
}
}
| [
"sonstar21"
]
| sonstar21 |
77d887422216d04300ae27155a7931dccb4e6d24 | a31cd2597b3c446fab309072996e650de9fda18c | /app/src/androidTest/java/com/example/loginlocal/ExampleInstrumentedTest.java | 8bf24aed6ffe0371c86fd78a45b263bfd7aba98d | []
| no_license | guilherme-IFSP/LoginLocal | ea49c28175db95f2f461f76f94e632e1f25af72c | 866cc990f0ab3330d0d8769c1e30a424590591cc | refs/heads/master | 2022-12-03T10:38:24.226487 | 2020-08-23T19:48:36 | 2020-08-23T19:48:36 | 289,417,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | package com.example.loginlocal;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.loginlocal", appContext.getPackageName());
}
} | [
"[email protected]"
]
| |
74b6f980796840ca13edab70a2ded84efa9fb67c | 7f929f6815c7df4b1cf88e628ad22edd08501365 | /WebProject/src/main/java/cn/itcast/b2c/gciantispider/model/NhSysmonitorSpiderdistinguish.java | 6fc291a9c683f1056f0ab9c521937e7f00a8ad23 | []
| no_license | githubkimber/git-test | fa16552303c7add9ea076711a96a04fb166c070f | 7cdc0093482789b3a984fbd7b2931e0ec60ceff3 | refs/heads/master | 2022-12-21T19:48:15.038712 | 2019-09-17T13:31:16 | 2019-09-17T13:31:16 | 208,517,283 | 2 | 0 | null | 2022-12-16T07:18:00 | 2019-09-14T23:42:58 | JavaScript | UTF-8 | Java | false | false | 1,623 | java | package cn.itcast.b2c.gciantispider.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* NhSysmonitorSpiderdistinguish entity. @author MyEclipse Persistence Tools
*/
@Entity
@Table(name = "itcast_sysmonitor_spiderdistinguish")
public class NhSysmonitorSpiderdistinguish implements java.io.Serializable {
// Fields
private Integer id;
private Date date;
private Integer numspider;
// Constructors
/** default constructor */
public NhSysmonitorSpiderdistinguish() {
}
/** full constructor */
public NhSysmonitorSpiderdistinguish(Date date, Integer numspider) {
this.date = date;
this.numspider = numspider;
}
// Property accessors
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id", unique = true, nullable = false)
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
@Temporal(TemporalType.DATE)
@Column(name = "date", length = 10)
public Date getDate() {
return this.date;
}
public void setDate(Date date) {
this.date = date;
}
@Column(name = "numspider")
public Integer getNumspider() {
return this.numspider;
}
public void setNumspider(Integer numspider) {
this.numspider = numspider;
}
} | [
"[email protected]"
]
| |
e02fd14287eeeeb685caca06c0f75ae9db6db1ce | 1e61086c00c4f9af65843a87a46cfab428eb95fb | /ciclo3/src/main/java/co/usa/g32/ciclo3/Ciclo3Application.java | 6918af4d7753f74dca4781770c4ac6476885c888 | []
| no_license | joluroba/g32ciclo3r5 | 87c0bf0b7294694444be79df8c36a4f5aa704783 | 60f67d9dd81d063f17be5eb5a62970562c26c1d6 | refs/heads/main | 2023-08-31T19:03:27.527997 | 2021-10-31T14:26:55 | 2021-10-31T14:26:55 | 423,169,880 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 309 | java | package co.usa.g32.ciclo3;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Ciclo3Application {
public static void main(String[] args) {
SpringApplication.run(Ciclo3Application.class, args);
}
} | [
"[email protected]"
]
| |
7c6f76839b18f945893212256ac09eebbbb598ee | d8e6e24eb0e3990d05631f3be0535081082fb696 | /src/br/com/sisagencia/view/CadastroUsuarioView.java | 057ed65862845cb677803f95454046bc488a5e3a | []
| no_license | JhonatanNobreBarboza/SistemaAgenciaViagens- | 67ae348e8c5b58f6a81be02cfb9e63101e32d2e9 | 916c7cb94ab0f642d369b4eab04926a49ff0f309 | refs/heads/master | 2020-03-27T12:31:51.544693 | 2019-04-26T17:58:10 | 2019-04-26T17:58:10 | 146,552,051 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,971 | 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 br.com.sisagencia.view;
import br.com.sisagencia.controller.UsuarioController;
import java.security.NoSuchAlgorithmException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.netbeans.lib.awtextra.AbsoluteLayout;
/**
*
* @author rgarcia
*/
public class CadastroUsuarioView extends javax.swing.JFrame {
AbsoluteLayout absoluto;
private UsuarioController uc;
/**
* Creates new form CadastroUsuarioView
*/
public CadastroUsuarioView() {
uc = new UsuarioController();
initComponents();
this.getContentPane().setLayout(absoluto);
this.setLocationRelativeTo(null);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
novoUsuarioPanel = new javax.swing.JPanel();
loginLabel = new javax.swing.JLabel();
senhaLabel = new javax.swing.JLabel();
loginField = new javax.swing.JTextField();
senhaField = new javax.swing.JPasswordField();
salvarButton = new javax.swing.JButton();
cancelarButton = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Cadastro de Usuário");
novoUsuarioPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
loginLabel.setText("Login: ");
novoUsuarioPanel.add(loginLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 30, -1, -1));
senhaLabel.setText("Senha:");
novoUsuarioPanel.add(senhaLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, -1, 19));
org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${uc.usuario.login}"), loginField, org.jdesktop.beansbinding.BeanProperty.create("text"));
bindingGroup.addBinding(binding);
novoUsuarioPanel.add(loginField, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 20, 232, -1));
binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${uc.usuario.senha}"), senhaField, org.jdesktop.beansbinding.BeanProperty.create("text"));
bindingGroup.addBinding(binding);
novoUsuarioPanel.add(senhaField, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 60, 230, -1));
salvarButton.setText("Cadastrar");
salvarButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
salvarButtonActionPerformed(evt);
}
});
novoUsuarioPanel.add(salvarButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 110, -1, -1));
cancelarButton.setText("Cancelar");
cancelarButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelarButtonActionPerformed(evt);
}
});
novoUsuarioPanel.add(cancelarButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 110, -1, -1));
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/sisagencia/imagens/fundoCadastro2.png"))); // NOI18N
novoUsuarioPanel.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 290, 150));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(novoUsuarioPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(novoUsuarioPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
);
bindingGroup.bind();
pack();
}// </editor-fold>//GEN-END:initComponents
private void salvarButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salvarButtonActionPerformed
try {
uc.salvar();
LoginView lv = new LoginView();
lv.setVisible(true);
this.dispose();
} catch (NoSuchAlgorithmException ex) {
Logger.getLogger(CadastroUsuarioView.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_salvarButtonActionPerformed
private void cancelarButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelarButtonActionPerformed
dispose();
}//GEN-LAST:event_cancelarButtonActionPerformed
public UsuarioController getUc() {
return uc;
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(CadastroUsuarioView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(CadastroUsuarioView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(CadastroUsuarioView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(CadastroUsuarioView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new CadastroUsuarioView().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton cancelarButton;
private javax.swing.JLabel jLabel1;
private javax.swing.JTextField loginField;
private javax.swing.JLabel loginLabel;
private javax.swing.JPanel novoUsuarioPanel;
private javax.swing.JButton salvarButton;
private javax.swing.JPasswordField senhaField;
private javax.swing.JLabel senhaLabel;
private org.jdesktop.beansbinding.BindingGroup bindingGroup;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
]
| |
fc6be871a6551562468a961a0422a1ad86f2cec8 | 088d3043de4f50d702829b9224889ba27ef28385 | /game-common/src/main/java/com/xianyi/framework/core/concurrent/selfDriver/AutoDriverQueue.java | 903decf50a5ca1aba5eb4e030863c3426390aeb1 | []
| no_license | taohyson/SERVER-1 | adf64087dab42a16af256a841a19b9556d05fd86 | d2bc339c4facebb6c63cabad406a623ebc14ef88 | refs/heads/master | 2020-04-15T16:19:04.804074 | 2018-12-03T08:11:21 | 2018-12-03T08:11:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,212 | java | /**
* Copyright@2015-2016 Hunan Qisheng Network Technology Co. Ltd.[SHEN-ZHEN]
*/
package com.xianyi.framework.core.concurrent.selfDriver;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.LongAdder;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cai.common.util.SystemClock;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
/**
* thread_safe,保证队列的任务顺序执行,适用于任务粒度大,耗时长,但并发不是特别高的场景
*
* @author wu_hc date: 2018年1月12日 下午5:55:30 <br/>
*/
public final class AutoDriverQueue implements Runnable, Executor {
private static final Logger logger = LoggerFactory.getLogger(AutoDriverQueue.class);
/**
* 队列
*/
private final LinkedList<Runnable> taskQueue = Lists.newLinkedList();
/**
* 执行器
*/
private final Executor actuator;
/**
* 锁对象
*/
private final Lock lock = new ReentrantLock();
/**
* 提交的任务数量
*/
private final LongAdder submitTaskCount = new LongAdder();
/**
* 批量执行,y每次调度会把队列中的所有任务一次执行完毕,n顺序取出一个任务执行
*/
private final boolean isBatchExecute;
// @Deprecated
// public static final AutoDriverQueue newQueue(Executor excutor, boolean isBatchExecute) {
// return new AutoDriverQueue(excutor, isBatchExecute);
// }
/**
* @param excutor
* @return
*/ public static final AutoDriverQueue newQueue(Executor excutor) {
return new AutoDriverQueue(excutor, false);
}
/**
* @param excutor
*/
private AutoDriverQueue(Executor excutor, boolean isBatchExecute) {
checkNotNull(excutor, "excutor is a nil value!");
this.actuator = excutor;
this.isBatchExecute = isBatchExecute;
}
/**
* @param task
*/
public int addTask(final Runnable task) {
checkNotNull(task, "task is nil value ");
int taskSize = 0;
final Lock lock = this.lock;
lock.lock();
submitTaskCount.increment();
try {
if (isEmpty()) {
taskQueue.add(task);
actuator.execute(this);
} else {
taskQueue.add(task);
}
taskSize = size();
if (taskSize > 1000) {
logger.warn("[auto_driver_queue] more task in queue! size:[{}],thread:[{}]", taskSize, Thread.currentThread().getName());
}
} finally {
lock.unlock();
}
return taskSize;
}
/**
* @param tasks
*/
public int addTask(final Collection<Runnable> tasks) {
checkNotNull(tasks, "tasks is nil value ");
int taskSize = 0;
final Lock lock = this.lock;
lock.lock();
submitTaskCount.increment();
try {
if (isEmpty()) {
taskQueue.addAll(tasks);
actuator.execute(this);
} else {
taskQueue.addAll(tasks);
}
taskSize = size();
if (taskSize > 1000) {
logger.warn("[auto_driver_queue] more task in queue! size:[{}],thread:[{}]", taskSize, Thread.currentThread().getName());
}
} finally {
lock.unlock();
}
return taskSize;
}
@Override
public void execute(Runnable command) {
addTask(command);
}
/**
* 将队列里未执行的任务抽离出来 --GAME-TODO(待测试)
*
* @return
*/
public final List<Runnable> drainQueue() {
List<Runnable> taskList = null;
final Lock lock = this.lock;
lock.lock();
try {
if (isEmpty()) {
taskList = Collections.emptyList();
} else {
taskList = Lists.newArrayListWithCapacity(size() + 16);
taskList.addAll(taskQueue);
taskQueue.clear();
}
} finally {
lock.unlock();
}
return taskList;
}
@Override
public void run() {
try {
if (isBatchExecute) {
batchExecute();
} else {
singleExecute();
}
} finally {
tryNextCommit();
}
}
/**
* 每次提交一个任务
*/
void singleExecute() {
Runnable task = null;
final Lock lock = this.lock;
lock.lock();
try {
if (!taskQueue.isEmpty()) {
task = taskQueue.peek();
}
} finally {
lock.unlock();
}
// 在锁外执行,保证在执行期间不占用锁
if (null != task) {
executeTask(task);
}
}
/**
* 每次提交队列中所有任务
*/
void batchExecute() {
List<Runnable> taskList = Lists.newArrayListWithCapacity(size() + 16);
final Lock lock = this.lock;
lock.lock();
try {
if (!taskQueue.isEmpty()) {
taskList.addAll(taskQueue);
}
taskQueue.clear();
} finally {
lock.unlock();
}
// 在锁外执行,保证在执行期间不占用锁
taskList.forEach((task) -> executeTask(task));
taskList.clear();
taskList = null; // help GC
}
/**
* 尝试再提交
*/
private void tryNextCommit() {
final Lock lock = this.lock;
lock.lock();
try {
//弹出已经执行的任务
if (!isBatchExecute()) {
taskQueue.poll();
}
if (!isEmpty()) {
actuator.execute(this);
}
} finally {
lock.unlock();
}
}
static void executeTask(final Runnable task) {
long cur = SystemClock.CLOCK.now();
try {
task.run();
long now = SystemClock.CLOCK.now();
if (now - cur > 100L) {
logger.warn("task[ {}, {} ] cost must time:[ {}ms ],thread[ {} ]", task.getClass(), task.toString(), (now - cur),
Thread.currentThread().getName());
}
} catch (Exception e) {
e.printStackTrace();
}
}
public int size() {
return taskQueue.size();
}
public boolean isEmpty() {
return taskQueue.isEmpty();
}
public void clear() {
final Lock lock = this.lock;
lock.lock();
try {
taskQueue.clear();
} finally {
lock.unlock();
}
}
public boolean isBatchExecute() {
return isBatchExecute;
}
public long getTotalTaskCount() {
return submitTaskCount.longValue();
}
/**
* @param v
* @param msg
*/
private static void checkNotNull(Object v, String msg) {
if (v == null)
throw Strings.isNullOrEmpty(msg) ? new NullPointerException() : new NullPointerException(msg);
}
@Override
public String toString() {
return String.format("[AutoDriverQueue]isBatchExecute:%b,size:%d,submitTaskCount:%d", isBatchExecute, size(), getTotalTaskCount());
}
}
| [
"[email protected]"
]
| |
32d18948726bf22c0f47fe6a315e036d4a25dc0f | e1baf0a5dcde05def447be3ff452489fadf9ca9a | /src/main/java/com/apple/service/impl/BloggerServiceImpl.java | ab9433b92293f9763ec80be3aee97a2ef7eac35b | []
| no_license | applechi/Blog | 96ad1c3e26b454418ace2ca63f7ad6063c5fe507 | cd7c9ca05db6966abe7643f3d6dfca2c2121e98f | refs/heads/master | 2022-12-25T20:01:05.191714 | 2019-09-30T07:21:09 | 2019-09-30T07:21:09 | 172,673,033 | 0 | 0 | null | 2022-12-16T05:53:56 | 2019-02-26T08:48:23 | JavaScript | UTF-8 | Java | false | false | 648 | java | package com.apple.service.impl;
import com.apple.dao.BloggerDao;
import com.apple.model.Blogger;
import com.apple.service.BloggerService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service("bloggerService")
public class BloggerServiceImpl implements BloggerService {
@Resource
private BloggerDao bloggerDao;
public Blogger getByUserName(String userName) {
return bloggerDao.getByUserName(userName);
}
public Blogger find() {
return bloggerDao.find();
}
@Override
public Integer update(Blogger blogger) {
return bloggerDao.update(blogger);
}
}
| [
"[email protected]"
]
| |
e5f418b33c8b4ffc6ea3fd17275e1d219a66e351 | ba118eeb413db8c679c0e987706e38dd294041ef | /Projeto/ws-dm110/2019-dm110/dm110-web/src/main/java/br/inatel/dm110/rest/RestApplication.java | 21c8a5a517e1be05efc3abf5fc9266601fb5a74c | []
| no_license | tbsouza/DM110-Projeto | 3c263e69ff3a024054b59138158dd2aa4fcc8648 | e9c055118cc9cba1746f18f554e7cf100f9701e2 | refs/heads/master | 2022-03-13T08:08:19.262443 | 2019-11-30T02:16:09 | 2019-11-30T02:16:09 | 222,578,550 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 436 | java | package br.inatel.dm110.rest;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import br.inatel.dm110.impl.OrderServiceImpl;
@ApplicationPath("/api")
public class RestApplication extends Application {
@Override
public Set<Class<?>> getClasses() {
Set<Class<?>> classes = new HashSet<>();
classes.add(OrderServiceImpl.class);
return classes;
}
}
| [
"[email protected]"
]
| |
0f5eb281acf829da3b99c21fcfd72018fa55970e | 89b650261ce180c49c0728daa5d49a68855b771c | /J2se-8/src/org/test/cloneEx/Department.java | 623c40695316476409c5bc96968fcea62361dd2b | []
| no_license | ParveenThakur/CoreJava | 81f33a5a7b49c5fa386b52e8ad0e41c255159e80 | b105adfd9d5f6513d9f65811278ed4d382f664ae | refs/heads/master | 2021-01-18T20:17:17.680357 | 2017-11-20T12:33:26 | 2017-11-20T12:33:26 | 68,283,797 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 417 | java | package org.test.cloneEx;
public class Department {
private int id;
private String name;
public Department(int id, String name)
{
this.id = id;
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"[email protected]"
]
| |
abcfb22613ec7fd8579fd250bc9e53cb40f53e61 | a6330fe54e1cde24d440039f07639f9cd76c9f04 | /app/src/main/java/com/android/sprj/criminalintent/CrimeFragment.java | ae80f94410247b626eddea8e7b9717910dcffeb3 | []
| no_license | sprj/CriminalIntent | f5d9bd8f57ab90cdb8ee7a970068c5f48c9d60fa | 168f41c094c883c9f58180d4b3d09cb622d7ce9c | refs/heads/master | 2020-05-03T18:16:34.990855 | 2015-07-13T10:55:39 | 2015-07-13T10:55:39 | 38,997,580 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,338 | java | package com.android.sprj.criminalintent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
/**
* Created by sprj on 13/07/15.
*/
public class CrimeFragment extends Fragment {
private Crime mCrime;
private EditText mTitleField;
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
mCrime = new Crime();
}
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState){
View v = inflater.inflate(R.layout.fragment_crime, parent, false);
mTitleField = (EditText) v.findViewById(R.id.crime_title);
mTitleField.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
mCrime.setTitle(s.toString());
}
@Override
public void afterTextChanged(Editable s) {
}
});
return v;
}
}
| [
"[email protected]"
]
| |
37821a649b118598ffde6a13285e440ed7995862 | 4c91e2049a2f39d1c84cb0dc2f436256468b8edc | /app/src/main/java/co/borucki/mycvwithdatabase/view/fragments/EducationFragment.java | cc74b9bab816888f71ed8a9cf0e5d4dbe6242c01 | []
| no_license | LukaszBorucki/MyCVwithDatabase | 961794de2be95d0ca714a39c3716870b86f0dd04 | cda2388ceedbb9af04394be427fd6f3bee76a919 | refs/heads/master | 2021-08-12T08:19:18.721661 | 2017-11-14T15:37:22 | 2017-11-14T15:37:22 | 109,703,827 | 0 | 1 | null | 2017-11-14T15:37:23 | 2017-11-06T14:12:13 | Java | UTF-8 | Java | false | false | 2,533 | java | package co.borucki.mycvwithdatabase.view.fragments;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import co.borucki.mycvwithdatabase.R;
import co.borucki.mycvwithdatabase.adapter.EducationAdapter;
import co.borucki.mycvwithdatabase.repository.EducationRepository;
import co.borucki.mycvwithdatabase.repository.EducationRepositoryImpl;
import co.borucki.mycvwithdatabase.security.ApplicationAccessPermission;
import co.borucki.mycvwithdatabase.security.ApplicationAccessPermissionImpl;
public class EducationFragment extends Fragment {
private EducationRepository mEducation = EducationRepositoryImpl.getInstance();
private ApplicationAccessPermission mApplicationAccessPermission = ApplicationAccessPermissionImpl.getInstance();
private RecyclerView mRecyclerView;
private EducationAdapter mEducationAdapter;
public EducationFragment() {
// Required empty public constructor
}
public static EducationFragment newInstance() {
return new EducationFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_education, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mRecyclerView = view.findViewById(R.id.education_fragment_list_view);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity().getApplicationContext());
mRecyclerView.setLayoutManager(linearLayoutManager);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(getActivity(), linearLayoutManager.getOrientation());
mRecyclerView.addItemDecoration(dividerItemDecoration);
mEducationAdapter = new EducationAdapter(getActivity());
mRecyclerView.setAdapter(mEducationAdapter);
mEducationAdapter.setData(mEducation.getAllEducationDataByLanguage(mApplicationAccessPermission.getAppLanguage()));
}
}
| [
"[email protected]"
]
| |
a6eeb3a64a0c8d15c23a57cc1155a49a79f51509 | cabf2eca639dd26529917c981479668c172203dc | /src/Entidad/ClsEntidadUnidad.java | 544bd575aad517f9f921ce321681ea5f977f3bb8 | []
| no_license | Drei109/SistemaInformesUPT | f91f001a883244ecbde15570ab2256ee989f3f5b | 51def2adcbc10e250097de14c62f387c42d2d861 | refs/heads/master | 2021-05-03T23:28:21.607915 | 2017-02-08T13:50:46 | 2017-02-08T13:50:46 | 71,736,519 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 806 | java | package Entidad;
/**
*
* @author enzocv
*/
public class ClsEntidadUnidad {
private int idUnidad;// INT(11) NOT NULL AUTO_INCREMENT,
private String descripcionUnidad;//` VARCHAR(20) NOT NULL,
private String estadoUnidad;// VARCHAR(20) NULL DEFAULT NULL,
public int getIdUnidad() {
return idUnidad;
}
public void setIdUnidad(int idUnidad) {
this.idUnidad = idUnidad;
}
public String getDescripcionUnidad() {
return descripcionUnidad;
}
public void setDescripcionUnidad(String descripcionUnidad) {
this.descripcionUnidad = descripcionUnidad;
}
public String getEstadoUnidad() {
return estadoUnidad;
}
public void setEstadoUnidad(String estadoUnidad) {
this.estadoUnidad = estadoUnidad;
}
}
| [
"[email protected]"
]
| |
b227ff088c2e65946855c3210a27bc7a6ec8c0e3 | 08ad19d2543ab96e4f404a688f75e9fbaf92de81 | /TradingBot/Server/src/main/java/com/kl/tradingbot/common/exception/GlobalExceptionHandler.java | 478efb7895d86d26b5bef8ecbfb8bebc107ef61c | [
"MIT"
]
| permissive | kostadinlambov/Trading-Bot | 1c414c4bf518eba9dfcc931784703cd57d2319d0 | 1d4632efe6eb8772157abb6c36ec1916280d228a | refs/heads/main | 2023-09-05T10:13:47.053214 | 2021-04-05T12:17:34 | 2021-04-05T12:17:34 | 344,804,267 | 0 | 0 | MIT | 2021-03-25T19:01:26 | 2021-03-05T12:29:10 | Java | UTF-8 | Java | false | false | 2,364 | java | package com.kl.tradingbot.common.exception;
import com.kl.tradingbot.common.exception.model.ErrorMessageEnum;
import com.kl.tradingbot.common.exception.model.response.ExceptionResponse;
import org.springframework.context.support.DefaultMessageSourceResolvable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
@ControllerAdvice
@RestController
public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
@ExceptionHandler(Exception.class)
public final ResponseEntity<ExceptionResponse> handleAllExceptions(Exception ex,
WebRequest request) {
String message = ex.getMessage();
ExceptionResponse exceptionResponse = new ExceptionResponse(message,
request.getDescription(false));
return new ResponseEntity<>(exceptionResponse, HttpStatus.INTERNAL_SERVER_ERROR);
}
@ExceptionHandler(TradingBotException.class)
public ResponseEntity<Object> handleException(MethodArgumentNotValidException ex,
HttpHeaders headers, HttpStatus status, WebRequest request) {
ExceptionResponse exceptionResponse = new ExceptionResponse(ex.getMessage(),
ex.getBindingResult().toString());
return new ResponseEntity<>(exceptionResponse, HttpStatus.BAD_REQUEST);
}
@Override
protected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request) {
String errorMessage = ex.getBindingResult().getAllErrors().stream()
.map(DefaultMessageSourceResolvable::getDefaultMessage)
.findFirst()
.orElse(ErrorMessageEnum.VALIDATION_ERROR.getMessage());
ExceptionResponse exceptionResponse = new ExceptionResponse(errorMessage,
ex.getBindingResult().toString());
System.out.println();
return new ResponseEntity<>(exceptionResponse, HttpStatus.BAD_REQUEST);
}
} | [
"[email protected]"
]
| |
c2f345a43fc0438e122a4f454c17347dcf31567f | 0513e1c8fc2d522bfdc3ef218deaf1447c98e7ce | /Method.java | b601d7e0a2ca4aec223454191aede82bbec944b9 | []
| no_license | kartikpatnaik/java-basic | 1782afc989f3062eea92adc04d7367fbc121d21f | ff3a42963391f07d1f2d0a45da9ffabbff7aa633 | refs/heads/main | 2023-09-04T15:15:56.874158 | 2021-11-16T19:28:43 | 2021-11-16T19:28:43 | 354,379,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 429 | java | import java.util.Scanner;
public class Method{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int num1,num2;
System.out.println("Enter the first num");
num1=sc.nextInt();
System.out.println("Enter the second num");
num2=sc.nextInt();
int sum=getTotal(num1,num2);
System.out.println("Sum "+sum);
}
public static int getTotal(int number1, int number2)
{
return number1+number2;
}
} | [
"[email protected]"
]
| |
17dbbe31cbc637808abeabfd68e0d9f8221c70f0 | 935c01eeb42e51c78cb2dee42a80a2c6432075a1 | /src/main/java/guru/springframework/msscbeerservice/web/controller/BeerController.java | f1df81921f7f9faa69310c63b621e1bc6e789c7e | []
| no_license | chriscj08/mssc-beer-service | b34eff0440791dda167b8786eb67061b9ef9b84e | 6ee6cec0236c14c50f24d58640824c62f6b1f2e9 | refs/heads/master | 2023-07-31T12:12:57.672170 | 2021-09-20T16:21:00 | 2021-09-20T16:21:00 | 407,235,719 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 974 | java | package guru.springframework.msscbeerservice.web.controller;
import guru.springframework.msscbeerservice.web.model.BeerDto;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.UUID;
@RequestMapping("/api/v1/beer")
@RestController
public class BeerController {
@GetMapping("/{beerId}")
public ResponseEntity<BeerDto> getBeerById(@PathVariable("beerId") UUID beerId) {
return new ResponseEntity<>(BeerDto.builder().build(), HttpStatus.OK);
}
@PostMapping
public ResponseEntity saveNewBeer(@RequestBody @Valid BeerDto beerDto) {
return new ResponseEntity(HttpStatus.CREATED);
}
@PutMapping("/{beerId}")
public ResponseEntity updateBeerById(@PathVariable("beerId") UUID beerId, @RequestBody @Valid BeerDto beerDto) {
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
}
| [
"[email protected]"
]
| |
a9aafbff53e68505a11a74143e119aaa9041c076 | 3590b627c3df339761621c57a47f6d7cc00ef9f3 | /unit-tests/app/src/androidTest/java/org/gearvrf/animation/GVRRotationByAxisWithPivotAnimationTest.java | 9b48a5e9460cd7cd617fe5ce2d94f75e88e69125 | []
| no_license | gearvrf/GearVRf-Tests | 72f9a27e01a3336ba126b1e37b9eabff7fc89d41 | 38321e9cb955ad1cd08e8720f6478e10b9581226 | refs/heads/master | 2020-05-22T04:00:09.586348 | 2018-10-25T19:32:47 | 2018-10-25T19:32:47 | 65,028,606 | 3 | 20 | null | 2018-10-25T19:32:48 | 2016-08-05T15:20:08 | Java | UTF-8 | Java | false | false | 2,815 | java | package org.gearvrf.animation;
import org.gearvrf.ActivityInstrumentationGVRf;
import org.gearvrf.viewmanager.TestDefaultGVRViewManager;
import org.gearvrf.GVRSceneObject;
/**
* Created by Douglas on 2/28/15.
*/
public class GVRRotationByAxisWithPivotAnimationTest extends ActivityInstrumentationGVRf {
public void testSetInvalidRepeatModeAnimation() {
try {
GVRSceneObject sceneObject = new GVRSceneObject(TestDefaultGVRViewManager.mGVRContext);
new GVRRotationByAxisAnimation
(sceneObject, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f).setRepeatMode(2);
GVRRotationByAxisWithPivotAnimation animation = new GVRRotationByAxisWithPivotAnimation(sceneObject,
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
animation.setRepeatMode(4);
} catch (IllegalArgumentException e) {
assertEquals(e.getMessage(), "4 is not a valid repetition type");
}
}
public void testInterpolatorAnimation() {
GVRSceneObject sceneObject = new GVRSceneObject(TestDefaultGVRViewManager.mGVRContext);
new GVRRotationByAxisAnimation
(sceneObject, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f).setRepeatMode(2);
GVRRotationByAxisWithPivotAnimation animation = new GVRRotationByAxisWithPivotAnimation(sceneObject,
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
animation.setInterpolator(new GVRInterpolator() {
@Override
public float mapRatio(float ratio) {
assertNotNull(ratio);
return 0;
}
});
}
public void testSetFinishedObject() {
GVRSceneObject sceneObject = new GVRSceneObject(TestDefaultGVRViewManager.mGVRContext);
new GVRRotationByAxisAnimation
(sceneObject, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f).setRepeatMode(2);
GVRRotationByAxisWithPivotAnimation animation = new GVRRotationByAxisWithPivotAnimation(sceneObject,
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
animation.setOnFinish(new GVROnFinish() {
@Override
public void finished(GVRAnimation animation) {
assertNotNull(animation);
}
});
}
public void testSetRepeatCount() {
GVRSceneObject sceneObject = new GVRSceneObject(TestDefaultGVRViewManager.mGVRContext);
new GVRRotationByAxisAnimation
(sceneObject, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f).setRepeatMode(2);
GVRRotationByAxisWithPivotAnimation animation = new GVRRotationByAxisWithPivotAnimation(sceneObject,
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
animation.setRepeatCount(10);
}
}
| [
"[email protected]"
]
| |
f2535b18ca1ae9435e738613472e1a51819d72bd | aa20dca7a42acf8636b324e1acde9f2f67081cdf | /finalProject/src/JAL.java | b1e1238529263af7ea03f4236b90b0d5f6bd2f55 | []
| no_license | irfanm96/CO225 | b86c579613c91603be84e4b4bab4a2116b6cab21 | 3af28472f9335c6c3e9b5c9a4fce627257cbb812 | refs/heads/master | 2020-03-31T22:12:55.710264 | 2019-02-18T14:14:20 | 2019-02-18T14:14:20 | 152,610,316 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 553 | java | import java.io.IOException;
public class JAL implements Instruction, JTypeInstruction {
@Override
public void execute(String[] args, CPUReg regFile) throws IOException {
throw new IOException("Need a cpu input for J type instructions");
}
//override executeBranch method in J Type instruction interface
@Override
public void executeBranch(String[] args, CPU cpu, CPUReg regFile) throws IOException {
//set program counter to the link address
cpu.setProgramCounter(Integer.parseInt(args[1]));
}
}
| [
"[email protected]"
]
| |
b4cfba46a7b444d52b883ece74a448f979dbf6d6 | 6b19524c2db316c1bae52a24f8b37fd6969b9400 | /plugins/circuit-breaker-policy/src/main/java/io/apiman/plugins/circuit_breaker/beans/CircuitBreakerConfigBean.java | 64ec649c11a3ed0df66550f5815a053acd0d5f48 | [
"Apache-2.0"
]
| permissive | apiman/apiman | feb59b437485080425105c8597ff01f3df4a7697 | 347f4a8de4d3f9feea7a4daa01cec7d12f654a0d | refs/heads/master | 2023-08-31T23:50:25.742996 | 2023-08-25T19:22:58 | 2023-08-25T19:22:58 | 12,319,410 | 846 | 440 | Apache-2.0 | 2023-09-14T17:09:49 | 2013-08-23T09:29:20 | Java | UTF-8 | Java | false | false | 2,536 | java | /*
* Copyright 2016 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.apiman.plugins.circuit_breaker.beans;
import java.util.HashSet;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Configuration object for the JSONP policy.
*
* @author Alexandre Kieling {@literal <[email protected]>}
*/
public class CircuitBreakerConfigBean {
@JsonProperty
private Set<String> errorCodes = new HashSet<>();
@JsonProperty
private int window;
@JsonProperty
private int limit;
@JsonProperty
private int reset;
@JsonProperty
private int failureCode;
/**
* Constructor.
*/
public CircuitBreakerConfigBean() {
}
/**
* @return the errorCodes
*/
public Set<String> getErrorCodes() {
return errorCodes;
}
/**
* @param errorCodes the errorCodes to set
*/
public void setErrorCodes(Set<String> errorCodes) {
this.errorCodes = errorCodes;
}
/**
* @return the window
*/
public int getWindow() {
return window;
}
/**
* @param window the window within which to keep faults (in seconds)
*/
public void setWindow(int window) {
this.window = window;
}
/**
* @return the limit
*/
public int getLimit() {
return limit;
}
/**
* @param limit the limit (# of faults)
*/
public void setLimit(int limit) {
this.limit = limit;
}
/**
* @return the reset
*/
public int getReset() {
return reset;
}
/**
* @param reset the reset time (in seconds)
*/
public void setReset(int reset) {
this.reset = reset;
}
/**
* @return the failureCode
*/
public int getFailureCode() {
return failureCode;
}
/**
* @param failureCode the failureCode to set
*/
public void setFailureCode(int failureCode) {
this.failureCode = failureCode;
}
}
| [
"[email protected]"
]
| |
f9171dfc626e0f8060967bad543d4b06b79d4131 | 1e8b7c4ad46e6711eb433070064d50a958c4d953 | /sqtf-core/src/main/java/org/sqtf/FailedTestException.java | e25bc5924a8b35f6d9887baf536ca6c70c3923bb | [
"MIT"
]
| permissive | BradleyWood/Software-Quality-Test-Framework | 465510d559ef373d96d81b2260d409d1c0f15b4b | 010dea3bfc8e025a4304ab9ef4a213c1adcb1aa0 | refs/heads/master | 2021-03-19T17:03:28.274827 | 2018-07-08T00:12:16 | 2018-07-08T00:12:16 | 121,662,864 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 139 | java | package org.sqtf;
final class FailedTestException extends Exception {
FailedTestException() {
super("Test failure");
}
}
| [
"[email protected]"
]
| |
5e941b5c694895938100145963a0aadb96efccde | dc861f083c39b16e8754810aae59c4a7dd6b4f67 | /app/src/test/java/com/madosweb/blurrystars/ExampleUnitTest.java | 31d6ebefe1cfea739f5dd6087d7a3d88a0457430 | []
| no_license | MohamedAbulgasem/BlurryStars-AndroidGame | ead3a2e2bb19b77b7823fa9de7d6abeeb6cd4eb8 | 27bfa9ff4e2fa61a1905000a84d3a057b073ae11 | refs/heads/master | 2020-03-16T19:15:04.217369 | 2018-05-20T16:41:37 | 2018-05-20T16:41:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 385 | java | package com.madosweb.blurrystars;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
]
| |
740e11a27d92f4c4c76893da2da8ac6913d6318f | 79ea8f7eee0e8a432cd6493ff21786afe3e3633c | /apphx/src/main/java/com/lifucong/apphx/presentation/contact/search/HxSearchContactPresenter.java | 935d2f3b946613a16383fd4de4525b4445721ce2 | []
| no_license | powerwolfman/ReadGroup | 6aca06c5cf1958fb5c7cdc2ffcd67fb328d9bdac | c5def303b2f4fdc0a35c08cd6f932de081ffedb1 | refs/heads/master | 2021-05-04T04:50:48.526361 | 2016-10-18T11:19:17 | 2016-10-18T11:19:17 | 70,898,326 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,242 | java | package com.lifucong.apphx.presentation.contact.search;
import android.support.annotation.NonNull;
import com.lifucong.apphx.basemvp.MvpPresenter;
import com.lifucong.apphx.model.HxContactManager;
import com.lifucong.apphx.model.event.HxErrorEvent;
import com.lifucong.apphx.model.event.HxEventType;
import com.lifucong.apphx.model.event.HxSearchContactEvent;
import com.lifucong.apphx.model.event.HxSimpleEvent;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
/**
* Created by Administrator on 2016/10/18.
*/
public class HxSearchContactPresenter extends MvpPresenter<HxSearchContactView> {
private final HxContactManager hxContactManager;
public HxSearchContactPresenter() {
hxContactManager = HxContactManager.getInstance();
}
@NonNull
@Override public HxSearchContactView getNullObject() {
return HxSearchContactView.NULL;
}
public void searchContact(String query) {
getView().startLoading();
hxContactManager.asyncSearchContacts(query);
}
public void sendInvite(String toHxId) {
// 如果已经是好友
if (hxContactManager.isFriend(toHxId)) {
getView().showAlreadyIsFriend();
return;
}
getView().startLoading();
hxContactManager.asyncSendInvite(toHxId);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEvent(HxSearchContactEvent event) {
getView().stopLoading();
if (event.isSuccess) {
getView().showContacts(event.contacts);
if (event.contacts.size() == 0) {
getView().showSearchError("No match result!");
}
} else {
getView().showSearchError(event.errorMessage);
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEvent(HxSimpleEvent e) {
if (e.type != HxEventType.SEND_INVITE) return;
getView().stopLoading();
getView().showSendInviteResult(true);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEvent(HxErrorEvent e) {
if (e.type != HxEventType.SEND_INVITE) return;
getView().stopLoading();
getView().showSendInviteResult(false);
}
}
| [
"[email protected]"
]
| |
47d59b956e560b39b2e735274b565ccef517d1cf | 37379ae134f7b0b09a841fc6938fa5f155395bb6 | /ByFei/analysis/maize2k/HapMapTaxaProcessor.java | 01488e025a3b31bf630c6bf923a5a7c0eb9e80c2 | []
| no_license | xuebozhao16/Wheat | f385196f6412bd90298aedeb51d03961c3e4ed30 | c16e9e9b342f76aeb221009c1f3cc1a41d54e8e9 | refs/heads/master | 2023-03-06T16:40:25.615124 | 2023-02-23T04:39:35 | 2023-02-23T04:39:35 | 148,152,557 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,914 | 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 analysis.maize2k;
import format.table.RowTable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import utils.PArrayUtils;
import utils.IOFileFormat;
/**
*
* @author feilu
*/
public class HapMapTaxaProcessor {
public HapMapTaxaProcessor () {
this.mkSampleTaxaMap();
String infileS1 = "/Users/feilu/Documents/analysisL/pipelineTest/HapScanner/taxaNameMap.txt";
String infileS2 = "/Users/feilu/Desktop/t.txt";
String outfileS = "/Users/feilu/Desktop/taxaBam.txt";
updateTaxaBamMap(infileS1, infileS2, outfileS);
this.testTaxaDuplicates();
}
private void testTaxaDuplicates () {
String infileS = "/Users/feilu/Desktop/taxaBam.txt";
RowTable<String> t = new RowTable<>(infileS);
List<String> taxaList = t.getColumn(0);
String[] taxaArray = taxaList.toArray(new String[taxaList.size()]);
String[] uTaxaArray = PArrayUtils.getUniqueStringArray(taxaArray);
Arrays.sort(uTaxaArray);
int[] cnts = new int[uTaxaArray.length];
for (int i = 0; i < taxaArray.length; i++) {
int index = Arrays.binarySearch(uTaxaArray, taxaArray[i]);
cnts[index]++;
}
for (int i = 0; i < cnts.length; i++) {
if (cnts[i] < 2) continue;
System.out.println(uTaxaArray[i]);
}
}
private void mkSampleTaxaMap () {
String infileS = "/Users/feilu/Documents/analysisL/pipelineTest/HapScanner/initialTaxaNameMap.txt";
String outfileS = "/Users/feilu/Documents/analysisL/pipelineTest/HapScanner/taxaNameMap.txt";
RowTable<String> t = new RowTable<>(infileS);
List<String> l = new ArrayList();
for (int i = 0; i < t.getRowNumber(); i++) {
String currentName = t.getCell(i, 1);
if (!isStandardTaxonName(currentName)) {
currentName = this.getStandardTaxonName(currentName);
}
l.add(currentName);
}
t.insertColumn("Taxa", 2, l);
t.writeTextTable(outfileS, IOFileFormat.Text);
}
private String getStandardTaxonName (String taxonName) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < taxonName.length(); i++) {
int c = (int)taxonName.charAt(i);
if ((47 < c && c < 58) || ((64 < c && c < 91)) || (96 < c && c < 123) || c == 45 || c ==95) {
sb.append(taxonName.charAt(i));
}
else {
if (sb.length() != 0) {
sb.append("_");
}
}
}
return sb.toString();
}
private boolean isStandardTaxonName (String taxonName) {
int cnt = 0;
for (int i = 0; i < taxonName.length(); i++) {
int c = (int)taxonName.charAt(i);
if ((47 < c && c < 58) || ((64 < c && c < 91)) || (96 < c && c < 123) || c == 45 || c ==95) {
cnt++;
}
}
if (cnt == taxonName.length()) return true;
return false;
}
public static void updateTaxaBamMap (String infileS1, String infileS2, String outfileS) {
RowTable<String> t = new RowTable<>(infileS1);
HashMap<String, String> sampleTaxaMap = new HashMap<>();
for (int i = 0; i < t.getRowNumber(); i++) {
sampleTaxaMap.put(t.getCell(i, 0), t.getCell(i, 2));
}
t = new RowTable<>(infileS2);
for (int i = 0; i < t.getRowNumber(); i++) {
String c = t.getCell(i, 0);
t.setCell(i, 0, sampleTaxaMap.get(c));
}
t.writeTextTable(outfileS, IOFileFormat.Text);
}
}
| [
"[email protected]"
]
| |
cb42b5f6e948de0527b6be0bff0c21ffc413e8c4 | 7398714c498444374047497fe2e9c9ad51239034 | /com/zhekasmirnov/innercore/core/MinecraftActivity.java | 1373fa43641748979535ca54428d4c051ecaf70a | []
| no_license | CheatBoss/InnerCore-horizon-sources | b3609694df499ccac5f133d64be03962f9f767ef | 84b72431e7cb702b7d929c61c340a8db07d6ece1 | refs/heads/main | 2023-04-07T07:30:19.725432 | 2021-04-10T01:23:04 | 2021-04-10T01:23:04 | 356,437,521 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,481 | java | package com.zhekasmirnov.innercore.core;
import java.lang.ref.*;
import android.app.*;
import com.zhekasmirnov.innercore.api.mod.*;
import com.zhekasmirnov.horizon.runtime.logger.*;
import com.zhekasmirnov.innercore.utils.*;
import com.zhekasmirnov.innercore.mod.resource.*;
import com.zhekasmirnov.innercore.api.runtime.*;
import com.zhekasmirnov.innercore.ui.*;
import com.zhekasmirnov.innercore.api.log.*;
import com.zhekasmirnov.mcpe161.*;
import com.zhekasmirnov.innercore.core.handle.*;
import android.os.*;
public class MinecraftActivity
{
private static final boolean COMPILE_MENU_SCRIPTS = false;
public static final String LOGGER_TAG = "INNERCORE-ACTIVITY";
private static final boolean RUN_ONLY_COMPILED_SCRIPTS = false;
public static WeakReference<Activity> current;
private static TPSMeter fpsMeter;
private static boolean isCrashHandlerLibLoaded;
private static boolean isFullscreen;
private static boolean isLoaded;
static {
MinecraftActivity.isFullscreen = false;
API.loadAllAPIs();
MinecraftActivity.isCrashHandlerLibLoaded = false;
MinecraftActivity.isLoaded = false;
MinecraftActivity.fpsMeter = new TPSMeter(20, 500);
}
private static void _initialize() {
try {
Logger.debug("INNERCORE-ACTIVITY", "starting native initialization...");
loadSubstrate();
if (MinecraftActivity.isCrashHandlerLibLoaded) {
nativeSetupCrashHandler(FileTools.assureAndGetCrashDir());
}
nativeInit();
ResourceStorage.loadAllTextures();
LoadingStage.setStage(5);
LoadingUI.setTextAndProgressBar("Initializing Minecraft...", 0.55f);
}
catch (Throwable t) {
ICLog.e("ERROR", "FAILED TO RUN INNER CORE LIB", t);
ICLog.flush();
throw new RuntimeException(t);
}
}
private static boolean checkAssetExists(final String s) {
FileTools.getAssetInputStream(s);
return true;
}
public static void forceUIThreadPriority() {
if (EnvironmentSetup.getCurrentActivity() != null) {
EnvironmentSetup.getCurrentActivity().runOnUiThread((Runnable)new Runnable() {
@Override
public void run() {
Process.setThreadPriority(-19);
}
});
return;
}
ICLog.i("ERROR", "FAILED TO SET PRIORITY TO UI THREAD");
}
public static void initialize(final boolean b) {
if (b) {
new Thread(new Runnable() {
@Override
public void run() {
_initialize();
}
}).start();
return;
}
_initialize();
}
public static void loadSubstrate() {
System.loadLibrary("tinysubstrate");
System.out.println("Substrate lib loaded");
System.loadLibrary("native-lib");
System.out.println("InnerCore lib loaded");
try {
System.loadLibrary("corkscrew");
System.out.println("crash handler lib loaded");
MinecraftActivity.isCrashHandlerLibLoaded = true;
}
catch (Throwable t) {
final StringBuilder sb = new StringBuilder();
sb.append("failed to load crash handler library ");
sb.append(t);
ICLog.i("WARNING", sb.toString());
}
}
public static native void nativeInit();
public static native void nativeSetupCrashHandler(final String p0);
public static void onFinalLoadComplete() {
MinecraftActivity.isLoaded = true;
LoadingStage.setStage(7);
LoadingUI.close();
AbiChecker.checkABIAndShowWarnings();
AdsHelper.checkPermissions();
ICLog.showIfErrorsAreFound();
LoadingStage.outputTimeMap();
}
public static void onFinalLoadStarted() {
}
public static void onLevelLeft() {
}
public static void onMCPELibLoaded() {
initialize(false);
}
public static void onNativeGuiLoaded() {
LoadingUI.setProgress(0.6f);
}
public boolean isStoragePermissionGranted() {
return true;
}
public void onCreate(final Bundle bundle) {
Logger.debug("INNERCORE", "Starting Minecraft...");
this.isStoragePermissionGranted();
}
}
| [
"[email protected]"
]
| |
ac614ae0ced817747dbf63d717066b0365e0d751 | e0770a2f82506643b5a621a8dabe1bc115738c2a | /app/src/main/java/com/shangame/fiction/book/cover/BookCoverView.java | 63ea9a6015136dfd3b909cc052f979d032a3acc8 | [
"Apache-2.0"
]
| permissive | daixu/QuReader | e6ce1821e183c07e80ef74fb69820101113296ef | bcd65dc03bbaa8e4932026dc4969f43c26caf93d | refs/heads/master | 2021-01-03T04:38:25.508410 | 2020-02-16T13:53:22 | 2020-02-16T13:53:22 | 239,925,589 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,000 | java | package com.shangame.fiction.book.cover;
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import com.fiction.bar.R;
/**
* 图书封面
* Create by Speedy on 2018/7/24
*/
public class BookCoverView extends FrameLayout {
private ImageView ivCover;
private ImageView ivLogo;
private BookCoverValue startValue;
private BookCoverValue endValue;
private BookStateLinstener bookStateLinstener;
private Activity mActivity;
private boolean isOpen;
public BookCoverView(@NonNull Context context) {
super(context);
initView(context);
}
public BookCoverView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
initView(context);
}
public BookCoverView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initView(context);
}
private void initView(Context context) {
View contentView = LayoutInflater.from(context).inflate(R.layout.book_cover_layout, null);
setBackgroundColor(Color.TRANSPARENT);
ivCover = contentView.findViewById(R.id.ivCover);
ivLogo = contentView.findViewById(R.id.ivLogo);
addView(contentView);
}
/**
* 绑定封面图片
* @param activity
* @param coverImageView
*/
public void bindCoverImageView(Activity activity,ImageView coverImageView){
this.mActivity = activity;
ivCover.setImageDrawable(coverImageView.getDrawable());
final ViewGroup window = (ViewGroup) activity.getWindow().getDecorView();
int[] location = new int[2] ;
coverImageView.getLocationOnScreen(location);//获取在整个屏幕内的绝对坐标(包括了通知栏的高度)
startValue = new BookCoverValue(location[0], location[1], coverImageView.getWidth()+location[0], location[1]+coverImageView.getHeight());
endValue = new BookCoverValue(window.getLeft(), window.getTop(), window.getRight(), window.getBottom());
window.addView(this);
}
public void unBindTargetView(){
if(mActivity != null){
final ViewGroup window = (ViewGroup) mActivity.getWindow().getDecorView();
window.removeView(this);
}
}
/**
* 开启动画
*/
public void openBook() {
if(mActivity == null){
return;
}
ValueAnimator valueAnimator = ValueAnimator.ofObject(new BookCoverEvaluator(), startValue, endValue);
valueAnimator.setDuration(1000);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
@Override
public void onAnimationUpdate(ValueAnimator animation) {
BookCoverValue midBookCoverValue = (BookCoverValue) animation.getAnimatedValue();
ivCover.setX(midBookCoverValue.getLeft());
ivCover.setY(midBookCoverValue.getTop());
ViewGroup.LayoutParams layoutParams = ivCover.getLayoutParams();
layoutParams.width = midBookCoverValue.getRight() - midBookCoverValue.getLeft();
layoutParams.height = midBookCoverValue.getBottom() - midBookCoverValue.getTop();
ivCover.setLayoutParams(layoutParams);
ivLogo.setX(midBookCoverValue.getLeft());
ivLogo.setY(midBookCoverValue.getTop());
ViewGroup.LayoutParams layoutParams1 = ivLogo.getLayoutParams();
layoutParams1.width = midBookCoverValue.getRight() - midBookCoverValue.getLeft();
layoutParams1.height = midBookCoverValue.getBottom() - midBookCoverValue.getTop();
ivLogo.setLayoutParams(layoutParams1);
}
});
valueAnimator.addListener(new Animator.AnimatorListener(){
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
if(bookStateLinstener != null){
bookStateLinstener.onBookOpened();
}
isOpen = true;
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
ivCover.setPivotX(0);
ivCover.setPivotY(ivCover.getY()/2);
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(ivCover, "rotationY", 0, -180);
objectAnimator.setDuration(1000);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(valueAnimator, objectAnimator);
animatorSet.start();
}
public void closeBook(){
if(!isOpen){
return;
}
ValueAnimator valueAnimator = ValueAnimator.ofObject(new BookCoverEvaluator(),endValue,startValue);
valueAnimator.setDuration(1000);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
@Override
public void onAnimationUpdate(ValueAnimator animation) {
BookCoverValue midBookCoverValue = (BookCoverValue) animation.getAnimatedValue();
ivCover.setX(midBookCoverValue.getLeft());
ivCover.setY(midBookCoverValue.getTop());
ViewGroup.LayoutParams layoutParams = ivCover.getLayoutParams();
layoutParams.width = midBookCoverValue.getRight() - midBookCoverValue.getLeft();
layoutParams.height = midBookCoverValue.getBottom() - midBookCoverValue.getTop();
ivCover.setLayoutParams(layoutParams);
ivLogo.setX(midBookCoverValue.getLeft());
ivLogo.setY(midBookCoverValue.getTop());
ViewGroup.LayoutParams layoutParams1 = ivLogo.getLayoutParams();
layoutParams1.width = midBookCoverValue.getRight() - midBookCoverValue.getLeft();
layoutParams1.height = midBookCoverValue.getBottom() - midBookCoverValue.getTop();
ivLogo.setLayoutParams(layoutParams1);
}
});
valueAnimator.addListener(new Animator.AnimatorListener(){
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
isOpen = false;
unBindTargetView();
if(bookStateLinstener != null){
bookStateLinstener.onBookClosed();
}
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
ivCover.setPivotX(0);
ivCover.setPivotY(ivCover.getY()/2);
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(ivCover, "rotationY", -180, 0);
objectAnimator.setDuration(1000);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(valueAnimator, objectAnimator);
animatorSet.start();
}
public void setBookStateLinstener(BookStateLinstener bookStateLinstener) {
this.bookStateLinstener = bookStateLinstener;
}
/**
* 书状态监听器
*/
public interface BookStateLinstener {
void onBookOpened();
void onBookClosed();
}
}
| [
"[email protected]"
]
| |
02f678101c7e83b2bd586134d27ce5b93618efb9 | a286f49957e5cd6e776c98205e98617c76d128ab | /SnagFlims/app/src/main/java/com/jsb/snagflims/data/ResponseCallback.java | 442212282ede0d15a197e4bff5cf9909a31f3dac | []
| no_license | Jayantheesh/SnagFlims | 499785889bb61957a2a3f6fa90c2ecf742c40a1d | 29d5816e2b53c0fdfa0b479617b02f348efa72fe | refs/heads/master | 2022-02-16T15:51:10.829549 | 2019-07-29T18:10:44 | 2019-07-29T18:10:44 | 198,307,710 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 224 | java | package com.jsb.snagflims.data;
import com.jsb.snagflims.model.SnagFlims;
import retrofit2.Response;
public interface ResponseCallback {
void onSucess(Response<SnagFlims> response);
void onFailure(String msg);
}
| [
"[email protected]"
]
| |
239b71b5c77bdc3739ca50d72e37318db45551ef | 7620774f3bf0d82561dc62aa29d65272bc246581 | /src/test/java/com/avseredyuk/carrental/dao/impl/MySqlAutomobileDaoTest.java | 364cc931fd30e7577b1e9eebb9526195ffd19c6d | []
| no_license | avseredyuk/car-rental | efb94971799e26ac30d8f192e5f6595f84bdc1af | 96fd9d7cf5c4eda840a6605c936820f051d6e9d9 | refs/heads/master | 2020-12-30T23:10:28.214965 | 2017-02-02T09:51:34 | 2017-02-02T09:51:34 | 80,601,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,503 | java | package com.avseredyuk.carrental.dao.impl;
import com.avseredyuk.carrental.dao.impl.factory.MySqlDaoFactory;
import com.avseredyuk.carrental.domain.Automobile;
import com.avseredyuk.carrental.util.RandomUtil;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static com.avseredyuk.carrental.util.Utils.*;
import static org.junit.Assert.*;
/**
* Created by lenfer on 1/28/17.
*/
public class MySqlAutomobileDaoTest {
public static final String AUTOMOBILE_MODEL_2 = "Yaris";
public static final String AUTOMOBILE_MANUFACTURER_2 = "Toyota";
public static final int AUTOMOBILE_YEAR_2 = 1999;
public static final int AUTOMOBILE_CARGO_CAPACITY_2 = 3;
public static final int AUTOMOBILE_PASSENGER_CAPACITY_2 = 4;
public static final int AUTOMOBILE_DOORS_COUNT_2 = 5;
public static final int AUTOMOBILE_PRICE_PER_DAY_2 = 123;
private Automobile randomAutomobile;
private List<Automobile> randomAutomobiles = new ArrayList<>();
private MySqlAutomobileDao dao = MySqlDaoFactory.getInstance().getAutomobileDao();
@Before
public void setUp() throws Exception {
resetDB();
randomAutomobile = RandomUtil.getAutomobile();
for(int i = 0; i < TOTAL_COUNT_ADDED; i++) {
randomAutomobiles.add(RandomUtil.getAutomobile());
}
}
@Test(expected = NullPointerException.class)
public void persistNull() throws Exception{
assertFalse(dao.persist(null));
}
@Test(expected = NullPointerException.class)
public void persistNullElements() throws Exception{
randomAutomobile.setDeliveryPlace(null);
randomAutomobile.setPricePerDay(null);
randomAutomobile.setDoorsCount(null);
randomAutomobile.setPassengerCapacity(null);
randomAutomobile.setCargoCapacity(null);
randomAutomobile.setModel(null);
randomAutomobile.setManufacturer(null);
randomAutomobile.setYearOfProduction(null);
randomAutomobile.setCategory(null);
randomAutomobile.setFuel(null);
randomAutomobile.setTransmission(null);
assertFalse(dao.persist(randomAutomobile));
}
@Test
public void persistValid() throws Exception {
assertTrue(dao.persist(randomAutomobile));
assertNotNull(randomAutomobile.getId());
}
@Test(expected = NullPointerException.class)
public void persistWithNonPersistedPlace() throws Exception {
randomAutomobile.setDeliveryPlace(RandomUtil.getPlace());
dao.persist(randomAutomobile);
}
@Test
public void readValidId() throws Exception {
assertTrue(dao.persist(randomAutomobile));
Automobile automobile2 = dao.read(randomAutomobile.getId());
assertEquals(randomAutomobile, automobile2);
}
@Test
public void readInvalidId() throws Exception {
assertNull(dao.read(NON_EXISTENT_ID));
}
@Test
public void updateValidId() throws Exception {
dao.persist(randomAutomobile);
randomAutomobile.setPricePerDay(AUTOMOBILE_PRICE_PER_DAY_2);
randomAutomobile.setDoorsCount(AUTOMOBILE_DOORS_COUNT_2);
randomAutomobile.setPassengerCapacity(AUTOMOBILE_PASSENGER_CAPACITY_2);
randomAutomobile.setCargoCapacity(AUTOMOBILE_CARGO_CAPACITY_2);
randomAutomobile.setModel(AUTOMOBILE_MODEL_2);
randomAutomobile.setManufacturer(AUTOMOBILE_MANUFACTURER_2);
randomAutomobile.setYearOfProduction(AUTOMOBILE_YEAR_2);
assertTrue(dao.update(randomAutomobile));
assertEquals(randomAutomobile, dao.read(randomAutomobile.getId()));
}
@Test
public void updateInvalidId() throws Exception {
randomAutomobile.setId(NON_EXISTENT_ID);
assertFalse(dao.update(randomAutomobile));
}
@Test
public void deleteValidId() throws Exception {
assertTrue(dao.persist(randomAutomobile));
assertTrue(dao.delete(randomAutomobile));
assertNull(dao.read(randomAutomobile.getId()));
}
@Test
public void deleteInvalidId() throws Exception {
randomAutomobile.setId(NON_EXISTENT_ID);
assertFalse(dao.delete(randomAutomobile));
}
@Test
public void findAll() throws Exception {
randomAutomobiles.forEach(dao::persist);
List<Automobile> foundAutomobiles = dao.findAll();
assertEquals(TOTAL_COUNT_ADDED, foundAutomobiles.size());
}
@Test
public void findAllValidRange() throws Exception {
for (int i = FIND_RANGE_START; i < FIND_RANGE_SIZE; i++) {
dao.persist(randomAutomobiles.get(i));
}
List<Automobile> foundAutomobiles = dao.findAll(FIND_RANGE_START, FIND_RANGE_SIZE);
assertEquals(FIND_RANGE_SIZE, foundAutomobiles.size());
}
@Test
public void findAllNegativeStartRange() throws Exception {
randomAutomobiles.forEach(dao::persist);
List<Automobile> automobiles = dao.findAll(NEGATIVE_RANGE, POSITIVE_RANGE);
assertNotNull(automobiles);
assertEquals(0, automobiles.size());
}
@Test
public void findAllNegativeSizeRange() throws Exception {
randomAutomobiles.forEach(dao::persist);
List<Automobile> automobiles = dao.findAll(ZERO_RANGE, NEGATIVE_RANGE);
assertNotNull(automobiles);
assertEquals(0, automobiles.size());
}
@Test
public void findAllBothNegativeRange() throws Exception {
randomAutomobiles.forEach(dao::persist);
List<Automobile> automobiles = dao.findAll(NEGATIVE_RANGE, NEGATIVE_RANGE);
assertNotNull(automobiles);
assertEquals(0, automobiles.size());
}
@Test
public void findAllZeroSizeRange() throws Exception {
randomAutomobiles.forEach(dao::persist);
List<Automobile> automobiles = dao.findAll(POSITIVE_RANGE, ZERO_RANGE);
assertNotNull(automobiles);
assertEquals(0, automobiles.size());
}
@Test
public void findAllGreaterThenExistsRange() throws Exception {
randomAutomobiles.forEach(dao::persist);
List<Automobile> automobiles = dao.findAll(TOO_BIG_RANGE, TOO_BIG_RANGE);
assertNotNull(automobiles);
assertEquals(0, automobiles.size());
}
@Test
public void getCount() throws Exception {
for (int i = 0; i < TOTAL_COUNT_ADDED; i++) {
assertTrue(dao.persist(randomAutomobile));
}
assertEquals(TOTAL_COUNT_ADDED, dao.getCount());
}
} | [
"[email protected]"
]
| |
a8585aa5da5ed865cd0744d1e3b00c8922151fb5 | 006bc3911b1debfcdbcdcc37313ad7e2c7567c75 | /src/main/java/com/checkout/sessions/completion/HostedCompletionInfo.java | 6f2f89a532eae0a0fbe6a8cad20b94532dc45f0b | [
"MIT"
]
| permissive | checkout/checkout-sdk-java | 835a30e576af3b5b7e21d148f47cc24ea63dc576 | 8f786cec6791e67e705124ff0213a5aad595a91e | refs/heads/master | 2023-08-16T04:19:56.009399 | 2023-08-11T12:11:22 | 2023-08-14T14:26:59 | 192,770,578 | 26 | 29 | MIT | 2023-09-14T08:39:02 | 2019-06-19T16:44:48 | Java | UTF-8 | Java | false | false | 1,015 | java | package com.checkout.sessions.completion;
import com.google.gson.annotations.SerializedName;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public final class HostedCompletionInfo extends CompletionInfo {
@SerializedName("callback_url")
private String callbackUrl;
@SerializedName("success_url")
private String successUrl;
@SerializedName("failure_url")
private String failureUrl;
@Builder
private HostedCompletionInfo(final String callbackUrl,
final String successUrl,
final String failureUrl) {
super(CompletionInfoType.HOSTED);
this.callbackUrl = callbackUrl;
this.successUrl = successUrl;
this.failureUrl = failureUrl;
}
public HostedCompletionInfo() {
super(CompletionInfoType.NON_HOSTED);
}
}
| [
"[email protected]"
]
| |
e818568417c10b28192594a028c6d6df77cc5d54 | b26a63c3743afd3aedcec85b1e99631be4e3e129 | /src/main/java/com/example/sg/fx/rate/db/model/FxRateModel.java | f9efa7c9eacc827b95efe5644dc9bf1e7ad2966b | []
| no_license | ps2420/kafka-stream-examples | bbbf0a54d6aa14e77fd3f211fac0da37f4963a5c | 1e998c71405f7ad51fc0ff15f12ab290d4069362 | refs/heads/master | 2020-03-30T11:41:14.077154 | 2018-10-02T02:35:22 | 2018-10-02T02:35:22 | 151,187,205 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 918 | java | package com.example.sg.fx.rate.db.model;
import java.io.Serializable;
import java.util.Date;
public class FxRateModel implements Serializable {
private static final long serialVersionUID = 1L;
private double bid;
private double ask;
private String currency;
private String tenor;
private Date timestamp;
public double getBid() {
return bid;
}
public void setBid(final double bid) {
this.bid = bid;
}
public double getAsk() {
return ask;
}
public void setAsk(final double ask) {
this.ask = ask;
}
public String getCurrency() {
return currency;
}
public void setCurrency(final String currency) {
this.currency = currency;
}
public String getTenor() {
return tenor;
}
public void setTenor(final String tenor) {
this.tenor = tenor;
}
public Date getTimestamp() {
return timestamp;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
}
| [
"[email protected]"
]
| |
940967a6e35f1b5f913e8ad3d4cb81143f7c6c4b | f331c091d6d8a2aac7b5af11e05ffe7b5cafc6d8 | /myBudget/src/com/zavitz/mybudget/screens/ModifyBudgetScreen.java | ff8c61fc18acfe98019481fbea40b2a8fb884d32 | [
"MIT"
]
| permissive | ianzavitz/blackberry-apps | 1f1df19d509d55588d3fa822e9284a3eb45d446a | c757ee491fb106021b5100c0aa1c1a0de80624b9 | refs/heads/master | 2020-04-08T01:45:47.076256 | 2012-02-15T19:50:44 | 2012-02-15T19:50:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,612 | java | package com.zavitz.mybudget.screens;
import com.zavitz.mybudget.UiApp;
import com.zavitz.mybudget.Utilities;
import com.zavitz.mybudget.elements.Budget;
import com.zavitz.mybudget.elements.Transaction;
import net.rim.device.api.system.Characters;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
public class ModifyBudgetScreen extends PopupScreen {
private ButtonField ok, close;
private AutoTextEditField amount;
private ObjectChoiceField type;
private CheckboxField recurring;
public ModifyBudgetScreen(final Budget budget) {
super(new VerticalFieldManager());
LabelField header = new LabelField("Modify a Budget");
header.setFont(getFont().derive(Font.BOLD));
LabelField sheader = new LabelField("Currently: $" + Utilities.formatDouble(budget.getAmount()));
sheader.setFont(getFont().derive(Font.ITALIC, getFont().getHeight() - 4));
type = new ObjectChoiceField("Modification:", new String[] { "None", "Add",
"Subtract", "Edit" });
type.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field f, int instance) {
boolean contained = false;
for(int i = 0; i < getFieldCount(); i++)
if(getField(i) == amount)
contained = true;
switch (type.getSelectedIndex()) {
case 0:
if(contained)
delete(amount);
break;
case 1:
if(!contained) {
insert(amount, 3);
contained = true;
}
amount.setText("");
case 2:
if(!contained)
insert(amount, 3);
break;
case 3:
if(!contained)
insert(amount, 3);
amount.setText(String.valueOf(Utilities.formatDoubleNoCommas(budget.getAmount())));
break;
}
}
});
amount = new AutoTextEditField("Amount: ", "", 100,
AutoTextEditField.FILTER_REAL_NUMERIC);
recurring = new CheckboxField("Recurring", budget.getRecurring());
ok = new ButtonField("Ok");
ok.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field f, int instance) {
switch (type.getSelectedIndex()) {
case 1:
budget.setAmount(budget.getAmount()
+ Double.parseDouble(amount.getText()));
break;
case 2:
budget.setAmount(budget.getAmount()
- Double.parseDouble(amount.getText()));
break;
case 3:
budget.setAmount(Double.parseDouble(amount.getText()));
break;
}
budget.setRecurring(recurring.getChecked());
UiApp.save();
setDirty(false);
close();
UiApplication.getUiApplication().repaint();
}
});
close = new ButtonField("Close");
close.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field f, int instance) {
setDirty(false);
close();
}
});
HorizontalFieldManager buttons = new HorizontalFieldManager();
buttons.add(ok);
buttons.add(close);
add(header);
add(sheader);
add(type);
add(recurring);
add(buttons);
}
public boolean keyChar(char key, int status, int time) {
boolean retval = false;
switch (key) {
case Characters.ENTER:
if (getLeafFieldWithFocus() != close) {
ok.getChangeListener().fieldChanged(null, 0);
retval = true;
break;
}
case Characters.ESCAPE:
close.getChangeListener().fieldChanged(null, 0);
break;
default:
retval = super.keyChar(key, status, time);
}
return retval;
}
}
| [
"[email protected]"
]
| |
cfec1ff0c2a71c9a26b81e01ba64549cdb94afad | c9e6a6ef09d6cffed0877bda8fb71d16c30ade81 | /ArduinoLEDController/app/src/test/java/meethook/infobeans/com/arduinoledcontroller/ExampleUnitTest.java | 6c675b9ca2452ddaadeee835f231b812fac0d301 | []
| no_license | FarazAhmadBPL/Arduino-LED-Controller | 3f140d004e20e9720297d90e5f6321a8ff0bae4e | b124e31f669c2ab3f058ae67d5f72852b1f92738 | refs/heads/master | 2020-03-22T11:02:31.893482 | 2018-07-06T07:13:33 | 2018-07-06T07:13:33 | 139,942,486 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 421 | java | package meethook.infobeans.com.arduinoledcontroller;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
]
| |
3ab013c624b1ba1969311d24dd6bb855eae196f2 | 51cc151ed0d06bee5c67215e1a8ea8f257717e70 | /src/main/java/chat/core/AbstractSocketManager.java | 10f3f0733e253c92d7840bba31f821deeeeb9591 | []
| no_license | frango9000/PSP_NetChat | a1816001a4bf9cebacb4e4ad6b5ded1ffd53a894 | f839b73daaa938d17e5b71c07e78a9b4c3613159 | refs/heads/master | 2022-04-03T03:04:40.766525 | 2020-02-22T19:29:27 | 2020-02-22T19:29:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,436 | java | package chat.core;
import chat.core.AppPacket.ProtocolSignal;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import tools.log.Flogger;
public abstract class AbstractSocketManager extends ActivableNotifier {
protected Socket managedSocket;
protected ExecutorService managerPool;
protected AppPacket heartbeatPacket;
protected HeartbeatDaemon heartbeatDaemon;
protected CommandReceiver commandReceiver;
protected CommandTransmitter commandTransmitter;
protected BlockingQueue<AppPacket> inboundCommandQueue;
protected BlockingQueue<AppPacket> outboundCommandQueue;
protected InputStream inputStream;
protected OutputStream outputStream;
public Socket getManagedSocket() {
return managedSocket;
}
public void setManagedSocket(Socket managedSocket) {
this.managedSocket = managedSocket;
}
public ExecutorService getManagerPool() {
return managerPool;
}
public void setManagerPool(ExecutorService managerPool) {
this.managerPool = managerPool;
}
public AppPacket getHeartbeatPacket() {
return heartbeatPacket != null
? heartbeatPacket
: new AppPacket(ProtocolSignal.HEARTBEAT,
managedSocket.getLocalSocketAddress(),
"kokoro",
"heartbeat");
}
public void setHeartbeatPacket(AppPacket heartbeatPacket) {
this.heartbeatPacket = heartbeatPacket;
}
public HeartbeatDaemon getHeartbeatDaemon() {
return heartbeatDaemon;
}
public void setHeartbeatDaemon(HeartbeatDaemon heartbeatDaemon) {
this.heartbeatDaemon = heartbeatDaemon;
}
public CommandReceiver getCommandReceiver() {
return commandReceiver;
}
public void setCommandReceiver(CommandReceiver commandReceiver) {
this.commandReceiver = commandReceiver;
}
public CommandTransmitter getCommandTransmitter() {
return commandTransmitter;
}
public void setCommandTransmitter(CommandTransmitter commandTransmitter) {
this.commandTransmitter = commandTransmitter;
}
public void setInboundCommandQueue(BlockingQueue<AppPacket> inboundCommandQueue) {
this.inboundCommandQueue = inboundCommandQueue;
}
public void setOutboundCommandQueue(BlockingQueue<AppPacket> outboundCommandQueue) {
this.outboundCommandQueue = outboundCommandQueue;
}
public BlockingQueue<AppPacket> getInboundCommandQueue() {
return inboundCommandQueue;
}
public BlockingQueue<AppPacket> getOutboundCommandQueue() {
return outboundCommandQueue;
}
public InputStream getInputStream() {
return inputStream;
}
public void setInputStream(InputStream inputStream) {
this.inputStream = inputStream;
}
public OutputStream getOutputStream() {
return outputStream;
}
public void setOutputStream(OutputStream outputStream) {
this.outputStream = outputStream;
}
public void setOutputStream() throws IOException {
this.outputStream = managedSocket.getOutputStream();
}
public void setInputStream() throws IOException {
this.inputStream = managedSocket.getInputStream();
}
public void setStreams() throws IOException {
setInputStream();
setOutputStream();
}
public void queueTransmission(AppPacket appPacket) {
try {
outboundCommandQueue.put(appPacket);
} catch (InterruptedException e) {
Flogger.atWarning().withCause(e).log("ER-ASM-0001");
} catch (Exception e) {
Flogger.atWarning().withCause(e).log("ER-ASM-0000");
}
}
public void queueTransmission(String username, String message) {
AppPacket newMessage = new AppPacket(ProtocolSignal.NEW_MESSAGE, managedSocket.getLocalSocketAddress(), username, message);
queueTransmission(newMessage);
}
public void sendHeartbeatPacket() {
if (!outboundCommandQueue.contains(heartbeatPacket)) {
try {
outboundCommandQueue.put(getHeartbeatPacket());
} catch (InterruptedException e) {
Flogger.atWarning().withCause(e).log("ER-ASM-0003");
} catch (Exception e) {
Flogger.atWarning().withCause(e).log("ER-ASM-0002");
}
}
}
public boolean isSocketOpen() {
return managedSocket != null && !managedSocket.isClosed();
}
public void closeSocket() {
try {
if (inputStream != null)
inputStream.close();
if (outputStream != null)
outputStream.close();
if (managedSocket != null)
managedSocket.close();
} catch (IOException e) {
Flogger.atWarning().withCause(e).log("ER-ASM-0005");
} catch (Exception e) {
Flogger.atWarning().withCause(e).log("ER-ASM-0004");
} finally {
setActive(false);
}
}
protected void closePool() {
if (managerPool != null) {
managerPool.shutdown(); // Disable new tasks from being submitted
try {
// Wait a while for existing tasks to terminate
if (!managerPool.awaitTermination(30, TimeUnit.SECONDS)) {
managerPool.shutdownNow(); // Cancel currently executing tasks
// Wait a while for tasks to respond to being cancelled
if (!managerPool.awaitTermination(30, TimeUnit.SECONDS)) {
System.err.println("Pool did not terminate");
}
}
} catch (InterruptedException ie) {
// (Re-)Cancel if current thread also interrupted
managerPool.shutdownNow();
Flogger.atWarning().withCause(ie).log("ER-ASM-0008");
} catch (NullPointerException npw) {
Flogger.atWarning().withCause(npw).log("ER-ASM-0007");
} catch (Exception e) {
Flogger.atWarning().withCause(e).log("ER-ASM-0006");
} finally {
// Thread.currentThread().interrupt();
}
}
}
protected void initializeChildProcesses() {
heartbeatDaemon = new HeartbeatDaemon(this);
commandReceiver = new CommandReceiver(this);
commandTransmitter = new CommandTransmitter(this);
}
protected void poolUpChildProcesses() {
managerPool.submit(commandTransmitter);
managerPool.submit(commandReceiver);
managerPool.submit(heartbeatDaemon);
}
protected void deactivateChildProcesses() {
if (heartbeatDaemon != null)
heartbeatDaemon.setActive(false);
if (commandReceiver != null)
commandReceiver.setActive(false);
if (commandTransmitter != null)
commandTransmitter.setActive(false);
}
public synchronized void updateHeartbeatDaemonTime() {
heartbeatDaemon.updateHeartBeatTime();
}
public abstract void startSocketManager();
public abstract void stopSocketManager();
}
| [
"[email protected]"
]
| |
49ccf4e666d0f1e461451cb39230c07a2e2d9bc6 | d280800ca4ec277f7f2cdabc459853a46bf87a7c | /spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/ExampleException.java | 0cbe3925b82d5df699070ff89d72e3ffe1967eb3 | [
"Apache-2.0"
]
| permissive | qqqqqcjq/spring-boot-2.1.x | e5ca46d93eeb6a5d17ed97a0b565f6f5ed814dbb | 238ffa349a961d292d859e6cc2360ad53b29dfd0 | refs/heads/master | 2023-03-12T12:50:11.619493 | 2021-03-01T05:32:52 | 2021-03-01T05:32:52 | 343,275,523 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 951 | java | /*
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.test.autoconfigure.web.servlet.mockmvc;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
/**
* Example exception used in {@link WebMvcTest} tests.
*
* @author Phillip Webb
*/
public class ExampleException extends RuntimeException {
}
| [
"[email protected]"
]
| |
7ade04f2e67ea832f4459a20864db8dcc63906bc | 2097dc3f3306232a1ded508c1159ae129d881294 | /src/test/java/modelparser/TestUtil.java | 52dbd513d654dac1c587ac6192535148ba4930bd | []
| no_license | Gribiwe/anotherCalculator | 5dc51635796134fd1cdaec731083563a7857727a | 1e7f1e24eb5d64b85431ba6366b492ca5d933b97 | refs/heads/master | 2021-07-11T03:38:48.004689 | 2020-07-30T23:10:04 | 2020-07-30T23:10:04 | 152,425,811 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,507 | java | package modelparser;
import gribiwe.controller.util.HistoryLineParser;
import gribiwe.controller.util.OutputNumberParser;
import gribiwe.model.ModelBrain;
import gribiwe.model.dto.BuildingSpecialOperations;
import gribiwe.model.exception.OverflowException;
import gribiwe.model.exception.UncorrectedDataException;
import gribiwe.model.exception.ZeroDivideException;
import gribiwe.model.exception.ZeroDivideZeroException;
import gribiwe.model.util.Digit;
import gribiwe.model.util.SimpleOperation;
import gribiwe.model.util.SpecialOperation;
import java.math.BigDecimal;
import static gribiwe.model.util.MemoryOperation.ADD;
import static gribiwe.model.util.MemoryOperation.SUBTRACT;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
/**
* Util class for testing parsed model values
*
* @author Gribiwe
*/
class TestUtil {
/**
* exemplar of Main model class
*/
private ModelBrain mainModel;
/**
* default constructor which
* makes initialization of main model
*/
TestUtil() {
mainModel = new ModelBrain();
}
/**
* test method for testing parsed model value
*
* @param actionSequence string value of sequence
* which will be emulated
* @param expectedOutputNumber expected value of
* parsed model value
* @param expectedHistory value of expected
* history line value
*/
void doTest(String actionSequence, String expectedOutputNumber, String expectedHistory) {
doTest(actionSequence, expectedOutputNumber, expectedHistory, "0");
}
/**
* test method for testing parsed model value
*
* @param actionSequence string value of sequence
* which will be emulated
* @param expectedOutputNumber expected value of
* parsed model value
* @param expectedHistory value of expected history line
* @param expectedMemory value of expected memory value
*/
void doTest(String actionSequence, String expectedOutputNumber, String expectedHistory, String expectedMemory) {
mainModel = new ModelBrain();
BigDecimal modelResult = null;
for (String command : actionSequence.split(" ")) {
try {
modelResult = emulate(command);
} catch (OverflowException | ZeroDivideZeroException | ZeroDivideException | UncorrectedDataException e) {
fail("unexpected exception");
}
}
String outputNumberAtResult;
if (mainModel.isBuildingNumber()) {
outputNumberAtResult = OutputNumberParser.formatInput(mainModel.getBuildingNumber());
} else {
outputNumberAtResult = OutputNumberParser.formatResult(modelResult, true);
}
assertEquals(expectedOutputNumber, outputNumberAtResult);
String historyLineAtResult = HistoryLineParser.parse(mainModel.getHistoryLineDto());
if (mainModel.isFormingSpecialOperation()) {
BuildingSpecialOperations buildingSpecialOperations = mainModel.getFormingSpecialOperationsDto();
historyLineAtResult += HistoryLineParser.parseSpecialOperations(buildingSpecialOperations);
}
assertEquals(expectedHistory, historyLineAtResult);
String memoryNumberAtResult = OutputNumberParser.formatResult(mainModel.getMemoryNumber(), true);
assertEquals(expectedMemory, memoryNumberAtResult);
}
/**
* method for emulating actions
* provided by string value of section
*
* @param section string value of
* operation or number to emulate
* @return result from model after emulating action
*/
private BigDecimal emulate(String section) throws OverflowException, ZeroDivideZeroException, ZeroDivideException, UncorrectedDataException {
BigDecimal toReturn;
if (section.equals("/")) {
toReturn = mainModel.doOperation(SimpleOperation.DIVIDE);
} else if (section.equals("*")) {
toReturn = mainModel.doOperation(SimpleOperation.MULTIPLY);
} else if (section.equals("-")) {
toReturn = mainModel.doOperation(SimpleOperation.SUBTRACT);
} else if (section.equals("+")) {
toReturn = mainModel.doOperation(SimpleOperation.PLUS);
} else if (section.equals("=")) {
toReturn = mainModel.doEquals();
} else if (section.equals("√")) {
toReturn = mainModel.doSpecialOperation(SpecialOperation.ROOT);
} else if (section.equals("1/x")) {
toReturn = mainModel.doSpecialOperation(SpecialOperation.ONE_DIV_X);
} else if (section.equals("sqr")) {
toReturn = mainModel.doSpecialOperation(SpecialOperation.SQUARE);
} else if (section.equals("%")) {
toReturn = mainModel.doPercent();
} else if (section.equals("m+")) {
toReturn = mainModel.operateMemory(ADD);
} else if (section.equals("m-")) {
toReturn = mainModel.operateMemory(SUBTRACT);
} else if (section.equals("mr")) {
toReturn = mainModel.loadFromMemory();
} else if (section.equals("mc")) {
toReturn = mainModel.clearMemory();
} else if (section.equals("ce")) {
toReturn = mainModel.deleteAllDigits();
} else if (section.equals("c")) {
toReturn = mainModel.deleteAllDigitsAndHistory();
} else if (section.equals("←")) {
toReturn = mainModel.deleteDigit();
} else if (section.equals("n")) {
toReturn = mainModel.doNegate();
} else {
toReturn = enterNumber(section);
}
return toReturn;
}
/**
* method for emulating action
* which contains only one symbol.
* Expected, it's a numbers or point
*
* @param character char value to emulate
* @return number from model after entering character
*/
private BigDecimal emulate(Character character) {
BigDecimal toReturn;
if (character == ',') {
toReturn = mainModel.addPoint();
} else if (character == '0') {
toReturn = mainModel.addDigit(Digit.ZERO);
} else if (character == '1') {
toReturn = mainModel.addDigit(Digit.ONE);
} else if (character == '2') {
toReturn = mainModel.addDigit(Digit.TWO);
} else if (character == '3') {
toReturn = mainModel.addDigit(Digit.THREE);
} else if (character == '4') {
toReturn = mainModel.addDigit(Digit.FOUR);
} else if (character == '5') {
toReturn = mainModel.addDigit(Digit.FIVE);
} else if (character == '6') {
toReturn = mainModel.addDigit(Digit.SIX);
} else if (character == '7') {
toReturn = mainModel.addDigit(Digit.SEVEN);
} else if (character == '8') {
toReturn = mainModel.addDigit(Digit.EIGHT);
} else if (character == '9') {
toReturn = mainModel.addDigit(Digit.NINE);
} else {
System.out.println(character);
fail("error in syntax");
toReturn = null;
}
return toReturn;
}
/**
* method for entering a number to model
*
* @param number string value of number to enter
* @return number from model after entering number
*/
private BigDecimal enterNumber(String number) {
for (int i = 0; i < number.length() - 1; i++) {
char character = number.charAt(i);
emulate(character);
}
return emulate(number.charAt(number.length() - 1));
}
} | [
"[email protected]"
]
| |
e8e02de364d4708f26ff147564abb50e4e92d1f5 | a97d3c14a3fd406fc5cf666fbd016aa200bab721 | /ex11/task11.3/Student.java | b9eb5bbe9b2f020022e58626e4604d18180dbd9a | []
| no_license | vladg94/java | 5f584064d3c6152a41422cf6692564f36b034c9f | e5005a757a06057ac4a5da30aee9c2ced8f43bef | refs/heads/master | 2021-06-03T21:04:33.098097 | 2017-08-26T19:18:58 | 2017-08-26T19:18:58 | 34,063,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,070 | java | /**
* Student class.
* @author Vlad Georgescu
*/
public class Student
{
private final String studentName;
private Phone mobilePhone = null;
/**
* Constructor a new Student.
*
* @param A string name of the student.
*/
public Student(String studentName)
{
this.studentName = studentName;
}
/**
* Creates a new mobile phone for a student.
*
* @param Takes two parameters one String name of the model of the phone
* and another String for the account name.
*/
public void purchasePhone(String phoneModel, String accountName)
{
this.mobilePhone = new Phone(phoneModel, new Account(accountName));
}
/**
* Verifies if there is a mobile phone.
* If it is a mobile phone it increases it`s account by
* the given argument.
*
* @param Integer value of pounds.
*/
public void topUp(int pounds)
{
if (this.mobilePhone == null) {
System.out.println("NO PHONE!!");
} else {
Account phoneAccount = this.mobilePhone.getAccount();
phoneAccount.increaseBalance(pounds);
}
}
/**
* Verifies if there is a mobile phone.
* If it is a mobile phone this method will calculate the Balance
* of the Account, then will calculate the seconds talked on that phone.
*
* @param int desired seconds
*/
public void makeCall(int desiredSeconds)
{
if (this.mobilePhone == null) {
System.out.println("No PHONE!!");
} else {
Account phoneAccount = this.mobilePhone.getAccount();
int seconds = phoneAccount.calculateBalance(desiredSeconds);
this.mobilePhone.memorizeSeconds(seconds);
}
}
/**
* Provides a Student(name, phone(model, seconds, account(provider, balance))) repesentation.
*
* @return representation under a string format.
*/
public String toString()
{
return "Student(" + this.studentName + ", " + this.mobilePhone + ")";
}
}
| [
"[email protected]"
]
| |
4bd792aee03581d6d7c589a4d87aa2ed208c1ff9 | ad4463e2f9acd29ed86336b855a2681682eef549 | /src/com/company/HumanXenomorph.java | 9b3591b06082ad325d3766de3effd6e1af585034 | []
| no_license | swest599/Inheritance-Polymorphism | 412574aea6187a5105c728b541b28ed24e4ad54e | 14decb41d1785b6a330fd006611e75925d9cef04 | refs/heads/master | 2020-04-02T03:01:26.219345 | 2018-10-20T19:39:20 | 2018-10-20T19:39:20 | 153,941,586 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 209 | java | package com.company;
class HumanXenomorph extends AlienXenomorph {
public void walkLikeAHuman() {
System.out.println("I spawned from a human, so I can run upright!");
}
}
| [
"[email protected]"
]
| |
dd12609fbbdd2eda9de166d3f7711a70758b734a | 128636ab55275eee12aecf2c6408787679ddd0a8 | /src/nu/validator/datatype/AutocompleteDetailsUrl.java | 0ed2a90b10c9b8886154af5b0925f45e03ddc516 | [
"MIT"
]
| permissive | validator/validator | db63c9085b0226cd7556f554757507d22abdf9da | ed62b92a2dd36b02711333f43f459f23218a2ac1 | refs/heads/main | 2023-08-24T19:30:45.547678 | 2023-08-13T20:41:09 | 2023-08-23T20:43:21 | 1,133,930 | 1,609 | 326 | MIT | 2023-09-11T04:26:10 | 2010-12-03T02:00:23 | Java | UTF-8 | Java | false | false | 2,146 | java | /*
* Copyright (c) 2016 Mozilla Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
package nu.validator.datatype;
import java.util.HashSet;
public final class AutocompleteDetailsUrl extends AbstractAutocompleteDetails {
/**
* The singleton instance.
*/
public static final AutocompleteDetailsUrl THE_INSTANCE = new AutocompleteDetailsUrl();
private AutocompleteDetailsUrl() {
super();
}
private static final HashSet<String> allowedFieldnames = new HashSet<>();
private static final HashSet<String> allowedContactFieldnames = new HashSet<>();
static {
allowedFieldnames.add("url");
allowedFieldnames.add("photo");
allowedFieldnames.add("impp");
allowedContactFieldnames.add("impp");
}
@Override
public HashSet<String> getAllowedFieldnames() {
return allowedFieldnames;
}
@Override
public HashSet<String> getAllowedContactFieldnames() {
return allowedContactFieldnames;
}
@Override
public String getName() {
return "autocomplete detail tokens (URL)";
}
}
| [
"[email protected]"
]
| |
e5cfb2ef03f4c49af2e0b15070a2cf61fd00436f | 99579c1fa7851dac0621d454062e368eed9aee47 | /app/src/main/java/com/example/sean/adssdk/model/info/AdsInfo.java | 1a07f59d06ca4829828b0320feef5036825c8265 | []
| no_license | SeanZhu11/AdSDK | f83a564eea8b2d0f07be71f449c485f10b1b8469 | 52f1b1b33322665822e7633a3022c1725dd5b7d0 | refs/heads/master | 2021-01-20T16:09:27.882588 | 2017-05-10T04:23:02 | 2017-05-10T04:23:02 | 90,820,007 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,449 | java | package com.example.sean.adssdk.model.info;
/**
* Created by Sean on 17/4/20.
*/
public class AdsInfo {
private final float FullMark = 5.0f;
private String adsPicUrl; //图片地址
// private String sponsored; //赞助商
private String adsDescription; //广告介绍
private String adsUrl;//广告下载地址
private String adsBundleId;//广告包名
private String adsTitle;//广告名称
private String adsIcon;//广告icon
private float rating;//广告评价
private String adsDownLoadCount;//广告下载次数
private String category;//类别
private String appSize;//包大小
private String actionText;//下载是否免费
private int appShowType; //展现的形式
public AdsInfo(){
}
public void setAdsPicUrl(String adsPicUrl){
this.adsPicUrl = adsPicUrl;
}
public String getAdsPicUrl(){
if(adsPicUrl == null){
adsPicUrl = "";
}
return adsPicUrl;
}
public void setAdsDescription(String adsDescription){
this.adsDescription = adsDescription;
}
public String getAdsDescription(){
if(adsDescription == null){
adsDescription = "";
}
return adsDescription;
}
public void setAdsUrl(String adsUrl){
this.adsUrl = adsUrl;
}
public String getAdsUrl(){
if(adsUrl == null){
adsUrl = "";
}
return adsUrl;
}
public void setAdsBundleId(String adsBundleId){
this.adsBundleId = adsBundleId;
}
public String getAdsBundleId(){
if(adsBundleId == null){
adsBundleId = "";
}
return adsBundleId;
}
public void setAdsTitle(String adsTitle){
this.adsTitle = adsTitle;
}
public String getAdsTitle(){
if(adsTitle == null){
adsTitle = "";
}
return adsTitle;
}
public void setRating(float rating){
if(rating >= FullMark){
rating = FullMark;
}
this.rating = rating;
}
public float getRating(){
return rating;
}
public void setAdsDownLoadCount(String adsDownLoadCount){
this.adsDownLoadCount = adsDownLoadCount;
}
public String getAdsDownLoadCount(){
if(adsDownLoadCount == null){
adsDownLoadCount = "";
}
return adsDownLoadCount;
}
public void setCategory(String category){
this.category = category;
}
public String getCategory(){
if(category == null){
category = "";
}
return category;
}
public void setAppSize(String appSize){
this.appSize = appSize;
}
public String getAppSize(){
if(appSize == null){
appSize = "";
}
return appSize;
}
public void setActionText(String actionText){
this.actionText = actionText;
}
public String getActionText(){
if(actionText == null){
actionText = "";
}
return actionText;
}
public void setAdsIcon(String adsIcon){
this.adsIcon = adsIcon;
}
public String getAdsIcon(){
if(adsIcon == null){
adsIcon = "";
}
return adsIcon;
}
public void setAppShowType(int appShowType){
this.appShowType = appShowType;
}
public int getAppShowType(){
return appShowType;
}
}
| [
"[email protected]"
]
| |
b4537fbf8f5e4c6b0e45bda8114494edc7bd6907 | 006babf1e9574fd3299cd6456a8d08642a8a7077 | /Applications/Pachyderm3/Sources/org/pachyderm/woc/PXOuterPageWrapper.java | cedde5dbf5192be4e0c3a40eb20259178f1c5838 | [
"CC0-1.0"
]
| permissive | gavineadie/Pachyderm | d79d1f26d90acbbecee6cd0d11cad86923e71c7d | e5bdeb852c10e33aea70e85e96a4eeaf68546c5c | refs/heads/master | 2023-05-11T20:34:21.553619 | 2023-05-03T04:05:43 | 2023-05-03T04:05:43 | 48,921,604 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,128 | java | //
// PXOuterPageWrapper.java: Class file for WO Component 'PXOuterPageWrapper'
// Project Pachyderm2
//
// Created by king on 2/21/05
//
package org.pachyderm.woc;
import com.webobjects.appserver.WOContext;
public class PXOuterPageWrapper extends PXPageWrapper {
private static final long serialVersionUID = -8274366108762979613L;
public PXOuterPageWrapper(WOContext context) {
super(context);
}
public boolean isStateless() {
return true;
}
}
/*
Copyright 2005-2006 The New Media Consortium,
Copyright 2000-2006 San Francisco Museum of Modern Art
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.
*/ | [
"[email protected]"
]
| |
c3e182afe2c6bcd5a2048426e7315e5e4ffaa7bd | adc86426ac8f3ab8ae2afa6a3d82989717d713d8 | /Main.java | cd4b1fea70ee15f0a56f37a1a24c8b2ad4d71cf9 | []
| no_license | acesHigh2020/CasiCocinado2 | 78245e7c93753010698e6b8a221d2a322fffb533 | 7ff9468f7c099780fd223535de6f356f54ce2e1e | refs/heads/main | 2023-01-02T19:28:46.658457 | 2020-10-17T15:41:55 | 2020-10-17T15:41:55 | 304,731,673 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 421 | java | package juegoTP;
public class Main {
public static void main(String[] args) {
Jugador j1 = new Jugador("Maxi");
Partida pp = j1.crearPartida();
Jugador j2 = new Jugador("Renata");
j2.unirsePartida(pp);
// Jugador j3 = new Jugador("Nestor");
// j3.unirsePartida(pp);
//
// Jugador j4 = new Jugador("Lopez");
// j4.unirsePartida(pp);
j1.iniciarPartida(pp);
}
}
| [
"[email protected]"
]
| |
29c192ea2d377b9b6161b58011c5f5727e8e7500 | 05965fc81f35de533671a1f03e1e86b7e2b8898d | /app/src/main/java/com/moor/im/options/group/adapter/GroupAdminAndMemberAdapter.java | 078f052f3a7565f47a1939281f4c3396d2010a37 | []
| no_license | longwei243/im2.0 | f056ec82df399e64ae27fb212bce57e468f88cd7 | fb77a3004a38fbb99ab875153f3c4102965d9971 | refs/heads/master | 2020-04-15T13:38:28.346810 | 2016-10-08T09:05:07 | 2016-10-08T09:05:07 | 57,932,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,059 | java | package com.moor.im.options.group.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.moor.im.R;
import com.moor.im.common.constant.M7Constant;
import com.moor.im.common.model.GroupAdminAndMembers;
import com.moor.im.common.utils.GlideUtils;
import java.util.List;
/**
* Created by long on 2015/7/21.
*/
public class GroupAdminAndMemberAdapter extends BaseAdapter{
private Context context;
private List<GroupAdminAndMembers> groupAdminAndMembersList;
public GroupAdminAndMemberAdapter(Context context, List<GroupAdminAndMembers> groupAdminAndMembersList) {
this.context = context;
this.groupAdminAndMembersList = groupAdminAndMembersList;
}
@Override
public int getCount() {
return groupAdminAndMembersList.size();
}
@Override
public Object getItem(int position) {
return groupAdminAndMembersList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if(convertView == null) {
convertView = LayoutInflater.from(context).inflate(R.layout.group_setting_list_item, null);
holder = new ViewHolder();
holder.tv_name = (TextView) convertView.findViewById(R.id.group_setting_list_item_item_tv_name);
holder.group_setting_list_item_tv_catalog = (TextView) convertView.findViewById(R.id.group_setting_list_item_tv_catalog);
holder.group_setting_list_item_iv_icon_group = (ImageView) convertView.findViewById(R.id.group_setting_list_item_iv_icon_group);
convertView.setTag(holder);
}else {
holder = (ViewHolder) convertView.getTag();
}
String imicon = groupAdminAndMembersList.get(position).getImicon();
if(!"".equals(imicon)) {
GlideUtils.displayNet(holder.group_setting_list_item_iv_icon_group, imicon+ M7Constant.QINIU_IMG_ICON);
// Glide.with(context).load(imicon + "?imageView2/0/w/100/h/100").asBitmap().placeholder(R.drawable.head_default_local).into(holder.group_setting_list_item_iv_icon_group);
}else {
GlideUtils.displayNative(holder.group_setting_list_item_iv_icon_group, R.drawable.img_default_head);
// Glide.with(context).load(R.drawable.head_default_local).asBitmap().into(holder.group_setting_list_item_iv_icon_group);
}
holder.tv_name.setText(groupAdminAndMembersList.get(position).getName());
if(position == getDepartmentFirstPosition()) {
holder.group_setting_list_item_tv_catalog.setVisibility(View.VISIBLE);
holder.group_setting_list_item_tv_catalog.setText("管理员");
}else {
holder.group_setting_list_item_tv_catalog.setVisibility(View.GONE);
}
if(position == getMemberFirstPosition()) {
holder.group_setting_list_item_tv_catalog.setVisibility(View.VISIBLE);
holder.group_setting_list_item_tv_catalog.setText("成员");
}
return convertView;
}
private int getDepartmentFirstPosition() {
for (int i = 0; i < groupAdminAndMembersList.size(); i++) {
if(groupAdminAndMembersList.get(i).getType().equals("Admin")) {
return i;
}
}
return -1;
}
private int getMemberFirstPosition() {
for (int i = 0; i < groupAdminAndMembersList.size(); i++) {
if(groupAdminAndMembersList.get(i).getType().equals("Member")) {
return i;
}
}
return -1;
}
static class ViewHolder{
TextView tv_name;
TextView group_setting_list_item_tv_catalog;
ImageView group_setting_list_item_iv_icon_group;
}
}
| [
"[email protected]"
]
| |
e85f883bbce7064a4de9c925a08be088a8357a55 | b305b1cf8603e5f7f3b7a6b536f792f2ced9f528 | /MosaicLite.java | 23d197a2df3c3dc00591f0756fb8ccdacf71c35b | []
| no_license | boomsquad/MosaicLite | abd2afe9c1ba7b9849b28f6b7cb567bba6a632bc | 619e0d9a8b210cce84bba4f94be9c32c3cb59a04 | refs/heads/master | 2021-02-04T06:34:18.669945 | 2020-02-27T23:17:10 | 2020-02-27T23:17:10 | 243,633,732 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 437 | java | import javax.swing.JFrame;
class MosaicLiteFrame extends JFrame
{
public MosaicLiteFrame()
{
setBounds(200,200,1200,800);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
public class MosaicLite
{
public static void main(String[] args)
{
System.out.println("MosaicLite Starting...");
MosaicLiteFrame myFrame = new MosaicLiteFrame();
myFrame.setVisible(true);
}
} | [
"[email protected]"
]
| |
11e5a7ef21f3819ec0f4a997b2a854aee6e6800e | 963a0f42aaebbcc29879638db0f15e76d7c676fc | /wffweb/src/main/java/com/webfirmframework/wffweb/internal/tag/html/listener/AttributeAddListener.java | b97a23d61f3a94c2b3700a9bcfa797eb4ed3b94b | [
"Apache-2.0"
]
| permissive | webfirmframework/wff | 0ff8f7c4f53d4ff414ec914f5b1d5d5042aecb82 | 843018dac3ae842a60d758a6eb60333489c9cc73 | refs/heads/master | 2023-08-05T21:28:27.153138 | 2023-07-29T03:55:08 | 2023-07-29T03:55:08 | 46,187,719 | 16 | 5 | Apache-2.0 | 2023-07-29T03:55:09 | 2015-11-14T18:56:22 | Java | UTF-8 | Java | false | false | 1,179 | java | /*
* Copyright 2014-2023 Web Firm Framework
*
* 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.webfirmframework.wffweb.internal.tag.html.listener;
import java.io.Serializable;
import com.webfirmframework.wffweb.server.page.AttributeAddListenerImpl;
import com.webfirmframework.wffweb.tag.html.AbstractHtml;
import com.webfirmframework.wffweb.tag.html.attribute.core.AbstractAttribute;
public sealed interface AttributeAddListener extends Serializable permits AttributeAddListenerImpl {
public static final record AddEvent(AbstractHtml addedToTag, AbstractAttribute... addedAttributes) {
}
public void addedAttributes(AddEvent event);
}
| [
"[email protected]"
]
| |
b76a78012e401d6a20772bd4f0cc8097f1a91320 | 9a4e964c0218107209b961af105a69b6876e22b7 | /src/main/java/com/pp/server/service/impl/WeatherServiceImpl.java | 93053573e0403873e81cc75309cc2bf93504f28a | []
| no_license | brookhn/e-flink | a4dcbf5113d521164365a538c12e1e0e28dcce79 | d3b4c245a4fb75596afd83c392e682dac5bf0a9d | refs/heads/master | 2020-09-07T09:17:02.877005 | 2019-11-10T03:27:09 | 2019-11-10T03:27:09 | 220,735,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,555 | java | package com.pp.server.service.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.pp.server.common.Constats;
import com.pp.server.common.DateUtil;
import com.pp.server.entity.WeatherResponse;
import com.pp.server.service.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.util.Date;
import java.util.concurrent.TimeUnit;
@Service
public class WeatherServiceImpl implements WeatherService {
private final Long TIME_OUT = 1800L;
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private RestTemplate restTemplate;
private final String WEATHER_URL = "http://wthrcdn.etouch.cn/weather_mini";
@Override
public WeatherResponse getDataCityById(String cityId) {
String uri = WEATHER_URL+"?citykey="+ cityId;
String redisKey = Constats.REDIS_WEATHER_CITY_NAME_KEY+":"+cityId+ DateUtil.getFormatDateTime(new Date(),DateUtil.DATE_TIME_NUM);
return this.doGetWeatherData(uri, cityId);
}
@Override
public WeatherResponse getDataCityByName(String name) {
String url = WEATHER_URL + "?city="+name;
String redisKey = Constats.REDIS_WEATHER_CITY_NAME_KEY+":"+name+ DateUtil.getFormatDateTime(new Date(),DateUtil.DATE_NUM);
return this.doGetWeatherData(url, redisKey);
}
private WeatherResponse doGetWeatherData(String url, String redisKey)
{
//restTemplate请求
ValueOperations<String,String> ops = this.redisTemplate.opsForValue();
String strBody = null;
WeatherResponse weatherResponse = null;
if (!this.redisTemplate.hasKey(redisKey)) {
ResponseEntity<String> response = restTemplate.getForEntity(url, String.class);
if (response.getStatusCodeValue() == 200) {
strBody = response.getBody();
}
ops.set(redisKey, strBody, TIME_OUT,TimeUnit.SECONDS);
}else {
strBody = ops.get(redisKey);
}
ObjectMapper objectMapper = new ObjectMapper();
try {
weatherResponse = objectMapper.readValue(strBody, WeatherResponse.class);
} catch (IOException e) {
e.printStackTrace();
}
return weatherResponse;
}
}
| [
"[email protected]"
]
| |
3f66579516049f65f0c4654ce38f0339d28216e1 | dde91e170a3463e43453c1d8881e3762de1d6996 | /grinder-core/src/test/java/net/grinder/scriptengine/jython/instrumentation/AbstractJythonInstrumenterTestCase.java | a9ab74cee89c491776755677f2f6523b861bf72f | []
| no_license | jdpgrailsdev/grinder | 20e1e985337d0f5defca13376f77b9ccb0744297 | bed967021c5fbe8cfb29566c0d6e2a17df9e6434 | refs/heads/master | 2021-01-24T02:06:18.186236 | 2012-06-17T17:26:44 | 2012-06-17T17:26:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,205 | java | // Copyright (C) 2009 - 2011 Philip Aston
// All rights reserved.
//
// This file is part of The Grinder software distribution. Refer to
// the file LICENSE which is part of The Grinder distribution for
// licensing details. The Grinder distribution is available on the
// Internet at http://grinder.sourceforge.net/
//
// 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 HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
package net.grinder.scriptengine.jython.instrumentation;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
import java.lang.reflect.Field;
import net.grinder.common.StubTest;
import net.grinder.common.UncheckedGrinderException;
import net.grinder.common.UncheckedInterruptedException;
import net.grinder.script.NonInstrumentableTypeException;
import net.grinder.script.NotWrappableTypeException;
import net.grinder.script.Test.InstrumentationFilter;
import net.grinder.scriptengine.Instrumenter;
import net.grinder.scriptengine.Recorder;
import net.grinder.testutility.AssertUtilities;
import net.grinder.testutility.RandomStubFactory;
import org.junit.Test;
import org.python.core.PyClass;
import org.python.core.PyException;
import org.python.core.PyInstance;
import org.python.core.PyInteger;
import org.python.core.PyObject;
import org.python.core.PyProxy;
import org.python.core.PySystemState;
import org.python.core.PyTuple;
import org.python.util.PythonInterpreter;
/**
* Instrumentation unit tests.
*
* @author Philip Aston
* @version $Revision:$
*/
public abstract class AbstractJythonInstrumenterTestCase {
{
PySystemState.initialize();
}
protected final Instrumenter m_instrumenter;
protected final PythonInterpreter m_interpreter =
new PythonInterpreter(null, new PySystemState());
protected final PyObject m_zero = new PyInteger(0);
protected final PyObject m_one = new PyInteger(1);
protected final PyObject m_two = new PyInteger(2);
protected final PyObject m_three = new PyInteger(3);
protected final PyObject m_six = new PyInteger(6);
protected final net.grinder.common.Test m_test = new StubTest(1, "test");
protected final RandomStubFactory<Recorder> m_recorderStubFactory =
RandomStubFactory.create(Recorder.class);
protected final Recorder m_recorder = m_recorderStubFactory.getStub();
public AbstractJythonInstrumenterTestCase(Instrumenter instrumenter) {
super();
m_instrumenter = instrumenter;
}
protected abstract void assertTestReference(PyObject proxy,
net.grinder.common.Test test);
protected abstract void assertTargetReference(PyObject proxy,
Object original,
boolean unwrapTarget);
protected void assertTargetReference(PyObject proxy, Object original) {
assertTargetReference(proxy, original, false);
}
public static Integer[] getJythonVersion() throws Exception {
final PyTuple pyTuple =
(PyTuple) PySystemState.class.getField("version_info").get(null);
final Object[] tuple = pyTuple.toArray();
return new Integer[] { (Integer) tuple[0],
(Integer) tuple[1],
(Integer) tuple[2], };
}
public static void assertVersion(String expected) throws Exception {
AssertUtilities.assertContains(
PySystemState.class.getField("version").get(null).toString(),
expected);
}
protected final PythonInterpreter getInterpretter() {
return m_interpreter;
}
protected final void assertNotWrappable(Object o) throws Exception {
try {
m_instrumenter.createInstrumentedProxy(null, null, o);
fail("Expected NotWrappableTypeException");
}
catch (NotWrappableTypeException e) {
}
}
protected final void assertNotWrappableByThisInstrumenter(Object o)
throws Exception {
assertNull(m_instrumenter.createInstrumentedProxy(null, null, o));
}
protected final Object createInstrumentedProxy(net.grinder.common.Test test,
Recorder recorder,
PyObject pyTarget)
throws NotWrappableTypeException {
// In the real world, the Java conversion happens implicitly because
// wrap() and record() are implemented in Java.
final Object javaTarget = pyTarget.__tojava__(Object.class);
return m_instrumenter.createInstrumentedProxy(test, recorder, javaTarget);
}
protected final Class<?> getClassForInstance(PyInstance target)
throws IllegalArgumentException, IllegalAccessException {
Field f;
try {
// Jython 2.1
f = PyObject.class.getField("__class__");
}
catch (NoSuchFieldException e) {
// Jython 2.2a1+
try {
f = PyInstance.class.getField("instclass");
}
catch (NoSuchFieldException e2) {
throw new AssertionError("Incompatible Jython release in classpath");
}
}
final PyClass pyClass = (PyClass)f.get(target);
return (Class<?>) pyClass.__tojava__(Class.class);
}
@Test public void testCreateProxyWithPyFunction() throws Exception {
m_interpreter.exec("def return1(): return 1");
final PyObject pyFunction = m_interpreter.get("return1");
final PyObject pyFunctionProxy = (PyObject)
createInstrumentedProxy(m_test, m_recorder, pyFunction);
final PyObject result = pyFunctionProxy.invoke("__call__");
assertEquals(m_one, result);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
assertTestReference(pyFunctionProxy, m_test);
assertTargetReference(pyFunctionProxy, pyFunction);
m_interpreter.exec("def multiply(x, y): return x * y");
final PyObject pyFunction2 = m_interpreter.get("multiply");
final PyObject pyFunctionProxy2 = (PyObject)
createInstrumentedProxy(m_test, m_recorder, pyFunction2);
final PyObject result2 =
pyFunctionProxy2.invoke("__call__", m_two, m_three);
assertEquals(m_six, result2);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
assertTargetReference(pyFunctionProxy2, pyFunction2);
final PyObject result3 =
pyFunctionProxy2.invoke("__call__", new PyObject[] { m_two, m_three});
assertEquals(m_six, result3);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
m_interpreter.exec("def square(x): return x * x");
final PyObject pyFunction11 = m_interpreter.get("square");
final PyObject pyFunctionProxy11 = (PyObject)
createInstrumentedProxy(m_test, m_recorder, pyFunction11);
final PyObject result11 = pyFunctionProxy11.invoke("__call__", m_two);
assertEquals(new PyInteger(4), result11);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
assertTargetReference(pyFunctionProxy11, pyFunction11);
// From Jython.
m_interpreter.set("proxy", pyFunctionProxy);
m_interpreter.set("proxy2", pyFunctionProxy2);
m_interpreter.exec("result5 = proxy()");
final PyObject result5 = m_interpreter.get("result5");
assertEquals(m_one, result5);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
}
@Test public void testCreateProxyWithPyInstance() throws Exception {
// PyInstance.
m_interpreter.exec(
"class Foo:\n" +
" def two(self): return 2\n" +
" def identity(self, x): return x\n" +
" def sum(self, x, y): return x + y\n" +
" def sum3(self, x, y, z): return x + y + z\n" +
"x=Foo()");
final PyObject pyInstance = m_interpreter.get("x");
final PyObject pyInstanceProxy = (PyObject)
createInstrumentedProxy(m_test, m_recorder, pyInstance);
final PyObject result1 = pyInstanceProxy.invoke("two");
assertEquals(m_two, result1);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
assertTestReference(pyInstanceProxy, m_test);
assertNull(pyInstanceProxy.__findattr__("__blah__"));
assertTargetReference(pyInstanceProxy, pyInstance);
final PyObject result2 = pyInstanceProxy.invoke("identity", m_one);
assertSame(m_one, result2);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
final PyObject result3 = pyInstanceProxy.invoke("sum", m_one, m_two);
assertEquals(m_three, result3);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
final PyObject result4 = pyInstanceProxy.invoke("sum3", new PyObject[] {
m_one, m_two, m_three });
assertEquals(m_six, result4);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
final PyObject result5 = pyInstanceProxy.invoke("sum", new PyObject[] {
m_one, m_two }, new String[] { "x", "y" });
assertEquals(m_three, result5);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
// From Jython.
m_interpreter.set("proxy", pyInstanceProxy);
m_interpreter.exec("result6 = proxy.sum(2, 4)");
final PyObject result6 = m_interpreter.get("result6");
assertEquals(m_six, result6);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
}
@Test public void testCreateProxyWithUnboundPyMethod() throws Exception {
m_interpreter.exec(
"class Foo:\n" +
" def two(self): return 2\n" +
" def identity(self, x): return x\n" +
" def sum(self, x, y): return x + y\n" +
" def sum3(self, x, y, z): return x + y + z\n" +
"x=Foo()");
final PyObject pyInstance = m_interpreter.get("x");
m_interpreter.exec("y=Foo.two");
final PyObject pyMethod = m_interpreter.get("y");
final PyObject pyMethodProxy = (PyObject)
createInstrumentedProxy(m_test, m_recorder, pyMethod);
final PyObject result = pyMethodProxy.invoke("__call__", pyInstance);
assertEquals(m_two, result);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
assertTestReference(pyMethodProxy, m_test);
assertNull(pyMethodProxy.__findattr__("__blah__"));
assertTargetReference(pyMethodProxy, pyMethod);
m_interpreter.exec("y=Foo.identity");
final PyObject pyMethod2 = m_interpreter.get("y");
final PyObject pyMethodProxy2 = (PyObject)
createInstrumentedProxy(m_test, m_recorder, pyMethod2);
final PyObject result2 =
pyMethodProxy2.invoke("__call__", pyInstance, m_one);
assertEquals(m_one, result2);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
m_interpreter.exec("y=Foo.sum");
final PyObject pyMethod3 = m_interpreter.get("y");
final PyObject pyMethodProxy3 = (PyObject)
createInstrumentedProxy(m_test, m_recorder, pyMethod3);
final PyObject result3 =
pyMethodProxy3.invoke(
"__call__", new PyObject[] { pyInstance, m_one, m_two });
assertEquals(m_three, result3);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
// From Jython.
m_interpreter.set("proxy", pyMethodProxy);
m_interpreter.exec("result5 = proxy(x)");
final PyObject result5 = m_interpreter.get("result5");
assertEquals(m_two, result5);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
}
@Test public void testCreateProxyWithBoundPyMethod() throws Exception {
m_interpreter.exec(
"class Foo:\n" +
" def two(self): return 2\n" +
"x=Foo()\n" +
"y=Foo()\n");
m_interpreter.exec("z=x.two");
final PyObject pyMethod = m_interpreter.get("z");
final PyObject pyMethodProxy = (PyObject)
createInstrumentedProxy(m_test, m_recorder, pyMethod);
final PyObject result = pyMethodProxy.invoke("__call__");
assertEquals(m_two, result);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
// Other instance is not instrumented.
m_interpreter.exec("z=y.two");
final PyObject pyMethod2 = m_interpreter.get("z");
final PyObject result2 = pyMethod2.invoke("__call__");
assertEquals(m_two, result2);
m_recorderStubFactory.assertNoMoreCalls();
}
@Test public void testCreateProxyWithPyReflectedFunction() throws Exception {
m_interpreter.exec("from test import MyClass\nx=MyClass(6, 5, 4)");
final PyObject pyJava = m_interpreter.get("x");
m_interpreter.exec("y=MyClass.getA");
final PyObject pyJavaMethod = m_interpreter.get("y");
final PyObject pyJavaMethodProxy = (PyObject)
createInstrumentedProxy(m_test, m_recorder, pyJavaMethod);
final PyObject result = pyJavaMethodProxy.__call__(pyJava);
assertEquals(m_six, result);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
assertTestReference(pyJavaMethodProxy, m_test);
assertNull(pyJavaMethodProxy.__findattr__("__blah__"));
assertTargetReference(pyJavaMethodProxy, pyJavaMethod);
// From Jython.
m_interpreter.set("proxy", pyJavaMethodProxy);
m_interpreter.exec("result2 = proxy(x)");
final PyObject result2 = m_interpreter.get("result2");
assertEquals(m_six, result2);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
}
private PyObject getPyInstance(PyProxy pyProxy) throws Exception {
// Dynamic invocation because return type has changed in 2.5.
return (PyObject) PyProxy.class.getMethod("_getPyInstance").invoke(pyProxy);
}
@Test public void testCreateProxyWithPyProxy() throws Exception {
m_interpreter.exec("from java.util import Random");
m_interpreter.exec(
"class PyRandom(Random):\n" +
" def one(self): return 1\n" +
"x=PyRandom()");
final PyObject pyInstance = m_interpreter.get("x");
// PyProxy's come paired with PyInstances - need to call
// __tojava__ to get the PyProxy.
final PyProxy pyProxy = (PyProxy) pyInstance.__tojava__(PyProxy.class);
final Object pyProxyProxy =
m_instrumenter.createInstrumentedProxy(m_test,
m_recorder,
pyProxy);
final PyObject pyProxyInstance =
(pyProxyProxy instanceof PyProxy) ?
getPyInstance((PyProxy) pyProxyProxy) : (PyObject)pyProxyProxy;
final PyObject result = pyProxyInstance.invoke("one");
assertEquals(m_one, result);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
assertTestReference(pyProxyInstance, m_test);
assertTargetReference(pyProxyInstance, pyInstance);
// From Jython.
m_interpreter.set("proxy", pyProxyProxy);
m_interpreter.exec("result2 = proxy.one()");
final PyObject result2 = m_interpreter.get("result2");
assertEquals(m_one, result2);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
m_interpreter.exec("result3 = proxy.nextInt()");
final PyObject result3 = m_interpreter.get("result3");
assertNotNull(result3);
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
}
@Test public void testCreateProxyWithRecursiveCode() throws Exception {
m_interpreter.exec(
"class Recurse:\n" +
" def __init__(self):\n" +
" self.i = 3\n" +
" def foo(self):\n" +
" self.i = self.i - 1\n" +
" if self.i == 0: return 0\n" +
" return self.i + self.foo()\n" +
"r = Recurse()");
final PyObject proxy = (PyObject)
createInstrumentedProxy(m_test, m_recorder, m_interpreter.get("r"));
final PyObject result = proxy.invoke("foo");
assertEquals(new PyInteger(3), result);
// The dispatcher will be called multiple times. The real dispatcher
// only records the outer invocation.
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertSuccess("end", true);
m_recorderStubFactory.assertNoMoreCalls();
}
@Test public void testPyDispatcherErrorHandling() throws Exception {
m_interpreter.exec("def blah(): raise Exception('a problem')");
final PyObject pyFunction = m_interpreter.get("blah");
final PyObject pyFunctionProxy = (PyObject)
createInstrumentedProxy(m_test, m_recorder, pyFunction);
try {
pyFunctionProxy.invoke("__call__");
fail("Expected PyException");
}
catch (PyException e) {
AssertUtilities.assertContains(e.toString(), "a problem");
}
m_recorderStubFactory.assertSuccess("start");
m_recorderStubFactory.assertSuccess("end", false);
m_recorderStubFactory.assertNoMoreCalls();
final UncheckedGrinderException e = new UncheckedInterruptedException(null);
m_recorderStubFactory.setThrows("start", e);
try {
pyFunctionProxy.invoke("__call__");
fail("Expected UncheckedGrinderException");
}
catch (UncheckedGrinderException e2) {
assertSame(e, e2);
}
catch (PyException e3) {
assertSame(e, e3.value.__tojava__(Exception.class));
}
}
@Test public void testSelectiveInstrumentUnsupported() throws Exception {
m_interpreter.exec(
"class Foo:\n" +
" def two(self): return 2\n" +
" def identity(self, x): return x\n" +
" def sum(self, x, y): return x + y\n" +
" def sum3(self, x, y, z): return x + y + z\n" +
"x=Foo()");
final PyObject pyInstance = m_interpreter.get("x");
final InstrumentationFilter filter = new InstrumentationFilter() {
public boolean matches(Object item) {
return true;
}
};
try {
m_instrumenter.instrument(m_test, m_recorder, pyInstance, filter);
fail("Expected NonInstrumentableTypeException");
}
catch (NonInstrumentableTypeException e) {
}
}
}
| [
"[email protected]"
]
| |
652147fbe5c68e91a44a4872bc273742832e8d21 | a9c692206a74809b3e8b63b76f3934c8ddc70b30 | /app/src/main/java/com/cabinet/rs485/rs485/common/RS485DeviceAddress.java | af0c9123a620d6b905fd42546809ba041275de26 | []
| no_license | TF27674569/Rs485 | cfc1722d1bc8fd1f73db4c16eac56dfadd3bb336 | 1f38b00f4916cb431973a6eedb50b72f241a9486 | refs/heads/master | 2020-03-23T11:28:27.507327 | 2018-07-19T01:01:04 | 2018-07-19T01:01:04 | 141,505,852 | 7 | 1 | null | null | null | null | UTF-8 | Java | false | false | 493 | java | package com.cabinet.rs485.rs485.common;
/**
* JIEGUI license
* Created by zuguo.yu on 2018/7/14.
*/
public enum RS485DeviceAddress {
NONE(0xFF, "NONE");
private final byte address;
private final String desc;
RS485DeviceAddress(int address, String desc) {
this.address = (byte) address;
this.desc = desc;
}
public byte getAddress() {
return address;
}
@Override
public String toString() {
return desc + "[ " + String.format("0x%02x", address);
}
}
| [
"[email protected]"
]
| |
bd31d433ad16988686cad618afe6896c52a2962f | 9124396cc26e7d162b28d5de493199bf2c13860c | /spring-quartz/src/main/java/com/laiyy/springquartz/conf/TaskExecutorConfig.java | 4f34a8eaeb27f1b10becb7161e6d6e6d5e44c275 | []
| no_license | laiyy0728/study | 2f20a735a823494b08ad8c95d6d869b9c3507e67 | 752a5aaea6a68666f76e41f69925923397e8388f | refs/heads/master | 2021-07-11T21:38:06.892227 | 2018-12-17T03:30:23 | 2018-12-17T03:30:23 | 95,877,325 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 703 | java | package com.laiyy.springquartz.conf;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
/**
* @author laiyy
* @date 2018/6/7 19:46
* @description Spring task 线程池
*/
@Configuration
public class TaskExecutorConfig {
@Bean
public TaskExecutor taskExecutor() {
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.setCorePoolSize(5);
taskExecutor.setMaxPoolSize(10);
taskExecutor.setQueueCapacity(25);
return taskExecutor;
}
}
| [
"[email protected]"
]
| |
4d3d595ffa9cc3e9b4a4ba806fac63f9ec0ce656 | 323ee90f708f1affa07fe52af82e075a1d38204e | /src/main/java/org/jukbar/dao/CountryDao.java | 1416519f0b957bf2de3d66664f8549ef651dcf9f | []
| no_license | beksay/jukbar | c2bd08ae3bdad87178143c9afd4c47902e0eddc0 | 6d1cb6547f6697bba4543404fb6372ef16e98af5 | refs/heads/master | 2023-04-08T11:51:23.903555 | 2021-04-24T12:28:31 | 2021-04-24T12:28:31 | 296,508,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 177 | java | package org.jukbar.dao;
import org.jukbar.domain.Country;
/**
*
* @author Kuttubek Aidaraliev
*
*/
public interface CountryDao extends GenericDao<Country, Integer> {
}
| [
"bektur@bektur-A320M-H"
]
| bektur@bektur-A320M-H |
6fd8aeb203a91db785a50bb2ae7b855d1f36d2ba | f91bc9b6d4b3fad7e0698522fde31c226400f0f3 | /src/main/java/com/runcible/abbot/service/UserServiceImpl.java | bca2e8e88fb746abf5c2a2a4e7165b226d47383c | []
| no_license | tom-biskupic/Abbot | 57b88e9798d59b02d1cc9f3edfb983be0717c1de | d99b0164ead5939825a52fd121babbd233cf57da | refs/heads/master | 2021-06-04T06:54:25.164370 | 2021-04-03T00:45:04 | 2021-04-03T00:45:04 | 67,769,466 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,449 | java | package com.runcible.abbot.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.runcible.abbot.model.User;
import com.runcible.abbot.repository.UserRepository;
import com.runcible.abbot.service.exceptions.DuplicateUserException;
import com.runcible.abbot.service.exceptions.NoSuchUser;
@Component
@Transactional
public class UserServiceImpl implements UserService
{
@Override
public User validateLogon(String email, String password)
{
User user = userRepo.findByEmailAndPassword(email.trim(), password.trim());
return user;
}
@Override
@Transactional(readOnly=false)
public void addUser(User user) throws DuplicateUserException
{
if (userRepo.findByEmail(user.getEmail()) != null )
{
throw new DuplicateUserException();
}
//
// if this is the first user created, make them an administrator
//
if ( userRepo.count() == 0 )
{
user.setAdministrator(true);
}
userRepo.save(user);
}
@Override
public void updateUser(User user) throws DuplicateUserException
{
User sameEmailUser = userRepo.findByEmail(user.getEmail());
//
// If this email address is the same as that of a different user
// then we throw
//
if ( sameEmailUser != null && sameEmailUser.getId() != user.getId())
{
throw new DuplicateUserException();
}
userRepo.save(user);
}
@Override
public Page<User> findAll(Pageable page)
{
return userRepo.findAll(page);
}
@Override
public User findByID(Integer id) throws NoSuchUser
{
User user = userRepo.findOne(id);
if (user == null)
{
throw new NoSuchUser();
}
return user;
}
@Override
public User findByEmail(String name) throws NoSuchUser
{
User user = userRepo.findByEmail(name);
if ( user == null )
{
throw new NoSuchUser();
}
return user;
}
@Autowired
UserRepository userRepo;
}
| [
"[email protected]"
]
| |
aa672a751e1f646782de08146dbf113b52abee18 | 7a7aa2eb6ad7e8e2a09587f59911a54efefefefa | /src/main/java/com/felipeforbeck/vacuum/infrastructure/persistence/RequestEventRepositoryNeo4j.java | 7524a70e5f1eee1b19058edd713d5811d7aa21c1 | []
| no_license | umeshdangat/vacuum | 03d3ff7570b47e43848e53d1ee68794a9761a6eb | ce584fd67319ab785b0edf6ce90da096be48a670 | refs/heads/master | 2021-06-08T17:03:20.710006 | 2016-06-05T03:06:17 | 2016-06-05T03:06:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,956 | java | package com.felipeforbeck.vacuum.infrastructure.persistence;
import com.felipeforbeck.vacuum.domain.model.RequestEventRepository;
import com.felipeforbeck.vacuum.domain.shared.RequestEventMetaData;
import com.felipeforbeck.vacuum.infrastructure.Neo4JConnector;
import org.neo4j.driver.v1.Driver;
import org.neo4j.driver.v1.Session;
import org.neo4j.driver.v1.Transaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.HashMap;
/**
* Created by fforbeck on 21/05/16.
*/
@Repository
public class RequestEventRepositoryNeo4j implements RequestEventRepository {
@Autowired
private Neo4JConnector connector;
@Override
public String saveRequest(RequestEventMetaData event) {
final String uuid = nextId();
HashMap<String, Object> params = new HashMap<>();
params.put("origin", event.getOrigin_host());
params.put("target", event.getTarget_host());
params.put("path", event.getTarget_path());
Driver driver = connector.getDriver();
try (Session session = driver.session();
Transaction tx = session.beginTransaction()) {
StringBuilder statement = new StringBuilder();
String method = event.getMethod().toUpperCase();
statement
.append("MATCH (s1:Service {host: {origin}}), (s2:Service {host: {target}})")
.append(" CREATE UNIQUE (s1)-[r1:").append(method).append(" {path: {path}}]->(s2)")
.append(" CREATE UNIQUE (s1)-[r2:CALL]->(s2)")
.append(" SET r1.count = coalesce(r1.count, 0) + 1")
.append(" SET r2.count = coalesce(r2.count, 0) + 1");
tx.run(statement.toString(), params);
tx.success();
}
return uuid;
}
private String nextId() {
return java.util.UUID.randomUUID().toString();
}
}
| [
"[email protected]"
]
| |
4735402ff553c50d4c71ed3fd9d9c35af32118a6 | 62faa058c143b305d9eaffbec8d4da7b38e095c0 | /src/java/fr/paris/lutece/portal/business/globalmanagement/IRichTextEditorDAO.java | 9181c597fcab4e53dfd825a23ad90b7fbd3eabf9 | []
| permissive | dominiquesalasvega/lutece-core | c3d4c37d3513e6773c2e248288b576577e01aa60 | ca28d51f03a2ca65508e4d8411b6da655e31b643 | refs/heads/master | 2020-06-17T16:17:49.268072 | 2020-05-15T00:09:32 | 2020-05-15T00:09:32 | 195,974,016 | 1 | 0 | BSD-3-Clause | 2019-07-09T09:11:32 | 2019-07-09T09:11:32 | null | UTF-8 | Java | false | false | 2,230 | java | /*
* Copyright (c) 2002-2017, Mairie de Paris
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright notice
* and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice
* and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of 'Mairie de Paris' nor 'Lutece' 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 HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* License 1.0
*/
package fr.paris.lutece.portal.business.globalmanagement;
import java.util.Collection;
/**
* Interface of RichTextEditorDAO
*/
public interface IRichTextEditorDAO
{
String BEAN_NAME = "richTextEditorDAO";
/**
* Get the collection of RichTextEditor for back or front office
*
* @param bBackOffice
* True if the list should contain back office editors, false if it should contain front office editors.
* @return The collection of RichTextEditor for back or front office
*/
Collection<RichTextEditor> findEditors( Boolean bBackOffice );
}
| [
"[email protected]"
]
| |
5c6b3df6ee7abfe8de0947e6e297a1e452f5ca76 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_068af629bad56cbb85da6ee794d4c7f8edd66b8a/TwigUserDao/2_068af629bad56cbb85da6ee794d4c7f8edd66b8a_TwigUserDao_s.java | c685c13d359db6a1937cec80ef80bb5aa7eb0a29 | []
| no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,178 | java | package net.sparkmuse.data.twig;
import net.sparkmuse.data.UserDao;
import net.sparkmuse.user.Votable;
import net.sparkmuse.user.Votables;
import net.sparkmuse.user.UserLogin;
import net.sparkmuse.data.entity.*;
import com.google.inject.Inject;
import static com.google.appengine.api.datastore.Query.FilterOperator.*;
import com.google.common.collect.Sets;
import com.google.common.collect.Iterables;
import com.google.common.base.Predicate;
import java.util.Set;
import java.util.Map;
import org.apache.commons.collections.CollectionUtils;
/**
* Created by IntelliJ IDEA.
*
* @author neteller
* @created: Sep 19, 2010
*/
public class TwigUserDao extends TwigDao implements UserDao {
@Inject
public TwigUserDao(DatastoreService service) {
super(service);
}
public UserVO findOrCreateUserBy(UserLogin login) {
final UserVO userVO = helper.only(datastore.find()
.type(UserVO.class)
.addFilter("authProviderUserId", EQUAL, login.getAuthProviderUserId()));
if (null == userVO) {
UserVO newUser = UserVO.newUser(login);
final UserVO storedNewUser = helper.store(newUser);
final UserProfile profile = UserProfile.newProfile(storedNewUser);
helper.store(profile);
return storedNewUser;
}
else {
userVO.updateUserDuring(login);
return helper.store(userVO);
}
}
public UserVO findUserBy(Long id) {
return helper.getUser(id);
}
public UserProfile findUserProfileBy(String userName) {
final UserVO user = helper.only(datastore.find()
.type(UserVO.class)
.addFilter("userNameLowercase", EQUAL, userName.toLowerCase()));
return helper.only(datastore.find()
.type(UserProfile.class)
.ancestor(user)
);
}
public Map<Long, UserVO> findUsersBy(Set<Long> ids) {
return helper.getUsers(ids);
}
public UserVO update(UserVO user) {
return helper.update(user);
}
public void saveApplication(String userName, String url) {
UserApplication app = new UserApplication();
app.userName = userName;
app.url = url;
datastore.store(app);
}
/**
* Stores a record of the vote for the given user, upvotes the votable, stores
* it to the datastore, and adjusts the author's reputation.
*
* @param votable
* @param voter
*/
public void vote(Votable votable, UserVO voter) {
helper.associate(voter);
final UserVote voteModel = datastore.load()
.type(UserVote.class)
.id(Votables.newKey(votable))
.parent(voter)
.now();
//check for existing vote
if (null == voteModel) {
//store vote later so we can check if user has voted on whatever
datastore.store().instance(UserVote.newUpVote(votable, voter)).parent(voter).later();
//record aggregate vote count on entity
if (votable instanceof Entity) {
votable.upVote();
helper.update((Entity) votable);
}
//adjust reputation
final UserVO author = votable.getAuthor();
author.setReputation(author.getReputation() + 1);
helper.update(author);
}
}
public <T extends Entity<T>> void vote(Class<T> entityClass, Long id, UserVO voter) {
T entity = helper.load(entityClass, id);
if (entity instanceof Votable) {
vote((Votable) entity, voter);
}
}
public Set<UserVote> findVotesFor(Set<Votable> votables, UserVO user) {
if (CollectionUtils.size(votables) == 0) return Sets.newHashSet();
Set<String> ids = Sets.newHashSet();
for (Votable votable: votables) {
ids.add(Votables.newKey(votable));
}
helper.associate(user);
final Map<String, UserVote> voteMap = datastore.load()
.type(UserVote.class)
.ids(ids)
.parent(user)
.now();
//filter out nulls
final Iterable<UserVote> votes = Iterables.filter(voteMap.values(), new Predicate<UserVote>(){
public boolean apply(UserVote voteModel) {
return null != voteModel;
}
});
return Sets.newHashSet(votes);
}
}
| [
"[email protected]"
]
| |
f014e20d5f4189370ac90f75397177941a05ff84 | a145697645c0483467d99599b943c37c99d87f44 | /MulipleImageSelector/build/generated/source/r/debug/android/support/v7/appcompat/R.java | 941dd50da63e4382d71e748ec56953cfbd835cde | []
| no_license | Arvind272/ELJEBO-Android | 963b3d64ab8571192cd69060d3912ad193c5c95a | d9eadafa6ba2f00a6a23d83f258522d00cec33b4 | refs/heads/master | 2021-09-17T22:58:16.104926 | 2018-07-06T09:25:51 | 2018-07-06T09:25:51 | 138,709,097 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 103,956 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.v7.appcompat;
public final class R {
public static final class anim {
public static int abc_fade_in = 0x7f010001;
public static int abc_fade_out = 0x7f010002;
public static int abc_grow_fade_in_from_bottom = 0x7f010003;
public static int abc_popup_enter = 0x7f010004;
public static int abc_popup_exit = 0x7f010005;
public static int abc_shrink_fade_out_from_bottom = 0x7f010006;
public static int abc_slide_in_bottom = 0x7f010007;
public static int abc_slide_in_top = 0x7f010008;
public static int abc_slide_out_bottom = 0x7f010009;
public static int abc_slide_out_top = 0x7f01000a;
public static int tooltip_enter = 0x7f01000b;
public static int tooltip_exit = 0x7f01000c;
}
public static final class attr {
public static int actionBarDivider = 0x7f040001;
public static int actionBarItemBackground = 0x7f040002;
public static int actionBarPopupTheme = 0x7f040003;
public static int actionBarSize = 0x7f040004;
public static int actionBarSplitStyle = 0x7f040005;
public static int actionBarStyle = 0x7f040006;
public static int actionBarTabBarStyle = 0x7f040007;
public static int actionBarTabStyle = 0x7f040008;
public static int actionBarTabTextStyle = 0x7f040009;
public static int actionBarTheme = 0x7f04000a;
public static int actionBarWidgetTheme = 0x7f04000b;
public static int actionButtonStyle = 0x7f04000c;
public static int actionDropDownStyle = 0x7f04000d;
public static int actionLayout = 0x7f04000e;
public static int actionMenuTextAppearance = 0x7f04000f;
public static int actionMenuTextColor = 0x7f040010;
public static int actionModeBackground = 0x7f040011;
public static int actionModeCloseButtonStyle = 0x7f040012;
public static int actionModeCloseDrawable = 0x7f040013;
public static int actionModeCopyDrawable = 0x7f040014;
public static int actionModeCutDrawable = 0x7f040015;
public static int actionModeFindDrawable = 0x7f040016;
public static int actionModePasteDrawable = 0x7f040017;
public static int actionModePopupWindowStyle = 0x7f040018;
public static int actionModeSelectAllDrawable = 0x7f040019;
public static int actionModeShareDrawable = 0x7f04001a;
public static int actionModeSplitBackground = 0x7f04001b;
public static int actionModeStyle = 0x7f04001c;
public static int actionModeWebSearchDrawable = 0x7f04001d;
public static int actionOverflowButtonStyle = 0x7f04001e;
public static int actionOverflowMenuStyle = 0x7f04001f;
public static int actionProviderClass = 0x7f040020;
public static int actionViewClass = 0x7f040021;
public static int activityChooserViewStyle = 0x7f040022;
public static int alertDialogButtonGroupStyle = 0x7f040023;
public static int alertDialogCenterButtons = 0x7f040024;
public static int alertDialogStyle = 0x7f040025;
public static int alertDialogTheme = 0x7f040026;
public static int allowStacking = 0x7f040027;
public static int alpha = 0x7f040028;
public static int alphabeticModifiers = 0x7f040029;
public static int arrowHeadLength = 0x7f04002a;
public static int arrowShaftLength = 0x7f04002b;
public static int autoCompleteTextViewStyle = 0x7f04002c;
public static int autoSizeMaxTextSize = 0x7f04002d;
public static int autoSizeMinTextSize = 0x7f04002e;
public static int autoSizePresetSizes = 0x7f04002f;
public static int autoSizeStepGranularity = 0x7f040030;
public static int autoSizeTextType = 0x7f040031;
public static int background = 0x7f040032;
public static int backgroundSplit = 0x7f040033;
public static int backgroundStacked = 0x7f040034;
public static int backgroundTint = 0x7f040035;
public static int backgroundTintMode = 0x7f040036;
public static int barLength = 0x7f040037;
public static int borderlessButtonStyle = 0x7f040038;
public static int buttonBarButtonStyle = 0x7f040039;
public static int buttonBarNegativeButtonStyle = 0x7f04003a;
public static int buttonBarNeutralButtonStyle = 0x7f04003b;
public static int buttonBarPositiveButtonStyle = 0x7f04003c;
public static int buttonBarStyle = 0x7f04003d;
public static int buttonGravity = 0x7f04003e;
public static int buttonPanelSideLayout = 0x7f04003f;
public static int buttonStyle = 0x7f040040;
public static int buttonStyleSmall = 0x7f040041;
public static int buttonTint = 0x7f040042;
public static int buttonTintMode = 0x7f040043;
public static int checkboxStyle = 0x7f040044;
public static int checkedTextViewStyle = 0x7f040045;
public static int closeIcon = 0x7f040046;
public static int closeItemLayout = 0x7f040047;
public static int collapseContentDescription = 0x7f040048;
public static int collapseIcon = 0x7f040049;
public static int color = 0x7f04004a;
public static int colorAccent = 0x7f04004b;
public static int colorBackgroundFloating = 0x7f04004c;
public static int colorButtonNormal = 0x7f04004d;
public static int colorControlActivated = 0x7f04004e;
public static int colorControlHighlight = 0x7f04004f;
public static int colorControlNormal = 0x7f040050;
public static int colorError = 0x7f040051;
public static int colorPrimary = 0x7f040052;
public static int colorPrimaryDark = 0x7f040053;
public static int colorSwitchThumbNormal = 0x7f040054;
public static int commitIcon = 0x7f040055;
public static int contentDescription = 0x7f040056;
public static int contentInsetEnd = 0x7f040057;
public static int contentInsetEndWithActions = 0x7f040058;
public static int contentInsetLeft = 0x7f040059;
public static int contentInsetRight = 0x7f04005a;
public static int contentInsetStart = 0x7f04005b;
public static int contentInsetStartWithNavigation = 0x7f04005c;
public static int controlBackground = 0x7f04005d;
public static int customNavigationLayout = 0x7f04005e;
public static int defaultQueryHint = 0x7f04005f;
public static int dialogPreferredPadding = 0x7f040060;
public static int dialogTheme = 0x7f040061;
public static int displayOptions = 0x7f040062;
public static int divider = 0x7f040063;
public static int dividerHorizontal = 0x7f040064;
public static int dividerPadding = 0x7f040065;
public static int dividerVertical = 0x7f040066;
public static int drawableSize = 0x7f040067;
public static int drawerArrowStyle = 0x7f040068;
public static int dropDownListViewStyle = 0x7f040069;
public static int dropdownListPreferredItemHeight = 0x7f04006a;
public static int editTextBackground = 0x7f04006b;
public static int editTextColor = 0x7f04006c;
public static int editTextStyle = 0x7f04006d;
public static int elevation = 0x7f04006e;
public static int expandActivityOverflowButtonDrawable = 0x7f04006f;
public static int font = 0x7f040070;
public static int fontFamily = 0x7f040071;
public static int fontProviderAuthority = 0x7f040072;
public static int fontProviderCerts = 0x7f040073;
public static int fontProviderFetchStrategy = 0x7f040074;
public static int fontProviderFetchTimeout = 0x7f040075;
public static int fontProviderPackage = 0x7f040076;
public static int fontProviderQuery = 0x7f040077;
public static int fontStyle = 0x7f040078;
public static int fontWeight = 0x7f040079;
public static int gapBetweenBars = 0x7f04007a;
public static int goIcon = 0x7f04007b;
public static int height = 0x7f04007c;
public static int hideOnContentScroll = 0x7f04007d;
public static int homeAsUpIndicator = 0x7f04007e;
public static int homeLayout = 0x7f04007f;
public static int icon = 0x7f040080;
public static int iconTint = 0x7f040081;
public static int iconTintMode = 0x7f040082;
public static int iconifiedByDefault = 0x7f040083;
public static int imageButtonStyle = 0x7f040084;
public static int indeterminateProgressStyle = 0x7f040085;
public static int initialActivityCount = 0x7f040086;
public static int isLightTheme = 0x7f040087;
public static int itemPadding = 0x7f040088;
public static int layout = 0x7f040089;
public static int listChoiceBackgroundIndicator = 0x7f04008a;
public static int listDividerAlertDialog = 0x7f04008b;
public static int listItemLayout = 0x7f04008c;
public static int listLayout = 0x7f04008d;
public static int listMenuViewStyle = 0x7f04008e;
public static int listPopupWindowStyle = 0x7f04008f;
public static int listPreferredItemHeight = 0x7f040090;
public static int listPreferredItemHeightLarge = 0x7f040091;
public static int listPreferredItemHeightSmall = 0x7f040092;
public static int listPreferredItemPaddingLeft = 0x7f040093;
public static int listPreferredItemPaddingRight = 0x7f040094;
public static int logo = 0x7f040095;
public static int logoDescription = 0x7f040096;
public static int maxButtonHeight = 0x7f040097;
public static int measureWithLargestChild = 0x7f040098;
public static int multiChoiceItemLayout = 0x7f040099;
public static int navigationContentDescription = 0x7f04009a;
public static int navigationIcon = 0x7f04009b;
public static int navigationMode = 0x7f04009c;
public static int numericModifiers = 0x7f04009d;
public static int overlapAnchor = 0x7f04009e;
public static int paddingBottomNoButtons = 0x7f04009f;
public static int paddingEnd = 0x7f0400a0;
public static int paddingStart = 0x7f0400a1;
public static int paddingTopNoTitle = 0x7f0400a2;
public static int panelBackground = 0x7f0400a3;
public static int panelMenuListTheme = 0x7f0400a4;
public static int panelMenuListWidth = 0x7f0400a5;
public static int popupMenuStyle = 0x7f0400a6;
public static int popupTheme = 0x7f0400a7;
public static int popupWindowStyle = 0x7f0400a8;
public static int preserveIconSpacing = 0x7f0400a9;
public static int progressBarPadding = 0x7f0400aa;
public static int progressBarStyle = 0x7f0400ab;
public static int queryBackground = 0x7f0400ac;
public static int queryHint = 0x7f0400ad;
public static int radioButtonStyle = 0x7f0400ae;
public static int ratingBarStyle = 0x7f0400af;
public static int ratingBarStyleIndicator = 0x7f0400b0;
public static int ratingBarStyleSmall = 0x7f0400b1;
public static int searchHintIcon = 0x7f0400b2;
public static int searchIcon = 0x7f0400b3;
public static int searchViewStyle = 0x7f0400b4;
public static int seekBarStyle = 0x7f0400b5;
public static int selectableItemBackground = 0x7f0400b6;
public static int selectableItemBackgroundBorderless = 0x7f0400b7;
public static int showAsAction = 0x7f0400b8;
public static int showDividers = 0x7f0400b9;
public static int showText = 0x7f0400ba;
public static int showTitle = 0x7f0400bb;
public static int singleChoiceItemLayout = 0x7f0400bc;
public static int spinBars = 0x7f0400bd;
public static int spinnerDropDownItemStyle = 0x7f0400be;
public static int spinnerStyle = 0x7f0400bf;
public static int splitTrack = 0x7f0400c0;
public static int srcCompat = 0x7f0400c1;
public static int state_above_anchor = 0x7f0400c2;
public static int subMenuArrow = 0x7f0400c3;
public static int submitBackground = 0x7f0400c4;
public static int subtitle = 0x7f0400c5;
public static int subtitleTextAppearance = 0x7f0400c6;
public static int subtitleTextColor = 0x7f0400c7;
public static int subtitleTextStyle = 0x7f0400c8;
public static int suggestionRowLayout = 0x7f0400c9;
public static int switchMinWidth = 0x7f0400ca;
public static int switchPadding = 0x7f0400cb;
public static int switchStyle = 0x7f0400cc;
public static int switchTextAppearance = 0x7f0400cd;
public static int textAllCaps = 0x7f0400ce;
public static int textAppearanceLargePopupMenu = 0x7f0400cf;
public static int textAppearanceListItem = 0x7f0400d0;
public static int textAppearanceListItemSecondary = 0x7f0400d1;
public static int textAppearanceListItemSmall = 0x7f0400d2;
public static int textAppearancePopupMenuHeader = 0x7f0400d3;
public static int textAppearanceSearchResultSubtitle = 0x7f0400d4;
public static int textAppearanceSearchResultTitle = 0x7f0400d5;
public static int textAppearanceSmallPopupMenu = 0x7f0400d6;
public static int textColorAlertDialogListItem = 0x7f0400d7;
public static int textColorSearchUrl = 0x7f0400d8;
public static int theme = 0x7f0400d9;
public static int thickness = 0x7f0400da;
public static int thumbTextPadding = 0x7f0400db;
public static int thumbTint = 0x7f0400dc;
public static int thumbTintMode = 0x7f0400dd;
public static int tickMark = 0x7f0400de;
public static int tickMarkTint = 0x7f0400df;
public static int tickMarkTintMode = 0x7f0400e0;
public static int tint = 0x7f0400e1;
public static int tintMode = 0x7f0400e2;
public static int title = 0x7f0400e3;
public static int titleMargin = 0x7f0400e4;
public static int titleMarginBottom = 0x7f0400e5;
public static int titleMarginEnd = 0x7f0400e6;
public static int titleMarginStart = 0x7f0400e7;
public static int titleMarginTop = 0x7f0400e8;
public static int titleMargins = 0x7f0400e9;
public static int titleTextAppearance = 0x7f0400ea;
public static int titleTextColor = 0x7f0400eb;
public static int titleTextStyle = 0x7f0400ec;
public static int toolbarNavigationButtonStyle = 0x7f0400ed;
public static int toolbarStyle = 0x7f0400ee;
public static int tooltipForegroundColor = 0x7f0400ef;
public static int tooltipFrameBackground = 0x7f0400f0;
public static int tooltipText = 0x7f0400f1;
public static int track = 0x7f0400f2;
public static int trackTint = 0x7f0400f3;
public static int trackTintMode = 0x7f0400f4;
public static int voiceIcon = 0x7f0400f5;
public static int windowActionBar = 0x7f0400f6;
public static int windowActionBarOverlay = 0x7f0400f7;
public static int windowActionModeOverlay = 0x7f0400f8;
public static int windowFixedHeightMajor = 0x7f0400f9;
public static int windowFixedHeightMinor = 0x7f0400fa;
public static int windowFixedWidthMajor = 0x7f0400fb;
public static int windowFixedWidthMinor = 0x7f0400fc;
public static int windowMinWidthMajor = 0x7f0400fd;
public static int windowMinWidthMinor = 0x7f0400fe;
public static int windowNoTitle = 0x7f0400ff;
}
public static final class bool {
public static int abc_action_bar_embed_tabs = 0x7f050001;
public static int abc_allow_stacked_button_bar = 0x7f050002;
public static int abc_config_actionMenuItemAllCaps = 0x7f050003;
public static int abc_config_closeDialogWhenTouchOutside = 0x7f050004;
public static int abc_config_showMenuShortcutsWhenKeyboardPresent = 0x7f050005;
}
public static final class color {
public static int abc_background_cache_hint_selector_material_dark = 0x7f060001;
public static int abc_background_cache_hint_selector_material_light = 0x7f060002;
public static int abc_btn_colored_borderless_text_material = 0x7f060003;
public static int abc_btn_colored_text_material = 0x7f060004;
public static int abc_color_highlight_material = 0x7f060005;
public static int abc_hint_foreground_material_dark = 0x7f060006;
public static int abc_hint_foreground_material_light = 0x7f060007;
public static int abc_input_method_navigation_guard = 0x7f060008;
public static int abc_primary_text_disable_only_material_dark = 0x7f060009;
public static int abc_primary_text_disable_only_material_light = 0x7f06000a;
public static int abc_primary_text_material_dark = 0x7f06000b;
public static int abc_primary_text_material_light = 0x7f06000c;
public static int abc_search_url_text = 0x7f06000d;
public static int abc_search_url_text_normal = 0x7f06000e;
public static int abc_search_url_text_pressed = 0x7f06000f;
public static int abc_search_url_text_selected = 0x7f060010;
public static int abc_secondary_text_material_dark = 0x7f060011;
public static int abc_secondary_text_material_light = 0x7f060012;
public static int abc_tint_btn_checkable = 0x7f060013;
public static int abc_tint_default = 0x7f060014;
public static int abc_tint_edittext = 0x7f060015;
public static int abc_tint_seek_thumb = 0x7f060016;
public static int abc_tint_spinner = 0x7f060017;
public static int abc_tint_switch_track = 0x7f060018;
public static int accent_material_dark = 0x7f060019;
public static int accent_material_light = 0x7f06001a;
public static int background_floating_material_dark = 0x7f06001b;
public static int background_floating_material_light = 0x7f06001c;
public static int background_material_dark = 0x7f06001d;
public static int background_material_light = 0x7f06001e;
public static int bright_foreground_disabled_material_dark = 0x7f06001f;
public static int bright_foreground_disabled_material_light = 0x7f060020;
public static int bright_foreground_inverse_material_dark = 0x7f060021;
public static int bright_foreground_inverse_material_light = 0x7f060022;
public static int bright_foreground_material_dark = 0x7f060023;
public static int bright_foreground_material_light = 0x7f060024;
public static int button_material_dark = 0x7f060025;
public static int button_material_light = 0x7f060026;
public static int dim_foreground_disabled_material_dark = 0x7f060028;
public static int dim_foreground_disabled_material_light = 0x7f060029;
public static int dim_foreground_material_dark = 0x7f06002a;
public static int dim_foreground_material_light = 0x7f06002b;
public static int error_color_material = 0x7f06002c;
public static int foreground_material_dark = 0x7f06002e;
public static int foreground_material_light = 0x7f06002f;
public static int highlighted_text_material_dark = 0x7f060030;
public static int highlighted_text_material_light = 0x7f060031;
public static int material_blue_grey_800 = 0x7f060032;
public static int material_blue_grey_900 = 0x7f060033;
public static int material_blue_grey_950 = 0x7f060034;
public static int material_deep_teal_200 = 0x7f060035;
public static int material_deep_teal_500 = 0x7f060036;
public static int material_grey_100 = 0x7f060037;
public static int material_grey_300 = 0x7f060038;
public static int material_grey_50 = 0x7f060039;
public static int material_grey_600 = 0x7f06003a;
public static int material_grey_800 = 0x7f06003b;
public static int material_grey_850 = 0x7f06003c;
public static int material_grey_900 = 0x7f06003d;
public static int notification_action_color_filter = 0x7f06003e;
public static int notification_icon_bg_color = 0x7f06003f;
public static int primary_dark_material_dark = 0x7f060040;
public static int primary_dark_material_light = 0x7f060041;
public static int primary_material_dark = 0x7f060042;
public static int primary_material_light = 0x7f060043;
public static int primary_text_default_material_dark = 0x7f060044;
public static int primary_text_default_material_light = 0x7f060045;
public static int primary_text_disabled_material_dark = 0x7f060046;
public static int primary_text_disabled_material_light = 0x7f060047;
public static int ripple_material_dark = 0x7f060048;
public static int ripple_material_light = 0x7f060049;
public static int secondary_text_default_material_dark = 0x7f06004a;
public static int secondary_text_default_material_light = 0x7f06004b;
public static int secondary_text_disabled_material_dark = 0x7f06004c;
public static int secondary_text_disabled_material_light = 0x7f06004d;
public static int switch_thumb_disabled_material_dark = 0x7f06004e;
public static int switch_thumb_disabled_material_light = 0x7f06004f;
public static int switch_thumb_material_dark = 0x7f060050;
public static int switch_thumb_material_light = 0x7f060051;
public static int switch_thumb_normal_material_dark = 0x7f060052;
public static int switch_thumb_normal_material_light = 0x7f060053;
public static int tooltip_background_dark = 0x7f060054;
public static int tooltip_background_light = 0x7f060055;
}
public static final class dimen {
public static int abc_action_bar_content_inset_material = 0x7f080001;
public static int abc_action_bar_content_inset_with_nav = 0x7f080002;
public static int abc_action_bar_default_height_material = 0x7f080003;
public static int abc_action_bar_default_padding_end_material = 0x7f080004;
public static int abc_action_bar_default_padding_start_material = 0x7f080005;
public static int abc_action_bar_elevation_material = 0x7f080006;
public static int abc_action_bar_icon_vertical_padding_material = 0x7f080007;
public static int abc_action_bar_overflow_padding_end_material = 0x7f080008;
public static int abc_action_bar_overflow_padding_start_material = 0x7f080009;
public static int abc_action_bar_progress_bar_size = 0x7f08000a;
public static int abc_action_bar_stacked_max_height = 0x7f08000b;
public static int abc_action_bar_stacked_tab_max_width = 0x7f08000c;
public static int abc_action_bar_subtitle_bottom_margin_material = 0x7f08000d;
public static int abc_action_bar_subtitle_top_margin_material = 0x7f08000e;
public static int abc_action_button_min_height_material = 0x7f08000f;
public static int abc_action_button_min_width_material = 0x7f080010;
public static int abc_action_button_min_width_overflow_material = 0x7f080011;
public static int abc_alert_dialog_button_bar_height = 0x7f080012;
public static int abc_button_inset_horizontal_material = 0x7f080013;
public static int abc_button_inset_vertical_material = 0x7f080014;
public static int abc_button_padding_horizontal_material = 0x7f080015;
public static int abc_button_padding_vertical_material = 0x7f080016;
public static int abc_cascading_menus_min_smallest_width = 0x7f080017;
public static int abc_config_prefDialogWidth = 0x7f080018;
public static int abc_control_corner_material = 0x7f080019;
public static int abc_control_inset_material = 0x7f08001a;
public static int abc_control_padding_material = 0x7f08001b;
public static int abc_dialog_fixed_height_major = 0x7f08001c;
public static int abc_dialog_fixed_height_minor = 0x7f08001d;
public static int abc_dialog_fixed_width_major = 0x7f08001e;
public static int abc_dialog_fixed_width_minor = 0x7f08001f;
public static int abc_dialog_list_padding_bottom_no_buttons = 0x7f080020;
public static int abc_dialog_list_padding_top_no_title = 0x7f080021;
public static int abc_dialog_min_width_major = 0x7f080022;
public static int abc_dialog_min_width_minor = 0x7f080023;
public static int abc_dialog_padding_material = 0x7f080024;
public static int abc_dialog_padding_top_material = 0x7f080025;
public static int abc_dialog_title_divider_material = 0x7f080026;
public static int abc_disabled_alpha_material_dark = 0x7f080027;
public static int abc_disabled_alpha_material_light = 0x7f080028;
public static int abc_dropdownitem_icon_width = 0x7f080029;
public static int abc_dropdownitem_text_padding_left = 0x7f08002a;
public static int abc_dropdownitem_text_padding_right = 0x7f08002b;
public static int abc_edit_text_inset_bottom_material = 0x7f08002c;
public static int abc_edit_text_inset_horizontal_material = 0x7f08002d;
public static int abc_edit_text_inset_top_material = 0x7f08002e;
public static int abc_floating_window_z = 0x7f08002f;
public static int abc_list_item_padding_horizontal_material = 0x7f080030;
public static int abc_panel_menu_list_width = 0x7f080031;
public static int abc_progress_bar_height_material = 0x7f080032;
public static int abc_search_view_preferred_height = 0x7f080033;
public static int abc_search_view_preferred_width = 0x7f080034;
public static int abc_seekbar_track_background_height_material = 0x7f080035;
public static int abc_seekbar_track_progress_height_material = 0x7f080036;
public static int abc_select_dialog_padding_start_material = 0x7f080037;
public static int abc_switch_padding = 0x7f080038;
public static int abc_text_size_body_1_material = 0x7f080039;
public static int abc_text_size_body_2_material = 0x7f08003a;
public static int abc_text_size_button_material = 0x7f08003b;
public static int abc_text_size_caption_material = 0x7f08003c;
public static int abc_text_size_display_1_material = 0x7f08003d;
public static int abc_text_size_display_2_material = 0x7f08003e;
public static int abc_text_size_display_3_material = 0x7f08003f;
public static int abc_text_size_display_4_material = 0x7f080040;
public static int abc_text_size_headline_material = 0x7f080041;
public static int abc_text_size_large_material = 0x7f080042;
public static int abc_text_size_medium_material = 0x7f080043;
public static int abc_text_size_menu_header_material = 0x7f080044;
public static int abc_text_size_menu_material = 0x7f080045;
public static int abc_text_size_small_material = 0x7f080046;
public static int abc_text_size_subhead_material = 0x7f080047;
public static int abc_text_size_subtitle_material_toolbar = 0x7f080048;
public static int abc_text_size_title_material = 0x7f080049;
public static int abc_text_size_title_material_toolbar = 0x7f08004a;
public static int compat_button_inset_horizontal_material = 0x7f08004b;
public static int compat_button_inset_vertical_material = 0x7f08004c;
public static int compat_button_padding_horizontal_material = 0x7f08004d;
public static int compat_button_padding_vertical_material = 0x7f08004e;
public static int compat_control_corner_material = 0x7f08004f;
public static int disabled_alpha_material_dark = 0x7f080050;
public static int disabled_alpha_material_light = 0x7f080051;
public static int highlight_alpha_material_colored = 0x7f080053;
public static int highlight_alpha_material_dark = 0x7f080054;
public static int highlight_alpha_material_light = 0x7f080055;
public static int hint_alpha_material_dark = 0x7f080056;
public static int hint_alpha_material_light = 0x7f080057;
public static int hint_pressed_alpha_material_dark = 0x7f080058;
public static int hint_pressed_alpha_material_light = 0x7f080059;
public static int notification_action_icon_size = 0x7f08005b;
public static int notification_action_text_size = 0x7f08005c;
public static int notification_big_circle_margin = 0x7f08005d;
public static int notification_content_margin_start = 0x7f08005e;
public static int notification_large_icon_height = 0x7f08005f;
public static int notification_large_icon_width = 0x7f080060;
public static int notification_main_column_padding_top = 0x7f080061;
public static int notification_media_narrow_margin = 0x7f080062;
public static int notification_right_icon_size = 0x7f080063;
public static int notification_right_side_padding_top = 0x7f080064;
public static int notification_small_icon_background_padding = 0x7f080065;
public static int notification_small_icon_size_as_large = 0x7f080066;
public static int notification_subtext_size = 0x7f080067;
public static int notification_top_pad = 0x7f080068;
public static int notification_top_pad_large_text = 0x7f080069;
public static int tooltip_corner_radius = 0x7f08006b;
public static int tooltip_horizontal_padding = 0x7f08006c;
public static int tooltip_margin = 0x7f08006d;
public static int tooltip_precise_anchor_extra_offset = 0x7f08006e;
public static int tooltip_precise_anchor_threshold = 0x7f08006f;
public static int tooltip_vertical_padding = 0x7f080070;
public static int tooltip_y_offset_non_touch = 0x7f080071;
public static int tooltip_y_offset_touch = 0x7f080072;
}
public static final class drawable {
public static int abc_ab_share_pack_mtrl_alpha = 0x7f090001;
public static int abc_action_bar_item_background_material = 0x7f090002;
public static int abc_btn_borderless_material = 0x7f090003;
public static int abc_btn_check_material = 0x7f090004;
public static int abc_btn_check_to_on_mtrl_000 = 0x7f090005;
public static int abc_btn_check_to_on_mtrl_015 = 0x7f090006;
public static int abc_btn_colored_material = 0x7f090007;
public static int abc_btn_default_mtrl_shape = 0x7f090008;
public static int abc_btn_radio_material = 0x7f090009;
public static int abc_btn_radio_to_on_mtrl_000 = 0x7f09000a;
public static int abc_btn_radio_to_on_mtrl_015 = 0x7f09000b;
public static int abc_btn_switch_to_on_mtrl_00001 = 0x7f09000c;
public static int abc_btn_switch_to_on_mtrl_00012 = 0x7f09000d;
public static int abc_cab_background_internal_bg = 0x7f09000e;
public static int abc_cab_background_top_material = 0x7f09000f;
public static int abc_cab_background_top_mtrl_alpha = 0x7f090010;
public static int abc_control_background_material = 0x7f090011;
public static int abc_dialog_material_background = 0x7f090012;
public static int abc_edit_text_material = 0x7f090013;
public static int abc_ic_ab_back_material = 0x7f090014;
public static int abc_ic_arrow_drop_right_black_24dp = 0x7f090015;
public static int abc_ic_clear_material = 0x7f090016;
public static int abc_ic_commit_search_api_mtrl_alpha = 0x7f090017;
public static int abc_ic_go_search_api_material = 0x7f090018;
public static int abc_ic_menu_copy_mtrl_am_alpha = 0x7f090019;
public static int abc_ic_menu_cut_mtrl_alpha = 0x7f09001a;
public static int abc_ic_menu_overflow_material = 0x7f09001b;
public static int abc_ic_menu_paste_mtrl_am_alpha = 0x7f09001c;
public static int abc_ic_menu_selectall_mtrl_alpha = 0x7f09001d;
public static int abc_ic_menu_share_mtrl_alpha = 0x7f09001e;
public static int abc_ic_search_api_material = 0x7f09001f;
public static int abc_ic_star_black_16dp = 0x7f090020;
public static int abc_ic_star_black_36dp = 0x7f090021;
public static int abc_ic_star_black_48dp = 0x7f090022;
public static int abc_ic_star_half_black_16dp = 0x7f090023;
public static int abc_ic_star_half_black_36dp = 0x7f090024;
public static int abc_ic_star_half_black_48dp = 0x7f090025;
public static int abc_ic_voice_search_api_material = 0x7f090026;
public static int abc_item_background_holo_dark = 0x7f090027;
public static int abc_item_background_holo_light = 0x7f090028;
public static int abc_list_divider_mtrl_alpha = 0x7f090029;
public static int abc_list_focused_holo = 0x7f09002a;
public static int abc_list_longpressed_holo = 0x7f09002b;
public static int abc_list_pressed_holo_dark = 0x7f09002c;
public static int abc_list_pressed_holo_light = 0x7f09002d;
public static int abc_list_selector_background_transition_holo_dark = 0x7f09002e;
public static int abc_list_selector_background_transition_holo_light = 0x7f09002f;
public static int abc_list_selector_disabled_holo_dark = 0x7f090030;
public static int abc_list_selector_disabled_holo_light = 0x7f090031;
public static int abc_list_selector_holo_dark = 0x7f090032;
public static int abc_list_selector_holo_light = 0x7f090033;
public static int abc_menu_hardkey_panel_mtrl_mult = 0x7f090034;
public static int abc_popup_background_mtrl_mult = 0x7f090035;
public static int abc_ratingbar_indicator_material = 0x7f090036;
public static int abc_ratingbar_material = 0x7f090037;
public static int abc_ratingbar_small_material = 0x7f090038;
public static int abc_scrubber_control_off_mtrl_alpha = 0x7f090039;
public static int abc_scrubber_control_to_pressed_mtrl_000 = 0x7f09003a;
public static int abc_scrubber_control_to_pressed_mtrl_005 = 0x7f09003b;
public static int abc_scrubber_primary_mtrl_alpha = 0x7f09003c;
public static int abc_scrubber_track_mtrl_alpha = 0x7f09003d;
public static int abc_seekbar_thumb_material = 0x7f09003e;
public static int abc_seekbar_tick_mark_material = 0x7f09003f;
public static int abc_seekbar_track_material = 0x7f090040;
public static int abc_spinner_mtrl_am_alpha = 0x7f090041;
public static int abc_spinner_textfield_background_material = 0x7f090042;
public static int abc_switch_thumb_material = 0x7f090043;
public static int abc_switch_track_mtrl_alpha = 0x7f090044;
public static int abc_tab_indicator_material = 0x7f090045;
public static int abc_tab_indicator_mtrl_alpha = 0x7f090046;
public static int abc_text_cursor_material = 0x7f090047;
public static int abc_text_select_handle_left_mtrl_dark = 0x7f090048;
public static int abc_text_select_handle_left_mtrl_light = 0x7f090049;
public static int abc_text_select_handle_middle_mtrl_dark = 0x7f09004a;
public static int abc_text_select_handle_middle_mtrl_light = 0x7f09004b;
public static int abc_text_select_handle_right_mtrl_dark = 0x7f09004c;
public static int abc_text_select_handle_right_mtrl_light = 0x7f09004d;
public static int abc_textfield_activated_mtrl_alpha = 0x7f09004e;
public static int abc_textfield_default_mtrl_alpha = 0x7f09004f;
public static int abc_textfield_search_activated_mtrl_alpha = 0x7f090050;
public static int abc_textfield_search_default_mtrl_alpha = 0x7f090051;
public static int abc_textfield_search_material = 0x7f090052;
public static int abc_vector_test = 0x7f090053;
public static int notification_action_background = 0x7f09005e;
public static int notification_bg = 0x7f09005f;
public static int notification_bg_low = 0x7f090060;
public static int notification_bg_low_normal = 0x7f090061;
public static int notification_bg_low_pressed = 0x7f090062;
public static int notification_bg_normal = 0x7f090063;
public static int notification_bg_normal_pressed = 0x7f090064;
public static int notification_icon_background = 0x7f090065;
public static int notification_template_icon_bg = 0x7f090066;
public static int notification_template_icon_low_bg = 0x7f090067;
public static int notification_tile_bg = 0x7f090068;
public static int notify_panel_notification_icon_bg = 0x7f090069;
public static int tooltip_frame_dark = 0x7f09006c;
public static int tooltip_frame_light = 0x7f09006d;
}
public static final class id {
public static int action_bar = 0x7f0c0001;
public static int action_bar_activity_content = 0x7f0c0002;
public static int action_bar_container = 0x7f0c0003;
public static int action_bar_root = 0x7f0c0004;
public static int action_bar_spinner = 0x7f0c0005;
public static int action_bar_subtitle = 0x7f0c0006;
public static int action_bar_title = 0x7f0c0007;
public static int action_container = 0x7f0c0008;
public static int action_context_bar = 0x7f0c0009;
public static int action_divider = 0x7f0c000a;
public static int action_image = 0x7f0c000b;
public static int action_menu_divider = 0x7f0c000c;
public static int action_menu_presenter = 0x7f0c000d;
public static int action_mode_bar = 0x7f0c000e;
public static int action_mode_bar_stub = 0x7f0c000f;
public static int action_mode_close_button = 0x7f0c0010;
public static int action_text = 0x7f0c0011;
public static int actions = 0x7f0c0012;
public static int activity_chooser_view_content = 0x7f0c0013;
public static int add = 0x7f0c0014;
public static int alertTitle = 0x7f0c0015;
public static int async = 0x7f0c0016;
public static int blocking = 0x7f0c0017;
public static int buttonPanel = 0x7f0c0019;
public static int checkbox = 0x7f0c001b;
public static int chronometer = 0x7f0c001d;
public static int contentPanel = 0x7f0c001f;
public static int custom = 0x7f0c0021;
public static int customPanel = 0x7f0c0022;
public static int decor_content_parent = 0x7f0c0023;
public static int default_activity_button = 0x7f0c0024;
public static int edit_query = 0x7f0c0025;
public static int expand_activities_button = 0x7f0c0026;
public static int expanded_menu = 0x7f0c0027;
public static int forever = 0x7f0c0029;
public static int home = 0x7f0c002b;
public static int icon = 0x7f0c002c;
public static int icon_group = 0x7f0c002d;
public static int image = 0x7f0c002e;
public static int info = 0x7f0c0031;
public static int italic = 0x7f0c0032;
public static int line1 = 0x7f0c0033;
public static int line3 = 0x7f0c0034;
public static int listMode = 0x7f0c0035;
public static int list_item = 0x7f0c0036;
public static int message = 0x7f0c0038;
public static int multiply = 0x7f0c0039;
public static int none = 0x7f0c003b;
public static int normal = 0x7f0c003c;
public static int notification_background = 0x7f0c003d;
public static int notification_main_column = 0x7f0c003e;
public static int notification_main_column_container = 0x7f0c003f;
public static int parentPanel = 0x7f0c0040;
public static int progress_circular = 0x7f0c0042;
public static int progress_horizontal = 0x7f0c0043;
public static int radio = 0x7f0c0044;
public static int right_icon = 0x7f0c0045;
public static int right_side = 0x7f0c0046;
public static int screen = 0x7f0c0047;
public static int scrollIndicatorDown = 0x7f0c0048;
public static int scrollIndicatorUp = 0x7f0c0049;
public static int scrollView = 0x7f0c004a;
public static int search_badge = 0x7f0c004b;
public static int search_bar = 0x7f0c004c;
public static int search_button = 0x7f0c004d;
public static int search_close_btn = 0x7f0c004e;
public static int search_edit_frame = 0x7f0c004f;
public static int search_go_btn = 0x7f0c0050;
public static int search_mag_icon = 0x7f0c0051;
public static int search_plate = 0x7f0c0052;
public static int search_src_text = 0x7f0c0053;
public static int search_voice_btn = 0x7f0c0054;
public static int select_dialog_listview = 0x7f0c0056;
public static int shortcut = 0x7f0c0057;
public static int spacer = 0x7f0c0059;
public static int split_action_bar = 0x7f0c005a;
public static int src_atop = 0x7f0c005b;
public static int src_in = 0x7f0c005c;
public static int src_over = 0x7f0c005d;
public static int submenuarrow = 0x7f0c005e;
public static int submit_area = 0x7f0c005f;
public static int tabMode = 0x7f0c0060;
public static int tag_transition_group = 0x7f0c0061;
public static int text = 0x7f0c0062;
public static int text2 = 0x7f0c0063;
public static int textSpacerNoButtons = 0x7f0c0064;
public static int textSpacerNoTitle = 0x7f0c0065;
public static int time = 0x7f0c0066;
public static int title = 0x7f0c0068;
public static int titleDividerNoCustom = 0x7f0c0069;
public static int title_template = 0x7f0c006a;
public static int topPanel = 0x7f0c006b;
public static int uniform = 0x7f0c006c;
public static int up = 0x7f0c006d;
public static int wrap_content = 0x7f0c006e;
}
public static final class integer {
public static int abc_config_activityDefaultDur = 0x7f0d0001;
public static int abc_config_activityShortDur = 0x7f0d0002;
public static int cancel_button_image_alpha = 0x7f0d0003;
public static int config_tooltipAnimTime = 0x7f0d0004;
public static int status_bar_notification_info_maxnum = 0x7f0d0005;
}
public static final class layout {
public static int abc_action_bar_title_item = 0x7f0f0001;
public static int abc_action_bar_up_container = 0x7f0f0002;
public static int abc_action_menu_item_layout = 0x7f0f0003;
public static int abc_action_menu_layout = 0x7f0f0004;
public static int abc_action_mode_bar = 0x7f0f0005;
public static int abc_action_mode_close_item_material = 0x7f0f0006;
public static int abc_activity_chooser_view = 0x7f0f0007;
public static int abc_activity_chooser_view_list_item = 0x7f0f0008;
public static int abc_alert_dialog_button_bar_material = 0x7f0f0009;
public static int abc_alert_dialog_material = 0x7f0f000a;
public static int abc_alert_dialog_title_material = 0x7f0f000b;
public static int abc_dialog_title_material = 0x7f0f000c;
public static int abc_expanded_menu_layout = 0x7f0f000d;
public static int abc_list_menu_item_checkbox = 0x7f0f000e;
public static int abc_list_menu_item_icon = 0x7f0f000f;
public static int abc_list_menu_item_layout = 0x7f0f0010;
public static int abc_list_menu_item_radio = 0x7f0f0011;
public static int abc_popup_menu_header_item_layout = 0x7f0f0012;
public static int abc_popup_menu_item_layout = 0x7f0f0013;
public static int abc_screen_content_include = 0x7f0f0014;
public static int abc_screen_simple = 0x7f0f0015;
public static int abc_screen_simple_overlay_action_mode = 0x7f0f0016;
public static int abc_screen_toolbar = 0x7f0f0017;
public static int abc_search_dropdown_item_icons_2line = 0x7f0f0018;
public static int abc_search_view = 0x7f0f0019;
public static int abc_select_dialog_material = 0x7f0f001a;
public static int notification_action = 0x7f0f0021;
public static int notification_action_tombstone = 0x7f0f0022;
public static int notification_template_custom_big = 0x7f0f0023;
public static int notification_template_icon_group = 0x7f0f0024;
public static int notification_template_part_chronometer = 0x7f0f0025;
public static int notification_template_part_time = 0x7f0f0026;
public static int select_dialog_item_material = 0x7f0f0027;
public static int select_dialog_multichoice_material = 0x7f0f0028;
public static int select_dialog_singlechoice_material = 0x7f0f0029;
public static int support_simple_spinner_dropdown_item = 0x7f0f002a;
public static int tooltip = 0x7f0f002b;
}
public static final class string {
public static int abc_action_bar_home_description = 0x7f150001;
public static int abc_action_bar_up_description = 0x7f150002;
public static int abc_action_menu_overflow_description = 0x7f150003;
public static int abc_action_mode_done = 0x7f150004;
public static int abc_activity_chooser_view_see_all = 0x7f150005;
public static int abc_activitychooserview_choose_application = 0x7f150006;
public static int abc_capital_off = 0x7f150007;
public static int abc_capital_on = 0x7f150008;
public static int abc_font_family_body_1_material = 0x7f150009;
public static int abc_font_family_body_2_material = 0x7f15000a;
public static int abc_font_family_button_material = 0x7f15000b;
public static int abc_font_family_caption_material = 0x7f15000c;
public static int abc_font_family_display_1_material = 0x7f15000d;
public static int abc_font_family_display_2_material = 0x7f15000e;
public static int abc_font_family_display_3_material = 0x7f15000f;
public static int abc_font_family_display_4_material = 0x7f150010;
public static int abc_font_family_headline_material = 0x7f150011;
public static int abc_font_family_menu_material = 0x7f150012;
public static int abc_font_family_subhead_material = 0x7f150013;
public static int abc_font_family_title_material = 0x7f150014;
public static int abc_search_hint = 0x7f150015;
public static int abc_searchview_description_clear = 0x7f150016;
public static int abc_searchview_description_query = 0x7f150017;
public static int abc_searchview_description_search = 0x7f150018;
public static int abc_searchview_description_submit = 0x7f150019;
public static int abc_searchview_description_voice = 0x7f15001a;
public static int abc_shareactionprovider_share_with = 0x7f15001b;
public static int abc_shareactionprovider_share_with_application = 0x7f15001c;
public static int abc_toolbar_collapse_description = 0x7f15001d;
public static int search_menu_title = 0x7f150023;
public static int status_bar_notification_info_overflow = 0x7f150024;
}
public static final class style {
public static int AlertDialog_AppCompat = 0x7f160001;
public static int AlertDialog_AppCompat_Light = 0x7f160002;
public static int Animation_AppCompat_Dialog = 0x7f160003;
public static int Animation_AppCompat_DropDownUp = 0x7f160004;
public static int Animation_AppCompat_Tooltip = 0x7f160005;
public static int Base_AlertDialog_AppCompat = 0x7f160006;
public static int Base_AlertDialog_AppCompat_Light = 0x7f160007;
public static int Base_Animation_AppCompat_Dialog = 0x7f160008;
public static int Base_Animation_AppCompat_DropDownUp = 0x7f160009;
public static int Base_Animation_AppCompat_Tooltip = 0x7f16000a;
public static int Base_DialogWindowTitleBackground_AppCompat = 0x7f16000b;
public static int Base_DialogWindowTitle_AppCompat = 0x7f16000c;
public static int Base_TextAppearance_AppCompat = 0x7f16000d;
public static int Base_TextAppearance_AppCompat_Body1 = 0x7f16000e;
public static int Base_TextAppearance_AppCompat_Body2 = 0x7f16000f;
public static int Base_TextAppearance_AppCompat_Button = 0x7f160010;
public static int Base_TextAppearance_AppCompat_Caption = 0x7f160011;
public static int Base_TextAppearance_AppCompat_Display1 = 0x7f160012;
public static int Base_TextAppearance_AppCompat_Display2 = 0x7f160013;
public static int Base_TextAppearance_AppCompat_Display3 = 0x7f160014;
public static int Base_TextAppearance_AppCompat_Display4 = 0x7f160015;
public static int Base_TextAppearance_AppCompat_Headline = 0x7f160016;
public static int Base_TextAppearance_AppCompat_Inverse = 0x7f160017;
public static int Base_TextAppearance_AppCompat_Large = 0x7f160018;
public static int Base_TextAppearance_AppCompat_Large_Inverse = 0x7f160019;
public static int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f16001a;
public static int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f16001b;
public static int Base_TextAppearance_AppCompat_Medium = 0x7f16001c;
public static int Base_TextAppearance_AppCompat_Medium_Inverse = 0x7f16001d;
public static int Base_TextAppearance_AppCompat_Menu = 0x7f16001e;
public static int Base_TextAppearance_AppCompat_SearchResult = 0x7f16001f;
public static int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f160020;
public static int Base_TextAppearance_AppCompat_SearchResult_Title = 0x7f160021;
public static int Base_TextAppearance_AppCompat_Small = 0x7f160022;
public static int Base_TextAppearance_AppCompat_Small_Inverse = 0x7f160023;
public static int Base_TextAppearance_AppCompat_Subhead = 0x7f160024;
public static int Base_TextAppearance_AppCompat_Subhead_Inverse = 0x7f160025;
public static int Base_TextAppearance_AppCompat_Title = 0x7f160026;
public static int Base_TextAppearance_AppCompat_Title_Inverse = 0x7f160027;
public static int Base_TextAppearance_AppCompat_Tooltip = 0x7f160028;
public static int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f160029;
public static int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f16002a;
public static int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f16002b;
public static int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f16002c;
public static int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f16002d;
public static int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f16002e;
public static int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f16002f;
public static int Base_TextAppearance_AppCompat_Widget_Button = 0x7f160030;
public static int Base_TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 0x7f160031;
public static int Base_TextAppearance_AppCompat_Widget_Button_Colored = 0x7f160032;
public static int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f160033;
public static int Base_TextAppearance_AppCompat_Widget_DropDownItem = 0x7f160034;
public static int Base_TextAppearance_AppCompat_Widget_PopupMenu_Header = 0x7f160035;
public static int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f160036;
public static int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f160037;
public static int Base_TextAppearance_AppCompat_Widget_Switch = 0x7f160038;
public static int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f160039;
public static int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f16003a;
public static int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f16003b;
public static int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f16003c;
public static int Base_ThemeOverlay_AppCompat = 0x7f16003d;
public static int Base_ThemeOverlay_AppCompat_ActionBar = 0x7f16003e;
public static int Base_ThemeOverlay_AppCompat_Dark = 0x7f16003f;
public static int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f160040;
public static int Base_ThemeOverlay_AppCompat_Dialog = 0x7f160041;
public static int Base_ThemeOverlay_AppCompat_Dialog_Alert = 0x7f160042;
public static int Base_ThemeOverlay_AppCompat_Light = 0x7f160043;
public static int Base_Theme_AppCompat = 0x7f160044;
public static int Base_Theme_AppCompat_CompactMenu = 0x7f160045;
public static int Base_Theme_AppCompat_Dialog = 0x7f160046;
public static int Base_Theme_AppCompat_DialogWhenLarge = 0x7f160047;
public static int Base_Theme_AppCompat_Dialog_Alert = 0x7f160048;
public static int Base_Theme_AppCompat_Dialog_FixedSize = 0x7f160049;
public static int Base_Theme_AppCompat_Dialog_MinWidth = 0x7f16004a;
public static int Base_Theme_AppCompat_Light = 0x7f16004b;
public static int Base_Theme_AppCompat_Light_DarkActionBar = 0x7f16004c;
public static int Base_Theme_AppCompat_Light_Dialog = 0x7f16004d;
public static int Base_Theme_AppCompat_Light_DialogWhenLarge = 0x7f16004e;
public static int Base_Theme_AppCompat_Light_Dialog_Alert = 0x7f16004f;
public static int Base_Theme_AppCompat_Light_Dialog_FixedSize = 0x7f160050;
public static int Base_Theme_AppCompat_Light_Dialog_MinWidth = 0x7f160051;
public static int Base_V11_ThemeOverlay_AppCompat_Dialog = 0x7f160052;
public static int Base_V11_Theme_AppCompat_Dialog = 0x7f160053;
public static int Base_V11_Theme_AppCompat_Light_Dialog = 0x7f160054;
public static int Base_V12_Widget_AppCompat_AutoCompleteTextView = 0x7f160055;
public static int Base_V12_Widget_AppCompat_EditText = 0x7f160056;
public static int Base_V21_ThemeOverlay_AppCompat_Dialog = 0x7f160057;
public static int Base_V21_Theme_AppCompat = 0x7f160058;
public static int Base_V21_Theme_AppCompat_Dialog = 0x7f160059;
public static int Base_V21_Theme_AppCompat_Light = 0x7f16005a;
public static int Base_V21_Theme_AppCompat_Light_Dialog = 0x7f16005b;
public static int Base_V22_Theme_AppCompat = 0x7f16005c;
public static int Base_V22_Theme_AppCompat_Light = 0x7f16005d;
public static int Base_V23_Theme_AppCompat = 0x7f16005e;
public static int Base_V23_Theme_AppCompat_Light = 0x7f16005f;
public static int Base_V26_Theme_AppCompat = 0x7f160060;
public static int Base_V26_Theme_AppCompat_Light = 0x7f160061;
public static int Base_V26_Widget_AppCompat_Toolbar = 0x7f160062;
public static int Base_V7_ThemeOverlay_AppCompat_Dialog = 0x7f160063;
public static int Base_V7_Theme_AppCompat = 0x7f160064;
public static int Base_V7_Theme_AppCompat_Dialog = 0x7f160065;
public static int Base_V7_Theme_AppCompat_Light = 0x7f160066;
public static int Base_V7_Theme_AppCompat_Light_Dialog = 0x7f160067;
public static int Base_V7_Widget_AppCompat_AutoCompleteTextView = 0x7f160068;
public static int Base_V7_Widget_AppCompat_EditText = 0x7f160069;
public static int Base_V7_Widget_AppCompat_Toolbar = 0x7f16006a;
public static int Base_Widget_AppCompat_ActionBar = 0x7f16006b;
public static int Base_Widget_AppCompat_ActionBar_Solid = 0x7f16006c;
public static int Base_Widget_AppCompat_ActionBar_TabBar = 0x7f16006d;
public static int Base_Widget_AppCompat_ActionBar_TabText = 0x7f16006e;
public static int Base_Widget_AppCompat_ActionBar_TabView = 0x7f16006f;
public static int Base_Widget_AppCompat_ActionButton = 0x7f160070;
public static int Base_Widget_AppCompat_ActionButton_CloseMode = 0x7f160071;
public static int Base_Widget_AppCompat_ActionButton_Overflow = 0x7f160072;
public static int Base_Widget_AppCompat_ActionMode = 0x7f160073;
public static int Base_Widget_AppCompat_ActivityChooserView = 0x7f160074;
public static int Base_Widget_AppCompat_AutoCompleteTextView = 0x7f160075;
public static int Base_Widget_AppCompat_Button = 0x7f160076;
public static int Base_Widget_AppCompat_ButtonBar = 0x7f160077;
public static int Base_Widget_AppCompat_ButtonBar_AlertDialog = 0x7f160078;
public static int Base_Widget_AppCompat_Button_Borderless = 0x7f160079;
public static int Base_Widget_AppCompat_Button_Borderless_Colored = 0x7f16007a;
public static int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f16007b;
public static int Base_Widget_AppCompat_Button_Colored = 0x7f16007c;
public static int Base_Widget_AppCompat_Button_Small = 0x7f16007d;
public static int Base_Widget_AppCompat_CompoundButton_CheckBox = 0x7f16007e;
public static int Base_Widget_AppCompat_CompoundButton_RadioButton = 0x7f16007f;
public static int Base_Widget_AppCompat_CompoundButton_Switch = 0x7f160080;
public static int Base_Widget_AppCompat_DrawerArrowToggle = 0x7f160081;
public static int Base_Widget_AppCompat_DrawerArrowToggle_Common = 0x7f160082;
public static int Base_Widget_AppCompat_DropDownItem_Spinner = 0x7f160083;
public static int Base_Widget_AppCompat_EditText = 0x7f160084;
public static int Base_Widget_AppCompat_ImageButton = 0x7f160085;
public static int Base_Widget_AppCompat_Light_ActionBar = 0x7f160086;
public static int Base_Widget_AppCompat_Light_ActionBar_Solid = 0x7f160087;
public static int Base_Widget_AppCompat_Light_ActionBar_TabBar = 0x7f160088;
public static int Base_Widget_AppCompat_Light_ActionBar_TabText = 0x7f160089;
public static int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f16008a;
public static int Base_Widget_AppCompat_Light_ActionBar_TabView = 0x7f16008b;
public static int Base_Widget_AppCompat_Light_PopupMenu = 0x7f16008c;
public static int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f16008d;
public static int Base_Widget_AppCompat_ListMenuView = 0x7f16008e;
public static int Base_Widget_AppCompat_ListPopupWindow = 0x7f16008f;
public static int Base_Widget_AppCompat_ListView = 0x7f160090;
public static int Base_Widget_AppCompat_ListView_DropDown = 0x7f160091;
public static int Base_Widget_AppCompat_ListView_Menu = 0x7f160092;
public static int Base_Widget_AppCompat_PopupMenu = 0x7f160093;
public static int Base_Widget_AppCompat_PopupMenu_Overflow = 0x7f160094;
public static int Base_Widget_AppCompat_PopupWindow = 0x7f160095;
public static int Base_Widget_AppCompat_ProgressBar = 0x7f160096;
public static int Base_Widget_AppCompat_ProgressBar_Horizontal = 0x7f160097;
public static int Base_Widget_AppCompat_RatingBar = 0x7f160098;
public static int Base_Widget_AppCompat_RatingBar_Indicator = 0x7f160099;
public static int Base_Widget_AppCompat_RatingBar_Small = 0x7f16009a;
public static int Base_Widget_AppCompat_SearchView = 0x7f16009b;
public static int Base_Widget_AppCompat_SearchView_ActionBar = 0x7f16009c;
public static int Base_Widget_AppCompat_SeekBar = 0x7f16009d;
public static int Base_Widget_AppCompat_SeekBar_Discrete = 0x7f16009e;
public static int Base_Widget_AppCompat_Spinner = 0x7f16009f;
public static int Base_Widget_AppCompat_Spinner_Underlined = 0x7f1600a0;
public static int Base_Widget_AppCompat_TextView_SpinnerItem = 0x7f1600a1;
public static int Base_Widget_AppCompat_Toolbar = 0x7f1600a2;
public static int Base_Widget_AppCompat_Toolbar_Button_Navigation = 0x7f1600a3;
public static int Platform_AppCompat = 0x7f1600a4;
public static int Platform_AppCompat_Light = 0x7f1600a5;
public static int Platform_ThemeOverlay_AppCompat = 0x7f1600a6;
public static int Platform_ThemeOverlay_AppCompat_Dark = 0x7f1600a7;
public static int Platform_ThemeOverlay_AppCompat_Light = 0x7f1600a8;
public static int Platform_V11_AppCompat = 0x7f1600a9;
public static int Platform_V11_AppCompat_Light = 0x7f1600aa;
public static int Platform_V14_AppCompat = 0x7f1600ab;
public static int Platform_V14_AppCompat_Light = 0x7f1600ac;
public static int Platform_V21_AppCompat = 0x7f1600ad;
public static int Platform_V21_AppCompat_Light = 0x7f1600ae;
public static int Platform_V25_AppCompat = 0x7f1600af;
public static int Platform_V25_AppCompat_Light = 0x7f1600b0;
public static int Platform_Widget_AppCompat_Spinner = 0x7f1600b1;
public static int RtlOverlay_DialogWindowTitle_AppCompat = 0x7f1600b2;
public static int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 0x7f1600b3;
public static int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 0x7f1600b4;
public static int RtlOverlay_Widget_AppCompat_PopupMenuItem = 0x7f1600b5;
public static int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 0x7f1600b6;
public static int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 0x7f1600b7;
public static int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 0x7f1600b8;
public static int RtlOverlay_Widget_AppCompat_Search_DropDown = 0x7f1600b9;
public static int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 0x7f1600ba;
public static int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 0x7f1600bb;
public static int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 0x7f1600bc;
public static int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 0x7f1600bd;
public static int RtlUnderlay_Widget_AppCompat_ActionButton = 0x7f1600be;
public static int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 0x7f1600bf;
public static int TextAppearance_AppCompat = 0x7f1600c0;
public static int TextAppearance_AppCompat_Body1 = 0x7f1600c1;
public static int TextAppearance_AppCompat_Body2 = 0x7f1600c2;
public static int TextAppearance_AppCompat_Button = 0x7f1600c3;
public static int TextAppearance_AppCompat_Caption = 0x7f1600c4;
public static int TextAppearance_AppCompat_Display1 = 0x7f1600c5;
public static int TextAppearance_AppCompat_Display2 = 0x7f1600c6;
public static int TextAppearance_AppCompat_Display3 = 0x7f1600c7;
public static int TextAppearance_AppCompat_Display4 = 0x7f1600c8;
public static int TextAppearance_AppCompat_Headline = 0x7f1600c9;
public static int TextAppearance_AppCompat_Inverse = 0x7f1600ca;
public static int TextAppearance_AppCompat_Large = 0x7f1600cb;
public static int TextAppearance_AppCompat_Large_Inverse = 0x7f1600cc;
public static int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 0x7f1600cd;
public static int TextAppearance_AppCompat_Light_SearchResult_Title = 0x7f1600ce;
public static int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f1600cf;
public static int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f1600d0;
public static int TextAppearance_AppCompat_Medium = 0x7f1600d1;
public static int TextAppearance_AppCompat_Medium_Inverse = 0x7f1600d2;
public static int TextAppearance_AppCompat_Menu = 0x7f1600d3;
public static int TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f1600d4;
public static int TextAppearance_AppCompat_SearchResult_Title = 0x7f1600d5;
public static int TextAppearance_AppCompat_Small = 0x7f1600d6;
public static int TextAppearance_AppCompat_Small_Inverse = 0x7f1600d7;
public static int TextAppearance_AppCompat_Subhead = 0x7f1600d8;
public static int TextAppearance_AppCompat_Subhead_Inverse = 0x7f1600d9;
public static int TextAppearance_AppCompat_Title = 0x7f1600da;
public static int TextAppearance_AppCompat_Title_Inverse = 0x7f1600db;
public static int TextAppearance_AppCompat_Tooltip = 0x7f1600dc;
public static int TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f1600dd;
public static int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f1600de;
public static int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f1600df;
public static int TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f1600e0;
public static int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f1600e1;
public static int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f1600e2;
public static int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 0x7f1600e3;
public static int TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f1600e4;
public static int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 0x7f1600e5;
public static int TextAppearance_AppCompat_Widget_Button = 0x7f1600e6;
public static int TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 0x7f1600e7;
public static int TextAppearance_AppCompat_Widget_Button_Colored = 0x7f1600e8;
public static int TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f1600e9;
public static int TextAppearance_AppCompat_Widget_DropDownItem = 0x7f1600ea;
public static int TextAppearance_AppCompat_Widget_PopupMenu_Header = 0x7f1600eb;
public static int TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f1600ec;
public static int TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f1600ed;
public static int TextAppearance_AppCompat_Widget_Switch = 0x7f1600ee;
public static int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f1600ef;
public static int TextAppearance_Compat_Notification = 0x7f1600f0;
public static int TextAppearance_Compat_Notification_Info = 0x7f1600f1;
public static int TextAppearance_Compat_Notification_Line2 = 0x7f1600f2;
public static int TextAppearance_Compat_Notification_Time = 0x7f1600f3;
public static int TextAppearance_Compat_Notification_Title = 0x7f1600f4;
public static int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f1600f5;
public static int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f1600f6;
public static int TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f1600f7;
public static int ThemeOverlay_AppCompat = 0x7f1600f8;
public static int ThemeOverlay_AppCompat_ActionBar = 0x7f1600f9;
public static int ThemeOverlay_AppCompat_Dark = 0x7f1600fa;
public static int ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f1600fb;
public static int ThemeOverlay_AppCompat_Dialog = 0x7f1600fc;
public static int ThemeOverlay_AppCompat_Dialog_Alert = 0x7f1600fd;
public static int ThemeOverlay_AppCompat_Light = 0x7f1600fe;
public static int Theme_AppCompat = 0x7f1600ff;
public static int Theme_AppCompat_CompactMenu = 0x7f160100;
public static int Theme_AppCompat_DayNight = 0x7f160101;
public static int Theme_AppCompat_DayNight_DarkActionBar = 0x7f160102;
public static int Theme_AppCompat_DayNight_Dialog = 0x7f160103;
public static int Theme_AppCompat_DayNight_DialogWhenLarge = 0x7f160104;
public static int Theme_AppCompat_DayNight_Dialog_Alert = 0x7f160105;
public static int Theme_AppCompat_DayNight_Dialog_MinWidth = 0x7f160106;
public static int Theme_AppCompat_DayNight_NoActionBar = 0x7f160107;
public static int Theme_AppCompat_Dialog = 0x7f160108;
public static int Theme_AppCompat_DialogWhenLarge = 0x7f160109;
public static int Theme_AppCompat_Dialog_Alert = 0x7f16010a;
public static int Theme_AppCompat_Dialog_MinWidth = 0x7f16010b;
public static int Theme_AppCompat_Light = 0x7f16010c;
public static int Theme_AppCompat_Light_DarkActionBar = 0x7f16010d;
public static int Theme_AppCompat_Light_Dialog = 0x7f16010e;
public static int Theme_AppCompat_Light_DialogWhenLarge = 0x7f16010f;
public static int Theme_AppCompat_Light_Dialog_Alert = 0x7f160110;
public static int Theme_AppCompat_Light_Dialog_MinWidth = 0x7f160111;
public static int Theme_AppCompat_Light_NoActionBar = 0x7f160112;
public static int Theme_AppCompat_NoActionBar = 0x7f160113;
public static int Widget_AppCompat_ActionBar = 0x7f160114;
public static int Widget_AppCompat_ActionBar_Solid = 0x7f160115;
public static int Widget_AppCompat_ActionBar_TabBar = 0x7f160116;
public static int Widget_AppCompat_ActionBar_TabText = 0x7f160117;
public static int Widget_AppCompat_ActionBar_TabView = 0x7f160118;
public static int Widget_AppCompat_ActionButton = 0x7f160119;
public static int Widget_AppCompat_ActionButton_CloseMode = 0x7f16011a;
public static int Widget_AppCompat_ActionButton_Overflow = 0x7f16011b;
public static int Widget_AppCompat_ActionMode = 0x7f16011c;
public static int Widget_AppCompat_ActivityChooserView = 0x7f16011d;
public static int Widget_AppCompat_AutoCompleteTextView = 0x7f16011e;
public static int Widget_AppCompat_Button = 0x7f16011f;
public static int Widget_AppCompat_ButtonBar = 0x7f160120;
public static int Widget_AppCompat_ButtonBar_AlertDialog = 0x7f160121;
public static int Widget_AppCompat_Button_Borderless = 0x7f160122;
public static int Widget_AppCompat_Button_Borderless_Colored = 0x7f160123;
public static int Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f160124;
public static int Widget_AppCompat_Button_Colored = 0x7f160125;
public static int Widget_AppCompat_Button_Small = 0x7f160126;
public static int Widget_AppCompat_CompoundButton_CheckBox = 0x7f160127;
public static int Widget_AppCompat_CompoundButton_RadioButton = 0x7f160128;
public static int Widget_AppCompat_CompoundButton_Switch = 0x7f160129;
public static int Widget_AppCompat_DrawerArrowToggle = 0x7f16012a;
public static int Widget_AppCompat_DropDownItem_Spinner = 0x7f16012b;
public static int Widget_AppCompat_EditText = 0x7f16012c;
public static int Widget_AppCompat_ImageButton = 0x7f16012d;
public static int Widget_AppCompat_Light_ActionBar = 0x7f16012e;
public static int Widget_AppCompat_Light_ActionBar_Solid = 0x7f16012f;
public static int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 0x7f160130;
public static int Widget_AppCompat_Light_ActionBar_TabBar = 0x7f160131;
public static int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 0x7f160132;
public static int Widget_AppCompat_Light_ActionBar_TabText = 0x7f160133;
public static int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f160134;
public static int Widget_AppCompat_Light_ActionBar_TabView = 0x7f160135;
public static int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 0x7f160136;
public static int Widget_AppCompat_Light_ActionButton = 0x7f160137;
public static int Widget_AppCompat_Light_ActionButton_CloseMode = 0x7f160138;
public static int Widget_AppCompat_Light_ActionButton_Overflow = 0x7f160139;
public static int Widget_AppCompat_Light_ActionMode_Inverse = 0x7f16013a;
public static int Widget_AppCompat_Light_ActivityChooserView = 0x7f16013b;
public static int Widget_AppCompat_Light_AutoCompleteTextView = 0x7f16013c;
public static int Widget_AppCompat_Light_DropDownItem_Spinner = 0x7f16013d;
public static int Widget_AppCompat_Light_ListPopupWindow = 0x7f16013e;
public static int Widget_AppCompat_Light_ListView_DropDown = 0x7f16013f;
public static int Widget_AppCompat_Light_PopupMenu = 0x7f160140;
public static int Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f160141;
public static int Widget_AppCompat_Light_SearchView = 0x7f160142;
public static int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 0x7f160143;
public static int Widget_AppCompat_ListMenuView = 0x7f160144;
public static int Widget_AppCompat_ListPopupWindow = 0x7f160145;
public static int Widget_AppCompat_ListView = 0x7f160146;
public static int Widget_AppCompat_ListView_DropDown = 0x7f160147;
public static int Widget_AppCompat_ListView_Menu = 0x7f160148;
public static int Widget_AppCompat_PopupMenu = 0x7f160149;
public static int Widget_AppCompat_PopupMenu_Overflow = 0x7f16014a;
public static int Widget_AppCompat_PopupWindow = 0x7f16014b;
public static int Widget_AppCompat_ProgressBar = 0x7f16014c;
public static int Widget_AppCompat_ProgressBar_Horizontal = 0x7f16014d;
public static int Widget_AppCompat_RatingBar = 0x7f16014e;
public static int Widget_AppCompat_RatingBar_Indicator = 0x7f16014f;
public static int Widget_AppCompat_RatingBar_Small = 0x7f160150;
public static int Widget_AppCompat_SearchView = 0x7f160151;
public static int Widget_AppCompat_SearchView_ActionBar = 0x7f160152;
public static int Widget_AppCompat_SeekBar = 0x7f160153;
public static int Widget_AppCompat_SeekBar_Discrete = 0x7f160154;
public static int Widget_AppCompat_Spinner = 0x7f160155;
public static int Widget_AppCompat_Spinner_DropDown = 0x7f160156;
public static int Widget_AppCompat_Spinner_DropDown_ActionBar = 0x7f160157;
public static int Widget_AppCompat_Spinner_Underlined = 0x7f160158;
public static int Widget_AppCompat_TextView_SpinnerItem = 0x7f160159;
public static int Widget_AppCompat_Toolbar = 0x7f16015a;
public static int Widget_AppCompat_Toolbar_Button_Navigation = 0x7f16015b;
public static int Widget_Compat_NotificationActionContainer = 0x7f16015c;
public static int Widget_Compat_NotificationActionText = 0x7f16015d;
}
public static final class styleable {
public static int[] ActionBar = { 0x7f040032, 0x7f040033, 0x7f040034, 0x7f040057, 0x7f040058, 0x7f040059, 0x7f04005a, 0x7f04005b, 0x7f04005c, 0x7f04005e, 0x7f040062, 0x7f040063, 0x7f04006e, 0x7f04007c, 0x7f04007d, 0x7f04007e, 0x7f04007f, 0x7f040080, 0x7f040085, 0x7f040088, 0x7f040095, 0x7f04009c, 0x7f0400a7, 0x7f0400aa, 0x7f0400ab, 0x7f0400c5, 0x7f0400c8, 0x7f0400e3, 0x7f0400ec };
public static int ActionBar_background = 0;
public static int ActionBar_backgroundSplit = 1;
public static int ActionBar_backgroundStacked = 2;
public static int ActionBar_contentInsetEnd = 3;
public static int ActionBar_contentInsetEndWithActions = 4;
public static int ActionBar_contentInsetLeft = 5;
public static int ActionBar_contentInsetRight = 6;
public static int ActionBar_contentInsetStart = 7;
public static int ActionBar_contentInsetStartWithNavigation = 8;
public static int ActionBar_customNavigationLayout = 9;
public static int ActionBar_displayOptions = 10;
public static int ActionBar_divider = 11;
public static int ActionBar_elevation = 12;
public static int ActionBar_height = 13;
public static int ActionBar_hideOnContentScroll = 14;
public static int ActionBar_homeAsUpIndicator = 15;
public static int ActionBar_homeLayout = 16;
public static int ActionBar_icon = 17;
public static int ActionBar_indeterminateProgressStyle = 18;
public static int ActionBar_itemPadding = 19;
public static int ActionBar_logo = 20;
public static int ActionBar_navigationMode = 21;
public static int ActionBar_popupTheme = 22;
public static int ActionBar_progressBarPadding = 23;
public static int ActionBar_progressBarStyle = 24;
public static int ActionBar_subtitle = 25;
public static int ActionBar_subtitleTextStyle = 26;
public static int ActionBar_title = 27;
public static int ActionBar_titleTextStyle = 28;
public static int[] ActionBarLayout = { 0x010100b3 };
public static int ActionBarLayout_android_layout_gravity = 0;
public static int[] ActionMenuItemView = { 0x0101013f };
public static int ActionMenuItemView_android_minWidth = 0;
public static int[] ActionMode = { 0x7f040032, 0x7f040033, 0x7f040047, 0x7f04007c, 0x7f0400c8, 0x7f0400ec };
public static int ActionMode_background = 0;
public static int ActionMode_backgroundSplit = 1;
public static int ActionMode_closeItemLayout = 2;
public static int ActionMode_height = 3;
public static int ActionMode_subtitleTextStyle = 4;
public static int ActionMode_titleTextStyle = 5;
public static int[] ActivityChooserView = { 0x7f04006f, 0x7f040086 };
public static int ActivityChooserView_expandActivityOverflowButtonDrawable = 0;
public static int ActivityChooserView_initialActivityCount = 1;
public static int[] AlertDialog = { 0x010100f2, 0x7f04003f, 0x7f04008c, 0x7f04008d, 0x7f040099, 0x7f0400bb, 0x7f0400bc };
public static int AlertDialog_android_layout = 0;
public static int AlertDialog_buttonPanelSideLayout = 1;
public static int AlertDialog_listItemLayout = 2;
public static int AlertDialog_listLayout = 3;
public static int AlertDialog_multiChoiceItemLayout = 4;
public static int AlertDialog_showTitle = 5;
public static int AlertDialog_singleChoiceItemLayout = 6;
public static int[] AppCompatImageView = { 0x01010119, 0x7f0400c1, 0x7f0400e1, 0x7f0400e2 };
public static int AppCompatImageView_android_src = 0;
public static int AppCompatImageView_srcCompat = 1;
public static int AppCompatImageView_tint = 2;
public static int AppCompatImageView_tintMode = 3;
public static int[] AppCompatSeekBar = { 0x01010142, 0x7f0400de, 0x7f0400df, 0x7f0400e0 };
public static int AppCompatSeekBar_android_thumb = 0;
public static int AppCompatSeekBar_tickMark = 1;
public static int AppCompatSeekBar_tickMarkTint = 2;
public static int AppCompatSeekBar_tickMarkTintMode = 3;
public static int[] AppCompatTextHelper = { 0x0101016e, 0x01010393, 0x0101016f, 0x01010170, 0x01010392, 0x0101016d, 0x01010034 };
public static int AppCompatTextHelper_android_drawableBottom = 0;
public static int AppCompatTextHelper_android_drawableEnd = 1;
public static int AppCompatTextHelper_android_drawableLeft = 2;
public static int AppCompatTextHelper_android_drawableRight = 3;
public static int AppCompatTextHelper_android_drawableStart = 4;
public static int AppCompatTextHelper_android_drawableTop = 5;
public static int AppCompatTextHelper_android_textAppearance = 6;
public static int[] AppCompatTextView = { 0x01010034, 0x7f04002d, 0x7f04002e, 0x7f04002f, 0x7f040030, 0x7f040031, 0x7f040071, 0x7f0400ce };
public static int AppCompatTextView_android_textAppearance = 0;
public static int AppCompatTextView_autoSizeMaxTextSize = 1;
public static int AppCompatTextView_autoSizeMinTextSize = 2;
public static int AppCompatTextView_autoSizePresetSizes = 3;
public static int AppCompatTextView_autoSizeStepGranularity = 4;
public static int AppCompatTextView_autoSizeTextType = 5;
public static int AppCompatTextView_fontFamily = 6;
public static int AppCompatTextView_textAllCaps = 7;
public static int[] AppCompatTheme = { 0x7f040001, 0x7f040002, 0x7f040003, 0x7f040004, 0x7f040005, 0x7f040006, 0x7f040007, 0x7f040008, 0x7f040009, 0x7f04000a, 0x7f04000b, 0x7f04000c, 0x7f04000d, 0x7f04000f, 0x7f040010, 0x7f040011, 0x7f040012, 0x7f040013, 0x7f040014, 0x7f040015, 0x7f040016, 0x7f040017, 0x7f040018, 0x7f040019, 0x7f04001a, 0x7f04001b, 0x7f04001c, 0x7f04001d, 0x7f04001e, 0x7f04001f, 0x7f040022, 0x7f040023, 0x7f040024, 0x7f040025, 0x7f040026, 0x010100ae, 0x01010057, 0x7f04002c, 0x7f040038, 0x7f040039, 0x7f04003a, 0x7f04003b, 0x7f04003c, 0x7f04003d, 0x7f040040, 0x7f040041, 0x7f040044, 0x7f040045, 0x7f04004b, 0x7f04004c, 0x7f04004d, 0x7f04004e, 0x7f04004f, 0x7f040050, 0x7f040051, 0x7f040052, 0x7f040053, 0x7f040054, 0x7f04005d, 0x7f040060, 0x7f040061, 0x7f040064, 0x7f040066, 0x7f040069, 0x7f04006a, 0x7f04006b, 0x7f04006c, 0x7f04006d, 0x7f04007e, 0x7f040084, 0x7f04008a, 0x7f04008b, 0x7f04008e, 0x7f04008f, 0x7f040090, 0x7f040091, 0x7f040092, 0x7f040093, 0x7f040094, 0x7f0400a3, 0x7f0400a4, 0x7f0400a5, 0x7f0400a6, 0x7f0400a8, 0x7f0400ae, 0x7f0400af, 0x7f0400b0, 0x7f0400b1, 0x7f0400b4, 0x7f0400b5, 0x7f0400b6, 0x7f0400b7, 0x7f0400be, 0x7f0400bf, 0x7f0400cc, 0x7f0400cf, 0x7f0400d0, 0x7f0400d1, 0x7f0400d2, 0x7f0400d3, 0x7f0400d4, 0x7f0400d5, 0x7f0400d6, 0x7f0400d7, 0x7f0400d8, 0x7f0400ed, 0x7f0400ee, 0x7f0400ef, 0x7f0400f0, 0x7f0400f6, 0x7f0400f7, 0x7f0400f8, 0x7f0400f9, 0x7f0400fa, 0x7f0400fb, 0x7f0400fc, 0x7f0400fd, 0x7f0400fe, 0x7f0400ff };
public static int AppCompatTheme_actionBarDivider = 0;
public static int AppCompatTheme_actionBarItemBackground = 1;
public static int AppCompatTheme_actionBarPopupTheme = 2;
public static int AppCompatTheme_actionBarSize = 3;
public static int AppCompatTheme_actionBarSplitStyle = 4;
public static int AppCompatTheme_actionBarStyle = 5;
public static int AppCompatTheme_actionBarTabBarStyle = 6;
public static int AppCompatTheme_actionBarTabStyle = 7;
public static int AppCompatTheme_actionBarTabTextStyle = 8;
public static int AppCompatTheme_actionBarTheme = 9;
public static int AppCompatTheme_actionBarWidgetTheme = 10;
public static int AppCompatTheme_actionButtonStyle = 11;
public static int AppCompatTheme_actionDropDownStyle = 12;
public static int AppCompatTheme_actionMenuTextAppearance = 13;
public static int AppCompatTheme_actionMenuTextColor = 14;
public static int AppCompatTheme_actionModeBackground = 15;
public static int AppCompatTheme_actionModeCloseButtonStyle = 16;
public static int AppCompatTheme_actionModeCloseDrawable = 17;
public static int AppCompatTheme_actionModeCopyDrawable = 18;
public static int AppCompatTheme_actionModeCutDrawable = 19;
public static int AppCompatTheme_actionModeFindDrawable = 20;
public static int AppCompatTheme_actionModePasteDrawable = 21;
public static int AppCompatTheme_actionModePopupWindowStyle = 22;
public static int AppCompatTheme_actionModeSelectAllDrawable = 23;
public static int AppCompatTheme_actionModeShareDrawable = 24;
public static int AppCompatTheme_actionModeSplitBackground = 25;
public static int AppCompatTheme_actionModeStyle = 26;
public static int AppCompatTheme_actionModeWebSearchDrawable = 27;
public static int AppCompatTheme_actionOverflowButtonStyle = 28;
public static int AppCompatTheme_actionOverflowMenuStyle = 29;
public static int AppCompatTheme_activityChooserViewStyle = 30;
public static int AppCompatTheme_alertDialogButtonGroupStyle = 31;
public static int AppCompatTheme_alertDialogCenterButtons = 32;
public static int AppCompatTheme_alertDialogStyle = 33;
public static int AppCompatTheme_alertDialogTheme = 34;
public static int AppCompatTheme_android_windowAnimationStyle = 35;
public static int AppCompatTheme_android_windowIsFloating = 36;
public static int AppCompatTheme_autoCompleteTextViewStyle = 37;
public static int AppCompatTheme_borderlessButtonStyle = 38;
public static int AppCompatTheme_buttonBarButtonStyle = 39;
public static int AppCompatTheme_buttonBarNegativeButtonStyle = 40;
public static int AppCompatTheme_buttonBarNeutralButtonStyle = 41;
public static int AppCompatTheme_buttonBarPositiveButtonStyle = 42;
public static int AppCompatTheme_buttonBarStyle = 43;
public static int AppCompatTheme_buttonStyle = 44;
public static int AppCompatTheme_buttonStyleSmall = 45;
public static int AppCompatTheme_checkboxStyle = 46;
public static int AppCompatTheme_checkedTextViewStyle = 47;
public static int AppCompatTheme_colorAccent = 48;
public static int AppCompatTheme_colorBackgroundFloating = 49;
public static int AppCompatTheme_colorButtonNormal = 50;
public static int AppCompatTheme_colorControlActivated = 51;
public static int AppCompatTheme_colorControlHighlight = 52;
public static int AppCompatTheme_colorControlNormal = 53;
public static int AppCompatTheme_colorError = 54;
public static int AppCompatTheme_colorPrimary = 55;
public static int AppCompatTheme_colorPrimaryDark = 56;
public static int AppCompatTheme_colorSwitchThumbNormal = 57;
public static int AppCompatTheme_controlBackground = 58;
public static int AppCompatTheme_dialogPreferredPadding = 59;
public static int AppCompatTheme_dialogTheme = 60;
public static int AppCompatTheme_dividerHorizontal = 61;
public static int AppCompatTheme_dividerVertical = 62;
public static int AppCompatTheme_dropDownListViewStyle = 63;
public static int AppCompatTheme_dropdownListPreferredItemHeight = 64;
public static int AppCompatTheme_editTextBackground = 65;
public static int AppCompatTheme_editTextColor = 66;
public static int AppCompatTheme_editTextStyle = 67;
public static int AppCompatTheme_homeAsUpIndicator = 68;
public static int AppCompatTheme_imageButtonStyle = 69;
public static int AppCompatTheme_listChoiceBackgroundIndicator = 70;
public static int AppCompatTheme_listDividerAlertDialog = 71;
public static int AppCompatTheme_listMenuViewStyle = 72;
public static int AppCompatTheme_listPopupWindowStyle = 73;
public static int AppCompatTheme_listPreferredItemHeight = 74;
public static int AppCompatTheme_listPreferredItemHeightLarge = 75;
public static int AppCompatTheme_listPreferredItemHeightSmall = 76;
public static int AppCompatTheme_listPreferredItemPaddingLeft = 77;
public static int AppCompatTheme_listPreferredItemPaddingRight = 78;
public static int AppCompatTheme_panelBackground = 79;
public static int AppCompatTheme_panelMenuListTheme = 80;
public static int AppCompatTheme_panelMenuListWidth = 81;
public static int AppCompatTheme_popupMenuStyle = 82;
public static int AppCompatTheme_popupWindowStyle = 83;
public static int AppCompatTheme_radioButtonStyle = 84;
public static int AppCompatTheme_ratingBarStyle = 85;
public static int AppCompatTheme_ratingBarStyleIndicator = 86;
public static int AppCompatTheme_ratingBarStyleSmall = 87;
public static int AppCompatTheme_searchViewStyle = 88;
public static int AppCompatTheme_seekBarStyle = 89;
public static int AppCompatTheme_selectableItemBackground = 90;
public static int AppCompatTheme_selectableItemBackgroundBorderless = 91;
public static int AppCompatTheme_spinnerDropDownItemStyle = 92;
public static int AppCompatTheme_spinnerStyle = 93;
public static int AppCompatTheme_switchStyle = 94;
public static int AppCompatTheme_textAppearanceLargePopupMenu = 95;
public static int AppCompatTheme_textAppearanceListItem = 96;
public static int AppCompatTheme_textAppearanceListItemSecondary = 97;
public static int AppCompatTheme_textAppearanceListItemSmall = 98;
public static int AppCompatTheme_textAppearancePopupMenuHeader = 99;
public static int AppCompatTheme_textAppearanceSearchResultSubtitle = 100;
public static int AppCompatTheme_textAppearanceSearchResultTitle = 101;
public static int AppCompatTheme_textAppearanceSmallPopupMenu = 102;
public static int AppCompatTheme_textColorAlertDialogListItem = 103;
public static int AppCompatTheme_textColorSearchUrl = 104;
public static int AppCompatTheme_toolbarNavigationButtonStyle = 105;
public static int AppCompatTheme_toolbarStyle = 106;
public static int AppCompatTheme_tooltipForegroundColor = 107;
public static int AppCompatTheme_tooltipFrameBackground = 108;
public static int AppCompatTheme_windowActionBar = 109;
public static int AppCompatTheme_windowActionBarOverlay = 110;
public static int AppCompatTheme_windowActionModeOverlay = 111;
public static int AppCompatTheme_windowFixedHeightMajor = 112;
public static int AppCompatTheme_windowFixedHeightMinor = 113;
public static int AppCompatTheme_windowFixedWidthMajor = 114;
public static int AppCompatTheme_windowFixedWidthMinor = 115;
public static int AppCompatTheme_windowMinWidthMajor = 116;
public static int AppCompatTheme_windowMinWidthMinor = 117;
public static int AppCompatTheme_windowNoTitle = 118;
public static int[] ButtonBarLayout = { 0x7f040027 };
public static int ButtonBarLayout_allowStacking = 0;
public static int[] ColorStateListItem = { 0x7f040028, 0x0101031f, 0x010101a5 };
public static int ColorStateListItem_alpha = 0;
public static int ColorStateListItem_android_alpha = 1;
public static int ColorStateListItem_android_color = 2;
public static int[] CompoundButton = { 0x01010107, 0x7f040042, 0x7f040043 };
public static int CompoundButton_android_button = 0;
public static int CompoundButton_buttonTint = 1;
public static int CompoundButton_buttonTintMode = 2;
public static int[] DrawerArrowToggle = { 0x7f04002a, 0x7f04002b, 0x7f040037, 0x7f04004a, 0x7f040067, 0x7f04007a, 0x7f0400bd, 0x7f0400da };
public static int DrawerArrowToggle_arrowHeadLength = 0;
public static int DrawerArrowToggle_arrowShaftLength = 1;
public static int DrawerArrowToggle_barLength = 2;
public static int DrawerArrowToggle_color = 3;
public static int DrawerArrowToggle_drawableSize = 4;
public static int DrawerArrowToggle_gapBetweenBars = 5;
public static int DrawerArrowToggle_spinBars = 6;
public static int DrawerArrowToggle_thickness = 7;
public static int[] FontFamily = { 0x7f040072, 0x7f040073, 0x7f040074, 0x7f040075, 0x7f040076, 0x7f040077 };
public static int FontFamily_fontProviderAuthority = 0;
public static int FontFamily_fontProviderCerts = 1;
public static int FontFamily_fontProviderFetchStrategy = 2;
public static int FontFamily_fontProviderFetchTimeout = 3;
public static int FontFamily_fontProviderPackage = 4;
public static int FontFamily_fontProviderQuery = 5;
public static int[] FontFamilyFont = { 0x01010532, 0x0101053f, 0x01010533, 0x7f040070, 0x7f040078, 0x7f040079 };
public static int FontFamilyFont_android_font = 0;
public static int FontFamilyFont_android_fontStyle = 1;
public static int FontFamilyFont_android_fontWeight = 2;
public static int FontFamilyFont_font = 3;
public static int FontFamilyFont_fontStyle = 4;
public static int FontFamilyFont_fontWeight = 5;
public static int[] LinearLayoutCompat = { 0x01010126, 0x01010127, 0x010100af, 0x010100c4, 0x01010128, 0x7f040063, 0x7f040065, 0x7f040098, 0x7f0400b9 };
public static int LinearLayoutCompat_android_baselineAligned = 0;
public static int LinearLayoutCompat_android_baselineAlignedChildIndex = 1;
public static int LinearLayoutCompat_android_gravity = 2;
public static int LinearLayoutCompat_android_orientation = 3;
public static int LinearLayoutCompat_android_weightSum = 4;
public static int LinearLayoutCompat_divider = 5;
public static int LinearLayoutCompat_dividerPadding = 6;
public static int LinearLayoutCompat_measureWithLargestChild = 7;
public static int LinearLayoutCompat_showDividers = 8;
public static int[] LinearLayoutCompat_Layout = { 0x010100b3, 0x010100f5, 0x01010181, 0x010100f4 };
public static int LinearLayoutCompat_Layout_android_layout_gravity = 0;
public static int LinearLayoutCompat_Layout_android_layout_height = 1;
public static int LinearLayoutCompat_Layout_android_layout_weight = 2;
public static int LinearLayoutCompat_Layout_android_layout_width = 3;
public static int[] ListPopupWindow = { 0x010102ac, 0x010102ad };
public static int ListPopupWindow_android_dropDownHorizontalOffset = 0;
public static int ListPopupWindow_android_dropDownVerticalOffset = 1;
public static int[] MenuGroup = { 0x010101e0, 0x0101000e, 0x010100d0, 0x010101de, 0x010101df, 0x01010194 };
public static int MenuGroup_android_checkableBehavior = 0;
public static int MenuGroup_android_enabled = 1;
public static int MenuGroup_android_id = 2;
public static int MenuGroup_android_menuCategory = 3;
public static int MenuGroup_android_orderInCategory = 4;
public static int MenuGroup_android_visible = 5;
public static int[] MenuItem = { 0x7f04000e, 0x7f040020, 0x7f040021, 0x7f040029, 0x010101e3, 0x010101e5, 0x01010106, 0x0101000e, 0x01010002, 0x010100d0, 0x010101de, 0x010101e4, 0x0101026f, 0x010101df, 0x010101e1, 0x010101e2, 0x01010194, 0x7f040056, 0x7f040081, 0x7f040082, 0x7f04009d, 0x7f0400b8, 0x7f0400f1 };
public static int MenuItem_actionLayout = 0;
public static int MenuItem_actionProviderClass = 1;
public static int MenuItem_actionViewClass = 2;
public static int MenuItem_alphabeticModifiers = 3;
public static int MenuItem_android_alphabeticShortcut = 4;
public static int MenuItem_android_checkable = 5;
public static int MenuItem_android_checked = 6;
public static int MenuItem_android_enabled = 7;
public static int MenuItem_android_icon = 8;
public static int MenuItem_android_id = 9;
public static int MenuItem_android_menuCategory = 10;
public static int MenuItem_android_numericShortcut = 11;
public static int MenuItem_android_onClick = 12;
public static int MenuItem_android_orderInCategory = 13;
public static int MenuItem_android_title = 14;
public static int MenuItem_android_titleCondensed = 15;
public static int MenuItem_android_visible = 16;
public static int MenuItem_contentDescription = 17;
public static int MenuItem_iconTint = 18;
public static int MenuItem_iconTintMode = 19;
public static int MenuItem_numericModifiers = 20;
public static int MenuItem_showAsAction = 21;
public static int MenuItem_tooltipText = 22;
public static int[] MenuView = { 0x0101012f, 0x0101012d, 0x01010130, 0x01010131, 0x0101012c, 0x0101012e, 0x010100ae, 0x7f0400a9, 0x7f0400c3 };
public static int MenuView_android_headerBackground = 0;
public static int MenuView_android_horizontalDivider = 1;
public static int MenuView_android_itemBackground = 2;
public static int MenuView_android_itemIconDisabledAlpha = 3;
public static int MenuView_android_itemTextAppearance = 4;
public static int MenuView_android_verticalDivider = 5;
public static int MenuView_android_windowAnimationStyle = 6;
public static int MenuView_preserveIconSpacing = 7;
public static int MenuView_subMenuArrow = 8;
public static int[] PopupWindow = { 0x010102c9, 0x01010176, 0x7f04009e };
public static int PopupWindow_android_popupAnimationStyle = 0;
public static int PopupWindow_android_popupBackground = 1;
public static int PopupWindow_overlapAnchor = 2;
public static int[] PopupWindowBackgroundState = { 0x7f0400c2 };
public static int PopupWindowBackgroundState_state_above_anchor = 0;
public static int[] RecycleListView = { 0x7f04009f, 0x7f0400a2 };
public static int RecycleListView_paddingBottomNoButtons = 0;
public static int RecycleListView_paddingTopNoTitle = 1;
public static int[] SearchView = { 0x010100da, 0x01010264, 0x01010220, 0x0101011f, 0x7f040046, 0x7f040055, 0x7f04005f, 0x7f04007b, 0x7f040083, 0x7f040089, 0x7f0400ac, 0x7f0400ad, 0x7f0400b2, 0x7f0400b3, 0x7f0400c4, 0x7f0400c9, 0x7f0400f5 };
public static int SearchView_android_focusable = 0;
public static int SearchView_android_imeOptions = 1;
public static int SearchView_android_inputType = 2;
public static int SearchView_android_maxWidth = 3;
public static int SearchView_closeIcon = 4;
public static int SearchView_commitIcon = 5;
public static int SearchView_defaultQueryHint = 6;
public static int SearchView_goIcon = 7;
public static int SearchView_iconifiedByDefault = 8;
public static int SearchView_layout = 9;
public static int SearchView_queryBackground = 10;
public static int SearchView_queryHint = 11;
public static int SearchView_searchHintIcon = 12;
public static int SearchView_searchIcon = 13;
public static int SearchView_submitBackground = 14;
public static int SearchView_suggestionRowLayout = 15;
public static int SearchView_voiceIcon = 16;
public static int[] Spinner = { 0x01010262, 0x010100b2, 0x01010176, 0x0101017b, 0x7f0400a7 };
public static int Spinner_android_dropDownWidth = 0;
public static int Spinner_android_entries = 1;
public static int Spinner_android_popupBackground = 2;
public static int Spinner_android_prompt = 3;
public static int Spinner_popupTheme = 4;
public static int[] SwitchCompat = { 0x01010125, 0x01010124, 0x01010142, 0x7f0400ba, 0x7f0400c0, 0x7f0400ca, 0x7f0400cb, 0x7f0400cd, 0x7f0400db, 0x7f0400dc, 0x7f0400dd, 0x7f0400f2, 0x7f0400f3, 0x7f0400f4 };
public static int SwitchCompat_android_textOff = 0;
public static int SwitchCompat_android_textOn = 1;
public static int SwitchCompat_android_thumb = 2;
public static int SwitchCompat_showText = 3;
public static int SwitchCompat_splitTrack = 4;
public static int SwitchCompat_switchMinWidth = 5;
public static int SwitchCompat_switchPadding = 6;
public static int SwitchCompat_switchTextAppearance = 7;
public static int SwitchCompat_thumbTextPadding = 8;
public static int SwitchCompat_thumbTint = 9;
public static int SwitchCompat_thumbTintMode = 10;
public static int SwitchCompat_track = 11;
public static int SwitchCompat_trackTint = 12;
public static int SwitchCompat_trackTintMode = 13;
public static int[] TextAppearance = { 0x010103ac, 0x01010161, 0x01010162, 0x01010163, 0x01010164, 0x01010098, 0x0101009a, 0x0101009b, 0x01010095, 0x01010097, 0x01010096, 0x7f040071, 0x7f0400ce };
public static int TextAppearance_android_fontFamily = 0;
public static int TextAppearance_android_shadowColor = 1;
public static int TextAppearance_android_shadowDx = 2;
public static int TextAppearance_android_shadowDy = 3;
public static int TextAppearance_android_shadowRadius = 4;
public static int TextAppearance_android_textColor = 5;
public static int TextAppearance_android_textColorHint = 6;
public static int TextAppearance_android_textColorLink = 7;
public static int TextAppearance_android_textSize = 8;
public static int TextAppearance_android_textStyle = 9;
public static int TextAppearance_android_typeface = 10;
public static int TextAppearance_fontFamily = 11;
public static int TextAppearance_textAllCaps = 12;
public static int[] Toolbar = { 0x010100af, 0x01010140, 0x7f04003e, 0x7f040048, 0x7f040049, 0x7f040057, 0x7f040058, 0x7f040059, 0x7f04005a, 0x7f04005b, 0x7f04005c, 0x7f040095, 0x7f040096, 0x7f040097, 0x7f04009a, 0x7f04009b, 0x7f0400a7, 0x7f0400c5, 0x7f0400c6, 0x7f0400c7, 0x7f0400e3, 0x7f0400e4, 0x7f0400e5, 0x7f0400e6, 0x7f0400e7, 0x7f0400e8, 0x7f0400e9, 0x7f0400ea, 0x7f0400eb };
public static int Toolbar_android_gravity = 0;
public static int Toolbar_android_minHeight = 1;
public static int Toolbar_buttonGravity = 2;
public static int Toolbar_collapseContentDescription = 3;
public static int Toolbar_collapseIcon = 4;
public static int Toolbar_contentInsetEnd = 5;
public static int Toolbar_contentInsetEndWithActions = 6;
public static int Toolbar_contentInsetLeft = 7;
public static int Toolbar_contentInsetRight = 8;
public static int Toolbar_contentInsetStart = 9;
public static int Toolbar_contentInsetStartWithNavigation = 10;
public static int Toolbar_logo = 11;
public static int Toolbar_logoDescription = 12;
public static int Toolbar_maxButtonHeight = 13;
public static int Toolbar_navigationContentDescription = 14;
public static int Toolbar_navigationIcon = 15;
public static int Toolbar_popupTheme = 16;
public static int Toolbar_subtitle = 17;
public static int Toolbar_subtitleTextAppearance = 18;
public static int Toolbar_subtitleTextColor = 19;
public static int Toolbar_title = 20;
public static int Toolbar_titleMargin = 21;
public static int Toolbar_titleMarginBottom = 22;
public static int Toolbar_titleMarginEnd = 23;
public static int Toolbar_titleMarginStart = 24;
public static int Toolbar_titleMarginTop = 25;
public static int Toolbar_titleMargins = 26;
public static int Toolbar_titleTextAppearance = 27;
public static int Toolbar_titleTextColor = 28;
public static int[] View = { 0x010100da, 0x01010000, 0x7f0400a0, 0x7f0400a1, 0x7f0400d9 };
public static int View_android_focusable = 0;
public static int View_android_theme = 1;
public static int View_paddingEnd = 2;
public static int View_paddingStart = 3;
public static int View_theme = 4;
public static int[] ViewBackgroundHelper = { 0x010100d4, 0x7f040035, 0x7f040036 };
public static int ViewBackgroundHelper_android_background = 0;
public static int ViewBackgroundHelper_backgroundTint = 1;
public static int ViewBackgroundHelper_backgroundTintMode = 2;
public static int[] ViewStubCompat = { 0x010100d0, 0x010100f3, 0x010100f2 };
public static int ViewStubCompat_android_id = 0;
public static int ViewStubCompat_android_inflatedId = 1;
public static int ViewStubCompat_android_layout = 2;
}
}
| [
"[email protected]"
]
| |
dd11bbe7920c5b0ceff1082bb53b906ac59c2ba6 | fb3b083a2fdb401a3feebf8b4ad673ccdc76d07b | /clever-canal-driver/src/main/java/org/clever/canal/parse/driver/mysql/utils/MSC.java | e355c9a35ca3985d5533ff05b05b2ebbd910fe45 | [
"MIT"
]
| permissive | Lzw2016/clever-canal | 85ce0d25b550e112475de1bc9966490407e7be79 | a6a317abeb7792a4fb5fc56bcbcd61ee19b80441 | refs/heads/master | 2022-10-09T22:07:23.136857 | 2021-05-27T02:35:40 | 2021-05-27T02:35:40 | 217,486,047 | 0 | 0 | MIT | 2022-10-04T23:55:08 | 2019-10-25T08:17:19 | Java | UTF-8 | Java | false | false | 886 | java | package org.clever.canal.parse.driver.mysql.utils;
/**
* MySQL Constants.<br>
* constants that is used in mysql server.<br>
*/
@SuppressWarnings({"unused", "WeakerAccess"})
public abstract class MSC {
public static final int MAX_PACKET_LENGTH = (1 << 24);
public static final int HEADER_PACKET_LENGTH_FIELD_LENGTH = 3;
public static final int HEADER_PACKET_LENGTH_FIELD_OFFSET = 0;
public static final int HEADER_PACKET_LENGTH = 4;
public static final int HEADER_PACKET_NUMBER_FIELD_LENGTH = 1;
public static final byte NULL_TERMINATED_STRING_DELIMITER = 0x00;
public static final byte DEFAULT_PROTOCOL_VERSION = 0x0a;
public static final int FIELD_COUNT_FIELD_LENGTH = 1;
public static final int EVENT_TYPE_OFFSET = 4;
public static final int EVENT_LEN_OFFSET = 9;
public static final long DEFAULT_BINLOG_FILE_START_POSITION = 4;
}
| [
"[email protected]"
]
| |
c30c6ece41af14f8252ddfd0598e5c4bdc2c03f5 | dd765c56951ffc34172fcb429e72ec3211920f2c | /gen/net/wekk/android/cheatsms/R.java | 15169cad2442565a54ae2cbd0bf5f80748f90379 | []
| no_license | whatsbcn/cheatsms_android | eacf34bc0640a0020bf7709afafe6fac2b607ff0 | 28990233f44890d4376e5231dafdfb5ce5b57697 | refs/heads/master | 2020-12-28T22:11:09.769816 | 2012-04-09T12:50:43 | 2012-04-09T12:50:43 | 68,436,052 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,608 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package net.wekk.android.cheatsms;
public final class R {
public static final class attr {
}
public static final class color {
public static final int background=0x7f060000;
public static final int watermark=0x7f060001;
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class id {
public static final int LinearLayout01=0x7f070001;
public static final int LinearLayout02=0x7f070005;
public static final int ListView01=0x7f07000e;
public static final int TextView01=0x7f070008;
public static final int TextView02=0x7f070006;
public static final int buttonEnviar=0x7f070010;
public static final int buttonFirstRunDialog=0x7f070002;
public static final int listMessages=0x7f070004;
public static final int rowContent=0x7f07000b;
public static final int rowDate=0x7f07000a;
public static final int rowFrom=0x7f070007;
public static final int rowTo=0x7f070009;
public static final int textFirstRunDialog=0x7f070000;
public static final int textNewMessage=0x7f070003;
public static final int textSmsContent=0x7f07000f;
public static final int textSmsFrom=0x7f07000c;
public static final int textSmsTo=0x7f07000d;
}
public static final class layout {
public static final int firstrun=0x7f030000;
public static final int main=0x7f030001;
public static final int message=0x7f030002;
public static final int newmessage=0x7f030003;
}
public static final class string {
public static final int app_name=0x7f050001;
public static final int buttonEnviar=0x7f050005;
public static final int firstRun=0x7f05000b;
public static final int hello=0x7f050006;
public static final int ok=0x7f05000c;
public static final int password=0x7f050008;
public static final int passwordDesc=0x7f05000a;
public static final int smsContent=0x7f050004;
public static final int smsFrom=0x7f050002;
public static final int smsTo=0x7f050003;
public static final int title=0x7f050000;
public static final int user=0x7f050007;
public static final int userDesc=0x7f050009;
}
public static final class xml {
public static final int prefs=0x7f040000;
}
}
| [
"[email protected]"
]
| |
317cd2263a05c8159d1198b19bcce3096394a9bd | 0dbb686651f7749d27f7486a07fbdc89a5e6e9c6 | /reply/src/main/java/com/serverless/ApiGatewayResponse.java | acc058f241bbfec25081755c66255117794348ae | []
| no_license | moritalous/linebot-serverless-blueprint-java | 76989852b415c372ee532871f24a8d8474f278c9 | b5be160be76715037535fcd0a24354f1e7bd126b | refs/heads/master | 2021-01-17T23:17:31.728695 | 2017-03-09T10:09:05 | 2017-03-09T10:09:05 | 84,215,338 | 1 | 1 | null | 2017-03-09T10:09:06 | 2017-03-07T15:30:12 | Java | UTF-8 | Java | false | false | 3,965 | java | package com.serverless;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.log4j.Logger;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.Collections;
import java.util.Map;
public class ApiGatewayResponse {
private final int statusCode;
private final String body;
private final Map<String, String> headers;
private final boolean isBase64Encoded;
public ApiGatewayResponse(int statusCode, String body, Map<String, String> headers, boolean isBase64Encoded) {
this.statusCode = statusCode;
this.body = body;
this.headers = headers;
this.isBase64Encoded = isBase64Encoded;
}
public static Builder builder() {
return new Builder();
}
public int getStatusCode() {
return statusCode;
}
public String getBody() {
return body;
}
public Map<String, String> getHeaders() {
return headers;
}
// API Gateway expects the property to be called "isBase64Encoded" => isIs
public boolean isIsBase64Encoded() {
return isBase64Encoded;
}
public static class Builder {
private static final Logger LOG = Logger.getLogger(Builder.class);
private static final ObjectMapper objectMapper = new ObjectMapper();
private int statusCode = 200;
private Map<String, String> headers = Collections.emptyMap();
private String rawBody;
private Object objectBody;
private byte[] binaryBody;
private boolean base64Encoded;
public Builder setStatusCode(int statusCode) {
this.statusCode = statusCode;
return this;
}
public Builder setHeaders(Map<String, String> headers) {
this.headers = headers;
return this;
}
/**
* Builds the {@link ApiGatewayResponse} using the passed raw body string.
*/
public Builder setRawBody(String rawBody) {
this.rawBody = rawBody;
return this;
}
/**
* Builds the {@link ApiGatewayResponse} using the passed object body
* converted to JSON.
*/
public Builder setObjectBody(Object objectBody) {
this.objectBody = objectBody;
return this;
}
/**
* Builds the {@link ApiGatewayResponse} using the passed binary body
* encoded as base64. {@link #setBase64Encoded(boolean)
* setBase64Encoded(true)} will be in invoked automatically.
*/
public Builder setBinaryBody(byte[] binaryBody) {
this.binaryBody = binaryBody;
setBase64Encoded(true);
return this;
}
/**
* A binary or rather a base64encoded responses requires
* <ol>
* <li>"Binary Media Types" to be configured in API Gateway
* <li>a request with an "Accept" header set to one of the "Binary Media
* Types"
* </ol>
*/
public Builder setBase64Encoded(boolean base64Encoded) {
this.base64Encoded = base64Encoded;
return this;
}
public ApiGatewayResponse build() {
String body = null;
if (rawBody != null) {
body = rawBody;
} else if (objectBody != null) {
try {
body = objectMapper.writeValueAsString(objectBody);
} catch (JsonProcessingException e) {
LOG.error("failed to serialize object", e);
throw new RuntimeException(e);
}
} else if (binaryBody != null) {
body = new String(Base64.getEncoder().encode(binaryBody), StandardCharsets.UTF_8);
}
return new ApiGatewayResponse(statusCode, body, headers, base64Encoded);
}
}
}
| [
"[email protected]"
]
| |
2fe246a48ede8eedb3f5595e3108f196f4ca4ea1 | a97138b55c34a9c3454fdcb64be10735cacf8085 | /HackerRank/Interview/SockMerchant/Main.java | 818ab5812289f633de50a42e7e00f59c43e9cbc5 | []
| no_license | siddharththakur26/hackerRank | b4f960dd40713c3c18de89ac864996c794a06811 | b0c002dd3e5b93809a2a2ab6ece63bf86056e351 | refs/heads/master | 2021-11-30T00:07:35.014725 | 2021-11-23T16:10:39 | 2021-11-23T16:10:39 | 169,684,621 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 550 | java | package HackerRank.Interview.SockMerchant;
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
int ar[] ={10, 20, 20, 10, 10, 30, 50, 10};
int n = ar.length;
int count=0;
Arrays.sort(ar);
for (int i = 0; i< ar.length; i++){
for (int j =i+1 ; j< ar.length; j++){
if (ar[i] == ar[j]){
count ++;
i++;
break;
}
}
}
System.out.println(count);
}
}
| [
"[email protected]"
]
| |
409ad8ad5ec35b17b87a1698b886adc12ac99fd0 | 3dc78b726ec091b5d22940564973d1dfd91e7eac | /src/test/java/hello/core/singleton/StatefulServiceTest.java | 5ca0ca3ebef1b87460b97b2a516a4f8cd58e846a | []
| no_license | nimkoes/inflearn_spring_core_basic_KYH | aa753095adc080b6e428d65acad345e810bcc8c6 | 1ec5800aaa6c1c874ff014e87134bbca3c649838 | refs/heads/master | 2022-12-23T20:36:56.746960 | 2020-09-22T08:18:06 | 2020-09-22T08:18:06 | 297,354,783 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,251 | java | package hello.core.singleton;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import static org.assertj.core.api.Assertions.assertThat;
class StatefulServiceTest {
@Test
void statefulServiceSingleton() {
ApplicationContext ac = new AnnotationConfigApplicationContext(TestConfig.class);
StatefulService statefulService1 = ac.getBean(StatefulService.class);
StatefulService statefulService2 = ac.getBean(StatefulService.class);
//ThreadA : A사용자 10000원 주문
statefulService1.order("userA", 10000);
//ThreadB : B사용자 20000원 주문
statefulService2.order("userB", 20000);
//ThreadA : 사용자A 주문 금액 조회
int price = statefulService1.getPrice();
System.out.println("price : " + price);
assertThat(statefulService1.getPrice()).isEqualTo(20000);
}
static class TestConfig {
@Bean
public StatefulService statefulService() {
return new StatefulService();
}
}
} | [
"[email protected]"
]
| |
6f7abd2b6a4e441d84a0a6b967c6452ecc3f7131 | 1d0ec91c86ca7a0bad92603dfb5b0960afd2b89f | /src/durablefurniturejavaproject/Bussiness/ProductBill.java | 239b97c67baad055a4d798423acd08464011cf9a | []
| no_license | rockle2000/durable_furniture_prj | 4964ea8fc3871f19a0e91f399134a189560610ed | 7ebd6e68674b9877ba992d2341f2c62c96711894 | refs/heads/master | 2023-02-11T03:25:14.075635 | 2021-01-08T16:39:30 | 2021-01-08T16:39:30 | 320,586,622 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,542 | 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 durablefurniturejavaproject.Bussiness;
import durablefurniturejavaproject.DataAccess.SqlDataAcess;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
*
* @author Admin
*/
public class ProductBill {
int BillId;
int Productid;
int Quantity;
public ProductBill(int BillId, int Productid, int Quantity) {
this.BillId = BillId;
this.Productid = Productid;
this.Quantity = Quantity;
}
SqlDataAcess db =new SqlDataAcess();
public ProductBill() {
}
public boolean DeleteProductBill(int BillId) throws SQLException {
String sql = "Delete from productbill where BillId = ?";
PreparedStatement stmt = null;
db.OpenConnection();
stmt = db.connection.prepareCall(sql);
stmt.setInt(1, BillId);
int res = stmt.executeUpdate();
db.CloseConnection();
return res == 1;
}
public int getBillId() {
return BillId;
}
public void setBillId(int BillId) {
this.BillId = BillId;
}
public int getProductid() {
return Productid;
}
public void setProductid(int Productid) {
this.Productid = Productid;
}
public int getQuantity() {
return Quantity;
}
public void setQuantity(int Quantity) {
this.Quantity = Quantity;
}
}
| [
"[email protected]"
]
| |
e42e99ff6931506a0e1d33881c5075e11458debd | 08180f91cdee97e969aeaabcfe3889f7d4b68263 | /9/src/main/java/app/FamilyServiceDao.java | b9701f0a384c76944d5c2f5bdafaf72e3daf3738 | []
| no_license | SergiiCini/Homeworks.Java | ae88a2d210adf8f1217879167a248a4307038e4c | 3e6aaa40078b792e9fbc0f9ed6b76e03eba326dd | refs/heads/master | 2023-02-21T19:05:20.066079 | 2021-01-17T11:06:27 | 2021-01-17T11:06:27 | 316,233,163 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 990 | java | package app;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
public interface FamilyServiceDao {
public List<Family> getAllFamilies();
public <T> void printData(List<T> data);
public void displayAllFamilies();
public List<Family> getFamiliesBiggerThan(int numberOfFamilyMembers);
public List<Family> getFamiliesLessThan(int numberOfFamilyMembers);
public int countFamiliesWithMemberNumber(int numberOfFamilyMembers);
public Family createNewFamily(Human mother, Human father);
public boolean deleteFamilyByIndex(int index);
public Family bornChild(Family family, String sonsName, String daughterName) throws ParseException;
public Family adoptChild(Family family, Human child);
public void deleteAllChildrenOlderThen(int year);
public int count();
public Family getFamilyById(int familyIndex);
public ArrayList<Pet> getPet(int familyIndex);
public boolean addPet(int familyIndex, Pet pet);
}
| [
"[email protected]"
]
| |
86e64a9fb9bf93f7d5917438f8a5f2832083d8ba | 689ad7cd25f9d0016107842d93e4fd4b7d67c328 | /CarAppAPI/src/main/java/com/mycompany/carappapi/core/mapper/CarMapper.java | 3d5abbff1b11add9ccf6650582853175dd5c31ca | []
| no_license | daesungjin/CarApplicationAPI_Android | 9a87dd8444762ec48d7cf1c74cf8cae49d4ae45c | eb3031b843e48f8265e64ba480aec761a55ad5c7 | refs/heads/master | 2022-06-23T02:09:48.177231 | 2019-05-27T16:25:41 | 2019-05-27T16:25:41 | 130,620,655 | 0 | 0 | null | 2022-06-20T23:25:47 | 2018-04-23T00:44:43 | HTML | UTF-8 | Java | false | false | 1,393 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.mycompany.carappapi.core.mapper;
import com.mycompany.carappapi.core.Car;
import com.mycompany.carappapi.core.CarInfo;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.tweak.ResultSetMapper;
/**
*
* @author User
*/
public class CarMapper implements ResultSetMapper<Car>{
Car car;
HashMap<String,Integer> tempMap = new HashMap<>();
@Override
public Car map(int i, ResultSet rs, StatementContext sc) throws SQLException {
if(tempMap.get(rs.getString("vin"))==null){
car = new Car();
car.setCarName(rs.getString("name"));
car.setVin(rs.getString("vin"));
tempMap.put(rs.getString("vin"), 1);
CarInfo carInfo = new CarInfo();
carInfo.setCategory(rs.getString("category"));
carInfo.setInfo(rs.getString("info"));
car.addCarInfo(carInfo);
return car;
}
CarInfo carInfo = new CarInfo();
carInfo.setCategory(rs.getString("category"));
carInfo.setInfo(rs.getString("info"));
car.addCarInfo(carInfo);
return null;
}
}
| [
"[email protected]"
]
| |
e1d499f8cfad4e5b632cd077656ba12d5204b40d | ea4228b7cd2238fd6f8bc47e6e71ccb53b9a9ad0 | /DAOProj8-NamedParameterJdbcTemplate/src/main/java/com/nt/dto/BookDTO.java | c33edc2439f185a9294f4d4e092922baadd2c7a0 | []
| no_license | PrimeCaster/NITSP612Lockdown | 5219de6918daf1b860127a704a3bb703e6c5556e | b1a2db3b22eea9250c9d41c70ea6de66bc70d28b | refs/heads/master | 2023-01-05T05:49:59.532155 | 2020-11-04T06:21:23 | 2020-11-04T06:21:23 | 297,062,694 | 3 | 0 | null | 2020-11-04T06:21:24 | 2020-09-20T11:37:14 | null | UTF-8 | Java | false | false | 1,431 | java | package com.nt.dto;
import java.io.Serializable;
public class BookDTO implements Serializable{
private int bookId;
private String bookName;
private String author;
private float price;
private String publisher;
private String status;
private String category;
public int getBookId() {
return bookId;
}
public void setBookId(int bookId) {
this.bookId = bookId;
}
public String getBookName() {
return bookName;
}
public void setBookName(String bookName) {
this.bookName = bookName;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public float getPrice() {
return price;
}
public void setPrice(float price) {
this.price = price;
}
public String getPublisher() {
return publisher;
}
public void setPublisher(String publisher) {
this.publisher = publisher;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
@Override
public String toString() {
return "BookStoreDTO [bookId=" + bookId + ", bookName=" + bookName + ", author=" + author + ", price=" + price
+ ", publisher=" + publisher + ", status=" + status + ", category=" + category + "]";
}
}
| [
"Admin@DESKTOP-2VT4A0N"
]
| Admin@DESKTOP-2VT4A0N |
c1b6da96eec6050e9780bbc1b24c4294d1a9b7ab | d7af49f76296ddbd9b01dbcd8aa40c05bb3d79a8 | /hedwig-client/src/main/java/org/apache/hedwig/client/netty/impl/simple/SimpleSubscribeResponseHandler.java | 2f671b9b94ef5a3ad0cfa822e8f34423b4f4d53b | [
"Apache-2.0"
]
| permissive | wobo-abhishek-zz/bookkeeper | d0e1f7d90b8e89ace1975c78bdbdabf11e1f7db8 | acbdfe6c3eb371d84b98dfad9fdd5b6f1a9ab4dc | refs/heads/master | 2022-04-30T04:06:51.469296 | 2013-03-05T22:03:09 | 2013-03-05T22:03:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 27,969 | 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.hedwig.client.netty.impl.simple;
import java.net.InetSocketAddress;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import com.google.protobuf.ByteString;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelFutureListener;
import org.apache.hedwig.client.api.MessageHandler;
import org.apache.hedwig.client.conf.ClientConfiguration;
import org.apache.hedwig.client.data.MessageConsumeData;
import org.apache.hedwig.client.data.PubSubData;
import org.apache.hedwig.client.data.TopicSubscriber;
import org.apache.hedwig.client.exceptions.AlreadyStartDeliveryException;
import org.apache.hedwig.client.handlers.SubscribeResponseHandler;
import org.apache.hedwig.client.handlers.MessageDeliveryHandler;
import org.apache.hedwig.client.netty.HChannelManager;
import org.apache.hedwig.client.netty.HChannel;
import org.apache.hedwig.client.netty.NetUtils;
import org.apache.hedwig.client.netty.FilterableMessageHandler;
import org.apache.hedwig.client.netty.impl.HChannelImpl;
import org.apache.hedwig.exceptions.PubSubException;
import org.apache.hedwig.exceptions.PubSubException.ClientAlreadySubscribedException;
import org.apache.hedwig.exceptions.PubSubException.ClientNotSubscribedException;
import org.apache.hedwig.exceptions.PubSubException.ServiceDownException;
import org.apache.hedwig.filter.ClientMessageFilter;
import org.apache.hedwig.protocol.PubSubProtocol.Message;
import org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId;
import org.apache.hedwig.protocol.PubSubProtocol.PubSubRequest;
import org.apache.hedwig.protocol.PubSubProtocol.PubSubResponse;
import org.apache.hedwig.protocol.PubSubProtocol.ResponseBody;
import org.apache.hedwig.protocol.PubSubProtocol.SubscribeResponse;
import org.apache.hedwig.protocol.PubSubProtocol.SubscriptionEvent;
import org.apache.hedwig.protocol.PubSubProtocol.SubscriptionPreferences;
import org.apache.hedwig.protocol.PubSubProtocol.StatusCode;
import org.apache.hedwig.protoextensions.SubscriptionStateUtils;
import org.apache.hedwig.util.Callback;
import static org.apache.hedwig.util.VarArgs.va;
public class SimpleSubscribeResponseHandler extends SubscribeResponseHandler {
private static Logger logger = LoggerFactory.getLogger(SimpleSubscribeResponseHandler.class);
// Member variables used when this ResponseHandler is for a Subscribe
// channel. We need to be able to consume messages sent back to us from
// the server, and to also recreate the Channel connection if it ever goes
// down. For that, we need to store the original PubSubData for the
// subscribe request, and also the MessageHandler that was registered when
// delivery of messages started for the subscription.
private volatile PubSubData origSubData;
private volatile TopicSubscriber origTopicSubscriber;
private SubscriptionPreferences preferences;
private Channel subscribeChannel;
// Counter for the number of consumed messages so far to buffer up before we
// send the Consume message back to the server along with the last/largest
// message seq ID seen so far in that batch.
private AtomicInteger numConsumedMessagesInBuffer = new AtomicInteger(0);
private MessageSeqId lastMessageSeqId;
// The Message delivery handler that is used to deliver messages without locking.
final private MessageDeliveryHandler deliveryHandler = new MessageDeliveryHandler();
// Set to store all of the outstanding subscribed messages that are pending
// to be consumed by the client app's MessageHandler. If this ever grows too
// big (e.g. problem at the client end for message consumption), we can
// throttle things by temporarily setting the Subscribe Netty Channel
// to not be readable. When the Set has shrunk sufficiently, we can turn the
// channel back on to read new messages.
final private Set<Message> outstandingMsgSet;
private SimpleHChannelManager sChannelManager;
protected SimpleSubscribeResponseHandler(ClientConfiguration cfg,
HChannelManager channelManager) {
super(cfg, channelManager);
sChannelManager = (SimpleHChannelManager) channelManager;
// Create the Set (from a concurrent hashmap) to keep track
// of outstanding Messages to be consumed by the client app. At this
// stage, delivery for that topic hasn't started yet so creation of
// this Set should be thread safe. We'll create the Set with an initial
// capacity equal to the configured parameter for the maximum number of
// outstanding messages to allow. The load factor will be set to
// 1.0f which means we'll only rehash and allocate more space if
// we ever exceed the initial capacity. That should be okay
// because when that happens, things are slow already and piling
// up on the client app side to consume messages.
outstandingMsgSet = Collections.newSetFromMap(
new ConcurrentHashMap<Message,Boolean>(
cfg.getMaximumOutstandingMessages(), 1.0f));
origTopicSubscriber = null;
}
protected HChannelManager getHChannelManager() {
return this.sChannelManager;
}
protected ClientConfiguration getConfiguration() {
return cfg;
}
@Override
public void handleResponse(PubSubResponse response, PubSubData pubSubData,
Channel channel) throws Exception {
// If this was not a successful response to the Subscribe request, we
// won't be using the Netty Channel created so just close it.
if (!response.getStatusCode().equals(StatusCode.SUCCESS)) {
HChannelImpl.getHChannelHandlerFromChannel(channel).closeExplicitly();
channel.close();
}
if (logger.isDebugEnabled()) {
logger.debug("Handling a Subscribe response: {}, pubSubData: {}, host: {}.",
va(response, pubSubData, NetUtils.getHostFromChannel(channel)));
}
switch (response.getStatusCode()) {
case SUCCESS:
// Store the original PubSubData used to create this successful
// Subscribe request.
origSubData = pubSubData;
origTopicSubscriber = new TopicSubscriber(pubSubData.topic,
pubSubData.subscriberId);
synchronized(this) {
// For successful Subscribe requests, store this Channel locally
// and set it to not be readable initially.
// This way we won't be delivering messages for this topic
// subscription until the client explicitly says so.
subscribeChannel = channel;
subscribeChannel.setReadable(false);
if (response.hasResponseBody()) {
ResponseBody respBody = response.getResponseBody();
if (respBody.hasSubscribeResponse()) {
SubscribeResponse resp = respBody.getSubscribeResponse();
if (resp.hasPreferences()) {
preferences = resp.getPreferences();
if (logger.isDebugEnabled()) {
logger.debug("Receive subscription preferences for {} : {}",
va(origTopicSubscriber,
SubscriptionStateUtils.toString(preferences)));
}
}
}
}
// Store the mapping for the TopicSubscriber to the Channel.
// This is so we can control the starting and stopping of
// message deliveries from the server on that Channel. Store
// this only on a successful ack response from the server.
sChannelManager.storeSubscriptionChannel(origTopicSubscriber,
channel);
// pass original subscription data to message delivery handler
deliveryHandler.setOrigSubData(origSubData);
}
// Response was success so invoke the callback's operationFinished
// method.
pubSubData.getCallback().operationFinished(pubSubData.context, null);
break;
case CLIENT_ALREADY_SUBSCRIBED:
// For Subscribe requests, the server says that the client is
// already subscribed to it.
pubSubData.getCallback().operationFailed(pubSubData.context, new ClientAlreadySubscribedException(
"Client is already subscribed for topic: " + pubSubData.topic.toStringUtf8() + ", subscriberId: "
+ pubSubData.subscriberId.toStringUtf8()));
break;
case SERVICE_DOWN:
// Response was service down failure so just invoke the callback's
// operationFailed method.
pubSubData.getCallback().operationFailed(pubSubData.context, new ServiceDownException(
"Server responded with a SERVICE_DOWN status"));
break;
case NOT_RESPONSIBLE_FOR_TOPIC:
// Redirect response so we'll need to repost the original Subscribe
// Request
handleRedirectResponse(response, pubSubData, channel);
break;
default:
// Consider all other status codes as errors, operation failed
// cases.
logger.error("Unexpected error response from server for PubSubResponse: {}", response);
pubSubData.getCallback().operationFailed(pubSubData.context, new ServiceDownException(
"Server responded with a status code of: " + response.getStatusCode()));
break;
}
}
@Override
public void handleSubscribeMessage(PubSubResponse response) {
if (logger.isDebugEnabled()) {
logger.debug("Handling a Subscribe message in response: {}, {}",
va(response, origTopicSubscriber));
}
// Simply call asyncMessageDeliver on this message. asyncMessageDeliver will take care of queuing the message
// if no message handler is available.
asyncMessageDeliver(origTopicSubscriber, response.getMessage());
}
@Override
public void handleSubscriptionEvent(ByteString topic, ByteString subscriberId,
SubscriptionEvent event) {
Channel channel;
synchronized (this) {
channel = subscribeChannel;
}
if (null == channel) {
logger.warn("No subscription channel found when receiving subscription event {} for (topic:{}, subscriber:{}).",
va(event, topic, subscriberId));
return;
}
processSubscriptionEvent(event, NetUtils.getHostFromChannel(channel), channel);
}
private synchronized void closeSubscribeChannel() {
if (null != subscribeChannel) {
subscribeChannel.close();
}
}
@Override
protected void asyncMessageDeliver(TopicSubscriber topicSubscriber,
Message message) {
if (logger.isDebugEnabled()) {
logger.debug("Call the client app's MessageHandler asynchronously to deliver the message {} to {}",
va(message, topicSubscriber));
}
synchronized (this) {
// Add this "pending to be consumed" message to the outstandingMsgSet.
outstandingMsgSet.add(message);
// Check if we've exceeded the max size for the outstanding message set.
if (outstandingMsgSet.size() >= cfg.getMaximumOutstandingMessages()
&& subscribeChannel.isReadable()) {
// Too many outstanding messages so throttle it by setting the Netty
// Channel to not be readable.
if (logger.isDebugEnabled()) {
logger.debug("Too many outstanding messages ({}) for {} so throttling the subscribe netty Channel",
outstandingMsgSet.size(), topicSubscriber);
}
subscribeChannel.setReadable(false);
}
}
MessageConsumeData messageConsumeData =
new MessageConsumeData(topicSubscriber, message, sChannelManager.getConsumeCallback());
try {
deliveryHandler.offerAndOptionallyDeliver(messageConsumeData);
} catch (MessageDeliveryHandler.MessageDeliveryException e) {
logger.error("Caught exception while trying to deliver messages to the message handler." + e);
// We close the channel so that this subscription is closed and retried later resulting in a new response handler.
// We want the state to be cleared so we don't close the channel explicitly.
closeSubscribeChannel();
}
}
@Override
protected synchronized void messageConsumed(TopicSubscriber topicSubscriber,
Message message) {
logger.debug("Message has been successfully consumed by the client app for message: {}, {}",
message, topicSubscriber);
// Remove this consumed message from the outstanding Message Set.
outstandingMsgSet.remove(message);
// If we had throttled delivery and the outstanding message number is below the configured threshold,
// set the channel to readable.
if (!subscribeChannel.isReadable() && outstandingMsgSet.size() <= cfg.getConsumedMessagesBufferSize()
* cfg.getReceiveRestartPercentage() / 100.0) {
logger.info("Message consumption has caught up so okay to turn off throttling of messages on the subscribe channel for {}",
topicSubscriber);
subscribeChannel.setReadable(true);
}
// Update these variables only if we are auto-sending consume
// messages to the server. Otherwise the onus is on the client app
// to call the Subscriber consume API to let the server know which
// messages it has successfully consumed.
if (cfg.isAutoSendConsumeMessageEnabled()) {
lastMessageSeqId = message.getMsgId();
// We just need to keep a count of the number of messages consumed
// and the largest/latest msg ID seen so far in this batch. Messages
// should be delivered in order and without gaps.
if (numConsumedMessagesInBuffer.incrementAndGet() == cfg.getConsumedMessagesBufferSize()) {
if (logger.isDebugEnabled()) {
logger.debug("Sending consume message to hedwig server for topic:" + origSubData.topic.toStringUtf8()
+ ", subscriber:" + origSubData.subscriberId.toStringUtf8() + " with message sequence id:"
+ lastMessageSeqId);
}
consume(topicSubscriber, lastMessageSeqId);
numConsumedMessagesInBuffer.addAndGet(-(cfg.getConsumedMessagesBufferSize()));
}
}
}
@Override
public void startDelivery(final TopicSubscriber topicSubscriber,
MessageHandler messageHandler)
throws ClientNotSubscribedException, AlreadyStartDeliveryException {
if (logger.isDebugEnabled()) {
logger.debug("Start delivering message for {} using message handler {}",
va(topicSubscriber, messageHandler));
}
if (!hasSubscription(topicSubscriber)) {
throw new ClientNotSubscribedException("Client is not yet subscribed to " + topicSubscriber);
}
synchronized (this) {
MessageHandler existedMsgHandler = deliveryHandler.getMessageHandler();
if (null != existedMsgHandler) {
throw new AlreadyStartDeliveryException("A message handler " + existedMsgHandler
+ " has been started for " + topicSubscriber);
}
// instantiante a message handler
if (null != messageHandler &&
messageHandler instanceof FilterableMessageHandler) {
FilterableMessageHandler filterMsgHandler =
(FilterableMessageHandler) messageHandler;
// pass subscription preferences to message filter
if (null == preferences) {
// no preferences means talking to an old version hub server
logger.warn("Start delivering messages with filter but no subscription "
+ "preferences found. It might due to talking to an old version"
+ " hub server.");
// use the original message handler.
messageHandler = filterMsgHandler.getMessageHandler();
} else {
if (logger.isDebugEnabled()) {
logger.debug("Start delivering messages with filter on {}, preferences: {}",
va(topicSubscriber,
SubscriptionStateUtils.toString(preferences)));
}
ClientMessageFilter msgFilter = filterMsgHandler.getMessageFilter();
msgFilter.setSubscriptionPreferences(
topicSubscriber.getTopic(), topicSubscriber.getSubscriberId(),
preferences);
}
}
}
try {
deliveryHandler.setMessageHandlerOptionallyDeliver(messageHandler);
} catch (MessageDeliveryHandler.MessageDeliveryException e) {
logger.error("Error while starting delivering outstanding messages : ", e);
closeSubscribeChannel();
// if failed to deliver messages, re-estabilish subscription channel
// we don't need to go thru following logic to make channel readable
return;
}
synchronized (this) {
// Now make the TopicSubscriber Channel readable (it is set to not be
// readable when the initial subscription is done). Note that this is an
// asynchronous call. If this fails (not likely), the futureListener
// will just log an error message for now.
ChannelFuture future = subscribeChannel.setReadable(true);
future.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (!future.isSuccess()) {
logger.error("Unable to make subscriber Channel readable in startDelivery call for {}",
topicSubscriber);
}
}
});
}
}
@Override
public void stopDelivery(final TopicSubscriber topicSubscriber)
throws ClientNotSubscribedException {
if (logger.isDebugEnabled()) {
logger.debug("Stop delivering messages for {}", topicSubscriber);
}
if (!hasSubscription(topicSubscriber)) {
throw new ClientNotSubscribedException("Client is not yet subscribed to " + topicSubscriber);
}
try {
deliveryHandler.setMessageHandlerOptionallyDeliver(null);
} catch (MessageDeliveryHandler.MessageDeliveryException e) {
logger.error("Error while stopping delivering outstanding messages : ", e);
closeSubscribeChannel();
// if failed, re-estabilish subscription channel
// we don't need to go thru following logic to make channel unreadable
return;
}
synchronized (this) {
// Now make the TopicSubscriber channel not-readable. This will buffer
// up messages if any are sent from the server. Note that this is an
// asynchronous call. If this fails (not likely), the futureListener
// will just log an error message for now.
ChannelFuture future = subscribeChannel.setReadable(false);
future.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (!future.isSuccess()) {
logger.error("Unable to make subscriber Channel not readable in stopDelivery call for {}",
topicSubscriber);
}
}
});
}
}
@Override
public boolean hasSubscription(TopicSubscriber topicSubscriber) {
if (null == origTopicSubscriber) {
return false;
} else {
return origTopicSubscriber.equals(topicSubscriber);
}
}
@Override
public void asyncCloseSubscription(final TopicSubscriber topicSubscriber,
final Callback<ResponseBody> callback,
final Object context) {
// nothing to do just clear status
// channel manager takes the responsibility to close the channel
callback.operationFinished(context, (ResponseBody)null);
}
@Override
public synchronized void consume(final TopicSubscriber topicSubscriber,
final MessageSeqId messageSeqId) {
PubSubRequest.Builder pubsubRequestBuilder =
NetUtils.buildConsumeRequest(sChannelManager.nextTxnId(),
topicSubscriber, messageSeqId);
// For Consume requests, we will send them from the client in a fire and
// forget manner. We are not expecting the server to send back an ack
// response so no need to register this in the ResponseHandler. There
// are no callbacks to invoke since this isn't a client initiated
// action. Instead, just have a future listener that will log an error
// message if there was a problem writing the consume request.
if (logger.isDebugEnabled()) {
logger.debug("Writing a Consume request to host: {} with messageSeqId: {} for {}",
va(NetUtils.getHostFromChannel(subscribeChannel),
messageSeqId, topicSubscriber));
}
ChannelFuture future = subscribeChannel.write(pubsubRequestBuilder.build());
future.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (!future.isSuccess()) {
logger.error("Error writing a Consume request to host: {} with messageSeqId: {} for {}",
va(NetUtils.getHostFromChannel(subscribeChannel),
messageSeqId, topicSubscriber));
}
}
});
}
@Override
public void onChannelDisconnected(InetSocketAddress host,
Channel channel) {
if (origTopicSubscriber == null) {
return;
}
processSubscriptionEvent(SubscriptionEvent.TOPIC_MOVED, host, channel);
}
private void processSubscriptionEvent(final SubscriptionEvent event, InetSocketAddress host,
final Channel channel) {
if (SubscriptionEvent.TOPIC_MOVED != event &&
SubscriptionEvent.SUBSCRIPTION_FORCED_CLOSED != event) {
logger.warn("Ignore subscription event {} received from channel {}.",
event, channel);
return;
}
if (SubscriptionEvent.TOPIC_MOVED == event) {
sChannelManager.clearHostForTopic(origTopicSubscriber.getTopic(), host);
}
// clear subscription status
sChannelManager.asyncCloseSubscription(origTopicSubscriber, new Callback<ResponseBody>() {
@Override
public void operationFinished(Object ctx, ResponseBody result) {
finish();
}
@Override
public void operationFailed(Object ctx, PubSubException exception) {
finish();
}
private void finish() {
// Since the connection to the server host that was responsible
// for the topic died, we are not sure about the state of that
// server. Resend the original subscribe request data to the default
// server host/VIP. Also clear out all of the servers we've
// contacted or attempted to from this request as we are starting a
// "fresh" subscribe request.
origSubData.clearServersList();
// do resubscribe if the subscription enables it
if (origSubData.options.getEnableResubscribe()) {
// Set a new type of VoidCallback for this async call. We need this
// hook so after the subscribe reconnect has completed, delivery for
// that topic subscriber should also be restarted (if it was that
// case before the channel disconnect).
final long retryWaitTime = cfg.getSubscribeReconnectRetryWaitTime();
SubscribeReconnectCallback reconnectCb =
new SubscribeReconnectCallback(origTopicSubscriber,
origSubData,
sChannelManager,
retryWaitTime);
origSubData.setCallback(reconnectCb);
origSubData.context = null;
// Clear the shouldClaim flag
origSubData.shouldClaim = false;
logger.debug("Reconnect {}'s subscription channel with origSubData {}",
origTopicSubscriber, origSubData);
sChannelManager.submitOpToDefaultServer(origSubData);
} else {
logger.info("Subscription channel {} for ({}) is disconnected.",
channel, origTopicSubscriber);
sChannelManager.getSubscriptionEventEmitter().emitSubscriptionEvent(
origSubData.topic, origSubData.subscriberId, event);
}
}
}, null);
}
}
| [
"[email protected]"
]
| |
7ca6a8a10e5c02e70f914df9007373dc817afad4 | bf97d2e27b66e2f8b4580ac400a2073b14c6bf63 | /20201027/LoopInLoop.java | 87b6e048bda02df9980a1668546cb021346ea0d5 | []
| no_license | rkgus7736/java | d46bd64f25146e0b32d6849320d7cb7538b5cafd | 6e532e1266d4286807684d64092658756182da5c | refs/heads/master | 2023-02-12T14:02:50.095347 | 2021-01-11T15:13:20 | 2021-01-11T15:13:20 | 328,702,791 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 535 | java |
public class LoopInLoop {
//구구단 2단부터 9단 출력
public static void main(String[] args) {
for(int dan=2;dan<10;dan++) {
System.out.println(dan+"단");
//1~9까지 곱한 결과
for(int is=1;is<10;is++) {
System.out.println(dan + " * "+ is + " = " + dan * is);
}
}
int dan=1;
int is = 1;
while(dan <10) {
System.out.println(dan + "단");
while(is < 10) {
//1~9까지 곱한 결과
System.out.println(dan + " * "+ is + " = " + dan * is);
is++;
}
dan++;
}
}
}
| [
"[email protected]"
]
| |
b2adbfdc2c0ca8172bb5525358e610979b0ceabc | 29274b62a179629d690a2f352d314b5d1e6b35cd | /app/src/main/java/com/example/administrator/read/fenlei/book_info.java | d78d4ada4aa4e6db9c566e9253300a05e95937b3 | []
| no_license | Kini0804/read | aaaee8e1c3852eaa5dc9d0641f980f87dd482b17 | a1373b53b6c16b294b1df5539c2da99994df726b | refs/heads/master | 2023-02-03T22:13:40.429413 | 2020-12-24T11:33:43 | 2020-12-24T11:33:43 | 323,832,144 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,293 | java | package com.example.administrator.read.fenlei;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.example.administrator.read.R;
import com.example.administrator.read.article_read;
import com.example.administrator.read.internet.internet;
import com.example.administrator.read.login.page_login;
import com.example.administrator.read.pdfread;
import com.example.administrator.read.tongyong.url_imgview;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
public class book_info extends AppCompatActivity {
int flag;
SectionsPagerAdapter mm;
Handler handler;
ArrayList<Fragment> datas=new ArrayList<>();;
ViewPager mViewPager;
int book_id;
String book_name;
String book_author;
String book_introduction;
String book_pic;
String article_url;
ArrayList<String> user_name=new ArrayList<String>();
ArrayList<String> post_context=new ArrayList<String>();
ArrayList<Integer> chapter_id=new ArrayList<Integer>();
ArrayList<String> chapter_name=new ArrayList<String>();
ArrayList<String> chapter_context=new ArrayList<String>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bookinfo);
Intent intent=getIntent();
handler=new Handler();
flag=intent.getIntExtra("flag",0);
book_id=intent.getIntExtra("book_id",0);
final String urlStr="http://122.114.237.201/read/bookinfo";
final String urlStr_article="http://122.114.237.201/read/Articleinfo";
final String urlStr2="http://122.114.237.201/read/chapters";
if(book_id==0)
{
Toast.makeText(this,"网络请求失败!",Toast.LENGTH_SHORT).show();
}
else {
if(flag==1) {
new Thread() {
@Override
public void run() {
String result = internet.getbookinfo(urlStr, book_id);
String result2 = internet.getbookinfo(urlStr2, book_id);
System.out.println(result);
System.out.println(result2);
if (result.equals("") || result2.equals("")) {
Looper.prepare();
Toast.makeText(book_info.this, "请求失败!", Toast.LENGTH_SHORT).show();
Looper.loop();
} else {
try {
JSONObject result_json = new JSONObject(result);
JSONArray bookinfo = result_json.getJSONArray("bookinfo");
JSONObject book = bookinfo.getJSONObject(0);
book_name = book.getString("bookName");
book_author = book.getString("bookAuthor");
book_introduction = book.getString("bookIntroduction");
book_pic = book.getString("bookPicture");
JSONArray post = result_json.getJSONArray("post");
for (int i = 0; i < post.length(); i++) {
JSONObject object = post.getJSONObject(i);
user_name.add(object.getString("userName"));
post_context.add(object.getString("postContext"));
}
JSONObject result_json2 = new JSONObject(result2);
JSONArray chapters = result_json2.getJSONArray("chapters");
for (int i = 0; i < chapters.length(); i++) {
JSONObject object = chapters.getJSONObject(i);
chapter_id.add(object.getInt("chapterId"));
chapter_name.add(object.getString("chapterName"));
chapter_context.add(object.getString("chapterContext"));
}
handler.post(new Runnable() {
@Override
public void run() {
setinfo();
setpagerview();
setclickitem();
}
});
} catch (JSONException e) {
e.printStackTrace();
System.out.println(e.toString());
}
}
}
}.start();
}
else if(flag==2){
new Thread() {
@Override
public void run() {
String result = internet.getarticleinfo(urlStr_article, book_id);
System.out.println(result);
if (result.equals("") ) {
Looper.prepare();
Toast.makeText(book_info.this, "请求失败!", Toast.LENGTH_SHORT).show();
Looper.loop();
} else {
try {
JSONObject result_json = new JSONObject(result);
JSONArray bookinfo = result_json.getJSONArray("articleinfo");
JSONObject book = bookinfo.getJSONObject(0);
book_name = book.getString("articleName");
book_author = book.getString("articleAuthor");
book_introduction = book.getString("articleIntroduction");
book_pic = book.getString("articlePicture");
article_url=book.getString("articleContext");
JSONArray post = result_json.getJSONArray("post");
for (int i = 0; i < post.length(); i++) {
JSONObject object = post.getJSONObject(i);
user_name.add(object.getString("userName"));
post_context.add(object.getString("postContext"));
}
handler.post(new Runnable() {
@Override
public void run() {
setinfo();
setpagerview();
setclickitem();
}
});
} catch (JSONException e) {
e.printStackTrace();
System.out.println(e.toString());
}
}
}
}.start();
}
}
}
private void setinfo() {
url_imgview imgview=(url_imgview) findViewById(R.id.bookimage);
imgview.geturlimg(book_pic);
TextView book_info_name=(TextView) findViewById(R.id.book_info_name);
TextView book_info_authorn=(TextView) findViewById(R.id.book_info_authorn);
TextView book_info_introduction=(TextView) findViewById(R.id.book_info_introduction);
book_info_name.setText(book_name);
book_info_authorn.setText(book_author);
book_info_introduction.setText(book_introduction);
}
private void setclickitem() {
Button button2=(Button) findViewById(R.id.button2);
Button button3=(Button) findViewById(R.id.button3);
Button begin_read=(Button) findViewById(R.id.yuedu);
Button putbook=(Button) findViewById(R.id.putbook);
Button returnbutton=(Button) findViewById(R.id.return1);
returnbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mViewPager.setCurrentItem(0);
}
});
button3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mViewPager.setCurrentItem(1);
}
});
begin_read.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(flag==1){
Intent intent= new Intent(book_info.this,article_read.class);
intent.putExtra("book_id",book_id);
intent.putExtra("book_name",book_name);
startActivity(intent);
}
else if(flag==2){
Intent intent= new Intent(book_info.this,pdfread.class);
intent.putExtra("url",article_url);
intent.putExtra("article_name",book_name);
startActivity(intent);
}
}
});
TextView authorn= (TextView) findViewById(R.id.book_info_authorn);
authorn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(book_info.this, AuthorContent.class);
startActivity(intent);
}
});
putbook.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final String urlputbook="http://122.114.237.201/read/addbookcase";
final String urlputarticle="http://122.114.237.201/read/addarticlecase";
SharedPreferences user_data=getSharedPreferences("user_data",MODE_PRIVATE);
final int user_id=user_data.getInt("user_id",0);
if(user_id==0)
{
Toast.makeText(book_info.this,"你还未登录,请先登录......",Toast.LENGTH_SHORT).show();
Intent intent=new Intent(book_info.this,page_login.class);
startActivity(intent);
}
else {
new Thread(){
@Override
public void run() {
String result=null;
if(flag==1){
result= internet.addbook(urlputbook,user_id,book_id);
}
else if(flag==2){
result= internet.addarticle(urlputarticle,user_id,book_id);
}
System.out.println(result);
if (result.equals(""))
{
Looper.prepare();
Toast.makeText(book_info.this,"请求失败!",Toast.LENGTH_SHORT).show();
Looper.loop();
}
else {
try {
JSONObject result_json = new JSONObject(result);
String message=result_json.getString("message");
if("success".equals(message))
{
Looper.prepare();
Toast.makeText(book_info.this,"好棒哟,成功加入书架了呢!",Toast.LENGTH_SHORT).show();
Looper.loop();
}
else
{
Looper.prepare();
Toast.makeText(book_info.this,"已经在你的书架里了哟宝贝~",Toast.LENGTH_SHORT).show();
Looper.loop();
}
} catch (JSONException e) {
e.printStackTrace();
System.out.println(e.toString());
}
}
}
}.start();
}
}
});
}
private void setpagerview() {
mm=new SectionsPagerAdapter(getSupportFragmentManager());
System.out.println(user_name);
System.out.println(post_context);
datas.add(xiangqing.newInstance(user_name,post_context));
datas.add(mulu.newInstance(chapter_id,chapter_name));
mm.setData(datas);
mViewPager = (ViewPager) findViewById(R.id.content);
mViewPager.setAdapter(mm);
}
public class SectionsPagerAdapter extends FragmentPagerAdapter {
private ArrayList<Fragment> datas;
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
public void setData(ArrayList<Fragment> datas) {
this.datas = datas;
}
@Override
public Fragment getItem(int position) {
return datas == null ? null : datas.get(position);
}
@Override
public int getCount() {
return datas == null ? 0 : datas.size();
}
}
}
| [
"[email protected]"
]
| |
258bba18cae9453a69744d6d06966d28f9768456 | e858882c4bfb5655300ef9ab3a20fd79df3de985 | /Ejercicio3DavidAbellanNavarro.java | 333835e1f2432b3674bb0a7842a3948b30ea30fa | []
| no_license | Naabda/Ejercicio3 | 48742aeac7e8b3458795e5de18e2c0eb6f8e2ebe | 50722219fae4c3de4cb03be63655efc11d5546cf | refs/heads/main | 2022-12-31T06:16:18.107315 | 2020-10-20T06:15:02 | 2020-10-20T06:15:02 | 305,607,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,496 | java | //Created by David Abellán Navarro 1ºDAM
//https://github.com/Naabda/Ejercicio3/blob/main/Ejercicio3DavidAbellanNavarro.java
package EjerciciosEntregados;
import java.util.Scanner;
public class Ejercicio3DavidAbellanNavarro {
// TODO Auto-generated method stub
public static void mostrarSubMenu() {
Scanner sc=new Scanner(System.in);
boolean continuar=true;
int subopcion;
do {
//Escribimos las opciones que posteriormente pondremos en las cajas.
System.out.println("Elige una opción");
System.out.println("4.1-Administrar");
System.out.println("4.2-Inspeccionar");
System.out.println("4.3-Revisar");
System.out.println("4.4-Volver al Menú");
subopcion=sc.nextInt();
//Definimos las cajas con nuestras opciones para el SubMenú.
switch (subopcion) {
case 1:
System.out.println("4.1-Administrando...");
break;
case 2:
System.out.println("4.2-Llamando hacienda para inspección.");
break;
case 3:
System.out.println("4.3-Revisando su antivirus esto va para rato...");
break;
case 4:
System.out.println("4.4-Aquí tiene su menú.");
continuar = false;
break;
default:
System.out.println("Inserta una opción correcta");
}
}
while (continuar);
//Indicamos el cierre de esta función.
}
public static void main(String[] args) {
// TODO Auto-generated method stub
//Definimos las variables.
Scanner sc= new Scanner(System.in);
boolean continuar =true;
int opcion;
do {
//Escribimos las opciones que posteriormente pondremos en las cajas.
System.out.println("Elige una opción");
System.out.println("1.Abrir programa");
System.out.println("2.Cerrar programa");
System.out.println("3.Guardar");
System.out.println("4.Submenú");
System.out.println("5.Salir");
opcion=sc.nextInt();
//Definimos las cajas con las opciones del menú.
switch (opcion) {
case 1:
System.out.println("Programa abierto");
break;
case 2:
System.out.println("Cerrar programa");
break;
case 3:
System.out.println("Programa guardado");
break;
case 4:
mostrarSubMenu();
break;
case 5:
System.out.println("Pague el menú antes de irse");
continuar = false;
break;
default:
System.out.println("Inserta una opción correcta");
}
}
while (continuar);
//Cerramos el escaner.
sc.close();
}
//Cerramos programa.
}
| [
"[email protected]"
]
| |
07ccbfd96e035a23bfdf87189f1569f8556c605f | 2cd00cba3e07a32abca4135d34c66a32c1af4596 | /src/com/kimyunjae/basket/controller/BasketAdd.java | c13e1b0baa31ea3e43c9a0af096ef8aec9a7de84 | []
| no_license | yunjaeKim-dev/personalProject | a4d7346108c636b5868e844396ec7139ec669b64 | c876702cd0971427476b91026ef317f8e13888ef | refs/heads/master | 2020-09-08T14:16:00.575596 | 2019-11-12T08:11:24 | 2019-11-12T08:11:24 | 221,155,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 888 | java | package com.kimyunjae.basket.controller;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.kimyunjae.basket.service.BasketServiceImpl;
import com.kimyunjae.game.vo.Game;
@WebServlet("/addBasket")
public class BasketAdd extends HttpServlet{
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String email = req.getParameter("email");
int gno = Integer.parseInt(req.getParameter("gno"));
List<Game> basket = new BasketServiceImpl().addBasket(gno, email);
if(!basket.isEmpty()) {
req.getSession(true).setAttribute("basket", basket);
resp.getWriter().print(1);
}
}
}
| [
"[email protected]"
]
| |
b5b00fffa426f1d68c924f56a39c483b48f50799 | 08dfb6b273126902d6ea458dc2fa750b6b3b651c | /src/main/java/iloveyouboss/ScoreCollection.java | a555428e9184e1542f4dd8735da0f3a68bc1e77c | []
| no_license | manuel-lim/junitStudy | d9e753493498577f174e964a520e50777d572af3 | 360ea62f0c25a558c3130c4afaa8461613922658 | refs/heads/master | 2022-12-02T10:23:06.883006 | 2020-07-31T08:54:41 | 2020-07-31T08:54:41 | 283,984,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package iloveyouboss;
import java.util.ArrayList;
import java.util.List;
public class ScoreCollection {
private List<Scoreable> scores = new ArrayList<>();
public void add(Scoreable scoreable) {
scores.add(scoreable);
}
public int arithmeticMean() {
int total = scores.stream().mapToInt(Scoreable::getScore).sum();
return total / scores.size();
}
}
| [
"[email protected]"
]
| |
5db482bf7bac5d3dcc640c82a04b3d2da772a70a | d36ec4db1fa1d69379f1ce74af2616470345df0c | /android/app/src/main/java/com/sample/SamplePackage.java | e3b5a49a31482878acc4d8245e93042e1dcd7625 | [
"MIT"
]
| permissive | devnirajc/ReactNativeSampleApp | 83d2b88945fbf101faaf0d0b71d7463c1fa01434 | 96ef30ae1530d58159a1bdb234e1ef71be522493 | refs/heads/master | 2023-07-07T15:30:47.501450 | 2021-07-12T17:39:40 | 2021-07-12T17:39:40 | 125,188,513 | 1 | 0 | MIT | 2023-06-21T15:21:39 | 2018-03-14T09:33:31 | JavaScript | UTF-8 | Java | false | false | 1,170 | java | package com.sample;
import android.app.Activity;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class SamplePackage implements ReactPackage {
private Activity mActivity;
//public SamplePackage(Activity activity) {
// mActivity = activity;
//}
@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactApplicationContext) {
return Collections.emptyList();
}
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new EnvironmentManager(reactContext));
modules.add(new TestRunnerManager(reactContext));
return modules;
}
}
| [
"[email protected]"
]
| |
c72a92699b9c2cf6a12e85ff820bf2dc62c6d9e0 | a4e77dc7149c42d3da14bdb2129c8ed08657e9d5 | /Authentication.java | 8df7b45ad812e5fa8bc66fb799796b3c312a84c3 | []
| no_license | Saidul1997/Banking-Management-System | 0d8c003af41cd37160983e8b61b84d34a1996166 | f96483cda9bd7ff860fddd2457a906701f96c815 | refs/heads/master | 2020-05-07T09:41:35.787442 | 2019-04-09T15:43:39 | 2019-04-09T15:43:39 | 180,388,116 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,027 | 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 online_banking;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
/**
*
* @author Rajib
*/
public class Authentication extends javax.swing.JFrame {
Connection conn;
ResultSet rs;
PreparedStatement pst;
/**
* Creates new form Authentication
*/
public Authentication() {
super("Login");
initComponents();
conn = Connect.connecrDb();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
jTextField3 = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/TBL-iBanking-Logo-green.png"))); // NOI18N
jLabel1.setText("Created By- SAIDUL ISLAM");
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 51, 153), 2), "Account_Information", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14), new java.awt.Color(0, 102, 51))); // NOI18N
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/login 16.png"))); // NOI18N
jButton1.setText("Login");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jTextField3.setText("Sign Up");
jTextField3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField3ActionPerformed(evt);
}
});
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel2.setForeground(new java.awt.Color(102, 0, 102));
jLabel2.setText("Account Number : ");
jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel3.setForeground(new java.awt.Color(102, 0, 153));
jLabel3.setText("Pin Number:");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel2)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField2)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(155, 155, 155)
.addComponent(jButton1)
.addGap(31, 31, 31)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(51, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(25, 25, 25)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField3))
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(42, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(39, 39, 39))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(31, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed
// TODO add your handling code here:
setVisible(false);
Account1 ob = new Account1();
ob.setVisible(true);
}//GEN-LAST:event_jTextField3ActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
String sql = "select * from Account where Acc=? and Pin = ?";
try{
pst = conn.prepareStatement(sql);
pst.setString(1, jTextField1.getText());
pst.setString(2, jTextField1.getText());
rs = pst.executeQuery();
if(rs.next()){
setVisible(false);
Loading ob = new Loading();
ob.setUpLoading();
ob.setVisible(true);
rs.close();
pst.close();
}
else{
JOptionPane.showMessageDialog(null,"Incorrect Credential");
}
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}finally{
try{
rs.close();
pst.close();
}catch(Exception e){
}
}
}//GEN-LAST:event_jButton1ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
/*if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;*/
UIManager.setLookAndFeel("com.jtattoo.plaf.smart.SmartLookAndFeel");
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Authentication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Authentication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Authentication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Authentication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Authentication().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
]
| |
4723070bcce64793c4214e4052eaddfdb18d8afa | fe494c27b5b4499a22b4b6b45498e66b1ace6389 | /Weibo/src/main/java/cc/openhome/controller/Message.java | 954bb4c0675f00658773a836341e77ffe5d1ea35 | []
| no_license | RingoKawasumi/JSP_ServletStudyNote | dd92212f9b676f97067ae77e06101d7c78fbe7d6 | 9487cd0c574929c1bb1c13a5320ad2c05b0f31af | refs/heads/master | 2021-01-10T16:13:01.918396 | 2016-02-17T06:48:13 | 2016-02-17T06:48:13 | 47,705,567 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,105 | java | package cc.openhome.controller;
import cc.openhome.model.Blah;
import cc.openhome.model.UserService;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Date;
import java.util.List;
/**
* Created by zhujie on 16/1/7.
*/
@WebServlet(
urlPatterns = {"/message.do"},
initParams = {
@WebInitParam(name = "MEMBER_VIEW", value = "member.jsp")
}
)
public class Message extends HttpServlet {
private String MEMBER_VIEW;
@Override
public void init() throws ServletException {
MEMBER_VIEW = getServletConfig().getInitParameter("MEMBER_VIEW");
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
processRequest(req, resp);
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
processRequest(req, resp);
}
protected void processRequest(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String username = (String) req.getSession().getAttribute("login");
UserService userService = (UserService) getServletContext().getAttribute("userService");
Blah blah = new Blah();
blah.setUsername(username);
String blabla = req.getParameter("blabla");
if (blabla != null && blabla.length() != 0) {
if (blabla.length() < 140) {
blah.setDate(new Date());
blah.setTxt(blabla);
userService.addBlah(blah);
} else {
req.setAttribute("blabla", blabla);
}
}
List<Blah> blahs = userService.getBlahs(blah);
req.setAttribute("blahs", blahs);
req.getRequestDispatcher(MEMBER_VIEW).forward(req, resp);
}
}
| [
"[email protected]"
]
| |
72484e916f2df2ee66caa9a27b123b9fdeeb69a6 | 4a35bdad25f49353889fb21d35c56ac4a7f9cf6c | /CyclingSerbia/src/main/java/com/springmvc/model/FileBucket.java | 27dc7b566d13bbc8f1ec3d180a78f5c599534650 | []
| no_license | Milanx64/CyclingSerbia | 99c2f40b193ecda7229da488a700ff5db9d4011c | 7949dd33a9f9f84e1f9db28b227fbc986054436f | refs/heads/master | 2022-12-21T10:50:24.048518 | 2020-03-18T11:08:47 | 2020-03-18T11:08:47 | 178,016,605 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 503 | java | package com.springmvc.model;
import org.springframework.web.multipart.MultipartFile;
public class FileBucket {
MultipartFile file;
public MultipartFile getFile() {
return file;
}
public void setFile(MultipartFile file) {
this.file = file;
}
String description;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
| [
"[email protected]"
]
| |
8a151f015c51c63e3da7633c56370dd0063635a5 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/6/6_ea5f99affcb13d7e00394b4fed343364267794a9/PShapeSVG/6_ea5f99affcb13d7e00394b4fed343364267794a9_PShapeSVG_t.java | a01d680a57c991bc8e601a99e6e530cddb2b018a | []
| 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 | 47,978 | java | package processing.core;
import java.awt.Paint;
import java.awt.PaintContext;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.ColorModel;
import java.awt.image.Raster;
import java.awt.image.WritableRaster;
import java.util.HashMap;
import processing.xml.XMLElement;
/**
* SVG stands for Scalable Vector Graphics, a portable graphics format. It is
* a vector format so it allows for infinite resolution and relatively small
* file sizes. Most modern media software can view SVG files, including Adobe
* products, Firefox, etc. Illustrator and Inkscape can edit SVG files.
* <p>
* We have no intention of turning this into a full-featured SVG library.
* The goal of this project is a basic shape importer that is small enough
* to be included with applets, meaning that its download size should be
* in the neighborhood of 25-30k. Because of this size, it is not made part
* of processing.core, as it's not a feature that will be used by the majority
* of our audience.
*
* For more sophisticated import/export, consider the
* <A HREF="http://xmlgraphics.apache.org/batik/">Batik</A>
* library from the Apache Software Foundation. Future improvements to this
* library may focus on this properly supporting a specific subset of SVG,
* for instance the simpler SVG profiles known as
* <A HREF="http://www.w3.org/TR/SVGMobile/">SVG Tiny or Basic</A>,
* although we still would not support the interactivity options.
* <p>
* This library was specifically tested under SVG files created with Adobe
* Illustrator. We can't guarantee that it will work for any SVGs created with
* other software. In the future we would like to improve compatibility with
* Open Source software such as Inkscape, however initial tests show its
* base implementation produces more complicated files, and this will require
* more time.
* <p>
* An SVG created under Illustrator must be created in one of two ways:
* <UL>
* <LI>File → Save for Web (or control-alt-shift-s on a PC). Under
* settings, make sure the CSS properties is set to "Presentation Attributes".
* <LI>With Illustrator CS2, it is also possible to use "Save As" with "SVG"
* as the file setting, but the CSS properties should also be set similarly.
* </UL>
* Saving it any other way will most likely not work.
*
* <p> <hr noshade> <p>
*
* A minimal example program using SVG:
* (assuming a working moo.svg is in your data folder)
*
* <PRE>
* PShape moo;
*
* void setup() {
* size(400, 400);
* moo = loadShape("moo.svg");
* }
* void draw() {
* shape(moo);
* }
* </PRE>
*
* This code is based on the Candy library written by Michael Chang, which was
* later revised and expanded for use as a Processing core library by Ben Fry.
*
* <p> <hr noshade> <p>
*
* October 2008 revisions by fry (Processing 0149, pre-1.0)
* <UL>
* <LI> Candy is no longer a separate library, and is instead part of core.
* <LI> Loading now works through loadShape()
* <LI> Shapes are now drawn using the new PGraphics shape() method.
* </UL>
*
* August 2008 revisions by fry (Processing 0149)
* <UL>
* <LI> Major changes to rework around PShape.
* <LI> Now implementing more of the "transform" attribute.
* </UL>
*
* February 2008 revisions by fry (Processing 0136)
* <UL>
* <LI> Added support for quadratic curves in paths (Q, q, T, and t operators)
* <LI> Support for reading SVG font data (though not rendering it yet)
* </UL>
*
* Revisions for "Candy 2" November 2006 by fry
* <UL>
* <LI> Switch to the new processing.xml library
* <LI> Several bug fixes for parsing of shape data
* <LI> Support for linear and radial gradients
* <LI> Support for additional types of shapes
* <LI> Added compound shapes (shapes with interior points)
* <LI> Added methods to get shapes from an internal table
* </UL>
*
* Revision 10/31/06 by flux
* <UL>
* <LI> Now properly supports Processing 0118
* <LI> Fixed a bunch of things for Casey's students and general buggity.
* <LI> Will now properly draw #FFFFFFFF colors (were being represented as -1)
* <LI> SVGs without <g> tags are now properly caught and loaded
* <LI> Added a method customStyle() for overriding SVG colors/styles
* <LI> Added a method SVGStyle() to go back to using SVG colors/styles
* </UL>
*
* Some SVG objects and features may not yet be supported.
* Here is a partial list of non-included features
* <UL>
* <LI> Rounded rectangles
* <LI> Drop shadow objects
* <LI> Typography
* <LI> <STRIKE>Layers</STRIKE> added for Candy 2
* <LI> Patterns
* <LI> Embedded images
* </UL>
*
* For those interested, the SVG specification can be found
* <A HREF="http://www.w3.org/TR/SVG">here</A>.
*/
public class PShapeSVG extends PShape {
XMLElement element;
float opacity;
Gradient strokeGradient;
Paint strokeGradientPaint;
String strokeName; // id of another object, gradients only?
Gradient fillGradient;
Paint fillGradientPaint;
String fillName; // id of another object
/**
* Initializes a new SVG Object with the given filename.
*/
public PShapeSVG(PApplet parent, String filename) {
// this will grab the root document, starting <svg ...>
// the xml version and initial comments are ignored
this(new XMLElement(parent, filename));
}
/**
* Initializes a new SVG Object from the given XMLElement.
*/
public PShapeSVG(XMLElement svg) {
this(null, svg);
if (!svg.getName().equals("svg")) {
throw new RuntimeException("root is not <svg>, it's <" + svg.getName() + ">");
}
// not proper parsing of the viewBox, but will cover us for cases where
// the width and height of the object is not specified
String viewBoxStr = svg.getStringAttribute("viewBox");
if (viewBoxStr != null) {
int[] viewBox = PApplet.parseInt(PApplet.splitTokens(viewBoxStr));
width = viewBox[2];
height = viewBox[3];
}
// TODO if viewbox is not same as width/height, then use it to scale
// the original objects. for now, viewbox only used when width/height
// are empty values (which by the spec means w/h of "100%"
String unitWidth = svg.getStringAttribute("width");
String unitHeight = svg.getStringAttribute("height");
if (unitWidth != null) {
width = parseUnitSize(unitWidth);
height = parseUnitSize(unitHeight);
} else {
if ((width == 0) || (height == 0)) {
//throw new RuntimeException("width/height not specified");
PGraphics.showWarning("The width and/or height is not " +
"readable in the <svg> tag of this file.");
// For the spec, the default is 100% and 100%. For purposes
// here, insert a dummy value because this is prolly just a
// font or something for which the w/h doesn't matter.
width = 1;
height = 1;
}
}
//root = new Group(null, svg);
parseChildren(svg); // ?
}
public PShapeSVG(PShapeSVG parent, XMLElement properties) {
//super(GROUP);
if (parent == null) {
// set values to their defaults according to the SVG spec
stroke = false;
strokeColor = 0xff000000;
strokeWeight = 1;
strokeCap = PConstants.SQUARE; // equivalent to BUTT in svg spec
strokeJoin = PConstants.MITER;
strokeGradient = null;
strokeGradientPaint = null;
strokeName = null;
fill = true;
fillColor = 0xff000000;
fillGradient = null;
fillGradientPaint = null;
fillName = null;
//hasTransform = false;
//transformation = null; //new float[] { 1, 0, 0, 1, 0, 0 };
opacity = 1;
} else {
stroke = parent.stroke;
strokeColor = parent.strokeColor;
strokeWeight = parent.strokeWeight;
strokeCap = parent.strokeCap;
strokeJoin = parent.strokeJoin;
strokeGradient = parent.strokeGradient;
strokeGradientPaint = parent.strokeGradientPaint;
strokeName = parent.strokeName;
fill = parent.fill;
fillColor = parent.fillColor;
fillGradient = parent.fillGradient;
fillGradientPaint = parent.fillGradientPaint;
fillName = parent.fillName;
//hasTransform = parent.hasTransform;
//transformation = parent.transformation;
opacity = parent.opacity;
}
element = properties;
name = properties.getStringAttribute("id");
// if (name != null) {
// table.put(name, this);
// //System.out.println("now parsing " + id);
// }
String displayStr = properties.getStringAttribute("display", "inline");
visible = !displayStr.equals("none");
String transformStr = properties.getStringAttribute("transform");
if (transformStr != null) {
matrix = parseMatrix(transformStr);
}
parseColors(properties);
parseChildren(properties);
}
protected void parseChildren(XMLElement graphics) {
XMLElement[] elements = graphics.getChildren();
children = new PShape[elements.length];
childCount = 0;
for (XMLElement elem : elements) {
PShape kid = parseChild(elem);
if (kid != null) {
addChild(kid);
}
}
}
/**
* Parse a child XML element.
* Override this method to add parsing for more SVG elements.
*/
protected PShape parseChild(XMLElement elem) {
String name = elem.getName();
PShapeSVG shape = new PShapeSVG(this, elem);
if (name.equals("g")) {
//return new BaseObject(this, elem);
} else if (name.equals("defs")) {
// generally this will contain gradient info, so may
// as well just throw it into a group element for parsing
//return new BaseObject(this, elem);
} else if (name.equals("line")) {
//return new Line(this, elem);
//return new BaseObject(this, elem, LINE);
shape.parseLine();
} else if (name.equals("circle")) {
//return new BaseObject(this, elem, ELLIPSE);
shape.parseEllipse(true);
} else if (name.equals("ellipse")) {
//return new BaseObject(this, elem, ELLIPSE);
shape.parseEllipse(false);
} else if (name.equals("rect")) {
//return new BaseObject(this, elem, RECT);
shape.parseRect();
} else if (name.equals("polygon")) {
//return new BaseObject(this, elem, POLYGON);
shape.parsePoly(true);
} else if (name.equals("polyline")) {
//return new BaseObject(this, elem, POLYGON);
shape.parsePoly(false);
} else if (name.equals("path")) {
//return new BaseObject(this, elem, PATH);
shape.parsePath();
} else if (name.equals("radialGradient")) {
return new RadialGradient(this, elem);
} else if (name.equals("linearGradient")) {
return new LinearGradient(this, elem);
} else if (name.equals("text")) {
PGraphics.showWarning("Text in SVG files is not currently supported, " +
"convert text to outlines instead.");
} else if (name.equals("filter")) {
PGraphics.showWarning("Filters are not supported.");
} else if (name.equals("mask")) {
PGraphics.showWarning("Masks are not supported.");
} else {
PGraphics.showWarning("Ignoring <" + name + "> tag.");
}
return null;
}
protected void parseLine() {
kind = LINE;
family = PRIMITIVE;
params = new float[] {
element.getFloatAttribute("x1"),
element.getFloatAttribute("y1"),
element.getFloatAttribute("x2"),
element.getFloatAttribute("y2"),
};
// x = params[0];
// y = params[1];
// width = params[2];
// height = params[3];
}
/**
* Handles parsing ellipse and circle tags.
* @param circle true if this is a circle and not an ellipse
*/
protected void parseEllipse(boolean circle) {
kind = ELLIPSE;
family = PRIMITIVE;
params = new float[4];
params[0] = element.getFloatAttribute("cx");
params[1] = element.getFloatAttribute("cy");
float rx, ry;
if (circle) {
rx = ry = element.getFloatAttribute("r");
} else {
rx = element.getFloatAttribute("rx");
ry = element.getFloatAttribute("ry");
}
params[0] -= rx;
params[1] -= ry;
params[2] = rx*2;
params[3] = ry*2;
}
protected void parseRect() {
kind = RECT;
family = PRIMITIVE;
params = new float[] {
element.getFloatAttribute("x"),
element.getFloatAttribute("y"),
element.getFloatAttribute("width"),
element.getFloatAttribute("height"),
};
}
/**
* Parse a polyline or polygon from an SVG file.
* @param close true if shape is closed (polygon), false if not (polyline)
*/
protected void parsePoly(boolean close) {
family = PATH;
this.close = close;
String pointsAttr = element.getStringAttribute("points");
if (pointsAttr != null) {
String[] pointsBuffer = PApplet.splitTokens(pointsAttr);
vertexCount = pointsBuffer.length;
vertices = new float[vertexCount][2];
for (int i = 0; i < vertexCount; i++) {
String pb[] = PApplet.split(pointsBuffer[i], ',');
vertices[i][X] = Float.valueOf(pb[0]).floatValue();
vertices[i][Y] = Float.valueOf(pb[1]).floatValue();
}
}
}
protected void parsePath() {
family = PATH;
kind = 0;
String pathData = element.getStringAttribute("d");
if (pathData == null) return;
char[] pathDataChars = pathData.toCharArray();
StringBuffer pathBuffer = new StringBuffer();
boolean lastSeparate = false;
for (int i = 0; i < pathDataChars.length; i++) {
char c = pathDataChars[i];
boolean separate = false;
if (c == 'M' || c == 'm' ||
c == 'L' || c == 'l' ||
c == 'H' || c == 'h' ||
c == 'V' || c == 'v' ||
c == 'C' || c == 'c' || // beziers
c == 'S' || c == 's' ||
c == 'Q' || c == 'q' || // quadratic beziers
c == 'T' || c == 't' ||
c == 'Z' || c == 'z' || // closepath
c == ',') {
separate = true;
if (i != 0) {
pathBuffer.append("|");
}
}
if (c == 'Z' || c == 'z') {
separate = false;
}
if (c == '-' && !lastSeparate) {
pathBuffer.append("|");
}
if (c != ',') {
pathBuffer.append(c); //"" + pathDataBuffer.charAt(i));
}
if (separate && c != ',' && c != '-') {
pathBuffer.append("|");
}
lastSeparate = separate;
}
// use whitespace constant to get rid of extra spaces and CR or LF
String[] pathDataKeys =
PApplet.splitTokens(pathBuffer.toString(), "|" + WHITESPACE);
float cx = 0;
float cy = 0;
int i = 0;
while (i < pathDataKeys.length) {
char c = pathDataKeys[i].charAt(0);
switch (c) {
case 'M': // M - move to (absolute)
cx = PApplet.parseFloat(pathDataKeys[i + 1]);
cy = PApplet.parseFloat(pathDataKeys[i + 2]);
parsePathMoveto(cx, cy);
i += 3;
break;
case 'm': // m - move to (relative)
cx = cx + PApplet.parseFloat(pathDataKeys[i + 1]);
cy = cy + PApplet.parseFloat(pathDataKeys[i + 2]);
parsePathMoveto(cx, cy);
i += 3;
break;
case 'L':
cx = PApplet.parseFloat(pathDataKeys[i + 1]);
cy = PApplet.parseFloat(pathDataKeys[i + 2]);
parsePathLineto(cx, cy);
i += 3;
break;
case 'l':
cx = cx + PApplet.parseFloat(pathDataKeys[i + 1]);
cy = cy + PApplet.parseFloat(pathDataKeys[i + 2]);
parsePathLineto(cx, cy);
i += 3;
break;
// horizontal lineto absolute
case 'H':
cx = PApplet.parseFloat(pathDataKeys[i + 1]);
parsePathLineto(cx, cy);
i += 2;
break;
// horizontal lineto relative
case 'h':
cx = cx + PApplet.parseFloat(pathDataKeys[i + 1]);
parsePathLineto(cx, cy);
i += 2;
break;
case 'V':
cy = PApplet.parseFloat(pathDataKeys[i + 1]);
parsePathLineto(cx, cy);
i += 2;
break;
case 'v':
cy = cy + PApplet.parseFloat(pathDataKeys[i + 1]);
parsePathLineto(cx, cy);
i += 2;
break;
// C - curve to (absolute)
case 'C': {
float ctrlX1 = PApplet.parseFloat(pathDataKeys[i + 1]);
float ctrlY1 = PApplet.parseFloat(pathDataKeys[i + 2]);
float ctrlX2 = PApplet.parseFloat(pathDataKeys[i + 3]);
float ctrlY2 = PApplet.parseFloat(pathDataKeys[i + 4]);
float endX = PApplet.parseFloat(pathDataKeys[i + 5]);
float endY = PApplet.parseFloat(pathDataKeys[i + 6]);
parsePathCurveto(ctrlX1, ctrlY1, ctrlX2, ctrlY2, endX, endY);
cx = endX;
cy = endY;
i += 7;
}
break;
// c - curve to (relative)
case 'c': {
float ctrlX1 = cx + PApplet.parseFloat(pathDataKeys[i + 1]);
float ctrlY1 = cy + PApplet.parseFloat(pathDataKeys[i + 2]);
float ctrlX2 = cx + PApplet.parseFloat(pathDataKeys[i + 3]);
float ctrlY2 = cy + PApplet.parseFloat(pathDataKeys[i + 4]);
float endX = cx + PApplet.parseFloat(pathDataKeys[i + 5]);
float endY = cy + PApplet.parseFloat(pathDataKeys[i + 6]);
parsePathCurveto(ctrlX1, ctrlY1, ctrlX2, ctrlY2, endX, endY);
cx = endX;
cy = endY;
i += 7;
}
break;
// S - curve to shorthand (absolute)
case 'S': {
float ppx = vertices[vertexCount-2][X];
float ppy = vertices[vertexCount-2][Y];
float px = vertices[vertexCount-1][X];
float py = vertices[vertexCount-1][Y];
float ctrlX1 = px + (px - ppx);
float ctrlY1 = py + (py - ppy);
float ctrlX2 = PApplet.parseFloat(pathDataKeys[i + 1]);
float ctrlY2 = PApplet.parseFloat(pathDataKeys[i + 2]);
float endX = PApplet.parseFloat(pathDataKeys[i + 3]);
float endY = PApplet.parseFloat(pathDataKeys[i + 4]);
parsePathCurveto(ctrlX1, ctrlY1, ctrlX2, ctrlY2, endX, endY);
cx = endX;
cy = endY;
i += 5;
}
break;
// s - curve to shorthand (relative)
case 's': {
float ppx = vertices[vertexCount-2][X];
float ppy = vertices[vertexCount-2][Y];
float px = vertices[vertexCount-1][X];
float py = vertices[vertexCount-1][Y];
float ctrlX1 = px + (px - ppx);
float ctrlY1 = py + (py - ppy);
float ctrlX2 = cx + PApplet.parseFloat(pathDataKeys[i + 1]);
float ctrlY2 = cy + PApplet.parseFloat(pathDataKeys[i + 2]);
float endX = cx + PApplet.parseFloat(pathDataKeys[i + 3]);
float endY = cy + PApplet.parseFloat(pathDataKeys[i + 4]);
parsePathCurveto(ctrlX1, ctrlY1, ctrlX2, ctrlY2, endX, endY);
cx = endX;
cy = endY;
i += 5;
}
break;
// Q - quadratic curve to (absolute)
case 'Q': {
float ctrlX = PApplet.parseFloat(pathDataKeys[i + 1]);
float ctrlY = PApplet.parseFloat(pathDataKeys[i + 2]);
float endX = PApplet.parseFloat(pathDataKeys[i + 3]);
float endY = PApplet.parseFloat(pathDataKeys[i + 4]);
parsePathCurveto(ctrlX, ctrlY, ctrlX, ctrlY, endX, endY);
cx = endX;
cy = endY;
i += 5;
}
break;
// q - quadratic curve to (relative)
case 'q': {
float ctrlX = cx + PApplet.parseFloat(pathDataKeys[i + 1]);
float ctrlY = cy + PApplet.parseFloat(pathDataKeys[i + 2]);
float endX = cx + PApplet.parseFloat(pathDataKeys[i + 3]);
float endY = cy + PApplet.parseFloat(pathDataKeys[i + 4]);
parsePathCurveto(ctrlX, ctrlY, ctrlX, ctrlY, endX, endY);
cx = endX;
cy = endY;
i += 5;
}
break;
// T - quadratic curve to shorthand (absolute)
// The control point is assumed to be the reflection of the
// control point on the previous command relative to the
// current point. (If there is no previous command or if the
// previous command was not a Q, q, T or t, assume the control
// point is coincident with the current point.)
case 'T': {
float ppx = vertices[vertexCount-2][X];
float ppy = vertices[vertexCount-2][Y];
float px = vertices[vertexCount-1][X];
float py = vertices[vertexCount-1][Y];
float ctrlX = px + (px - ppx);
float ctrlY = py + (py - ppy);
float endX = PApplet.parseFloat(pathDataKeys[i + 1]);
float endY = PApplet.parseFloat(pathDataKeys[i + 2]);
parsePathCurveto(ctrlX, ctrlY, ctrlX, ctrlY, endX, endY);
cx = endX;
cy = endY;
i += 3;
}
break;
// t - quadratic curve to shorthand (relative)
case 't': {
float ppx = vertices[vertexCount-2][X];
float ppy = vertices[vertexCount-2][Y];
float px = vertices[vertexCount-1][X];
float py = vertices[vertexCount-1][Y];
float ctrlX = px + (px - ppx);
float ctrlY = py + (py - ppy);
float endX = cx + PApplet.parseFloat(pathDataKeys[i + 1]);
float endY = cy + PApplet.parseFloat(pathDataKeys[i + 2]);
parsePathCurveto(ctrlX, ctrlY, ctrlX, ctrlY, endX, endY);
cx = endX;
cy = endY;
i += 3;
}
break;
case 'Z':
case 'z':
close = true;
i++;
break;
default:
String parsed =
PApplet.join(PApplet.subset(pathDataKeys, 0, i), ",");
String unparsed =
PApplet.join(PApplet.subset(pathDataKeys, i), ",");
System.err.println("parsed: " + parsed);
System.err.println("unparsed: " + unparsed);
throw new RuntimeException("shape command not handled: " + pathDataKeys[i]);
}
}
}
// private void parsePathCheck(int num) {
// if (vertexCount + num-1 >= vertices.length) {
// //vertices = (float[][]) PApplet.expand(vertices);
// float[][] temp = new float[vertexCount << 1][2];
// System.arraycopy(vertices, 0, temp, 0, vertexCount);
// vertices = temp;
// }
// }
private void parsePathVertex(float x, float y) {
if (vertexCount == vertices.length) {
//vertices = (float[][]) PApplet.expand(vertices);
float[][] temp = new float[vertexCount << 1][2];
System.arraycopy(vertices, 0, temp, 0, vertexCount);
vertices = temp;
}
vertices[vertexCount][X] = x;
vertices[vertexCount][Y] = y;
vertexCount++;
}
private void parsePathCode(int what) {
if (vertexCodeCount == vertexCodes.length) {
vertexCodes = PApplet.expand(vertexCodes);
}
vertexCodes[vertexCodeCount++] = what;
}
private void parsePathMoveto(float px, float py) {
if (vertexCount > 0) {
parsePathCode(BREAK);
}
parsePathCode(VERTEX);
parsePathVertex(px, py);
}
private void parsePathLineto(float px, float py) {
parsePathCode(VERTEX);
parsePathVertex(px, py);
}
private void parsePathCurveto(float x1, float y1,
float x2, float y2,
float x3, float y3) {
parsePathCode(BEZIER_VERTEX);
parsePathVertex(x1, y1);
parsePathVertex(x2, y2);
parsePathVertex(x3, y3);
}
/**
* Parse the specified SVG matrix into a PMatrix2D. Note that PMatrix2D
* is rotated relative to the SVG definition, so parameters are rearranged
* here. More about the transformation matrices in
* <a href="http://www.w3.org/TR/SVG/coords.html#TransformAttribute">this section</a>
* of the SVG documentation.
* @param matrixStr text of the matrix param.
* @return a good old-fashioned PMatrix2D
*/
static protected PMatrix2D parseMatrix(String matrixStr) {
String[] pieces = PApplet.match(matrixStr, "\\s*(\\w+)\\((.*)\\)");
if (pieces == null) {
System.err.println("Could not parse transform " + matrixStr);
return null;
}
float[] m = PApplet.parseFloat(PApplet.splitTokens(pieces[2]));
if (pieces[1].equals("matrix")) {
return new PMatrix2D(m[0], m[2], m[4], m[1], m[3], m[5]);
} else if (pieces[1].equals("translate")) {
float tx = m[0];
float ty = (m.length == 2) ? m[1] : m[0];
//return new float[] { 1, 0, tx, 0, 1, ty };
return new PMatrix2D(1, 0, tx, 0, 1, ty);
} else if (pieces[1].equals("scale")) {
float sx = m[0];
float sy = (m.length == 2) ? m[1] : m[0];
//return new float[] { sx, 0, 0, 0, sy, 0 };
return new PMatrix2D(sx, 0, 0, 0, sy, 0);
} else if (pieces[1].equals("rotate")) {
float angle = m[0];
if (m.length == 1) {
float c = PApplet.cos(angle);
float s = PApplet.sin(angle);
// SVG version is cos(a) sin(a) -sin(a) cos(a) 0 0
return new PMatrix2D(c, -s, 0, s, c, 0);
} else if (m.length == 3) {
PMatrix2D mat = new PMatrix2D(0, 1, m[1], 1, 0, m[2]);
mat.rotate(m[0]);
mat.translate(-m[1], -m[2]);
return mat; //.get(null);
}
} else if (pieces[1].equals("skewX")) {
//return new float[] { 1, PApplet.tan(m[0]), 0, 0, 1, 0 };
return new PMatrix2D(1, 0, 1, PApplet.tan(m[0]), 0, 0);
} else if (pieces[1].equals("skewY")) {
//return new float[] { 1, 0, 0, PApplet.tan(m[0]), 1, 0 };
return new PMatrix2D(1, 0, 1, 0, PApplet.tan(m[0]), 0);
}
return null;
}
protected void parseColors(XMLElement properties) {
if (properties.hasAttribute("opacity")) {
opacity = properties.getFloatAttribute("opacity");
}
int opacityMask = ((int) (opacity * 255)) << 24;
if (properties.hasAttribute("stroke")) {
String strokeText = properties.getStringAttribute("stroke");
if (strokeText.equals("none")) {
stroke = false;
} else if (strokeText.startsWith("#")) {
stroke = true;
strokeColor = opacityMask |
(Integer.parseInt(strokeText.substring(1), 16)) & 0xFFFFFF;
} else if (strokeText.startsWith("rgb")) {
stroke = true;
strokeColor = opacityMask | parseRGB(strokeText);
} else if (strokeText.startsWith("url(#")) {
strokeName = strokeText.substring(5, strokeText.length() - 1);
Object strokeObject = findChild(strokeName);
if (strokeObject instanceof Gradient) {
strokeGradient = (Gradient) strokeObject;
strokeGradientPaint = calcGradientPaint(strokeGradient); //, opacity);
} else {
System.err.println("url " + strokeName + " refers to unexpected data");
}
}
}
if (properties.hasAttribute("stroke-width")) {
// if NaN (i.e. if it's 'inherit') then default back to the inherit setting
strokeWeight = properties.getFloatAttribute("stroke-width", strokeWeight);
}
if (properties.hasAttribute("stroke-linejoin")) {
String linejoin = properties.getStringAttribute("stroke-linejoin");
if (linejoin.equals("inherit")) {
// do nothing, will inherit automatically
} else if (linejoin.equals("miter")) {
strokeJoin = PConstants.MITER;
} else if (linejoin.equals("round")) {
strokeJoin = PConstants.ROUND;
} else if (linejoin.equals("bevel")) {
strokeJoin = PConstants.BEVEL;
}
}
if (properties.hasAttribute("stroke-linecap")) {
String linecap = properties.getStringAttribute("stroke-linecap");
if (linecap.equals("inherit")) {
// do nothing, will inherit automatically
} else if (linecap.equals("butt")) {
strokeCap = PConstants.SQUARE;
} else if (linecap.equals("round")) {
strokeCap = PConstants.ROUND;
} else if (linecap.equals("square")) {
strokeCap = PConstants.PROJECT;
}
}
// fill defaults to black (though stroke defaults to "none")
// http://www.w3.org/TR/SVG/painting.html#FillProperties
if (properties.hasAttribute("fill")) {
String fillText = properties.getStringAttribute("fill");
if (fillText.equals("none")) {
fill = false;
} else if (fillText.startsWith("#")) {
fill = true;
fillColor = opacityMask |
(Integer.parseInt(fillText.substring(1), 16)) & 0xFFFFFF;
//System.out.println("hex for fill is " + PApplet.hex(fillColor));
} else if (fillText.startsWith("rgb")) {
fill = true;
fillColor = opacityMask | parseRGB(fillText);
} else if (fillText.startsWith("url(#")) {
fillName = fillText.substring(5, fillText.length() - 1);
//PApplet.println("looking for " + fillName);
Object fillObject = findChild(fillName);
//PApplet.println("found " + fillObject);
if (fillObject instanceof Gradient) {
fill = true;
fillGradient = (Gradient) fillObject;
fillGradientPaint = calcGradientPaint(fillGradient); //, opacity);
//PApplet.println("got filla " + fillObject);
} else {
System.err.println("url " + fillName + " refers to unexpected data");
}
}
}
}
static protected int parseRGB(String what) {
int leftParen = what.indexOf('(') + 1;
int rightParen = what.indexOf(')');
String sub = what.substring(leftParen, rightParen);
int[] values = PApplet.parseInt(PApplet.splitTokens(sub, ", "));
return (values[0] << 16) | (values[1] << 8) | (values[2]);
}
static protected HashMap<String, String> parseStyleAttributes(String style) {
HashMap<String, String> table = new HashMap<String, String>();
String[] pieces = style.split(";");
for (int i = 0; i < pieces.length; i++) {
String[] parts = pieces[i].split(":");
table.put(parts[0], parts[1]);
}
return table;
}
/**
* Parse a size that may have a suffix for its units.
* Ignoring cases where this could also be a percentage.
* The <A HREF="http://www.w3.org/TR/SVG/coords.html#Units">units</A> spec:
* <UL>
* <LI>"1pt" equals "1.25px" (and therefore 1.25 user units)
* <LI>"1pc" equals "15px" (and therefore 15 user units)
* <LI>"1mm" would be "3.543307px" (3.543307 user units)
* <LI>"1cm" equals "35.43307px" (and therefore 35.43307 user units)
* <LI>"1in" equals "90px" (and therefore 90 user units)
* </UL>
*/
static protected float parseUnitSize(String text) {
int len = text.length() - 2;
if (text.endsWith("pt")) {
return PApplet.parseFloat(text.substring(0, len)) * 1.25f;
} else if (text.endsWith("pc")) {
return PApplet.parseFloat(text.substring(0, len)) * 15;
} else if (text.endsWith("mm")) {
return PApplet.parseFloat(text.substring(0, len)) * 3.543307f;
} else if (text.endsWith("cm")) {
return PApplet.parseFloat(text.substring(0, len)) * 35.43307f;
} else if (text.endsWith("in")) {
return PApplet.parseFloat(text.substring(0, len)) * 90;
} else if (text.endsWith("px")) {
return PApplet.parseFloat(text.substring(0, len));
} else {
return PApplet.parseFloat(text);
}
}
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
// these are a set of hacks so that gradients can be hacked into Java 2D.
/*
protected Paint getGradient(String name, float cx, float cy, float r) {
BaseObject obj = (BaseObject) findChild(name);
if (obj != null) {
if (obj.fillGradient != null) {
return obj.calcGradientPaint(obj.fillGradient, cx, cy, r);
}
}
throw new RuntimeException("No gradient found for shape " + name);
}
protected Paint getGradient(String name, float x1, float y1, float x2, float y2) {
BaseObject obj = (BaseObject) findChild(name);
if (obj != null) {
if (obj.fillGradient != null) {
return obj.calcGradientPaint(obj.fillGradient, x1, y1, x2, y2);
}
}
throw new RuntimeException("No gradient found for shape " + name);
}
protected void strokeGradient(PGraphics g, String name, float x, float y, float r) {
Paint paint = getGradient(name, x, y, r);
if (g instanceof PGraphicsJava2D) {
PGraphicsJava2D p2d = (PGraphicsJava2D) g;
p2d.strokeGradient = true;
p2d.strokeGradientObject = paint;
}
}
protected void strokeGradient(PGraphics g, String name, float x1, float y1, float x2, float y2) {
Paint paint = getGradient(name, x1, y1, x2, y2);
if (g instanceof PGraphicsJava2D) {
PGraphicsJava2D p2d = (PGraphicsJava2D) g;
p2d.strokeGradient = true;
p2d.strokeGradientObject = paint;
}
}
protected void fillGradient(PGraphics g, String name, float x, float y, float r) {
Paint paint = getGradient(name, x, y, r);
if (g instanceof PGraphicsJava2D) {
PGraphicsJava2D p2d = (PGraphicsJava2D) g;
p2d.fillGradient = true;
p2d.fillGradientObject = paint;
}
}
protected void fillGradient(PGraphics g, String name, float x1, float y1, float x2, float y2) {
Paint paint = getGradient(name, x1, y1, x2, y2);
if (g instanceof PGraphicsJava2D) {
PGraphicsJava2D p2d = (PGraphicsJava2D) g;
p2d.fillGradient = true;
p2d.fillGradientObject = paint;
}
}
*/
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
static class Gradient extends PShapeSVG {
AffineTransform transform;
float[] offset;
int[] color;
int count;
public Gradient(PShapeSVG parent, XMLElement properties) {
super(parent, properties);
XMLElement elements[] = properties.getChildren();
offset = new float[elements.length];
color = new int[elements.length];
// <stop offset="0" style="stop-color:#967348"/>
for (int i = 0; i < elements.length; i++) {
XMLElement elem = elements[i];
String name = elem.getName();
if (name.equals("stop")) {
offset[count] = elem.getFloatAttribute("offset");
String style = elem.getStringAttribute("style");
HashMap<String, String> styles = parseStyleAttributes(style);
String colorStr = styles.get("stop-color");
if (colorStr == null) colorStr = "#000000";
String opacityStr = styles.get("stop-opacity");
if (opacityStr == null) opacityStr = "1";
int tupacity = (int) (PApplet.parseFloat(opacityStr) * 255);
color[count] = (tupacity << 24) |
Integer.parseInt(colorStr.substring(1), 16);
count++;
}
}
}
}
class LinearGradient extends Gradient {
float x1, y1, x2, y2;
public LinearGradient(PShapeSVG parent, XMLElement properties) {
super(parent, properties);
this.x1 = properties.getFloatAttribute("x1");
this.y1 = properties.getFloatAttribute("y1");
this.x2 = properties.getFloatAttribute("x2");
this.y2 = properties.getFloatAttribute("y2");
String transformStr =
properties.getStringAttribute("gradientTransform");
if (transformStr != null) {
float t[] = parseMatrix(transformStr).get(null);
this.transform = new AffineTransform(t[0], t[3], t[1], t[4], t[2], t[5]);
Point2D t1 = transform.transform(new Point2D.Float(x1, y1), null);
Point2D t2 = transform.transform(new Point2D.Float(x2, y2), null);
this.x1 = (float) t1.getX();
this.y1 = (float) t1.getY();
this.x2 = (float) t2.getX();
this.y2 = (float) t2.getY();
}
}
}
class RadialGradient extends Gradient {
float cx, cy, r;
public RadialGradient(PShapeSVG parent, XMLElement properties) {
super(parent, properties);
this.cx = properties.getFloatAttribute("cx");
this.cy = properties.getFloatAttribute("cy");
this.r = properties.getFloatAttribute("r");
String transformStr =
properties.getStringAttribute("gradientTransform");
if (transformStr != null) {
float t[] = parseMatrix(transformStr).get(null);
this.transform = new AffineTransform(t[0], t[3], t[1], t[4], t[2], t[5]);
Point2D t1 = transform.transform(new Point2D.Float(cx, cy), null);
Point2D t2 = transform.transform(new Point2D.Float(cx + r, cy), null);
this.cx = (float) t1.getX();
this.cy = (float) t1.getY();
this.r = (float) (t2.getX() - t1.getX());
}
}
}
class LinearGradientPaint implements Paint {
float x1, y1, x2, y2;
float[] offset;
int[] color;
int count;
float opacity;
public LinearGradientPaint(float x1, float y1, float x2, float y2,
float[] offset, int[] color, int count,
float opacity) {
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
this.offset = offset;
this.color = color;
this.count = count;
this.opacity = opacity;
}
public PaintContext createContext(ColorModel cm,
Rectangle deviceBounds, Rectangle2D userBounds,
AffineTransform xform, RenderingHints hints) {
Point2D t1 = xform.transform(new Point2D.Float(x1, y1), null);
Point2D t2 = xform.transform(new Point2D.Float(x2, y2), null);
return new LinearGradientContext((float) t1.getX(), (float) t1.getY(),
(float) t2.getX(), (float) t2.getY());
}
public int getTransparency() {
return TRANSLUCENT; // why not.. rather than checking each color
}
public class LinearGradientContext implements PaintContext {
int ACCURACY = 2;
float tx1, ty1, tx2, ty2;
public LinearGradientContext(float tx1, float ty1, float tx2, float ty2) {
this.tx1 = tx1;
this.ty1 = ty1;
this.tx2 = tx2;
this.ty2 = ty2;
}
public void dispose() { }
public ColorModel getColorModel() { return ColorModel.getRGBdefault(); }
public Raster getRaster(int x, int y, int w, int h) {
WritableRaster raster =
getColorModel().createCompatibleWritableRaster(w, h);
int[] data = new int[w * h * 4];
// make normalized version of base vector
float nx = tx2 - tx1;
float ny = ty2 - ty1;
float len = (float) Math.sqrt(nx*nx + ny*ny);
if (len != 0) {
nx /= len;
ny /= len;
}
int span = (int) PApplet.dist(tx1, ty1, tx2, ty2) * ACCURACY;
if (span <= 0) {
//System.err.println("span is too small");
// annoying edge case where the gradient isn't legit
int index = 0;
for (int j = 0; j < h; j++) {
for (int i = 0; i < w; i++) {
data[index++] = 0;
data[index++] = 0;
data[index++] = 0;
data[index++] = 255;
}
}
} else {
int[][] interp = new int[span][4];
int prev = 0;
for (int i = 1; i < count; i++) {
int c0 = color[i-1];
int c1 = color[i];
int last = (int) (offset[i] * (span-1));
//System.out.println("last is " + last);
for (int j = prev; j <= last; j++) {
float btwn = PApplet.norm(j, prev, last);
interp[j][0] = (int) PApplet.lerp((c0 >> 16) & 0xff, (c1 >> 16) & 0xff, btwn);
interp[j][1] = (int) PApplet.lerp((c0 >> 8) & 0xff, (c1 >> 8) & 0xff, btwn);
interp[j][2] = (int) PApplet.lerp(c0 & 0xff, c1 & 0xff, btwn);
interp[j][3] = (int) (PApplet.lerp((c0 >> 24) & 0xff, (c1 >> 24) & 0xff, btwn) * opacity);
//System.out.println(j + " " + interp[j][0] + " " + interp[j][1] + " " + interp[j][2]);
}
prev = last;
}
int index = 0;
for (int j = 0; j < h; j++) {
for (int i = 0; i < w; i++) {
//float distance = 0; //PApplet.dist(cx, cy, x + i, y + j);
//int which = PApplet.min((int) (distance * ACCURACY), interp.length-1);
float px = (x + i) - tx1;
float py = (y + j) - ty1;
// distance up the line is the dot product of the normalized
// vector of the gradient start/stop by the point being tested
int which = (int) ((px*nx + py*ny) * ACCURACY);
if (which < 0) which = 0;
if (which > interp.length-1) which = interp.length-1;
//if (which > 138) System.out.println("grabbing " + which);
data[index++] = interp[which][0];
data[index++] = interp[which][1];
data[index++] = interp[which][2];
data[index++] = interp[which][3];
}
}
}
raster.setPixels(0, 0, w, h, data);
return raster;
}
}
}
class RadialGradientPaint implements Paint {
float cx, cy, radius;
float[] offset;
int[] color;
int count;
float opacity;
public RadialGradientPaint(float cx, float cy, float radius,
float[] offset, int[] color, int count,
float opacity) {
this.cx = cx;
this.cy = cy;
this.radius = radius;
this.offset = offset;
this.color = color;
this.count = count;
this.opacity = opacity;
}
public PaintContext createContext(ColorModel cm,
Rectangle deviceBounds, Rectangle2D userBounds,
AffineTransform xform, RenderingHints hints) {
return new RadialGradientContext();
}
public int getTransparency() {
return TRANSLUCENT;
}
public class RadialGradientContext implements PaintContext {
int ACCURACY = 5;
public void dispose() {}
public ColorModel getColorModel() { return ColorModel.getRGBdefault(); }
public Raster getRaster(int x, int y, int w, int h) {
WritableRaster raster =
getColorModel().createCompatibleWritableRaster(w, h);
int span = (int) radius * ACCURACY;
int[][] interp = new int[span][4];
int prev = 0;
for (int i = 1; i < count; i++) {
int c0 = color[i-1];
int c1 = color[i];
int last = (int) (offset[i] * (span - 1));
for (int j = prev; j <= last; j++) {
float btwn = PApplet.norm(j, prev, last);
interp[j][0] = (int) PApplet.lerp((c0 >> 16) & 0xff, (c1 >> 16) & 0xff, btwn);
interp[j][1] = (int) PApplet.lerp((c0 >> 8) & 0xff, (c1 >> 8) & 0xff, btwn);
interp[j][2] = (int) PApplet.lerp(c0 & 0xff, c1 & 0xff, btwn);
interp[j][3] = (int) (PApplet.lerp((c0 >> 24) & 0xff, (c1 >> 24) & 0xff, btwn) * opacity);
}
prev = last;
}
int[] data = new int[w * h * 4];
int index = 0;
for (int j = 0; j < h; j++) {
for (int i = 0; i < w; i++) {
float distance = PApplet.dist(cx, cy, x + i, y + j);
int which = PApplet.min((int) (distance * ACCURACY), interp.length-1);
data[index++] = interp[which][0];
data[index++] = interp[which][1];
data[index++] = interp[which][2];
data[index++] = interp[which][3];
}
}
raster.setPixels(0, 0, w, h, data);
return raster;
}
}
}
protected Paint calcGradientPaint(Gradient gradient) {
if (gradient instanceof LinearGradient) {
LinearGradient grad = (LinearGradient) gradient;
return new LinearGradientPaint(grad.x1, grad.y1, grad.x2, grad.y2,
grad.offset, grad.color, grad.count,
opacity);
} else if (gradient instanceof RadialGradient) {
RadialGradient grad = (RadialGradient) gradient;
return new RadialGradientPaint(grad.cx, grad.cy, grad.r,
grad.offset, grad.color, grad.count,
opacity);
}
return null;
}
protected Paint calcGradientPaint(Gradient gradient,
float x1, float y1, float x2, float y2) {
if (gradient instanceof LinearGradient) {
LinearGradient grad = (LinearGradient) gradient;
return new LinearGradientPaint(x1, y1, x2, y2,
grad.offset, grad.color, grad.count,
opacity);
}
throw new RuntimeException("Not a linear gradient.");
}
protected Paint calcGradientPaint(Gradient gradient,
float cx, float cy, float r) {
if (gradient instanceof RadialGradient) {
RadialGradient grad = (RadialGradient) gradient;
return new RadialGradientPaint(cx, cy, r,
grad.offset, grad.color, grad.count,
opacity);
}
throw new RuntimeException("Not a radial gradient.");
}
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
protected void styles(PGraphics g) {
super.styles(g);
if (g instanceof PGraphicsJava2D) {
PGraphicsJava2D p2d = (PGraphicsJava2D) g;
if (strokeGradient != null) {
p2d.strokeGradient = true;
p2d.strokeGradientObject = strokeGradientPaint;
} else {
// need to shut off, in case parent object has a gradient applied
//p2d.strokeGradient = false;
}
if (fillGradient != null) {
p2d.fillGradient = true;
p2d.fillGradientObject = fillGradientPaint;
} else {
// need to shut off, in case parent object has a gradient applied
//p2d.fillGradient = false;
}
}
}
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
//public void drawImpl(PGraphics g) {
// do nothing
//}
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/**
* Get a particular element based on its SVG ID. When editing SVG by hand,
* this is the id="" tag on any SVG element. When editing from Illustrator,
* these IDs can be edited by expanding the layers palette. The names used
* in the layers palette, both for the layers or the shapes and groups
* beneath them can be used here.
* <PRE>
* // This code grabs "Layer 3" and the shapes beneath it.
* SVG layer3 = svg.get("Layer 3");
* </PRE>
*/
public PShape getChild(String name) {
PShape found = super.getChild(name);
if (found != null) return found;
// otherwise try with underscores instead of spaces
return super.getChild(name.replace(' ', '_'));
}
/**
* Prints out the SVG document. Useful for parsing.
*/
public void print() {
PApplet.println(element.toString());
}
}
| [
"[email protected]"
]
| |
f6b26d98948cd613f578023dd5528dbf1990b150 | faea897caba7ca92bf83268c60a978015e791d6c | /src/models/Backpack.java | b7a21904035a44bc4a51ae5d09367dac0da0966e | []
| no_license | alexander-koronovskiy/bigNumberUi | f7d175a1d8a51cb99e652634af456dc3e9dd842d | 57a00898d5613ed83c38c1e52f8b6e90ce8f7d14 | refs/heads/master | 2020-04-21T18:58:02.425905 | 2019-02-26T17:14:27 | 2019-02-26T17:14:27 | 169,789,548 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,467 | java | package models;
import java.sql.*;
import java.util.ArrayList;
public class Backpack {
public void insertData(Connection connection, String object,float volume, float value) {
try {
String sql = "INSERT INTO backpack VALUES (?,?,?)";
PreparedStatement stat = connection.prepareStatement(sql);
stat.setString(1,object);
stat.setFloat(2, volume);
stat.setFloat(3, value);
stat.executeUpdate();
System.out.println("Данные добавлены: " + object + " " + volume + " " + value);
} catch (Exception e){
System.out.println("Не могу выполнить запрос");
e.printStackTrace();
}
}
public String printLast(Connection connection){
String s = "";
try {
Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet result1 = statement.executeQuery
("SELECT * FROM backpack order by id desc limit 1;");
while (result1.next()) {
s = s + result1.getInt("id") + " "
+ result1.getString("object") + " "
+ result1.getFloat("volume") + " "
+ result1.getFloat("value");
}
} catch (Exception e){e.printStackTrace(); }
return s;
}
public ArrayList printAll(Connection connection){
ArrayList notes = new ArrayList();
try {
Statement statement = connection.createStatement();
ResultSet result1 = statement.executeQuery
("SELECT * FROM backpack;");
while (result1.next()) {
notes.add(result1.getInt("id") + " "
+ result1.getString("object") + " "
+ result1.getFloat("volume") + " "
+ result1.getFloat("value"));
}
} catch (Exception e){e.printStackTrace(); }
return notes;
}
public ArrayList printVolume(Connection connection){
ArrayList notes = new ArrayList<>();
try {
Statement statement = connection.createStatement();
ResultSet result1 = statement.executeQuery
("SELECT * FROM backpack;");
while (result1.next()) {
notes.add(result1.getFloat("volume"));
}
} catch (Exception e){e.printStackTrace(); }
return notes;
}
public ArrayList printValue(Connection connection){
ArrayList notes = new ArrayList<>();
try {
Statement statement = connection.createStatement();
ResultSet result1 = statement.executeQuery
("SELECT * FROM backpack;");
while (result1.next()) {
notes.add(result1.getFloat("value"));
}
} catch (Exception e){e.printStackTrace(); }
return notes;
}
public String DeleteAll(Connection connection){
String s1 = "";
try {
Statement statement = connection.createStatement();
statement.executeUpdate("DELETE FROM backpack;");
s1 = "Содержимое удалено";
}catch (Exception e){ s1 = "Ошибка удаления"; e.printStackTrace();}
finally {
return s1;
}
}
}
| [
"[email protected]"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.