blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 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
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ab3cf4d43a53804be5bd67c7777044794e1fdf7a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_816efb1b017296103650239e7e927b65d4435d3d/Fits/2_816efb1b017296103650239e7e927b65d4435d3d_Fits_t.java | 8685fde24b5e731c3f5b60ead33eb53864d2ec3f | [] | 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 | 20,061 | java | /*
* Copyright 2009 Harvard University Library
*
* This file is part of FITS (File Information Tool Set).
*
* FITS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FITS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with FITS. If not, see <http://www.gnu.org/licenses/>.
*/
package edu.harvard.hul.ois.fits;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionGroup;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;
import org.apache.log4j.Logger;
import org.jdom.Document;
import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;
import edu.harvard.hul.ois.fits.consolidation.ToolOutputConsolidator;
import edu.harvard.hul.ois.fits.exceptions.FitsConfigurationException;
import edu.harvard.hul.ois.fits.exceptions.FitsException;
import edu.harvard.hul.ois.fits.mapping.FitsXmlMapper;
import edu.harvard.hul.ois.fits.tools.Tool;
import edu.harvard.hul.ois.fits.tools.Tool.RunStatus;
import edu.harvard.hul.ois.fits.tools.ToolBelt;
import edu.harvard.hul.ois.fits.tools.ToolOutput;
import edu.harvard.hul.ois.ots.schemas.XmlContent.XmlContent;
/**
* The main class for FITS.
*/
public class Fits {
private static Logger logger;
public static volatile String FITS_HOME;
public static String FITS_XML;
public static String FITS_TOOLS;
public static XMLConfiguration config;
public static FitsXmlMapper mapper;
public static boolean validateToolOutput;
public static boolean enableStatistics;
public static String externalOutputSchema;
public static String internalOutputSchema;
public static int maxThreads = 20; // GDM 16-Nov-2012
public static final String XML_NAMESPACE = "http://hul.harvard.edu/ois/xml/ns/fits/fits_output";
public static String VERSION = "0.8";
private ToolOutputConsolidator consolidator;
private static XMLOutputFactory xmlOutputFactory = XMLOutputFactory.newInstance();
private ToolBelt toolbelt;
private static boolean traverseDirs;
public Fits() throws FitsException {
this( null );
}
public Fits( String fits_home ) throws FitsConfigurationException {
// Set BB_HOME dir with environment variable
FITS_HOME = System.getenv( "FITS_HOME" );
if (FITS_HOME == null) {
// if env variable not set check for fits_home passed into constructor
if (fits_home != null) {
FITS_HOME = fits_home;
} else {
// if fits_home is still not set use the current directory
FITS_HOME = "";
}
}
// If fits home is not an empty string and doesn't send with a file
// separator character, add one
if (FITS_HOME.length() > 0 && !FITS_HOME.endsWith( File.separator )) {
FITS_HOME = FITS_HOME + File.separator;
}
FITS_XML = FITS_HOME + "xml" + File.separator;
FITS_TOOLS = FITS_HOME + "tools" + File.separator;
// Set up logging.
// Now using an explicit properties file, because otherwoise DROID will
// hijack it, and it's cleaner this way anyway.
//(SM 1/2/14 -- Note that this statement probably isn't doing what the author intended.
// If log4j.debug=true is set then it shows that this doesn't actually find the specified
// log4j.properties file. Leaving as is for now since overall logging works as intended.
// also note that any logging statements in this class probably do not work.
System.setProperty( "log4j.configuration", FITS_TOOLS + "log4j.properties" );
logger = Logger.getLogger( this.getClass() );
try {
config = new XMLConfiguration( FITS_XML + "fits.xml" );
} catch (ConfigurationException e) {
logger.fatal( "Error reading " + FITS_XML + "fits.xml: " + e.getClass().getName() );
throw new FitsConfigurationException( "Error reading " + FITS_XML + "fits.xml", e );
}
try {
mapper = new FitsXmlMapper();
} catch (Exception e) {
logger.fatal( "Error creating FITS XML Mapper: " + e.getClass().getName() );
throw new FitsConfigurationException( "Error creating FITS XML Mapper", e );
}
// required config values
try {
validateToolOutput = config.getBoolean( "output.validate-tool-output" );
externalOutputSchema = config.getString( "output.external-output-schema" );
internalOutputSchema = config.getString( "output.internal-output-schema" );
enableStatistics = config.getBoolean( "output.enable-statistics" );
} catch (NoSuchElementException e) {
logger.fatal( "Error in configuration file: " + e.getClass().getName() );
System.out.println( "Error inconfiguration file: " + e.getMessage() );
return;
}
// optional config values GDM 16-Nov-2012
try {
maxThreads = config.getShort( "process.max-threads" );
} catch (NoSuchElementException e) {
}
if (maxThreads < 1) {
// If invalid number specified, use a default.
maxThreads = 20;
}
logger.debug( "Maximum threads = " + maxThreads );
String consolidatorClass = config.getString( "output.dataConsolidator[@class]" );
try {
Class<?> c = Class.forName( consolidatorClass );
consolidator = (ToolOutputConsolidator) c.newInstance();
} catch (Exception e) {
throw new FitsConfigurationException( "Error initializing " + consolidatorClass, e );
}
toolbelt = new ToolBelt( FITS_XML + "fits.xml" );
}
public static void main( String[] args ) throws FitsException, IOException, ParseException, XMLStreamException {
Options options = new Options();
options.addOption( "i", true, "input file or directory" );
options.addOption( "r", false, "process directories recursively when -i is a directory " );
options.addOption( "o", true, "output file or directory if -i is a directory" );
options.addOption( "h", false, "print this message" );
options.addOption( "v", false, "print version information" );
OptionGroup outputOptions = new OptionGroup();
Option stdxml = new Option( "x", false, "convert FITS output to a standard metadata schema" );
Option combinedStd = new Option( "xc", false, "output using a standard metadata schema and include FITS xml" );
outputOptions.addOption( stdxml );
outputOptions.addOption( combinedStd );
options.addOptionGroup( outputOptions );
CommandLineParser parser = new GnuParser();
CommandLine cmd = parser.parse( options, args );
if (cmd.hasOption( "h" )) {
printHelp( options );
System.exit( 0 );
}
if (cmd.hasOption( "v" )) {
System.out.println( Fits.VERSION );
System.exit( 0 );
}
if (cmd.hasOption( "r" )) {
traverseDirs = true;
} else {
traverseDirs = false;
}
if (cmd.hasOption( "i" )) {
String input = cmd.getOptionValue( "i" );
File inputFile = new File( input );
if (inputFile.isDirectory()) {
String outputDir = cmd.getOptionValue( "o" );
if (outputDir == null || !(new File( outputDir ).isDirectory())) {
throw new FitsException(
"When FITS is run in directory processing mode the output location must be a directory" );
}
Fits fits = new Fits();
fits.doDirectory( inputFile, new File( outputDir ), cmd.hasOption( "x" ), cmd.hasOption( "xc" ) );
} else {
Fits fits = new Fits();
FitsOutput result = fits.doSingleFile( inputFile );
fits.outputResults( result, cmd.getOptionValue( "o" ), cmd.hasOption( "x" ), cmd.hasOption( "xc" ), false );
}
} else {
System.err.println( "Invalid CLI options" );
printHelp( options );
System.exit( -1 );
}
System.exit( 0 );
}
/**
* Recursively processes all files in the directory.
*
* @param intputFile
* @param useStandardSchemas
* @throws IOException
* @throws XMLStreamException
* @throws FitsException
*/
private void doDirectory(File inputDir, File outputDir,boolean useStandardSchemas, boolean standardCombinedFormat) throws FitsException, XMLStreamException, IOException {
if(inputDir.listFiles() == null) {
return;
}
logger.info("Processing directory " + inputDir.getAbsolutePath());
for (File f : inputDir.listFiles()) {
if(f == null || !f.exists() || !f.canRead()) {
continue;
}
logger.info("processing " + f.getPath());
if (f.isDirectory() && traverseDirs) {
doDirectory(f, outputDir, useStandardSchemas, standardCombinedFormat);
} else if (f.isFile()) {
if (".DS_Store".equals(f.getName())) {
// Mac hidden directory services file, ignore
logger.debug("Skipping .DS_Store");
continue;
}
FitsOutput result = doSingleFile(f);
String outputFile = outputDir.getPath() + File.separator + f.getName() + ".fits.xml";
File output = new File(outputFile);
if (output.exists()) {
int cnt = 1;
while (true) {
outputFile = outputDir.getPath() + File.separator + f.getName() + "-" + cnt + ".fits.xml";
output = new File(outputFile);
if (!output.exists()) {
break;
}
cnt++;
}
}
outputResults(result, outputFile, useStandardSchemas,
standardCombinedFormat, true);
}
}
}
/**
* processes a single file and outputs to the provided output location.
* Outputs to standard out if outputLocation is null
*
* @param inputFile
* @param outputLocation
* @param useStandardSchemas
* - use standard schemas if available for output type
* @throws FitsException
* @throws XMLStreamException
* @throws IOException
*/
private FitsOutput doSingleFile( File inputFile ) throws FitsException, XMLStreamException, IOException {
logger.debug( "Processing file " + inputFile.getAbsolutePath() );
FitsOutput result = this.examine( inputFile );
if (result.getCaughtExceptions().size() > 0) {
for (Exception e : result.getCaughtExceptions()) {
System.err.println( "Warning: " + e.getMessage() );
}
}
return result;
}
private void outputResults( FitsOutput result, String outputLocation, boolean standardSchema,
boolean standardCombinedFormat, boolean dirMode ) throws XMLStreamException, IOException, FitsException {
OutputStream out = null;
logger.debug( "Outputting results" );
try {
// figure out the output location
if (outputLocation != null) {
out = new FileOutputStream( outputLocation );
} else if (!dirMode) {
out = System.out;
} else {
throw new FitsException( "The output location must be provided when running FITS in directory mode" );
}
// if -x is set, then convert to standard metadata schema and output to -o
if (standardSchema) {
outputStandardSchemaXml( result, out );
}
// if we are using -xc output FITS xml and standard format
else if (standardCombinedFormat) {
outputStandardCombinedFormat( result, out );
}
// else output FITS XML to -o
else {
Document doc = result.getFitsXml();
XMLOutputter serializer = new XMLOutputter( Format.getPrettyFormat() );
serializer.output( doc, out );
}
} finally {
if (out != null) {
out.close();
}
}
}
public static void outputStandardCombinedFormat( FitsOutput result, OutputStream out ) throws XMLStreamException,
IOException, FitsException {
// add the normal fits xml output
result.addStandardCombinedFormat();
// output the merged JDOM Document
XMLOutputter serializer = new XMLOutputter( Format.getPrettyFormat() );
serializer.output( result.getFitsXml(), out );
}
public static void outputStandardSchemaXml( FitsOutput fitsOutput, OutputStream out ) throws XMLStreamException,
IOException {
XmlContent xml = fitsOutput.getStandardXmlContent();
// create an xml output factory
Transformer transformer = null;
// initialize transformer for pretty print xslt
TransformerFactory tFactory = TransformerFactory.newInstance();
String prettyPrintXslt = FITS_XML + "prettyprint.xslt";
try {
Templates template = tFactory.newTemplates( new StreamSource( prettyPrintXslt ) );
transformer = template.newTransformer();
} catch (Exception e) {
transformer = null;
}
if (xml != null && transformer != null) {
xml.setRoot( true );
ByteArrayOutputStream xmlOutStream = new ByteArrayOutputStream();
OutputStream xsltOutStream = new ByteArrayOutputStream();
try {
// send standard xml to the output stream
XMLStreamWriter sw = xmlOutputFactory.createXMLStreamWriter( xmlOutStream );
xml.output( sw );
// convert output stream to byte array and read back in as inputstream
Source source = new StreamSource( new ByteArrayInputStream( xmlOutStream.toByteArray() ) );
Result rstream = new StreamResult( xsltOutStream );
// apply the xslt
transformer.transform( source, rstream );
// send to the providedOutpuStream
out.write( xsltOutStream.toString().getBytes( "UTF-8" ) );
out.flush();
} catch (Exception e) {
System.err.println( "error converting output to a standard schema format" );
} finally {
xmlOutStream.close();
xsltOutStream.close();
}
} else {
System.err.println( "Error: output cannot be converted to a standard schema format for this file" );
}
}
private static void printHelp( Options opts ) {
HelpFormatter formatter = new HelpFormatter();
formatter.printHelp( "fits", opts );
}
/*
* ORIGINAL EXAMINE METHOD WITHOUT THREADS
*
* public FitsOutput examineOriginal(File input) throws FitsException {
* if(!input.exists()) { throw new
* FitsConfigurationException(input+" does not exist or is not readable"); }
*
* List<ToolOutput> toolResults = new ArrayList<ToolOutput>();
*
* //run file through each tool, catching exceptions thrown by tools
* List<Exception> caughtExceptions = new ArrayList<Exception>(); String path
* = input.getPath().toLowerCase(); String ext =
* path.substring(path.lastIndexOf(".")+1); for(Tool t : toolbelt.getTools())
* { if(t.isEnabled()) { if(!t.hasExcludedExtension(ext)) { try { ToolOutput
* tOutput = t.extractInfo(input); toolResults.add(tOutput); } catch(Exception
* e) { caughtExceptions.add(e); } } } }
*
*
* // consolidate the results into a single DOM FitsOutput result =
* consolidator.processResults(toolResults);
* result.setCaughtExceptions(caughtExceptions);
*
* for(Tool t: toolbelt.getTools()) { t.resetOutput(); }
*
* return result; }
*/
public FitsOutput examine( File input ) throws FitsException {
long t1 = System.currentTimeMillis();
if (!input.exists()) {
throw new FitsConfigurationException( input + " does not exist or is not readable" );
}
List<ToolOutput> toolResults = new ArrayList<ToolOutput>();
// run file through each tool, catching exceptions thrown by tools
List<Exception> caughtExceptions = new ArrayList<Exception>();
String path = input.getPath().toLowerCase();
String ext = path.substring( path.lastIndexOf( "." ) + 1 );
ArrayList<Thread> threads = new ArrayList<Thread>();
// GDM 16-Nov-12: Implement limit on maximum threads
for (Tool t : toolbelt.getTools()) {
if (t.isEnabled()) {
// figure out of the tool should be run against the file depending on
// the include and exclude extension lists
RunStatus runStatus = RunStatus.SHOULDNOTRUN;
// if the tool has an include-exts list and it has the extension in it,
// then run
if (t.hasIncludedExtensions()) {
if (t.hasIncludedExtension( ext )) {
runStatus = RunStatus.SHOULDRUN;
}
}
// if the tool has an exclude-exts list and it does NOT have the
// extension in it, then run
else if (t.hasExcludedExtensions()) {
if (!t.hasExcludedExtension( ext )) {
runStatus = RunStatus.SHOULDRUN;
}
}
// if the tool does not have an include-exts or exclude-exts list then
// run
else if (!t.hasIncludedExtensions() && !t.hasExcludedExtensions()) {
runStatus = RunStatus.SHOULDRUN;
}
t.setRunStatus( runStatus );
if (runStatus == RunStatus.SHOULDRUN) {
// Don't exceed the maximum thread count
while (countActiveTools( threads ) >= maxThreads) {
try {
Thread.sleep( 200 );
} catch (InterruptedException e) {
}
}
// spin up new threads
t.setInputFile( input );
// GDM 16-Nov-12: Name the threads as a debugging aid
Thread thread = new Thread( t, t.getToolInfo().getName() );
threads.add( thread );
logger.debug( "Starting thread " + thread.getName() );
thread.start();
}
}
}
// wait for them all to finish
for (Thread thread : threads) {
try {
thread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
// get all output from the tools
for (Tool t : toolbelt.getTools()) {
toolResults.add( t.getOutput() );
}
// consolidate the results into a single DOM
FitsOutput result = consolidator.processResults( toolResults );
result.setCaughtExceptions( caughtExceptions );
long t2 = System.currentTimeMillis();
if (enableStatistics) {
result.createStatistics( toolbelt, ext, t2 - t1 );
}
for (Tool t : toolbelt.getTools()) {
t.resetOutput();
}
return result;
}
public ToolBelt getToolbelt() {
return toolbelt;
}
/* Count up all the threads that are still running */
private int countActiveTools( List<Thread> threads ) {
int count = 0;
for (Thread t : threads) {
if (t.isAlive()) {
++count;
}
}
return count;
}
}
| [
"[email protected]"
] | |
8225dc1aa89913915ff9e5f2efaebd9fbc46c9d7 | b4f6337124ff5fd2e2cfd4fe475bdc7996559c97 | /TiboHulensEJB/src/java/entity/Person.java | 19c8e05ddf1bed59c472d85e948e1e259278be54 | [] | no_license | tiboke1992/EindWerkDistrAPPS | b4fbe21e42351a74328e83fffa0a0c6df4484b2d | 9e6902a1c693756d603c39cf91dfe52740b92ab0 | refs/heads/master | 2021-04-09T16:56:45.625826 | 2012-12-02T15:02:39 | 2012-12-02T15:02:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,533 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package entity;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
/**
*
* @author Tibo
*/
@Entity
public class Person implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String naam;
public String getNaam(){
return this.naam;
}
public void setNaam(String naam){
this.naam = naam;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Person)) {
return false;
}
Person other = (Person) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "entity.Person[ id=" + id + " ]";
}
}
| [
"[email protected]"
] | |
fc7dd26dae4399de42b669db2053a4296688ced0 | c8568b77ad88e925c09c292571ff3dca5c7574fc | /app/src/main/java/fi/tamk/jorix3/dreamcrusher/MainActivity.java | 95b78dc0a0890c198bed39c1642d432db572fe12 | [] | no_license | jorix3/DreamCrusher | 3aee39c7bd0ccb8905c4ce943b9dd36e1d0ce2b2 | 28584ed3cd547206398f87d8f6069d58f860e8f2 | refs/heads/master | 2021-09-05T19:18:48.393270 | 2018-01-30T13:51:19 | 2018-01-30T13:51:19 | 119,542,263 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,669 | java | package fi.tamk.jorix3.dreamcrusher;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Color;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
public class MainActivity extends AppCompatActivity {
private SortedSet<Integer> selectedNumbers;
private int threadSleepValue;
private boolean isLottoRunning = false;
private int lvl = 7;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MyDebug.loadMyDebug(this, "MainActivity");
selectedNumbers = new TreeSet<>();
BroadcastReceiver broadcastListener = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
MyDebug.loadMyDebug(context, "MainActivity:MyBroadCastListener");
Bundle bundle = intent.getExtras();
if (bundle != null) {
Set<String> keys = bundle.keySet();
resetButtonStyles();
for (String key : keys) {
if (key.equals("weeks")) {
TextView textView = findViewById(R.id.notifications);
String text = "Weeks passed: " + bundle.getInt(key);
textView.setText(text);
} else {
int value = bundle.getInt(key);
Button button = findViewById(getResources().
getIdentifier("B" + value, "id",
context.getPackageName()));
button.setBackgroundResource(android.R.drawable.btn_star_big_on);
}
MyDebug.print("onReceive",
"" + bundle.getInt(key), 4);
}
}
}
};
threadSleepValue = 510;
LocalBroadcastManager.getInstance(this).
registerReceiver(broadcastListener,
new IntentFilter("LottoService"));
resetButtonStyles();
}
public void sendBroadcast() {
String intentTag = "MainActivity";
LocalBroadcastManager manager =
LocalBroadcastManager.getInstance(this);
Intent intent = new Intent(intentTag);
intent.putExtra("speed", threadSleepValue);
manager.sendBroadcast(intent);
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
MenuItem plus = menu.findItem(R.id.plus);
MenuItem minus = menu.findItem(R.id.minus);
plus.setEnabled(true);
minus.setEnabled(true);
return true;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.mainmenu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
super.onOptionsItemSelected(item);
switch (item.getItemId()) {
case (R.id.plus):
Toast.makeText(this, "+", Toast.LENGTH_SHORT).show();
if (threadSleepValue > 10) {
threadSleepValue = threadSleepValue - 100;
sendBroadcast();
}
return true;
case (R.id.minus):
Toast.makeText(this, "-", Toast.LENGTH_SHORT).show();
if (threadSleepValue < 5000) {
threadSleepValue = threadSleepValue + 100;
sendBroadcast();
}
return true;
case (R.id.lvl7):
lvl = 7;
resetGame();
return true;
case (R.id.lvl6):
lvl = 6;
resetGame();
return true;
case (R.id.lvl5):
lvl = 5;
resetGame();
return true;
}
return false;
}
public void resetGame() {
Intent lottoIntent = new Intent(this, LottoService.class);
Button button = findViewById(R.id.lucky_button);
isLottoRunning = false;
selectedNumbers = new TreeSet<>();
threadSleepValue = 510;
stopService(lottoIntent);
button.setText("I Feel Lucky");
resetButtonStyles();
resetButtonTextColors();
}
public void resetButtonStyles() {
for (int i = 0; i < 39; i++) {
int value = i + 1;
Button button = findViewById(getResources().
getIdentifier("B" + value, "id",
this.getPackageName()));
button.setBackgroundResource(android.R.drawable.btn_default);
}
}
public void resetButtonTextColors() {
for (int i = 0; i < 39; i++) {
int value = i + 1;
Button button = findViewById(getResources().
getIdentifier("B" + value, "id",
this.getPackageName()));
button.setTextColor(Color.BLACK);
}
}
public void selectNumber(View v) {
Button button = (Button) v;
int value;
try {
value = Integer.parseInt(button.getText().toString());
} catch (NullPointerException | NumberFormatException e) {
e.printStackTrace();
MyDebug.print("selectNumber", "Error getting button number", 2);
return;
}
if (selectedNumbers.contains(value)) {
selectedNumbers.remove(value);
button.setTextColor(Color.BLACK);
MyDebug.print("selectNumber", "removed " + value, 2);
} else if (selectedNumbers.size() < lvl) {
selectedNumbers.add(value);
button.setTextColor(Color.rgb(0, 128, 0));
MyDebug.print("selectNumber", "added " + value, 2);
}
}
public void iFeelLucky(View v) {
for (int i : selectedNumbers) {
MyDebug.print("iFeelLucky", "current numbers: " + i, 2);
}
Intent lottoIntent = new Intent(this, LottoService.class);
Button button = findViewById(R.id.lucky_button);
if (!isLottoRunning && selectedNumbers.size() == lvl) {
int key = 0;
lottoIntent.putExtra("speed", threadSleepValue);
for (int number : selectedNumbers) {
lottoIntent.putExtra(String.valueOf(key), number);
key++;
}
startService(lottoIntent);
button.setText("I Give Up");
isLottoRunning = true;
} else {
stopService(lottoIntent);
button.setText("I Feel Lucky");
isLottoRunning = false;
}
}
}
| [
"[email protected]"
] | |
4499e06bddec3a1ad09eea5a317c5964221df35b | ed3cb95dcc590e98d09117ea0b4768df18e8f99e | /project_1_3/src/j/c/h/Calc_1_3_9275.java | 0ca4bd69a26b8d581e828ca72fe0d8e64c3b964c | [] | no_license | chalstrick/bigRepo1 | ac7fd5785d475b3c38f1328e370ba9a85a751cff | dad1852eef66fcec200df10083959c674fdcc55d | refs/heads/master | 2016-08-11T17:59:16.079541 | 2015-12-18T14:26:49 | 2015-12-18T14:26:49 | 48,244,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 131 | java | package j.c.h;
public class Calc_1_3_9275 {
/** @return the sum of a and b */
public int add(int a, int b) {
return a+b;
}
}
| [
"[email protected]"
] | |
2ba2914012a41d383e55bbbb60d355ecc5662374 | 5629da1eaa5a347262c80c9907eb9e36732e00e0 | /JAVA/TestingSystem_Assignment_07/src/com/vti/entity/Student2.java | 94e201c1be9529af917d6e3c100ec4bd64bae3d2 | [] | no_license | trungkienNUCE/Rocket_13 | ac38ec2df206ce7eb613a014202ec844a6ece143 | 17a7cc741b6594266c7699a2a07a00b903b0b25b | refs/heads/master | 2023-05-31T13:45:36.886971 | 2021-06-16T05:00:04 | 2021-06-16T05:00:04 | 360,833,966 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 470 | java | package com.vti.entity;
public class Student2 {
private final int id;
private String name;
public Student2(int id, String name) {
this.id = id;
this.name = name;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
@Override
public String toString() {
return "Student{" + "name='" + getId() + '\'' + "name='" + name + '\'' + '}';
}
public final static void study() {
System.out.println("Đang học bài…");
}
}
| [
"[email protected]"
] | |
9c1488afac58799769128097512c6f8921ccc0c5 | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/test/com/alibaba/json/bvt/serializer/stream/StreamWriterTest_writeValueString1.java | 47f543bf2695794654310acb8b0ab87e242c6e65 | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 744 | java | package com.alibaba.json.bvt.serializer.stream;
import SerializerFeature.BrowserCompatible;
import com.alibaba.fastjson.serializer.SerializeWriter;
import java.io.StringWriter;
import junit.framework.TestCase;
import org.junit.Assert;
public class StreamWriterTest_writeValueString1 extends TestCase {
public void test_0() throws Exception {
StringWriter out = new StringWriter();
SerializeWriter writer = new SerializeWriter(out, 10);
writer.config(BrowserCompatible, true);
Assert.assertEquals(10, writer.getBufferLength());
writer.writeString("abcde12345678\t");
writer.close();
String text = out.toString();
Assert.assertEquals("\"abcde12345678\\t\"", text);
}
}
| [
"[email protected]"
] | |
ce833eaabd0598fd53fac408d9a01bc9976e616d | 4c63a7cf53de6bc07fbec891e1ee7c07d44c321c | /src/main/java/de/workshops/bookdemo/books/BookRepository.java | 54d2a7bd9b9ad17aae7799e58943a1e315ae34af | [] | no_license | workshops-de/spring-boot-example | 68f7ed2c8276f148c1d579e1289ec08ee8b36f4d | a8557e66ca00ec82315e9301252cd603eac2a42e | refs/heads/master | 2022-07-07T17:40:38.933972 | 2020-05-12T08:01:21 | 2020-05-12T08:01:21 | 259,620,456 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,151 | java | package de.workshops.bookdemo.books;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
//@Repository
public class BookRepository {
@NonNull
private ObjectMapper mapper;
List<Book> books = new ArrayList<Book>();
public List<Book> findAll() throws Exception {
books.addAll(Arrays.asList(mapper.readValue(new File("target/classes/books.json"), Book[].class)));
return books;
}
public Optional<Book> findByIsbn(String isbn) throws Exception {
return Arrays.asList(mapper.readValue(new File("target/classes/books.json"), Book[].class))
.stream().filter(book -> book.getIsbn().equalsIgnoreCase(isbn)).findFirst();
}
public Book create(Book book) {
books.add(book);
return book;
}
}
| [
"[email protected]"
] | |
d17b27423808ddda843bdcd9c3c18c5b45aeac88 | ead62c4cc5ca63cd5fa5e12f95b74d806f024107 | /src/PageObjects/SendReportMailer.java | 6381e650797bb43b5186f2b42e6fb8f26183d33d | [] | no_license | GlobalAutomationGrp/MyProject | debd7fe7f4094d3a48807e6d70bb3d30e896f631 | 8c1cc871dd969d991f3bd0bd6c9997386ee848bd | refs/heads/master | 2021-01-01T05:05:11.402060 | 2016-05-06T08:39:43 | 2016-05-06T08:39:43 | 58,191,755 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,655 | java | package PageObjects;
import java.util.Properties;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.activation.FileDataSource;
import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
public class SendReportMailer
{
public static void main(String args[])
{
//Properties props = System.getProperties();
Properties props = new Properties();
/* props.put("mail.smtp.host", "mail.lexmark.com");
props.put("mail.smtp.auth", "false");
props.put("mail.smtp.debug", "true");*/
/** SET MAIL PROPERTIES INTO SESSION */
// Session session = Session.getDefaultInstance(props);
// System.out.println("Start Mail sending");
//Message message = new MimeMessage(session);
/** SET SENDER NAME */
// message.setFrom(new InternetAddress(mailFrom
String host = "squeeze.dhcp.indiadev.lexmark.com";
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.host", host);
props.put("mail.smtp.user", "[email protected]");
props.put("mail.smtp.password", "nettest");
props.put("mail.smtp.port", "587");
props.put("mail.smtp.ssl.trust", host);
props.put("mail.smtp.auth", "true");
Session session = Session.getDefaultInstance(props);
MimeMessage message = new MimeMessage(session);
try {
//Set from address
message.setFrom(new InternetAddress("[email protected]"));
message.addRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
String subject="Test report ZIP file";
message.setSubject(subject);
message.setText("");
BodyPart objMessageBodyPart = new MimeBodyPart();
objMessageBodyPart.setText("Please Find The Attached Report File!");
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(objMessageBodyPart);
objMessageBodyPart = new MimeBodyPart();
//Set path to the pdf report file
String filename = System.getProperty("user.dir")+"/XSLT_Reports/output.zip";
//Create data source to attach the file in mail
DataSource source = new FileDataSource(filename);
objMessageBodyPart.setDataHandler(new DataHandler(source));
objMessageBodyPart.setFileName(filename);
multipart.addBodyPart(objMessageBodyPart);
message.setContent(multipart);
Transport transport = session.getTransport("smtp");
transport.connect(host, "[email protected]", "nettest");
transport.sendMessage(message, message.getAllRecipients());
transport.close();
}
catch (AddressException ae) {
ae.printStackTrace();
}
catch (MessagingException me) {
me.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
dfc6b865cb522b05c8ad79e6c0d368ef3f0d4630 | af7b787325afeb7023147481718f66664c0dfb57 | /Day-11/DeadlockSolution1.java | f59c5c14627043813bc4073f7687443c2604522d | [] | no_license | radhikachanda/java-learning | e5e953bd53d0362165ae113504ad158fc10c8c29 | bb7735fd3f073c278f93fb27b83c2d4ae91d5557 | refs/heads/main | 2023-03-12T12:24:54.817166 | 2021-03-05T19:01:20 | 2021-03-05T19:01:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,220 | java | public class DeadlockSolution1 {
public static Object Lock1 = new Object();
public static Object Lock2 = new Object();
public static void main(String args[]) {
ThreadDemo1 T1 = new ThreadDemo1();
ThreadDemo2 T2 = new ThreadDemo2();
T1.start();
T2.start();
}
private static class ThreadDemo1 extends Thread {
public void run() {
//there can be additional logic where no critical section code is there
synchronized (Lock1) {
System.out.println("Thread 1: Holding lock 1...");
try {
Thread.sleep(10);
} catch (InterruptedException e) {
}
System.out.println("Thread 1: Waiting for lock 2...");
synchronized (Lock2) {
System.out.println("Thread 1: Holding lock 1 & 2...");
}
}
//there can be additional logic where no critical section code is there
}
}
private static class ThreadDemo2 extends Thread {
public void run() {
synchronized (Lock1) {
System.out.println("Thread 2: Holding lock 1...");
try {
Thread.sleep(10);
} catch (InterruptedException e) {
}
System.out.println("Thread 2: Waiting for lock 2...");
synchronized (Lock2) {
System.out.println("Thread 2: Holding lock 1 & 2...");
}
}
}
}
} | [
"[email protected]"
] | |
53cdf509e1f9dce95ecfce0cfad52c20a00deb81 | d0e1ac9f7bdbcc580c38d059f1dbb6451b8478b5 | /test/relaytask/AuthenticationTest.java | 2a41b00845ba7859091d54d04220b39854f30aed | [] | no_license | small1pharoh/Reply-task | fd80d70821643f7ebff11e20933ccb1e5ba9692f | ba921a3f6987bc021791f5c80278587b56ea8119 | refs/heads/master | 2020-03-25T22:02:08.606558 | 2018-08-09T21:51:20 | 2018-08-09T21:51:20 | 144,202,324 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,441 | java | package relaytask;
import static org.junit.jupiter.api.Assertions.*;
import java.util.logging.FileHandler;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import userInterface.buttonOperation;
import userInterface.inputVerification;
class AuthenticationTest {
static Logger logger = Logger.getLogger("MyLog");
static FileHandler fh;
@BeforeAll
static void setUpBeforeClass() throws Exception {
try {
// This block configure the logger with handler and formatter
fh = new FileHandler("AuthenticationTest.log");
logger.addHandler(fh);
CustomRecordFormatter formatter = new CustomRecordFormatter();
fh.setFormatter(formatter);
} catch (SecurityException e) {
e.printStackTrace();
}
}
@AfterAll
static void tearDownAfterClass() throws Exception {
}
@BeforeEach
void setUp() throws Exception {
}
@AfterEach
void tearDown() throws Exception {
}
@Test
void test() {
inputVerification inpVer = new inputVerification();
buttonOperation butOp = new buttonOperation();
logger.info("###################################################");
logger.info("########### AuthenticationTest #################");
logger.info("###################################################");
logger.info("I will create a new user for test called testrobot");
String username = "testrobot";
String gender = "Male";
String age = "30";
String output = inpVer.registerButton(username, gender, age);
assertEquals(output,"1");
output = butOp.registerOperButton(username, gender, age);
assertEquals(output,"New user is added successfully");
logger.info("A new user is add successfully");
logger.info("test Pass");
logger.info("--------------------------------------------------------------------");
logger.info("I will try to login with the new user");
String input = "testrobot";
output = inpVer.loginButton(input);
assertEquals(output,"1");
output = butOp.loginOperButton(input);
assertEquals(output,butOp.getUserobj().getUsername()+" is login successfully");
logger.info("I can login with the testrobot");
logger.info("test Pass");
logger.info("--------------------------------------------------------------------");
logger.info("I will try to update the new user");
age = "50";
output = inpVer.updateuserinfoButtom(age);
assertEquals(output,"1");
output = butOp.updateuserinfo("" ,"",age);
assertEquals(output,"User information are updated successfully relogin with you new information");
logger.info("The user information is update successfully");
logger.info("test Pass");
logger.info("--------------------------------------------------------------------");
logger.info("I will try to re login with the new info");
input = "testrobot";
output = inpVer.loginButton(input);
assertEquals(output,"1");
output = butOp.loginOperButton(input);
assertEquals(output,butOp.getUserobj().getUsername()+" is login successfully");
logger.info("I can login with the testrobot");
logger.info("test Pass");
logger.info("--------------------------------------------------------------------");
logger.info("I will try to logout from my account");
input = "testrobot";
output = butOp.logoutOprButton();
assertEquals(output,"1");
logger.info("I can logout from my account");
logger.info("test Pass");
logger.info("--------------------------------------------------------------------");
logger.info("I will try to login and remove my account");
input = "testrobot";
output = inpVer.loginButton(input);
assertEquals(output,"1");
output = butOp.loginOperButton(input);
assertEquals(output,butOp.getUserobj().getUsername()+" is login successfully");
output = butOp.deregisterOperButton();
assertEquals(output,"User removed successfully");
logger.info("I can remove my account");
logger.info("test Pass");
logger.info("--------------------------------------------------------------------");
logger.info("--------------------------------------------------------------------");
}
}
| [
"amer0@DESKTOP-3TST333"
] | amer0@DESKTOP-3TST333 |
ef6243a39507b804965ea53287690427c84ada0c | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/10/10_564ef2858cf8a41f0bf62af1c7dae6d83c526a6b/ViewApplication/10_564ef2858cf8a41f0bf62af1c7dae6d83c526a6b_ViewApplication_t.java | 08a50dbe89ab2088eda7a53dee72026f4f596c78 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 6,523 | java | package com.sun.identity.admin.model;
import com.sun.identity.admin.ManagedBeanResolver;
import com.sun.identity.admin.Resources;
import com.sun.identity.admin.dao.ViewApplicationTypeDao;
import com.sun.identity.entitlement.Application;
import com.sun.identity.entitlement.ApplicationManager;
import com.sun.identity.entitlement.EntitlementException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class ViewApplication implements Serializable {
private String name;
private ViewApplicationType viewApplicationType;
private List<Resource> resources = new ArrayList<Resource>();
private List<Action> actions = new ArrayList<Action>();
private List<ConditionType> conditionTypes = new ArrayList<ConditionType>();
private List<SubjectType> subjectTypes = new ArrayList<SubjectType>();
public ViewApplication(Application a) {
ManagedBeanResolver mbr = new ManagedBeanResolver();
name = a.getName();
// application type
Map<String, ViewApplicationType> entitlementApplicationTypeToViewApplicationTypeMap = (Map<String, ViewApplicationType>) mbr.resolve("entitlementApplicationTypeToViewApplicationTypeMap");
viewApplicationType = entitlementApplicationTypeToViewApplicationTypeMap.get(a.getApplicationType().getName());
// resources
for (String resourceString : a.getResources()) {
Resource r;
try {
r = (Resource) Class.forName(viewApplicationType.getResourceClassName()).newInstance();
} catch (ClassNotFoundException cnfe) {
throw new RuntimeException(cnfe);
} catch (InstantiationException ie) {
throw new RuntimeException(ie);
} catch (IllegalAccessException iae) {
throw new RuntimeException(iae);
}
r.setName(resourceString);
resources.add(r);
}
// actions
for (String actionName : a.getActions().keySet()) {
Boolean value = a.getActions().get(actionName);
BooleanAction ba = new BooleanAction();
ba.setName(actionName);
ba.setAllow(value.booleanValue());
actions.add(ba);
}
// conditions
ConditionTypeFactory ctf = (ConditionTypeFactory) mbr.resolve("conditionTypeFactory");
for (String viewConditionClassName : a.getConditions()) {
Class c;
try {
c = Class.forName(viewConditionClassName);
} catch (ClassNotFoundException cnfe) {
// TODO: log
continue;
}
ConditionType ct = ctf.getConditionType(c);
assert (ct != null);
conditionTypes.add(ct);
}
// subjects
SubjectFactory sf = (SubjectFactory) mbr.resolve("subjectFactory");
for (String viewSubjectClassName : a.getSubjects()) {
SubjectType st = sf.getSubjectType(viewSubjectClassName);
assert (st != null);
subjectTypes.add(st);
}
}
public List<SubjectContainer> getSubjectContainers() {
ManagedBeanResolver mbr = new ManagedBeanResolver();
SubjectFactory sf = (SubjectFactory) mbr.resolve("subjectFactory");
List<SubjectContainer> subjectContainers = new ArrayList<SubjectContainer>();
for (SubjectType st : subjectTypes) {
SubjectContainer sc = sf.getSubjectContainer(st);
if (sc != null && sc.isVisible()) {
subjectContainers.add(sc);
}
}
return subjectContainers;
}
public List<SubjectType> getExpressionSubjectTypes() {
List<SubjectType> ests = new ArrayList<SubjectType>();
for (SubjectType st: subjectTypes) {
if (st.isExpression()) {
ests.add(st);
}
}
return ests;
}
public List<ConditionType> getExpressionConditionTypes() {
List<ConditionType> ects = new ArrayList<ConditionType>();
for (ConditionType ct: conditionTypes) {
if (ct.isExpression()) {
ects.add(ct);
}
}
return ects;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTitle() {
Resources r = new Resources();
String title = r.getString(this, "title." + name);
return title;
}
public ViewApplicationType getViewApplicationType() {
return viewApplicationType;
}
public void setViewApplicationType(ViewApplicationType viewApplicationType) {
this.viewApplicationType = viewApplicationType;
}
public List<Resource> getResources() {
return resources;
}
public void setResources(List<Resource> resources) {
this.resources = resources;
}
public List<Action> getActions() {
return actions;
}
public void setActions(List<Action> actions) {
this.actions = actions;
}
public Application toApplication(ViewApplicationTypeDao viewApplicationTypeDao) {
//
// this is really just modifies the applications.
//
// TODO: realm
Application app = ApplicationManager.getApplication("/", name);
// resources
Set<String> resourceStrings = new HashSet<String>();
for (Resource r : resources) {
resourceStrings.add(r.getName());
}
app.addResources(resourceStrings);
// actions
Map appActions = app.getActions();
for (Action action : actions) {
if (!appActions.containsKey(action.getName())) {
try {
app.addAction(action.getName(), (Boolean) action.getValue());
} catch (EntitlementException ex) {
//TODO
}
}
}
// conditions
//TODO
return app;
}
public List<ConditionType> getConditionTypes() {
return conditionTypes;
}
public void setConditionTypes(List<ConditionType> conditionTypes) {
this.conditionTypes = conditionTypes;
}
}
| [
"[email protected]"
] | |
95b09dda59362e9a2a1b7b80dfc258640ae82e89 | 6bd94f2d729bae4a1fabaae613c727f24dcd19bf | /src/main/java/com/designpatterns/structuralpatterns/decorator/BurgerDecorator.java | ea992386ca938dff5bfc8e847bdce56ca0ae4246 | [] | no_license | MuhammadSobhy/DesignPatterns | 24c84ebbfa158a50b9c30795ab5cba7c2a77ec8e | ec3fd1af2e2fb395a3f44aee3e62cdbbac2050f6 | refs/heads/master | 2022-11-11T06:00:15.899993 | 2020-06-25T12:44:34 | 2020-06-25T12:44:34 | 272,435,811 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 282 | java | package com.designpatterns.structuralpatterns.decorator;
public class BurgerDecorator implements Burger{
private Burger burger;
public BurgerDecorator(Burger burger) {
super();
this.burger = burger;
}
@Override
public void prepare() {
this.burger.prepare();
}
}
| [
"[email protected]"
] | |
40d777cc70ea9090d550af6497896786e1e71994 | b75855675310ecaeb39b035b746a37cf7bf40c5c | /src/GCTest/HellowGC1.java | 79a5c487cf5f871c04416c126eb1142526876c6c | [] | no_license | cwc972135903/ThreadMulti | 151431bd1d7fe24c2d2d8951ed5b497cb4bcf07d | 95c1b295f5dc83c6fa1a49df0256e0235721a1e4 | refs/heads/master | 2023-03-28T16:09:39.175261 | 2021-04-04T13:23:13 | 2021-04-04T13:23:13 | 348,916,324 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package GCTest;
/**
* <p>Title: xCRMS </p>
* Description: <br>
* Copyright: CorpRights xQuant.com<br>
* Company: xQuant.com<br>
*
* @author wenchao.chai
* @version 1.1.1.RELEASE
* @date 2020/3/28 13:17
*/
public class HellowGC1 {
public static void main(String ...args){
System.out.println("HelloGC");
}
}
| [
"[email protected]"
] | |
233368287f3be4af7aab28891ef6b82aa8cbd758 | 8ed00ffe74f1cb78b7fb3c49d4059228a4e25950 | /Java/code/5/JLab0504B/src/Pet.java | eef53164ad4d5cbdfc67d394d12a3c57c5c8ed56 | [] | no_license | DeercoderCourse/Course-Project | 9bbeab3b80a6c82a6eb4f046971640632d42a5d8 | 507d8c05aa598d5230b0b413945e986feab3db4c | refs/heads/master | 2021-01-18T20:25:00.539992 | 2013-04-04T10:21:25 | 2013-04-04T10:21:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 127 | java |
public interface Pet {
public String getName();
public String move();
public String speak();
public String toString();
}
| [
"[email protected]"
] | |
65a3e796a0dfae517ca3272e207b7fb1664dd944 | 3d5e6745a6b46a0e0197430642fdbf0901ba6a20 | /demo/restful/src/main/java/com/yuruicai/test/resfull/service/serviceImpl/UserServiceImpl.java | e4a2eb6288d8c8b9c1d3a7ca4066532751de8945 | [] | no_license | yuruicai/demo-sptingboot | d43e064ea3b88b0e5f48251476fee532d186f416 | dfc8736f22fa84750fd93eeda62ece1d1f44b093 | refs/heads/master | 2022-08-09T08:35:33.653654 | 2019-11-02T15:15:33 | 2019-11-02T15:15:33 | 184,198,905 | 0 | 0 | null | 2022-06-21T02:09:36 | 2019-04-30T05:43:25 | JavaScript | UTF-8 | Java | false | false | 844 | java | package com.yuruicai.test.resfull.service.serviceImpl;
import com.yuruicai.test.resfull.dao.UserRepository;
import com.yuruicai.test.resfull.domin.User;
import com.yuruicai.test.resfull.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class UserServiceImpl implements UserService {
@Autowired
ApplicationEventPublisher applicationEventPublisher;
@Autowired
private UserRepository userRepository;
@Transactional
public Object selectUser(long userId){
User byName = userRepository.findById(userId);
applicationEventPublisher.publishEvent(byName);
return byName;
}
}
| [
"[email protected]"
] | |
2ea47ae83e3b45fc96d5d6ae2f4414438de052b8 | 7209ad8300f5b3911f56bb928c4da90e338d72f4 | /cool-meeting/src/com/zrgj/UI/Controller/check_roleController.java | 52cb813335457ad58088851c243902834e4bc254 | [] | no_license | bobli1128/CoolMeeting | a13b92e8eed840b0a67aad39b4bc913ab2069fd5 | 13e3e53afe8ffd6bc84ac5ab170c14467673bf5f | refs/heads/master | 2020-04-16T09:17:16.415240 | 2019-01-20T11:18:44 | 2019-01-20T11:18:44 | 165,458,263 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 724 | java | package com.zrgj.UI.Controller;
import java.io.IOException;
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.zrgj.BLL.RoleService;
@WebServlet(value={"/roleManage/check.do"})
public class check_roleController extends HttpServlet {
private RoleService service=new RoleService();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setAttribute("roles", service.getUncheckedRoles());
req.getRequestDispatcher("/roleManage/check_people.jsp").forward(req, resp);
}
}
| [
"[email protected]"
] | |
1fa3c393bf306e02daca797e91cefc2bd3b1f5b3 | 4ebed2b8e8b7b4156deadf597b1662170ccd6917 | /Spring-Boot/1-Boot-Core/src/main/java/com/cts/product/Application.java | 9c481f43086b79925d8e200a666493d67753968a | [] | no_license | tracksdata/sme-connectt | 3c6507eada3ae0a77151725e78c9acad69749b98 | 003e00d3dd7970956f2cd0f55221ab0f7d9f0f1b | refs/heads/master | 2023-06-01T23:30:51.964408 | 2021-06-15T04:59:21 | 2021-06-15T04:59:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 653 | java | package com.cts.product;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import com.cts.product.service.ProductService;
import com.cts.product.service.TestServiceImpl;
@SpringBootApplication // Auto Discovery
public class Application {
public static void main(String[] args) {
ApplicationContext ac = SpringApplication.run(Application.class, args);
TestServiceImpl ps1 = ac.getBean(TestServiceImpl.class);
//ProductService ps2 = ac.getBean(ProductService.class);
ps1.process();
//ps2.f1();
}
}
| [
"[email protected]"
] | |
393a0e7be9bed6e29c5d7ed66c7b83e29e5650aa | 0ccccc208aa55273764aa593779e8fdc1ca7fa76 | /WeatherStationJava/CurrentConditionsDisplay.java | 0f37fb2173e407333a6dd33c8607a4a42cb18290 | [] | no_license | zuzhi/head-first-design-patterns | 295a2ebf2a194cc35db282b1eeb42ad5b698784a | f29c4cee5adaf03dfd3bf18b1030f482850afc6d | refs/heads/master | 2020-04-12T08:31:02.476027 | 2019-01-08T09:19:18 | 2019-01-08T09:19:18 | 162,387,063 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 955 | java | import java.util.Observable;
import java.util.Observer;
public class CurrentConditionsDisplay implements Observer, DisplayElement {
Observable observable;
private float temperature;
private float humidity;
private float pressure;
public CurrentConditionsDisplay(Observable observable) {
this.observable = observable;
observable.addObserver(this);
}
public void update(Observable obs, Object arg) {
if (obs instanceof WeatherData) {
WeatherData weatherData = (WeatherData)obs;
this.temperature = weatherData.getTemperature();
this.humidity = weatherData.getHumidity();
this.pressure = weatherData.getPressure();
display();
}
}
public void display() {
System.out.println("Current conditions: " + temperature
+ "F degrees, " + humidity + "% humidity and " + pressure
+ "in pressure.");
}
} | [
"[email protected]"
] | |
03de611153cc71a7c161bb0a72a31671d7291c76 | 9b27636b2781fede56805c6514cc5983f46741b9 | /src/test/java/com/faceye/test/feature/util/MathUtilsTestCase.java | d7d5e13100ddedb55ad98ff6ce95372b3dd7edf5 | [] | no_license | haipenge/faceye-boot-jpa | d05338e242c8eec92d57e2e1ae4d0b9f1295ee9d | 72b50137c49865a307abd659c8af80971bfeca81 | refs/heads/master | 2020-03-07T08:12:44.632397 | 2018-03-30T02:26:20 | 2018-03-30T02:26:20 | 127,371,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 408 | java | package com.faceye.test.feature.util;
import org.junit.Assert;
import org.junit.Test;
import com.faceye.feature.util.MathUtil;
import com.faceye.test.feature.service.BaseTestCase;
public class MathUtilsTestCase extends BaseTestCase {
@Test
public void testRand() throws Exception{
int rand =MathUtil.getRandInt(0, 10);
logger.debug(">>FaceYe --> rand is:"+rand);
Assert.assertTrue(rand>0);
}
}
| [
"[email protected]"
] | |
d3f5ecd28f3ba13f26032e3ed45c3ea0e6bb3415 | 6c936d20cd8c526cb18d69c81eeaf826d7e02b30 | /MyConsole/src/test/java/com/jeff/intern/MyConsole/ReadDataTest.java | 875bdb03a2f2cc2647cb17cec595c19d6ef471b5 | [] | no_license | zyj177484/AddressBook2 | c0d3a65a6c94519d0057930818e4bce735ba8bf6 | 6aaeab43e01fb441d0a76fa09ad94edcd79593d7 | refs/heads/master | 2021-01-17T08:50:00.936391 | 2013-05-25T03:22:15 | 2013-05-25T03:22:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,533 | java | package com.jeff.intern.MyConsole;
import java.io.File;
import java.io.Reader;
import java.io.StringReader;
import net.sf.json.JSONObject;
import org.junit.* ;
import static org.junit.Assert.* ;
public class ReadDataTest {
private ReadData readData=new ReadData();
@Test
public void testBuildJsonObject() throws DataException
{
Reader reader=new StringReader("{\"lilei\":{\"age\":12}}");
JSONObject jsonObject=new JSONObject();
jsonObject.put("age", 12);
JSONObject jsonObject2=new JSONObject();
jsonObject2.put("lilei", jsonObject);
JSONObject jsonObject3=new JSONObject();
jsonObject3.put("root", jsonObject2);
JSONObject temp=ReadData.buildJsonObject(reader);
assertEquals(temp,jsonObject3);
}
@Test
public void testBuildData() throws Exception
{
File file = new File("newFile");
JSONObject jsonO1=new JSONObject();
JSONObject jsonO2=new JSONObject();
jsonO2.put("root", jsonO1);
assertEquals(ReadData.buildData(file),jsonO2);
file = new File("oldFile");
JSONObject jsonObject=new JSONObject();
jsonObject.put("age", 12);
JSONObject jsonObject2=new JSONObject();
jsonObject2.put("lilei", jsonObject);
JSONObject jsonObject3=new JSONObject();
jsonObject3.put("root", jsonObject2);
assertEquals(ReadData.buildData(file),jsonObject3);
}
}
| [
"[email protected]"
] | |
07153097fbd30c1178c825169fe0902110b77b45 | bbc42646d24002abb5db8265415b1442efdd129c | /Java/JavaPatternsAndOther/DDD/infrastructure/src/main/java/dev/gaudnik/infrastructure/BeanConfiguration.java | e4726793859818fdf551a6b39a4926280cb9a669 | [] | no_license | wojciechGaudnik/Learning | 223a162ddddc59aa4cfe49471ce08ba25587cf1b | dfffd4ddd453edf7667fe94b0fb4367235579424 | refs/heads/master | 2023-03-09T02:21:47.975665 | 2023-01-22T16:09:51 | 2023-01-22T16:09:51 | 201,742,343 | 0 | 0 | null | 2023-03-01T05:35:15 | 2019-08-11T09:10:46 | C | UTF-8 | Java | false | false | 351 | java | package dev.gaudnik.infrastructure;
import dev.gaudnik.domain.OrderRepository;
import dev.gaudnik.domain.OrderService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
class BeanConfiguration {
@Bean
OrderService orderService(OrderRepository orderRepository) {
}
}
| [
"[email protected]"
] | |
931cb2d3da6ede6dce0777867724f8886a28f544 | c88cd25ebd6cea7772a59b209f440ddf7411d655 | /src/com/yihen/jdb/business/UserImpl.java | 34829f2f631248c942109516f79f73c0ac67ff1c | [] | no_license | FrostySmile/JDB | c7494a39205c223074d4bde9c531fab865a9d7a9 | b75d5cc8e8572f949f33079513ffdbd47c92b1a9 | refs/heads/master | 2021-01-10T17:22:39.238764 | 2015-09-28T07:29:01 | 2015-09-28T07:29:01 | 43,285,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,381 | java | package com.yihen.jdb.business;
import com.google.gson.reflect.TypeToken;
import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.client.HttpRequest;
import com.yihen.jdb.bean.URLs;
import com.yihen.jdb.bean.ViewModel.Result;
import com.yihen.jdb.bean.ViewModel.UserViewModel;
import com.yihen.jdb.net.HttpUtilsExtension;
import com.yihen.jdb.tools.JsonConverter;
import java.io.IOException;
/**
* @author Yuanbin
* @ProjectName: jdb_app
* @Description:
* @date 15-2-15 上午10:55
*/
public class UserImpl implements IUserLab{
private HttpUtils httpUtils;
public UserImpl(){
httpUtils = new HttpUtils();
}
@Override
public UserViewModel login(String userName, String password) {
try {
String string = httpUtils.sendSync(HttpRequest.HttpMethod.GET, "http://192.168.1.121:8080/rest/customer/login.htm?loginName=" + userName + "&loginPwd=" + password).readString();
Result<UserViewModel> result = JsonConverter.deserialize(string, new TypeToken<Result<UserViewModel>>(){}.getType());
} catch (HttpException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
public boolean loginOut(String userName) {
return false;
}
}
| [
"[email protected]"
] | |
6c1f9a5f07c93cb66cc62646f1a6b3cd1a9b4745 | 813c58dd28ee4959b628104233d2f30100259f95 | /src/test/java/test2/Goods.java | 023a402206e061b5e6bdc994dd9fff1328a3ed33 | [] | no_license | kunlun327/lianxi | ddb6192f0f348ad9e1e28bf7565812d1fcb16592 | daafc1bca8c2ec2792123bf42b28f3fe542e404d | refs/heads/master | 2022-12-10T12:05:55.330305 | 2020-09-16T12:08:02 | 2020-09-16T12:08:02 | 295,449,989 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,234 | java | package test2;
import java.util.Date;
public class Goods {
private String name;
private double price;
private String detail;
private Date creattime;
public Goods(String name, double price, String detail, Date creattime) {
this.name = name;
this.price = price;
this.detail = detail;
this.creattime = creattime;
}
public Goods() {
}
@Override
public String toString() {
return "Goods{" +
"name='" + name + '\'' +
", price=" + price +
", detail='" + detail + '\'' +
", creattime=" + creattime +
'}';
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public Date getCreattime() {
return creattime;
}
public void setCreattime(Date creattime) {
this.creattime = creattime;
}
}
| [
"[email protected]"
] | |
c08b4abcd68f767e62ffbc96a9cf2e7dcaef2788 | c1abc8d334a405a5536ab4fe2d1504c5ba0cd289 | /Back-End/BusReservationSystem/src/main/java/com/lti/dto/ForgotPassDto.java | b197e767d3bcf5e726ba735d5abf83685eda8313 | [] | no_license | akshatra/Bus-Management-System | 989efb58c51d7e613b8cf96a2259186d9a592fec | 34c89c2727c426d7d98c4f4da3da1defbeea8ee0 | refs/heads/master | 2023-01-20T16:25:39.162893 | 2020-12-03T07:55:33 | 2020-12-03T07:55:33 | 289,874,103 | 1 | 6 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | package com.lti.dto;
public class ForgotPassDto {
private String email;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
} | [
"[email protected]"
] | |
f2d6f680a56653248300afac08d9e6785f08e39b | edf7dc42337f0f644c5217afb9048acda2b22bea | /src/main/java/de/vs/monopoly/client/ClientInterface2.java | 29d17af108174ab937d22914802618c22c113d73 | [] | no_license | d-is/Monopoly | 8a92f3f8b1692da9c458d581c06b8c9c1f542b34 | 948c148db2c292bb8e1727262d3063e0cd6d594d | refs/heads/master | 2016-08-11T14:17:36.287152 | 2016-01-13T14:30:53 | 2016-01-13T14:30:53 | 44,614,034 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | package de.vs.monopoly.client;
import de.vs.monopoly.model.Game;
import de.vs.monopoly.model.Roll;
import retrofit.Call;
import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.POST;
import retrofit.http.PUT;
import retrofit.http.Path;
public interface ClientInterface2 {
@GET("/dice")
Call<Roll> dice();
}
| [
"[email protected]"
] | |
28b2181916524d95a0164e806a3c2f631eb1cb2c | 0d1b0ac6015aca84136811d8e152b947d55643db | /app/src/main/java/com/ext/adarsh/Fragment/MarketMyAddFragment.java | 5c5ae9d9ce6255fc5e67fafc66752a56cdcba662 | [] | no_license | Rajuvaghela/DemoProject | ab244666a120f468c09001d296c46b7d1c34a965 | 73730dfe07764fb665ccaa47172381dae346e7e4 | refs/heads/master | 2021-01-24T00:54:04.189889 | 2018-02-24T22:24:29 | 2018-02-24T22:24:29 | 122,785,119 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,550 | java | package com.ext.adarsh.Fragment;
import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Base64;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkError;
import com.android.volley.NoConnectionError;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.ServerError;
import com.android.volley.TimeoutError;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.ext.adarsh.Activity.MarketActivity;
import com.ext.adarsh.Activity.MarketCreateMyAddsActivity;
import com.ext.adarsh.Adapter.AdapterMarket;
import com.ext.adarsh.Adapter.AdapterMarketCategory;
import com.ext.adarsh.Adapter.AdapterMyAdvMarket;
import com.ext.adarsh.Bean.BeanMarket;
import com.ext.adarsh.Bean.BeanMarketCategory;
import com.ext.adarsh.R;
import com.ext.adarsh.Utils.AppConstant;
import com.ext.adarsh.Utils.Infranet;
import com.ext.adarsh.Utils.Utility;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import butterknife.BindView;
import butterknife.ButterKnife;
import static com.ext.adarsh.Utils.Utility.checkConnectivity;
import static com.ext.adarsh.Utils.Utility.showMsg;
public class MarketMyAddFragment extends Fragment {
public static RecyclerView recylermarket;
public static ProgressDialog pd;
public static Activity activity;
@BindView(R.id.add_my_adds)
FloatingActionButton add_my_adds;
@BindView(R.id.search_people)
EditText search_people;
public static AdapterMyAdvMarket adapter;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.market_selling_fragment_layout, container, false);
return rootView;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
ButterKnife.bind(this, view);
activity = getActivity();
pd = Utility.getDialog(activity);
if (Utility.getMarketAdd().equalsIgnoreCase("Y")){
add_my_adds.setVisibility(View.VISIBLE);
}else {
add_my_adds.setVisibility(View.GONE);
}
add_my_adds.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(activity, MarketCreateMyAddsActivity.class);
intent.putExtra("add_or_edit", "add");
startActivity(intent);
}
});
recylermarket = (RecyclerView) view.findViewById(R.id.recylermarket);
recylermarket.setHasFixedSize(true);
GridLayoutManager gaggeredGridLayoutManager = new GridLayoutManager(getContext(), 2);
recylermarket.setLayoutManager(gaggeredGridLayoutManager);
recylermarket.setItemAnimator(new DefaultItemAnimator());
getMarketData();
search_people.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) {
adapter.getFilter().filter(s.toString());
}
@Override
public void afterTextChanged(Editable s) {
}
});
}
public static void getMarketData() {
pd.show();
if (checkConnectivity()) {
StringRequest request = new StringRequest(Request.Method.POST, AppConstant.Market_My_Ads_Select_All, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.e(AppConstant.TAG, response);
try {
JSONObject object = new JSONObject(response);
if (object.has("Market_My_Ads_Array")) {
JSONArray jsonArray = object.getJSONArray("Market_My_Ads_Array");
if (jsonArray.length() != 0) {
ArrayList<BeanMarket> beanMarkets = new ArrayList<>();
beanMarkets.addAll((Collection<? extends BeanMarket>) new Gson().fromJson(jsonArray.toString(), new TypeToken<ArrayList<BeanMarket>>() {
}.getType()));
adapter = new AdapterMyAdvMarket(activity, beanMarkets);
recylermarket.setAdapter(adapter);
pd.dismiss();
} else {
recylermarket.setAdapter(null);
pd.dismiss();
}
}
} catch (JSONException e) {
pd.dismiss();
showMsg(R.string.json_error);
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e(AppConstant.TAG, error.toString());
pd.dismiss();
try {
if (error instanceof TimeoutError || error instanceof NoConnectionError) {
showMsg(R.string.time_out_message);
} else if (error instanceof AuthFailureError) {
showMsg(R.string.authentication_message);
} else if (error instanceof ServerError) {
showMsg(R.string.server_message);
} else if (error instanceof NetworkError) {
showMsg(R.string.connection_message);
} else if (error instanceof ParseError) {
showMsg(R.string.parsing_message);
} else {
showMsg(R.string.server_message);
}
} catch (Exception e) {
pd.dismiss();
showMsg(R.string.json_error);
e.printStackTrace();
}
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> map = new HashMap<>();
map.put("Hashkey", Utility.getHashKeyPreference());
map.put("PeopleId", Utility.getPeopleIdPreference());
return map;
}
};
Utility.SetvollyTime30Sec(request);
Infranet.getInstance().getRequestQueue().add(request);
} else {
pd.dismiss();
Toast.makeText(activity, "There is no network connection at the moment.Try again later", Toast.LENGTH_SHORT).show();
}
}
}
| [
"[email protected]"
] | |
a035c6711ea070a13c9325b43a2d013c9cf49a82 | 473b76b1043df2f09214f8c335d4359d3a8151e0 | /benchmark/bigclonebenchdata_partial/14007786.java | 38111f50c34134f4764a6201650bc3267ec097b7 | [] | no_license | whatafree/JCoffee | 08dc47f79f8369af32e755de01c52d9a8479d44c | fa7194635a5bd48259d325e5b0a190780a53c55f | refs/heads/master | 2022-11-16T01:58:04.254688 | 2020-07-13T20:11:17 | 2020-07-13T20:11:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,266 | java |
class c14007786 {
@Override
protected IStatus run(IProgressMonitor monitor) {
final int BUFFER_SIZE = 1024;
final int DISPLAY_BUFFER_SIZE = 8196;
File sourceFile = new File(_sourceFile);
File destFile = new File(_destFile);
if (sourceFile.exists()) {
try {
Log.getInstance(FileCopierJob.class).debug(String.format("Start copy of %s to %s", _sourceFile, _destFile));
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destFile));
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(sourceFile));
monitor.beginTask(Messages.getString("FileCopierJob.MainTask") + " " + _sourceFile, (int) ((sourceFile.length() / DISPLAY_BUFFER_SIZE) + 4));
monitor.worked(1);
byte[] buffer = new byte[BUFFER_SIZE];
int stepRead = 0;
int read;
boolean copying = true;
while (copying) {
read = bis.read(buffer);
if (read > 0) {
bos.write(buffer, 0, read);
stepRead += read;
} else {
copying = false;
}
if (monitor.isCanceled()) {
bos.close();
bis.close();
deleteFile(_destFile);
return Status.CANCEL_STATUS;
}
if (stepRead >= DISPLAY_BUFFER_SIZE) {
monitor.worked(1);
stepRead = 0;
}
}
bos.flush();
bos.close();
bis.close();
monitor.worked(1);
} catch (Exception e) {
processError("Error while copying: " + e.getMessage());
}
Log.getInstance(FileCopierJob.class).debug("End of copy.");
return Status.OK_STATUS;
} else {
processError(Messages.getString("FileCopierJob.ErrorSourceDontExists") + sourceFile.getAbsolutePath());
return Status.CANCEL_STATUS;
}
}
}
| [
"[email protected]"
] | |
a8c4d1039301ec3dba1f623e75cf0584a944c615 | d090eb9ad62dca3177f4125415d49faa1567351b | /Javaeclipse/collectionframework/src/com/ustglobal/collectionframework/list/TestA.java | de1081a67fc7680216d2fb00fb75d72d5ee7c7bb | [] | no_license | manasacidde/USTGlobal-16-Sep19-Ciddemanasa | 68bb8ac5f13c7fbf6e795178da7539f389ce4cba | 2a6989869ad77e1fd0df4d2bd0ef57b45f4ad86e | refs/heads/master | 2023-01-09T00:16:47.028810 | 2019-12-21T13:17:34 | 2019-12-21T13:17:34 | 215,541,004 | 0 | 0 | null | 2023-01-07T13:03:56 | 2019-10-16T12:19:12 | JavaScript | UTF-8 | Java | false | false | 287 | java | package com.ustglobal.collectionframework.list;
import java.util.ArrayList;
public class TestA {
public static void main(String[] args) {
ArrayList al = new ArrayList();
al.add(10);
al.add("manasa");
al.add(true);
for(Object o : al)
{
System.out.println(o);
}
}
}
| [
"[email protected]"
] | |
b4390de18af979f3ff1f2515de2eb14a77e8eaa4 | 9624c8ea680f3e3acc0c2f55265ee88575e08b21 | /cloudalibaba-config-nacos-client3377/src/main/java/com/kiss/controller/ConfigClientController.java | ca6e845af824853114f1791d6e4fdb25c59210ec | [] | no_license | kissn01/springcloud_01 | c887d31fb59d40c8707d09e455a2d991f4af63f9 | 1a65bb965ba77ad830cee8ac93f7b00a39964063 | refs/heads/master | 2022-12-17T18:06:31.846780 | 2020-09-23T12:34:57 | 2020-09-23T12:34:57 | 296,195,262 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 646 | java | package com.kiss.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @ClassName ConfigClientController
* @Description TODO
* @Author kiss
* @Date 2020/9/21 15:53
* @Version 1.0
*/
@RefreshScope
@RestController
public class ConfigClientController
{
@Value("${config.info}")
private String configInfo;
@GetMapping("/config/info")
public String getConfigInfo()
{
return configInfo;
}
}
| [
"[email protected]"
] | |
14180e615b97c70b415f7b10a787f02679886db4 | 3636c15b123684d1ca051cac023168a03f9268db | /app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/v7/appcompat/R.java | b7b3a9e483d224801f5befbaa0cbf49808de8345 | [] | no_license | SOUHAIBMEHEMEL/Retrofit_EXO4 | f498767ef341d843174e4fa485eb3aac440961b9 | 9936e4c0d57598c15de1c55ea7f11e58de548f3f | refs/heads/master | 2022-09-02T16:06:58.477487 | 2020-05-18T02:48:05 | 2020-05-18T02:48:05 | 263,734,468 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 120,814 | 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 {
private R() {}
public static final class anim {
private anim() {}
public static final int abc_fade_in = 0x7f010000;
public static final int abc_fade_out = 0x7f010001;
public static final int abc_grow_fade_in_from_bottom = 0x7f010002;
public static final int abc_popup_enter = 0x7f010003;
public static final int abc_popup_exit = 0x7f010004;
public static final int abc_shrink_fade_out_from_bottom = 0x7f010005;
public static final int abc_slide_in_bottom = 0x7f010006;
public static final int abc_slide_in_top = 0x7f010007;
public static final int abc_slide_out_bottom = 0x7f010008;
public static final int abc_slide_out_top = 0x7f010009;
public static final int abc_tooltip_enter = 0x7f01000a;
public static final int abc_tooltip_exit = 0x7f01000b;
}
public static final class attr {
private attr() {}
public static final int actionBarDivider = 0x7f020000;
public static final int actionBarItemBackground = 0x7f020001;
public static final int actionBarPopupTheme = 0x7f020002;
public static final int actionBarSize = 0x7f020003;
public static final int actionBarSplitStyle = 0x7f020004;
public static final int actionBarStyle = 0x7f020005;
public static final int actionBarTabBarStyle = 0x7f020006;
public static final int actionBarTabStyle = 0x7f020007;
public static final int actionBarTabTextStyle = 0x7f020008;
public static final int actionBarTheme = 0x7f020009;
public static final int actionBarWidgetTheme = 0x7f02000a;
public static final int actionButtonStyle = 0x7f02000b;
public static final int actionDropDownStyle = 0x7f02000c;
public static final int actionLayout = 0x7f02000d;
public static final int actionMenuTextAppearance = 0x7f02000e;
public static final int actionMenuTextColor = 0x7f02000f;
public static final int actionModeBackground = 0x7f020010;
public static final int actionModeCloseButtonStyle = 0x7f020011;
public static final int actionModeCloseDrawable = 0x7f020012;
public static final int actionModeCopyDrawable = 0x7f020013;
public static final int actionModeCutDrawable = 0x7f020014;
public static final int actionModeFindDrawable = 0x7f020015;
public static final int actionModePasteDrawable = 0x7f020016;
public static final int actionModePopupWindowStyle = 0x7f020017;
public static final int actionModeSelectAllDrawable = 0x7f020018;
public static final int actionModeShareDrawable = 0x7f020019;
public static final int actionModeSplitBackground = 0x7f02001a;
public static final int actionModeStyle = 0x7f02001b;
public static final int actionModeWebSearchDrawable = 0x7f02001c;
public static final int actionOverflowButtonStyle = 0x7f02001d;
public static final int actionOverflowMenuStyle = 0x7f02001e;
public static final int actionProviderClass = 0x7f02001f;
public static final int actionViewClass = 0x7f020020;
public static final int activityChooserViewStyle = 0x7f020021;
public static final int alertDialogButtonGroupStyle = 0x7f020022;
public static final int alertDialogCenterButtons = 0x7f020023;
public static final int alertDialogStyle = 0x7f020024;
public static final int alertDialogTheme = 0x7f020025;
public static final int allowStacking = 0x7f020026;
public static final int alpha = 0x7f020027;
public static final int alphabeticModifiers = 0x7f020028;
public static final int arrowHeadLength = 0x7f020029;
public static final int arrowShaftLength = 0x7f02002a;
public static final int autoCompleteTextViewStyle = 0x7f02002b;
public static final int autoSizeMaxTextSize = 0x7f02002c;
public static final int autoSizeMinTextSize = 0x7f02002d;
public static final int autoSizePresetSizes = 0x7f02002e;
public static final int autoSizeStepGranularity = 0x7f02002f;
public static final int autoSizeTextType = 0x7f020030;
public static final int background = 0x7f020031;
public static final int backgroundSplit = 0x7f020032;
public static final int backgroundStacked = 0x7f020033;
public static final int backgroundTint = 0x7f020034;
public static final int backgroundTintMode = 0x7f020035;
public static final int barLength = 0x7f020036;
public static final int borderlessButtonStyle = 0x7f020039;
public static final int buttonBarButtonStyle = 0x7f02003a;
public static final int buttonBarNegativeButtonStyle = 0x7f02003b;
public static final int buttonBarNeutralButtonStyle = 0x7f02003c;
public static final int buttonBarPositiveButtonStyle = 0x7f02003d;
public static final int buttonBarStyle = 0x7f02003e;
public static final int buttonGravity = 0x7f02003f;
public static final int buttonIconDimen = 0x7f020040;
public static final int buttonPanelSideLayout = 0x7f020041;
public static final int buttonStyle = 0x7f020042;
public static final int buttonStyleSmall = 0x7f020043;
public static final int buttonTint = 0x7f020044;
public static final int buttonTintMode = 0x7f020045;
public static final int checkboxStyle = 0x7f020047;
public static final int checkedTextViewStyle = 0x7f020048;
public static final int closeIcon = 0x7f020049;
public static final int closeItemLayout = 0x7f02004a;
public static final int collapseContentDescription = 0x7f02004b;
public static final int collapseIcon = 0x7f02004c;
public static final int color = 0x7f02004d;
public static final int colorAccent = 0x7f02004e;
public static final int colorBackgroundFloating = 0x7f02004f;
public static final int colorButtonNormal = 0x7f020050;
public static final int colorControlActivated = 0x7f020051;
public static final int colorControlHighlight = 0x7f020052;
public static final int colorControlNormal = 0x7f020053;
public static final int colorError = 0x7f020054;
public static final int colorPrimary = 0x7f020055;
public static final int colorPrimaryDark = 0x7f020056;
public static final int colorSwitchThumbNormal = 0x7f020057;
public static final int commitIcon = 0x7f020058;
public static final int contentDescription = 0x7f02005c;
public static final int contentInsetEnd = 0x7f02005d;
public static final int contentInsetEndWithActions = 0x7f02005e;
public static final int contentInsetLeft = 0x7f02005f;
public static final int contentInsetRight = 0x7f020060;
public static final int contentInsetStart = 0x7f020061;
public static final int contentInsetStartWithNavigation = 0x7f020062;
public static final int controlBackground = 0x7f020063;
public static final int coordinatorLayoutStyle = 0x7f020064;
public static final int customNavigationLayout = 0x7f020065;
public static final int defaultQueryHint = 0x7f020066;
public static final int dialogCornerRadius = 0x7f020067;
public static final int dialogPreferredPadding = 0x7f020068;
public static final int dialogTheme = 0x7f020069;
public static final int displayOptions = 0x7f02006a;
public static final int divider = 0x7f02006b;
public static final int dividerHorizontal = 0x7f02006c;
public static final int dividerPadding = 0x7f02006d;
public static final int dividerVertical = 0x7f02006e;
public static final int drawableSize = 0x7f02006f;
public static final int drawerArrowStyle = 0x7f020070;
public static final int dropDownListViewStyle = 0x7f020071;
public static final int dropdownListPreferredItemHeight = 0x7f020072;
public static final int editTextBackground = 0x7f020073;
public static final int editTextColor = 0x7f020074;
public static final int editTextStyle = 0x7f020075;
public static final int elevation = 0x7f020076;
public static final int expandActivityOverflowButtonDrawable = 0x7f020078;
public static final int firstBaselineToTopHeight = 0x7f020079;
public static final int font = 0x7f02007a;
public static final int fontFamily = 0x7f02007b;
public static final int fontProviderAuthority = 0x7f02007c;
public static final int fontProviderCerts = 0x7f02007d;
public static final int fontProviderFetchStrategy = 0x7f02007e;
public static final int fontProviderFetchTimeout = 0x7f02007f;
public static final int fontProviderPackage = 0x7f020080;
public static final int fontProviderQuery = 0x7f020081;
public static final int fontStyle = 0x7f020082;
public static final int fontVariationSettings = 0x7f020083;
public static final int fontWeight = 0x7f020084;
public static final int gapBetweenBars = 0x7f020085;
public static final int goIcon = 0x7f020086;
public static final int height = 0x7f020087;
public static final int hideOnContentScroll = 0x7f020088;
public static final int homeAsUpIndicator = 0x7f020089;
public static final int homeLayout = 0x7f02008a;
public static final int icon = 0x7f02008b;
public static final int iconTint = 0x7f02008c;
public static final int iconTintMode = 0x7f02008d;
public static final int iconifiedByDefault = 0x7f02008e;
public static final int imageButtonStyle = 0x7f02008f;
public static final int indeterminateProgressStyle = 0x7f020090;
public static final int initialActivityCount = 0x7f020091;
public static final int isLightTheme = 0x7f020092;
public static final int itemPadding = 0x7f020093;
public static final int keylines = 0x7f020094;
public static final int lastBaselineToBottomHeight = 0x7f020095;
public static final int layout = 0x7f020096;
public static final int layout_anchor = 0x7f020097;
public static final int layout_anchorGravity = 0x7f020098;
public static final int layout_behavior = 0x7f020099;
public static final int layout_dodgeInsetEdges = 0x7f0200c3;
public static final int layout_insetEdge = 0x7f0200cc;
public static final int layout_keyline = 0x7f0200cd;
public static final int lineHeight = 0x7f0200cf;
public static final int listChoiceBackgroundIndicator = 0x7f0200d0;
public static final int listDividerAlertDialog = 0x7f0200d1;
public static final int listItemLayout = 0x7f0200d2;
public static final int listLayout = 0x7f0200d3;
public static final int listMenuViewStyle = 0x7f0200d4;
public static final int listPopupWindowStyle = 0x7f0200d5;
public static final int listPreferredItemHeight = 0x7f0200d6;
public static final int listPreferredItemHeightLarge = 0x7f0200d7;
public static final int listPreferredItemHeightSmall = 0x7f0200d8;
public static final int listPreferredItemPaddingLeft = 0x7f0200d9;
public static final int listPreferredItemPaddingRight = 0x7f0200da;
public static final int logo = 0x7f0200db;
public static final int logoDescription = 0x7f0200dc;
public static final int maxButtonHeight = 0x7f0200dd;
public static final int measureWithLargestChild = 0x7f0200de;
public static final int multiChoiceItemLayout = 0x7f0200df;
public static final int navigationContentDescription = 0x7f0200e0;
public static final int navigationIcon = 0x7f0200e1;
public static final int navigationMode = 0x7f0200e2;
public static final int numericModifiers = 0x7f0200e3;
public static final int overlapAnchor = 0x7f0200e4;
public static final int paddingBottomNoButtons = 0x7f0200e5;
public static final int paddingEnd = 0x7f0200e6;
public static final int paddingStart = 0x7f0200e7;
public static final int paddingTopNoTitle = 0x7f0200e8;
public static final int panelBackground = 0x7f0200e9;
public static final int panelMenuListTheme = 0x7f0200ea;
public static final int panelMenuListWidth = 0x7f0200eb;
public static final int popupMenuStyle = 0x7f0200ec;
public static final int popupTheme = 0x7f0200ed;
public static final int popupWindowStyle = 0x7f0200ee;
public static final int preserveIconSpacing = 0x7f0200ef;
public static final int progressBarPadding = 0x7f0200f0;
public static final int progressBarStyle = 0x7f0200f1;
public static final int queryBackground = 0x7f0200f2;
public static final int queryHint = 0x7f0200f3;
public static final int radioButtonStyle = 0x7f0200f4;
public static final int ratingBarStyle = 0x7f0200f5;
public static final int ratingBarStyleIndicator = 0x7f0200f6;
public static final int ratingBarStyleSmall = 0x7f0200f7;
public static final int searchHintIcon = 0x7f0200f8;
public static final int searchIcon = 0x7f0200f9;
public static final int searchViewStyle = 0x7f0200fa;
public static final int seekBarStyle = 0x7f0200fb;
public static final int selectableItemBackground = 0x7f0200fc;
public static final int selectableItemBackgroundBorderless = 0x7f0200fd;
public static final int showAsAction = 0x7f0200fe;
public static final int showDividers = 0x7f0200ff;
public static final int showText = 0x7f020100;
public static final int showTitle = 0x7f020101;
public static final int singleChoiceItemLayout = 0x7f020102;
public static final int spinBars = 0x7f020103;
public static final int spinnerDropDownItemStyle = 0x7f020104;
public static final int spinnerStyle = 0x7f020105;
public static final int splitTrack = 0x7f020106;
public static final int srcCompat = 0x7f020107;
public static final int state_above_anchor = 0x7f020108;
public static final int statusBarBackground = 0x7f020109;
public static final int subMenuArrow = 0x7f02010a;
public static final int submitBackground = 0x7f02010b;
public static final int subtitle = 0x7f02010c;
public static final int subtitleTextAppearance = 0x7f02010d;
public static final int subtitleTextColor = 0x7f02010e;
public static final int subtitleTextStyle = 0x7f02010f;
public static final int suggestionRowLayout = 0x7f020110;
public static final int switchMinWidth = 0x7f020111;
public static final int switchPadding = 0x7f020112;
public static final int switchStyle = 0x7f020113;
public static final int switchTextAppearance = 0x7f020114;
public static final int textAllCaps = 0x7f020115;
public static final int textAppearanceLargePopupMenu = 0x7f020116;
public static final int textAppearanceListItem = 0x7f020117;
public static final int textAppearanceListItemSecondary = 0x7f020118;
public static final int textAppearanceListItemSmall = 0x7f020119;
public static final int textAppearancePopupMenuHeader = 0x7f02011a;
public static final int textAppearanceSearchResultSubtitle = 0x7f02011b;
public static final int textAppearanceSearchResultTitle = 0x7f02011c;
public static final int textAppearanceSmallPopupMenu = 0x7f02011d;
public static final int textColorAlertDialogListItem = 0x7f02011e;
public static final int textColorSearchUrl = 0x7f02011f;
public static final int theme = 0x7f020120;
public static final int thickness = 0x7f020121;
public static final int thumbTextPadding = 0x7f020122;
public static final int thumbTint = 0x7f020123;
public static final int thumbTintMode = 0x7f020124;
public static final int tickMark = 0x7f020125;
public static final int tickMarkTint = 0x7f020126;
public static final int tickMarkTintMode = 0x7f020127;
public static final int tint = 0x7f020128;
public static final int tintMode = 0x7f020129;
public static final int title = 0x7f02012a;
public static final int titleMargin = 0x7f02012b;
public static final int titleMarginBottom = 0x7f02012c;
public static final int titleMarginEnd = 0x7f02012d;
public static final int titleMarginStart = 0x7f02012e;
public static final int titleMarginTop = 0x7f02012f;
public static final int titleMargins = 0x7f020130;
public static final int titleTextAppearance = 0x7f020131;
public static final int titleTextColor = 0x7f020132;
public static final int titleTextStyle = 0x7f020133;
public static final int toolbarNavigationButtonStyle = 0x7f020134;
public static final int toolbarStyle = 0x7f020135;
public static final int tooltipForegroundColor = 0x7f020136;
public static final int tooltipFrameBackground = 0x7f020137;
public static final int tooltipText = 0x7f020138;
public static final int track = 0x7f020139;
public static final int trackTint = 0x7f02013a;
public static final int trackTintMode = 0x7f02013b;
public static final int ttcIndex = 0x7f02013c;
public static final int viewInflaterClass = 0x7f02013d;
public static final int voiceIcon = 0x7f02013e;
public static final int windowActionBar = 0x7f02013f;
public static final int windowActionBarOverlay = 0x7f020140;
public static final int windowActionModeOverlay = 0x7f020141;
public static final int windowFixedHeightMajor = 0x7f020142;
public static final int windowFixedHeightMinor = 0x7f020143;
public static final int windowFixedWidthMajor = 0x7f020144;
public static final int windowFixedWidthMinor = 0x7f020145;
public static final int windowMinWidthMajor = 0x7f020146;
public static final int windowMinWidthMinor = 0x7f020147;
public static final int windowNoTitle = 0x7f020148;
}
public static final class bool {
private bool() {}
public static final int abc_action_bar_embed_tabs = 0x7f030000;
public static final int abc_allow_stacked_button_bar = 0x7f030001;
public static final int abc_config_actionMenuItemAllCaps = 0x7f030002;
}
public static final class color {
private color() {}
public static final int abc_background_cache_hint_selector_material_dark = 0x7f040000;
public static final int abc_background_cache_hint_selector_material_light = 0x7f040001;
public static final int abc_btn_colored_borderless_text_material = 0x7f040002;
public static final int abc_btn_colored_text_material = 0x7f040003;
public static final int abc_color_highlight_material = 0x7f040004;
public static final int abc_hint_foreground_material_dark = 0x7f040005;
public static final int abc_hint_foreground_material_light = 0x7f040006;
public static final int abc_input_method_navigation_guard = 0x7f040007;
public static final int abc_primary_text_disable_only_material_dark = 0x7f040008;
public static final int abc_primary_text_disable_only_material_light = 0x7f040009;
public static final int abc_primary_text_material_dark = 0x7f04000a;
public static final int abc_primary_text_material_light = 0x7f04000b;
public static final int abc_search_url_text = 0x7f04000c;
public static final int abc_search_url_text_normal = 0x7f04000d;
public static final int abc_search_url_text_pressed = 0x7f04000e;
public static final int abc_search_url_text_selected = 0x7f04000f;
public static final int abc_secondary_text_material_dark = 0x7f040010;
public static final int abc_secondary_text_material_light = 0x7f040011;
public static final int abc_tint_btn_checkable = 0x7f040012;
public static final int abc_tint_default = 0x7f040013;
public static final int abc_tint_edittext = 0x7f040014;
public static final int abc_tint_seek_thumb = 0x7f040015;
public static final int abc_tint_spinner = 0x7f040016;
public static final int abc_tint_switch_track = 0x7f040017;
public static final int accent_material_dark = 0x7f040018;
public static final int accent_material_light = 0x7f040019;
public static final int background_floating_material_dark = 0x7f04001a;
public static final int background_floating_material_light = 0x7f04001b;
public static final int background_material_dark = 0x7f04001c;
public static final int background_material_light = 0x7f04001d;
public static final int bright_foreground_disabled_material_dark = 0x7f04001e;
public static final int bright_foreground_disabled_material_light = 0x7f04001f;
public static final int bright_foreground_inverse_material_dark = 0x7f040020;
public static final int bright_foreground_inverse_material_light = 0x7f040021;
public static final int bright_foreground_material_dark = 0x7f040022;
public static final int bright_foreground_material_light = 0x7f040023;
public static final int button_material_dark = 0x7f040024;
public static final int button_material_light = 0x7f040025;
public static final int dim_foreground_disabled_material_dark = 0x7f040029;
public static final int dim_foreground_disabled_material_light = 0x7f04002a;
public static final int dim_foreground_material_dark = 0x7f04002b;
public static final int dim_foreground_material_light = 0x7f04002c;
public static final int error_color_material_dark = 0x7f04002d;
public static final int error_color_material_light = 0x7f04002e;
public static final int foreground_material_dark = 0x7f04002f;
public static final int foreground_material_light = 0x7f040030;
public static final int highlighted_text_material_dark = 0x7f040031;
public static final int highlighted_text_material_light = 0x7f040032;
public static final int material_blue_grey_800 = 0x7f040033;
public static final int material_blue_grey_900 = 0x7f040034;
public static final int material_blue_grey_950 = 0x7f040035;
public static final int material_deep_teal_200 = 0x7f040036;
public static final int material_deep_teal_500 = 0x7f040037;
public static final int material_grey_100 = 0x7f040038;
public static final int material_grey_300 = 0x7f040039;
public static final int material_grey_50 = 0x7f04003a;
public static final int material_grey_600 = 0x7f04003b;
public static final int material_grey_800 = 0x7f04003c;
public static final int material_grey_850 = 0x7f04003d;
public static final int material_grey_900 = 0x7f04003e;
public static final int notification_action_color_filter = 0x7f04003f;
public static final int notification_icon_bg_color = 0x7f040040;
public static final int primary_dark_material_dark = 0x7f040041;
public static final int primary_dark_material_light = 0x7f040042;
public static final int primary_material_dark = 0x7f040043;
public static final int primary_material_light = 0x7f040044;
public static final int primary_text_default_material_dark = 0x7f040045;
public static final int primary_text_default_material_light = 0x7f040046;
public static final int primary_text_disabled_material_dark = 0x7f040047;
public static final int primary_text_disabled_material_light = 0x7f040048;
public static final int ripple_material_dark = 0x7f040049;
public static final int ripple_material_light = 0x7f04004a;
public static final int secondary_text_default_material_dark = 0x7f04004b;
public static final int secondary_text_default_material_light = 0x7f04004c;
public static final int secondary_text_disabled_material_dark = 0x7f04004d;
public static final int secondary_text_disabled_material_light = 0x7f04004e;
public static final int switch_thumb_disabled_material_dark = 0x7f04004f;
public static final int switch_thumb_disabled_material_light = 0x7f040050;
public static final int switch_thumb_material_dark = 0x7f040051;
public static final int switch_thumb_material_light = 0x7f040052;
public static final int switch_thumb_normal_material_dark = 0x7f040053;
public static final int switch_thumb_normal_material_light = 0x7f040054;
public static final int tooltip_background_dark = 0x7f040055;
public static final int tooltip_background_light = 0x7f040056;
}
public static final class dimen {
private dimen() {}
public static final int abc_action_bar_content_inset_material = 0x7f050000;
public static final int abc_action_bar_content_inset_with_nav = 0x7f050001;
public static final int abc_action_bar_default_height_material = 0x7f050002;
public static final int abc_action_bar_default_padding_end_material = 0x7f050003;
public static final int abc_action_bar_default_padding_start_material = 0x7f050004;
public static final int abc_action_bar_elevation_material = 0x7f050005;
public static final int abc_action_bar_icon_vertical_padding_material = 0x7f050006;
public static final int abc_action_bar_overflow_padding_end_material = 0x7f050007;
public static final int abc_action_bar_overflow_padding_start_material = 0x7f050008;
public static final int abc_action_bar_stacked_max_height = 0x7f050009;
public static final int abc_action_bar_stacked_tab_max_width = 0x7f05000a;
public static final int abc_action_bar_subtitle_bottom_margin_material = 0x7f05000b;
public static final int abc_action_bar_subtitle_top_margin_material = 0x7f05000c;
public static final int abc_action_button_min_height_material = 0x7f05000d;
public static final int abc_action_button_min_width_material = 0x7f05000e;
public static final int abc_action_button_min_width_overflow_material = 0x7f05000f;
public static final int abc_alert_dialog_button_bar_height = 0x7f050010;
public static final int abc_alert_dialog_button_dimen = 0x7f050011;
public static final int abc_button_inset_horizontal_material = 0x7f050012;
public static final int abc_button_inset_vertical_material = 0x7f050013;
public static final int abc_button_padding_horizontal_material = 0x7f050014;
public static final int abc_button_padding_vertical_material = 0x7f050015;
public static final int abc_cascading_menus_min_smallest_width = 0x7f050016;
public static final int abc_config_prefDialogWidth = 0x7f050017;
public static final int abc_control_corner_material = 0x7f050018;
public static final int abc_control_inset_material = 0x7f050019;
public static final int abc_control_padding_material = 0x7f05001a;
public static final int abc_dialog_corner_radius_material = 0x7f05001b;
public static final int abc_dialog_fixed_height_major = 0x7f05001c;
public static final int abc_dialog_fixed_height_minor = 0x7f05001d;
public static final int abc_dialog_fixed_width_major = 0x7f05001e;
public static final int abc_dialog_fixed_width_minor = 0x7f05001f;
public static final int abc_dialog_list_padding_bottom_no_buttons = 0x7f050020;
public static final int abc_dialog_list_padding_top_no_title = 0x7f050021;
public static final int abc_dialog_min_width_major = 0x7f050022;
public static final int abc_dialog_min_width_minor = 0x7f050023;
public static final int abc_dialog_padding_material = 0x7f050024;
public static final int abc_dialog_padding_top_material = 0x7f050025;
public static final int abc_dialog_title_divider_material = 0x7f050026;
public static final int abc_disabled_alpha_material_dark = 0x7f050027;
public static final int abc_disabled_alpha_material_light = 0x7f050028;
public static final int abc_dropdownitem_icon_width = 0x7f050029;
public static final int abc_dropdownitem_text_padding_left = 0x7f05002a;
public static final int abc_dropdownitem_text_padding_right = 0x7f05002b;
public static final int abc_edit_text_inset_bottom_material = 0x7f05002c;
public static final int abc_edit_text_inset_horizontal_material = 0x7f05002d;
public static final int abc_edit_text_inset_top_material = 0x7f05002e;
public static final int abc_floating_window_z = 0x7f05002f;
public static final int abc_list_item_padding_horizontal_material = 0x7f050030;
public static final int abc_panel_menu_list_width = 0x7f050031;
public static final int abc_progress_bar_height_material = 0x7f050032;
public static final int abc_search_view_preferred_height = 0x7f050033;
public static final int abc_search_view_preferred_width = 0x7f050034;
public static final int abc_seekbar_track_background_height_material = 0x7f050035;
public static final int abc_seekbar_track_progress_height_material = 0x7f050036;
public static final int abc_select_dialog_padding_start_material = 0x7f050037;
public static final int abc_switch_padding = 0x7f050038;
public static final int abc_text_size_body_1_material = 0x7f050039;
public static final int abc_text_size_body_2_material = 0x7f05003a;
public static final int abc_text_size_button_material = 0x7f05003b;
public static final int abc_text_size_caption_material = 0x7f05003c;
public static final int abc_text_size_display_1_material = 0x7f05003d;
public static final int abc_text_size_display_2_material = 0x7f05003e;
public static final int abc_text_size_display_3_material = 0x7f05003f;
public static final int abc_text_size_display_4_material = 0x7f050040;
public static final int abc_text_size_headline_material = 0x7f050041;
public static final int abc_text_size_large_material = 0x7f050042;
public static final int abc_text_size_medium_material = 0x7f050043;
public static final int abc_text_size_menu_header_material = 0x7f050044;
public static final int abc_text_size_menu_material = 0x7f050045;
public static final int abc_text_size_small_material = 0x7f050046;
public static final int abc_text_size_subhead_material = 0x7f050047;
public static final int abc_text_size_subtitle_material_toolbar = 0x7f050048;
public static final int abc_text_size_title_material = 0x7f050049;
public static final int abc_text_size_title_material_toolbar = 0x7f05004a;
public static final int compat_button_inset_horizontal_material = 0x7f05004b;
public static final int compat_button_inset_vertical_material = 0x7f05004c;
public static final int compat_button_padding_horizontal_material = 0x7f05004d;
public static final int compat_button_padding_vertical_material = 0x7f05004e;
public static final int compat_control_corner_material = 0x7f05004f;
public static final int compat_notification_large_icon_max_height = 0x7f050050;
public static final int compat_notification_large_icon_max_width = 0x7f050051;
public static final int disabled_alpha_material_dark = 0x7f050052;
public static final int disabled_alpha_material_light = 0x7f050053;
public static final int highlight_alpha_material_colored = 0x7f050054;
public static final int highlight_alpha_material_dark = 0x7f050055;
public static final int highlight_alpha_material_light = 0x7f050056;
public static final int hint_alpha_material_dark = 0x7f050057;
public static final int hint_alpha_material_light = 0x7f050058;
public static final int hint_pressed_alpha_material_dark = 0x7f050059;
public static final int hint_pressed_alpha_material_light = 0x7f05005a;
public static final int notification_action_icon_size = 0x7f05005b;
public static final int notification_action_text_size = 0x7f05005c;
public static final int notification_big_circle_margin = 0x7f05005d;
public static final int notification_content_margin_start = 0x7f05005e;
public static final int notification_large_icon_height = 0x7f05005f;
public static final int notification_large_icon_width = 0x7f050060;
public static final int notification_main_column_padding_top = 0x7f050061;
public static final int notification_media_narrow_margin = 0x7f050062;
public static final int notification_right_icon_size = 0x7f050063;
public static final int notification_right_side_padding_top = 0x7f050064;
public static final int notification_small_icon_background_padding = 0x7f050065;
public static final int notification_small_icon_size_as_large = 0x7f050066;
public static final int notification_subtext_size = 0x7f050067;
public static final int notification_top_pad = 0x7f050068;
public static final int notification_top_pad_large_text = 0x7f050069;
public static final int tooltip_corner_radius = 0x7f05006a;
public static final int tooltip_horizontal_padding = 0x7f05006b;
public static final int tooltip_margin = 0x7f05006c;
public static final int tooltip_precise_anchor_extra_offset = 0x7f05006d;
public static final int tooltip_precise_anchor_threshold = 0x7f05006e;
public static final int tooltip_vertical_padding = 0x7f05006f;
public static final int tooltip_y_offset_non_touch = 0x7f050070;
public static final int tooltip_y_offset_touch = 0x7f050071;
}
public static final class drawable {
private drawable() {}
public static final int abc_ab_share_pack_mtrl_alpha = 0x7f060001;
public static final int abc_action_bar_item_background_material = 0x7f060002;
public static final int abc_btn_borderless_material = 0x7f060003;
public static final int abc_btn_check_material = 0x7f060004;
public static final int abc_btn_check_to_on_mtrl_000 = 0x7f060005;
public static final int abc_btn_check_to_on_mtrl_015 = 0x7f060006;
public static final int abc_btn_colored_material = 0x7f060007;
public static final int abc_btn_default_mtrl_shape = 0x7f060008;
public static final int abc_btn_radio_material = 0x7f060009;
public static final int abc_btn_radio_to_on_mtrl_000 = 0x7f06000a;
public static final int abc_btn_radio_to_on_mtrl_015 = 0x7f06000b;
public static final int abc_btn_switch_to_on_mtrl_00001 = 0x7f06000c;
public static final int abc_btn_switch_to_on_mtrl_00012 = 0x7f06000d;
public static final int abc_cab_background_internal_bg = 0x7f06000e;
public static final int abc_cab_background_top_material = 0x7f06000f;
public static final int abc_cab_background_top_mtrl_alpha = 0x7f060010;
public static final int abc_control_background_material = 0x7f060011;
public static final int abc_dialog_material_background = 0x7f060012;
public static final int abc_edit_text_material = 0x7f060013;
public static final int abc_ic_ab_back_material = 0x7f060014;
public static final int abc_ic_arrow_drop_right_black_24dp = 0x7f060015;
public static final int abc_ic_clear_material = 0x7f060016;
public static final int abc_ic_commit_search_api_mtrl_alpha = 0x7f060017;
public static final int abc_ic_go_search_api_material = 0x7f060018;
public static final int abc_ic_menu_copy_mtrl_am_alpha = 0x7f060019;
public static final int abc_ic_menu_cut_mtrl_alpha = 0x7f06001a;
public static final int abc_ic_menu_overflow_material = 0x7f06001b;
public static final int abc_ic_menu_paste_mtrl_am_alpha = 0x7f06001c;
public static final int abc_ic_menu_selectall_mtrl_alpha = 0x7f06001d;
public static final int abc_ic_menu_share_mtrl_alpha = 0x7f06001e;
public static final int abc_ic_search_api_material = 0x7f06001f;
public static final int abc_ic_star_black_16dp = 0x7f060020;
public static final int abc_ic_star_black_36dp = 0x7f060021;
public static final int abc_ic_star_black_48dp = 0x7f060022;
public static final int abc_ic_star_half_black_16dp = 0x7f060023;
public static final int abc_ic_star_half_black_36dp = 0x7f060024;
public static final int abc_ic_star_half_black_48dp = 0x7f060025;
public static final int abc_ic_voice_search_api_material = 0x7f060026;
public static final int abc_item_background_holo_dark = 0x7f060027;
public static final int abc_item_background_holo_light = 0x7f060028;
public static final int abc_list_divider_material = 0x7f060029;
public static final int abc_list_divider_mtrl_alpha = 0x7f06002a;
public static final int abc_list_focused_holo = 0x7f06002b;
public static final int abc_list_longpressed_holo = 0x7f06002c;
public static final int abc_list_pressed_holo_dark = 0x7f06002d;
public static final int abc_list_pressed_holo_light = 0x7f06002e;
public static final int abc_list_selector_background_transition_holo_dark = 0x7f06002f;
public static final int abc_list_selector_background_transition_holo_light = 0x7f060030;
public static final int abc_list_selector_disabled_holo_dark = 0x7f060031;
public static final int abc_list_selector_disabled_holo_light = 0x7f060032;
public static final int abc_list_selector_holo_dark = 0x7f060033;
public static final int abc_list_selector_holo_light = 0x7f060034;
public static final int abc_menu_hardkey_panel_mtrl_mult = 0x7f060035;
public static final int abc_popup_background_mtrl_mult = 0x7f060036;
public static final int abc_ratingbar_indicator_material = 0x7f060037;
public static final int abc_ratingbar_material = 0x7f060038;
public static final int abc_ratingbar_small_material = 0x7f060039;
public static final int abc_scrubber_control_off_mtrl_alpha = 0x7f06003a;
public static final int abc_scrubber_control_to_pressed_mtrl_000 = 0x7f06003b;
public static final int abc_scrubber_control_to_pressed_mtrl_005 = 0x7f06003c;
public static final int abc_scrubber_primary_mtrl_alpha = 0x7f06003d;
public static final int abc_scrubber_track_mtrl_alpha = 0x7f06003e;
public static final int abc_seekbar_thumb_material = 0x7f06003f;
public static final int abc_seekbar_tick_mark_material = 0x7f060040;
public static final int abc_seekbar_track_material = 0x7f060041;
public static final int abc_spinner_mtrl_am_alpha = 0x7f060042;
public static final int abc_spinner_textfield_background_material = 0x7f060043;
public static final int abc_switch_thumb_material = 0x7f060044;
public static final int abc_switch_track_mtrl_alpha = 0x7f060045;
public static final int abc_tab_indicator_material = 0x7f060046;
public static final int abc_tab_indicator_mtrl_alpha = 0x7f060047;
public static final int abc_text_cursor_material = 0x7f060048;
public static final int abc_text_select_handle_left_mtrl_dark = 0x7f060049;
public static final int abc_text_select_handle_left_mtrl_light = 0x7f06004a;
public static final int abc_text_select_handle_middle_mtrl_dark = 0x7f06004b;
public static final int abc_text_select_handle_middle_mtrl_light = 0x7f06004c;
public static final int abc_text_select_handle_right_mtrl_dark = 0x7f06004d;
public static final int abc_text_select_handle_right_mtrl_light = 0x7f06004e;
public static final int abc_textfield_activated_mtrl_alpha = 0x7f06004f;
public static final int abc_textfield_default_mtrl_alpha = 0x7f060050;
public static final int abc_textfield_search_activated_mtrl_alpha = 0x7f060051;
public static final int abc_textfield_search_default_mtrl_alpha = 0x7f060052;
public static final int abc_textfield_search_material = 0x7f060053;
public static final int abc_vector_test = 0x7f060054;
public static final int notification_action_background = 0x7f060057;
public static final int notification_bg = 0x7f060058;
public static final int notification_bg_low = 0x7f060059;
public static final int notification_bg_low_normal = 0x7f06005a;
public static final int notification_bg_low_pressed = 0x7f06005b;
public static final int notification_bg_normal = 0x7f06005c;
public static final int notification_bg_normal_pressed = 0x7f06005d;
public static final int notification_icon_background = 0x7f06005e;
public static final int notification_template_icon_bg = 0x7f06005f;
public static final int notification_template_icon_low_bg = 0x7f060060;
public static final int notification_tile_bg = 0x7f060061;
public static final int notify_panel_notification_icon_bg = 0x7f060062;
public static final int tooltip_frame_dark = 0x7f060063;
public static final int tooltip_frame_light = 0x7f060064;
}
public static final class id {
private id() {}
public static final int action_bar = 0x7f070006;
public static final int action_bar_activity_content = 0x7f070007;
public static final int action_bar_container = 0x7f070008;
public static final int action_bar_root = 0x7f070009;
public static final int action_bar_spinner = 0x7f07000a;
public static final int action_bar_subtitle = 0x7f07000b;
public static final int action_bar_title = 0x7f07000c;
public static final int action_container = 0x7f07000d;
public static final int action_context_bar = 0x7f07000e;
public static final int action_divider = 0x7f07000f;
public static final int action_image = 0x7f070010;
public static final int action_menu_divider = 0x7f070011;
public static final int action_menu_presenter = 0x7f070012;
public static final int action_mode_bar = 0x7f070013;
public static final int action_mode_bar_stub = 0x7f070014;
public static final int action_mode_close_button = 0x7f070015;
public static final int action_text = 0x7f070016;
public static final int actions = 0x7f070017;
public static final int activity_chooser_view_content = 0x7f070018;
public static final int add = 0x7f070019;
public static final int alertTitle = 0x7f07001a;
public static final int async = 0x7f07001d;
public static final int blocking = 0x7f070020;
public static final int bottom = 0x7f070022;
public static final int buttonPanel = 0x7f070023;
public static final int checkbox = 0x7f070028;
public static final int chronometer = 0x7f070029;
public static final int content = 0x7f07002d;
public static final int contentPanel = 0x7f07002e;
public static final int custom = 0x7f07002f;
public static final int customPanel = 0x7f070030;
public static final int decor_content_parent = 0x7f070031;
public static final int default_activity_button = 0x7f070032;
public static final int edit_query = 0x7f070036;
public static final int end = 0x7f070037;
public static final int expand_activities_button = 0x7f070038;
public static final int expanded_menu = 0x7f070039;
public static final int forever = 0x7f07003d;
public static final int group_divider = 0x7f07003f;
public static final int home = 0x7f070041;
public static final int icon = 0x7f070043;
public static final int icon_group = 0x7f070044;
public static final int image = 0x7f070046;
public static final int info = 0x7f070047;
public static final int italic = 0x7f070049;
public static final int left = 0x7f07004a;
public static final int line1 = 0x7f07004b;
public static final int line3 = 0x7f07004c;
public static final int listMode = 0x7f07004d;
public static final int list_item = 0x7f07004f;
public static final int message = 0x7f070050;
public static final int multiply = 0x7f070052;
public static final int none = 0x7f070054;
public static final int normal = 0x7f070055;
public static final int notification_background = 0x7f070056;
public static final int notification_main_column = 0x7f070057;
public static final int notification_main_column_container = 0x7f070058;
public static final int parentPanel = 0x7f07005b;
public static final int progress_circular = 0x7f07005d;
public static final int progress_horizontal = 0x7f07005e;
public static final int radio = 0x7f07005f;
public static final int right = 0x7f070060;
public static final int right_icon = 0x7f070061;
public static final int right_side = 0x7f070062;
public static final int screen = 0x7f070063;
public static final int scrollIndicatorDown = 0x7f070064;
public static final int scrollIndicatorUp = 0x7f070065;
public static final int scrollView = 0x7f070066;
public static final int search_badge = 0x7f070067;
public static final int search_bar = 0x7f070068;
public static final int search_button = 0x7f070069;
public static final int search_close_btn = 0x7f07006a;
public static final int search_edit_frame = 0x7f07006b;
public static final int search_go_btn = 0x7f07006c;
public static final int search_mag_icon = 0x7f07006d;
public static final int search_plate = 0x7f07006e;
public static final int search_src_text = 0x7f07006f;
public static final int search_voice_btn = 0x7f070070;
public static final int select_dialog_listview = 0x7f070071;
public static final int shortcut = 0x7f070072;
public static final int spacer = 0x7f070076;
public static final int split_action_bar = 0x7f070077;
public static final int src_atop = 0x7f07007a;
public static final int src_in = 0x7f07007b;
public static final int src_over = 0x7f07007c;
public static final int start = 0x7f07007e;
public static final int submenuarrow = 0x7f07007f;
public static final int submit_area = 0x7f070080;
public static final int tabMode = 0x7f070081;
public static final int tag_transition_group = 0x7f070082;
public static final int tag_unhandled_key_event_manager = 0x7f070083;
public static final int tag_unhandled_key_listeners = 0x7f070084;
public static final int text = 0x7f070085;
public static final int text2 = 0x7f070086;
public static final int textSpacerNoButtons = 0x7f070087;
public static final int textSpacerNoTitle = 0x7f070088;
public static final int time = 0x7f070089;
public static final int title = 0x7f07008a;
public static final int titleDividerNoCustom = 0x7f07008b;
public static final int title_template = 0x7f07008c;
public static final int top = 0x7f07008d;
public static final int topPanel = 0x7f07008e;
public static final int uniform = 0x7f07008f;
public static final int up = 0x7f070090;
public static final int wrap_content = 0x7f070094;
}
public static final class integer {
private integer() {}
public static final int abc_config_activityDefaultDur = 0x7f080000;
public static final int abc_config_activityShortDur = 0x7f080001;
public static final int cancel_button_image_alpha = 0x7f080002;
public static final int config_tooltipAnimTime = 0x7f080003;
public static final int status_bar_notification_info_maxnum = 0x7f080004;
}
public static final class layout {
private layout() {}
public static final int abc_action_bar_title_item = 0x7f090000;
public static final int abc_action_bar_up_container = 0x7f090001;
public static final int abc_action_menu_item_layout = 0x7f090002;
public static final int abc_action_menu_layout = 0x7f090003;
public static final int abc_action_mode_bar = 0x7f090004;
public static final int abc_action_mode_close_item_material = 0x7f090005;
public static final int abc_activity_chooser_view = 0x7f090006;
public static final int abc_activity_chooser_view_list_item = 0x7f090007;
public static final int abc_alert_dialog_button_bar_material = 0x7f090008;
public static final int abc_alert_dialog_material = 0x7f090009;
public static final int abc_alert_dialog_title_material = 0x7f09000a;
public static final int abc_cascading_menu_item_layout = 0x7f09000b;
public static final int abc_dialog_title_material = 0x7f09000c;
public static final int abc_expanded_menu_layout = 0x7f09000d;
public static final int abc_list_menu_item_checkbox = 0x7f09000e;
public static final int abc_list_menu_item_icon = 0x7f09000f;
public static final int abc_list_menu_item_layout = 0x7f090010;
public static final int abc_list_menu_item_radio = 0x7f090011;
public static final int abc_popup_menu_header_item_layout = 0x7f090012;
public static final int abc_popup_menu_item_layout = 0x7f090013;
public static final int abc_screen_content_include = 0x7f090014;
public static final int abc_screen_simple = 0x7f090015;
public static final int abc_screen_simple_overlay_action_mode = 0x7f090016;
public static final int abc_screen_toolbar = 0x7f090017;
public static final int abc_search_dropdown_item_icons_2line = 0x7f090018;
public static final int abc_search_view = 0x7f090019;
public static final int abc_select_dialog_material = 0x7f09001a;
public static final int abc_tooltip = 0x7f09001b;
public static final int notification_action = 0x7f09001e;
public static final int notification_action_tombstone = 0x7f09001f;
public static final int notification_template_custom_big = 0x7f090020;
public static final int notification_template_icon_group = 0x7f090021;
public static final int notification_template_part_chronometer = 0x7f090022;
public static final int notification_template_part_time = 0x7f090023;
public static final int select_dialog_item_material = 0x7f090024;
public static final int select_dialog_multichoice_material = 0x7f090025;
public static final int select_dialog_singlechoice_material = 0x7f090026;
public static final int support_simple_spinner_dropdown_item = 0x7f090027;
}
public static final class string {
private string() {}
public static final int abc_action_bar_home_description = 0x7f0b0000;
public static final int abc_action_bar_up_description = 0x7f0b0001;
public static final int abc_action_menu_overflow_description = 0x7f0b0002;
public static final int abc_action_mode_done = 0x7f0b0003;
public static final int abc_activity_chooser_view_see_all = 0x7f0b0004;
public static final int abc_activitychooserview_choose_application = 0x7f0b0005;
public static final int abc_capital_off = 0x7f0b0006;
public static final int abc_capital_on = 0x7f0b0007;
public static final int abc_font_family_body_1_material = 0x7f0b0008;
public static final int abc_font_family_body_2_material = 0x7f0b0009;
public static final int abc_font_family_button_material = 0x7f0b000a;
public static final int abc_font_family_caption_material = 0x7f0b000b;
public static final int abc_font_family_display_1_material = 0x7f0b000c;
public static final int abc_font_family_display_2_material = 0x7f0b000d;
public static final int abc_font_family_display_3_material = 0x7f0b000e;
public static final int abc_font_family_display_4_material = 0x7f0b000f;
public static final int abc_font_family_headline_material = 0x7f0b0010;
public static final int abc_font_family_menu_material = 0x7f0b0011;
public static final int abc_font_family_subhead_material = 0x7f0b0012;
public static final int abc_font_family_title_material = 0x7f0b0013;
public static final int abc_menu_alt_shortcut_label = 0x7f0b0014;
public static final int abc_menu_ctrl_shortcut_label = 0x7f0b0015;
public static final int abc_menu_delete_shortcut_label = 0x7f0b0016;
public static final int abc_menu_enter_shortcut_label = 0x7f0b0017;
public static final int abc_menu_function_shortcut_label = 0x7f0b0018;
public static final int abc_menu_meta_shortcut_label = 0x7f0b0019;
public static final int abc_menu_shift_shortcut_label = 0x7f0b001a;
public static final int abc_menu_space_shortcut_label = 0x7f0b001b;
public static final int abc_menu_sym_shortcut_label = 0x7f0b001c;
public static final int abc_prepend_shortcut_label = 0x7f0b001d;
public static final int abc_search_hint = 0x7f0b001e;
public static final int abc_searchview_description_clear = 0x7f0b001f;
public static final int abc_searchview_description_query = 0x7f0b0020;
public static final int abc_searchview_description_search = 0x7f0b0021;
public static final int abc_searchview_description_submit = 0x7f0b0022;
public static final int abc_searchview_description_voice = 0x7f0b0023;
public static final int abc_shareactionprovider_share_with = 0x7f0b0024;
public static final int abc_shareactionprovider_share_with_application = 0x7f0b0025;
public static final int abc_toolbar_collapse_description = 0x7f0b0026;
public static final int search_menu_title = 0x7f0b0028;
public static final int status_bar_notification_info_overflow = 0x7f0b0029;
}
public static final class style {
private style() {}
public static final int AlertDialog_AppCompat = 0x7f0c0000;
public static final int AlertDialog_AppCompat_Light = 0x7f0c0001;
public static final int Animation_AppCompat_Dialog = 0x7f0c0002;
public static final int Animation_AppCompat_DropDownUp = 0x7f0c0003;
public static final int Animation_AppCompat_Tooltip = 0x7f0c0004;
public static final int Base_AlertDialog_AppCompat = 0x7f0c0006;
public static final int Base_AlertDialog_AppCompat_Light = 0x7f0c0007;
public static final int Base_Animation_AppCompat_Dialog = 0x7f0c0008;
public static final int Base_Animation_AppCompat_DropDownUp = 0x7f0c0009;
public static final int Base_Animation_AppCompat_Tooltip = 0x7f0c000a;
public static final int Base_DialogWindowTitleBackground_AppCompat = 0x7f0c000c;
public static final int Base_DialogWindowTitle_AppCompat = 0x7f0c000b;
public static final int Base_TextAppearance_AppCompat = 0x7f0c000d;
public static final int Base_TextAppearance_AppCompat_Body1 = 0x7f0c000e;
public static final int Base_TextAppearance_AppCompat_Body2 = 0x7f0c000f;
public static final int Base_TextAppearance_AppCompat_Button = 0x7f0c0010;
public static final int Base_TextAppearance_AppCompat_Caption = 0x7f0c0011;
public static final int Base_TextAppearance_AppCompat_Display1 = 0x7f0c0012;
public static final int Base_TextAppearance_AppCompat_Display2 = 0x7f0c0013;
public static final int Base_TextAppearance_AppCompat_Display3 = 0x7f0c0014;
public static final int Base_TextAppearance_AppCompat_Display4 = 0x7f0c0015;
public static final int Base_TextAppearance_AppCompat_Headline = 0x7f0c0016;
public static final int Base_TextAppearance_AppCompat_Inverse = 0x7f0c0017;
public static final int Base_TextAppearance_AppCompat_Large = 0x7f0c0018;
public static final int Base_TextAppearance_AppCompat_Large_Inverse = 0x7f0c0019;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0c001a;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0c001b;
public static final int Base_TextAppearance_AppCompat_Medium = 0x7f0c001c;
public static final int Base_TextAppearance_AppCompat_Medium_Inverse = 0x7f0c001d;
public static final int Base_TextAppearance_AppCompat_Menu = 0x7f0c001e;
public static final int Base_TextAppearance_AppCompat_SearchResult = 0x7f0c001f;
public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0c0020;
public static final int Base_TextAppearance_AppCompat_SearchResult_Title = 0x7f0c0021;
public static final int Base_TextAppearance_AppCompat_Small = 0x7f0c0022;
public static final int Base_TextAppearance_AppCompat_Small_Inverse = 0x7f0c0023;
public static final int Base_TextAppearance_AppCompat_Subhead = 0x7f0c0024;
public static final int Base_TextAppearance_AppCompat_Subhead_Inverse = 0x7f0c0025;
public static final int Base_TextAppearance_AppCompat_Title = 0x7f0c0026;
public static final int Base_TextAppearance_AppCompat_Title_Inverse = 0x7f0c0027;
public static final int Base_TextAppearance_AppCompat_Tooltip = 0x7f0c0028;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0c0029;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0c002a;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0c002b;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0c002c;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0c002d;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0c002e;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0c002f;
public static final int Base_TextAppearance_AppCompat_Widget_Button = 0x7f0c0030;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 0x7f0c0031;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Colored = 0x7f0c0032;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f0c0033;
public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0c0034;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Header = 0x7f0c0035;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0c0036;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0c0037;
public static final int Base_TextAppearance_AppCompat_Widget_Switch = 0x7f0c0038;
public static final int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0c0039;
public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0c003a;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0c003b;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0c003c;
public static final int Base_ThemeOverlay_AppCompat = 0x7f0c004b;
public static final int Base_ThemeOverlay_AppCompat_ActionBar = 0x7f0c004c;
public static final int Base_ThemeOverlay_AppCompat_Dark = 0x7f0c004d;
public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0c004e;
public static final int Base_ThemeOverlay_AppCompat_Dialog = 0x7f0c004f;
public static final int Base_ThemeOverlay_AppCompat_Dialog_Alert = 0x7f0c0050;
public static final int Base_ThemeOverlay_AppCompat_Light = 0x7f0c0051;
public static final int Base_Theme_AppCompat = 0x7f0c003d;
public static final int Base_Theme_AppCompat_CompactMenu = 0x7f0c003e;
public static final int Base_Theme_AppCompat_Dialog = 0x7f0c003f;
public static final int Base_Theme_AppCompat_DialogWhenLarge = 0x7f0c0043;
public static final int Base_Theme_AppCompat_Dialog_Alert = 0x7f0c0040;
public static final int Base_Theme_AppCompat_Dialog_FixedSize = 0x7f0c0041;
public static final int Base_Theme_AppCompat_Dialog_MinWidth = 0x7f0c0042;
public static final int Base_Theme_AppCompat_Light = 0x7f0c0044;
public static final int Base_Theme_AppCompat_Light_DarkActionBar = 0x7f0c0045;
public static final int Base_Theme_AppCompat_Light_Dialog = 0x7f0c0046;
public static final int Base_Theme_AppCompat_Light_DialogWhenLarge = 0x7f0c004a;
public static final int Base_Theme_AppCompat_Light_Dialog_Alert = 0x7f0c0047;
public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize = 0x7f0c0048;
public static final int Base_Theme_AppCompat_Light_Dialog_MinWidth = 0x7f0c0049;
public static final int Base_V21_ThemeOverlay_AppCompat_Dialog = 0x7f0c0056;
public static final int Base_V21_Theme_AppCompat = 0x7f0c0052;
public static final int Base_V21_Theme_AppCompat_Dialog = 0x7f0c0053;
public static final int Base_V21_Theme_AppCompat_Light = 0x7f0c0054;
public static final int Base_V21_Theme_AppCompat_Light_Dialog = 0x7f0c0055;
public static final int Base_V22_Theme_AppCompat = 0x7f0c0057;
public static final int Base_V22_Theme_AppCompat_Light = 0x7f0c0058;
public static final int Base_V23_Theme_AppCompat = 0x7f0c0059;
public static final int Base_V23_Theme_AppCompat_Light = 0x7f0c005a;
public static final int Base_V26_Theme_AppCompat = 0x7f0c005b;
public static final int Base_V26_Theme_AppCompat_Light = 0x7f0c005c;
public static final int Base_V26_Widget_AppCompat_Toolbar = 0x7f0c005d;
public static final int Base_V28_Theme_AppCompat = 0x7f0c005e;
public static final int Base_V28_Theme_AppCompat_Light = 0x7f0c005f;
public static final int Base_V7_ThemeOverlay_AppCompat_Dialog = 0x7f0c0064;
public static final int Base_V7_Theme_AppCompat = 0x7f0c0060;
public static final int Base_V7_Theme_AppCompat_Dialog = 0x7f0c0061;
public static final int Base_V7_Theme_AppCompat_Light = 0x7f0c0062;
public static final int Base_V7_Theme_AppCompat_Light_Dialog = 0x7f0c0063;
public static final int Base_V7_Widget_AppCompat_AutoCompleteTextView = 0x7f0c0065;
public static final int Base_V7_Widget_AppCompat_EditText = 0x7f0c0066;
public static final int Base_V7_Widget_AppCompat_Toolbar = 0x7f0c0067;
public static final int Base_Widget_AppCompat_ActionBar = 0x7f0c0068;
public static final int Base_Widget_AppCompat_ActionBar_Solid = 0x7f0c0069;
public static final int Base_Widget_AppCompat_ActionBar_TabBar = 0x7f0c006a;
public static final int Base_Widget_AppCompat_ActionBar_TabText = 0x7f0c006b;
public static final int Base_Widget_AppCompat_ActionBar_TabView = 0x7f0c006c;
public static final int Base_Widget_AppCompat_ActionButton = 0x7f0c006d;
public static final int Base_Widget_AppCompat_ActionButton_CloseMode = 0x7f0c006e;
public static final int Base_Widget_AppCompat_ActionButton_Overflow = 0x7f0c006f;
public static final int Base_Widget_AppCompat_ActionMode = 0x7f0c0070;
public static final int Base_Widget_AppCompat_ActivityChooserView = 0x7f0c0071;
public static final int Base_Widget_AppCompat_AutoCompleteTextView = 0x7f0c0072;
public static final int Base_Widget_AppCompat_Button = 0x7f0c0073;
public static final int Base_Widget_AppCompat_ButtonBar = 0x7f0c0079;
public static final int Base_Widget_AppCompat_ButtonBar_AlertDialog = 0x7f0c007a;
public static final int Base_Widget_AppCompat_Button_Borderless = 0x7f0c0074;
public static final int Base_Widget_AppCompat_Button_Borderless_Colored = 0x7f0c0075;
public static final int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f0c0076;
public static final int Base_Widget_AppCompat_Button_Colored = 0x7f0c0077;
public static final int Base_Widget_AppCompat_Button_Small = 0x7f0c0078;
public static final int Base_Widget_AppCompat_CompoundButton_CheckBox = 0x7f0c007b;
public static final int Base_Widget_AppCompat_CompoundButton_RadioButton = 0x7f0c007c;
public static final int Base_Widget_AppCompat_CompoundButton_Switch = 0x7f0c007d;
public static final int Base_Widget_AppCompat_DrawerArrowToggle = 0x7f0c007e;
public static final int Base_Widget_AppCompat_DrawerArrowToggle_Common = 0x7f0c007f;
public static final int Base_Widget_AppCompat_DropDownItem_Spinner = 0x7f0c0080;
public static final int Base_Widget_AppCompat_EditText = 0x7f0c0081;
public static final int Base_Widget_AppCompat_ImageButton = 0x7f0c0082;
public static final int Base_Widget_AppCompat_Light_ActionBar = 0x7f0c0083;
public static final int Base_Widget_AppCompat_Light_ActionBar_Solid = 0x7f0c0084;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0c0085;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText = 0x7f0c0086;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f0c0087;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabView = 0x7f0c0088;
public static final int Base_Widget_AppCompat_Light_PopupMenu = 0x7f0c0089;
public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f0c008a;
public static final int Base_Widget_AppCompat_ListMenuView = 0x7f0c008b;
public static final int Base_Widget_AppCompat_ListPopupWindow = 0x7f0c008c;
public static final int Base_Widget_AppCompat_ListView = 0x7f0c008d;
public static final int Base_Widget_AppCompat_ListView_DropDown = 0x7f0c008e;
public static final int Base_Widget_AppCompat_ListView_Menu = 0x7f0c008f;
public static final int Base_Widget_AppCompat_PopupMenu = 0x7f0c0090;
public static final int Base_Widget_AppCompat_PopupMenu_Overflow = 0x7f0c0091;
public static final int Base_Widget_AppCompat_PopupWindow = 0x7f0c0092;
public static final int Base_Widget_AppCompat_ProgressBar = 0x7f0c0093;
public static final int Base_Widget_AppCompat_ProgressBar_Horizontal = 0x7f0c0094;
public static final int Base_Widget_AppCompat_RatingBar = 0x7f0c0095;
public static final int Base_Widget_AppCompat_RatingBar_Indicator = 0x7f0c0096;
public static final int Base_Widget_AppCompat_RatingBar_Small = 0x7f0c0097;
public static final int Base_Widget_AppCompat_SearchView = 0x7f0c0098;
public static final int Base_Widget_AppCompat_SearchView_ActionBar = 0x7f0c0099;
public static final int Base_Widget_AppCompat_SeekBar = 0x7f0c009a;
public static final int Base_Widget_AppCompat_SeekBar_Discrete = 0x7f0c009b;
public static final int Base_Widget_AppCompat_Spinner = 0x7f0c009c;
public static final int Base_Widget_AppCompat_Spinner_Underlined = 0x7f0c009d;
public static final int Base_Widget_AppCompat_TextView_SpinnerItem = 0x7f0c009e;
public static final int Base_Widget_AppCompat_Toolbar = 0x7f0c009f;
public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation = 0x7f0c00a0;
public static final int Platform_AppCompat = 0x7f0c00a1;
public static final int Platform_AppCompat_Light = 0x7f0c00a2;
public static final int Platform_ThemeOverlay_AppCompat = 0x7f0c00a3;
public static final int Platform_ThemeOverlay_AppCompat_Dark = 0x7f0c00a4;
public static final int Platform_ThemeOverlay_AppCompat_Light = 0x7f0c00a5;
public static final int Platform_V21_AppCompat = 0x7f0c00a6;
public static final int Platform_V21_AppCompat_Light = 0x7f0c00a7;
public static final int Platform_V25_AppCompat = 0x7f0c00a8;
public static final int Platform_V25_AppCompat_Light = 0x7f0c00a9;
public static final int Platform_Widget_AppCompat_Spinner = 0x7f0c00aa;
public static final int RtlOverlay_DialogWindowTitle_AppCompat = 0x7f0c00ab;
public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 0x7f0c00ac;
public static final int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 0x7f0c00ad;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem = 0x7f0c00ae;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 0x7f0c00af;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Shortcut = 0x7f0c00b0;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_SubmenuArrow = 0x7f0c00b1;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 0x7f0c00b2;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Title = 0x7f0c00b3;
public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 0x7f0c00b9;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown = 0x7f0c00b4;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 0x7f0c00b5;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 0x7f0c00b6;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 0x7f0c00b7;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 0x7f0c00b8;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton = 0x7f0c00ba;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 0x7f0c00bb;
public static final int TextAppearance_AppCompat = 0x7f0c00bc;
public static final int TextAppearance_AppCompat_Body1 = 0x7f0c00bd;
public static final int TextAppearance_AppCompat_Body2 = 0x7f0c00be;
public static final int TextAppearance_AppCompat_Button = 0x7f0c00bf;
public static final int TextAppearance_AppCompat_Caption = 0x7f0c00c0;
public static final int TextAppearance_AppCompat_Display1 = 0x7f0c00c1;
public static final int TextAppearance_AppCompat_Display2 = 0x7f0c00c2;
public static final int TextAppearance_AppCompat_Display3 = 0x7f0c00c3;
public static final int TextAppearance_AppCompat_Display4 = 0x7f0c00c4;
public static final int TextAppearance_AppCompat_Headline = 0x7f0c00c5;
public static final int TextAppearance_AppCompat_Inverse = 0x7f0c00c6;
public static final int TextAppearance_AppCompat_Large = 0x7f0c00c7;
public static final int TextAppearance_AppCompat_Large_Inverse = 0x7f0c00c8;
public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 0x7f0c00c9;
public static final int TextAppearance_AppCompat_Light_SearchResult_Title = 0x7f0c00ca;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0c00cb;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0c00cc;
public static final int TextAppearance_AppCompat_Medium = 0x7f0c00cd;
public static final int TextAppearance_AppCompat_Medium_Inverse = 0x7f0c00ce;
public static final int TextAppearance_AppCompat_Menu = 0x7f0c00cf;
public static final int TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0c00d0;
public static final int TextAppearance_AppCompat_SearchResult_Title = 0x7f0c00d1;
public static final int TextAppearance_AppCompat_Small = 0x7f0c00d2;
public static final int TextAppearance_AppCompat_Small_Inverse = 0x7f0c00d3;
public static final int TextAppearance_AppCompat_Subhead = 0x7f0c00d4;
public static final int TextAppearance_AppCompat_Subhead_Inverse = 0x7f0c00d5;
public static final int TextAppearance_AppCompat_Title = 0x7f0c00d6;
public static final int TextAppearance_AppCompat_Title_Inverse = 0x7f0c00d7;
public static final int TextAppearance_AppCompat_Tooltip = 0x7f0c00d8;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0c00d9;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0c00da;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0c00db;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0c00dc;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0c00dd;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0c00de;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 0x7f0c00df;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0c00e0;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 0x7f0c00e1;
public static final int TextAppearance_AppCompat_Widget_Button = 0x7f0c00e2;
public static final int TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 0x7f0c00e3;
public static final int TextAppearance_AppCompat_Widget_Button_Colored = 0x7f0c00e4;
public static final int TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f0c00e5;
public static final int TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0c00e6;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Header = 0x7f0c00e7;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0c00e8;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0c00e9;
public static final int TextAppearance_AppCompat_Widget_Switch = 0x7f0c00ea;
public static final int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0c00eb;
public static final int TextAppearance_Compat_Notification = 0x7f0c00ec;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0c00ed;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c00ee;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0c00ef;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0c00f0;
public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0c00f1;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0c00f2;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0c00f3;
public static final int ThemeOverlay_AppCompat = 0x7f0c0109;
public static final int ThemeOverlay_AppCompat_ActionBar = 0x7f0c010a;
public static final int ThemeOverlay_AppCompat_Dark = 0x7f0c010b;
public static final int ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0c010c;
public static final int ThemeOverlay_AppCompat_Dialog = 0x7f0c010d;
public static final int ThemeOverlay_AppCompat_Dialog_Alert = 0x7f0c010e;
public static final int ThemeOverlay_AppCompat_Light = 0x7f0c010f;
public static final int Theme_AppCompat = 0x7f0c00f4;
public static final int Theme_AppCompat_CompactMenu = 0x7f0c00f5;
public static final int Theme_AppCompat_DayNight = 0x7f0c00f6;
public static final int Theme_AppCompat_DayNight_DarkActionBar = 0x7f0c00f7;
public static final int Theme_AppCompat_DayNight_Dialog = 0x7f0c00f8;
public static final int Theme_AppCompat_DayNight_DialogWhenLarge = 0x7f0c00fb;
public static final int Theme_AppCompat_DayNight_Dialog_Alert = 0x7f0c00f9;
public static final int Theme_AppCompat_DayNight_Dialog_MinWidth = 0x7f0c00fa;
public static final int Theme_AppCompat_DayNight_NoActionBar = 0x7f0c00fc;
public static final int Theme_AppCompat_Dialog = 0x7f0c00fd;
public static final int Theme_AppCompat_DialogWhenLarge = 0x7f0c0100;
public static final int Theme_AppCompat_Dialog_Alert = 0x7f0c00fe;
public static final int Theme_AppCompat_Dialog_MinWidth = 0x7f0c00ff;
public static final int Theme_AppCompat_Light = 0x7f0c0101;
public static final int Theme_AppCompat_Light_DarkActionBar = 0x7f0c0102;
public static final int Theme_AppCompat_Light_Dialog = 0x7f0c0103;
public static final int Theme_AppCompat_Light_DialogWhenLarge = 0x7f0c0106;
public static final int Theme_AppCompat_Light_Dialog_Alert = 0x7f0c0104;
public static final int Theme_AppCompat_Light_Dialog_MinWidth = 0x7f0c0105;
public static final int Theme_AppCompat_Light_NoActionBar = 0x7f0c0107;
public static final int Theme_AppCompat_NoActionBar = 0x7f0c0108;
public static final int Widget_AppCompat_ActionBar = 0x7f0c0110;
public static final int Widget_AppCompat_ActionBar_Solid = 0x7f0c0111;
public static final int Widget_AppCompat_ActionBar_TabBar = 0x7f0c0112;
public static final int Widget_AppCompat_ActionBar_TabText = 0x7f0c0113;
public static final int Widget_AppCompat_ActionBar_TabView = 0x7f0c0114;
public static final int Widget_AppCompat_ActionButton = 0x7f0c0115;
public static final int Widget_AppCompat_ActionButton_CloseMode = 0x7f0c0116;
public static final int Widget_AppCompat_ActionButton_Overflow = 0x7f0c0117;
public static final int Widget_AppCompat_ActionMode = 0x7f0c0118;
public static final int Widget_AppCompat_ActivityChooserView = 0x7f0c0119;
public static final int Widget_AppCompat_AutoCompleteTextView = 0x7f0c011a;
public static final int Widget_AppCompat_Button = 0x7f0c011b;
public static final int Widget_AppCompat_ButtonBar = 0x7f0c0121;
public static final int Widget_AppCompat_ButtonBar_AlertDialog = 0x7f0c0122;
public static final int Widget_AppCompat_Button_Borderless = 0x7f0c011c;
public static final int Widget_AppCompat_Button_Borderless_Colored = 0x7f0c011d;
public static final int Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f0c011e;
public static final int Widget_AppCompat_Button_Colored = 0x7f0c011f;
public static final int Widget_AppCompat_Button_Small = 0x7f0c0120;
public static final int Widget_AppCompat_CompoundButton_CheckBox = 0x7f0c0123;
public static final int Widget_AppCompat_CompoundButton_RadioButton = 0x7f0c0124;
public static final int Widget_AppCompat_CompoundButton_Switch = 0x7f0c0125;
public static final int Widget_AppCompat_DrawerArrowToggle = 0x7f0c0126;
public static final int Widget_AppCompat_DropDownItem_Spinner = 0x7f0c0127;
public static final int Widget_AppCompat_EditText = 0x7f0c0128;
public static final int Widget_AppCompat_ImageButton = 0x7f0c0129;
public static final int Widget_AppCompat_Light_ActionBar = 0x7f0c012a;
public static final int Widget_AppCompat_Light_ActionBar_Solid = 0x7f0c012b;
public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 0x7f0c012c;
public static final int Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0c012d;
public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 0x7f0c012e;
public static final int Widget_AppCompat_Light_ActionBar_TabText = 0x7f0c012f;
public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f0c0130;
public static final int Widget_AppCompat_Light_ActionBar_TabView = 0x7f0c0131;
public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 0x7f0c0132;
public static final int Widget_AppCompat_Light_ActionButton = 0x7f0c0133;
public static final int Widget_AppCompat_Light_ActionButton_CloseMode = 0x7f0c0134;
public static final int Widget_AppCompat_Light_ActionButton_Overflow = 0x7f0c0135;
public static final int Widget_AppCompat_Light_ActionMode_Inverse = 0x7f0c0136;
public static final int Widget_AppCompat_Light_ActivityChooserView = 0x7f0c0137;
public static final int Widget_AppCompat_Light_AutoCompleteTextView = 0x7f0c0138;
public static final int Widget_AppCompat_Light_DropDownItem_Spinner = 0x7f0c0139;
public static final int Widget_AppCompat_Light_ListPopupWindow = 0x7f0c013a;
public static final int Widget_AppCompat_Light_ListView_DropDown = 0x7f0c013b;
public static final int Widget_AppCompat_Light_PopupMenu = 0x7f0c013c;
public static final int Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f0c013d;
public static final int Widget_AppCompat_Light_SearchView = 0x7f0c013e;
public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 0x7f0c013f;
public static final int Widget_AppCompat_ListMenuView = 0x7f0c0140;
public static final int Widget_AppCompat_ListPopupWindow = 0x7f0c0141;
public static final int Widget_AppCompat_ListView = 0x7f0c0142;
public static final int Widget_AppCompat_ListView_DropDown = 0x7f0c0143;
public static final int Widget_AppCompat_ListView_Menu = 0x7f0c0144;
public static final int Widget_AppCompat_PopupMenu = 0x7f0c0145;
public static final int Widget_AppCompat_PopupMenu_Overflow = 0x7f0c0146;
public static final int Widget_AppCompat_PopupWindow = 0x7f0c0147;
public static final int Widget_AppCompat_ProgressBar = 0x7f0c0148;
public static final int Widget_AppCompat_ProgressBar_Horizontal = 0x7f0c0149;
public static final int Widget_AppCompat_RatingBar = 0x7f0c014a;
public static final int Widget_AppCompat_RatingBar_Indicator = 0x7f0c014b;
public static final int Widget_AppCompat_RatingBar_Small = 0x7f0c014c;
public static final int Widget_AppCompat_SearchView = 0x7f0c014d;
public static final int Widget_AppCompat_SearchView_ActionBar = 0x7f0c014e;
public static final int Widget_AppCompat_SeekBar = 0x7f0c014f;
public static final int Widget_AppCompat_SeekBar_Discrete = 0x7f0c0150;
public static final int Widget_AppCompat_Spinner = 0x7f0c0151;
public static final int Widget_AppCompat_Spinner_DropDown = 0x7f0c0152;
public static final int Widget_AppCompat_Spinner_DropDown_ActionBar = 0x7f0c0153;
public static final int Widget_AppCompat_Spinner_Underlined = 0x7f0c0154;
public static final int Widget_AppCompat_TextView_SpinnerItem = 0x7f0c0155;
public static final int Widget_AppCompat_Toolbar = 0x7f0c0156;
public static final int Widget_AppCompat_Toolbar_Button_Navigation = 0x7f0c0157;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0c0158;
public static final int Widget_Compat_NotificationActionText = 0x7f0c0159;
public static final int Widget_Support_CoordinatorLayout = 0x7f0c015a;
}
public static final class styleable {
private styleable() {}
public static final int[] ActionBar = { 0x7f020031, 0x7f020032, 0x7f020033, 0x7f02005d, 0x7f02005e, 0x7f02005f, 0x7f020060, 0x7f020061, 0x7f020062, 0x7f020065, 0x7f02006a, 0x7f02006b, 0x7f020076, 0x7f020087, 0x7f020088, 0x7f020089, 0x7f02008a, 0x7f02008b, 0x7f020090, 0x7f020093, 0x7f0200db, 0x7f0200e2, 0x7f0200ed, 0x7f0200f0, 0x7f0200f1, 0x7f02010c, 0x7f02010f, 0x7f02012a, 0x7f020133 };
public static final int ActionBar_background = 0;
public static final int ActionBar_backgroundSplit = 1;
public static final int ActionBar_backgroundStacked = 2;
public static final int ActionBar_contentInsetEnd = 3;
public static final int ActionBar_contentInsetEndWithActions = 4;
public static final int ActionBar_contentInsetLeft = 5;
public static final int ActionBar_contentInsetRight = 6;
public static final int ActionBar_contentInsetStart = 7;
public static final int ActionBar_contentInsetStartWithNavigation = 8;
public static final int ActionBar_customNavigationLayout = 9;
public static final int ActionBar_displayOptions = 10;
public static final int ActionBar_divider = 11;
public static final int ActionBar_elevation = 12;
public static final int ActionBar_height = 13;
public static final int ActionBar_hideOnContentScroll = 14;
public static final int ActionBar_homeAsUpIndicator = 15;
public static final int ActionBar_homeLayout = 16;
public static final int ActionBar_icon = 17;
public static final int ActionBar_indeterminateProgressStyle = 18;
public static final int ActionBar_itemPadding = 19;
public static final int ActionBar_logo = 20;
public static final int ActionBar_navigationMode = 21;
public static final int ActionBar_popupTheme = 22;
public static final int ActionBar_progressBarPadding = 23;
public static final int ActionBar_progressBarStyle = 24;
public static final int ActionBar_subtitle = 25;
public static final int ActionBar_subtitleTextStyle = 26;
public static final int ActionBar_title = 27;
public static final int ActionBar_titleTextStyle = 28;
public static final int[] ActionBarLayout = { 0x10100b3 };
public static final int ActionBarLayout_android_layout_gravity = 0;
public static final int[] ActionMenuItemView = { 0x101013f };
public static final int ActionMenuItemView_android_minWidth = 0;
public static final int[] ActionMenuView = { };
public static final int[] ActionMode = { 0x7f020031, 0x7f020032, 0x7f02004a, 0x7f020087, 0x7f02010f, 0x7f020133 };
public static final int ActionMode_background = 0;
public static final int ActionMode_backgroundSplit = 1;
public static final int ActionMode_closeItemLayout = 2;
public static final int ActionMode_height = 3;
public static final int ActionMode_subtitleTextStyle = 4;
public static final int ActionMode_titleTextStyle = 5;
public static final int[] ActivityChooserView = { 0x7f020078, 0x7f020091 };
public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 0;
public static final int ActivityChooserView_initialActivityCount = 1;
public static final int[] AlertDialog = { 0x10100f2, 0x7f020040, 0x7f020041, 0x7f0200d2, 0x7f0200d3, 0x7f0200df, 0x7f020101, 0x7f020102 };
public static final int AlertDialog_android_layout = 0;
public static final int AlertDialog_buttonIconDimen = 1;
public static final int AlertDialog_buttonPanelSideLayout = 2;
public static final int AlertDialog_listItemLayout = 3;
public static final int AlertDialog_listLayout = 4;
public static final int AlertDialog_multiChoiceItemLayout = 5;
public static final int AlertDialog_showTitle = 6;
public static final int AlertDialog_singleChoiceItemLayout = 7;
public static final int[] AnimatedStateListDrawableCompat = { 0x101011c, 0x1010194, 0x1010195, 0x1010196, 0x101030c, 0x101030d };
public static final int AnimatedStateListDrawableCompat_android_dither = 0;
public static final int AnimatedStateListDrawableCompat_android_visible = 1;
public static final int AnimatedStateListDrawableCompat_android_variablePadding = 2;
public static final int AnimatedStateListDrawableCompat_android_constantSize = 3;
public static final int AnimatedStateListDrawableCompat_android_enterFadeDuration = 4;
public static final int AnimatedStateListDrawableCompat_android_exitFadeDuration = 5;
public static final int[] AnimatedStateListDrawableItem = { 0x10100d0, 0x1010199 };
public static final int AnimatedStateListDrawableItem_android_id = 0;
public static final int AnimatedStateListDrawableItem_android_drawable = 1;
public static final int[] AnimatedStateListDrawableTransition = { 0x1010199, 0x1010449, 0x101044a, 0x101044b };
public static final int AnimatedStateListDrawableTransition_android_drawable = 0;
public static final int AnimatedStateListDrawableTransition_android_toId = 1;
public static final int AnimatedStateListDrawableTransition_android_fromId = 2;
public static final int AnimatedStateListDrawableTransition_android_reversible = 3;
public static final int[] AppCompatImageView = { 0x1010119, 0x7f020107, 0x7f020128, 0x7f020129 };
public static final int AppCompatImageView_android_src = 0;
public static final int AppCompatImageView_srcCompat = 1;
public static final int AppCompatImageView_tint = 2;
public static final int AppCompatImageView_tintMode = 3;
public static final int[] AppCompatSeekBar = { 0x1010142, 0x7f020125, 0x7f020126, 0x7f020127 };
public static final int AppCompatSeekBar_android_thumb = 0;
public static final int AppCompatSeekBar_tickMark = 1;
public static final int AppCompatSeekBar_tickMarkTint = 2;
public static final int AppCompatSeekBar_tickMarkTintMode = 3;
public static final int[] AppCompatTextHelper = { 0x1010034, 0x101016d, 0x101016e, 0x101016f, 0x1010170, 0x1010392, 0x1010393 };
public static final int AppCompatTextHelper_android_textAppearance = 0;
public static final int AppCompatTextHelper_android_drawableTop = 1;
public static final int AppCompatTextHelper_android_drawableBottom = 2;
public static final int AppCompatTextHelper_android_drawableLeft = 3;
public static final int AppCompatTextHelper_android_drawableRight = 4;
public static final int AppCompatTextHelper_android_drawableStart = 5;
public static final int AppCompatTextHelper_android_drawableEnd = 6;
public static final int[] AppCompatTextView = { 0x1010034, 0x7f02002c, 0x7f02002d, 0x7f02002e, 0x7f02002f, 0x7f020030, 0x7f020079, 0x7f02007b, 0x7f020095, 0x7f0200cf, 0x7f020115 };
public static final int AppCompatTextView_android_textAppearance = 0;
public static final int AppCompatTextView_autoSizeMaxTextSize = 1;
public static final int AppCompatTextView_autoSizeMinTextSize = 2;
public static final int AppCompatTextView_autoSizePresetSizes = 3;
public static final int AppCompatTextView_autoSizeStepGranularity = 4;
public static final int AppCompatTextView_autoSizeTextType = 5;
public static final int AppCompatTextView_firstBaselineToTopHeight = 6;
public static final int AppCompatTextView_fontFamily = 7;
public static final int AppCompatTextView_lastBaselineToBottomHeight = 8;
public static final int AppCompatTextView_lineHeight = 9;
public static final int AppCompatTextView_textAllCaps = 10;
public static final int[] AppCompatTheme = { 0x1010057, 0x10100ae, 0x7f020000, 0x7f020001, 0x7f020002, 0x7f020003, 0x7f020004, 0x7f020005, 0x7f020006, 0x7f020007, 0x7f020008, 0x7f020009, 0x7f02000a, 0x7f02000b, 0x7f02000c, 0x7f02000e, 0x7f02000f, 0x7f020010, 0x7f020011, 0x7f020012, 0x7f020013, 0x7f020014, 0x7f020015, 0x7f020016, 0x7f020017, 0x7f020018, 0x7f020019, 0x7f02001a, 0x7f02001b, 0x7f02001c, 0x7f02001d, 0x7f02001e, 0x7f020021, 0x7f020022, 0x7f020023, 0x7f020024, 0x7f020025, 0x7f02002b, 0x7f020039, 0x7f02003a, 0x7f02003b, 0x7f02003c, 0x7f02003d, 0x7f02003e, 0x7f020042, 0x7f020043, 0x7f020047, 0x7f020048, 0x7f02004e, 0x7f02004f, 0x7f020050, 0x7f020051, 0x7f020052, 0x7f020053, 0x7f020054, 0x7f020055, 0x7f020056, 0x7f020057, 0x7f020063, 0x7f020067, 0x7f020068, 0x7f020069, 0x7f02006c, 0x7f02006e, 0x7f020071, 0x7f020072, 0x7f020073, 0x7f020074, 0x7f020075, 0x7f020089, 0x7f02008f, 0x7f0200d0, 0x7f0200d1, 0x7f0200d4, 0x7f0200d5, 0x7f0200d6, 0x7f0200d7, 0x7f0200d8, 0x7f0200d9, 0x7f0200da, 0x7f0200e9, 0x7f0200ea, 0x7f0200eb, 0x7f0200ec, 0x7f0200ee, 0x7f0200f4, 0x7f0200f5, 0x7f0200f6, 0x7f0200f7, 0x7f0200fa, 0x7f0200fb, 0x7f0200fc, 0x7f0200fd, 0x7f020104, 0x7f020105, 0x7f020113, 0x7f020116, 0x7f020117, 0x7f020118, 0x7f020119, 0x7f02011a, 0x7f02011b, 0x7f02011c, 0x7f02011d, 0x7f02011e, 0x7f02011f, 0x7f020134, 0x7f020135, 0x7f020136, 0x7f020137, 0x7f02013d, 0x7f02013f, 0x7f020140, 0x7f020141, 0x7f020142, 0x7f020143, 0x7f020144, 0x7f020145, 0x7f020146, 0x7f020147, 0x7f020148 };
public static final int AppCompatTheme_android_windowIsFloating = 0;
public static final int AppCompatTheme_android_windowAnimationStyle = 1;
public static final int AppCompatTheme_actionBarDivider = 2;
public static final int AppCompatTheme_actionBarItemBackground = 3;
public static final int AppCompatTheme_actionBarPopupTheme = 4;
public static final int AppCompatTheme_actionBarSize = 5;
public static final int AppCompatTheme_actionBarSplitStyle = 6;
public static final int AppCompatTheme_actionBarStyle = 7;
public static final int AppCompatTheme_actionBarTabBarStyle = 8;
public static final int AppCompatTheme_actionBarTabStyle = 9;
public static final int AppCompatTheme_actionBarTabTextStyle = 10;
public static final int AppCompatTheme_actionBarTheme = 11;
public static final int AppCompatTheme_actionBarWidgetTheme = 12;
public static final int AppCompatTheme_actionButtonStyle = 13;
public static final int AppCompatTheme_actionDropDownStyle = 14;
public static final int AppCompatTheme_actionMenuTextAppearance = 15;
public static final int AppCompatTheme_actionMenuTextColor = 16;
public static final int AppCompatTheme_actionModeBackground = 17;
public static final int AppCompatTheme_actionModeCloseButtonStyle = 18;
public static final int AppCompatTheme_actionModeCloseDrawable = 19;
public static final int AppCompatTheme_actionModeCopyDrawable = 20;
public static final int AppCompatTheme_actionModeCutDrawable = 21;
public static final int AppCompatTheme_actionModeFindDrawable = 22;
public static final int AppCompatTheme_actionModePasteDrawable = 23;
public static final int AppCompatTheme_actionModePopupWindowStyle = 24;
public static final int AppCompatTheme_actionModeSelectAllDrawable = 25;
public static final int AppCompatTheme_actionModeShareDrawable = 26;
public static final int AppCompatTheme_actionModeSplitBackground = 27;
public static final int AppCompatTheme_actionModeStyle = 28;
public static final int AppCompatTheme_actionModeWebSearchDrawable = 29;
public static final int AppCompatTheme_actionOverflowButtonStyle = 30;
public static final int AppCompatTheme_actionOverflowMenuStyle = 31;
public static final int AppCompatTheme_activityChooserViewStyle = 32;
public static final int AppCompatTheme_alertDialogButtonGroupStyle = 33;
public static final int AppCompatTheme_alertDialogCenterButtons = 34;
public static final int AppCompatTheme_alertDialogStyle = 35;
public static final int AppCompatTheme_alertDialogTheme = 36;
public static final int AppCompatTheme_autoCompleteTextViewStyle = 37;
public static final int AppCompatTheme_borderlessButtonStyle = 38;
public static final int AppCompatTheme_buttonBarButtonStyle = 39;
public static final int AppCompatTheme_buttonBarNegativeButtonStyle = 40;
public static final int AppCompatTheme_buttonBarNeutralButtonStyle = 41;
public static final int AppCompatTheme_buttonBarPositiveButtonStyle = 42;
public static final int AppCompatTheme_buttonBarStyle = 43;
public static final int AppCompatTheme_buttonStyle = 44;
public static final int AppCompatTheme_buttonStyleSmall = 45;
public static final int AppCompatTheme_checkboxStyle = 46;
public static final int AppCompatTheme_checkedTextViewStyle = 47;
public static final int AppCompatTheme_colorAccent = 48;
public static final int AppCompatTheme_colorBackgroundFloating = 49;
public static final int AppCompatTheme_colorButtonNormal = 50;
public static final int AppCompatTheme_colorControlActivated = 51;
public static final int AppCompatTheme_colorControlHighlight = 52;
public static final int AppCompatTheme_colorControlNormal = 53;
public static final int AppCompatTheme_colorError = 54;
public static final int AppCompatTheme_colorPrimary = 55;
public static final int AppCompatTheme_colorPrimaryDark = 56;
public static final int AppCompatTheme_colorSwitchThumbNormal = 57;
public static final int AppCompatTheme_controlBackground = 58;
public static final int AppCompatTheme_dialogCornerRadius = 59;
public static final int AppCompatTheme_dialogPreferredPadding = 60;
public static final int AppCompatTheme_dialogTheme = 61;
public static final int AppCompatTheme_dividerHorizontal = 62;
public static final int AppCompatTheme_dividerVertical = 63;
public static final int AppCompatTheme_dropDownListViewStyle = 64;
public static final int AppCompatTheme_dropdownListPreferredItemHeight = 65;
public static final int AppCompatTheme_editTextBackground = 66;
public static final int AppCompatTheme_editTextColor = 67;
public static final int AppCompatTheme_editTextStyle = 68;
public static final int AppCompatTheme_homeAsUpIndicator = 69;
public static final int AppCompatTheme_imageButtonStyle = 70;
public static final int AppCompatTheme_listChoiceBackgroundIndicator = 71;
public static final int AppCompatTheme_listDividerAlertDialog = 72;
public static final int AppCompatTheme_listMenuViewStyle = 73;
public static final int AppCompatTheme_listPopupWindowStyle = 74;
public static final int AppCompatTheme_listPreferredItemHeight = 75;
public static final int AppCompatTheme_listPreferredItemHeightLarge = 76;
public static final int AppCompatTheme_listPreferredItemHeightSmall = 77;
public static final int AppCompatTheme_listPreferredItemPaddingLeft = 78;
public static final int AppCompatTheme_listPreferredItemPaddingRight = 79;
public static final int AppCompatTheme_panelBackground = 80;
public static final int AppCompatTheme_panelMenuListTheme = 81;
public static final int AppCompatTheme_panelMenuListWidth = 82;
public static final int AppCompatTheme_popupMenuStyle = 83;
public static final int AppCompatTheme_popupWindowStyle = 84;
public static final int AppCompatTheme_radioButtonStyle = 85;
public static final int AppCompatTheme_ratingBarStyle = 86;
public static final int AppCompatTheme_ratingBarStyleIndicator = 87;
public static final int AppCompatTheme_ratingBarStyleSmall = 88;
public static final int AppCompatTheme_searchViewStyle = 89;
public static final int AppCompatTheme_seekBarStyle = 90;
public static final int AppCompatTheme_selectableItemBackground = 91;
public static final int AppCompatTheme_selectableItemBackgroundBorderless = 92;
public static final int AppCompatTheme_spinnerDropDownItemStyle = 93;
public static final int AppCompatTheme_spinnerStyle = 94;
public static final int AppCompatTheme_switchStyle = 95;
public static final int AppCompatTheme_textAppearanceLargePopupMenu = 96;
public static final int AppCompatTheme_textAppearanceListItem = 97;
public static final int AppCompatTheme_textAppearanceListItemSecondary = 98;
public static final int AppCompatTheme_textAppearanceListItemSmall = 99;
public static final int AppCompatTheme_textAppearancePopupMenuHeader = 100;
public static final int AppCompatTheme_textAppearanceSearchResultSubtitle = 101;
public static final int AppCompatTheme_textAppearanceSearchResultTitle = 102;
public static final int AppCompatTheme_textAppearanceSmallPopupMenu = 103;
public static final int AppCompatTheme_textColorAlertDialogListItem = 104;
public static final int AppCompatTheme_textColorSearchUrl = 105;
public static final int AppCompatTheme_toolbarNavigationButtonStyle = 106;
public static final int AppCompatTheme_toolbarStyle = 107;
public static final int AppCompatTheme_tooltipForegroundColor = 108;
public static final int AppCompatTheme_tooltipFrameBackground = 109;
public static final int AppCompatTheme_viewInflaterClass = 110;
public static final int AppCompatTheme_windowActionBar = 111;
public static final int AppCompatTheme_windowActionBarOverlay = 112;
public static final int AppCompatTheme_windowActionModeOverlay = 113;
public static final int AppCompatTheme_windowFixedHeightMajor = 114;
public static final int AppCompatTheme_windowFixedHeightMinor = 115;
public static final int AppCompatTheme_windowFixedWidthMajor = 116;
public static final int AppCompatTheme_windowFixedWidthMinor = 117;
public static final int AppCompatTheme_windowMinWidthMajor = 118;
public static final int AppCompatTheme_windowMinWidthMinor = 119;
public static final int AppCompatTheme_windowNoTitle = 120;
public static final int[] ButtonBarLayout = { 0x7f020026 };
public static final int ButtonBarLayout_allowStacking = 0;
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f020027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] CompoundButton = { 0x1010107, 0x7f020044, 0x7f020045 };
public static final int CompoundButton_android_button = 0;
public static final int CompoundButton_buttonTint = 1;
public static final int CompoundButton_buttonTintMode = 2;
public static final int[] CoordinatorLayout = { 0x7f020094, 0x7f020109 };
public static final int CoordinatorLayout_keylines = 0;
public static final int CoordinatorLayout_statusBarBackground = 1;
public static final int[] CoordinatorLayout_Layout = { 0x10100b3, 0x7f020097, 0x7f020098, 0x7f020099, 0x7f0200c3, 0x7f0200cc, 0x7f0200cd };
public static final int CoordinatorLayout_Layout_android_layout_gravity = 0;
public static final int CoordinatorLayout_Layout_layout_anchor = 1;
public static final int CoordinatorLayout_Layout_layout_anchorGravity = 2;
public static final int CoordinatorLayout_Layout_layout_behavior = 3;
public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4;
public static final int CoordinatorLayout_Layout_layout_insetEdge = 5;
public static final int CoordinatorLayout_Layout_layout_keyline = 6;
public static final int[] DrawerArrowToggle = { 0x7f020029, 0x7f02002a, 0x7f020036, 0x7f02004d, 0x7f02006f, 0x7f020085, 0x7f020103, 0x7f020121 };
public static final int DrawerArrowToggle_arrowHeadLength = 0;
public static final int DrawerArrowToggle_arrowShaftLength = 1;
public static final int DrawerArrowToggle_barLength = 2;
public static final int DrawerArrowToggle_color = 3;
public static final int DrawerArrowToggle_drawableSize = 4;
public static final int DrawerArrowToggle_gapBetweenBars = 5;
public static final int DrawerArrowToggle_spinBars = 6;
public static final int DrawerArrowToggle_thickness = 7;
public static final int[] FontFamily = { 0x7f02007c, 0x7f02007d, 0x7f02007e, 0x7f02007f, 0x7f020080, 0x7f020081 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f02007a, 0x7f020082, 0x7f020083, 0x7f020084, 0x7f02013c };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
public static final int[] LinearLayoutCompat = { 0x10100af, 0x10100c4, 0x1010126, 0x1010127, 0x1010128, 0x7f02006b, 0x7f02006d, 0x7f0200de, 0x7f0200ff };
public static final int LinearLayoutCompat_android_gravity = 0;
public static final int LinearLayoutCompat_android_orientation = 1;
public static final int LinearLayoutCompat_android_baselineAligned = 2;
public static final int LinearLayoutCompat_android_baselineAlignedChildIndex = 3;
public static final int LinearLayoutCompat_android_weightSum = 4;
public static final int LinearLayoutCompat_divider = 5;
public static final int LinearLayoutCompat_dividerPadding = 6;
public static final int LinearLayoutCompat_measureWithLargestChild = 7;
public static final int LinearLayoutCompat_showDividers = 8;
public static final int[] LinearLayoutCompat_Layout = { 0x10100b3, 0x10100f4, 0x10100f5, 0x1010181 };
public static final int LinearLayoutCompat_Layout_android_layout_gravity = 0;
public static final int LinearLayoutCompat_Layout_android_layout_width = 1;
public static final int LinearLayoutCompat_Layout_android_layout_height = 2;
public static final int LinearLayoutCompat_Layout_android_layout_weight = 3;
public static final int[] ListPopupWindow = { 0x10102ac, 0x10102ad };
public static final int ListPopupWindow_android_dropDownHorizontalOffset = 0;
public static final int ListPopupWindow_android_dropDownVerticalOffset = 1;
public static final int[] MenuGroup = { 0x101000e, 0x10100d0, 0x1010194, 0x10101de, 0x10101df, 0x10101e0 };
public static final int MenuGroup_android_enabled = 0;
public static final int MenuGroup_android_id = 1;
public static final int MenuGroup_android_visible = 2;
public static final int MenuGroup_android_menuCategory = 3;
public static final int MenuGroup_android_orderInCategory = 4;
public static final int MenuGroup_android_checkableBehavior = 5;
public static final int[] MenuItem = { 0x1010002, 0x101000e, 0x10100d0, 0x1010106, 0x1010194, 0x10101de, 0x10101df, 0x10101e1, 0x10101e2, 0x10101e3, 0x10101e4, 0x10101e5, 0x101026f, 0x7f02000d, 0x7f02001f, 0x7f020020, 0x7f020028, 0x7f02005c, 0x7f02008c, 0x7f02008d, 0x7f0200e3, 0x7f0200fe, 0x7f020138 };
public static final int MenuItem_android_icon = 0;
public static final int MenuItem_android_enabled = 1;
public static final int MenuItem_android_id = 2;
public static final int MenuItem_android_checked = 3;
public static final int MenuItem_android_visible = 4;
public static final int MenuItem_android_menuCategory = 5;
public static final int MenuItem_android_orderInCategory = 6;
public static final int MenuItem_android_title = 7;
public static final int MenuItem_android_titleCondensed = 8;
public static final int MenuItem_android_alphabeticShortcut = 9;
public static final int MenuItem_android_numericShortcut = 10;
public static final int MenuItem_android_checkable = 11;
public static final int MenuItem_android_onClick = 12;
public static final int MenuItem_actionLayout = 13;
public static final int MenuItem_actionProviderClass = 14;
public static final int MenuItem_actionViewClass = 15;
public static final int MenuItem_alphabeticModifiers = 16;
public static final int MenuItem_contentDescription = 17;
public static final int MenuItem_iconTint = 18;
public static final int MenuItem_iconTintMode = 19;
public static final int MenuItem_numericModifiers = 20;
public static final int MenuItem_showAsAction = 21;
public static final int MenuItem_tooltipText = 22;
public static final int[] MenuView = { 0x10100ae, 0x101012c, 0x101012d, 0x101012e, 0x101012f, 0x1010130, 0x1010131, 0x7f0200ef, 0x7f02010a };
public static final int MenuView_android_windowAnimationStyle = 0;
public static final int MenuView_android_itemTextAppearance = 1;
public static final int MenuView_android_horizontalDivider = 2;
public static final int MenuView_android_verticalDivider = 3;
public static final int MenuView_android_headerBackground = 4;
public static final int MenuView_android_itemBackground = 5;
public static final int MenuView_android_itemIconDisabledAlpha = 6;
public static final int MenuView_preserveIconSpacing = 7;
public static final int MenuView_subMenuArrow = 8;
public static final int[] PopupWindow = { 0x1010176, 0x10102c9, 0x7f0200e4 };
public static final int PopupWindow_android_popupBackground = 0;
public static final int PopupWindow_android_popupAnimationStyle = 1;
public static final int PopupWindow_overlapAnchor = 2;
public static final int[] PopupWindowBackgroundState = { 0x7f020108 };
public static final int PopupWindowBackgroundState_state_above_anchor = 0;
public static final int[] RecycleListView = { 0x7f0200e5, 0x7f0200e8 };
public static final int RecycleListView_paddingBottomNoButtons = 0;
public static final int RecycleListView_paddingTopNoTitle = 1;
public static final int[] SearchView = { 0x10100da, 0x101011f, 0x1010220, 0x1010264, 0x7f020049, 0x7f020058, 0x7f020066, 0x7f020086, 0x7f02008e, 0x7f020096, 0x7f0200f2, 0x7f0200f3, 0x7f0200f8, 0x7f0200f9, 0x7f02010b, 0x7f020110, 0x7f02013e };
public static final int SearchView_android_focusable = 0;
public static final int SearchView_android_maxWidth = 1;
public static final int SearchView_android_inputType = 2;
public static final int SearchView_android_imeOptions = 3;
public static final int SearchView_closeIcon = 4;
public static final int SearchView_commitIcon = 5;
public static final int SearchView_defaultQueryHint = 6;
public static final int SearchView_goIcon = 7;
public static final int SearchView_iconifiedByDefault = 8;
public static final int SearchView_layout = 9;
public static final int SearchView_queryBackground = 10;
public static final int SearchView_queryHint = 11;
public static final int SearchView_searchHintIcon = 12;
public static final int SearchView_searchIcon = 13;
public static final int SearchView_submitBackground = 14;
public static final int SearchView_suggestionRowLayout = 15;
public static final int SearchView_voiceIcon = 16;
public static final int[] Spinner = { 0x10100b2, 0x1010176, 0x101017b, 0x1010262, 0x7f0200ed };
public static final int Spinner_android_entries = 0;
public static final int Spinner_android_popupBackground = 1;
public static final int Spinner_android_prompt = 2;
public static final int Spinner_android_dropDownWidth = 3;
public static final int Spinner_popupTheme = 4;
public static final int[] StateListDrawable = { 0x101011c, 0x1010194, 0x1010195, 0x1010196, 0x101030c, 0x101030d };
public static final int StateListDrawable_android_dither = 0;
public static final int StateListDrawable_android_visible = 1;
public static final int StateListDrawable_android_variablePadding = 2;
public static final int StateListDrawable_android_constantSize = 3;
public static final int StateListDrawable_android_enterFadeDuration = 4;
public static final int StateListDrawable_android_exitFadeDuration = 5;
public static final int[] StateListDrawableItem = { 0x1010199 };
public static final int StateListDrawableItem_android_drawable = 0;
public static final int[] SwitchCompat = { 0x1010124, 0x1010125, 0x1010142, 0x7f020100, 0x7f020106, 0x7f020111, 0x7f020112, 0x7f020114, 0x7f020122, 0x7f020123, 0x7f020124, 0x7f020139, 0x7f02013a, 0x7f02013b };
public static final int SwitchCompat_android_textOn = 0;
public static final int SwitchCompat_android_textOff = 1;
public static final int SwitchCompat_android_thumb = 2;
public static final int SwitchCompat_showText = 3;
public static final int SwitchCompat_splitTrack = 4;
public static final int SwitchCompat_switchMinWidth = 5;
public static final int SwitchCompat_switchPadding = 6;
public static final int SwitchCompat_switchTextAppearance = 7;
public static final int SwitchCompat_thumbTextPadding = 8;
public static final int SwitchCompat_thumbTint = 9;
public static final int SwitchCompat_thumbTintMode = 10;
public static final int SwitchCompat_track = 11;
public static final int SwitchCompat_trackTint = 12;
public static final int SwitchCompat_trackTintMode = 13;
public static final int[] TextAppearance = { 0x1010095, 0x1010096, 0x1010097, 0x1010098, 0x101009a, 0x101009b, 0x1010161, 0x1010162, 0x1010163, 0x1010164, 0x10103ac, 0x7f02007b, 0x7f020115 };
public static final int TextAppearance_android_textSize = 0;
public static final int TextAppearance_android_typeface = 1;
public static final int TextAppearance_android_textStyle = 2;
public static final int TextAppearance_android_textColor = 3;
public static final int TextAppearance_android_textColorHint = 4;
public static final int TextAppearance_android_textColorLink = 5;
public static final int TextAppearance_android_shadowColor = 6;
public static final int TextAppearance_android_shadowDx = 7;
public static final int TextAppearance_android_shadowDy = 8;
public static final int TextAppearance_android_shadowRadius = 9;
public static final int TextAppearance_android_fontFamily = 10;
public static final int TextAppearance_fontFamily = 11;
public static final int TextAppearance_textAllCaps = 12;
public static final int[] Toolbar = { 0x10100af, 0x1010140, 0x7f02003f, 0x7f02004b, 0x7f02004c, 0x7f02005d, 0x7f02005e, 0x7f02005f, 0x7f020060, 0x7f020061, 0x7f020062, 0x7f0200db, 0x7f0200dc, 0x7f0200dd, 0x7f0200e0, 0x7f0200e1, 0x7f0200ed, 0x7f02010c, 0x7f02010d, 0x7f02010e, 0x7f02012a, 0x7f02012b, 0x7f02012c, 0x7f02012d, 0x7f02012e, 0x7f02012f, 0x7f020130, 0x7f020131, 0x7f020132 };
public static final int Toolbar_android_gravity = 0;
public static final int Toolbar_android_minHeight = 1;
public static final int Toolbar_buttonGravity = 2;
public static final int Toolbar_collapseContentDescription = 3;
public static final int Toolbar_collapseIcon = 4;
public static final int Toolbar_contentInsetEnd = 5;
public static final int Toolbar_contentInsetEndWithActions = 6;
public static final int Toolbar_contentInsetLeft = 7;
public static final int Toolbar_contentInsetRight = 8;
public static final int Toolbar_contentInsetStart = 9;
public static final int Toolbar_contentInsetStartWithNavigation = 10;
public static final int Toolbar_logo = 11;
public static final int Toolbar_logoDescription = 12;
public static final int Toolbar_maxButtonHeight = 13;
public static final int Toolbar_navigationContentDescription = 14;
public static final int Toolbar_navigationIcon = 15;
public static final int Toolbar_popupTheme = 16;
public static final int Toolbar_subtitle = 17;
public static final int Toolbar_subtitleTextAppearance = 18;
public static final int Toolbar_subtitleTextColor = 19;
public static final int Toolbar_title = 20;
public static final int Toolbar_titleMargin = 21;
public static final int Toolbar_titleMarginBottom = 22;
public static final int Toolbar_titleMarginEnd = 23;
public static final int Toolbar_titleMarginStart = 24;
public static final int Toolbar_titleMarginTop = 25;
public static final int Toolbar_titleMargins = 26;
public static final int Toolbar_titleTextAppearance = 27;
public static final int Toolbar_titleTextColor = 28;
public static final int[] View = { 0x1010000, 0x10100da, 0x7f0200e6, 0x7f0200e7, 0x7f020120 };
public static final int View_android_theme = 0;
public static final int View_android_focusable = 1;
public static final int View_paddingEnd = 2;
public static final int View_paddingStart = 3;
public static final int View_theme = 4;
public static final int[] ViewBackgroundHelper = { 0x10100d4, 0x7f020034, 0x7f020035 };
public static final int ViewBackgroundHelper_android_background = 0;
public static final int ViewBackgroundHelper_backgroundTint = 1;
public static final int ViewBackgroundHelper_backgroundTintMode = 2;
public static final int[] ViewStubCompat = { 0x10100d0, 0x10100f2, 0x10100f3 };
public static final int ViewStubCompat_android_id = 0;
public static final int ViewStubCompat_android_layout = 1;
public static final int ViewStubCompat_android_inflatedId = 2;
}
}
| [
"[email protected]"
] | |
87ef8d14c681dabe86d5737889167b6eed50f124 | 3801a73f30aad8da2c020d03deed2c46198266c4 | /jess/PrettyPrinter.java | 47f65642039e6b9bb321d544c8890829fdc542e7 | [] | no_license | rngwrldngnr/Facade | 6eada6681e2e7d5843ba7837a283efee4326e76c | 31a421a55a1f69294fdab6c0f075e89683160b80 | refs/heads/master | 2023-04-25T21:11:53.686955 | 2021-05-28T20:41:26 | 2021-05-28T20:41:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,158 | java | package jess;
import java.util.Iterator;
public class PrettyPrinter implements Visitor
{
private Visitable m_visitable;
private boolean m_inTestCE;
public Object visitDeffacts(final Deffacts deffacts) {
final List list = new List("deffacts", deffacts.getName());
if (deffacts.getDocstring() != null && deffacts.getDocstring().length() > 0) {
list.addQuoted(deffacts.getDocstring());
}
for (int i = 0; i < deffacts.getNFacts(); ++i) {
list.newLine();
list.add(deffacts.getFact(i));
}
return list.toString();
}
public Object visitDeftemplate(final Deftemplate deftemplate) {
final List list = new List("deftemplate", deftemplate.getName());
if (deftemplate.getParent() != null && deftemplate.getParent() != deftemplate) {
list.add("extends");
list.add(deftemplate.getParent().getName());
}
if (deftemplate.getDocstring() != null && deftemplate.getDocstring().length() > 0) {
list.addQuoted(deftemplate.getDocstring());
}
for (int i = 0; i < deftemplate.m_data.size(); i += 3) {
try {
final Value value = deftemplate.m_data.get(i);
final List list2 = new List((value.type() == 16384) ? "slot" : "multislot", value);
final Value value2 = deftemplate.m_data.get(i + 1);
if (!value2.equals(Funcall.NIL) && !value2.equals(Funcall.NILLIST)) {
list2.add(new List((value2.type() == 64) ? "default-dynamic" : "default", value2));
}
final Value value3 = deftemplate.m_data.get(i + 2);
if (value3.intValue(null) != -1) {
list2.add(new List("type", value3));
}
list.newLine();
list.add(list2);
}
catch (JessException ex) {
list.add(ex.toString());
break;
}
}
return list.toString();
}
public Object visitDefglobal(final Defglobal defglobal) {
final List list = new List("defglobal");
list.add("?" + defglobal.getName());
list.add("=");
list.add(defglobal.getInitializationValue());
return list.toString();
}
public Object visitDeffunction(final Deffunction deffunction) {
final List list = new List("deffunction", deffunction.getName());
final List list2 = new List();
final Iterator arguments = deffunction.getArguments();
while (arguments.hasNext()) {
final Deffunction.Argument argument = arguments.next();
list2.add(((argument.m_type == 8) ? "?" : "$?") + argument.m_name);
}
list.add(list2);
if (deffunction.getDocstring() != null && deffunction.getDocstring().length() > 0) {
list.addQuoted(deffunction.getDocstring());
}
final Iterator actions = deffunction.getActions();
while (actions.hasNext()) {
list.newLine();
list.add(actions.next());
}
return list.toString();
}
public Object visitDefrule(final Defrule defrule) {
final List list = new List("defrule");
list.add(defrule.getName());
list.indent(" ");
if (defrule.m_docstring != null && defrule.m_docstring.length() > 0) {
list.newLine();
list.addQuoted(defrule.m_docstring);
}
int n = 0;
final List list2 = new List("declare");
try {
if (defrule.m_salienceVal.type() != 4 || defrule.m_salienceVal.intValue(null) != 0) {
final List list3 = new List("salience");
list3.add(defrule.m_salienceVal);
list2.add(list3);
n = 1;
}
}
catch (JessException ex) {}
if (defrule.getAutoFocus()) {
if (n != 0) {
list2.indent(" ");
list2.newLine();
}
final List list4 = new List("auto-focus");
list4.add("TRUE");
list2.add(list4);
n = 1;
}
if (n != 0) {
list.newLine();
list.add(list2);
}
for (int i = 0; i < defrule.getGroupSize(); ++i) {
final LHSComponent lhsComponent = defrule.getLHSComponent(i);
list.newLine();
list.add(((Visitable)lhsComponent).accept(this));
}
list.newLine();
list.add("=>");
for (int j = 0; j < defrule.getNActions(); ++j) {
list.newLine();
list.add(defrule.getAction(j).toString());
}
return list.toString();
}
public Object visitGroup(final Group group) {
final List list = new List(group.getName());
for (int i = 0; i < group.getGroupSize(); ++i) {
list.add(((Visitable)group.getLHSComponent(i)).accept(this));
}
if (group.getBoundName() != null) {
return "?" + group.getBoundName() + " <- " + list.toString();
}
return list.toString();
}
public Object visitPattern(final Pattern pattern) {
final List list = new List(pattern.getName());
final Deftemplate deftemplate = pattern.getDeftemplate();
this.m_inTestCE = pattern.getName().equals("test");
try {
for (int i = 0; i < pattern.getNSlots(); ++i) {
if (pattern.getNTests(i) != 0) {
List list2;
if (deftemplate.getSlotName(i).equals("__data")) {
list2 = list;
}
else {
list2 = new List(deftemplate.getSlotName(i));
}
for (int j = -1; j <= pattern.getSlotLength(i); ++j) {
final StringBuffer sb = new StringBuffer();
for (int k = 0; k < pattern.getNTests(i); ++k) {
final Test1 test = pattern.getTest(i, k);
if (test.m_subIdx == j) {
if (sb.length() > 0) {
sb.append("&");
}
sb.append(test.accept(this));
}
}
if (sb.length() > 0) {
list2.add(sb);
}
}
if (!deftemplate.getSlotName(i).equals("__data")) {
list.add(list2);
}
}
}
}
catch (JessException ex) {
list.add(ex.getMessage());
}
if (pattern.getBoundName() != null) {
return "?" + pattern.getBoundName() + " <- " + list.toString();
}
return list.toString();
}
public Object visitTest1(final Test1 test1) {
final StringBuffer sb = new StringBuffer();
if (test1.m_test == 1) {
sb.append("~");
}
if (test1.m_slotValue.type() == 64 && !this.m_inTestCE) {
sb.append(":");
}
sb.append(test1.m_slotValue);
return sb.toString();
}
public Object visitDefquery(final Defquery defquery) {
final List list = new List("defquery");
list.add(defquery.getName());
list.indent(" ");
if (defquery.m_docstring != null && defquery.m_docstring.length() > 0) {
list.newLine();
list.addQuoted(defquery.m_docstring);
}
if (defquery.getNVariables() > 0 || defquery.getMaxBackgroundRules() > 0) {
list.newLine();
final List list2 = new List("declare");
if (defquery.getNVariables() > 0) {
final List list3 = new List("variables");
for (int i = 0; i < defquery.getNVariables(); ++i) {
list3.add(defquery.getQueryVariable(i));
}
list2.add(list3);
}
if (defquery.getMaxBackgroundRules() > 0) {
final List list4 = new List("max-background-rules");
list4.add(String.valueOf(defquery.getMaxBackgroundRules()));
list2.add(list4);
}
list.add(list2);
}
for (int j = 0; j < defquery.getGroupSize(); ++j) {
final LHSComponent lhsComponent = defquery.getLHSComponent(j);
if (lhsComponent.getName().indexOf("__query-trigger-") == -1) {
list.newLine();
list.add(((Visitable)lhsComponent).accept(this));
}
}
return list.toString();
}
public String toString() {
return (String)this.m_visitable.accept(this);
}
private final /* synthetic */ void this() {
this.m_inTestCE = false;
}
public PrettyPrinter(final Visitable visitable) {
this.this();
this.m_visitable = visitable;
}
}
| [
"[email protected]"
] | |
433a06ba8e549487bfbd710bfe9d69967f6e1645 | 82b5d8b58b4ce2a80d18aa8b823c4d1e34026cb6 | /src/main/java/com/song/jeremy/mapstruct/ItemsMapStruct.java | 22d63a6828edcd343d852f7c1503bfbbc2d13fd9 | [] | no_license | songshengping/songshengping | e288914af41507d19e2d220839c042c3f19ffbfe | 263675235b5cc3f06bebf240de50828e0a4039c4 | refs/heads/master | 2023-02-10T03:24:35.859251 | 2021-01-10T12:58:59 | 2021-01-10T12:58:59 | 327,382,213 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,243 | java | package com.song.jeremy.mapstruct;
import com.song.jeremy.dbmodel.Items;
import com.song.jeremy.dbmodel.ItemsImg;
import com.song.jeremy.dbmodel.ItemsParam;
import com.song.jeremy.dbmodel.ItemsSpec;
import com.song.jeremy.response.ItemImgDTO;
import com.song.jeremy.response.ItemParamDTO;
import com.song.jeremy.response.ItemSpecDTO;
import com.song.jeremy.response.ItemsDTO;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* @Description TODO
* @Date 2021/1/7 23:28
* @Created by Jeremy
*/
@Mapper(nullValueCheckStrategy= NullValueCheckStrategy.ALWAYS)
public interface ItemsMapStruct {
ItemsMapStruct INSTANCE = Mappers.getMapper(ItemsMapStruct.class);
ItemsDTO toResItems(Items items);
List<ItemsDTO> toResItemsList(List<Items> itemsList);
ItemSpecDTO toResItemsSpec(ItemsSpec itemsSpec);
List<ItemSpecDTO> toResItemsSpecList(List<ItemsSpec> itemsSpecList);
ItemParamDTO toResItemsParam(ItemsParam itemsParam);
List<ItemParamDTO> toResItemsParamList(List<ItemParamDTO> itemsSpecList);
ItemImgDTO toResItemsImg(ItemsImg itemsImg);
List<ItemImgDTO> toResItemsImgList(List<ItemsImg> itemsSpecList);
}
| [
"="
] | = |
05c85aeedd1f8c1e1e833ab26a6678264d97f442 | 3600ae0359126c9c804c508cacc1ddafb911fda6 | /FinanceApplication/src/shahi/Action/ReportFolder/EPM/beans/ChequeSearch.java | 793b7518ba5c5d5f13606c632d7e9fee55df29b4 | [] | no_license | vins667/FinanceApp | 30a4bc264915f9b61df8e4cf227a6e577297ae8e | c03b34f46f1d630aba60041516500ebb8442a8d2 | refs/heads/master | 2020-03-19T06:24:11.728711 | 2018-06-04T12:00:39 | 2018-06-04T12:00:39 | 136,016,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,173 | java | package shahi.Action.ReportFolder.EPM.beans;
public class ChequeSearch {
private String ckcono;
private String ckdivi;
private String ckyea4;
private String ckbkid;
private String ckchkn;
private String ckspyn;
private String cksunm;
private String ckpycu;
private String ckait1;
private String ckdtpr;
private String ckvser;
private String ckvono;
public ChequeSearch(){
}
public String getCkcono() {
return ckcono;
}
public void setCkcono(String ckcono) {
this.ckcono = ckcono;
}
public String getCkdivi() {
return ckdivi;
}
public void setCkdivi(String ckdivi) {
this.ckdivi = ckdivi;
}
public String getCkyea4() {
return ckyea4;
}
public void setCkyea4(String ckyea4) {
this.ckyea4 = ckyea4;
}
public String getCkbkid() {
return ckbkid;
}
public void setCkbkid(String ckbkid) {
this.ckbkid = ckbkid;
}
public String getCkchkn() {
return ckchkn;
}
public void setCkchkn(String ckchkn) {
this.ckchkn = ckchkn;
}
public String getCkspyn() {
return ckspyn;
}
public void setCkspyn(String ckspyn) {
this.ckspyn = ckspyn;
}
public String getCksunm() {
return cksunm;
}
public void setCksunm(String cksunm) {
this.cksunm = cksunm;
}
public String getCkpycu() {
return ckpycu;
}
public void setCkpycu(String ckpycu) {
this.ckpycu = ckpycu;
}
public String getCkait1() {
return ckait1;
}
public void setCkait1(String ckait1) {
this.ckait1 = ckait1;
}
public String getCkdtpr() {
return ckdtpr;
}
public void setCkdtpr(String ckdtpr) {
this.ckdtpr = ckdtpr;
}
public String getCkvser() {
return ckvser;
}
public void setCkvser(String ckvser) {
this.ckvser = ckvser;
}
public String getCkvono() {
return ckvono;
}
public void setCkvono(String ckvono) {
this.ckvono = ckvono;
}
@Override
public String toString() {
return "ChequeSearch [ckcono=" + ckcono + ", ckdivi=" + ckdivi + ", ckyea4=" + ckyea4 + ", ckbkid=" + ckbkid
+ ", ckchkn=" + ckchkn + ", ckspyn=" + ckspyn + ", cksunm=" + cksunm + ", ckpycu=" + ckpycu
+ ", ckait1=" + ckait1 + ", ckdtpr=" + ckdtpr + ", ckvser=" + ckvser + ", ckvono=" + ckvono + "]";
}
}
| [
"[email protected]"
] | |
f9818e77162158d295afcd5f43fadb55cf471465 | 0b6a1811466d1c294355bcf902104a135abe667e | /src/flashcards/Main.java | d1b036cff141bc19460165ca2d390ea6499b3476 | [] | no_license | jslubowski/flashcards | 9873caec08508029628fcbcbe935531dbecb8076 | bab0657523cb842767650293095972ffa0a25142 | refs/heads/master | 2020-06-03T03:32:03.894999 | 2019-12-27T13:07:57 | 2019-12-27T13:07:57 | 191,419,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 135 | java | package flashcards;
public class Main {
public static void main(String[] args) {
System.out.print("Hello world!");
}
} | [
"[email protected]"
] | |
9b9e416077ef559b26a1e726ef471151b669da63 | 976c08e4954a12f72cbe9f8beeb4778cd8427015 | /app/src/androidTest/java/async/shah/com/retrofittest/ExampleInstrumentedTest.java | 701c7b39718bca52f937a6176796686f3cc16c61 | [] | no_license | sics-shah/Retro | 46959c1cdbc42a6ce54726e9811aff0e1917f28e | 9d3af752304224f2eb0146780deb6de46a7122fe | refs/heads/master | 2020-12-02T06:40:31.139533 | 2017-07-24T07:40:19 | 2017-07-24T07:40:19 | 96,875,766 | 0 | 0 | null | 2017-07-24T07:40:19 | 2017-07-11T09:27:09 | Java | UTF-8 | Java | false | false | 784 | java | package async.shah.com.retrofittest;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("async.shah.com.retrofittest", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
37103c45c84efdf82092f1c3a500d669dcdf5296 | 56ea0ecdda41ae1fe952ca77f72866b87cbf578b | /src/org/volante/abm/serialization/CellRasterReader.java | 2f8a10f8e30f09faf1ed5a6953dda6c833df4a05 | [] | no_license | jamesdamillington/CRAFTY_Brazil | d9ea3a308ae77c24baceba2ece99ea5630f390ac | ad58f75b6ed044fed73d2eff7ad369babe07a794 | refs/heads/master | 2021-08-20T04:51:45.564103 | 2021-01-08T12:04:52 | 2021-01-08T12:04:52 | 241,864,383 | 1 | 1 | null | 2021-01-08T11:54:03 | 2020-02-20T11:13:01 | Java | UTF-8 | Java | false | false | 2,668 | java | /**
* This file is part of
*
* CRAFTY - Competition for Resources between Agent Functional TYpes
*
* Copyright (C) 2014 School of GeoScience, University of Edinburgh, Edinburgh, UK
*
* CRAFTY is free software: You can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* CRAFTY is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* School of Geoscience, University of Edinburgh, Edinburgh, UK
*/
package org.volante.abm.serialization;
import static java.lang.Double.isNaN;
import org.apache.log4j.Logger;
import org.simpleframework.xml.Attribute;
import org.volante.abm.data.Capital;
import org.volante.abm.data.Cell;
import org.volante.abm.data.ModelData;
import org.volante.abm.serialization.RegionLoader.CellInitialiser;
import com.moseph.gis.raster.Raster;
import com.moseph.modelutils.fastdata.DoubleMap;
/**
* Reads information from a csv file into the given region
*
* @author dmrust
*
*/
public class CellRasterReader implements CellInitialiser {
@Attribute(name = "file")
String rasterFile = "";
@Attribute(name = "capital")
String capitalName = "HUMAN";
Logger log = Logger.getLogger(getClass());
@Override
public void initialise(RegionLoader rl) throws Exception {
ModelData data = rl.modelData;
log.info("Loading raster for " + capitalName + " from " + rasterFile);
Raster raster = rl.persister.readRaster(rasterFile, rl.getRegion()
.getPersisterContextExtra());
Capital capital = data.capitals.forName(capitalName);
int cells = 0;
for (int x = 0; x < raster.getCols(); x++) {
for (int y = 0; y < raster.getRows(); y++) {
double val = raster.getValue(y, x);
int xPos = raster.colToX(x);
int yPos = raster.rowToY(y);
if (isNaN(val)) {
continue;
}
cells++;
if (cells % 10000 == 0) {
log.debug("Cell: " + cells);
Runtime r = Runtime.getRuntime();
log.debug(String.format("Mem: Total: %d, Free: %d, Used: %d\n",
r.totalMemory(), r.freeMemory(), r.totalMemory() - r.freeMemory()));
}
Cell cell = rl.getCell(xPos, yPos);
DoubleMap<Capital> adjusted = data.capitalMap();
cell.getBaseCapitals().copyInto(adjusted);
adjusted.putDouble(capital, val);
cell.setBaseCapitals(adjusted);
}
}
}
}
| [
"[email protected]"
] | |
147c7b0d233331a91d2f73edca709b26c057e4f5 | 36d0740b47725d0d27b8ac6a2714ba030bfb9b78 | /src/de/diddiz/codegeneration/codetree/IfElse.java | 6e94958f6b16ae6ddcce762ee1db510b459d91bc | [
"MIT"
] | permissive | DiddiZ/CodeGeneration | 82cc850d443aeb4643b2bb5169caa28a0e86e10a | 92bb2ba2e11701c66ad3c08ea59d5279da3c22d4 | refs/heads/master | 2021-01-13T16:15:58.729946 | 2017-04-12T10:30:36 | 2017-04-12T10:30:36 | 81,147,832 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,026 | java | package de.diddiz.codegeneration.codetree;
import java.util.List;
import java.util.Set;
import de.diddiz.codegeneration.codetree.evaluation.EvaluationContext;
import de.diddiz.codegeneration.codetree.generator.Context;
import de.diddiz.codegeneration.codetree.generator.Generator;
import de.diddiz.codegeneration.exceptions.EvaluationException;
import de.diddiz.utils.Utils;
public class IfElse extends Statement
{
private final Expression condition;
private final Block ifBlock, elseBlock;
public IfElse(Expression condition, Block ifBlock) {
this(condition, ifBlock, null);
}
public IfElse(Expression condition, Block ifBlock, Block elseBlock) {
this.condition = condition;
this.ifBlock = ifBlock;
this.elseBlock = elseBlock;
}
@Override
public Integer eval(EvaluationContext context) throws EvaluationException {
if (condition.eval(context))
return ifBlock.eval(context);
return elseBlock != null ? elseBlock.eval(context) : null;
}
@Override
public Statement mutate(Set<CodeElement> mutated, Context context) {
if (mutated.contains(this)) // Mutate this
return Generator.generateStatement(context);
// Mutate children
return new IfElse(condition.mutate(mutated, context), ifBlock.mutate(mutated, context), elseBlock != null ? elseBlock.mutate(mutated, context) : null);
}
@Override
public boolean returns() {
return ifBlock.returns() && elseBlock != null && elseBlock.returns();
}
@Override
public String toCode() {
String ret = "if (" + condition.toCode() + ") {" + Utils.NEWLINE + ifBlock.toCode() + Utils.NEWLINE + "}";
if (elseBlock != null)
ret += " else {" + Utils.NEWLINE + elseBlock.toCode() + Utils.NEWLINE + "}";
return ret;
}
@Override
protected void gatherChildren(List<CodeElement> children) {
children.add(this);
children.add(condition);
condition.gatherChildren(children);
children.add(ifBlock);
ifBlock.gatherChildren(children);
if (elseBlock != null) {
children.add(elseBlock);
elseBlock.gatherChildren(children);
}
}
}
| [
"[email protected]"
] | |
70551d0d8ca68b2e1d767bff664d9a70f927bf80 | 422b55940c5f2e47c2cb6a4042edfa1a163050ff | /MintLocker/app/src/main/java/com/bss/mintlocker/ui/fragments/OncePerMonth.java | 1761c367e98c27f507715093e29fed996341a573 | [] | no_license | garg-neha198814/MintLocker9Feb | 3fda6b935f73ac355abd81121da64c4b913c66df | a01675c7399f6ed853a8d3218b846758fcb9b847 | refs/heads/master | 2021-01-17T17:09:43.229538 | 2016-06-24T07:32:26 | 2016-06-24T07:32:26 | 61,865,872 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,202 | java | package com.bss.mintlocker.ui.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import com.bss.mintlocker.R;
import com.bss.mintlocker.adapter.OncePerMonthAdapter;
import com.bss.mintlocker.landing.LandingScreenActivity;
import com.bss.mintlocker.model.OncePerMonthModel;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
/**
* Created by bhawanisingh on 04/12/15.
*/
public class OncePerMonth extends Fragment implements View.OnClickListener {
public OncePerMonth() {
}
int monthMaxDays = 0;
GridView gridView;
List<OncePerMonthModel> rowItems;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_once_per_month, container, false);
LandingScreenActivity.mToolbarTitle.setText("Deposit");
gridView = (GridView) v.findViewById(R.id.once_per_month_gridview);
Calendar c = Calendar.getInstance();
monthMaxDays = c.getActualMaximum(Calendar.DAY_OF_MONTH);
int[] arrayVal = new int[monthMaxDays];
for (int j = 1; j <= monthMaxDays; j++) {
arrayVal[j - 1] = j;
}
System.out.println("Size>>" + arrayVal.length);
//setting dummy list
rowItems = new ArrayList<OncePerMonthModel>();
for (int i = 0; i < arrayVal.length; i++) {
OncePerMonthModel item = new OncePerMonthModel(arrayVal[i]);
rowItems.add(item);
}
System.out.println("Size11>>" + rowItems.size());
for (int i = 0; i < arrayVal.length; i++) {
System.out.println("value are >>" + arrayVal[i]);
}
//setting dummy adapter
OncePerMonthAdapter adapter = new OncePerMonthAdapter(getActivity(), rowItems);
gridView.setAdapter(adapter);
return v;
}
@Override
public void onClick(View v) {
switch (v.getId()) {
}
}
}
| [
"[email protected]"
] | |
6eb06ab968db98e922c8a6f5349f7f8d65443676 | 0a8bbc5c88f7a362304d5a1547f9999249aec1ff | /thriftdemo/src/main/java/thrift/test/SomeUnion.java | 880bbb501df52b8cb4cbc47d305cdd5c1b37d6f1 | [] | no_license | yangjiugang/teamway | 697ea4296f92d7982166f5607b42b4ece6374a91 | 425cf8b1d0bc759a5f79c40cde700adbef39ba12 | refs/heads/master | 2021-10-20T21:46:13.327612 | 2018-07-30T08:10:01 | 2018-07-30T08:10:01 | 108,513,918 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | true | 21,621 | java | /**
* Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package thrift.test;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
public class SomeUnion extends org.apache.thrift.TUnion<SomeUnion, SomeUnion._Fields> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SomeUnion");
private static final org.apache.thrift.protocol.TField MAP_THING_FIELD_DESC = new org.apache.thrift.protocol.TField("map_thing", org.apache.thrift.protocol.TType.MAP, (short)1);
private static final org.apache.thrift.protocol.TField STRING_THING_FIELD_DESC = new org.apache.thrift.protocol.TField("string_thing", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField I32_THING_FIELD_DESC = new org.apache.thrift.protocol.TField("i32_thing", org.apache.thrift.protocol.TType.I32, (short)3);
private static final org.apache.thrift.protocol.TField XTRUCT_THING_FIELD_DESC = new org.apache.thrift.protocol.TField("xtruct_thing", org.apache.thrift.protocol.TType.STRUCT, (short)4);
private static final org.apache.thrift.protocol.TField INSANITY_THING_FIELD_DESC = new org.apache.thrift.protocol.TField("insanity_thing", org.apache.thrift.protocol.TType.STRUCT, (short)5);
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
MAP_THING((short)1, "map_thing"),
STRING_THING((short)2, "string_thing"),
I32_THING((short)3, "i32_thing"),
XTRUCT_THING((short)4, "xtruct_thing"),
INSANITY_THING((short)5, "insanity_thing");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // MAP_THING
return MAP_THING;
case 2: // STRING_THING
return STRING_THING;
case 3: // I32_THING
return I32_THING;
case 4: // XTRUCT_THING
return XTRUCT_THING;
case 5: // INSANITY_THING
return INSANITY_THING;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.MAP_THING, new org.apache.thrift.meta_data.FieldMetaData("map_thing", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Numberz.class),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "UserId"))));
tmpMap.put(_Fields.STRING_THING, new org.apache.thrift.meta_data.FieldMetaData("string_thing", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.I32_THING, new org.apache.thrift.meta_data.FieldMetaData("i32_thing", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.XTRUCT_THING, new org.apache.thrift.meta_data.FieldMetaData("xtruct_thing", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Xtruct3.class)));
tmpMap.put(_Fields.INSANITY_THING, new org.apache.thrift.meta_data.FieldMetaData("insanity_thing", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Insanity.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SomeUnion.class, metaDataMap);
}
public SomeUnion() {
super();
}
public SomeUnion(_Fields setField, java.lang.Object value) {
super(setField, value);
}
public SomeUnion(SomeUnion other) {
super(other);
}
public SomeUnion deepCopy() {
return new SomeUnion(this);
}
public static SomeUnion map_thing(java.util.Map<Numberz,java.lang.Long> value) {
SomeUnion x = new SomeUnion();
x.setMap_thing(value);
return x;
}
public static SomeUnion string_thing(java.lang.String value) {
SomeUnion x = new SomeUnion();
x.setString_thing(value);
return x;
}
public static SomeUnion i32_thing(int value) {
SomeUnion x = new SomeUnion();
x.setI32_thing(value);
return x;
}
public static SomeUnion xtruct_thing(Xtruct3 value) {
SomeUnion x = new SomeUnion();
x.setXtruct_thing(value);
return x;
}
public static SomeUnion insanity_thing(Insanity value) {
SomeUnion x = new SomeUnion();
x.setInsanity_thing(value);
return x;
}
@Override
protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException {
switch (setField) {
case MAP_THING:
if (value instanceof java.util.Map) {
break;
}
throw new java.lang.ClassCastException("Was expecting value of type java.util.Map<Numberz,java.lang.Long> for field 'map_thing', but got " + value.getClass().getSimpleName());
case STRING_THING:
if (value instanceof java.lang.String) {
break;
}
throw new java.lang.ClassCastException("Was expecting value of type java.lang.String for field 'string_thing', but got " + value.getClass().getSimpleName());
case I32_THING:
if (value instanceof java.lang.Integer) {
break;
}
throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'i32_thing', but got " + value.getClass().getSimpleName());
case XTRUCT_THING:
if (value instanceof Xtruct3) {
break;
}
throw new java.lang.ClassCastException("Was expecting value of type Xtruct3 for field 'xtruct_thing', but got " + value.getClass().getSimpleName());
case INSANITY_THING:
if (value instanceof Insanity) {
break;
}
throw new java.lang.ClassCastException("Was expecting value of type Insanity for field 'insanity_thing', but got " + value.getClass().getSimpleName());
default:
throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
}
}
@Override
protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
_Fields setField = _Fields.findByThriftId(field.id);
if (setField != null) {
switch (setField) {
case MAP_THING:
if (field.type == MAP_THING_FIELD_DESC.type) {
java.util.Map<Numberz,java.lang.Long> map_thing;
{
org.apache.thrift.protocol.TMap _map88 = iprot.readMapBegin();
map_thing = new java.util.HashMap<Numberz,java.lang.Long>(2*_map88.size);
Numberz _key89;
long _val90;
for (int _i91 = 0; _i91 < _map88.size; ++_i91)
{
_key89 = thrift.test.Numberz.findByValue(iprot.readI32());
_val90 = iprot.readI64();
map_thing.put(_key89, _val90);
}
iprot.readMapEnd();
}
return map_thing;
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
return null;
}
case STRING_THING:
if (field.type == STRING_THING_FIELD_DESC.type) {
java.lang.String string_thing;
string_thing = iprot.readString();
return string_thing;
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
return null;
}
case I32_THING:
if (field.type == I32_THING_FIELD_DESC.type) {
java.lang.Integer i32_thing;
i32_thing = iprot.readI32();
return i32_thing;
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
return null;
}
case XTRUCT_THING:
if (field.type == XTRUCT_THING_FIELD_DESC.type) {
Xtruct3 xtruct_thing;
xtruct_thing = new Xtruct3();
xtruct_thing.read(iprot);
return xtruct_thing;
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
return null;
}
case INSANITY_THING:
if (field.type == INSANITY_THING_FIELD_DESC.type) {
Insanity insanity_thing;
insanity_thing = new Insanity();
insanity_thing.read(iprot);
return insanity_thing;
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
return null;
}
default:
throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
}
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
return null;
}
}
@Override
protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
switch (setField_) {
case MAP_THING:
java.util.Map<Numberz,java.lang.Long> map_thing = (java.util.Map<Numberz,java.lang.Long>)value_;
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.I64, map_thing.size()));
for (java.util.Map.Entry<Numberz, java.lang.Long> _iter92 : map_thing.entrySet())
{
oprot.writeI32(_iter92.getKey().getValue());
oprot.writeI64(_iter92.getValue());
}
oprot.writeMapEnd();
}
return;
case STRING_THING:
java.lang.String string_thing = (java.lang.String)value_;
oprot.writeString(string_thing);
return;
case I32_THING:
java.lang.Integer i32_thing = (java.lang.Integer)value_;
oprot.writeI32(i32_thing);
return;
case XTRUCT_THING:
Xtruct3 xtruct_thing = (Xtruct3)value_;
xtruct_thing.write(oprot);
return;
case INSANITY_THING:
Insanity insanity_thing = (Insanity)value_;
insanity_thing.write(oprot);
return;
default:
throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
}
}
@Override
protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
_Fields setField = _Fields.findByThriftId(fieldID);
if (setField != null) {
switch (setField) {
case MAP_THING:
java.util.Map<Numberz,java.lang.Long> map_thing;
{
org.apache.thrift.protocol.TMap _map93 = iprot.readMapBegin();
map_thing = new java.util.HashMap<Numberz,java.lang.Long>(2*_map93.size);
Numberz _key94;
long _val95;
for (int _i96 = 0; _i96 < _map93.size; ++_i96)
{
_key94 = thrift.test.Numberz.findByValue(iprot.readI32());
_val95 = iprot.readI64();
map_thing.put(_key94, _val95);
}
iprot.readMapEnd();
}
return map_thing;
case STRING_THING:
java.lang.String string_thing;
string_thing = iprot.readString();
return string_thing;
case I32_THING:
java.lang.Integer i32_thing;
i32_thing = iprot.readI32();
return i32_thing;
case XTRUCT_THING:
Xtruct3 xtruct_thing;
xtruct_thing = new Xtruct3();
xtruct_thing.read(iprot);
return xtruct_thing;
case INSANITY_THING:
Insanity insanity_thing;
insanity_thing = new Insanity();
insanity_thing.read(iprot);
return insanity_thing;
default:
throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
}
} else {
throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID);
}
}
@Override
protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
switch (setField_) {
case MAP_THING:
java.util.Map<Numberz,java.lang.Long> map_thing = (java.util.Map<Numberz,java.lang.Long>)value_;
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.I64, map_thing.size()));
for (java.util.Map.Entry<Numberz, java.lang.Long> _iter97 : map_thing.entrySet())
{
oprot.writeI32(_iter97.getKey().getValue());
oprot.writeI64(_iter97.getValue());
}
oprot.writeMapEnd();
}
return;
case STRING_THING:
java.lang.String string_thing = (java.lang.String)value_;
oprot.writeString(string_thing);
return;
case I32_THING:
java.lang.Integer i32_thing = (java.lang.Integer)value_;
oprot.writeI32(i32_thing);
return;
case XTRUCT_THING:
Xtruct3 xtruct_thing = (Xtruct3)value_;
xtruct_thing.write(oprot);
return;
case INSANITY_THING:
Insanity insanity_thing = (Insanity)value_;
insanity_thing.write(oprot);
return;
default:
throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
}
}
@Override
protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) {
switch (setField) {
case MAP_THING:
return MAP_THING_FIELD_DESC;
case STRING_THING:
return STRING_THING_FIELD_DESC;
case I32_THING:
return I32_THING_FIELD_DESC;
case XTRUCT_THING:
return XTRUCT_THING_FIELD_DESC;
case INSANITY_THING:
return INSANITY_THING_FIELD_DESC;
default:
throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
}
}
@Override
protected org.apache.thrift.protocol.TStruct getStructDesc() {
return STRUCT_DESC;
}
@Override
protected _Fields enumForId(short id) {
return _Fields.findByThriftIdOrThrow(id);
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public java.util.Map<Numberz,java.lang.Long> getMap_thing() {
if (getSetField() == _Fields.MAP_THING) {
return (java.util.Map<Numberz,java.lang.Long>)getFieldValue();
} else {
throw new java.lang.RuntimeException("Cannot get field 'map_thing' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setMap_thing(java.util.Map<Numberz,java.lang.Long> value) {
if (value == null) throw new java.lang.NullPointerException();
setField_ = _Fields.MAP_THING;
value_ = value;
}
public java.lang.String getString_thing() {
if (getSetField() == _Fields.STRING_THING) {
return (java.lang.String)getFieldValue();
} else {
throw new java.lang.RuntimeException("Cannot get field 'string_thing' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setString_thing(java.lang.String value) {
if (value == null) throw new java.lang.NullPointerException();
setField_ = _Fields.STRING_THING;
value_ = value;
}
public int getI32_thing() {
if (getSetField() == _Fields.I32_THING) {
return (java.lang.Integer)getFieldValue();
} else {
throw new java.lang.RuntimeException("Cannot get field 'i32_thing' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setI32_thing(int value) {
setField_ = _Fields.I32_THING;
value_ = value;
}
public Xtruct3 getXtruct_thing() {
if (getSetField() == _Fields.XTRUCT_THING) {
return (Xtruct3)getFieldValue();
} else {
throw new java.lang.RuntimeException("Cannot get field 'xtruct_thing' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setXtruct_thing(Xtruct3 value) {
if (value == null) throw new java.lang.NullPointerException();
setField_ = _Fields.XTRUCT_THING;
value_ = value;
}
public Insanity getInsanity_thing() {
if (getSetField() == _Fields.INSANITY_THING) {
return (Insanity)getFieldValue();
} else {
throw new java.lang.RuntimeException("Cannot get field 'insanity_thing' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setInsanity_thing(Insanity value) {
if (value == null) throw new java.lang.NullPointerException();
setField_ = _Fields.INSANITY_THING;
value_ = value;
}
public boolean isSetMap_thing() {
return setField_ == _Fields.MAP_THING;
}
public boolean isSetString_thing() {
return setField_ == _Fields.STRING_THING;
}
public boolean isSetI32_thing() {
return setField_ == _Fields.I32_THING;
}
public boolean isSetXtruct_thing() {
return setField_ == _Fields.XTRUCT_THING;
}
public boolean isSetInsanity_thing() {
return setField_ == _Fields.INSANITY_THING;
}
public boolean equals(java.lang.Object other) {
if (other instanceof SomeUnion) {
return equals((SomeUnion)other);
} else {
return false;
}
}
public boolean equals(SomeUnion other) {
return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue());
}
@Override
public int compareTo(SomeUnion other) {
int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField());
if (lastComparison == 0) {
return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue());
}
return lastComparison;
}
@Override
public int hashCode() {
java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>();
list.add(this.getClass().getName());
org.apache.thrift.TFieldIdEnum setField = getSetField();
if (setField != null) {
list.add(setField.getThriftFieldId());
java.lang.Object value = getFieldValue();
if (value instanceof org.apache.thrift.TEnum) {
list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
} else {
list.add(value);
}
}
return list.hashCode();
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
}
| [
"gaven@DESKTOP-DUDNVRA"
] | gaven@DESKTOP-DUDNVRA |
533784c304b4bfb986863041c6041c62ccda2dc8 | e0588e8d41f54c315914fefe384abb7d36a2fc2d | /finalchat/src/test/java/edu/rice/comp504/model/obj/ChatRoomTest.java | 373d734a8fd0698fa9b85b8c465aa7ef8f878177 | [] | no_license | xun6000/504OOD | e8462ad3a6f8bb53dd5851021c85e67f8c5b8aa1 | cf1ffc92585c6df44d467b8c93e7cc3ba8cdaf25 | refs/heads/master | 2020-04-13T13:23:54.011659 | 2018-12-27T00:41:16 | 2018-12-27T00:41:16 | 163,228,852 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,504 | java | package edu.rice.comp504.model.obj;
import edu.rice.comp504.model.DispatcherAdapter;
import junit.framework.TestCase;
import java.util.ArrayList;
public class ChatRoomTest extends TestCase {
public ChatRoom createChatRoom(){
String[] school = {};
String[] location = {};
return new ChatRoom(0, "name", null, 0, 18, location, school, new DispatcherAdapter());
}
public void testGetId() {
ChatRoom c = createChatRoom();
assertEquals(0, c.getId());
}
public void testGetName() {
ChatRoom c = createChatRoom();
assertEquals("name", c.getName());
}
public void testGetOwner() {
ChatRoom c = createChatRoom();
assertEquals(null, c.getOwner());
}
public void testGetNotifications() {
ChatRoom c = createChatRoom();
assertEquals(0, c.getNotifications().size());
}
public void testGetChatHistory() {
ChatRoom c = createChatRoom();
assertEquals(0, c.getChatHistory().size());
}
public void testApplyFilter() {
ChatRoom c = createChatRoom();
ChatRoom[] a = {};
User user = new User(0, null, "name", 18, "location", "school", a);
assertEquals(true, c.applyFilter(user));
}
public void testRemoveUser() {
ChatRoom c = createChatRoom();
ChatRoom[] a = {};
User user = new User(0, null, "name", 18, "location", "school", a);
assertEquals(true, c.removeUser(user, ""));
}
} | [
"[email protected]"
] | |
b58382529a640ccdc5224fad523f4b4e8ba38ac2 | 927a79e515892662d4a42572184b7b67cc830bd2 | /web/src/main/java/com/school/utils/StrFormatter.java | 32156b71a3a4becd2467d3e205df8531c940ab70 | [] | no_license | adlin2019/schoolserver | 072405f7352e99fc7b76c665969cea5ac50e0e3d | 8a0c14019e4ffd8160409d26d217a0b10225d4c3 | refs/heads/master | 2023-08-04T05:23:24.362565 | 2021-09-10T08:09:17 | 2021-09-10T08:09:17 | 401,086,913 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,476 | java | package com.school.utils;
import com.school.utils.StringUtils;
/**
* 字符串格式化
*
* @author ruoyi
*/
public class StrFormatter {
public static final String EMPTY_JSON = "{}";
public static final char C_BACKSLASH = '\\';
public static final char C_DELIM_START = '{';
public static final char C_DELIM_END = '}';
/**
* 格式化字符串<br>
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
* 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
* 例:<br>
* 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
*
* @param strPattern 字符串模板
* @param argArray 参数列表
* @return 结果
*/
public static String format(final String strPattern, final Object... argArray)
{
if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray))
{
return strPattern;
}
final int strPatternLength = strPattern.length();
// 初始化定义好的长度以获得更好的性能
StringBuilder sbuf = new StringBuilder(strPatternLength + 50);
int handledPosition = 0;
int delimIndex;// 占位符所在位置
for (int argIndex = 0; argIndex < argArray.length; argIndex++)
{
delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
if (delimIndex == -1)
{
if (handledPosition == 0)
{
return strPattern;
}
else
{ // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
sbuf.append(strPattern, handledPosition, strPatternLength);
return sbuf.toString();
}
}
else
{
if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH)
{
if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH)
{
// 转义符之前还有一个转义符,占位符依旧有效
sbuf.append(strPattern, handledPosition, delimIndex - 1);
sbuf.append(Convert.utf8Str(argArray[argIndex]));
handledPosition = delimIndex + 2;
}
else
{
// 占位符被转义
argIndex--;
sbuf.append(strPattern, handledPosition, delimIndex - 1);
sbuf.append(C_DELIM_START);
handledPosition = delimIndex + 1;
}
}
else
{
// 正常占位符
sbuf.append(strPattern, handledPosition, delimIndex);
sbuf.append(Convert.utf8Str(argArray[argIndex]));
handledPosition = delimIndex + 2;
}
}
}
// 加入最后一个占位符后所有的字符
sbuf.append(strPattern, handledPosition, strPattern.length());
return sbuf.toString();
}
}
| [
"[email protected]"
] | |
c698a460d193c72a78c0e99db4c140c0c00a4667 | a29b7ab365b3c9d65e679c638f0e0ef3fd654e05 | /02_Operator/src/com/kh/operator/D_Comparison.java | a5ccea023a80117d10b1e811ca556b63ffc55ad0 | [] | no_license | b-bok/BackUp | 6ee7af38e9590a1220a0221906c125daab635b7c | 1d78088b6ce2028f9a2a086bfe5ae15cd1f1d142 | refs/heads/master | 2022-11-19T10:01:17.989825 | 2020-07-16T12:36:24 | 2020-07-16T12:36:24 | 280,147,659 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,410 | java | package com.kh.operator;
public class D_Comparison {
/*
* * 비교 연산자(관계 연산자, 이항 연산자)
* - 두 값을 비교하는 연산자
* - 비교 한 값이 참이면 true, 거짓이면 false
* 즉, 비교연산을 수행한 결과값은 논리값
*
* a < b : a가 b보다 작냐?
* a > b : a가 b보다 크냐?
* a <= b : a가 b보다 작거나 같냐?
* a >= b : a가 b보다 크거나 같냐? (기호 순서대로 읽기)
*
* a == b : a와 b가 같냐?
* a != b : a와 b가 다르냐? == !(a==b)
*
*
*/
public void method1() {
int a = 10;
int b = 25;
System.out.println("a == b : " + (a == b));
System.out.println("a <= b : " + (a <= b));
System.out.println("a > b : " + (a > b));
System.out.println("a != b : " + (a != b));
System.out.println("a == b : " + (a == b));
boolean result = (a >= b);
System.out.println("result : " + result);
// 산술연산 + 비교연산
// a가 짝수 입니까?
System.out.println("a가 짝수 입니까? : " + (a % 2 == 0));
System.out.println("b는 짝수 인가? : " + (b % 2 == 0));
System.out.println("a가 홀수인가? : " + (a % 2 == 1));
System.out.println("b가 홀수인가? : " + (b % 2 == 1));
System.out.println(a + b > 30);
// 값 % 2 == 0 -> 짝수
// 값 % 2 == 1 -> 홀수
}
}
| [
"[email protected]"
] | |
f7111409a85feec49f4a8a954ee7b4a5f22c2b4f | af0ca82c213abfef2ab242f5efdbade572e7fd5f | /WebTvRebuild_KenLi/app/src/main/java/com/sobey/cloud/webtv/obj/ViewHolderBrokeTask.java | 6e23ae153135ed02c96a91b4649221aa998e27b4 | [] | no_license | i2863CookieZJ/KenLi | e7f7d1033c7e66ae01eee7f1c59c736a241a50bb | 38e7fc3c33eb5b27d63626e6640843072810611e | refs/heads/master | 2020-07-02T07:52:35.508729 | 2016-11-21T03:02:48 | 2016-11-21T03:02:48 | 74,317,209 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,046 | java | package com.sobey.cloud.webtv.obj;
import com.appsdk.advancedimageview.AdvancedImageView;
import com.dylan.uiparts.circularseekbar.CircularSeekBar;
import android.widget.Button;
import android.widget.HorizontalScrollView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class ViewHolderBrokeTask {
private TextView title;
private AdvancedImageView image;
private TextView time;
private ImageView videocountImage;
private TextView videocount;
private ImageView picturecountImage;
private TextView picturecount;
private RelativeLayout waitingLayout;
private RelativeLayout uploadingLayout;
private CircularSeekBar uploadingCircularSeekbar;
private Button actionBtn;
private LinearLayout contentLayout;
private HorizontalScrollView horizontalScrollView;
public TextView getTitle() {
return title;
}
public void setTitle(TextView title) {
this.title = title;
}
public AdvancedImageView getImage() {
return image;
}
public void setImage(AdvancedImageView image) {
this.image = image;
}
public TextView getTime() {
return time;
}
public void setTime(TextView time) {
this.time = time;
}
public ImageView getVideocountImage() {
return videocountImage;
}
public void setVideocountImage(ImageView videocountImage) {
this.videocountImage = videocountImage;
}
public TextView getVideocount() {
return videocount;
}
public void setVideocount(TextView videocount) {
this.videocount = videocount;
}
public ImageView getPicturecountImage() {
return picturecountImage;
}
public void setPicturecountImage(ImageView picturecountImage) {
this.picturecountImage = picturecountImage;
}
public TextView getPicturecount() {
return picturecount;
}
public void setPicturecount(TextView picturecount) {
this.picturecount = picturecount;
}
public RelativeLayout getWaitingLayout() {
return waitingLayout;
}
public void setWaitingLayout(RelativeLayout waitingLayout) {
this.waitingLayout = waitingLayout;
}
public RelativeLayout getUploadingLayout() {
return uploadingLayout;
}
public void setUploadingLayout(RelativeLayout uploadingLayout) {
this.uploadingLayout = uploadingLayout;
}
public CircularSeekBar getUploadingCircularSeekbar() {
return uploadingCircularSeekbar;
}
public void setUploadingCircularSeekbar(CircularSeekBar uploadingCircularSeekbar) {
this.uploadingCircularSeekbar = uploadingCircularSeekbar;
}
public Button getActionBtn() {
return actionBtn;
}
public void setActionBtn(Button actionBtn) {
this.actionBtn = actionBtn;
}
public HorizontalScrollView getHorizontalScrollView() {
return horizontalScrollView;
}
public void setHorizontalScrollView(HorizontalScrollView horizontalScrollView) {
this.horizontalScrollView = horizontalScrollView;
}
public LinearLayout getContentLayout() {
return contentLayout;
}
public void setContentLayout(LinearLayout contentLayout) {
this.contentLayout = contentLayout;
}
}
| [
"[email protected]"
] | |
f2b9ef816e545f89ff28ecc4229f343363e2a7e7 | e971b5c618b214bc3a2a780064929b73d8981659 | /src/test/Launch.java | 0cfbe96c1ace576529e65d5d527cff10d459761c | [] | no_license | bloodarea/CutImages | 9fd7c77e2b598971d2d4b9ab882ad8d6359ccd72 | 76a9090dc5887d4485f66426ffb6be177692b0aa | refs/heads/master | 2022-08-06T23:22:39.907704 | 2020-05-24T03:51:03 | 2020-05-24T03:51:03 | 266,458,070 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 156 | java | package test;
import com.cutimages.MainWindow;
public class Launch {
public static void main(String[] args) {
MainWindow.main(args);
}
}
| [
"[email protected]"
] | |
08b837b2555ec308bf58e487db7f869b66a8167f | 94951222a643ed295579c535939d55670deb60ba | /team05_client/app/src/main/java/com/example/caroline/videorecording/SegmentVideos.java | 40f9dde6583ae50ce6d4bc020d393b4691f02858 | [] | no_license | liulanyi/team05_A0163111Y_A0174362E_A0174434E | 04e18eb60acef159fd2b37132b43d8de8626b331 | 047bfea8d16650c25156ff3945a91eae376a33c3 | refs/heads/master | 2021-05-07T01:55:10.827328 | 2017-11-15T11:48:30 | 2017-11-15T11:49:50 | 110,452,580 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,433 | java | package com.example.caroline.videorecording;
import android.util.Log;
import com.coremedia.iso.IsoFile;
import com.coremedia.iso.boxes.Container;
import com.googlecode.mp4parser.authoring.Movie;
import com.googlecode.mp4parser.authoring.Track;
import com.googlecode.mp4parser.authoring.builder.DefaultMp4Builder;
import com.googlecode.mp4parser.authoring.container.mp4.MovieCreator;
import com.googlecode.mp4parser.authoring.tracks.CroppedTrack;
import java.io.FileOutputStream;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
/**
* Created by caroline on 20/10/2017.
*/
public class SegmentVideos {
private double duration ;
private int numberOfSmallVideos;
public void segmentVideo(){
double startTime = 0 ;
double splitDuration = 3.0 ;
try {
// duration in seconds
duration = getDuration(Variables.getFilePath());
numberOfSmallVideos = (int) (duration / 3);
// Arraylist that will contains all the segments filepaths
ArrayList<String> listNameOf3sVideos = new ArrayList<String>();
// segmentation of the video
for (int num = 0; num < numberOfSmallVideos; num++) {
if (startTime == 0){
cutVideo3sec(startTime, startTime+splitDuration, num, listNameOf3sVideos);
startTime += splitDuration;
}
else {
cutVideo3sec(startTime+1, startTime+splitDuration, num, listNameOf3sVideos);
startTime += splitDuration;
}
}
// last part of the video, which duration is less than 3 sec
cutVideo3sec(startTime+1, duration, numberOfSmallVideos, listNameOf3sVideos);
Variables.setListFilePath(listNameOf3sVideos);
}catch (Exception e){
e.printStackTrace();
}
}
// getDuration method that returns the duration of the video in second
protected static double getDuration(String filename) {
try{
IsoFile isoFile = new IsoFile(filename);
double lengthInSeconds = (double)
isoFile.getMovieBox().getMovieHeaderBox().getDuration() / isoFile.getMovieBox().getMovieHeaderBox().getTimescale();
System.err.println(lengthInSeconds);
return lengthInSeconds;
}catch (Exception e){
e.printStackTrace();
return 0;
}
}
private static double correctTimeToSyncSample(Track track, double cutHere, boolean next) {
double[] timeOfSyncSamples = new double[track.getSyncSamples().length];
long currentSample = 0;
double currentTime = 0;
for (int i = 0; i < track.getSampleDurations().length; i++) {
long delta = track.getSampleDurations()[i];
if (Arrays.binarySearch(track.getSyncSamples(), currentSample + 1) >= 0) {
// samples always start with 1 but we start with zero therefore +1
timeOfSyncSamples[Arrays.binarySearch(track.getSyncSamples(), currentSample + 1)] = currentTime;
}
currentTime += (double) delta / (double) track.getTrackMetaData().getTimescale();
currentSample++;
}
double previous = 0;
for (double timeOfSyncSample : timeOfSyncSamples) {
if (timeOfSyncSample >= cutHere) {
if (next) {
return timeOfSyncSample;
} else {
return previous;
}
}
previous = timeOfSyncSample;
}
return timeOfSyncSamples[timeOfSyncSamples.length - 1];
}
private void cutVideo3sec (double startTime, double endTime, int i, ArrayList<String> listNameOf3sVideos){
try{
Movie movie = MovieCreator.build(Variables.getFilePath());
List<Track> tracks = movie.getTracks();
//System.out.println("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
//System.out.println(tracks);
movie.setTracks(new LinkedList<Track>());
//Movie movie1 = new Movie();
System.out.println("IIIIIIIIIII");
System.out.println(i);
boolean timeCorrected = false;
// Here we try to find a track that has sync samples. Since we can only start decoding
// at such a sample we SHOULD make sure that the start of the new fragment is exactly
// such a frame
for (Track track : tracks) {
if (track.getSyncSamples() != null && track.getSyncSamples().length > 0) {
if (timeCorrected) {
// This exception here could be a false positive in case we have multiple tracks
// with sync samples at exactly the same positions. E.g. a single movie containing
// multiple qualities of the same video (Microsoft Smooth Streaming file)
throw new RuntimeException("The startTime has already been corrected by another track with SyncSample. Not Supported.");
}
startTime = correctTimeToSyncSample(track, startTime, false);
endTime = correctTimeToSyncSample(track, endTime, true);
timeCorrected = true;
}
}
for (Track track : tracks) {
long currentSample = 0;
double currentTime = 0 ;
long startSample = 0;
long endSample = 0;
for (int j = 0; j < track.getSampleDurations().length; j++) {
long delta = track.getSampleDurations()[j];
if (currentTime <= startTime) {
// current sample is still before the new starttime
startSample = currentSample;
}
if (currentTime <= endTime) {
// current sample is after the new start time and still before the new endtime
endSample = currentSample;
} else {
// current sample is after the end of the cropped video
break;
}
currentTime += (double) delta / (double) track.getTrackMetaData().getTimescale();
currentSample++;
}
Log.i("DASH", "Start time = " + startTime + ", End time = " + endTime);
movie.addTrack(new CroppedTrack(track, startSample, endSample));
//movie.addTrack(new CroppedTrack(track, (long) startTime, (long) endTime));
}
Container out = new DefaultMp4Builder().build(movie);
String filename = Variables.getFilePathWithoutExt()+"_"+ String.valueOf(i+1)+".mp4";
FileOutputStream fos = new FileOutputStream(filename);
System.out.println("FFFFFFFFFFFFFFFF");
System.out.println(filename);
listNameOf3sVideos.add(filename);
FileChannel fc = fos.getChannel();
out.writeContainer(fc);
fc.close();
fos.close();
}catch (Exception e){
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
a8caa70e6dc6a3130e7cfcd4d225611f5d495f23 | 02394ab69e896af32b6cbcfd6a7bd18dd170bb00 | /src/HighLowGame.java | 5a19123de4b1ee95a0719ee49d681dd29146d214 | [] | no_license | NancyGuerrero04/Level-0 | b85c117d712ef90c0e69c60452aa7b9ab11ec03a | e62d9bea18c433f422e9a0e845b7fcff2aa51032 | refs/heads/master | 2021-01-17T11:15:03.495987 | 2016-05-12T02:00:59 | 2016-05-12T02:00:59 | 42,623,974 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,335 | java | import java.util.Random;
import javax.swing.JOptionPane;
// Copyright Wintriss Technical Schools 2013
public class HighLowGame {
public static void main(String[] args) {
// 3. Change this line to give you a random number between 1 - 100.
int random = new Random().nextInt(101);
boolean winner = false;
// 2. Print out the random variable above
System.out.println(random);
// 11. do the following 10 times
for (int i = 0; i < 11; i++) {
// 1. ask the user for a guess using a pop-up window, and save their response
String guess = JOptionPane.showInputDialog("Pick a number!");
// 4. convert the users’ answer to an int (Integer.parseInt(string))
int nummy = Integer.parseInt(guess);
// 5. if the guess is correct
if (nummy==random){
JOptionPane.showMessageDialog(null, "Correct! You are a WINNER!");
winner = true;
break;
}
// 6. win
// 7. if the guess is high
if (nummy>random){
JOptionPane.showMessageDialog(null, "Too high.");
}
// 8. tell them it's too high
// 9. if the guess is low
else if (nummy<random){
JOptionPane.showMessageDialog(null, "Too low.");
}
// 10. tell them it's too low
// 12. tell them they lose
}
if (winner== false){
JOptionPane.showMessageDialog(null, "You lose, sorry :c");
}
}
}
| [
"[email protected]"
] | |
286d47cf2886124fd72941fa78cb1d2cc786fde6 | cd557ccb3bb0e516e51f337479fc35f5f05d1a84 | /app/src/main/java/com/example/smartagriculture/Model/Important/ImportantPageStatus.java | f757f569fb352fb4e2b5ec27a929319f24597c4f | [] | no_license | xsj321/SmartNeighborhood | 2de33f77a4e509bd286e7026f808660e48b1d642 | d6be6f2a39f4a79291050b20e9f4c980318bb587 | refs/heads/master | 2023-04-21T07:28:11.146072 | 2020-06-08T17:16:37 | 2020-06-08T17:16:37 | 259,416,023 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 877 | java | package com.example.smartagriculture.Model.Important;
import com.example.smartagriculture.Model.Cover.CoverDataListItem;
import java.util.ArrayList;
/**
* 用来传递ImportantPage页面的消息
*/
public class ImportantPageStatus {
private Boolean isWaring;
private ArrayList<ImportantDataListItem> dataList;
private ArrayList<CoverDataListItem> waringList;
public ImportantPageStatus(Boolean isWaring, ArrayList<ImportantDataListItem> dataList, ArrayList<CoverDataListItem> waringList) {
this.isWaring = isWaring;
this.dataList = dataList;
this.waringList = waringList;
}
public Boolean getWaring() {
return isWaring;
}
public ArrayList<ImportantDataListItem> getDataList() {
return dataList;
}
public ArrayList<CoverDataListItem> getWaringList() {
return waringList;
}
}
| [
"[email protected]"
] | |
001b7882a394ab2e6a3dc0e8a6a964f1df062554 | 7bfcc5ef1a03f95108f4541ce8c69b90e62c72d7 | /src/main/java/com/cuimiao/demo/bean/Student.java | be0d78a6d7014f20f701a0523d45bf406672c8c6 | [] | no_license | bycuimiao/formzy | 4f878defbb7f325dcd39a859881776c7d8abfe59 | f31a6138cd4d65e71c15adcca25bd12708f822ac | refs/heads/master | 2020-03-16T06:48:43.401687 | 2018-05-08T06:18:29 | 2018-05-08T06:18:29 | 132,563,159 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 823 | java | /*
* Created by cuimiao on 2018/5/7.
*/
package com.cuimiao.demo.bean;
import javax.persistence.*;
/**
* @author cuimiao
* @version 0.0.1
* @Description:
* @since 0.0.1 2018-05-07
*/
@Entity
public class Student {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
private Long age;
private String telephone;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getAge() {
return age;
}
public void setAge(Long age) {
this.age = age;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
} | [
"[email protected]"
] | |
163f30b46a74e2557276780bf3f4afcd25112ab4 | dc37bfa92d000867b10d3c44cbbb8319123bd868 | /app/src/main/java/arvolear/zoomer/zoomer/global_gui/LoadingWheel.java | b778fdc10ca5a9333d9a4dcd4a54317e180901a2 | [] | no_license | Arvolear/Zoomer | 37f6969d6f90f04b78e71d8d0e58d401da27e4d1 | e7f444e8cc3a606f89ca1098cfb33567fc2c5f22 | refs/heads/master | 2023-01-28T19:34:15.600073 | 2020-12-04T17:29:23 | 2020-12-04T17:29:23 | 297,283,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,728 | java | package arvolear.zoomer.zoomer.global_gui;
import android.graphics.BlendMode;
import android.graphics.BlendModeColorFilter;
import android.graphics.PorterDuff;
import android.os.Build;
import android.view.Gravity;
import android.widget.FrameLayout;
import android.widget.ProgressBar;
import androidx.appcompat.app.AppCompatActivity;
import arvolear.zoomer.zoomer.R;
public class LoadingWheel extends FrameLayout
{
private AppCompatActivity activity;
private int color;
private FrameLayout loadLayout;
private ProgressBar progressBar;
public LoadingWheel(AppCompatActivity activity, int color)
{
super(activity);
this.activity = activity;
this.loadLayout = activity.findViewById(R.id.loadLayout);
this.color = color;
init();
}
@SuppressWarnings("deprecation")
private void init()
{
FrameLayout.LayoutParams LP0 = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
LP0.gravity = Gravity.END;
progressBar = new ProgressBar(activity);
progressBar.setLayoutParams(LP0);
progressBar.setPadding(0, 0, 0, 20);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
{
progressBar.getIndeterminateDrawable().setColorFilter(new BlendModeColorFilter(color, BlendMode.MODULATE));
}
else
{
progressBar.getIndeterminateDrawable().setColorFilter(color, PorterDuff.Mode.MULTIPLY);
}
progressBar.setIndeterminate(true);
addView(progressBar);
}
public void show()
{
loadLayout.addView(this);
}
public void hide()
{
loadLayout.removeView(this);
}
}
| [
"[email protected]"
] | |
f9083e14aa1c2d35f7d6c59ada8a77ff301589bb | 553d92fd7b2af0398102400b123c1354336a0221 | /src/main/java/com/appdynamics/universalagent/adapter/RuntimeTypeAdapterFactory.java | 144b77800c310745d239ff00495ef9b196da8723 | [
"Apache-2.0"
] | permissive | Appdynamics/UniversalAgentGUIManager | aa81ff7e5d28bc50b7414e4d5a748d1ce50d4260 | 4033ad262a3cf70ea5c70b060fd6dd09e0be10cb | refs/heads/master | 2021-05-03T11:48:40.849019 | 2018-06-26T15:58:15 | 2018-06-26T15:58:15 | 120,486,384 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,845 | java | /*******************************************************************************
* Copyright 2018 AppDynamics LLC
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
******************************************************************************/
package com.appdynamics.universalagent.adapter;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapter;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.internal.Streams;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
public final class RuntimeTypeAdapterFactory<T> implements TypeAdapterFactory {
private final Class<?> baseType;
private final RuntimeTypeAdapterPredicate predicate;
private final Map<String, Class<?>> labelToSubtype = new LinkedHashMap<String, Class<?>>();
private final Map<Class<?>, String> subtypeToLabel = new LinkedHashMap<Class<?>, String>();
private RuntimeTypeAdapterFactory(Class<?> baseType, RuntimeTypeAdapterPredicate predicate) {
if (predicate == null || baseType == null) {
throw new NullPointerException();
}
this.baseType = baseType;
this.predicate = predicate;
}
/**
* Creates a new runtime type adapter using for {@code baseType} using {@code
* typeFieldName} as the type field name. Type field names are case sensitive.
*/
public static <T> RuntimeTypeAdapterFactory<T> of(Class<T> baseType, RuntimeTypeAdapterPredicate predicate) {
return new RuntimeTypeAdapterFactory<T>(baseType, predicate);
}
/**
* Creates a new runtime type adapter for {@code baseType} using {@code "type"}
* as the type field name.
*/
public static <T> RuntimeTypeAdapterFactory<T> of(Class<T> baseType) {
return new RuntimeTypeAdapterFactory<T>(baseType, null);
}
/**
* Registers {@code type} identified by {@code label}. Labels are case
* sensitive.
*
* @throws IllegalArgumentException
* if either {@code type} or {@code label} have already been
* registered on this type adapter.
*/
public RuntimeTypeAdapterFactory<T> registerSubtype(Class<? extends T> type, String label) {
if (type == null || label == null) {
throw new NullPointerException();
}
if (subtypeToLabel.containsKey(type) || labelToSubtype.containsKey(label)) {
throw new IllegalArgumentException("types and labels must be unique");
}
labelToSubtype.put(label, type);
subtypeToLabel.put(type, label);
return this;
}
/**
* Registers {@code type} identified by its {@link Class#getSimpleName simple
* name}. Labels are case sensitive.
*
* @throws IllegalArgumentException
* if either {@code type} or its simple name have already been
* registered on this type adapter.
*/
public RuntimeTypeAdapterFactory<T> registerSubtype(Class<? extends T> type) {
return registerSubtype(type, type.getSimpleName());
}
public <R> TypeAdapter<R> create(Gson gson, TypeToken<R> type) {
if (type.getRawType() != baseType) {
return null;
}
final Map<String, TypeAdapter<?>> labelToDelegate = new LinkedHashMap<String, TypeAdapter<?>>();
final Map<Class<?>, TypeAdapter<?>> subtypeToDelegate = new LinkedHashMap<Class<?>, TypeAdapter<?>>();
for (Map.Entry<String, Class<?>> entry : labelToSubtype.entrySet()) {
TypeAdapter<?> delegate = gson.getDelegateAdapter(this, TypeToken.get(entry.getValue()));
labelToDelegate.put(entry.getKey(), delegate);
subtypeToDelegate.put(entry.getValue(), delegate);
}
return new TypeAdapter<R>() {
@Override
public R read(JsonReader in) throws IOException {
JsonElement jsonElement = Streams.parse(in);
String label = predicate.process(jsonElement);
@SuppressWarnings("unchecked") // registration requires that subtype extends T
TypeAdapter<R> delegate = (TypeAdapter<R>) labelToDelegate.get(label);
if (delegate == null) {
throw new JsonParseException("cannot deserialize " + baseType + " subtype named " + label
+ "; did you forget to register a subtype?");
}
return delegate.fromJsonTree(jsonElement);
}
@Override
public void write(JsonWriter out, R value) throws IOException { // Unimplemented as we don't use write.
/*
* Class<?> srcType = value.getClass(); String label =
* subtypeToLabel.get(srcType);
*
* @SuppressWarnings("unchecked") // registration requires that subtype extends
* T TypeAdapter<R> delegate = (TypeAdapter<R>) subtypeToDelegate.get(srcType);
* if (delegate == null) { throw new JsonParseException("cannot serialize " +
* srcType.getName() + "; did you forget to register a subtype?"); } JsonObject
* jsonObject = delegate.toJsonTree(value).getAsJsonObject(); if
* (jsonObject.has(typeFieldName)) { throw new
* JsonParseException("cannot serialize " + srcType.getName() +
* " because it already defines a field named " + typeFieldName); } JsonObject
* clone = new JsonObject(); clone.add(typeFieldName, new JsonPrimitive(label));
* for (Map.Entry<String, JsonElement> e : jsonObject.entrySet()) {
* clone.add(e.getKey(), e.getValue()); }
*/
Streams.write(null, out);
}
};
}
}
| [
"[email protected]"
] | |
c5ba17896e4014a0343450b9d3746ff30791d3cf | 3b8fcc9fb93606aa460a3815a6131888b915b0b7 | /src/parser/AstNode.java | 755b9b5d8356b53e4bf7b656294fe217edc6a3bd | [
"MIT"
] | permissive | mklinik/compiler-construction-werkcollege-java | 9b22890c7ad3ff6b90ee3ef423f2c7bc8b296ce2 | 0cf331b636b8d223bcc0b3a7fb12d0117928b01f | refs/heads/master | 2021-04-29T16:30:26.525075 | 2018-03-26T15:08:31 | 2018-03-26T15:08:31 | 121,651,466 | 0 | 1 | MIT | 2018-03-11T15:15:31 | 2018-02-15T16:20:10 | Java | UTF-8 | Java | false | false | 269 | java | package parser;
import typechecker.Type;
import util.Visitor;
public abstract class AstNode {
private Type type = null;
public Type getType() {
return type;
}
public void setType(Type type) {
this.type = type;
}
public abstract void accept(Visitor v);
}
| [
"[email protected]"
] | |
c6d2f1a97bf9a2952e7ee4f2de5911bc3f0a2843 | c5455a16e6ffb0cfab03f46ea2cc69820c796bf4 | /src/org/OutlierCorrector/JMeterLogCorrector/MemoryBufferingOutputtingHandler.java | 69a8fad1a90613966a70074dcd1ffac7a9b86314 | [] | no_license | OutlierCorrector/OutlierCorrector | 6e79a73ec195d7cefa412eccf07c7fd7d6ad3ac0 | e0edf198f68820610a6becef65069b11d42f06aa | refs/heads/master | 2016-09-06T14:37:24.788334 | 2013-08-11T23:02:17 | 2013-08-11T23:02:17 | 12,043,885 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 652 | java | package org.OutlierCorrector.JMeterLogCorrector;
import java.io.IOException;
import java.util.*;
import org.OutlierCorrector.Request;
import org.OutlierCorrector.RequestHandler;
public class MemoryBufferingOutputtingHandler implements RequestHandler {
private final List<Request> log = (List<Request>) Collections.synchronizedCollection(new ArrayList<Request>());
public MemoryBufferingOutputtingHandler() throws IOException {
}
Request getRequestAtIndex(int index) {
return log.get(index);
}
public void handleRequest(final Request request) {
log.add(request);
}
@Override
public void flush() {
}
}
| [
"[email protected]"
] | |
c7d6cae9cd2f4e799ab4e31af8348955c462db5b | 926fefb45918a4cb6aef0688084b45d8eac19700 | /javastone/src/main/java/com/hxr/javatone/concurrency/netty/official/worldclock/WorldClockServerInitializer.java | 837968d28aac7363f76c1453d9e261482d6c5404 | [] | no_license | hanxirui/for_java | 1534d19828b4e30056deb4340d5ce0b9fd819f1a | 14df7f9cb635da16a0ee283bf016dc77ad3cecec | refs/heads/master | 2022-12-25T02:06:30.568892 | 2019-09-06T06:45:36 | 2019-09-06T06:45:36 | 14,199,294 | 1 | 0 | null | 2022-12-16T06:29:53 | 2013-11-07T09:17:09 | JavaScript | UTF-8 | Java | false | false | 1,689 | java | /*
* Copyright 2012 The Netty Project
*
* The Netty Project 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 com.hxr.javatone.concurrency.netty.official.worldclock;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.protobuf.ProtobufDecoder;
import io.netty.handler.codec.protobuf.ProtobufEncoder;
import io.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder;
import io.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender;
public class WorldClockServerInitializer extends ChannelInitializer<SocketChannel> {
@Override
public void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline p = ch.pipeline();
p.addLast("frameDecoder", new ProtobufVarint32FrameDecoder());
p.addLast("protobufDecoder", new ProtobufDecoder(WorldClockProtocol.Locations.getDefaultInstance()));
p.addLast("frameEncoder", new ProtobufVarint32LengthFieldPrepender());
p.addLast("protobufEncoder", new ProtobufEncoder());
p.addLast("handler", new WorldClockServerHandler());
}
}
| [
"[email protected]"
] | |
a6ceb15e37fbce5b9f916b8525a9b715470783c3 | 2cc353c63c5e005f2207b93fbba1909b12d64410 | /app/src/main/java/com/a6bytes/jack/adapter/NoteItemRecyclerViewAdapter.java | 6529f096107080757ba7ef51edca65304a94ce55 | [] | no_license | 106BYTES/jack-android | d551163b105f32bc7fae587ac624bb9290fa03b6 | b9f69df7b26d6276ec411e2bcacd0e674da0ba72 | refs/heads/master | 2021-01-19T15:23:07.522422 | 2017-08-27T15:27:37 | 2017-08-27T15:27:37 | 100,964,950 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,473 | java | package com.a6bytes.jack.adapter;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.a6bytes.jack.R;
import com.a6bytes.jack.ui.main.fragment.NoteItemFragment.OnListFragmentInteractionListener;
import java.util.List;
/**
* {@link RecyclerView.Adapter} that can display a {@link NoteListItem} and makes a call to the
* specified {@link OnListFragmentInteractionListener}.
* TODO: Replace the implementation with code for your data type.
*/
public class NoteItemRecyclerViewAdapter extends RecyclerView.Adapter<NoteItemRecyclerViewAdapter.ViewHolder> {
private final List<NoteListItem> mValues;
private final OnListFragmentInteractionListener mListener;
public NoteItemRecyclerViewAdapter(List<NoteListItem> items, OnListFragmentInteractionListener listener) {
mValues = items;
mListener = listener;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.fragment_noteitem, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
holder.mItem = mValues.get(position);
holder.mSummaryView.setText(mValues.get(position).summary);
holder.mContentView.setText(mValues.get(position).title);
holder.mThumbnail.setImageDrawable(holder.mItem.thumbnail);
holder.mView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (null != mListener) {
// Notify the active callbacks interface (the activity, if the
// fragment is attached to one) that an item has been selected.
mListener.onListFragmentInteraction(holder.mItem);
}
}
});
}
@Override
public int getItemCount() {
return mValues.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
public final View mView;
public final TextView mSummaryView;
public final TextView mContentView;
public NoteListItem mItem;
public final ImageView mThumbnail;
public ViewHolder(View view) {
super(view);
mView = view;
mSummaryView = (TextView) view.findViewById(R.id.summary);
mContentView = (TextView) view.findViewById(R.id.content);
mThumbnail = (ImageView) view.findViewById(R.id.imageView);
}
@Override
public String toString() {
return super.toString() + " '" + mContentView.getText() + "'";
}
}
public static class NoteListItem {
public int id;
public String title;
public String summary;
public int year, month, day;
public Drawable thumbnail;
public NoteListItem(int id, String title, String summary, int[] date, Drawable thumbnail) {
this.id = id;
this.title = title;
this.summary = summary;
this.year = date[0];
this.month = date[1];
this.day = date[2];
this.thumbnail = thumbnail;
}
}
}
| [
"[email protected]"
] | |
678402a5a0348d33a5057075be908fe3451adcef | d7b57ef0c06806e1f96ad1280cb63d993cc3ba4c | /src/Ex3ArrayZigZag.java | 737755fa465a629da0e9dd5d031bb52e9583808f | [] | no_license | Aethernite/Softuni-Technology-Fundamentals | 3875711b6b59d96dc6b1aefad9459aa185f8a5a1 | 3405945539b4af3fcbedc04917f35e40d8e9a538 | refs/heads/master | 2021-10-22T11:24:33.402583 | 2019-03-10T08:29:31 | 2019-03-10T08:29:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 740 | java | import java.util.Scanner;
public class Ex3ArrayZigZag {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = Integer.parseInt(scanner.nextLine());
int[] arr = new int[n];
int[] arr2 = new int[n];
for(int i=0; i<n; i++){
if(i%2==0) {
arr2[i] = scanner.nextInt();
arr[i] = scanner.nextInt();
} else{
arr[i] = scanner.nextInt();
arr2[i] = scanner.nextInt();
}
}
for(int i: arr2){
System.out.print(i + " ");
}
System.out.println();
for(int i: arr){
System.out.print(i + " ");
}
}
}
| [
"[email protected]"
] | |
300d2730a361990ad7152be219ead8ef31cfc85d | 7fb15446b5645b7761a8ac1eee7fce8ff2bfb493 | /app/src/main/java/com/dibs/dibly/daocontroller/FollowingController.java | 74d8f117ed5fb423425968d06a67562801a16cc6 | [] | no_license | loipn1804/Dibly | 4d7d3cbf3b895b27a3244cb52df9acaade776b20 | d94e40208b90cc602812a701c6c0a77855741721 | refs/heads/master | 2020-12-31T05:09:33.182036 | 2017-04-26T14:18:44 | 2017-04-26T14:18:44 | 59,657,238 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 901 | java | package com.dibs.dibly.daocontroller;
import android.content.Context;
import com.dibs.dibly.application.MyApplication;
import java.util.List;
import greendao.Following;
import greendao.FollowingDao;
/**
* Created by USER on 7/10/2015.
*/
public class FollowingController {
private static FollowingDao getFollowingDao(Context c) {
return ((MyApplication) c.getApplicationContext()).getDaoSession().getFollowingDao();
}
public static void insert(Context context, Following following) {
getFollowingDao(context).insert(following);
}
public static List<Following> getAll(Context ctx) {
return getFollowingDao(ctx).loadAll();
}
public static void deleteByID(Context ctx, long id) {
getFollowingDao(ctx).deleteByKey(id);
}
public static void deleteAll(Context context) {
getFollowingDao(context).deleteAll();
}
}
| [
"[email protected]"
] | |
8f586f254168d0eb3f831d3c6f5d7a87493e8690 | b09abc5c601569de9739959c27a88aef2813688e | /SeleniumWebmanager/src/test/java/deep/parameter/TestNG_parameterDemo.java | 3f36cc5b7fb44cde5cdc049cae73d2c8690f5874 | [] | no_license | dilipdire/SeleniumStep_by_Step | a5bd8f74dc823ea66d36cad5f36ccc882c2e52a1 | 5d0f5e43d5bb8460f72710521793d99bf75fcbe7 | refs/heads/master | 2023-08-23T13:08:37.537886 | 2021-10-13T02:35:34 | 2021-10-13T02:35:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 316 | java | package deep.parameter;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
public class TestNG_parameterDemo {
@Test
@Parameters({"Myname"})
public void test(@Optional String name)
{
System.out.println("name "+name);
}
}
| [
"Dilip [email protected]"
] | Dilip [email protected] |
d26b137e478426a264b36403de5fa1eabf136288 | 3b9816e0a3d7e3eb4b7d0427bd3519de004c9c10 | /src/main/java/com/maven/hello/App.java | 79d06abb26ebd6eb290fd91c0b48bacf584b91ae | [] | no_license | Balajihockey/hello | a9b3dfa2cb0ab0e0ca1cdcebe1d05dcc00e8e6eb | b1b7040416fd29c8f5d95d50878b598f6f3f9a6f | refs/heads/main | 2023-02-12T09:00:03.891488 | 2021-01-09T12:17:07 | 2021-01-09T12:17:07 | 328,147,038 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 178 | java | package com.maven.hello;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
| [
"[email protected]"
] | |
4cb3210e9f1993cb63c3c11bb5c7478b46742f9d | 6f8ecbc5505bf67c6e735e18704bddf2f3d3cab8 | /src/Aula22/Negocio/ProduzirBolaMorango.java | 1d470faa8fc421b3daa4ac9daee7f76730b7ad23 | [
"MIT"
] | permissive | ErikVergani/Java-POO | 570fef390a358c628526294b79a3cc3bfba40f18 | deec8ca646f60f2734ecda4dc235f07ef6e32354 | refs/heads/main | 2023-05-28T22:06:19.008472 | 2021-06-12T04:22:26 | 2021-06-12T04:22:26 | 362,958,721 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 864 | java | package Aula22.Negocio;
/**
* @author ErikVergani
* @date 07/05/2021
**/
public class ProduzirBolaMorango implements ProcessarItem {
MaquinaSorvete maquinaSorvete;
public ProduzirBolaMorango(MaquinaSorvete maquinaSorvete) {
this.maquinaSorvete = maquinaSorvete;
}
@Override
public void processarItem() {
if (maquinaSorvete.getMorango() >= 7 && maquinaSorvete.getEmulsificante() >= 15 && maquinaSorvete.getLeite() >= 35) {
maquinaSorvete.useMorango(7);
maquinaSorvete.useEmulsificante(15);
maquinaSorvete.useLeite(35);
maquinaSorvete.addNumBolasMorango(1);
System.out.println("1 bola de morango foi vendida!\n");
}else{
System.out.println("Não foi possivel vender a bola de morango pois algum ingrediente está faltando");
}
}
} | [
"[email protected]"
] | |
b9f99bb012bf40d9c246dfc7b05dac2605b1fbee | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/16/16_ad6e673d389e5a5b5912d1b5134861925c289e97/ThingListFragment/16_ad6e673d389e5a5b5912d1b5134861925c289e97_ThingListFragment_s.java | 62d6e36b58b95e064d968cac8586cea0aee20b98 | [] | 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 | 9,763 | java | /*
* Copyright (C) 2012 Brian Muramatsu
*
* 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.btmura.android.reddit.fragment;
import java.net.URL;
import java.util.List;
import android.app.ListFragment;
import android.app.LoaderManager.LoaderCallbacks;
import android.content.ContentValues;
import android.content.Intent;
import android.content.Loader;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.ListView;
import com.btmura.android.reddit.R;
import com.btmura.android.reddit.activity.SidebarActivity;
import com.btmura.android.reddit.content.ThingLoader;
import com.btmura.android.reddit.data.Flag;
import com.btmura.android.reddit.data.Urls;
import com.btmura.android.reddit.entity.Subreddit;
import com.btmura.android.reddit.entity.Thing;
import com.btmura.android.reddit.provider.Provider;
import com.btmura.android.reddit.provider.Provider.Subreddits;
import com.btmura.android.reddit.widget.ThingAdapter;
public class ThingListFragment extends ListFragment implements
LoaderCallbacks<List<Thing>>,
OnScrollListener {
public static final String TAG = "ThingListFragment";
public static final int FLAG_SINGLE_CHOICE = 0x1;
private static final String ARG_SUBREDDIT = "s";
private static final String ARG_FILTER = "f";
private static final String ARG_SEARCH_QUERY = "q";
private static final String ARG_FLAGS = "l";
private static final String STATE_THING_NAME = "n";
private static final String STATE_THING_POSITION = "p";
private static final String LOADER_ARG_MORE_KEY = "m";
public interface OnThingSelectedListener {
void onThingSelected(Thing thing, int position);
int getThingBodyWidth();
}
private Subreddit subreddit;
private String query;
private ThingAdapter adapter;
private boolean scrollLoading;
public static ThingListFragment newInstance(Subreddit sr, int filter, int flags) {
ThingListFragment f = new ThingListFragment();
Bundle args = new Bundle(4);
args.putParcelable(ARG_SUBREDDIT, sr);
args.putInt(ARG_FILTER, filter);
args.putInt(ARG_FLAGS, flags);
f.setArguments(args);
return f;
}
public static ThingListFragment newSearchInstance(String query, int flags) {
ThingListFragment f = new ThingListFragment();
Bundle args = new Bundle(2);
args.putString(ARG_SEARCH_QUERY, query);
args.putInt(ARG_FLAGS, flags);
f.setArguments(args);
return f;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
subreddit = getSubreddit();
query = getSearchQuery();
adapter = new ThingAdapter(getActivity(), Subreddit.getName(subreddit), isSingleChoice());
setHasOptionsMenu(true);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = super.onCreateView(inflater, container, savedInstanceState);
ListView list = (ListView) view.findViewById(android.R.id.list);
list.setOnScrollListener(this);
return view;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
String name;
int position;
if (savedInstanceState != null) {
name = savedInstanceState.getString(STATE_THING_NAME);
position = savedInstanceState.getInt(STATE_THING_POSITION);
} else {
name = null;
position = -1;
}
adapter.setSelectedThing(name, position);
adapter.setThingBodyWidth(getThingBodyWidth());
setListAdapter(adapter);
setListShown(false);
getLoaderManager().initLoader(0, null, this);
}
public Loader<List<Thing>> onCreateLoader(int id, Bundle args) {
String moreKey = args != null ? args.getString(LOADER_ARG_MORE_KEY) : null;
URL url;
if (subreddit != null) {
url = Urls.subredditUrl(subreddit, getFilter(), moreKey);
} else {
url = Urls.searchUrl(query, moreKey);
}
return new ThingLoader(getActivity().getApplicationContext(), Subreddit.getName(subreddit),
url, args != null ? adapter.getItems() : null);
}
public void onLoadFinished(Loader<List<Thing>> loader, List<Thing> things) {
scrollLoading = false;
adapter.swapData(things);
setEmptyText(getString(things != null ? R.string.empty : R.string.error));
setListShown(true);
}
public void onLoaderReset(Loader<List<Thing>> loader) {
adapter.swapData(null);
}
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
Thing t = adapter.getItem(position);
adapter.setSelectedThing(t.name, position);
adapter.notifyDataSetChanged();
switch (t.type) {
case Thing.TYPE_THING:
getListener().onThingSelected(adapter.getItem(position), position);
break;
}
}
public void onScrollStateChanged(AbsListView view, int scrollState) {
}
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,
int totalItemCount) {
if (visibleItemCount <= 0 || scrollLoading) {
return;
}
if (firstVisibleItem + visibleItemCount * 2 >= totalItemCount) {
Loader<List<Thing>> loader = getLoaderManager().getLoader(0);
if (loader != null) {
if (!adapter.isEmpty()) {
Thing t = adapter.getItem(adapter.getCount() - 1);
if (t.type == Thing.TYPE_MORE) {
scrollLoading = true;
Bundle b = new Bundle(1);
b.putString(LOADER_ARG_MORE_KEY, t.moreKey);
getLoaderManager().restartLoader(0, b, this);
}
}
}
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(STATE_THING_NAME, adapter.getSelectedThingName());
outState.putInt(STATE_THING_POSITION, adapter.getSelectedThingPosition());
}
public void setSelectedThing(Thing t, int position) {
String name = t != null ? t.name : null;
if (!adapter.isSelectedThing(name, position)) {
adapter.setSelectedThing(name, position);
adapter.notifyDataSetChanged();
}
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
inflater.inflate(R.menu.thing_list_menu, menu);
menu.findItem(R.id.menu_view_subreddit_sidebar).setVisible(
subreddit != null && !subreddit.isFrontPage());
}
@Override
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_add:
handleAdd();
return true;
case R.id.menu_view_subreddit_sidebar:
handleViewSidebar();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void handleAdd() {
ContentValues values = new ContentValues(1);
values.put(Subreddits.COLUMN_NAME, getSubreddit().name);
Provider.addInBackground(getActivity(), Subreddits.CONTENT_URI, values);
}
private void handleViewSidebar() {
Intent intent = new Intent(getActivity(), SidebarActivity.class);
intent.putExtra(SidebarActivity.EXTRA_SUBREDDIT, getSubreddit());
startActivity(intent);
}
private int getThingBodyWidth() {
return getListener().getThingBodyWidth();
}
private OnThingSelectedListener getListener() {
return (OnThingSelectedListener) getActivity();
}
private Subreddit getSubreddit() {
return getArguments().getParcelable(ARG_SUBREDDIT);
}
private int getFilter() {
return getArguments().getInt(ARG_FILTER);
}
private String getSearchQuery() {
return getArguments().getString(ARG_SEARCH_QUERY);
}
private int getFlags() {
return getArguments().getInt(ARG_FLAGS);
}
private boolean isSingleChoice() {
return Flag.isEnabled(getFlags(), FLAG_SINGLE_CHOICE);
}
}
| [
"[email protected]"
] | |
3d0a1a6a537a4ad58856b13804fea608e5b73fb6 | 934a8d7d5a7e3dc0700ef32ca21e90b5d75f0ae7 | /src/main/java/com/xiezhaoxin/test/EclEmmaTest.java | b1d747f3054cd433d7f1dbbcde8eca4fe5f01821 | [] | no_license | xiezhaoxin/exercise | 6925f347a7cc09ea4c898b4c9ec92e06b62ca02a | 713f1c3bbd8233e42e282b40fbba532cb429ef67 | refs/heads/master | 2021-01-17T14:57:27.375875 | 2016-03-07T02:29:10 | 2016-03-07T02:29:10 | 53,289,101 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 873 | java | package com.xiezhaoxin.test;
import org.junit.Test;
public class EclEmmaTest {
@Test
public void testA(){
TestA a = new TestA();
a.aaa();
}
// @Test
// public void myWordsTest(){
// System.out.println(new Date().getTime());
// int i = 0;
// int j = 0;
// int k = 0;
//
// i = i << 5;
// i += 8;
//
// j = j << 5;
// j += 31;
//
// k = k << 5;
// k += 16;
//
// System.out.println(i);
// System.out.println(Integer.toHexString(i));
// System.out.println(Integer.toBinaryString(i));
//
// System.out.println(j);
// System.out.println(Integer.toHexString(j));
// System.out.println(Integer.toBinaryString(j));
//
// System.out.println(k);
// System.out.println(Integer.toHexString(k));
// System.out.println(Integer.toBinaryString(k));
// System.out.println(new Date().getTime());
// }
}
| [
"[email protected]"
] | |
669a032be270aa880a2f799919861fe9f9f12ed6 | 1671d87c2e414de8186570983c65c220888f20b1 | /第一阶段/Spring2/src/com/atguigu/test/TestSpring.java | 5efe704c1f013f2477608d367398f29e8d7c8c07 | [] | no_license | qisirendexudoudou/BigData_0722 | 4f25b508b4c20088d4155abb2d52e1d39c8b0e81 | e474e6ebcbbfedd12f859f0198238f58b73e5bec | refs/heads/master | 2022-07-21T17:41:47.611707 | 2019-11-16T05:59:11 | 2019-11-16T05:59:11 | 221,875,869 | 0 | 0 | null | 2022-06-21T02:14:43 | 2019-11-15T08:10:07 | Java | UTF-8 | Java | false | false | 2,042 | java | package com.atguigu.test;
import static org.junit.Assert.*;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.atguigu.entity.User;
public class TestSpring {
/*
* 1. 容器中的对象 是什么时候创建的?
* 对象是随着容器的创建而创建!一个<bean>只会创建一个对象。默认是单例模式!
*
* 2. getBean(): 从容器中取出对象
* getBean(String id): 取出后,需要手动进行类型转换
* getBean(Class T): 取出后,无需进行类型转换
* 前提: 保证容器中只有唯一此类型的对象
*
* getBean(String id,Class T):
* 3. 常见错误:
* NoSuchBeanDefinitionException: No bean named 'user' is defined : 容器中没有指定id的对象
* NoUniqueBeanDefinitionException: No qualifying bean of type [com.atguigu.entity.User] is defined:
* expected single matching bean but found 2: user1,user2
* 使用类型从容器中取出对象时,发生了歧义(容器中有多个此类型)
*
* 4. 为对象赋值
* 常用:使用<property>标签赋值
* 赋值的类型:
* 字面量: 从字面上就知道数据是什么样的!
* 8种基本数据类型及其包装类+String
* 在<property>标签中,使用value属性或<value>赋值
* 自定义的引用数据类型:
* 在<property>标签中,使用ref属性或<ref>赋值
*
* null:<null>
*
*
*
*
*
*
*/
@Test
public void test() {
// 先获取指定的容器
ApplicationContext context=new ClassPathXmlApplicationContext("helloworld.xml");
// 从容器中获取想要的对象
User bean = (User) context.getBean("user1");
//User user = context.getBean(User.class);
User user = context.getBean("user1", User.class);
//System.out.println(user.getPassword()==null);
System.out.println(user);
}
}
| [
"[email protected]"
] | |
60ce901d85d546b9b4e32ab86aad5ff259e86fa4 | 3567d60bfc736ff40d57c02c79610c5b77032725 | /src/main/java/com/CS5500/springbootinfrastructure/view/DateLogQuery.java | 1e89b891f89a6bcfd706cc1566f6028895cbba90 | [
"MIT"
] | permissive | Ivor808/CS5500-Project | ad301ace56d0f983c64e1f5add082d91ad95dcba | 9b5c06428de10aa21c25f31a5eebff5d13397647 | refs/heads/main | 2023-07-10T23:28:00.761619 | 2021-08-20T00:32:06 | 2021-08-20T00:32:06 | 373,665,420 | 0 | 0 | null | 2021-08-11T18:38:50 | 2021-06-03T23:13:44 | Java | UTF-8 | Java | false | false | 363 | java | package com.CS5500.springbootinfrastructure.view;
import com.CS5500.springbootinfrastructure.parser.DataFormatterImpl;
import java.sql.Timestamp;
public class DateLogQuery {
public static void main(String[] args) {
Timestamp t = new DataFormatterImpl().convertTimestamp("20130209T185023-0800");
System.out.println(t.toString());
}
}
| [
"[email protected]"
] | |
ac1164f9c7bc563cae316e1c4ac1bcf8b134bbcd | 7d35c7f927de649dc15a9600fdfa15e7a177f4f6 | /src/test/java/com/bridgelabz/converter/unitconverter/UnitconverterApplicationTests.java | 8400fc93bb19632026c92c821f65f04b72c7efd9 | [] | no_license | AvatarMalekar/QUANTITY-MEASUREMENT-SPRING-API-2 | 74b5e61635dd2cd5829b216374e240255206422b | 9b1f4bcd05e634311467ea7b47fa8939dafd79e1 | refs/heads/master | 2022-04-23T14:01:53.830102 | 2020-04-18T07:59:16 | 2020-04-18T07:59:16 | 255,959,436 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 950 | java | package com.bridgelabz.converter.unitconverter;
import com.bridgelabz.converter.unitconverter.enumration.UnitConverterEnum;
import com.bridgelabz.converter.unitconverter.service.IUnitConverterService;
import org.assertj.core.api.Assert;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.Arrays;
import java.util.List;
@SpringBootTest
class UnitconverterApplicationTests {
@Autowired
IUnitConverterService iUnitConverterService;
@Test
void givenUnitTypeList_WhenCorrect_ShouldReturnTrue() {
List<UnitConverterEnum> checkList= Arrays.asList(UnitConverterEnum.values());
List<UnitConverterEnum> actualList=iUnitConverterService.getAllUnits();
Assertions.assertEquals(checkList,actualList);
}
@Test
void contextLoads() {
}
}
| [
"avatarmalekar4@gmailcom"
] | avatarmalekar4@gmailcom |
20668fc332db42b9ec90d57d97a65cc9f6a4ce36 | b479e6a04d5141936975c5c1aa8705b038c279d5 | /src/java/controlador/UbicacionServices.java | 48a3e7d8c46c1c150a546a4f1f1dfe486d7b054d | [] | no_license | alexv96/DE4504---Examen | 138cbe2b53ca15507857b64aa46b1bcaaea42a42 | 2588629d0a6d7b21d24abdc18a43b3a0ad9697de | refs/heads/master | 2021-03-30T13:38:22.522895 | 2020-03-19T01:40:01 | 2020-03-19T01:40:01 | 248,060,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 587 | 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 controlador;
import DAO.UbicacionDAO;
import modelo.Carretera;
import modelo.Ubicacion;
/**
*
* @author Alex
*/
public class UbicacionServices {
UbicacionDAO dao;
public UbicacionServices() {
this.dao = new UbicacionDAO();
}
public Carretera buscarUbicacionCarretera(int id){
return dao.getUbicacion(id);
}
}
| [
"[email protected]"
] | |
7fd75a6e721d0e2c3f9661ca17e34e0ccf303e42 | 5e65c0cfff12b0dec5ab1494b69f188bfc2afb2c | /Project DVD/Source Code/ProgressiveOverload/src/com/example/progressiveoverload/SelectWorkout/SelectWorkoutsDetailFragment.java | 4fe10fb7a5c72291fc7357d463c12d253b96a648 | [] | no_license | TwoToneEddy/uniBackup | c2650fbd9ae82ae44e345b53edf6995cd176453a | 96415bfaecfd8398f9bed74664a5cbe389c4be28 | refs/heads/master | 2022-11-22T14:31:07.244100 | 2020-07-27T19:12:46 | 2020-07-27T19:12:46 | 282,992,191 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 618 | java | package com.example.progressiveoverload.SelectWorkout;
import com.example.progressiveoverload.R;
import android.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class SelectWorkoutsDetailFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = (ViewGroup)inflater.inflate(R.layout.fragment_select_workouts_detail,
container, false);
return view;
}
}
| [
"[email protected]"
] | |
38e5eb640ae63771b650b3d8db72d63b83ed811a | 30533228f1ed42590dcd87c5ef424fef82aa18a3 | /movieapp/src/main/java/com/hoangmn/config/JwtRequestFilter.java | 204776e096c454f5ecd05735f538f2656e74efda | [] | no_license | thayhoang/react-movie | ced269fc7aa32f6938fb7bcb5b2cf63ad32d0581 | 9e6666e92950dcfbb0846fbfb19235299edf06e4 | refs/heads/master | 2023-02-10T02:11:37.297088 | 2020-05-12T17:14:58 | 2020-05-12T17:14:58 | 263,401,301 | 0 | 0 | null | 2021-01-06T02:29:36 | 2020-05-12T17:11:36 | Java | UTF-8 | Java | false | false | 2,482 | java | package com.hoangmn.config;
import com.hoangmn.service.UserDetailsServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Component
public class JwtRequestFilter extends OncePerRequestFilter {
private static final Logger logger = LoggerFactory.getLogger(JwtRequestFilter.class);
@Autowired
private JwtUtils jwtUtils;
@Autowired
private UserDetailsServiceImpl userDetailsService;
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
try {
String jwt = parseJwt(request);
if (jwt != null && jwtUtils.validateJwtToken(jwt)) {
String username = jwtUtils.getUserNameFromJwtToken(jwt);
UserDetails userDetails = userDetailsService.loadUserByUsername(username);
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
userDetails, null, userDetails.getAuthorities());
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
SecurityContextHolder.getContext().setAuthentication(authentication);
}
} catch (Exception e) {
logger.error("Cannot set user authentication: {}", e);
}
filterChain.doFilter(request, response);
}
private String parseJwt(HttpServletRequest request) {
String headerAuth = request.getHeader("Authorization");
if (StringUtils.hasText(headerAuth) && headerAuth.startsWith("Bearer ")) {
return headerAuth.substring(7, headerAuth.length());
}
return null;
}
}
| [
"[email protected]"
] | |
99502c158df0cbc7febb6d06b252e1ed5bc6ed47 | 5d2a0f937f4e028d28cb366a1a78f356f8574867 | /src/main/java/project/spring/data/dao/InterfaceSpringDataUser.java | 0d29e023e7d400d463e64eec613089a137f5d840 | [] | no_license | EderCamposRibeiro/project-spring-data | 36fe56b1b00aebe246569eb718f84595ddf54218 | b8098b56a99eb6fb921fee26ca988ba80167f0e5 | refs/heads/master | 2022-12-25T19:26:58.288039 | 2020-10-11T13:00:52 | 2020-10-11T13:00:52 | 302,047,204 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,443 | java | package project.spring.data.dao;
import java.util.List;
import javax.persistence.LockModeType;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import project.spring.data.model.UserSpringData;
@Repository
public interface InterfaceSpringDataUser extends CrudRepository<UserSpringData, Long> {
@Transactional(readOnly = true)
@Query(value = "select p from UserSpringData p where p.name like %?1%")
public List<UserSpringData> findByName (String name);
@Lock(LockModeType.READ)
@Transactional(readOnly = true)
@Query(value = "select p from UserSpringData p where p.name = :paramname")
public UserSpringData findByNameParam(@Param("paramname") String paramname);
default <S extends UserSpringData> S saveActual(S entity) {
// Do the process that you want!
return save(entity);
}
@Modifying
@Transactional
@Query("delete from UserSpringData p where p.name = ?1")
public void deleteByName(String name);
@Modifying
@Transactional
@Query("update UserSpringData p set p.email = ?1 where p.name = ?2")
public void updateEmailByName(String email, String name);
}
| [
"[email protected]"
] | |
4148cd1f37aea6bd82a1101928e0a17a551bc758 | cc5f525525070c785c2470ff2b30d9f5cd859cf8 | /src/app/command/CMDAddShape.java | 0c5dd8ff6251d0e5923bdf50893a58a3a7a48a17 | [] | no_license | sladjapopadic/PaintDO | d629cba1b1943689d1da1746decbfa18b0a2f692 | f2d1707a241c1d18f9d69b76b4dd8f7d3cc285d6 | refs/heads/master | 2020-09-06T21:25:37.665522 | 2019-11-08T23:41:17 | 2019-11-08T23:41:17 | 220,557,486 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 524 | java | package app.command;
import app.mvc.AppModel;
import geometry.Shape;
public class CMDAddShape implements Command{
private static final long serialVersionUID = 1L;
private AppModel model;
private Shape shape;
public CMDAddShape(AppModel model, Shape shape) {
this.model = model;
this.shape = shape;
}
@Override
public void execute() {
model.add(shape);
}
@Override
public void unexecute() {
model.remove(shape);
}
@Override
public String toString() {
return "add:" + shape.toString();
}
}
| [
"[email protected]"
] | |
f3a2c739675c3c1d0528488709d2b27a03d4a36a | 59909bbf3e8fb8a416cbd88b6faa94cdfe0884e1 | /app/src/main/java/com/robugos/tcc/dominio/ImageLoadTask.java | f521f634ead4aa87a1090241cdb10c0589dfcc34 | [] | no_license | robugos/tcc | e3de590cad1d8ff952b7f73d81a5c6c8b8f18699 | 3499a5bf4a56ec8a65dd446f0c500f20092be88f | refs/heads/master | 2020-03-23T06:32:37.912916 | 2018-07-25T11:21:56 | 2018-07-25T11:21:56 | 141,215,019 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,279 | java | package com.robugos.tcc.dominio;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.widget.ImageView;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* Created by Robson on 05/06/2017.
*/
public class ImageLoadTask extends AsyncTask<Void, Void, Bitmap> {
private String url;
private ImageView imageView;
public ImageLoadTask(String url, ImageView imageView) {
this.url = url;
this.imageView = imageView;
}
@Override
protected Bitmap doInBackground(Void... params) {
try {
URL urlConnection = new URL(url);
HttpURLConnection connection = (HttpURLConnection) urlConnection
.openConnection();
connection.setDoInput(true);
connection.connect();
InputStream input = connection.getInputStream();
Bitmap myBitmap = BitmapFactory.decodeStream(input);
return myBitmap;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Bitmap result) {
super.onPostExecute(result);
imageView.setImageBitmap(result);
}
} | [
"[email protected]"
] | |
f420db9132c6b3dbb71e9473f78fd67c6ddf026b | 87ef8bb6cd54cf24731c6ae19041db5c8f44a31f | /src/main/java/com/community/demo/dao/EducationMapper.java | b3247b84db0ad9e2df0db747e83fd210c39bc298 | [] | no_license | b15952025503/correction | 0c65e0593d5a00bae72229703833d0fbf342172b | 12e31f175f321c061b9f6c85612d32408b1a37fd | refs/heads/master | 2020-04-09T07:21:02.941833 | 2019-01-09T10:30:48 | 2019-01-09T10:30:48 | 160,151,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 941 | java | package com.community.demo.dao;
import com.community.demo.entity.Education;
import com.community.demo.entity.EducationExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface EducationMapper {
long countByExample(EducationExample example);
int deleteByExample(EducationExample example);
int deleteByPrimaryKey(Integer id);
int insert(Education record);
int insertSelective(Education record);
List<Education> selectByExample(EducationExample example);
Education selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") Education record, @Param("example") EducationExample example);
int updateByExample(@Param("record") Education record, @Param("example") EducationExample example);
int updateByPrimaryKeySelective(Education record);
int updateByPrimaryKey(Education record);
} | [
"[email protected]"
] | |
3e71f1a94b9b476c2b2f433a583454c59fcf3fbb | 6cb0fc33a5f43c910cf15522e5dead41433eb101 | /UlityCore/src/fr/mrmicky/fastparticle/ParticleType.java | b64531a7d5e8f2971ce39bc22fb4cfb4097a99a6 | [] | no_license | 360matt-archives/UlityCore-v0-alpha | 3e5408273ff2a01331100a4a22db43eab0c163f6 | f6738b5d8e744eb05263c5077ae81f446f0fd856 | refs/heads/master | 2022-04-10T07:41:59.672614 | 2020-02-20T21:04:57 | 2020-02-20T21:04:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,170 | java | package fr.mrmicky.fastparticle;
import org.bukkit.Color;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
/**
* @author MrMicky
*/
@SuppressWarnings("deprecation")
public enum ParticleType {
// 1.7+
EXPLOSION_NORMAL("explode", "poof"),
EXPLOSION_LARGE("largeexplode", "explosion"),
EXPLOSION_HUGE("hugeexplosion", "explosion_emitter"),
FIREWORKS_SPARK("fireworksSpark", "firework"),
WATER_BUBBLE("bubble", "bubble"),
WATER_SPLASH("splash", "splash"),
WATER_WAKE("wake", "fishing"),
SUSPENDED("suspended", "underwater"),
SUSPENDED_DEPTH("depthsuspend", "underwater"),
CRIT("crit", "crit"),
CRIT_MAGIC("magicCrit", "enchanted_hit"),
SMOKE_NORMAL("smoke", "smoke"),
SMOKE_LARGE("largesmoke", "large_smoke"),
SPELL("spell", "effect"),
SPELL_INSTANT("instantSpell", "instant_effect"),
SPELL_MOB("mobSpell", "entity_effect"),
SPELL_MOB_AMBIENT("mobSpellAmbient", "ambient_entity_effect"),
SPELL_WITCH("witchMagic", "witch"),
DRIP_WATER("dripWater", "dripping_water"),
DRIP_LAVA("dripLava", "dripping_lava"),
VILLAGER_ANGRY("angryVillager", "angry_villager"),
VILLAGER_HAPPY("happyVillager", "happy_villager"),
TOWN_AURA("townaura", "mycelium"),
NOTE("note", "note"),
PORTAL("portal", "portal"),
ENCHANTMENT_TABLE("enchantmenttable", "enchant"),
FLAME("flame", "flame"),
LAVA("lava", "lava"),
// FOOTSTEP("footstep", null),
CLOUD("cloud", "cloud"),
REDSTONE("reddust", "dust"),
SNOWBALL("snowballpoof", "item_snowball"),
SNOW_SHOVEL("snowshovel", "item_snowball"),
SLIME("slime", "item_slime"),
HEART("heart", "heart"),
ITEM_CRACK("iconcrack", "item"),
BLOCK_CRACK("blockcrack", "block"),
BLOCK_DUST("blockdust", "block"),
// 1.8+
BARRIER("barrier", "barrier", 8),
WATER_DROP("droplet", "rain", 8),
MOB_APPEARANCE("mobappearance", "elder_guardian", 8),
// ITEM_TAKE("take", null, 8),
// 1.9+
DRAGON_BREATH("dragonbreath", "dragon_breath", 9),
END_ROD("endRod", "end_rod", 9),
DAMAGE_INDICATOR("damageIndicator", "damage_indicator", 9),
SWEEP_ATTACK("sweepAttack", "sweep_attack", 9),
// 1.10+
FALLING_DUST("fallingdust", "falling_dust", 10),
// 1.11+
TOTEM("totem", "totem_of_undying", 11),
SPIT("spit", "spit", 11),
// 1.13+
SQUID_INK(13),
BUBBLE_POP(13),
CURRENT_DOWN(13),
BUBBLE_COLUMN_UP(13),
NAUTILUS(13),
DOLPHIN(13),
// 1.14+
SNEEZE(14),
CAMPFIRE_COSY_SMOKE(14),
CAMPFIRE_SIGNAL_SMOKE(14),
COMPOSTER(14),
FLASH(14),
FALLING_LAVA(14),
LANDING_LAVA(14),
FALLING_WATER(14),
// 1.15+
DRIPPING_HONEY(15),
FALLING_HONEY(15),
LANDING_HONEY(15),
FALLING_NECTAR(15);
private static final int SERVER_VERSION_ID;
static {
String ver = FastReflection.VERSION;
SERVER_VERSION_ID = ver.charAt(4) == '_' ? Character.getNumericValue(ver.charAt(3)) : Integer.parseInt(ver.substring(3, 5));
}
private final String legacyName;
private final String name;
private final int minimumVersion;
// 1.7 particles
ParticleType(String legacyName, String name) {
this(legacyName, name, -1);
}
// 1.13+ particles
ParticleType(int minimumVersion) {
this.legacyName = null;
this.name = name().toLowerCase();
this.minimumVersion = minimumVersion;
}
// 1.8-1.12 particles
ParticleType(String legacyName, String name, int minimumVersion) {
this.legacyName = legacyName;
this.name = name;
this.minimumVersion = minimumVersion;
}
public boolean hasLegacyName() {
return legacyName != null;
}
public String getLegacyName() {
if (!hasLegacyName()) {
throw new IllegalStateException("Particle " + name() + " don't have legacy name");
}
return legacyName;
}
public String getName() {
return name;
}
public boolean isSupported() {
return minimumVersion <= 0 || SERVER_VERSION_ID >= minimumVersion;
}
public Class<?> getDataType() {
switch (this) {
case ITEM_CRACK:
return ItemStack.class;
case BLOCK_CRACK:
case BLOCK_DUST:
case FALLING_DUST:
//noinspection deprecation
return MaterialData.class;
case REDSTONE:
return Color.class;
default:
return Void.class;
}
}
public static ParticleType getParticle(String particleName) {
try {
return ParticleType.valueOf(particleName.toUpperCase());
} catch (IllegalArgumentException e) {
for (ParticleType particle : values()) {
if (particle.getName().equalsIgnoreCase(particleName)) {
return particle;
}
if (particle.hasLegacyName() && particle.getLegacyName().equalsIgnoreCase(particleName)) {
return particle;
}
}
}
return null;
}
}
| [
"[email protected]"
] | |
a52417c52d6d3d826902fb19161540feebdafe2a | a77083d81255eecf1cc1096b25829800fe139ebd | /src/main/java/com/sohoenwa/primefaceslogin/java/dao/UserDAO.java | f6a355fe9956cbd558e076040d79b35147c0b99d | [] | no_license | rai-prashanna/MovieGenie | c69b92aeca38cc7d777b87dd7e4eafb29035c201 | 2397b78e081464154fb1bff8cefd2d5b840964d0 | refs/heads/master | 2021-05-12T12:07:56.608260 | 2018-01-27T10:02:05 | 2018-01-27T10:02:05 | 117,405,416 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,218 | java | package com.sohoenwa.primefaceslogin.java.dao;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import com.prashanna.model.MovieIDDTO;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class UserDAO {
private Connection connection;
public UserDAO() {
connection = Database.getConnection();
}
public boolean checklogin(String user, String password) {
PreparedStatement ps = null;
try {
ps = connection.prepareStatement(
"select user, pass from userinfo where user= ? and pass= ? ");
ps.setString(1, user);
ps.setString(2, password);
ResultSet rs = ps.executeQuery();
if (rs.next()) // found
{
System.out.println(rs.getString("user"));
return true;
}
else {
return false;
}
} catch (Exception ex) {
System.out.println("Error in login() -->" + ex.getMessage());
return false;
} finally {
Database.close(connection);
}
}
public void insert(MovieIDDTO movie){
PreparedStatement ps = null;
try {
ps=connection.prepareStatement("insert into links(movieId, imdbId ) values (?, ?)");
ps.setInt(1,Integer.parseInt(movie.getMovieID()));
ps.setInt(2, Integer.parseInt(movie.getImdbID()));
ps.executeUpdate();
} catch (SQLException ex) {
//Logger.getLogger(UserDAO.class.getName()).log(Level.SEVERE, null, ex);
System.out.println("Exception"+ex);
}
}
public MovieIDDTO getImdbIDbyMID(String id){
MovieIDDTO movieIDDTO=new MovieIDDTO();
try {
PreparedStatement preparedStatement = connection.prepareStatement("select * from links where movieId=?");
preparedStatement.setString(1, id);
ResultSet rs = preparedStatement.executeQuery();
if(rs.next()){
movieIDDTO.setMovieID(id);
movieIDDTO.setImdbID("tt0"+rs.getString("imdbId"));
}
} catch (SQLException ex) {
Logger.getLogger(UserDAO.class.getName()).log(Level.SEVERE, null, ex);
}
return movieIDDTO;
}
// public List<User> getAllUsers() {
// List<User> users = new ArrayList<User>();
// try {
// Statement statement = connection.createStatement();
// ResultSet rs = statement.executeQuery("select * from users");
// while (rs.next()) {
// User user = new User();
// user.setUname(rs.getString("uname"));
// user.setPassword(rs.getString("password"));
// user.setEmail(rs.getString("email"));
// user.setRegisteredon(rs.getDate("registeredon"));
// users.add(user);
// }
// } catch (SQLException e) {
// e.printStackTrace();
// }
//
// return users;
// }
} | [
"[email protected]"
] | |
fcccdd2f11abb720107108bb70cf18cf64211869 | 63b9a706ed1366a4fb7869f533b0f524118190d1 | /text/TextDirectionHeuristicsCompat.java | a59b37c5ee72af24cbb6be33b7ab2bcf8d151a26 | [] | no_license | parnamondal/Music-Player-App | 0ea3f82e7315ae693c42a7ab5ab2043056671eb8 | 69b0736191d33e6f2c66be723e5862315e954c55 | refs/heads/master | 2023-06-20T03:40:18.990383 | 2020-02-12T12:47:05 | 2020-02-12T12:47:05 | 179,228,231 | 2 | 0 | null | 2021-07-22T11:44:50 | 2019-04-03T06:50:52 | Java | UTF-8 | Java | false | false | 7,395 | java | package android.support.p000v4.text;
import java.nio.CharBuffer;
import java.util.Locale;
/* renamed from: android.support.v4.text.TextDirectionHeuristicsCompat */
public final class TextDirectionHeuristicsCompat {
public static final TextDirectionHeuristicCompat ANYRTL_LTR = new TextDirectionHeuristicInternal(AnyStrong.INSTANCE_RTL, false);
public static final TextDirectionHeuristicCompat FIRSTSTRONG_LTR = new TextDirectionHeuristicInternal(FirstStrong.INSTANCE, false);
public static final TextDirectionHeuristicCompat FIRSTSTRONG_RTL = new TextDirectionHeuristicInternal(FirstStrong.INSTANCE, true);
public static final TextDirectionHeuristicCompat LOCALE = TextDirectionHeuristicLocale.INSTANCE;
public static final TextDirectionHeuristicCompat LTR = new TextDirectionHeuristicInternal(null, false);
public static final TextDirectionHeuristicCompat RTL = new TextDirectionHeuristicInternal(null, true);
private static final int STATE_FALSE = 1;
private static final int STATE_TRUE = 0;
private static final int STATE_UNKNOWN = 2;
/* renamed from: android.support.v4.text.TextDirectionHeuristicsCompat$AnyStrong */
private static class AnyStrong implements TextDirectionAlgorithm {
static final AnyStrong INSTANCE_LTR = new AnyStrong(false);
static final AnyStrong INSTANCE_RTL = new AnyStrong(true);
private final boolean mLookForRtl;
public int checkRtl(CharSequence cs, int start, int count) {
boolean haveUnlookedFor = false;
int e = start + count;
for (int i = start; i < e; i++) {
switch (TextDirectionHeuristicsCompat.isRtlText(Character.getDirectionality(cs.charAt(i)))) {
case 0:
if (!this.mLookForRtl) {
haveUnlookedFor = true;
break;
} else {
return 0;
}
case 1:
if (this.mLookForRtl) {
haveUnlookedFor = true;
break;
} else {
return 1;
}
}
}
if (haveUnlookedFor) {
return this.mLookForRtl ? 1 : 0;
}
return 2;
}
private AnyStrong(boolean lookForRtl) {
this.mLookForRtl = lookForRtl;
}
}
/* renamed from: android.support.v4.text.TextDirectionHeuristicsCompat$FirstStrong */
private static class FirstStrong implements TextDirectionAlgorithm {
static final FirstStrong INSTANCE = new FirstStrong();
public int checkRtl(CharSequence cs, int start, int count) {
int result = 2;
int e = start + count;
for (int i = start; i < e && result == 2; i++) {
result = TextDirectionHeuristicsCompat.isRtlTextOrFormat(Character.getDirectionality(cs.charAt(i)));
}
return result;
}
private FirstStrong() {
}
}
/* renamed from: android.support.v4.text.TextDirectionHeuristicsCompat$TextDirectionAlgorithm */
private interface TextDirectionAlgorithm {
int checkRtl(CharSequence charSequence, int i, int i2);
}
/* renamed from: android.support.v4.text.TextDirectionHeuristicsCompat$TextDirectionHeuristicImpl */
private static abstract class TextDirectionHeuristicImpl implements TextDirectionHeuristicCompat {
private final TextDirectionAlgorithm mAlgorithm;
/* access modifiers changed from: protected */
public abstract boolean defaultIsRtl();
TextDirectionHeuristicImpl(TextDirectionAlgorithm algorithm) {
this.mAlgorithm = algorithm;
}
public boolean isRtl(char[] array, int start, int count) {
return isRtl((CharSequence) CharBuffer.wrap(array), start, count);
}
public boolean isRtl(CharSequence cs, int start, int count) {
if (cs == null || start < 0 || count < 0 || cs.length() - count < start) {
throw new IllegalArgumentException();
} else if (this.mAlgorithm == null) {
return defaultIsRtl();
} else {
return doCheck(cs, start, count);
}
}
private boolean doCheck(CharSequence cs, int start, int count) {
switch (this.mAlgorithm.checkRtl(cs, start, count)) {
case 0:
return true;
case 1:
return false;
default:
return defaultIsRtl();
}
}
}
/* renamed from: android.support.v4.text.TextDirectionHeuristicsCompat$TextDirectionHeuristicInternal */
private static class TextDirectionHeuristicInternal extends TextDirectionHeuristicImpl {
private final boolean mDefaultIsRtl;
TextDirectionHeuristicInternal(TextDirectionAlgorithm algorithm, boolean defaultIsRtl) {
super(algorithm);
this.mDefaultIsRtl = defaultIsRtl;
}
/* access modifiers changed from: protected */
public boolean defaultIsRtl() {
return this.mDefaultIsRtl;
}
}
/* renamed from: android.support.v4.text.TextDirectionHeuristicsCompat$TextDirectionHeuristicLocale */
private static class TextDirectionHeuristicLocale extends TextDirectionHeuristicImpl {
static final TextDirectionHeuristicLocale INSTANCE = new TextDirectionHeuristicLocale();
TextDirectionHeuristicLocale() {
super(null);
}
/* access modifiers changed from: protected */
public boolean defaultIsRtl() {
return TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == 1;
}
}
static int isRtlText(int directionality) {
switch (directionality) {
case 0:
return 1;
case 1:
case 2:
return 0;
default:
return 2;
}
}
/* JADX WARNING: Code restructure failed: missing block: B:5:0x0009, code lost:
return 0;
*/
/* JADX WARNING: Code restructure failed: missing block: B:7:0x000b, code lost:
return 1;
*/
/* Code decompiled incorrectly, please refer to instructions dump. */
static int isRtlTextOrFormat(int r1) {
/*
switch(r1) {
case 0: goto L_0x000a;
case 1: goto L_0x0008;
case 2: goto L_0x0008;
default: goto L_0x0003;
}
L_0x0003:
switch(r1) {
case 14: goto L_0x000a;
case 15: goto L_0x000a;
case 16: goto L_0x0008;
case 17: goto L_0x0008;
default: goto L_0x0006;
}
L_0x0006:
r0 = 2
return r0
L_0x0008:
r0 = 0
return r0
L_0x000a:
r0 = 1
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: android.support.p000v4.text.TextDirectionHeuristicsCompat.isRtlTextOrFormat(int):int");
}
private TextDirectionHeuristicsCompat() {
}
}
| [
"[email protected]"
] | |
778f9319277cdb3e31f3b68d4473ac41f272addf | 1f9baaa9d5ae5d31a68f8958421192b287338439 | /app/src/main/java/ci/ws/Models/entities/CIApisStateEntity.java | 9cb93cc2fd03695da5365fea6d301d24bdaf2e6d | [] | no_license | TkWu/CAL_live_code-1 | 538dde0ce66825026ef01d3fadfcbf4d6e4b1dd0 | ba30ccfd8056b9cc3045b8e06e8dc60b654c1e55 | refs/heads/master | 2020-08-29T09:16:35.600796 | 2019-10-23T06:46:53 | 2019-10-23T06:46:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 250 | java | package ci.ws.Models.entities;
import com.google.gson.annotations.Expose;
/**
* Created by joannyang on 16/6/1.
*/
public class CIApisStateEntity implements Cloneable {
@Expose
public String code;
@Expose
public String name;
}
| [
"[email protected]"
] | |
db58b4d021f96fc4a424845cf27aa12bd305f6d1 | 3f62e8686bb663cfedeb5091b38735fb38ea365b | /Sort.java | 40a38c45bc9a8e4bfbca63c906859d95fd37dcf8 | [] | no_license | lukiux/LPExam | 08a8afdc1126f1dde25e6573c2a502f2c12e729b | 05d1cc35b8b174d3b7b9d042e8e3959a35c4be3c | refs/heads/master | 2021-05-12T03:06:25.176810 | 2018-01-16T00:08:40 | 2018-01-16T00:08:40 | 117,608,854 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,080 | java | class BubbleSort implements Runnable {
private int i, j, temp;
private int[] numbers;
private int size;
BubbleSort(int numbers[], int size) {
this.numbers = numbers;
this.size = size;
}
@Override
public void run(){
for (i = (size - 1); i >=0; i--)
{
for(j = 1; j <= i; j++)
if (numbers[j-1] > numbers[j])
{
temp = numbers[j - 1];
numbers[j - 1] = numbers[j];
numbers[j] = temp;
}
}
}
public void print(){
for(int l = 0; l < size; l++)
System.out.println(numbers[l] + " ");
}
}
public class Sort {
public static int[] numbers = new int[10];
public static void main(String[] args) {
Random random = new Random();
for (int i = 0; i < numbers.length; i++)
numbers[i] = random.nextInt(100);
Thread t = new Thread(new BubbleSort(numbers, numbers.length));
}
}
| [
"[email protected]"
] | |
d453863c774d756d28699f1bbd50dc256e687ece | b7456ce38350766c2c4d4ff102cbdddfd864e53b | /Driver.java | 01f43eaf2819031f11b7cff8789e6e9494af2e67 | [] | no_license | GabrielAiello/csc370_gabriel_assignment5 | eeb1e13f131df2b7e65dfb2cc0be819a26b86387 | 28469c270da701709fb0e3a2a90eebfbd984df8c | refs/heads/master | 2021-01-20T12:10:19.579056 | 2017-02-21T06:24:06 | 2017-02-21T06:24:06 | 82,644,349 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 600 | java | package hwassignment5csc300;
public class Driver
{
public static void main(String[] args)
{
LinkedList happy = new LinkedList();
System.out.println("" + happy.getCount());
happy.addFront("a");
happy.addFront("b");
happy.addEnd("c");
happy.addFront("d");
happy.addFront("e");
happy.addEnd("f");
happy.addFront("g");
happy.addFront("h");
happy.addEnd("i");
happy.addFront("j");
happy.addFront("k");
happy.addEnd("l");
System.out.println("" + happy.getCount());
happy.display();
happy.removeEnd();
happy.display();
happy.removeAtIndex(3);
happy.display();
}
}
| [
"[email protected]"
] | |
9cdbfbcb239ad6c2fbed01ea61578510e980185d | 5b095c41d30c653449ededdb28a46c49f21072be | /assignments/odev3/src/PegasusReservationSystem.java | f5942d3c67831107e82a1e88a081f6a26f72a205 | [] | no_license | mkkasem/Kodluyoruz_repositry | 19bcf0756a3641be96c179b654a0e2454d823765 | afce4ca17868d9ef20abbc5d79a86b3489e478bf | refs/heads/master | 2023-07-12T12:19:19.707768 | 2021-08-09T13:59:49 | 2021-08-09T13:59:49 | 394,052,008 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,966 | java | import java.util.Scanner;
/*I first implemented THY reservation system and then instead of duplicating the code I simply create an
object of THY reservation system class and used it in a hidden way as Pegasus reservation system since they both
display the same behaviour
*/
public class PegasusReservationSystem extends AirplaneReservationSystem{
private static THYReservationSystem thyasusReservationSystem;
public PegasusReservationSystem() {
super();
thyasusReservationSystem=new THYReservationSystem();
}
public PegasusReservationSystem(int numberOfSeats) {
super(numberOfSeats);
thyasusReservationSystem=new THYReservationSystem(numberOfSeats);
}
@Override
public void makeReservation() {
this.thyasusReservationSystem.makeReservation();
}
public static void main(String[] args) {
PegasusReservationSystem pegasusReservationSystem=new PegasusReservationSystem(10);
boolean toContinue;
//choose after how many loops you want to change size of seats
//int afterNLoops=1;//
//int changeNumberOfSeats=30;
//take the client booking requests
while (true){
/*uncomment the ıf statement block and the variables above to change number of seats
and choose any number you want*/
//if(afterNLoops--==0)
//PegasusReservationSystem.thyasusReservationSystem.setNumberOfSeats(changeNumberOfSeats);
System.out.println("Pegasus Rezervasyon Sistemine hoş geldiniz! ");
pegasusReservationSystem.makeReservation();
System.out.println("Devam etmek için c'ye, çıkmak için herhangi başka bir tuşa basınız ");
toContinue=new Scanner(System.in).next().equals("c")?true:false;
if(!toContinue)
break;
System.out.println();
}
}
}
| [
"[email protected]"
] | |
55d55a6c1dd3dd2290a94e05ed9c0e1214d2b1a1 | e630cc31142e1ce19b28a90bb9e0cde331fee371 | /src/test/java/ex34/AppTest.java | 9aef2f89e5294cfb6ccc831a932012a72ce11225 | [] | no_license | AwesomeDin/dinesh-cop3330-assignment2 | 65d1687f329d57926cf7561a2f0dba18501dbd2a | 4bc84b66a2e6701b1c34a83a6a2fc66fc2ca0693 | refs/heads/master | 2023-08-01T18:52:54.365438 | 2021-09-27T22:18:18 | 2021-09-27T22:18:18 | 407,016,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,196 | java | package ex34;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import static org.junit.jupiter.api.Assertions.*;
class AppTest {
@Test
void addEmp() {
ArrayList<String> employees = new ArrayList<>();
ArrayList<String> currentEmployees = new ArrayList<>();
employees.add("John Smith");
employees.add("Jackie Jackson");
employees.add("Chris Jones");
employees.add("Amanda Cullen");
employees.add("Jeremy Goodwin");
assertEquals(employees,App.addEmp(currentEmployees));
}
@Test
void removeEmp() {
ArrayList<String> employees = new ArrayList<>();
employees.add("Jackie Jackson");
employees.add("Chris Jones");
employees.add("Amanda Cullen");
employees.add("Jeremy Goodwin");
ArrayList<String> currentEmployees = new ArrayList<>();
currentEmployees.add("John Smith");
currentEmployees.add("Jackie Jackson");
currentEmployees.add("Chris Jones");
currentEmployees.add("Amanda Cullen");
currentEmployees.add("Jeremy Goodwin");
assertEquals(employees,App.removeEmp(currentEmployees,"John Smith"));
}
} | [
"[email protected]"
] | |
1398f22ea2d1c3262b42da35e0385dff6cf81b15 | f6190666e6fda3e017b6be3ee1cb14ec7a11a1be | /src/main/java/uz/pdp/online/helper/GsonUserHelper.java | b50709909cfddeaa549e0a4c05dab98dad37812f | [] | no_license | Muhammad0224/MiniInternetMagazine | f076a7e3be0d91a133150e7dcb00559dd2d6d1b8 | 7add03feff69dbd1b1ccc77a4a720ad18234f488 | refs/heads/master | 2023-07-15T05:58:50.428927 | 2021-08-31T16:51:12 | 2021-08-31T16:51:12 | 401,777,602 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 860 | java | package uz.pdp.online.helper;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import uz.pdp.online.model.Goods;
import uz.pdp.online.model.User;
import uz.pdp.online.service.GsonToList;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class GsonUserHelper {
Gson gson = new GsonBuilder().setPrettyPrinting().create();
public List<User> converter(Reader reader, File file) {
// Type listType = new TypeToken<ArrayList<T>>(){}.getType();
try (BufferedReader bufferedReader = new BufferedReader(new FileReader(file))) {
return new ArrayList<>(Arrays.asList(gson.fromJson(bufferedReader, User[].class)));
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
| [
"[email protected]"
] | |
8ed107d51920a50db3dc0c7f11937835fd3e26db | af6251ee729995455081c4f4e48668c56007e1ac | /domain/src/main/java/mmp/gps/domain/push/InstructResultMessage.java | 4b5ada1bcda4c7e7492a4d6a247692f96705bbe9 | [] | no_license | LXKing/monitor | b7522d5b95d2cca7e37a8bfc66dc7ba389e926ef | 7d1eca454ce9a93fc47c68f311eca4dcd6f82603 | refs/heads/master | 2020-12-01T08:08:53.265259 | 2018-12-24T12:43:32 | 2018-12-24T12:43:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 323 | java | package mmp.gps.domain.push;
/**
* 指令结果消息
*/
public class InstructResultMessage {
/**
* 设备号
*/
public String number;
/**
* 记录号
*/
public String id;
/**
* 结果
*/
public String result;
/**
* 数据
*/
public Object data;
}
| [
"[email protected]"
] | |
4246c60831e914b8644db716781045211e36c031 | e705f88c4a45c60a1dd37ffbdc71cab876cf43ff | /src/main/java/ru/onyx/clipper/pdfgenerator/converter/JSONObject.java | d25fce8d36c0f33562e21089fd0756ae6d21fd7a | [] | no_license | MasterSPB/pdf-generator | 468f99a9cb663ac5f67914cd40277f12a52dd065 | ab7e36f4558579245ba5da1e656dc48a3bbe9764 | refs/heads/master | 2021-01-01T18:42:34.868937 | 2015-12-08T08:37:34 | 2015-12-08T08:37:34 | 19,023,355 | 0 | 8 | null | 2015-12-08T08:38:52 | 2014-04-22T09:02:55 | Java | UTF-8 | Java | false | false | 56,501 | java | package ru.onyx.clipper.pdfgenerator.converter;
/**
* Created by anton on 30.04.14.
*/
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.Set;
/**
* A JSONObject is an unordered collection of name/value pairs. Its external
* form is a string wrapped in curly braces with colons between the names and
* values, and commas between the values and names. The internal form is an
* object having <code>get</code> and <code>opt</code> methods for accessing
* the values by name, and <code>put</code> methods for adding or replacing
* values by name. The values can be any of these types: <code>Boolean</code>,
* <code>JSONArray</code>, <code>JSONObject</code>, <code>Number</code>,
* <code>String</code>, or the <code>JSONObject.NULL</code> object. A
* JSONObject constructor can be used to convert an external form JSON text
* into an internal form whose values can be retrieved with the
* <code>get</code> and <code>opt</code> methods, or to convert values into a
* JSON text using the <code>put</code> and <code>toString</code> methods. A
* <code>get</code> method returns a value if one can be found, and throws an
* exception if one cannot be found. An <code>opt</code> method returns a
* default value instead of throwing an exception, and so is useful for
* obtaining optional values.
* <p>
* The generic <code>get()</code> and <code>opt()</code> methods return an
* object, which you can cast or query for type. There are also typed
* <code>get</code> and <code>opt</code> methods that do type checking and type
* coercion for you. The opt methods differ from the get methods in that they
* do not throw. Instead, they return a specified value, such as null.
* <p>
* The <code>put</code> methods add or replace values in an object. For
* example,
*
* <pre>
* myString = new JSONObject()
* .put("JSON", "Hello, World!").toString();
* </pre>
*
* produces the string <code>{"JSON": "Hello, World"}</code>.
* <p>
* The texts produced by the <code>toString</code> methods strictly conform to
* the JSON syntax rules. The constructors are more forgiving in the texts they
* will accept:
* <ul>
* <li>An extra <code>,</code> <small>(comma)</small> may appear just
* before the closing brace.</li>
* <li>Strings may be quoted with <code>'</code> <small>(single
* quote)</small>.</li>
* <li>Strings do not need to be quoted at all if they do not begin with a
* quote or single quote, and if they do not contain leading or trailing
* spaces, and if they do not contain any of these characters:
* <code>{ } [ ] / \ : , #</code> and if they do not look like numbers and
* if they are not the reserved words <code>true</code>, <code>false</code>,
* or <code>null</code>.</li>
* </ul>
*
* @author JSON.org
* @version 2014-04-21
*/
public class JSONObject {
/**
* JSONObject.NULL is equivalent to the value that JavaScript calls null,
* whilst Java's null is equivalent to the value that JavaScript calls
* undefined.
*/
private static final class Null {
/**
* There is only intended to be a single instance of the NULL object,
* so the clone method returns itself.
*
* @return NULL.
*/
protected final Object clone() {
return this;
}
/**
* A Null object is equal to the null value and to itself.
*
* @param object
* An object to test for nullness.
* @return true if the object parameter is the JSONObject.NULL object or
* null.
*/
public boolean equals(Object object) {
return object == null || object == this;
}
/**
* Get the "null" string value.
*
* @return The string "null".
*/
public String toString() {
return "null";
}
}
/**
* The map where the JSONObject's properties are kept.
*/
private final Map map;
/**
* It is sometimes more convenient and less ambiguous to have a
* <code>NULL</code> object than to use Java's <code>null</code> value.
* <code>JSONObject.NULL.equals(null)</code> returns <code>true</code>.
* <code>JSONObject.NULL.toString()</code> returns <code>"null"</code>.
*/
public static final Object NULL = new Null();
/**
* Construct an empty JSONObject.
*/
public JSONObject() {
this.map = new HashMap();
}
/**
* Construct a JSONObject from a subset of another JSONObject. An array of
* strings is used to identify the keys that should be copied. Missing keys
* are ignored.
*
* @param jo
* A JSONObject.
* @param names
* An array of strings.
* @throws JSONException
* @exception JSONException
* If a value is a non-finite number or if a name is
* duplicated.
*/
public JSONObject(JSONObject jo, String[] names) {
this();
for (int i = 0; i < names.length; i += 1) {
try {
this.putOnce(names[i], jo.opt(names[i]));
} catch (Exception ignore) {
}
}
}
/**
* Construct a JSONObject from a JSONTokener.
*
* @param x
* A JSONTokener object containing the source string.
* @throws JSONException
* If there is a syntax error in the source string or a
* duplicated key.
*/
public JSONObject(JSONTokener x) throws JSONException {
this();
char c;
String key;
if (x.nextClean() != '{') {
throw x.syntaxError("A JSONObject text must begin with '{'");
}
for (;;) {
c = x.nextClean();
switch (c) {
case 0:
throw x.syntaxError("A JSONObject text must end with '}'");
case '}':
return;
default:
x.back();
key = x.nextValue().toString();
}
// The key is followed by ':'.
c = x.nextClean();
if (c != ':') {
throw x.syntaxError("Expected a ':' after a key");
}
this.putOnce(key, x.nextValue());
// Pairs are separated by ','.
switch (x.nextClean()) {
case ';':
case ',':
if (x.nextClean() == '}') {
return;
}
x.back();
break;
case '}':
return;
default:
throw x.syntaxError("Expected a ',' or '}'");
}
}
}
/**
* Construct a JSONObject from a Map.
*
* @param map
* A map object that can be used to initialize the contents of
* the JSONObject.
* @throws JSONException
*/
public JSONObject(Map map) {
this.map = new HashMap();
if (map != null) {
Iterator i = map.entrySet().iterator();
while (i.hasNext()) {
Map.Entry e = (Map.Entry) i.next();
Object value = e.getValue();
if (value != null) {
this.map.put(e.getKey(), wrap(value));
}
}
}
}
/**
* Construct a JSONObject from an Object using bean getters. It reflects on
* all of the public methods of the object. For each of the methods with no
* parameters and a name starting with <code>"get"</code> or
* <code>"is"</code> followed by an uppercase letter, the method is invoked,
* and a key and the value returned from the getter method are put into the
* new JSONObject.
*
* The key is formed by removing the <code>"get"</code> or <code>"is"</code>
* prefix. If the second remaining character is not upper case, then the
* first character is converted to lower case.
*
* For example, if an object has a method named <code>"getName"</code>, and
* if the result of calling <code>object.getName()</code> is
* <code>"Larry Fine"</code>, then the JSONObject will contain
* <code>"name": "Larry Fine"</code>.
*
* @param bean
* An object that has getter methods that should be used to make
* a JSONObject.
*/
public JSONObject(Object bean) {
this();
this.populateMap(bean);
}
/**
* Construct a JSONObject from an Object, using reflection to find the
* public members. The resulting JSONObject's keys will be the strings from
* the names array, and the values will be the field values associated with
* those keys in the object. If a key is not found or not visible, then it
* will not be copied into the new JSONObject.
*
* @param object
* An object that has fields that should be used to make a
* JSONObject.
* @param names
* An array of strings, the names of the fields to be obtained
* from the object.
*/
public JSONObject(Object object, String names[]) {
this();
Class c = object.getClass();
for (int i = 0; i < names.length; i += 1) {
String name = names[i];
try {
this.putOpt(name, c.getField(name).get(object));
} catch (Exception ignore) {
}
}
}
/**
* Construct a JSONObject from a source JSON text string. This is the most
* commonly used JSONObject constructor.
*
* @param source
* A string beginning with <code>{</code> <small>(left
* brace)</small> and ending with <code>}</code>
* <small>(right brace)</small>.
* @exception JSONException
* If there is a syntax error in the source string or a
* duplicated key.
*/
public JSONObject(String source) throws JSONException {
this(new JSONTokener(source));
}
/**
* Construct a JSONObject from a ResourceBundle.
*
* @param baseName
* The ResourceBundle base name.
* @param locale
* The Locale to load the ResourceBundle for.
* @throws JSONException
* If any JSONExceptions are detected.
*/
public JSONObject(String baseName, Locale locale) throws JSONException {
this();
ResourceBundle bundle = ResourceBundle.getBundle(baseName, locale,
Thread.currentThread().getContextClassLoader());
// Iterate through the keys in the bundle.
Enumeration keys = bundle.getKeys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
if (key instanceof String) {
// Go through the path, ensuring that there is a nested JSONObject for each
// segment except the last. Add the value using the last segment's name into
// the deepest nested JSONObject.
String[] path = ((String) key).split("\\.");
int last = path.length - 1;
JSONObject target = this;
for (int i = 0; i < last; i += 1) {
String segment = path[i];
JSONObject nextTarget = target.optJSONObject(segment);
if (nextTarget == null) {
nextTarget = new JSONObject();
target.put(segment, nextTarget);
}
target = nextTarget;
}
target.put(path[last], bundle.getString((String) key));
}
}
}
/**
* Accumulate values under a key. It is similar to the put method except
* that if there is already an object stored under the key then a JSONArray
* is stored under the key to hold all of the accumulated values. If there
* is already a JSONArray, then the new value is appended to it. In
* contrast, the put method replaces the previous value.
*
* If only one value is accumulated that is not a JSONArray, then the result
* will be the same as using put. But if multiple values are accumulated,
* then the result will be like append.
*
* @param key
* A key string.
* @param value
* An object to be accumulated under the key.
* @return this.
* @throws JSONException
* If the value is an invalid number or if the key is null.
*/
public JSONObject accumulate(String key, Object value) throws JSONException {
key = key.replace('.', '_');
testValidity(value);
Object object = this.opt(key);
if (object == null) {
this.put(key,
value instanceof JSONArray ? new JSONArray().put(value)
: value);
} else if (object instanceof JSONArray) {
((JSONArray) object).put(value);
} else {
this.put(key, new JSONArray().put(object).put(value));
}
return this;
}
/**
* Append values to the array under a key. If the key does not exist in the
* JSONObject, then the key is put in the JSONObject with its value being a
* JSONArray containing the value parameter. If the key was already
* associated with a JSONArray, then the value parameter is appended to it.
*
* @param key
* A key string.
* @param value
* An object to be accumulated under the key.
* @return this.
* @throws JSONException
* If the key is null or if the current value associated with
* the key is not a JSONArray.
*/
public JSONObject append(String key, Object value) throws JSONException {
testValidity(value);
Object object = this.opt(key);
if (object == null) {
this.put(key, new JSONArray().put(value));
} else if (object instanceof JSONArray) {
this.put(key, ((JSONArray) object).put(value));
} else {
throw new JSONException("JSONObject[" + key
+ "] is not a JSONArray.");
}
return this;
}
/**
* Produce a string from a double. The string "null" will be returned if the
* number is not finite.
*
* @param d
* A double.
* @return A String.
*/
public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
&& string.indexOf('E') < 0) {
while (string.endsWith("0")) {
string = string.substring(0, string.length() - 1);
}
if (string.endsWith(".")) {
string = string.substring(0, string.length() - 1);
}
}
return string;
}
/**
* Get the value object associated with a key.
*
* @param key
* A key string.
* @return The object associated with the key.
* @throws JSONException
* if the key is not found.
*/
public Object get(String key) throws JSONException {
if (key == null) {
throw new JSONException("Null key.");
}
Object object = this.opt(key);
if (object == null) {
throw new JSONException("JSONObject[" + quote(key) + "] not found.");
}
return object;
}
/**
* Get the boolean value associated with a key.
*
* @param key
* A key string.
* @return The truth.
* @throws JSONException
* if the value is not a Boolean or the String "true" or
* "false".
*/
public boolean getBoolean(String key) throws JSONException {
Object object = this.get(key);
if (object.equals(Boolean.FALSE)
|| (object instanceof String && ((String) object)
.equalsIgnoreCase("false"))) {
return false;
} else if (object.equals(Boolean.TRUE)
|| (object instanceof String && ((String) object)
.equalsIgnoreCase("true"))) {
return true;
}
throw new JSONException("JSONObject[" + quote(key)
+ "] is not a Boolean.");
}
/**
* Get the double value associated with a key.
*
* @param key
* A key string.
* @return The numeric value.
* @throws JSONException
* if the key is not found or if the value is not a Number
* object and cannot be converted to a number.
*/
public double getDouble(String key) throws JSONException {
Object object = this.get(key);
try {
return object instanceof Number ? ((Number) object).doubleValue()
: Double.parseDouble((String) object);
} catch (Exception e) {
throw new JSONException("JSONObject[" + quote(key)
+ "] is not a number.");
}
}
/**
* Get the int value associated with a key.
*
* @param key
* A key string.
* @return The integer value.
* @throws JSONException
* if the key is not found or if the value cannot be converted
* to an integer.
*/
public int getInt(String key) throws JSONException {
Object object = this.get(key);
try {
return object instanceof Number ? ((Number) object).intValue()
: Integer.parseInt((String) object);
} catch (Exception e) {
throw new JSONException("JSONObject[" + quote(key)
+ "] is not an int.");
}
}
/**
* Get the JSONArray value associated with a key.
*
* @param key
* A key string.
* @return A JSONArray which is the value.
* @throws JSONException
* if the key is not found or if the value is not a JSONArray.
*/
public JSONArray getJSONArray(String key) throws JSONException {
Object object = this.get(key);
if (object instanceof JSONArray) {
return (JSONArray) object;
}
throw new JSONException("JSONObject[" + quote(key)
+ "] is not a JSONArray.");
}
/**
* Get the JSONObject value associated with a key.
*
* @param key
* A key string.
* @return A JSONObject which is the value.
* @throws JSONException
* if the key is not found or if the value is not a JSONObject.
*/
public JSONObject getJSONObject(String key) throws JSONException {
Object object = this.get(key);
if (object instanceof JSONObject) {
return (JSONObject) object;
}
throw new JSONException("JSONObject[" + quote(key)
+ "] is not a JSONObject.");
}
/**
* Get the long value associated with a key.
*
* @param key
* A key string.
* @return The long value.
* @throws JSONException
* if the key is not found or if the value cannot be converted
* to a long.
*/
public long getLong(String key) throws JSONException {
Object object = this.get(key);
try {
return object instanceof Number ? ((Number) object).longValue()
: Long.parseLong((String) object);
} catch (Exception e) {
throw new JSONException("JSONObject[" + quote(key)
+ "] is not a long.");
}
}
/**
* Get an array of field names from a JSONObject.
*
* @return An array of field names, or null if there are no names.
*/
public static String[] getNames(JSONObject jo) {
int length = jo.length();
if (length == 0) {
return null;
}
Iterator iterator = jo.keys();
String[] names = new String[length];
int i = 0;
while (iterator.hasNext()) {
names[i] = (String) iterator.next();
i += 1;
}
return names;
}
/**
* Get an array of field names from an Object.
*
* @return An array of field names, or null if there are no names.
*/
public static String[] getNames(Object object) {
if (object == null) {
return null;
}
Class klass = object.getClass();
Field[] fields = klass.getFields();
int length = fields.length;
if (length == 0) {
return null;
}
String[] names = new String[length];
for (int i = 0; i < length; i += 1) {
names[i] = fields[i].getName();
}
return names;
}
/**
* Get the string associated with a key.
*
* @param key
* A key string.
* @return A string which is the value.
* @throws JSONException
* if there is no string value for the key.
*/
public String getString(String key) throws JSONException {
Object object = this.get(key);
if (object instanceof String) {
return (String) object;
}
throw new JSONException("JSONObject[" + quote(key) + "] not a string.");
}
/**
* Determine if the JSONObject contains a specific key.
*
* @param key
* A key string.
* @return true if the key exists in the JSONObject.
*/
public boolean has(String key) {
return this.map.containsKey(key);
}
/**
* Increment a property of a JSONObject. If there is no such property,
* create one with a value of 1. If there is such a property, and if it is
* an Integer, Long, Double, or Float, then add one to it.
*
* @param key
* A key string.
* @return this.
* @throws JSONException
* If there is already a property with this name that is not an
* Integer, Long, Double, or Float.
*/
public JSONObject increment(String key) throws JSONException {
Object value = this.opt(key);
if (value == null) {
this.put(key, 1);
} else if (value instanceof Integer) {
this.put(key, ((Integer) value).intValue() + 1);
} else if (value instanceof Long) {
this.put(key, ((Long) value).longValue() + 1);
} else if (value instanceof Double) {
this.put(key, ((Double) value).doubleValue() + 1);
} else if (value instanceof Float) {
this.put(key, ((Float) value).floatValue() + 1);
} else {
throw new JSONException("Unable to increment [" + quote(key) + "].");
}
return this;
}
/**
* Determine if the value associated with the key is null or if there is no
* value.
*
* @param key
* A key string.
* @return true if there is no value associated with the key or if the value
* is the JSONObject.NULL object.
*/
public boolean isNull(String key) {
return JSONObject.NULL.equals(this.opt(key));
}
/**
* Get an enumeration of the keys of the JSONObject.
*
* @return An iterator of the keys.
*/
public Iterator keys() {
return this.keySet().iterator();
}
/**
* Get a set of keys of the JSONObject.
*
* @return A keySet.
*/
public Set keySet() {
return this.map.keySet();
}
/**
* Get the number of keys stored in the JSONObject.
*
* @return The number of keys in the JSONObject.
*/
public int length() {
return this.map.size();
}
/**
* Produce a JSONArray containing the names of the elements of this
* JSONObject.
*
* @return A JSONArray containing the key strings, or null if the JSONObject
* is empty.
*/
public JSONArray names() {
JSONArray ja = new JSONArray();
Iterator keys = this.keys();
while (keys.hasNext()) {
ja.put(keys.next());
}
return ja.length() == 0 ? null : ja;
}
/**
* Produce a string from a Number.
*
* @param number
* A Number
* @return A String.
* @throws JSONException
* If n is a non-finite number.
*/
public static String numberToString(Number number) throws JSONException {
if (number == null) {
throw new JSONException("Null pointer");
}
testValidity(number);
// Shave off trailing zeros and decimal point, if possible.
String string = number.toString();
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
&& string.indexOf('E') < 0) {
while (string.endsWith("0")) {
string = string.substring(0, string.length() - 1);
}
if (string.endsWith(".")) {
string = string.substring(0, string.length() - 1);
}
}
return string;
}
/**
* Get an optional value associated with a key.
*
* @param key
* A key string.
* @return An object which is the value, or null if there is no value.
*/
public Object opt(String key) {
return key == null ? null : this.map.get(key);
}
/**
* Get an optional boolean associated with a key. It returns false if there
* is no such key, or if the value is not Boolean.TRUE or the String "true".
*
* @param key
* A key string.
* @return The truth.
*/
public boolean optBoolean(String key) {
return this.optBoolean(key, false);
}
/**
* Get an optional boolean associated with a key. It returns the
* defaultValue if there is no such key, or if it is not a Boolean or the
* String "true" or "false" (case insensitive).
*
* @param key
* A key string.
* @param defaultValue
* The default.
* @return The truth.
*/
public boolean optBoolean(String key, boolean defaultValue) {
try {
return this.getBoolean(key);
} catch (Exception e) {
return defaultValue;
}
}
/**
* Get an optional double associated with a key, or NaN if there is no such
* key or if its value is not a number. If the value is a string, an attempt
* will be made to evaluate it as a number.
*
* @param key
* A string which is the key.
* @return An object which is the value.
*/
public double optDouble(String key) {
return this.optDouble(key, Double.NaN);
}
/**
* Get an optional double associated with a key, or the defaultValue if
* there is no such key or if its value is not a number. If the value is a
* string, an attempt will be made to evaluate it as a number.
*
* @param key
* A key string.
* @param defaultValue
* The default.
* @return An object which is the value.
*/
public double optDouble(String key, double defaultValue) {
try {
return this.getDouble(key);
} catch (Exception e) {
return defaultValue;
}
}
/**
* Get an optional int value associated with a key, or zero if there is no
* such key or if the value is not a number. If the value is a string, an
* attempt will be made to evaluate it as a number.
*
* @param key
* A key string.
* @return An object which is the value.
*/
public int optInt(String key) {
return this.optInt(key, 0);
}
/**
* Get an optional int value associated with a key, or the default if there
* is no such key or if the value is not a number. If the value is a string,
* an attempt will be made to evaluate it as a number.
*
* @param key
* A key string.
* @param defaultValue
* The default.
* @return An object which is the value.
*/
public int optInt(String key, int defaultValue) {
try {
return this.getInt(key);
} catch (Exception e) {
return defaultValue;
}
}
/**
* Get an optional JSONArray associated with a key. It returns null if there
* is no such key, or if its value is not a JSONArray.
*
* @param key
* A key string.
* @return A JSONArray which is the value.
*/
public JSONArray optJSONArray(String key) {
Object o = this.opt(key);
return o instanceof JSONArray ? (JSONArray) o : null;
}
/**
* Get an optional JSONObject associated with a key. It returns null if
* there is no such key, or if its value is not a JSONObject.
*
* @param key
* A key string.
* @return A JSONObject which is the value.
*/
public JSONObject optJSONObject(String key) {
Object object = this.opt(key);
return object instanceof JSONObject ? (JSONObject) object : null;
}
/**
* Get an optional long value associated with a key, or zero if there is no
* such key or if the value is not a number. If the value is a string, an
* attempt will be made to evaluate it as a number.
*
* @param key
* A key string.
* @return An object which is the value.
*/
public long optLong(String key) {
return this.optLong(key, 0);
}
/**
* Get an optional long value associated with a key, or the default if there
* is no such key or if the value is not a number. If the value is a string,
* an attempt will be made to evaluate it as a number.
*
* @param key
* A key string.
* @param defaultValue
* The default.
* @return An object which is the value.
*/
public long optLong(String key, long defaultValue) {
try {
return this.getLong(key);
} catch (Exception e) {
return defaultValue;
}
}
/**
* Get an optional string associated with a key. It returns an empty string
* if there is no such key. If the value is not a string and is not null,
* then it is converted to a string.
*
* @param key
* A key string.
* @return A string which is the value.
*/
public String optString(String key) {
return this.optString(key, "");
}
/**
* Get an optional string associated with a key. It returns the defaultValue
* if there is no such key.
*
* @param key
* A key string.
* @param defaultValue
* The default.
* @return A string which is the value.
*/
public String optString(String key, String defaultValue) {
Object object = this.opt(key);
return NULL.equals(object) ? defaultValue : object.toString();
}
private void populateMap(Object bean) {
Class klass = bean.getClass();
// If klass is a System class then set includeSuperClass to false.
boolean includeSuperClass = klass.getClassLoader() != null;
Method[] methods = includeSuperClass ? klass.getMethods() : klass
.getDeclaredMethods();
for (int i = 0; i < methods.length; i += 1) {
try {
Method method = methods[i];
if (Modifier.isPublic(method.getModifiers())) {
String name = method.getName();
String key = "";
if (name.startsWith("get")) {
if ("getClass".equals(name)
|| "getDeclaringClass".equals(name)) {
key = "";
} else {
key = name.substring(3);
}
} else if (name.startsWith("is")) {
key = name.substring(2);
}
if (key.length() > 0
&& Character.isUpperCase(key.charAt(0))
&& method.getParameterTypes().length == 0) {
if (key.length() == 1) {
key = key.toLowerCase();
} else if (!Character.isUpperCase(key.charAt(1))) {
key = key.substring(0, 1).toLowerCase()
+ key.substring(1);
}
Object result = method.invoke(bean, (Object[]) null);
if (result != null) {
this.map.put(key, wrap(result));
}
}
}
} catch (Exception ignore) {
}
}
}
/**
* Put a key/boolean pair in the JSONObject.
*
* @param key
* A key string.
* @param value
* A boolean which is the value.
* @return this.
* @throws JSONException
* If the key is null.
*/
public JSONObject put(String key, boolean value) throws JSONException {
this.put(key, value ? Boolean.TRUE : Boolean.FALSE);
return this;
}
/**
* Put a key/value pair in the JSONObject, where the value will be a
* JSONArray which is produced from a Collection.
*
* @param key
* A key string.
* @param value
* A Collection value.
* @return this.
* @throws JSONException
*/
public JSONObject put(String key, Collection value) throws JSONException {
this.put(key, new JSONArray(value));
return this;
}
/**
* Put a key/double pair in the JSONObject.
*
* @param key
* A key string.
* @param value
* A double which is the value.
* @return this.
* @throws JSONException
* If the key is null or if the number is invalid.
*/
public JSONObject put(String key, double value) throws JSONException {
this.put(key, new Double(value));
return this;
}
/**
* Put a key/int pair in the JSONObject.
*
* @param key
* A key string.
* @param value
* An int which is the value.
* @return this.
* @throws JSONException
* If the key is null.
*/
public JSONObject put(String key, int value) throws JSONException {
this.put(key, new Integer(value));
return this;
}
/**
* Put a key/long pair in the JSONObject.
*
* @param key
* A key string.
* @param value
* A long which is the value.
* @return this.
* @throws JSONException
* If the key is null.
*/
public JSONObject put(String key, long value) throws JSONException {
this.put(key, new Long(value));
return this;
}
/**
* Put a key/value pair in the JSONObject, where the value will be a
* JSONObject which is produced from a Map.
*
* @param key
* A key string.
* @param value
* A Map value.
* @return this.
* @throws JSONException
*/
public JSONObject put(String key, Map value) throws JSONException {
this.put(key, new JSONObject(value));
return this;
}
/**
* Put a key/value pair in the JSONObject. If the value is null, then the
* key will be removed from the JSONObject if it is present.
*
* @param key
* A key string.
* @param value
* An object which is the value. It should be of one of these
* types: Boolean, Double, Integer, JSONArray, JSONObject, Long,
* String, or the JSONObject.NULL object.
* @return this.
* @throws JSONException
* If the value is non-finite number or if the key is null.
*/
public JSONObject put(String key, Object value) throws JSONException {
if (key == null) {
throw new NullPointerException("Null key.");
}
if (value != null) {
testValidity(value);
this.map.put(key, value);
} else {
this.remove(key);
}
return this;
}
/**
* Put a key/value pair in the JSONObject, but only if the key and the value
* are both non-null, and only if there is not already a member with that
* name.
*
* @param key
* @param value
* @return his.
* @throws JSONException
* if the key is a duplicate
*/
public JSONObject putOnce(String key, Object value) throws JSONException {
if (key != null && value != null) {
if (this.opt(key) != null) {
throw new JSONException("Duplicate key \"" + key + "\"");
}
this.put(key, value);
}
return this;
}
/**
* Put a key/value pair in the JSONObject, but only if the key and the value
* are both non-null.
*
* @param key
* A key string.
* @param value
* An object which is the value. It should be of one of these
* types: Boolean, Double, Integer, JSONArray, JSONObject, Long,
* String, or the JSONObject.NULL object.
* @return this.
* @throws JSONException
* If the value is a non-finite number.
*/
public JSONObject putOpt(String key, Object value) throws JSONException {
if (key != null && value != null) {
this.put(key, value);
}
return this;
}
/**
* Produce a string in double quotes with backslash sequences in all the
* right places. A backslash will be inserted within </, producing <\/,
* allowing JSON text to be delivered in HTML. In JSON text, a string cannot
* contain a control character or an unescaped quote or backslash.
*
* @param string
* A String
* @return A String correctly formatted for insertion in a JSON text.
*/
public static String quote(String string) {
StringWriter sw = new StringWriter();
synchronized (sw.getBuffer()) {
try {
return quote(string, sw).toString();
} catch (IOException ignored) {
// will never happen - we are writing to a string writer
return "";
}
}
}
public static Writer quote(String string, Writer w) throws IOException {
if (string == null || string.length() == 0) {
w.write("\"\"");
return w;
}
char b;
char c = 0;
String hhhh;
int i;
int len = string.length();
w.write('"');
for (i = 0; i < len; i += 1) {
b = c;
c = string.charAt(i);
switch (c) {
case '\\':
case '"':
w.write('\\');
w.write(c);
break;
case '/':
if (b == '<') {
w.write('\\');
}
w.write(c);
break;
case '\b':
w.write("\\b");
break;
case '\t':
w.write("\\t");
break;
case '\n':
w.write("\\n");
break;
case '\f':
w.write("\\f");
break;
case '\r':
w.write("\\r");
break;
default:
if (c < ' ' || (c >= '\u0080' && c < '\u00a0')
|| (c >= '\u2000' && c < '\u2100')) {
w.write("\\u");
hhhh = Integer.toHexString(c);
w.write("0000", 0, 4 - hhhh.length());
w.write(hhhh);
} else {
w.write(c);
}
}
}
w.write('"');
return w;
}
/**
* Remove a name and its value, if present.
*
* @param key
* The name to be removed.
* @return The value that was associated with the name, or null if there was
* no value.
*/
public Object remove(String key) {
return this.map.remove(key);
}
/**
* Determine if two JSONObjects are similar.
* They must contain the same set of names which must be associated with
* similar values.
*
* @param other The other JSONObject
* @return true if they are equal
*/
public boolean similar(Object other) {
try {
if (!(other instanceof JSONObject)) {
return false;
}
Set set = this.keySet();
if (!set.equals(((JSONObject)other).keySet())) {
return false;
}
Iterator iterator = set.iterator();
while (iterator.hasNext()) {
String name = (String)iterator.next();
Object valueThis = this.get(name);
Object valueOther = ((JSONObject)other).get(name);
if (valueThis instanceof JSONObject) {
if (!((JSONObject)valueThis).similar(valueOther)) {
return false;
}
} else if (valueThis instanceof JSONArray) {
if (!((JSONArray)valueThis).similar(valueOther)) {
return false;
}
} else if (!valueThis.equals(valueOther)) {
return false;
}
}
return true;
} catch (Throwable exception) {
return false;
}
}
/**
* Try to convert a string into a number, boolean, or null. If the string
* can't be converted, return the string.
*
* @param string
* A String.
* @return A simple JSON value.
*/
public static Object stringToValue(String string) {
Double d;
if (string.equals("")) {
return string;
}
if (string.equalsIgnoreCase("true")) {
return Boolean.TRUE;
}
if (string.equalsIgnoreCase("false")) {
return Boolean.FALSE;
}
if (string.equalsIgnoreCase("null")) {
return JSONObject.NULL;
}
/*
* If it might be a number, try converting it. If a number cannot be
* produced, then the value will just be a string.
*/
char b = string.charAt(0);
if ((b >= '0' && b <= '9') || b == '-') {
try {
if (string.indexOf('.') > -1 || string.indexOf('e') > -1
|| string.indexOf('E') > -1) {
d = Double.valueOf(string);
if (!d.isInfinite() && !d.isNaN()) {
return d;
}
} else {
Long myLong = new Long(string);
if (string.equals(myLong.toString())) {
if (myLong.longValue() == myLong.intValue()) {
return new Integer(myLong.intValue());
} else {
return myLong;
}
}
}
} catch (Exception ignore) {
}
}
return string;
}
/**
* Throw an exception if the object is a NaN or infinite number.
*
* @param o
* The object to test.
* @throws JSONException
* If o is a non-finite number.
*/
public static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double) o).isInfinite() || ((Double) o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
}
} else if (o instanceof Float) {
if (((Float) o).isInfinite() || ((Float) o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
}
}
}
}
/**
* Produce a JSONArray containing the values of the members of this
* JSONObject.
*
* @param names
* A JSONArray containing a list of key strings. This determines
* the sequence of the values in the result.
* @return A JSONArray of values.
* @throws JSONException
* If any of the values are non-finite numbers.
*/
public JSONArray toJSONArray(JSONArray names) throws JSONException {
if (names == null || names.length() == 0) {
return null;
}
JSONArray ja = new JSONArray();
for (int i = 0; i < names.length(); i += 1) {
ja.put(this.opt(names.getString(i)));
}
return ja;
}
/**
* Make a JSON text of this JSONObject. For compactness, no whitespace is
* added. If this would not result in a syntactically correct JSON text,
* then null will be returned instead.
* <p>
* Warning: This method assumes that the data structure is acyclical.
*
* @return a printable, displayable, portable, transmittable representation
* of the object, beginning with <code>{</code> <small>(left
* brace)</small> and ending with <code>}</code> <small>(right
* brace)</small>.
*/
public String toString() {
try {
return this.toString(0);
} catch (Exception e) {
return null;
}
}
/**
* Make a prettyprinted JSON text of this JSONObject.
* <p>
* Warning: This method assumes that the data structure is acyclical.
*
* @param indentFactor
* The number of spaces to add to each level of indentation.
* @return a printable, displayable, portable, transmittable representation
* of the object, beginning with <code>{</code> <small>(left
* brace)</small> and ending with <code>}</code> <small>(right
* brace)</small>.
* @throws JSONException
* If the object contains an invalid number.
*/
public String toString(int indentFactor) throws JSONException {
StringWriter w = new StringWriter();
synchronized (w.getBuffer()) {
return this.write(w, indentFactor, 0).toString();
}
}
/**
* Make a JSON text of an Object value. If the object has an
* value.toJSONString() method, then that method will be used to produce the
* JSON text. The method is required to produce a strictly conforming text.
* If the object does not contain a toJSONString method (which is the most
* common case), then a text will be produced by other means. If the value
* is an array or Collection, then a JSONArray will be made from it and its
* toJSONString method will be called. If the value is a MAP, then a
* JSONObject will be made from it and its toJSONString method will be
* called. Otherwise, the value's toString method will be called, and the
* result will be quoted.
*
* <p>
* Warning: This method assumes that the data structure is acyclical.
*
* @param value
* The value to be serialized.
* @return a printable, displayable, transmittable representation of the
* object, beginning with <code>{</code> <small>(left
* brace)</small> and ending with <code>}</code> <small>(right
* brace)</small>.
* @throws JSONException
* If the value is or contains an invalid number.
*/
public static String valueToString(Object value) throws JSONException {
if (value == null || value.equals(null)) {
return "null";
}
if (value instanceof JSONString) {
Object object;
try {
object = ((JSONString) value).toJSONString();
} catch (Exception e) {
throw new JSONException(e);
}
if (object instanceof String) {
return (String) object;
}
throw new JSONException("Bad value from toJSONString: " + object);
}
if (value instanceof Number) {
return numberToString((Number) value);
}
if (value instanceof Boolean || value instanceof JSONObject
|| value instanceof JSONArray) {
return value.toString();
}
if (value instanceof Map) {
return new JSONObject((Map) value).toString();
}
if (value instanceof Collection) {
return new JSONArray((Collection) value).toString();
}
if (value.getClass().isArray()) {
return new JSONArray(value).toString();
}
return quote(value.toString());
}
/**
* Wrap an object, if necessary. If the object is null, return the NULL
* object. If it is an array or collection, wrap it in a JSONArray. If it is
* a map, wrap it in a JSONObject. If it is a standard property (Double,
* String, et al) then it is already wrapped. Otherwise, if it comes from
* one of the java packages, turn it into a string. And if it doesn't, try
* to wrap it in a JSONObject. If the wrapping fails, then null is returned.
*
* @param object
* The object to wrap
* @return The wrapped value
*/
public static Object wrap(Object object) {
try {
if (object == null) {
return NULL;
}
if (object instanceof JSONObject || object instanceof JSONArray
|| NULL.equals(object) || object instanceof JSONString
|| object instanceof Byte || object instanceof Character
|| object instanceof Short || object instanceof Integer
|| object instanceof Long || object instanceof Boolean
|| object instanceof Float || object instanceof Double
|| object instanceof String) {
return object;
}
if (object instanceof Collection) {
return new JSONArray((Collection) object);
}
if (object.getClass().isArray()) {
return new JSONArray(object);
}
if (object instanceof Map) {
return new JSONObject((Map) object);
}
Package objectPackage = object.getClass().getPackage();
String objectPackageName = objectPackage != null ? objectPackage
.getName() : "";
if (objectPackageName.startsWith("java.")
|| objectPackageName.startsWith("javax.")
|| object.getClass().getClassLoader() == null) {
return object.toString();
}
return new JSONObject(object);
} catch (Exception exception) {
return null;
}
}
/**
* Write the contents of the JSONObject as JSON text to a writer. For
* compactness, no whitespace is added.
* <p>
* Warning: This method assumes that the data structure is acyclical.
*
* @return The writer.
* @throws JSONException
*/
public Writer write(Writer writer) throws JSONException {
return this.write(writer, 0, 0);
}
static final Writer writeValue(Writer writer, Object value,
int indentFactor, int indent) throws JSONException, IOException {
if (value == null || value.equals(null)) {
writer.write("null");
} else if (value instanceof JSONObject) {
((JSONObject) value).write(writer, indentFactor, indent);
} else if (value instanceof JSONArray) {
((JSONArray) value).write(writer, indentFactor, indent);
} else if (value instanceof Map) {
new JSONObject((Map) value).write(writer, indentFactor, indent);
} else if (value instanceof Collection) {
new JSONArray((Collection) value).write(writer, indentFactor,
indent);
} else if (value.getClass().isArray()) {
new JSONArray(value).write(writer, indentFactor, indent);
} else if (value instanceof Number) {
writer.write(numberToString((Number) value));
} else if (value instanceof Boolean) {
writer.write(value.toString());
} else if (value instanceof JSONString) {
Object o;
try {
o = ((JSONString) value).toJSONString();
} catch (Exception e) {
throw new JSONException(e);
}
writer.write(o != null ? o.toString() : quote(value.toString()));
} else {
quote(value.toString(), writer);
}
return writer;
}
static final void indent(Writer writer, int indent) throws IOException {
for (int i = 0; i < indent; i += 1) {
writer.write(' ');
}
}
/**
* Write the contents of the JSONObject as JSON text to a writer. For
* compactness, no whitespace is added.
* <p>
* Warning: This method assumes that the data structure is acyclical.
*
* @return The writer.
* @throws JSONException
*/
Writer write(Writer writer, int indentFactor, int indent)
throws JSONException {
try {
boolean commanate = false;
final int length = this.length();
Iterator keys = this.keys();
writer.write('{');
if (length == 1) {
Object key = keys.next();
writer.write(quote(key.toString()));
writer.write(':');
if (indentFactor > 0) {
writer.write(' ');
}
writeValue(writer, this.map.get(key), indentFactor, indent);
} else if (length != 0) {
final int newindent = indent + indentFactor;
while (keys.hasNext()) {
Object key = keys.next();
if (commanate) {
writer.write(',');
}
if (indentFactor > 0) {
writer.write('\n');
}
indent(writer, newindent);
writer.write(quote(key.toString()));
writer.write(':');
if (indentFactor > 0) {
writer.write(' ');
}
writeValue(writer, this.map.get(key), indentFactor,
newindent);
commanate = true;
}
if (indentFactor > 0) {
writer.write('\n');
}
indent(writer, indent);
}
writer.write('}');
return writer;
} catch (IOException exception) {
throw new JSONException(exception);
}
}
}
| [
"[email protected]"
] | |
815b9bfc126a76ff55e49f292868fe708a116c67 | 5b2c309c903625b14991568c442eb3a889762c71 | /classes/com/xueqiu/android/trade/model/SnowxTraderConfigItem.java | b383ded94b79436f8c3cf6aeb590ba06588f47e7 | [] | no_license | iidioter/xueqiu | c71eb4bcc53480770b9abe20c180da693b2d7946 | a7d8d7dfbaf9e603f72890cf861ed494099f5a80 | refs/heads/master | 2020-12-14T23:55:07.246659 | 2016-10-08T08:56:27 | 2016-10-08T08:56:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 914 | java | package com.xueqiu.android.trade.model;
import com.google.gson.annotations.Expose;
public class SnowxTraderConfigItem
{
@Expose
private String configMessage;
@Expose
private String configValue;
@Expose
private String tid;
public String getConfigMessage()
{
return this.configMessage;
}
public String getConfigValue()
{
return this.configValue;
}
public String getTid()
{
return this.tid;
}
public void setConfigMessage(String paramString)
{
this.configMessage = paramString;
}
public void setConfigValue(String paramString)
{
this.configValue = paramString;
}
public void setTid(String paramString)
{
this.tid = paramString;
}
}
/* Location: E:\apk\xueqiu2\classes-dex2jar.jar!\com\xueqiu\android\trade\model\SnowxTraderConfigItem.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"[email protected]"
] | |
bbe26d2dfe6d000cc8f4894a941ed54b1616baa3 | 9630c7c54e36bf6f1e5f6921f0890f9725f972b9 | /src/main/java/com/jxf/web/admin/sys/CommonController.java | 2f9023b5ce0af8110b4faae5f1f9a477e42d62fa | [] | no_license | happyjianguo/wyjt | df1539f6227ff38b7b7990fb0c56d20105d9c0b1 | a5de0f17db2e5e7baf25ea72159e100c656920ea | refs/heads/master | 2022-11-18T01:16:29.783973 | 2020-07-14T10:32:42 | 2020-07-14T10:32:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,400 | java | package com.jxf.web.admin.sys;
import java.io.File;
import java.io.IOException;
import java.security.interfaces.RSAPublicKey;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import com.jxf.mms.consts.MmsConstant;
import com.jxf.mms.msg.SendSmsMsgService;
import com.jxf.mms.msg.utils.VerifyCodeUtils;
import com.jxf.mms.record.entity.MmsSmsRecord;
import com.jxf.mms.record.service.MmsSmsRecordService;
import com.jxf.svc.config.Global;
import com.jxf.svc.model.JsonpRsp;
import com.jxf.svc.model.Message;
import com.jxf.svc.security.rsa.RSAService;
import com.jxf.svc.servlet.Servlets;
import com.jxf.svc.servlet.ValidateCodeServlet;
import com.jxf.svc.sys.area.entity.Area;
import com.jxf.svc.sys.area.service.AreaService;
import com.jxf.svc.sys.image.entity.Image;
import com.jxf.svc.sys.image.service.ImageService;
import com.jxf.svc.utils.CalendarUtil;
import com.jxf.svc.utils.FileUploadUtils;
import com.jxf.svc.utils.JsonpUtils;
import com.jxf.svc.utils.StringUtils;
import com.jxf.web.model.ResponseData;
/**
*
* @类功能说明: 公用
* @类修改者:
* @修改日期:
* @修改说明:
* @公司名称:北京金信服科技有限公司
* @作者:Administrator
* @创建时间:2016年12月19日 上午10:56:53
* @版本:V1.0
*/
@Controller("adminCommonController")
@RequestMapping(value="${adminPath}/common")
public class CommonController {
@Autowired
private RSAService rsaService;
@Autowired
private AreaService areaService;
@Autowired
private SendSmsMsgService sendSmsMsgService;
@Autowired
private MmsSmsRecordService mmsSmsRecordService;
@Autowired
private ImageService imageService;
/**
* 公钥
*/
@RequestMapping(value = "/public_key", method = RequestMethod.GET)
public @ResponseBody
Map<String, String> publicKey(HttpServletRequest request) {
RSAPublicKey publicKey = rsaService.generateKey(request);
Map<String, String> data = new HashMap<String, String>();
data.put("modulus", Base64.encodeBase64String(publicKey.getModulus().toByteArray()));
data.put("exponent", Base64.encodeBase64String(publicKey.getPublicExponent().toByteArray()));
return data;
}
/**
* 地区
*/
@RequestMapping(value = "/area", method = RequestMethod.GET)
public @ResponseBody
ResponseData area(Long parentId) {
List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
Area parent = areaService.get(parentId);
Collection<Area> areas = parent != null ? areaService.getChildren(parent) : areaService.getRoot();
for (Area area : areas) {
Map<String, Object> item = new HashMap<String, Object>();
item.put("name", area.getName());
item.put("value", area.getId());
data.add(item);
}
return ResponseData.success("success",data);
}
/**
* 验证图形验证码
*/
@RequestMapping(value="checkImageCaptcha")
public void checkImageCaptcha(HttpServletRequest req, HttpServletResponse response,HttpSession session) {
JsonpRsp jsonpRsp = new JsonpRsp();
String checkcode = req.getParameter("image_captcha");
String code = (String)session.getAttribute(ValidateCodeServlet.VALIDATE_CODE);
if(!checkcode.toUpperCase().equals(code)){
jsonpRsp.setObj("验证码错误,请重新填写!");
jsonpRsp.setErrno(-1);
}else{
jsonpRsp.setErrno(0);
}
JsonpUtils.callback(req, response, jsonpRsp);
}
/**
* 发送短信验证码
*/
@ResponseBody
@RequestMapping(value="sendSMSCaptcha")
public Message sendSMSCaptcha(HttpServletRequest request, HttpServletResponse response,HttpSession session){
String phoneNo = request.getParameter("phoneNo");
String msgType = request.getParameter("msgType");
//生成验证码
String smsCode = VerifyCodeUtils.genSmsValidCode();
//将验证码存入session中
request.getSession().setAttribute(VerifyCodeUtils.SMS_CODE+phoneNo, smsCode);
sendSmsMsgService.sendSms(msgType,phoneNo,smsCode);
return Message.success("发送成功");
}
/**
* 验证短信验证码
*/
@RequestMapping(value="checkSMSCaptcha")
public void checkSMSCaptcha(HttpServletRequest req, HttpServletResponse response,HttpSession session){
JsonpRsp jsonpRsp = new JsonpRsp();
String phoneNo = req.getParameter("mobile");
String captcha = req.getParameter("captcha");
String msgType = req.getParameter("msgType");
MmsSmsRecord smsRecord = mmsSmsRecordService.getSendedVerifyCode(msgType,phoneNo, captcha);
if(smsRecord == null){
jsonpRsp.setErrno(-1);
jsonpRsp.setObj("短信验证码错误");
}else{
if(CalendarUtil.addSecond(smsRecord.getSendTime(), MmsConstant.SMS_OUTTIME).before(new Date())){
jsonpRsp.setErrno(-1);
jsonpRsp.setObj("短信验证码过期");
}else{
jsonpRsp.setErrno(0);
jsonpRsp.setObj(smsRecord.getId());
}
}
JsonpUtils.callback(req, response, jsonpRsp);
}
/**
* 上传图标
*
* @return result
*/
@RequestMapping("uploadIcon")
@ResponseBody
public ResponseData uploadIcon(MultipartHttpServletRequest multiRequest) {
Map<String, Object> result = new HashMap<String, Object>();
try {
// 获取多个文件
for (Iterator<String> it = multiRequest.getFileNames(); it.hasNext(); ) {
// 文件名
String key = (String) it.next();
// 根据key得到文件
MultipartFile multipartFile = multiRequest.getFile(key);
if (multipartFile.getSize() <= 0) {
continue;
}
String extension = FilenameUtils.getExtension(multipartFile.getOriginalFilename());
File tempFile = new File(FileUtils.getTempDirectory(), UUID.randomUUID() + ".tmp");
multipartFile.transferTo(tempFile);
String imageUploadPath = FileUploadUtils.upload(tempFile, "icon", "image", extension);
result.put("image", imageUploadPath);
}
} catch (IllegalStateException | IOException e) {
e.printStackTrace();
}
return ResponseData.success("上传成功", result);
}
/**
* 上传图片
*
* @return result
*/
@RequestMapping("uploadArticleImage")
@ResponseBody
public ResponseData uploadArticleImage(MultipartHttpServletRequest multiRequest) {
Map<String, Object> result = new HashMap<String, Object>();
// 获取多个文件
for (Iterator<String> it = multiRequest.getFileNames(); it.hasNext(); ) {
// 文件名
String key = (String) it.next();
// 根据key得到文件
MultipartFile imageFile = multiRequest.getFile(key);
if (imageFile.getSize() <= 0) {
continue;
}
Image image = new Image();
image.setFile(imageFile);
image.setDir("/article");
image.setAsync(false);
imageService.generate(image);
result.put("image", image.getImagePath());
}
return ResponseData.success("上传成功", result);
}
/**
* 上传图片
*
* @return result
*/
@RequestMapping("uploadArbitrationImage")
@ResponseBody
public ResponseData uploadArbitrationImage(MultipartHttpServletRequest multiRequest) {
Map<String, Object> result = new HashMap<String, Object>();
String imageUploadPath = "";
// 获取多个文件
try {
for (Iterator<String> it = multiRequest.getFileNames(); it.hasNext(); ) {
// 文件名
String key = (String) it.next();
// 根据key得到文件
MultipartFile multipartFile = multiRequest.getFile(key);
if (multipartFile.getSize() <= 0) {
continue;
}
String extension = FilenameUtils.getExtension(multipartFile.getOriginalFilename()).toLowerCase();
File tempFile = new File(FileUtils.getTempDirectory(), UUID.randomUUID() + ".tmp");
multipartFile.transferTo(tempFile);
String filePath = Global.getConfig("domain")+Servlets.getRequest().getContextPath()+FileUploadUtils.upload(tempFile, "arbitrationProof", "image", extension);
imageUploadPath = imageUploadPath + filePath + ",";
}
} catch (IllegalStateException | IOException e) {
return ResponseData.error("图片上传错误");
}
result.put("image", StringUtils.substring(imageUploadPath, 0, imageUploadPath.lastIndexOf(",")));
return ResponseData.success("上传成功", result);
}
/**
* 上传视频
* @param multiRequest
* @return
* @throws Exception
*/
@RequestMapping("uploadVideo")
@ResponseBody
public ResponseData upload(MultipartHttpServletRequest multiRequest) throws Exception {
Map<String, Object> result = new HashMap<String, Object>();
try {
// 获取多个文件
for (Iterator<String> it = multiRequest.getFileNames(); it.hasNext(); ) {
// 文件名
String key = (String) it.next();
// 根据key得到文件
MultipartFile multipartFile = multiRequest.getFile(key);
if (multipartFile.getSize() <= 0) {
continue;
}
String extension = FilenameUtils.getExtension(multipartFile.getOriginalFilename());
File tempFile = new File(FileUtils.getTempDirectory(), UUID.randomUUID() + ".tmp");
multipartFile.transferTo(tempFile);
String videoUploadPath = FileUploadUtils.upload(tempFile, "video", "video", extension);
result.put("video", videoUploadPath);
}
} catch (IllegalStateException | IOException e) {
e.printStackTrace();
}
return ResponseData.success("上传成功", result);
}
} | [
"[email protected]"
] | |
e82d50b49e77d7332488eef16ae761652de7c74a | 55286976be14bb6fd441b67f79f7a3256e93f91c | /Project4/src/inf22/bitly/command/LoginCommand.java | 698b0fc0f3f4e6387c93f331410a29e125b43413 | [] | no_license | taithienbo/urlShortenerSystem | 962273f2784bab82cb89296d7d3e13855c363034 | bd0e8f10aeb15c1ee9f2303d491ef1d48602520f | refs/heads/master | 2020-04-06T06:51:50.828109 | 2013-02-20T23:53:21 | 2013-02-21T01:05:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 276 | java | package inf22.bitly.command;
import inf22.bitly.result.AbstractResult;
import inf22.bitly.state.State;
public class LoginCommand implements AbstractCommand
{
@Override
public AbstractResult execute(State state) {
// TODO Auto-generated method stub
return null;
}
}
| [
"[email protected]"
] | |
4d5ca90d7e79faa7784a5bb8e010252ba62f0389 | 126b90c506a84278078510b5979fbc06d2c61a39 | /src/ANXCamera/sources/com/color/compat/net/ConnectivityManagerNative.java | 2ea6036d654e7916ac82b49be7f0969041ad9863 | [] | no_license | XEonAX/ANXRealCamera | 196bcbb304b8bbd3d86418cac5e82ebf1415f68a | 1d3542f9e7f237b4ef7ca175d11086217562fad0 | refs/heads/master | 2022-08-02T00:24:30.864763 | 2020-05-29T14:01:41 | 2020-05-29T14:01:41 | 261,256,968 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,536 | java | package com.color.compat.net;
import android.net.ConnectivityManager;
import android.os.Handler;
import android.util.Log;
import com.color.inner.net.ConnectivityManagerWrapper;
import com.color.util.UnSupportedApiVersionException;
import com.color.util.VersionUtils;
import java.util.List;
public class ConnectivityManagerNative {
private static final String TAG = "ConnManagerNative";
public interface OnStartTetheringCallbackNative {
void onTetheringFailed();
void onTetheringStarted();
}
private ConnectivityManagerNative() {
}
public static List<String> readArpFile(ConnectivityManager connectivityManager) {
try {
return ConnectivityManagerWrapper.readArpFile(connectivityManager);
} catch (Throwable th) {
Log.e(TAG, th.toString());
return null;
}
}
public static void setVpnPackageAuthorization(String str, int i, boolean z) {
try {
ConnectivityManagerWrapper.setVpnPackageAuthorization(str, i, z);
} catch (Throwable th) {
Log.e(TAG, th.toString());
}
}
public static void startTethering(ConnectivityManager connectivityManager, int i, boolean z, final OnStartTetheringCallbackNative onStartTetheringCallbackNative, Handler handler) {
try {
ConnectivityManagerWrapper.OnStartTetheringCallbackWrapper onStartTetheringCallbackWrapper = null;
if (VersionUtils.isQ()) {
if (onStartTetheringCallbackNative != null) {
onStartTetheringCallbackWrapper = new ConnectivityManagerWrapper.OnStartTetheringCallbackWrapper() {
public void onTetheringFailed() {
onStartTetheringCallbackNative.onTetheringFailed();
}
public void onTetheringStarted() {
onStartTetheringCallbackNative.onTetheringStarted();
}
};
}
ConnectivityManagerWrapper.startTethering(connectivityManager, i, z, onStartTetheringCallbackWrapper, handler);
} else if (VersionUtils.isN()) {
if (onStartTetheringCallbackNative != null) {
onStartTetheringCallbackWrapper = new ConnectivityManager.OnStartTetheringCallback() {
public void onTetheringFailed() {
onStartTetheringCallbackNative.onTetheringFailed();
}
public void onTetheringStarted() {
onStartTetheringCallbackNative.onTetheringStarted();
}
};
}
connectivityManager.startTethering(i, z, onStartTetheringCallbackWrapper, handler);
} else {
throw new UnSupportedApiVersionException();
}
} catch (Throwable th) {
Log.e(TAG, th.toString());
}
}
public static void stopTethering(ConnectivityManager connectivityManager, int i) {
try {
if (VersionUtils.isQ()) {
ConnectivityManagerWrapper.stopTethering(connectivityManager, i);
} else if (VersionUtils.isN()) {
connectivityManager.stopTethering(i);
} else {
throw new UnSupportedApiVersionException();
}
} catch (Throwable th) {
Log.e(TAG, th.toString());
}
}
}
| [
"[email protected]"
] | |
94fb64df36c583e3d56cb188c16cd528b70f5d5e | 9b664f13978672bb3fbb666fb585a0a0556e6a3e | /com.kin207.zn.web/src/main/java/com/hd/service/gh/WorkContentManager.java | 9a40b588d9269f8a6b4da94e09c16b7166dfb204 | [] | no_license | lihaibozi/javaCode | aa36de6ae160e4278bc0d718881db9abbb5c39c0 | 1fa50e7c88545cfa9d9cd1579d21b1725eef7239 | refs/heads/master | 2020-03-29T18:11:30.894495 | 2018-12-27T03:55:16 | 2018-12-27T03:55:16 | 150,198,657 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,391 | java | package com.hd.service.gh;
import java.util.List;
import com.hd.entity.Page;
import com.hd.util.PageData;
/** 科室信息接口类
* @author lihaibo
* 修改时间:2018.10.26
*/
public interface WorkContentManager {
/**科室信息列表
* @param page
* @return
* @throws Exception
*/
public List<PageData> workcontentList (Page page)throws Exception;
public List<PageData> workcontents(PageData pd) throws Exception ;
/**通过id获取数据
* @param pd
* @return
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception;
/**修改数据
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception;
public void save(PageData pd) throws Exception;
public void delete(PageData pd) throws Exception;
public void deleteAll(String[] ids) throws Exception;
public List<PageData> getDeps(PageData pd) throws Exception;
public List<PageData> getworkcontentBydepHos(PageData pd) throws Exception;
public List<PageData> getworkcontents(PageData pd) throws Exception;
public List<PageData> findByScheduleId(PageData pd)throws Exception;
public void deleteFilePath(PageData pd) throws Exception;
public List<PageData> researchWrokContent(Page page)throws Exception;
public void addOpinion(PageData pd) throws Exception;
public List<PageData> zkWrokContent(Page page)throws Exception;
}
| [
"[email protected]"
] | |
0b40d41e97b719b5d04319575364ab28ad036c89 | 9d4766278acfe37053e890be8f23694ac1c339ee | /src/main/java/com/udacity/jdnd/course3/critter/user/repository/EmployeeRepository.java | 51efd387f5988ff66996183b9d24563d5583083d | [] | no_license | btran-developer/udacity_critter_chronologer | 7fed05eeac358b6c85ca9ab8e4e1477c63c0c17e | bd48581aae45930077c5f6ad59c0cea170bb55bb | refs/heads/master | 2022-12-22T17:25:35.982232 | 2020-09-10T23:26:39 | 2020-09-10T23:26:39 | 294,544,648 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 585 | java | package com.udacity.jdnd.course3.critter.user.repository;
import com.udacity.jdnd.course3.critter.user.entity.Employee;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.time.DayOfWeek;
import java.util.List;
@Repository
public interface EmployeeRepository extends JpaRepository<Employee, Long> {
@Query("select e from Employee e where :day member of e.daysAvailable")
List<Employee> findEmployeeAvailableForServiceByDayOfWeek(DayOfWeek day);
}
| [
"[email protected]"
] | |
ebf357f1b5b93046378796ab18c81a5e399e7a13 | f39da8943819ffa95b47d8ca73f9a6ea87bcbb3e | /app/src/main/java/com/example/android/notesapplication/Fragments/DetailFragment.java | 96f06146d51761c1b0c52ac6a0bf3cd1b2f5a73a | [] | no_license | geekanamika/NotesApplication | 193b9239748cf39d98e510d46554ed65194e1237 | 10d5b3c4ff16531d226fc72620c060aea1596684 | refs/heads/master | 2021-07-08T21:27:49.625853 | 2017-10-06T14:38:54 | 2017-10-06T14:38:54 | 106,013,848 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,625 | java | package com.example.android.notesapplication.Fragments;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.android.notesapplication.R;
public class DetailFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
public DetailFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment DetailFragment.
*/
// TODO: Rename and change types and number of parameters
public static DetailFragment newInstance(String param1, String param2) {
DetailFragment fragment = new DetailFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_detail, container, false);
}
}
| [
"[email protected]"
] | |
4960d079fca2e322d1fdcfa018e62e4989e5727e | 7c11fa420a6ecb67e0a2e74ee55422917e20e695 | /app/src/main/java/com/bin/studentmanager/utils/FileUtils.java | 324bb0fa4cc53bd9e74187eb08a91c30fdbfb951 | [] | no_license | xlbin/StudentManager_OpenCV_Java4 | 511aeb2cc799a0ebfd6ae8eb1603876afb0d704d | fe7fab9a01f46c5cbcc2c6ae0f87bff47dfa00b6 | refs/heads/master | 2020-03-14T12:10:41.390013 | 2018-04-30T14:43:07 | 2018-04-30T14:43:07 | 131,568,122 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,006 | java | package com.bin.studentmanager.utils;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Environment;
import android.util.Log;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
/**
* Created by xiaolang on 2018/3/24.
*/
public class FileUtils {
private static final String FILE_FOLDER =
Environment.getExternalStorageDirectory().getAbsolutePath()
+ File.separator + "faces" + File.separator + "data";
private static final String FILE_CSV = "about_data.csv";
public static void saveCSV(String filename) {
// String storePath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "faces";
// File file = new File(storePath);
// File file=new File("E:\\faces\\db_PEAL");
File file = new File(filename);
//打开faces目录
String faces = filename+ File.separator + "db_PEAL";
File mFacesFile = new File(faces);
File[] files=mFacesFile.listFiles();
// File csv = context.getDir("csv", Context.MODE_PRIVATE);
// File mCsvFile = new File(csv, "at.txt");
// 首先保存图片
String csv = filename+ File.separator+"at.txt";
File mCsvFile = new File(csv);
if (!mCsvFile.exists()) {
try {
mCsvFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
try {
// FileOutputStream os = new FileOutputStream(mCsvFile);
FileOutputStream os = new FileOutputStream(mCsvFile);
String s;
for(File f : files) {
s = f.getAbsolutePath()+";"+f.getName().substring(0, 4)+"\n";
os.write(s.getBytes());
}
Log.d("test", os.toString());
os.close();
} catch(Exception e) {
e.printStackTrace();
}
}
public ArrayList<String> refreshFileList(String strPath, ArrayList<String> wechats) {
String filename;//文件名
String suf;//文件后缀
File dir = new File(strPath);//文件夹dir
File[] files = dir.listFiles();//文件夹下的所有文件或文件夹
if (files == null)
return null;
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory())
{
System.out.println("---" + files[i].getAbsolutePath());
refreshFileList(files[i].getAbsolutePath(), wechats);//递归文件夹!!!
}
else {
filename = files[i].getName();
int j = filename.lastIndexOf(".");
suf = filename.substring(j+1);//得到文件后缀
if(suf.equalsIgnoreCase("amr"))//判断是不是msml后缀的文件
{
String strFileName = files[i].getAbsolutePath().toLowerCase();
wechats.add(files[i].getAbsolutePath());//对于文件才把它的路径加到filelist中
}
}
}
return wechats;
}
static int numbers = 000000;
//保存文件到指定路径
public static boolean saveImageToGallery(Context context, Bitmap bmp) {
// 首先保存图片
String storePath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "faces//db_PEAL";
File appDir = new File(storePath);
if (!appDir.exists()) {
appDir.mkdir();
}
String fileName = "1041"+String.format("%02d",numbers) + ".jpg"; File file = new File(appDir, fileName);
numbers++;
try {
FileOutputStream fos = new FileOutputStream(file);
//通过io流的方式来压缩保存图片
boolean isSuccess = bmp.compress(Bitmap.CompressFormat.JPEG, 60, fos);
fos.flush();
fos.close();
//把文件插入到系统图库
// MediaStore.Images.Media.insertImage(context.getContentResolver(), file.getAbsolutePath(), fileName, null);
// 保存图片后发送广播通知更新数据库
Uri uri = Uri.fromFile(file);
context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri));
if (isSuccess) {
return true;
} else {
return false;
}
} catch (IOException e) {
e.printStackTrace();
} return false;
}
//保存文件到指定路径
public static boolean saveImageToGallery(Context context, Bitmap bmp, int n1, int n2) {
// 首先保存图片
String storePath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "faces//db_PEAL";
File appDir = new File(storePath);
if (!appDir.exists()) {
appDir.mkdir();
}
String fileName = String.format("%04d",n1)+String.format("%02d",n2) + ".jpg"; File file = new File(appDir, fileName);
try {
FileOutputStream fos = new FileOutputStream(file);
//通过io流的方式来压缩保存图片
boolean isSuccess = bmp.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.flush();
fos.close();
//把文件插入到系统图库
// MediaStore.Images.Media.insertImage(context.getContentResolver(), file.getAbsolutePath(), fileName, null);
// 保存图片后发送广播通知更新数据库
Uri uri = Uri.fromFile(file);
context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri));
if (isSuccess) {
return true;
} else {
return false;
}
} catch (IOException e) {
e.printStackTrace();
} return false;
}
}
| [
"[email protected]"
] | |
32ecd9c9d64c97466a360021c304b10c890795a3 | a8d5ff68abf0951313c4c1fc19be73d09ca5a24f | /main/java/com/example/demo/repository/HelloRepository.java | eb0260a4c362308a048022cdc4946f4b69454097 | [] | no_license | fernandonguyen/Junit-Mock | b09db01391ad7d04aabff2fcfb978283488f6119 | b3aaa0a7176ba1913aabe77fd39db08d7d4a3d48 | refs/heads/master | 2022-04-24T09:01:06.516633 | 2020-04-26T03:32:09 | 2020-04-26T03:32:09 | 258,929,838 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 99 | java | package com.example.demo.repository;
public interface HelloRepository{
public String get();
}
| [
"[email protected]"
] | |
73912673f9944c499b79d0595640c45128bbf51d | 3b1206648485806c988ac23e6f0f5377b2ac540f | /app/src/main/java/com/example/android/bakingtime/data/Contract.java | ffc80ed8b9b25c94d0a103c7b59a876441412ccb | [] | no_license | HarunJr/Baking-Time | f1458465382eb9d9b3afa72f8827514c58045827 | 4b2c65f72b7a854fa51117ce1360ad3a564a91ad | refs/heads/master | 2021-05-10T16:20:32.423588 | 2018-01-26T07:02:05 | 2018-01-26T07:02:05 | 118,572,323 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,913 | java | package com.example.android.bakingtime.data;
import android.content.ContentResolver;
import android.net.Uri;
import android.provider.BaseColumns;
public class Contract {
// The "Content authority" is a name for the entire content provider, similar to the
// relationship between a domain name and its website. A convenient string to use for the
// content authority is the package name for the app, which is guaranteed to be unique on the
// device.
static final String CONTENT_AUTHORITY = "com.example.android.bakingtime";
// Use CONTENT_AUTHORITY to create the base of all URI's which apps will use to contact
// the content provider.
private static final Uri BASE_CONTENT_URI = Uri.parse("content://" + CONTENT_AUTHORITY);
// Possible paths (appended to base content URI for possible URI's)
static final String PATH_RECIPE = "recipe";
static final String PATH_INGREDIENTS = "ingredients";
static final String PATH_STEPS = "steps";
public static final class RecipeEntry {
public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath(PATH_RECIPE).build();
static final String CONTENT_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE + "/" + CONTENT_AUTHORITY + "/" + PATH_RECIPE;
// public static final String CONTENT_ITEM_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE + "/" + CONTENT_AUTHORITY + "/" + PATH_MOVIE;
public static final String TABLE_NAME = "recipe";
public static final String COLUMN_RECIPE_ID = "id";
public static final String COLUMN_RECIPE_NAME= "name";
public static final String COLUMN_RECIPE_SERVING= "servings";
public static final String COLUMN_RECIPE_IMAGE= "image";
}
public static final class IngredientEntry implements BaseColumns{
public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath(PATH_INGREDIENTS).build();
static final String CONTENT_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE + "/" + CONTENT_AUTHORITY + "/" + PATH_INGREDIENTS;
public static final String TABLE_NAME = "ingredient_table";
public static final String COLUMN_RECIPE_KEY = "recipe_key";
public static final String COLUMN_QUANTITY = "quantity";
public static final String COLUMN_MEASURE = "measure";
public static final String COLUMN_INGREDIENT = "ingredient";
public static Uri buildKeyUri(int recipeKey) {
return CONTENT_URI.buildUpon()
.appendPath(String.valueOf(recipeKey))
.build();
}
public static int getRecipeKeyFromUri(Uri uri) {return Integer.parseInt(uri.getPathSegments().get(1));}
}
public static final class StepsEntry implements BaseColumns{
public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath(PATH_STEPS).build();
static final String CONTENT_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE + "/" + CONTENT_AUTHORITY + "/" + PATH_STEPS;
public static final String CONTENT_ITEM_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE + "/" + CONTENT_AUTHORITY + "/" + PATH_STEPS;
public static final String TABLE_NAME = "steps";
public static final String COLUMN_ID = "id";
public static final String COLUMN_RECIPE_KEY = "recipe_key";
public static final String COLUMN_SHORT_DESC = "shortDescription";
public static final String COLUMN_DESCRIPTION = "description";
public static final String COLUMN_VIDEO_URL = "videoURL";
public static final String COLUMN_THUMBNAIL_URL = "thumbnailURL";
public static Uri buildKeyUri(int id) {
return CONTENT_URI.buildUpon()
.appendPath(String.valueOf(id))
.build();
}
public static int getKeyIdFromUri(Uri uri) {return Integer.parseInt(uri.getPathSegments().get(1));}
}
}
| [
"[email protected]"
] | |
ef6d897046f1a7c3e26c0ebec547b3c8488f0e1a | 7c3caea671dc84b553e44ea62af86970e7801305 | /app/src/androidTest/java/com/example/administrator/android_animation_tween/ApplicationTest.java | f1a160a692fb9cde3ff9cf6972f31b76d21a4418 | [] | no_license | liyiJiang/Android_animation_tween | ef4c50e18d65b11ec0fa5c3639c7532e33af40e6 | 2d07ea47b7dffba00c45b9256a6d67fe68b75d75 | refs/heads/master | 2021-01-12T15:17:10.758423 | 2016-10-24T02:55:20 | 2016-10-24T02:55:20 | 71,741,077 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 380 | java | package com.example.administrator.android_animation_tween;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"[email protected]"
] | |
0a7dca773ebb34c349f809640bc3a0f4a105252d | 4bf9ea8553b332b3239bfe7a84bd28dc0539ca81 | /src/test/java/ParserJsonTest.java | bcb56d925f5c17a76207f697dc4cd0bc8fbd6d3c | [] | no_license | flackyang/mysql-parser | c70e4345e7313af4a2497a1afa51566c01af0fb9 | b8a0292c66e00a31fce035d304b33354c7c03e1a | refs/heads/master | 2021-05-09T20:33:09.413243 | 2017-05-09T03:00:19 | 2017-05-09T03:00:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,182 | java | import com.github.hackerwin7.mysql.parser.protocol.json.ConfigJson;
import net.sf.json.JSONObject;
import com.github.hackerwin7.mysql.parser.parser.utils.ParserConfig;
/**
* Created by hp on 14-11-14.
*/
public class ParserJsonTest {
public static void main(String[] args) {
ParserConfig configer = new ParserConfig();
ConfigJson configJson = new ConfigJson("jd-mysql-parser-1");
JSONObject jRoot = configJson.getJson();
if(jRoot != null) {
JSONObject jContent = jRoot.getJSONObject("info").getJSONObject("content");
configer.setHbaseRootDir(jContent.getString("HbaseRootDir"));
configer.setHbaseDistributed(jContent.getString("HbaseDistributed"));
configer.setHbaseZkQuorum(jContent.getString("HbaseZKQuorum"));
configer.setHbaseZkPort(jContent.getString("HbaseZKPort"));
configer.setDfsSocketTimeout(jContent.getString("DfsSocketTimeout"));
}
System.out.println(configer.getHbaseRootDir()+","+configer.getHbaseDistributed()+"," +
configer.getHbaseZkQuorum()+","+configer.getHbaseZkPort()+","+configer.getDfsSocketTimeout());
}
}
| [
"[email protected]"
] | |
e3507c8b2afb571cdbf97b4f6e0636062948ae2f | df5e404747be479cc80e1cec49ff6608519595fe | /APS/Exercicios/TorrentzFilmes/src/br/com/torrentz/app/AuxPlano.java | bc6fdb8ebe0a42e6d2ae79d17d6532d17cf75dfa | [
"MIT"
] | permissive | lucasDEV20/ADS--3- | e35a7d1c92343ac1548a103442e7b559be0e7b4e | bc7464eb08c0707de7d3dc99fec5a17aef73bc34 | refs/heads/master | 2023-03-15T23:02:01.233179 | 2021-03-06T03:13:35 | 2021-03-06T03:13:35 | 284,832,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 24,079 | java | package br.com.torrentz.app;
//import br.com.marcosjob.bll.FabricanteBll;
//import br.com.marcosjob.model.Fabricante;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
public class AuxPlano extends javax.swing.JFrame {
private DefaultTableModel tbl = new DefaultTableModel();
// private FabricanteBll bll = new FabricanteBll();
// Fabricante model = new Fabricante();
public AuxPlano() throws Exception {
CriarTable();
// read();
initComponents();
this.setLocationRelativeTo(rootPane);
// jTable.getTableHeader().setFont(new java.awt.Font("Dialog", 0, 18));
// estadoInicialComponentes();
}
public void estadoInicialComponentes() {
btnUpdateAux.setEnabled(false);
btnDelete.setEnabled(false);
txtAuxNome.setEnabled(false);
btnUpdate.setEnabled(false);
}
private void CriarTable() {
jTable = new JTable(tbl);
tbl.addColumn("Código");
tbl.addColumn("Nome");
tbl.addColumn("Acessos Simultâneos");
tbl.addColumn("Preço R$");
}
public void read() throws Exception {
// try {
// tbl.setNumRows(0);
// List<Fabricante> listModel = new ArrayList<>();
// listModel = bll.read();
//
// if (listModel.size() > 0) {
// for (int i = 0; i < listModel.size(); i++) {
// tbl.addRow(new Object[]{
// listModel.get(i).getId_fabricante(),
// listModel.get(i).getNome()
// });
// }
// } else {
// tbl.setNumRows(0);
// }
//
// } catch (Exception e) {
// JOptionPane.showMessageDialog(rootPane, e);
// }
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jTabbedOpcoes = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jTable = new javax.swing.JTable();
btnDelete = new javax.swing.JButton();
btnUpdate = new javax.swing.JButton();
txtAuxNome = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jTextFieldPesquisar = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jLabel4 = new javax.swing.JLabel();
btnUpdateAux = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
txtAuxAcessos = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
txtAuxPreco = new javax.swing.JTextField();
jPanel2 = new javax.swing.JPanel();
btnIncluir = new javax.swing.JButton();
txtNome = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
txtAcessos = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
txtPreco = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Torrentz Fimes | Cadastro Planos");
jTabbedOpcoes.setFont(new java.awt.Font("Dialog", 0, 16)); // NOI18N
jTable.setFont(new java.awt.Font("Dialog", 0, 16));
jTable.setModel(tbl);
jTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_NEXT_COLUMN);
jTable.setAutoscrolls(false);
jTable.setRowHeight(50);
jTable.setShowHorizontalLines(false);
jTable.setShowVerticalLines(false);
jTable.getTableHeader().setResizingAllowed(false);
jTable.getTableHeader().setReorderingAllowed(false);
jTable.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
jTableMousePressed(evt);
}
});
jScrollPane1.setViewportView(jTable);
btnDelete.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
btnDelete.setText("Excluir");
btnDelete.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteActionPerformed(evt);
}
});
btnUpdate.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
btnUpdate.setText("Salvar");
btnUpdate.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateActionPerformed(evt);
}
});
txtAuxNome.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
jLabel2.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel2.setText("Pesquisar");
jTextFieldPesquisar.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
jLabel3.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel3.setText("Nome");
jLabel4.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel4.setText("Campos editáveis");
btnUpdateAux.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
btnUpdateAux.setText("Editar");
btnUpdateAux.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateAuxActionPerformed(evt);
}
});
jLabel5.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel5.setText("Acessos Simultâneos");
txtAuxAcessos.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
jLabel6.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel6.setText("Preço R$");
txtAuxPreco.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
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()
.addComponent(jSeparator1)
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(btnUpdateAux, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(btnDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap(16, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 661, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(16, 16, 16))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(26, 26, 26)
.addComponent(jLabel2)
.addGap(18, 18, 18)
.addComponent(jTextFieldPesquisar, javax.swing.GroupLayout.PREFERRED_SIZE, 523, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel5)
.addGap(18, 18, 18)
.addComponent(txtAuxAcessos, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel6)
.addGap(18, 18, 18)
.addComponent(txtAuxPreco))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel3)
.addGap(18, 18, 18)
.addComponent(txtAuxNome)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addGap(22, 22, 22))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(31, 31, 31)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jTextFieldPesquisar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(28, 28, 28)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(27, 27, 27)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnDelete)
.addComponent(btnUpdateAux))
.addGap(18, 18, 18)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4)
.addGap(30, 30, 30)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(txtAuxNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(30, 30, 30)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(txtAuxAcessos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(26, 26, 26)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(txtAuxPreco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnUpdate))
.addContainerGap())
);
jTabbedOpcoes.addTab("Editar / Excluir", jPanel1);
btnIncluir.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
btnIncluir.setText("Incluir");
btnIncluir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnIncluirActionPerformed(evt);
}
});
txtNome.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
jLabel7.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel7.setText("Acessos Simultâneos");
txtAcessos.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
jLabel8.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel8.setText("Nome");
jLabel9.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel9.setText("Preço R$");
txtPreco.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(187, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel7)
.addGap(18, 18, 18)
.addComponent(txtAcessos))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel9)
.addGap(18, 18, 18)
.addComponent(txtPreco))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel8)
.addGap(18, 18, 18)
.addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(btnIncluir, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(188, 188, 188))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(203, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(30, 30, 30)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(txtAcessos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(26, 26, 26)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel9)
.addComponent(txtPreco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(68, 68, 68)
.addComponent(btnIncluir)
.addGap(168, 168, 168))
);
jTabbedOpcoes.addTab("Incluir", jPanel2);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(jTabbedOpcoes, javax.swing.GroupLayout.PREFERRED_SIZE, 695, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(30, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(jTabbedOpcoes, javax.swing.GroupLayout.PREFERRED_SIZE, 662, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(30, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnIncluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIncluirActionPerformed
// try {
// model.setNome(jTextFieldCreateNome.getText());
// bll.create(model);
// JOptionPane.showMessageDialog(rootPane, model.getNome()
// + " cadastrado com sucesso!");
// read();
// jTextFieldCreateNome.setText("");
//
// } catch (Exception e) {
// e.getMessage();
// }
}//GEN-LAST:event_btnIncluirActionPerformed
private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteActionPerformed
// try {
// model.setId_fabricante(Integer.parseInt(jTable.getValueAt(
// jTable.getSelectedRow(), 0).toString()));
// bll.delete(model);
// estadoInicialComponentes();
// read();
//
// } catch (Exception e) {
// JOptionPane.showMessageDialog(rootPane, e);
// }
}//GEN-LAST:event_btnDeleteActionPerformed
private void btnUpdateAuxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateAuxActionPerformed
// jButtonUpdate.setEnabled(true);
// jTextFieldAuxNome.setEnabled(true);
// jTextFieldAuxNome.setText(jTable.getValueAt(
// jTable.getSelectedRow(), 1).toString());
}//GEN-LAST:event_btnUpdateAuxActionPerformed
private void jTableMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableMousePressed
// jButtonUpdateAux.setEnabled(true);
// jButtonDelete.setEnabled(true);
}//GEN-LAST:event_jTableMousePressed
private void btnUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateActionPerformed
// try {
// model.setId_fabricante(Integer.parseInt(jTable.getValueAt(
// jTable.getSelectedRow(), 0).toString()));
// model.setNome(jTextFieldAuxNome.getText());
// bll.update(model);
// jTextFieldAuxNome.setText("");
// estadoInicialComponentes();
// read();
// } catch (Exception e) {
// e.getMessage();
// }
}//GEN-LAST:event_btnUpdateActionPerformed
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(AuxPlano.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(AuxPlano.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(AuxPlano.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(AuxPlano.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
new AuxPlano().setVisible(true);
} catch (Exception ex) {
Logger.getLogger(AuxPlano.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnDelete;
private javax.swing.JButton btnIncluir;
private javax.swing.JButton btnUpdate;
private javax.swing.JButton btnUpdateAux;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JTabbedPane jTabbedOpcoes;
private javax.swing.JTable jTable;
private javax.swing.JTextField jTextFieldPesquisar;
private javax.swing.JTextField txtAcessos;
private javax.swing.JTextField txtAuxAcessos;
private javax.swing.JTextField txtAuxNome;
private javax.swing.JTextField txtAuxPreco;
private javax.swing.JTextField txtNome;
private javax.swing.JTextField txtPreco;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
d8025d92185eb0b8eea2c392a6ab6294e3c870cf | 1f031ccfd9f3ca311a440f442125f10a51740aa7 | /app/src/main/java/com/example/guessthecelebrityapplication/MainActivity.java | ce7af876057e909bf0ac3c33a6523138d34ccfae | [] | no_license | hamza-albanaa1/GuessTheCelebrit | 459b46d6e1c6c159d428df715e9bb8c8a954428a | 87343976d4ae2d72b71a1fb622a6e279d2dd44d8 | refs/heads/master | 2020-07-25T03:52:31.099686 | 2019-09-12T22:31:33 | 2019-09-12T22:31:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,390 | java | package com.example.guessthecelebrityapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MainActivity extends AppCompatActivity {
ArrayList<String> celebURLs = new ArrayList<String>();
ArrayList<String> celebNames = new ArrayList<String>();
//for choice and answers
int chosencleb = 0;
String[] forAnswers = new String[4];
int locationOfCorrect = 0;
public void celebChosen (View view){
if(view.getTag().toString().equals(Integer.toString(locationOfCorrect))){
Toast.makeText(getApplicationContext(), "Correct ", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(getApplicationContext(), "Wrong It was "+celebNames.get(chosencleb), Toast.LENGTH_SHORT).show();
}
newQuestion();
}
//download Image
public class imageDownloader extends AsyncTask<String,Void, Bitmap>{
@Override
protected Bitmap doInBackground(String... urls) {
try{
URL url = new URL(urls[0]);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.connect();
InputStream inputStream = connection.getInputStream();
Bitmap myBitmap = BitmapFactory.decodeStream(inputStream);
return myBitmap;
}catch (Exception e){
e.printStackTrace();
return null;
}
}
}
//download
public class DownloadTask extends AsyncTask<String,Void,String>{
@Override
protected String doInBackground(String... urls) {
String result ="";
URL url;
HttpURLConnection urlConnection = null;
try {
url = new URL(urls[0]);
urlConnection = (HttpURLConnection) url.openConnection();
InputStream in = urlConnection.getInputStream();
InputStreamReader reader = new InputStreamReader(in);
int data = reader.read();
while (data != -1){
char current = (char) data;
result += current;
data = reader.read();
}
return result;
}catch (Exception e){
e.printStackTrace();
return null;
}
}
}
public void newQuestion(){
try{
//random question
Random random = new Random();
//for choice random
chosencleb = random.nextInt(celebURLs.size());
//setup Image
imageDownloader imagedownloader = new imageDownloader();
Bitmap celebImage = imagedownloader.execute(celebURLs.get(chosencleb)).get();
imageView.setImageBitmap(celebImage); // set image
//for location answer
locationOfCorrect = random.nextInt(4);
int incorrectAnswer ;
for (int i = 0 ; i <4;i++){
if(i == locationOfCorrect){
forAnswers[i] =celebNames.get(chosencleb);
}else{
incorrectAnswer = random.nextInt(celebURLs.size());
forAnswers[i]=celebNames.get(incorrectAnswer);
while (incorrectAnswer == chosencleb);
incorrectAnswer = random.nextInt(celebURLs.size());
}
}
button0.setText(forAnswers[0]);
button1.setText(forAnswers[1]);
button2.setText(forAnswers[2]);
button3.setText(forAnswers[3]);
}catch(Exception e){
e.printStackTrace();
}
}
ImageView imageView;
Button button0;
Button button1;
Button button2;
Button button3;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageView = findViewById(R.id.imageView);
button0 = findViewById(R.id.button0);
button1 = findViewById(R.id.button1);
button2 = findViewById(R.id.button2);
button3 = findViewById(R.id.button3);
DownloadTask task = new DownloadTask();
String result = null;
try{
result = task.execute("http://www.posh24.se/kandisar").get();
//split
String[] splitResult = result.split("<div class=\"listedArticle\">");
Pattern p = Pattern.compile("<img src=\"(.*?)\"");
Matcher m = p.matcher(splitResult[0]);
while (m.find()){
celebURLs.add(m.group(1));
}
p = Pattern.compile("alt=\"(.*?)\"");
m = p.matcher(splitResult[0]);
while (m.find()){
celebNames.add(m.group(1));
}
newQuestion();
}catch(Exception e){
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
4c416f77a988b583ae7cc609b5ca0bdf9b40ff37 | d6eb2140757e89a47def8c1d67b8f09b334b8740 | /3.6/AdmofiAndroidAdapters/src/com/admofi/sdk/lib/and/adapters/CustomAdaptermillennialmedia.java | 49915c273397f8cf1bf315ced1ededa588fe9dd0 | [] | no_license | SAI-KIRAN-K/ADMOFI | d5ec286cdbefd00796cf1e289a1d16cc629ab7fa | d95994caee7610d1860b3287535315e53b202c78 | refs/heads/master | 2021-08-23T15:12:27.072435 | 2017-12-05T10:51:02 | 2017-12-05T10:51:02 | 112,732,072 | 0 | 0 | null | 2017-12-01T12:06:19 | 2017-12-01T11:22:29 | null | UTF-8 | Java | false | false | 8,720 | java | package com.admofi.sdk.lib.and.adapters;
import android.app.Activity;
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.RelativeLayout;
import com.admofi.sdk.lib.and.AdmofiAd;
import com.admofi.sdk.lib.and.AdmofiConstants;
import com.admofi.sdk.lib.and.AdmofiUtil;
import com.admofi.sdk.lib.and.AdmofiView;
import com.millennialmedia.AppInfo;
import com.millennialmedia.InlineAd;
import com.millennialmedia.InlineAd.InlineErrorStatus;
import com.millennialmedia.InlineAd.InlineListener;
import com.millennialmedia.InterstitialAd;
import com.millennialmedia.InterstitialAd.InterstitialErrorStatus;
import com.millennialmedia.InterstitialAd.InterstitialListener;
import com.millennialmedia.MMException;
import com.millennialmedia.MMSDK;
public class CustomAdaptermillennialmedia extends CustomAdapterImpl {
private InterstitialAd interAD = null;
private RelativeLayout adRelativeLayout;
private InterstitialAd interstitalAd = null;
public CustomAdaptermillennialmedia(Context context) {
super(context);
}
public void loadAd(Handler loadingCompletedHandler, AdmofiView madView, AdmofiAd mAdShown, String sAdIdentifier) {
super.loadAd(loadingCompletedHandler, madView, mAdShown, sAdIdentifier);
try {
Class.forName("com.millennialmedia.InlineAd");
} catch (Exception e) {
super.setSupported(false);
adEventLoadFailed(AdmofiConstants.ADM_TPFAILED_EXCEPTION);
return;
}
super.setSupported(true);
if(mAdShown.getAdType() == AdmofiConstants.AD_TYPE_BANNER) {
loadBanner(super.mContext, mAdShown);
} else if(mAdShown.getAdType() == AdmofiConstants.AD_TYPE_INTERSTITIAL) {
loadInterstitial(super.mContext, mAdShown);
} else {
adEventLoadFailed(AdmofiConstants.ADM_TPFAILED_UNKNOWN);
}
}
private void loadBanner(final Context context, AdmofiAd mAdCurrent)
{
try
{
MMSDK.initialize((Activity)context);
AppInfo appInfo = new AppInfo();
// Only applicable if migrating from Nexage
appInfo.setSiteId(mAdCurrent.getAdapterKey(1));
MMSDK.setAppInfo(appInfo);
AdmofiUtil.logMessage("admofi mmedia: ", Log.DEBUG, "admofi mmedia : load banner");
final InlineAd adView;
int width = mAdCurrent.getWidth();
int height= mAdCurrent.getHeight();
adRelativeLayout = new RelativeLayout(context);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(width,height);
adRelativeLayout.setLayoutParams(layoutParams);
adView = InlineAd.createInstance ( mAdCurrent.getAdapterKey(0), (ViewGroup) adRelativeLayout);
//The AdRequest instance is used to pass additional metadata to the server to improve ad selection
final InlineAd.InlineAdMetadata inlineAdMetadata = new InlineAd.InlineAdMetadata().setAdSize(InlineAd.AdSize.BANNER);
adView.request(inlineAdMetadata);
adView.setListener(new InlineListener() {
@Override
public void onResized(InlineAd paramInlineAd, int paramInt1, int paramInt2,
boolean paramBoolean) {
}
@Override
public void onResize(InlineAd paramInlineAd, int paramInt1, int paramInt2)
{
}
@Override
public void onRequestSucceeded(InlineAd paramInlineAd)
{
try
{
if(mContext!=null){
((Activity)mContext).runOnUiThread(new Runnable()
{
@Override
public void run()
{
try {
if(adRelativeLayout!=null) {
AdmofiUtil.logMessage("admofi mmedia: ", Log.DEBUG, "admofi mmedia : onRequestSucceeded ");
adEventReady(adRelativeLayout);
}
} catch (Exception e) {
e.printStackTrace();
adEventLoadFailed(AdmofiConstants.ADM_TPFAILED_EXCEPTION);
}
}
});
}
}
catch (Exception e)
{
e.printStackTrace();
adEventLoadFailed(AdmofiConstants.ADM_TPFAILED_EXCEPTION);
}
}
@Override
public void onRequestFailed(InlineAd paramInlineAd,InlineErrorStatus paramInlineErrorStatus)
{
AdmofiUtil.logMessage("admofi mmedia: ", Log.DEBUG, "admofi mmedia : onRequestFailed :: " + paramInlineErrorStatus.getDescription() + "::" + paramInlineErrorStatus.getErrorCode());
adEventLoadFailed(AdmofiConstants.ADM_TPFAILED_NOFILL);
}
@Override
public void onExpanded(InlineAd paramInlineAd)
{
// TODO Auto-generated method stub
}
@Override
public void onCollapsed(InlineAd paramInlineAd)
{
// TODO Auto-generated method stub
}
@Override
public void onClicked(InlineAd paramInlineAd)
{
adEventClicked();
}
@Override
public void onAdLeftApplication(InlineAd paramInlineAd)
{
// TODO Auto-generated method stub
}
});
}
catch (Exception e)
{
AdmofiUtil.logMessage("admofi mmedia: ", Log.DEBUG, "admofi mmedia : failed with exception " + e.getMessage());
adEventLoadFailed(AdmofiConstants.ADM_TPFAILED_EXCEPTION);
}
}
private void loadInterstitial(Context context, AdmofiAd mAdCurrent) {
try {
AdmofiUtil.logMessage("admofi mmedia: ", Log.DEBUG, "admofi mmedia : load inter");
MMSDK.initialize((Activity) context);
AppInfo appInfo = new AppInfo();
appInfo.setSiteId(mAdCurrent.getAdapterKey(1));
MMSDK.setAppInfo(appInfo);
System.out.println("admofi mmedia id::"+mAdCurrent.getAdapterKey(0));
interAD = InterstitialAd.createInstance(mAdCurrent.getAdapterKey(0));
InterstitialAd.InterstitialAdMetadata interstitialAdMetadata = new InterstitialAd.InterstitialAdMetadata();
interAD.setListener(new InterstitialListener() {
@Override
public void onShown(InterstitialAd paramInterstitialAd) {
AdmofiUtil.logMessage("admofi mmedia: ", Log.DEBUG, "admofi mmedia : onShown ");
}
@Override
public void onShowFailed(InterstitialAd paramInterstitialAd,
InterstitialErrorStatus paramInterstitialErrorStatus) {
AdmofiUtil.logMessage("admofi mmedia: ", Log.DEBUG, "admofi mmedia : onShowFailed :: " + paramInterstitialErrorStatus);
}
@Override
public void onLoaded(InterstitialAd paramInterstitialAd) {
if(paramInterstitialAd!=null && paramInterstitialAd.isReady()){
AdmofiUtil.logMessage("admofi mmedia: ", Log.DEBUG, "admofi mmedia : onLoaded :: " + paramInterstitialAd.isReady());
adEventReady(null);
}
}
@Override
public void onLoadFailed(InterstitialAd paramInterstitialAd,
InterstitialErrorStatus paramInterstitialErrorStatus) {
try {
AdmofiUtil.logMessage("admofi mmedia: ", Log.DEBUG, "admofi mmedia : onLoadFailed :: " + paramInterstitialErrorStatus.getDescription());
if(paramInterstitialErrorStatus.getErrorCode() == InterstitialErrorStatus.LOAD_FAILED){
adEventLoadFailed(AdmofiConstants.ADM_TPFAILED_NOFILL);
} else {
adEventLoadFailed(AdmofiConstants.ADM_TPFAILED_UNKNOWN);
}
} catch (Exception e) {
e.printStackTrace();
adEventLoadFailed(AdmofiConstants.ADM_TPFAILED_EXCEPTION);
}
}
@Override
public void onExpired(InterstitialAd paramInterstitialAd) {
AdmofiUtil.logMessage("admofi mmedia: ", Log.DEBUG, "admofi mmedia : onExpired :: ");
}
@Override
public void onClosed(InterstitialAd paramInterstitialAd) {
AdmofiUtil.logMessage("admofi mmedia: ", Log.DEBUG, "admofi mmedia : onClosed");
adEventCompleted();
}
@Override
public void onClicked(InterstitialAd paramInterstitialAd) {
adEventClicked();
}
@Override
public void onAdLeftApplication(InterstitialAd paramInterstitialAd) {
// TODO Auto-generated method stub
}
});
interAD.load(context, interstitialAdMetadata);
} catch (Exception e) {
adEventLoadFailed(AdmofiConstants.ADM_TPFAILED_EXCEPTION);
}
}
@Override
public boolean showinterstitial() {
try {
if((getAd().getAdType() == AdmofiConstants.AD_TYPE_INTERSTITIAL) && (mContext!=null) && (interAD!=null) && (interAD.isReady())) {
adEventImpression();
try {
interAD.show(mContext);
} catch (MMException e) {
e.printStackTrace();
}
return true;
}
} catch (Exception e) {
return false;
}
return false;
}
protected boolean canFit(int adWidth,Context context) {
try {
int adWidthPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, adWidth, context.getResources().getDisplayMetrics());
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
return metrics.widthPixels >= adWidthPx;
} catch (Exception e) {
return false;
}
}
} | [
"[email protected]"
] | |
184269b45b5b631d7f1c2943440fac3277bb3510 | 1ec994d0d929051d2ef63c3d45d8af7a7603b006 | /app/src/test/java/com/hackernews/reader/news/NewsAdapterActivity.java | 450701772819a17248de9f6e767504ff2e6ded74 | [] | no_license | HassanUsman/HackerNews-MVM-Espresso-Robolectric-Data-Binding-RxJava-RxAndroid-Dagger | 523ee68c2aea2204b6be93a4b26be71a751f160d | 21e8ea98f9e9c2ff621e790f60bc1af709a2c3e4 | refs/heads/master | 2021-09-08T05:05:52.675001 | 2018-03-07T10:07:18 | 2018-03-07T10:07:18 | 116,226,468 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,091 | java | package com.hackernews.reader.news;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.hackernews.reader.R;
import com.hackernews.reader.news.NewsAdapter;
import com.hackernews.reader.data.news.NewsItem;
import java.util.ArrayList;
public class NewsAdapterActivity extends AppCompatActivity implements NewsAdapter.Callback{
public NewsAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_news_adapter);
}
public void setNewsItem(ArrayList<NewsItem> newsItem){
adapter = new NewsAdapter(newsItem,this);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.newsList);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);
adapter.notifyDataSetChanged();
}
@Override
public void onItemClick(int position) {
}
}
| [
"[email protected]"
] | |
ddfc457af75071bc5c1c7eae423dd029ea6913fa | c82e242bb65a6abe6638d0542fb0e370e8d959d5 | /src/com/itcast/web/servlet/ServletDemo1.java | f1b354aabe44e71fd794a194713ad14eb925d239 | [] | no_license | zb666/TomcatProject | ec030b9c2fc82bacdee01b32d4be677f345367f9 | 8b498d62b8cb1122212ec2b35530b874b1a09ca8 | refs/heads/master | 2022-12-26T21:35:42.767588 | 2020-10-05T07:08:47 | 2020-10-05T07:08:47 | 301,315,034 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 735 | java | package com.itcast.web.servlet;
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;
@WebServlet({"/demo1","/demo2","/demo3"})
public class ServletDemo1 implements Servlet {
@Override
public void init(ServletConfig servletConfig) throws ServletException {
}
@Override
public ServletConfig getServletConfig() {
return null;
}
@Override
public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
System.out.println("Service 3.0 来了");
}
@Override
public String getServletInfo() {
return null;
}
@Override
public void destroy() {
}
}
| [
"[email protected]"
] | |
90dfe40c6f94f52ecbebc116ead2527fc9b339f6 | 09eaa46b4fddeb990fb94312bd9d0e8c2dada07c | /Shop/src/java/controller/CartServlet.java | 254d439edf3a0472c33c6f6002393b482791bf4b | [] | no_license | dinhuy6695/Show | 479d0df93715754dabee5220e527f138e1c5a1dc | 8be353661b87e98c1bbb84bc870978fdb6ce3bdf | refs/heads/master | 2021-09-01T00:08:41.368824 | 2017-12-23T17:41:39 | 2017-12-23T17:41:39 | 115,211,003 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,972 | java | package controller;
import dao.ProductDAO;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import model.Cart;
import model.Item;
import model.Product;
public class CartServlet extends HttpServlet {
private final ProductDAO productDAO = new ProductDAO();
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
HttpSession session = request.getSession();
String command = request.getParameter("command");
String productID = request.getParameter("productID");
Cart cart = (Cart) session.getAttribute("cart");
try {
Long idProduct = Long.parseLong(productID);
Product product = productDAO.getProduct(idProduct);
switch (command) {
case "plus":
if (cart.getCartItems().containsKey(idProduct)) {
cart.plusToCart(idProduct,
new Item(product,cart.getCartItems().get(idProduct).getQuantity()));
} else {
cart.plusToCart(idProduct, new Item(product, 1));
}
break;
case "remove":
cart.removeToCart(idProduct);
break;
}
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/Shop/Index.jsp");
}
session.setAttribute("cart", cart);
response.sendRedirect("/Shop/Index.jsp");
}
}
| [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.