blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
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
132 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
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
d7915dc77a99819f439e06dc5d897659dd632fb7
c339a4029bf68302936cb4c64cdc5676b6c0228b
/com.hydra.project.MyPlugin_Nebula/src/com/hydra/project/myplugin_nebula/xviewer/XViewerPreComputedColumnAdapter.java
9f8ed3529ddab676384e23e0e4f57297bdeee418
[]
no_license
burkhardpoehler/hydra
3feabbe5a261d8cefe2ffcb72dd87d4c859a2821
c270bfd210404e9b7323738e32ffe462da81bfa0
refs/heads/master
2021-01-10T19:58:31.975025
2017-11-05T17:14:18
2017-11-05T17:14:18
33,044,739
0
0
null
null
null
null
UTF-8
Java
false
false
375
java
/* * Created on May 19, 2015 * * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE */ package com.hydra.project.myplugin_nebula.xviewer; /** * @author Donald G. Dunne */ public abstract class XViewerPreComputedColumnAdapter implements IXViewerPreComputedColumn { @Override public String getText(Object obj, Long key, String cachedValue) { return null; } }
[ "burkhard.poehler@googlemail.com" ]
burkhard.poehler@googlemail.com
537ff0b3276d575e558b5879dee0d034119ecab1
394bcec663a49a2b381c6a8fca8eb334e8debd27
/src/ClassificationRunner.java
de30f6e28f8010ce98bdb8947ccb3c78b383b8d0
[]
no_license
preetisi/Ensemble-Method-Milestone-5
c21f9f5dc2ca502c345daf1016df9dbaabe819a2
7f7b51be9e5c87325b9f3e0ce0f130c1e32fbebe
refs/heads/master
2020-05-30T15:40:46.119223
2015-08-14T10:53:30
2015-08-14T10:53:30
40,710,389
0
0
null
null
null
null
UTF-8
Java
false
false
8,617
java
import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintStream; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Random; import java.util.SortedMap; import java.util.TreeMap; import weka.classifiers.Classifier; import weka.classifiers.Evaluation; import weka.classifiers.bayes.NaiveBayes; import weka.classifiers.functions.SMO; import weka.classifiers.meta.AdaBoostM1; import weka.classifiers.meta.Vote; import weka.classifiers.trees.J48; import weka.core.Instances; import weka.core.converters.ConverterUtils.DataSource; public class ClassificationRunner { final static String[] OLD_DATASETS = { "anneal", "audiology", "autos", "balance-scale", "breast-cancer", "colic", "credit-a", "diabetes", "glass", "heart-c", "hepatitis", "hypothyroid2" }; final static String[] NEW_DATASETS = { "anneal", "audiology", "autos", "balance-scale", "breast-cancer", "colic", "credit-a", "diabetes", "glass", "heart-c", "hepatitis", "hypothyroid2", "ionosphere", "labor", "lymph", "mushroom", "segment", "sonar", "soybean", "splice", "vehicle", "vote", "vowel", "zoo" }; final static String[] NEW_RAND_B_DATASETS = { "arrhythmia", "breast-w", "car", "cmc", "credit-g", "cylinder-bands", "dermatology", "ecoli", "flags", "haberman", "heart-h", "heart-statlog", "kr-vs-kp", "liver-disorders", "mfeat-factors", "mfeat-fourier", "mfeat-karhunen", "primary-tumor", "sick", "spambase" }; // final static Class<?>[] CLASSIFIERS = { SMO.class, // MultilayerPerceptron.class, AdaBoostM1.class }; final static Class<?>[] L5_CLASSIFIER = { Vote.class }; final static Class<?>[] LB_CLASSIFIER = { AdaBoostM1.class }; final static Class<? extends Classifier> NB_CLASSIFIER = NaiveBayes.class; final static String[] EXAMPLE_DATASET = { "anneal" }; final static Class<?>[] EXAMPLE_CLASSIFIER = { SMO.class }; final String dataDir; final String outputDir; final String[] dataSets; final Class<?>[] classifierClasses; public ClassificationRunner(String dataDir, String outputDir, String[] dataSets, Class<?>[] classifiersClasses) { this.dataDir = dataDir; this.outputDir = outputDir; this.dataSets = dataSets; this.classifierClasses = classifiersClasses; } public static void main(String[] args) throws Exception { if (args.length < 3) { System.err .println("Usage: ClassificationRunner <data dir> <output dir> <'old' or 'new' or 'm5b'>"); } else { String[] datasets; if ("old".equals(args[2])) { datasets = OLD_DATASETS; } else if ("new".equals(args[2])) { datasets = NEW_DATASETS; } else if ("m5b".equals(args[2])) { datasets = NEW_RAND_B_DATASETS; } else { System.err .println("Usage: ClassificationRunner <data dir> <output dir> <'old' or 'new' or 'm5b'>"); return; } new ClassificationRunner(args[0], args[1], datasets, L5_CLASSIFIER).runClassifiers(); } } static String formatClassiferName(String fullClassifierName) { String[] nameParts = fullClassifierName.split("\\."); return nameParts[nameParts.length - 1]; } static void runExampleClassifier(String dataDir) throws Exception { ClassificationRunner runner = new ClassificationRunner(dataDir, dataDir, EXAMPLE_DATASET, EXAMPLE_CLASSIFIER); runner.runClassifiers(); } void runClassifiers() throws Exception { SortedMap<String, Collection<ClassifierResult>> results = new TreeMap<String, Collection<ClassifierResult>>(); for (String dataSet : this.dataSets) { System.out.printf("Running dataset '%s'\n", dataSet); Instances trainingData = getTrainingInstances(dataDir, dataSet); Instances testingData = getTestingInstances(dataDir, dataSet); ClassifierResult nbResult = runClassifier(trainingData, testingData, NB_CLASSIFIER); // Each classifier will be run on the dataset and results stored. List<ClassifierResult> classifierResults = new ArrayList<ClassifierResult>( classifierClasses.length); for (Class<?> classifierClass : this.classifierClasses) { System.out.printf("\tRunning classifier: %s...\n", classifierClass.getSimpleName()); ClassifierResult result = runClassifier(trainingData, testingData, classifierClass); result.setRatioResult(nbResult); classifierResults.add(result); } results.put(dataSet, classifierResults); } outputResults(outputDir, getBestResults(results)); } static Instances getTrainingInstances(String dataDir, String dataSet) throws Exception { return getInstances(dataDir, dataSet, true/* isTraining */); } static Instances getTestingInstances(String dataDir, String dataSet) throws Exception { return getInstances(dataDir, dataSet, false/* isTraining */); } /** * Returns the instances for a dataset. * * @param dataDir * the root directory containing the dataset arff file * @param dataSet * the name of the dataset * @param isTraining * whether this is a training or testing dataset. */ static Instances getInstances(String dataDir, String dataSet, boolean isTraining) throws Exception { String datasetRootName = dataDir + "/" + dataSet; String trainingDataPath = datasetRootName + (isTraining ? "_train.arff" : "_test.arff"); DataSource inputData = new DataSource(trainingDataPath); Instances instances = inputData.getDataSet(); if (instances.classIndex() == -1) { instances.setClassIndex(instances.numAttributes() - 1); } return instances; } static String getModelOutputPath(String dataDir, String dataSet) { String datasetRootName = dataDir + "/" + dataSet; return datasetRootName + ".model"; } static void outputSummaryResults(Collection<ClassifierResult> bestResults) { // Find the mean error rate. double totalErrorRatio = 0; for (ClassifierResult result : bestResults) { totalErrorRatio += result.getErrorRatio(); } double meanErrorRatio = (totalErrorRatio / bestResults.size()); System.out.printf("Mean error ratio: %f\n", meanErrorRatio); ClassifierResult maxResult = Collections.max(bestResults); System.out.printf("Max error ratio: %f\n", maxResult.getErrorRatio()); } static EvaluationResult getError(Classifier model, Instances trainData, Instances testData) throws Exception { // Evaluate on the test dataset. Evaluation eval = new Evaluation(trainData); double[] predictions = new double[30]; //double[] predictions = eval.evaluateModel(model, testData); eval.crossValidateModel(model, trainData, 10, new Random()); return new EvaluationResult(eval.errorRate(), predictions); } protected void outputResults(String outputDir, SortedMap<String, ClassifierResult> results) throws FileNotFoundException, IOException { System.out.println("Outputting all models to " + outputDir); for (Entry<String, ClassifierResult> dataResultsEntry : results.entrySet()) { String dataSet = dataResultsEntry.getKey(); ClassifierResult bestResult = dataResultsEntry.getValue(); // Output model for best result. System.out.printf("Best error ratio: %f (%s)\n", bestResult.getErrorRatio(), bestResult.getName()); bestResult.outputModel(getModelOutputPath(outputDir, dataSet)); // Output predictions from chosen model. String outputFilePath = outputDir + "/" + dataSet + ".predict"; PrintStream outputStream = new PrintStream(outputFilePath); bestResult.outputPredictions(outputStream); outputStream.close(); } outputSummaryResults(results.values()); } /** * Get the best result for each dataset. */ protected SortedMap<String, ClassifierResult> getBestResults( Map<String, Collection<ClassifierResult>> results) { SortedMap<String, ClassifierResult> bestResults = new TreeMap<String, ClassifierResult>(); for (Entry<String, Collection<ClassifierResult>> dataResultsEntry : results.entrySet()) { Collection<ClassifierResult> dataResults = dataResultsEntry.getValue(); // For each dataset, get the result with the lowest error rate. bestResults.put(dataResultsEntry.getKey(), Collections.min(dataResults)); } return bestResults; } protected ClassifierResult runClassifier(Instances trainingData, Instances testingData, Class<?> classifier) throws Exception { Classifier model = Classifier.forName(classifier.getName(), null); if (model instanceof AdaBoostM1) { ((AdaBoostM1) model).setClassifier(new J48()); } model.buildClassifier(trainingData); EvaluationResult result = getError(model, trainingData, testingData); return new ClassifierResult(result, model); } }
[ "singhpreeti236@gmail.com" ]
singhpreeti236@gmail.com
d570665136e8da99c3922176de3ad0eaadcdeac9
a74a4e5e4fb90f39952768da6687f8f75a382736
/JAVACODES/src/TypeCasting/class_1_2.java
0f2eda947df3616d14f66a5a4b1ab83ae5a06a4c
[]
no_license
AdityaMohan06/JAVACODES
fef6328008536246d44a5333c1286f7c7538d486
19296318c50ea171e7f3df6e737f2101c024dd0c
refs/heads/master
2016-09-12T13:25:36.679123
2016-04-20T09:27:26
2016-04-20T09:27:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
185
java
package TypeCasting; public class class_1_2 { public static void main(String[] args) { long a=1,b=6; long c=(int)a*b; System.out.println(c); } }
[ "aditya060690@rediffmail.com" ]
aditya060690@rediffmail.com
406283722dee39066f49fd6eac8f1bb809fbd6b3
eb9920b75ad2acbc9976dc0bc78a6ef0c454d317
/app/src/main/java/com/example/myapplication/Student.java
a4d9ee44063badecb52f60a5062538adace108a4
[]
no_license
thanhhong593/DoanThiThanhHong_Lab6
4cdb964c6b9063007ec5edebce3becedd3c64a0f
95f51085223fd1b730171a98e5630d7d0722a250
refs/heads/main
2023-04-18T09:48:18.559609
2021-05-05T10:19:36
2021-05-05T10:19:36
364,536,164
0
0
null
null
null
null
UTF-8
Java
false
false
1,219
java
package com.example.myapplication; public class Student { int id; String name; String address; String phone_number; public Student(int id, String name, String address, String phone_number) { super(); this.id = id; this.name = name; this.address = address; this.phone_number = phone_number; } public Student(String name, String address, String phone_number) { super(); this.name = name; this.address = address; this.phone_number = phone_number; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getPhone_number() { return phone_number; } public void setPhone_number(String phone_number) { this.phone_number = phone_number; } @Override public String toString() { return "" + name ; } }
[ "thanhhong593@gmail.com" ]
thanhhong593@gmail.com
ea1dd373d53d5e106dcb812aa8f99fac8777175d
4e0f734106d6733a3f2478ca6b35e629705ec0e1
/debt/src/main/java/com/zhichangan/debt/dic/service/impl/DicServiceImp.java
dc7b658855370985edde3ed1eb975ec31ad26139
[]
no_license
zhq1/debt
4a147e81de510e07fc01a859654e95334daee8e7
4a9f6784b5ea202f1d9ee8bc577b4fa406274ba7
refs/heads/master
2023-07-17T21:14:09.364785
2021-08-20T00:09:15
2021-08-20T00:09:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
436
java
package com.zhichangan.debt.dic.service.impl; import com.zhichangan.debt.dic.entity.Dic; import com.zhichangan.debt.dic.mapper.DicMapper; import com.zhichangan.debt.dic.service.DicService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class DicServiceImp implements DicService { @Autowired private DicMapper dicMapper; }
[ "Liuheer@outlook.com" ]
Liuheer@outlook.com
7bb281b1e98685c6548d496fa64653c95eaeaaf9
e1d928d38b0abe6be9d1cc22347de8d06c74436e
/jmetal-component/src/test/java/org/uma/jmetal/component/algorithm/multiobjective/SMPSOBuilderIT.java
77a75782dc5a71246ae54c3f2aab69dab99881b8
[ "MIT" ]
permissive
dongzhiming/jMetal
d8132386af6988e38fa399f2ea02076f93af7075
7a40faa22298291ff155137a838da8bed9a7f8f4
refs/heads/master
2023-01-03T03:59:20.787752
2022-12-23T09:34:23
2022-12-23T09:34:23
185,506,721
0
0
MIT
2022-02-04T06:22:47
2019-05-08T01:44:46
Java
UTF-8
Java
false
false
4,423
java
package org.uma.jmetal.component.algorithm.multiobjective; import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; import java.util.List; import org.junit.jupiter.api.Test; import org.uma.jmetal.component.algorithm.ParticleSwarmOptimizationAlgorithm; import org.uma.jmetal.component.catalogue.common.evaluation.Evaluation; import org.uma.jmetal.component.catalogue.common.evaluation.impl.SequentialEvaluationWithArchive; import org.uma.jmetal.component.catalogue.common.termination.Termination; import org.uma.jmetal.component.catalogue.common.termination.impl.TerminationByEvaluations; import org.uma.jmetal.operator.mutation.impl.PolynomialMutation; import org.uma.jmetal.problem.Problem; import org.uma.jmetal.problem.ProblemFactory; import org.uma.jmetal.problem.doubleproblem.DoubleProblem; import org.uma.jmetal.qualityindicator.QualityIndicator; import org.uma.jmetal.qualityindicator.impl.hypervolume.impl.PISAHypervolume; import org.uma.jmetal.solution.doublesolution.DoubleSolution; import org.uma.jmetal.util.NormalizeUtils; import org.uma.jmetal.util.SolutionListUtils; import org.uma.jmetal.util.VectorUtils; import org.uma.jmetal.util.archive.Archive; import org.uma.jmetal.util.archive.impl.BestSolutionsArchive; import org.uma.jmetal.util.archive.impl.NonDominatedSolutionListArchive; class SMPSOBuilderIT { @Test void SMPSOWithDefaultSettingsReturnsAFrontWithHVHigherThanZeroPointSixtyFiveOnProblemZDT4() { String problemName = "org.uma.jmetal.problem.multiobjective.zdt.ZDT4"; Problem<DoubleSolution> problem = ProblemFactory.<DoubleSolution>loadProblem(problemName); int swarmSize = 100; Termination termination = new TerminationByEvaluations(25000); ParticleSwarmOptimizationAlgorithm smpso = new SMPSOBuilder( (DoubleProblem) problem, swarmSize) .setTermination(termination) .build(); smpso.run(); double[][] referenceFront = new double[][]{{0.0, 1.0}, {1.0, 0.0}}; QualityIndicator hypervolume = new PISAHypervolume(referenceFront); double[][] normalizedFront = NormalizeUtils.normalize( SolutionListUtils.getMatrixWithObjectiveValues(smpso.getResult()), NormalizeUtils.getMinValuesOfTheColumnsOfAMatrix(referenceFront), NormalizeUtils.getMaxValuesOfTheColumnsOfAMatrix(referenceFront)); double hv = hypervolume.compute(normalizedFront); assertThat(smpso.getResult()).hasSizeGreaterThan(95); assertThat(hv).isGreaterThan(0.65); } @Test void SMPSOWithExternalUnboundedArchiveReturnsAFrontWithHVHigherThanZeroPointThirtyFiveOnProblemDTLZ2() throws IOException { String problemName = "org.uma.jmetal.problem.multiobjective.dtlz.DTLZ2"; String referenceFrontFileName = "DTLZ2.3D.csv"; Problem<DoubleSolution> problem = ProblemFactory.<DoubleSolution>loadProblem(problemName); double mutationProbability = 1.0 / problem.numberOfVariables(); double mutationDistributionIndex = 20.0; var mutation = new PolynomialMutation(mutationProbability, mutationDistributionIndex); int swarmSize = 100; Termination termination = new TerminationByEvaluations(50000); Archive<DoubleSolution> archive = new BestSolutionsArchive<>( new NonDominatedSolutionListArchive<>(), swarmSize); Evaluation<DoubleSolution> evaluation = new SequentialEvaluationWithArchive<>(problem, archive); ParticleSwarmOptimizationAlgorithm smpso = new SMPSOBuilder( (DoubleProblem) problem, swarmSize) .setTermination(termination) .setEvaluation(evaluation) .build(); smpso.run(); List<DoubleSolution> obtainedSolutions = archive.solutions(); String referenceFrontFile = "../resources/referenceFrontsCSV/" + referenceFrontFileName; double[][] referenceFront = VectorUtils.readVectors(referenceFrontFile, ","); QualityIndicator hypervolume = new PISAHypervolume(referenceFront); double[][] normalizedFront = NormalizeUtils.normalize( SolutionListUtils.getMatrixWithObjectiveValues(obtainedSolutions), NormalizeUtils.getMinValuesOfTheColumnsOfAMatrix(referenceFront), NormalizeUtils.getMaxValuesOfTheColumnsOfAMatrix(referenceFront)); double hv = hypervolume.compute(normalizedFront); assertThat(obtainedSolutions).hasSizeGreaterThan(95); assertThat(hv).isGreaterThan(0.35); } }
[ "ajnebro@users.noreply.github.com" ]
ajnebro@users.noreply.github.com
dfeb8ccef89df0460107e36f719bf4c1d70bbbcc
c82f2819a7d93f09499889fd9f3121e6b3c3fc90
/Principal/src/principal/Counter.java
5f6abaf2022f66d1377e43a9be5be530d349f9f6
[]
no_license
iaghoCristian/Raposas-e-Coelhos
6bf7cead9e6a21015bf973767a2559170841dc2c
b74438065e6c3c41cf408e74cefa603fda742bf8
refs/heads/master
2022-04-05T12:42:16.484394
2020-02-12T17:26:44
2020-02-12T17:26:44
240,070,574
0
0
null
null
null
null
UTF-8
Java
false
false
1,194
java
package principal; /** * Faz um contador para um participante na simulacao. * Esta classe inclui uma string de identificacao e um contador * de quantos participantes deste tipo existem na simulacao. * @author Iagho_Joseane_Tulio. * @version 05-12-2018. */ public class Counter{ /** Um nome para um tipo na simulacao.*/ private String name; /** Quantos deste tipo existem na simulacao.*/ private int count; /** * Cria um contado para cada tipo e atribui um nome a ele. * @param name Um nome, e.g. "Fox". */ public Counter(String name){ this.name = name; count = 0; } /** * Consulta uma descricao de um tipo. * @return Uma pequena descricao desse tipo. */ public String getName(){ return name; } /** * Consulta o contador de um tipo. * @return o contador desse tipo. */ public int getCount(){ return count; } /** * Incrementa o contador de um tipo de um em um. */ public void increment(){ count++; } /** * Reseta o contador para zero. */ public void reset(){ count = 0; } }
[ "iagho.carvalho@estudante.ufla.br" ]
iagho.carvalho@estudante.ufla.br
438df30dc383affc6b6b98df42687695d6327a7c
4cf9c939c880b350c538d5ce7ced7d2fbca57f76
/ServeurATBM/src/classesTraitment/ActionCompte.java
d91ae91d23c2b1efee1c44a9eaf9f3fdcc6c8714
[]
no_license
HamrouniMedKhaled/Android
c312107231b716b4c99295c33a8e7fe450677ab3
da0cea3d1abfe288ad37bc202739048690ad0277
refs/heads/master
2020-05-03T07:13:24.135518
2019-03-30T01:55:11
2019-03-30T01:55:11
178,476,661
0
0
null
null
null
null
UTF-8
Java
false
false
424
java
package classesTraitment; import java.io.BufferedReader; import java.io.PrintWriter; import classesDB.AuthentificationDB; import classesDB.CompteDB; public class ActionCompte { String [] transCompte; public ActionCompte(String [] transcompte) { this.transCompte = transcompte; } public String [] soldeChargee() { CompteDB charge = new CompteDB(transCompte); return charge.chargementSoldeCompte(); } }
[ "medkhaled.hamrouni@esprit.tn" ]
medkhaled.hamrouni@esprit.tn
70b0db0e0b4d049e791551287f1a9e34125c3eb4
a51ba60aea6c75a9fd83be2e4e104374ac59f3ab
/JavaBasic/StringTest.java
38e0d7b4f1789c6fccc3f4807d04f19e61c8271b
[]
no_license
kwakmoonseok/LearningSpring
59ab568bf2fdff3ed79906615db09fe1902c8150
6ba4dfe8a451abc2e098852e02fa8243b7ad13da
refs/heads/main
2023-04-05T13:49:13.592713
2021-04-13T23:50:25
2021-04-13T23:50:25
323,267,245
0
0
null
null
null
null
UTF-8
Java
false
false
345
java
package JavaBasic; public class StringTest { public static void main(String[] args) { String str1 = new String("abc"); String str2 = new String("abc"); System.out.println(str1 == str2); //false String str3 = ("abc"); String str4 = ("abc"); System.out.println(str3 == str4); //true } }
[ "kms34510@naver.com" ]
kms34510@naver.com
9f54ca0638f7f2e582d91064b3eccce569fa9476
d5e616745726d8252eb0cb42c70dc5100ce9792a
/src/main/java/homework/lab3/Main.java
d9720ff0a6c73838e3720740b4d8b447900c6006
[]
no_license
Drucetination/java-school
0e4f91e4d29f30654eed0b1f89428791b851989a
1db319244c3ac469d841d56c772cf09642d52814
refs/heads/master
2023-07-18T03:22:36.882181
2021-08-26T12:26:39
2021-08-26T12:26:39
396,917,632
0
0
null
null
null
null
UTF-8
Java
false
false
363
java
package homework.lab3; public class Main { public static void main(String[] args) { King king = new King(); Elf elf = new Elf(); Hobbit hobbit = new Hobbit(); king.kick(elf); king.kick(king); elf.kick(king); hobbit.kick(elf); System.out.println(king); System.out.println(elf); } }
[ "st050025@student.spbu.ru" ]
st050025@student.spbu.ru
cfa31147bd8e37c24cd4bbbe64a683fe0c6acaab
549cccf92d21840745110823544e6cf0956c4199
/src/test/java/Base/BasePage.java
6ef87a5f7c417a04d76a4ae4ad87c4df9ac43fda
[]
no_license
akifcecen/ImdbTestSelenium
ef3f86af19c92d50892df9cf35f89030f14add58
b21f677e309643535bcc556e10051724fd3a9ad1
refs/heads/master
2023-06-02T07:15:13.869145
2021-06-20T23:54:50
2021-06-20T23:54:50
378,221,239
0
0
null
null
null
null
UTF-8
Java
false
false
5,041
java
package Base; import Util.ElementInfo; import org.apache.log4j.Logger; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import java.io.IOException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class BasePage { protected WebDriver driver = BaseTest.driver; private WebDriverWait wait = new WebDriverWait(driver, 15, 1000); protected Actions action = new Actions(driver); private Logger LOGGER = Logger.getLogger(BasePage.class); private String url=""; HttpURLConnection huc = null; int respCode = 200; protected WebElement getElement(ElementInfo elementInfo) { return driver.findElement(elementInfo.getBy()); } protected WebElement waitForElement(ElementInfo info) { isElementVisible(info,10); isElementClickable(info,10); return wait.until(ExpectedConditions.presenceOfElementLocated(info.getBy())); } protected void waitForElementAndClick(ElementInfo elementInfo) { waitForElement(elementInfo).click(); } protected void waitForElementAndClickWithAction(ElementInfo elementInfo) { Actions action = new Actions(driver); action.moveToElement(waitForElement(elementInfo)).click().build().perform(); } protected void waitForElementAndSendKeys(ElementInfo elementInfo, String text) { waitForElement(elementInfo).sendKeys(text); } public boolean isElementClickable(ElementInfo elementInfo, int timeout){ try{ WebDriverWait wait = new WebDriverWait(driver,timeout); waitClickableOfElementLocatedBy(elementInfo.getBy()); return true; }catch (Exception e){ // LOGGER.info(key +" görünmüyor."); return false; } } public boolean isElementVisible(ElementInfo elementInfo, int timeout){ try{ WebDriverWait wait = new WebDriverWait(driver,timeout); waitVisibilityOfElementLocatedBy(elementInfo.getBy()); return true; }catch (Exception e){ // LOGGER.info(key +" görünmüyor."); return false; } } protected void waitSeconds(int seconds) { try { LOGGER.info(seconds + " saniye boyunca bekleniyor."); Thread.sleep(seconds * 1000); } catch (InterruptedException e) { // LOGGER.info(e); } } protected void waitVisibilityOfElementLocatedBy(By by) { try { wait.until(ExpectedConditions .visibilityOfElementLocated(by)); }catch (Exception e ){ //this.LOGGER.error( by + "---> Element görünüm hatası. " + e.getStackTrace().toString()); } } protected void waitClickableOfElementLocatedBy(By by) { try { wait.until(ExpectedConditions .elementToBeClickable(by)); }catch (Exception e ){ //this.LOGGER.error( by + "---> Element tıklanamıyor hatası. " + e.getStackTrace().toString()); } } protected boolean isElementExist(By by){ return !driver.findElements(by).isEmpty(); } public boolean creditCheck(List<WebElement> elm, List<WebElement> elm2) { List<String> str=new ArrayList<>(); List<String> compr=new ArrayList<>(); for (WebElement web: elm) { str.add(web.getText()); } for (WebElement web: elm2) { compr.add(web.getText()); } return str.equals(compr); } public void linkChecker(List<WebElement> links){ int count = 0; Iterator<WebElement> it = links.iterator(); while (it.hasNext()) { url = it.next().getAttribute("href"); try { huc = (HttpURLConnection) (new URL(url).openConnection()); huc.setRequestMethod("HEAD"); huc.connect(); respCode = huc.getResponseCode(); if (respCode >= 400) { LOGGER.info(url + " Linki çalışmıyor"); count++; } else { //LOGGER.info(url + " Linki çalışıyor"); } } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } LOGGER.info("Toplam Link sayısı : "+ links.size() + " Çalışmayan link sayısı :"+count); if(count>0)LOGGER.info("Çalışmayan link var.."); else LOGGER.info("Linklerde kırık yok.."); } }
[ "akifcecenn@yandex.com" ]
akifcecenn@yandex.com
d02f99ac27bb952f71c458ad6f40b251d3ef1d27
f46891cca8db8bb3b4b7a1acdf4b60e50f709b0b
/thirdparty-osgi/sip/nist-sip/src/gov/nist/javax/sip/header/Expires.java
f704e1da8c0a532762ab320be60f6bf11b1324b5
[]
no_license
BackupTheBerlios/osgirepo
7778117c9850bbde753e5a470fd546b1ed39063d
581645f2d269a577c76c4bdc40cc01cd68bffbd3
refs/heads/master
2021-01-19T14:58:47.088987
2005-07-29T09:18:00
2005-07-29T09:18:00
40,255,705
0
0
null
null
null
null
UTF-8
Java
false
false
2,912
java
/******************************************************************************* * Product of NIST/ITL Advanced Networking Technologies Division (ANTD). * *******************************************************************************/ package gov.nist.javax.sip.header; import javax.sip.*; /** * Expires SIP Header. * * @version JAIN-SIP-1.1 $Revision: 1.1 $ $Date: 2004/11/15 14:24:53 $ * * @author M. Ranganathan <mranga@nist.gov> <br/> * * <a href="{@docRoot}/uncopyright.html">This code is in the public domain.</a> */ public class Expires extends SIPHeader implements javax.sip.header.ExpiresHeader { /** expires field */ protected int expires; /** default constructor */ public Expires() { super(NAME); } /** * Return canonical form. * @return String */ public String encodeBody() { return new Integer(expires).toString(); } /** * Gets the expires value of the ExpiresHeader. This expires value is * * relative time. * * * * @return the expires value of the ExpiresHeader. * * @since JAIN SIP v1.1 * */ public int getExpires() { return expires; } /** * Sets the relative expires value of the ExpiresHeader. * The expires value MUST be greater than zero and MUST be * less than 2**31. * * @param expires - the new expires value of this ExpiresHeader * * @throws InvalidArgumentException if supplied value is less than zero. * * @since JAIN SIP v1.1 * */ public void setExpires(int expires) throws InvalidArgumentException { if (expires < 0) throw new InvalidArgumentException("bad argument " + expires); this.expires = expires; } } /* * $Log: Expires.java,v $ * Revision 1.1 2004/11/15 14:24:53 afrei * initial checkin to osgirepo * * Revision 1.1 2004/11/14 14:30:01 andfrei * checkin of sip, btapi, axis * * Revision 1.2 2004/01/22 13:26:29 sverker * Issue number: * Obtained from: * Submitted by: sverker * Reviewed by: mranga * * Major reformat of code to conform with style guide. Resolved compiler and javadoc warnings. Added CVS tags. * * CVS: ---------------------------------------------------------------------- * CVS: Issue number: * CVS: If this change addresses one or more issues, * CVS: then enter the issue number(s) here. * CVS: Obtained from: * CVS: If this change has been taken from another system, * CVS: then name the system in this line, otherwise delete it. * CVS: Submitted by: * CVS: If this code has been contributed to the project by someone else; i.e., * CVS: they sent us a patch or a set of diffs, then include their name/email * CVS: address here. If this is your work then delete this line. * CVS: Reviewed by: * CVS: If we are doing pre-commit code reviews and someone else has * CVS: reviewed your changes, include their name(s) here. * CVS: If you have not had it reviewed then delete this line. * */
[ "afrei" ]
afrei
cd2e31e1c62d069b99adac145beefb7880cfd7b9
2c29df623aab00b509467bedd3bfed8d724c15df
/src/main/java/com/apap/tutorial4/model/CarModel.java
1433485c997302328f78ab85cb2de588cc3ec6ed
[]
no_license
Apap-2018/tutorial4_1606874665
3f2a13cdccf74ee1bffe431bd9bb733d0043e816
1b0c4eebe14452bad9a2a1a7b1a881f67ca5299c
refs/heads/master
2020-03-30T19:48:08.376999
2018-10-04T11:12:11
2018-10-04T11:12:11
151,559,046
0
0
null
null
null
null
UTF-8
Java
false
false
1,701
java
package com.apap.tutorial4.model; import java.io.Serializable; import javax.persistence.*; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import com.fasterxml.jackson.annotation.JsonIgnore; /*import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction;*/ @Entity @Table(name="car") public class CarModel { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; @NotNull @Size (max = 50) @Column (name = "brand", nullable = false) private String brand; @NotNull @Size (max = 50) @Column (name = "type", nullable = false, unique = true) private String type; @NotNull @Column (name = "price", nullable = false) private Long price; @NotNull @Column (name = "amount", nullable = false) private Integer amount; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name="dealer_id", referencedColumnName = "id", nullable = false) /*@OnDelete(action = OnDeleteAction.NO_ACTION)*/ @JsonIgnore private DealerModel dealer; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getBrand() { return brand; } public void setBrand(String brand) { this.brand = brand; } public String getType() { return type; } public void setType(String type) { this.type = type; } public Long getPrice() { return price; } public void setPrice(Long price) { this.price = price; } public Integer getAmount() { return amount; } public void setAmount(Integer amount) { this.amount = amount; } public DealerModel getDealer() { return dealer; } public void setDealer(DealerModel dealer) { this.dealer = dealer; } }
[ "nikmahsalsabila28@gmail.com" ]
nikmahsalsabila28@gmail.com
024d38356cd64f663b2c368fcba85864175d5e38
07b6312caa6bd3762de44d702f19443b12fe618f
/games/TicTacToe/src/Button.java
5c0982c3348ffd8b24b6e776270a01a154b173a2
[]
no_license
thepaulfoley/thepaulfoley.com
35d69bcae324c745c1e23b5f5a5a1c5e8812e00a
035a60d57f264a6905cea267838ad1740a4cc53d
refs/heads/master
2020-05-16T21:26:34.738527
2017-04-01T19:13:51
2017-04-01T19:13:51
11,395,380
0
0
null
null
null
null
UTF-8
Java
false
false
4,063
java
import java.applet.Applet; import java.awt.*; import java.awt.image.ImageObserver; import java.net.*; /** * Creates a new button * @author Paul Foley * */ public class Button { private Image img; private Image alt; private int x; private int y; private Applet app; private boolean highlighted; private Menu goTo; String type; public Button(){ this.type="null"; } private Button(Image img, Image alt, Menu goTo, Applet app, String type){ this.img=img; this.alt=alt; this.x=0; this.y=0; this.goTo=goTo; this.app=app; this.highlighted=false; this.type=type; } private Button(Image img, Image alt, Menu goTo, Applet app, int x, int y, String type){ this.img=img; this.alt=alt; this.x=x; this.y=y; this.goTo=goTo; this.app=app; this.highlighted=false; this.type=type; } public static Button create(String type, Menu goTo, Applet app)throws Exception{ String prefix = app.getCodeBase().toString().concat("../img/buttons/"); String file = type; String fileAlt = type.concat(".alt"); String suffix = ".gif"; URL imgURL=new URL(prefix.concat(file).concat(suffix)); URL altURL= new URL(prefix.concat(fileAlt).concat(suffix)); Image img=app.getImage(imgURL); Image alt=app.getImage(altURL); return new Button(img, alt, goTo, app, type); } public static Button create(String type, Menu goTo, Applet app, int x, int y)throws Exception{ String prefix = app.getCodeBase().toString().concat("../img/buttons/"); String file = type; String fileAlt = type.concat(".alt"); String suffix = ".gif"; URL imgURL=new URL(prefix.concat(file).concat(suffix)); URL altURL= new URL(prefix.concat(fileAlt).concat(suffix)); Image img=app.getImage(imgURL); Image alt=app.getImage(altURL); return new Button(img, alt, goTo, app, x, y, type); } /** * * @param io: ImageObserver utilizing this Card * @return returns the width of the img field */ public int getWidth(){ return this.img.getWidth(this.app); } /** * * @param io: ImageObserver utilizing this Card * @return returns the height of the img field */ public int getHeight(){ return this.img.getHeight(this.app); } /** * gets the x-coordinate of this Button * @return the x coordinate of this Button */ public int getX(){ return this.x; } /** * gets the y-coordinate of this Button * @return the y-coordinate of this Button */ public int getY(){ return this.y; } /** * sets the x-coordinate of this Button * to the given int * @param x - an int to set the the x-coordinate * of this Button to */ public void setX(int x){ this.x = x; } /** * sets the y-coordinate of this Button * to the given int * @param y - an int to set the the x-coordinate * of this Button to */ public void setY(int y){ this.y = y; } public void setCoords(Point p){ this.setX((int)p.getX()); this.setY((int)p.getY()); } /** * determines if this Button contains the given point * @param mX - x-coordinate * @param mY - y-coordinate * @return - returns true if the given points are in * this Button, otherwise returns false */ public boolean contains(int mX, int mY){ this.highlighted = (( (mX>=this.x) && mX<=(this.x+this.getWidth())) && ( (mY>=this.y) && mY<=(this.y+this.getHeight()))); return this.highlighted; } public void refresh(int x, int y){ boolean wasHighlighted=this.highlighted; if(!this.contains(x,y)==wasHighlighted) this.draw(this.app.getGraphics()); } /** * returns the goTo field of this Button * @return - returns the goTo field of this Button */ public Menu goTo(){ return this.goTo; } /** * draws this Button * @param g - the Graphics object used to draw this Button */ public void draw(Graphics g){ if(this.highlighted) g.drawImage(this.alt, this.x, this.y, (ImageObserver)this.app); else g.drawImage(this.img, this.x, this.y, (ImageObserver)this.app); } public String toString(){ return "Button: ".concat(this.type); } }
[ "thepaulfoley@gmail.com" ]
thepaulfoley@gmail.com
c29bc1663f4a921ca81c191cd112a80f013d8c7d
e65f799f7bcfbce1fd176c870813cb0b69dd75f9
/JAVAclass/src/ellen015.java
83ab0d8021548ca54acbc1bf80044b79541df011
[]
no_license
ellen60538/JAVAclass
27ccf6927262a573853f7ffb8538be210615bce0
1adb13e780c5756ff40bc436c7cc168f1785f0e0
refs/heads/master
2020-11-30T15:11:03.609399
2020-01-03T15:23:31
2020-01-03T15:23:31
230,427,025
0
0
null
null
null
null
UTF-8
Java
false
false
400
java
public class ellen015 { public static void main(String[] args) { int[] p = new int[7] ; for (int i = 0; i < 100000; i++) { // 灌鉛的骰子 嘿嘿嘿... int rand = (int)(Math.random()*9 + 1) ; // 1-9 p[rand>=7 ? rand-3 : rand]++ ; } if (p[0] == 0) { for (int i = 0; i <= 6; i++) { System.out.printf("%d點出現%d次\n", i, p[i]); } } } }
[ "ellen60538@gmail.com" ]
ellen60538@gmail.com
29c3b6e49489243f5bbe34e6e81fd02933e54ade
f59f15d6e54a460db13e1e0b7321949f0a0f1ac7
/.svn/pristine/a0/a0ba765c928ea677a63ccd7edfc28d2e4113b2b3.svn-base
e4f5037d5d5ac73d66dddfdcbaf615740daa89b2
[]
no_license
rnicchi/demDec
8f4198dcf4eb956c2dd3263bb25060a3c6d00048
353b8117952492e935bfcc1fb42a605601838c92
refs/heads/master
2020-03-07T14:12:34.387118
2018-04-01T21:12:43
2018-04-01T21:12:43
127,521,166
0
0
null
null
null
null
UTF-8
Java
false
false
367
package it.almavivaitalia.bsn.sh.tagparser.text.html; import it.almavivaitalia.bsn.sh.tagparser.StringConverter; import org.apache.commons.lang.StringEscapeUtils; public class HtmlEscaper implements StringConverter{ @Override public String unescape(String str) { if (str!=null){ return StringEscapeUtils.escapeHtml(str); }else { return str; } } }
[ "robertonicchi@virgilio.it" ]
robertonicchi@virgilio.it
0ccbd7a139f90c29d913960d0b162c8f3305babf
f9123aedb9ef668e8cd3bd8ab27a476eee7ece90
/app/src/main/java/com/mediclink/hassan/bakingapp/adapter/IngredientListAdapter.java
18263ee5104fc0c8506c42dd7b8c46ea3ab4c468
[]
no_license
Hilyas68/BakingApp
70929ce3d594ea6a98082dc8d98c070cd5264c7e
95989c929b2c0400f37c1ee1b1d24285c2a78bf5
refs/heads/master
2020-04-05T12:39:06.583378
2017-07-12T23:48:57
2017-07-12T23:48:57
95,214,718
0
0
null
null
null
null
UTF-8
Java
false
false
3,043
java
package com.mediclink.hassan.bakingapp.adapter; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.mediclink.hassan.bakingapp.R; import com.mediclink.hassan.bakingapp.model.Ingredient; import java.util.ArrayList; /** * Created by hassan on 6/24/2017. */ public class IngredientListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; private ArrayList<Ingredient> mIngredients; public IngredientListAdapter(ArrayList<Ingredient> ingredients) { this.mIngredients = ingredients; } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == TYPE_HEADER) { View rootView = LayoutInflater.from(parent.getContext()).inflate(R.layout.ingredient_header, parent, false); return new IngredientHeaderViewHolder(rootView); } else if (viewType == TYPE_ITEM) { View rootView = LayoutInflater.from(parent.getContext()).inflate(R.layout.ingredients_list_item, parent, false); return new IngredientViewHolder(rootView); } throw new RuntimeException("there is no type that matches the type " + viewType + " + make sure your using types correctly"); } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (holder instanceof IngredientViewHolder) { ((IngredientViewHolder) holder).mIngredient.setText(mIngredients.get(position - 1).getIngredient()); ((IngredientViewHolder) holder).mMeasure.setText(mIngredients.get(position - 1).getMeasure()); ((IngredientViewHolder) holder).mQuantity.setText(String.valueOf(mIngredients.get(position - 1).getQuantity())); } } @Override public int getItemCount() { if (mIngredients == null) { return 0; } return mIngredients.size() + 1; } @Override public int getItemViewType(int position) { if (isPositionHeader(position)) return TYPE_HEADER; return TYPE_ITEM; } private boolean isPositionHeader(int position) { return position == 0; } static class IngredientHeaderViewHolder extends RecyclerView.ViewHolder { public IngredientHeaderViewHolder(View itemView) { super(itemView); } } static class IngredientViewHolder extends RecyclerView.ViewHolder { TextView mIngredient; TextView mMeasure; TextView mQuantity; public IngredientViewHolder(View itemView) { super(itemView); mIngredient = (TextView) itemView.findViewById(R.id.tv_ingredient); mMeasure = (TextView) itemView.findViewById(R.id.tv_measure); mQuantity = (TextView) itemView.findViewById(R.id.tv_quantity); } } }
[ "htope68@gmail.com" ]
htope68@gmail.com
749044a3fc1cc451546fa22dc27fa66a7fd8ec0c
173fd8b4548b579121a85542a55cda6f6e833a49
/src/test/java/net/whydah/sso/simulator/WhydahSimulator.java
e4de3e522fc459989412783df82e3ffb694c1f99
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
Cantara/Whydah-Java-SDK
135dce9fc20fbb97500c8f7afedfd8f190517fc0
f0140d4fca129bc21b6610c7f99dee1f13039018
refs/heads/master
2023-08-14T01:37:50.665176
2023-07-28T08:05:46
2023-07-28T08:05:46
30,081,701
3
1
Apache-2.0
2023-07-28T16:01:25
2015-01-30T17:00:21
Java
UTF-8
Java
false
false
6,603
java
package net.whydah.sso.simulator; import net.whydah.sso.application.mappers.ApplicationCredentialMapper; import net.whydah.sso.application.mappers.ApplicationTokenMapper; import net.whydah.sso.application.types.ApplicationCredential; import net.whydah.sso.application.types.ApplicationToken; import net.whydah.sso.session.DefaultWhydahApplicationSession; import org.junit.Assert; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import spark.Spark; import java.util.List; import java.util.UUID; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; public class WhydahSimulator implements AutoCloseable { private static final Logger log = LoggerFactory.getLogger(WhydahSimulator.class); public static Builder builder() { return new Builder(); } public static class Builder { private int maxNumberOfAllowedLogons = Integer.MAX_VALUE; private boolean applicationLogonAlwaysFailing = false; private Builder() { } public Builder withMaxNumberOfAllowedLogons(int maxNumberOfAllowedLogons) { this.maxNumberOfAllowedLogons = maxNumberOfAllowedLogons; return this; } public Builder withApplicationLogonAlwaysFailing(boolean applicationLogonAlwaysFailing) { this.applicationLogonAlwaysFailing = applicationLogonAlwaysFailing; return this; } public WhydahSimulator build() { return new WhydahSimulator(maxNumberOfAllowedLogons, applicationLogonAlwaysFailing); } } private final int maxNumberOfAllowedLogons; private final boolean applicationLogonAlwaysFailing; private final AtomicInteger logonsAttempted = new AtomicInteger(0); private final List<DefaultWhydahApplicationSession> sessions = new CopyOnWriteArrayList<>(); private final List<Throwable> errors = new CopyOnWriteArrayList<>(); private final CountDownLatch firstErrorCountDownLatch = new CountDownLatch(1); private WhydahSimulator(int maxNumberOfAllowedLogons, boolean applicationLogonAlwaysFailing) { this.maxNumberOfAllowedLogons = maxNumberOfAllowedLogons; this.applicationLogonAlwaysFailing = applicationLogonAlwaysFailing; Spark.port(0); initRoutes(); Spark.init(); Spark.awaitInitialization(); } public void expectPeriodWithoutAnyErrors(long timeout, TimeUnit unit) throws InterruptedException { long start = System.nanoTime(); if (firstErrorCountDownLatch.await(timeout, unit)) { long duration = (System.nanoTime() - start) / 1_000_000; errors.get(0).printStackTrace(); Assert.fail(String.format("Error after %d ms: %s", duration, errors.get(0).getMessage())); } } public boolean hasErrors() { return errors.size() > 0; } public void initRoutes() { Spark.post("/sts/logon", (req, res) -> { log.info("WHYDAH-SIMULATOR: logon"); if (logonsAttempted.incrementAndGet() > maxNumberOfAllowedLogons) { errors.add(new RuntimeException(String.format("More than %d number of logons attempted", maxNumberOfAllowedLogons))); firstErrorCountDownLatch.countDown(); return ""; } if (applicationLogonAlwaysFailing) { return ""; } String applicationcredentialXml = req.raw().getParameter("applicationcredential"); ApplicationCredential applicationCredential = ApplicationCredentialMapper.fromXml(applicationcredentialXml); ApplicationToken token = new ApplicationToken(); token.setApplicationName(applicationCredential.getApplicationName()); token.setApplicationID(applicationCredential.getApplicationID()); token.setApplicationSecret(applicationCredential.getApplicationSecret()); token.setApplicationTokenId(UUID.randomUUID().toString()); token.setExpires(String.valueOf((System.currentTimeMillis() + (24 * 60 * 60 * 1000)))); // 24 HOURS String xml = ApplicationTokenMapper.toXML(token); return xml; }); Spark.post("/sts/:applicationTokenId/renew_applicationtoken", (req, res) -> { log.info("WHYDAH-SIMULATOR: renew_applicationtoken"); return ""; }); Spark.get("/sts/:applicationTokenId/get_application_key", (req, res) -> { log.info("WHYDAH-SIMULATOR: get_application_key"); return ""; }); Spark.get("/sts/:applicationTokenId/validate", (req, res) -> { String applicationTokenId = req.params(":applicationTokenId"); log.info("WHYDAH-SIMULATOR: {}/validate", applicationTokenId); return ""; }); Spark.get("/sts/threat/:applicationTokenId/signal", (req, res) -> { log.info("WHYDAH-SIMULATOR: threat/.../signal"); return ""; }); Spark.get("/uas/:applicationTokenId/applications", (req, res) -> { log.info("WHYDAH-SIMULATOR: applications"); return ""; }); } public String sts() { return String.format("http://localhost:%d/sts/", Spark.port()); } public String uas() { return String.format("http://localhost:%d/uas/", Spark.port()); } public DefaultWhydahApplicationSession createNewSession(Consumer<DefaultWhydahApplicationSession.Builder> sessionBuilderConsumer) { final ApplicationCredential defaultCredential = new ApplicationCredential("myappid", "MyApplication", "my-app-s3cr3t"); DefaultWhydahApplicationSession.Builder builder = DefaultWhydahApplicationSession.builder() .withSts(sts()) .withUas(uas()) .withAppCred(defaultCredential); sessionBuilderConsumer.accept(builder); DefaultWhydahApplicationSession was = builder.build(); sessions.add(was); return was; } @Override public void close() { try { for (DefaultWhydahApplicationSession was : sessions) { try { was.close(); } catch (Throwable t) { t.printStackTrace(); } } } catch (Throwable t) { t.printStackTrace(); } finally { Spark.stop(); Spark.awaitStop(); } } }
[ "kim.christian.gaarder@gmail.com" ]
kim.christian.gaarder@gmail.com
76ff657bba706697926ff197e523acd2e6fe45d9
7124d36081fe5f3de61afbb7febcd323bd57c827
/src/cn/itcast/bookStore/servlet/manager/FindOrdersServlet.java
4c9ad75eb7e2859f56f1349e138cc89a64435a79
[]
no_license
alenzhd/bookstore
ae46b43286c977acc3a30bcfc5f8c85ce2658d1b
af98b242bb490ea82f740feaa09d28f340a5d2bf
refs/heads/master
2021-01-19T03:40:48.007378
2016-07-05T06:36:38
2016-07-05T06:36:38
62,607,719
0
0
null
null
null
null
UTF-8
Java
false
false
1,106
java
package cn.itcast.bookStore.servlet.manager; import java.io.IOException; import java.util.List; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import cn.itcast.bookStore.domain.Order; import cn.itcast.bookStore.service.OrderService; //查找所有订单 @WebServlet("/findOrders") public class FindOrdersServlet extends HttpServlet { private static final long serialVersionUID = 1L; public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { OrderService service = new OrderService(); List<Order> orders = service.findAllOrder(); request.setAttribute("orders", orders); request.getRequestDispatcher("/admin/orders/list.jsp").forward(request, response); } }
[ "386175782@qq.com" ]
386175782@qq.com
2ab26be1d469aa61082606658c078b8fa10cf78f
8504b15ba9153caa24c1032f5482deef93b9e339
/JanLib/src/jan/util/CompileHelper.java
8a6404f190a3497f7b08f388c48ded46902ea40a
[]
no_license
AlexanderKwong/myProject
78d4507f0ef9bcc64c383151233d744fe3cc89ef
3828aff308babb689c035e25be71c743d769c093
refs/heads/master
2021-08-31T19:53:35.167478
2017-12-22T16:42:10
2017-12-22T16:42:10
111,092,218
0
0
null
null
null
null
UTF-8
Java
false
false
1,062
java
package jan.util; import java.util.HashMap; import java.util.Map; public class CompileHelper { private boolean[] marks; private Map<String, Integer> markMap; public CompileHelper() { clear(); } private void clear() { marks = new boolean[1000]; for(int i=0; i<marks.length; ++i) { marks[i] = false; } markMap = new HashMap<String, Integer>(); } public boolean Assert(int mark) { if (mark < marks.length && marks[mark] == true) { return true; } return false; } public boolean initFormatMark(String formatMarksStr) { clear(); String[] strs = formatMarksStr.split(","); for (int i=0; i<strs.length; ++i) { marks[i+1] = false; markMap.put(strs[i].toUpperCase(), i+1); } return true; } public boolean initMark(String marksStr) { String[] strs = marksStr.split(","); for (int i=0; i<strs.length; ++i) { String markStr = strs[i].toUpperCase(); if(markMap.containsKey(markStr)) { int index = markMap.get(markStr); marks[index] = true; } } return true; } }
[ "601828006@qq.com" ]
601828006@qq.com
2f53e677a2fa721e2d526d92afed7ee8cae5c37f
874befb0f6d19708035b20a4b3f943460e7434bc
/src/main/java/net/katagaitai/phpscan/php/builtin/Session.java
e06d6bfbd9e11de87752cacd11bb970f0a381c84
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
AsaiKen/phpscan
4205c64eb260ac5b6d116e8138c83ff1408dc5cd
8ecce8ad185c01681762c28729daa01dbf8c9ba7
refs/heads/master
2020-12-30T16:48:40.416997
2020-03-09T14:48:23
2020-03-09T14:48:23
91,027,145
61
5
null
null
null
null
UTF-8
Java
false
false
13,464
java
package net.katagaitai.phpscan.php.builtin; import java.util.List; import net.katagaitai.phpscan.compiler.BuiltinBase; import net.katagaitai.phpscan.compiler.PhpCallable; import net.katagaitai.phpscan.interpreter.Interpreter; import net.katagaitai.phpscan.symbol.Symbol; import net.katagaitai.phpscan.symbol.SymbolOperator; import net.katagaitai.phpscan.util.Constants; import net.katagaitai.phpscan.util.SymbolUtils; import com.google.common.collect.Lists; public class Session extends BuiltinBase { public Session(Interpreter ip) { super(ip); } // function session_name ($name = null) {} public static class session_name implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.string(); } } // function session_module_name ($module = null) {} public static class session_module_name implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.string(); } } // function session_save_path ($path = null) {} public static class session_save_path implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); // TODO 実装したほうがよいかも return operator.string(); } } // function session_id ($id = null) {} // 現在のセッション ID を取得または設定する public static class session_id implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); Symbol sessionIdSymbol = ip.getGlobalScope().getOrPhpNull(Constants.SESSION_ID_VARIABLE); Symbol idSymbol = SymbolUtils.getArgument(ip, 0); if (operator.isNull(idSymbol)) { // pass } else { operator.assign(sessionIdSymbol, idSymbol); } Symbol resultSymbol = operator.copy(sessionIdSymbol); return resultSymbol; } } // function session_regenerate_id ($delete_old_session = false) {} public static class session_regenerate_id implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.bool(); } } // function session_register_shutdown () {} public static class session_register_shutdown implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.null_(); } } // function session_decode ($data) {} // http://php.net/manual/ja/function.session-decode.php // session_decode() は、 $data のセッションデータをデコードし、 // スーパーグローバル $_SESSION にその結果を格納します。 public static class session_decode implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); Symbol dataSymbol = SymbolUtils.getArgument(ip, 0); Symbol sessionSymbol = ip.getGlobalScope().getOrPhpNull("$_SESSION"); operator.assign(sessionSymbol, operator.createSymbol( operator.createPhpArrayDummy(dataSymbol))); return operator.createNull(); } } // function session_register ($name, $_ = null) {} public static class session_register implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); List<Symbol> list = ip.getContext().getArgumentSymbolList(); for (int i = 0; i < list.size(); i++) { Symbol symbol = list.get(i); for (String string : operator.getJavaStringList(symbol)) { Symbol globalSymbol = ip.getGlobalScope().getOrPhpNull(string); if (operator.isNull(globalSymbol)) { continue; } Symbol sessionSymbol = ip.getGlobalScope().getOrPhpNull("$_SESSION"); if (operator.isNull(sessionSymbol)) { continue; } operator.putArrayValue(sessionSymbol, string, globalSymbol); } } return operator.bool(); } } // function session_unregister ($name) {} public static class session_unregister implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.bool(); } } // function session_is_registered ($name) {} public static class session_is_registered implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.bool(); } } // function session_encode () {} public static class session_encode implements PhpCallable { @Override public Symbol call(Interpreter ip) { return serialize(ip, ip.getGlobalScope().getOrPhpNull("$_SESSION")); } } // function session_start () {} public static class session_start implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); Symbol sessionCallbackArraySymbol = ip.getGlobalScope().getOrPhpNull(Constants.SESSION_CALLBACK_ARRAY_VARIABLE); Symbol sessionHandlerSymbol = ip.getGlobalScope().getOrPhpNull(Constants.SESSION_HANDLER_VARIABLE); Symbol sessionIdSymbol = ip.getGlobalScope().getOrPhpNull(Constants.SESSION_ID_VARIABLE); Symbol sessionSymbol = ip.getGlobalScope().getOrPhpNull("$_SESSION"); PhpCallable callable = ip.getFunction("session_decode"); Symbol serializedSessionSymbol1 = SymbolUtils.callCallable(ip, operator.getArrayValue(sessionCallbackArraySymbol, "read"), Lists.newArrayList(sessionIdSymbol)); if (callable != null) { operator.assign(sessionSymbol, SymbolUtils.callFunction(ip, callable, Lists.newArrayList(serializedSessionSymbol1))); } Symbol serializedSessionSymbol2 = SymbolUtils.callMethod(ip, sessionHandlerSymbol, operator.createSymbol("read"), Lists.newArrayList(sessionIdSymbol)); if (callable != null) { operator.assign(sessionSymbol, SymbolUtils.callFunction(ip, callable, Lists.newArrayList(serializedSessionSymbol2))); } return operator.bool(); } } // function session_destroy () {} public static class session_destroy implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.bool(); } } // function session_unset () {} public static class session_unset implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.null_(); } } // function session_set_save_handler ($open, $close, $read, $write, $destroy, $gc) {} // function session_set_save_handler (SessionHandlerInterface $session_handler, $register_shutdown = true) {} public static class session_set_save_handler implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); Symbol sessionIdSymbol = ip.getGlobalScope().getOrPhpNull(Constants.SESSION_ID_VARIABLE); Symbol sessionSymbol = ip.getGlobalScope().getOrPhpNull("$_SESSION"); Symbol sessionCallbackArraySymbol = ip.getGlobalScope().getOrPhpNull(Constants.SESSION_CALLBACK_ARRAY_VARIABLE); Symbol sessionHandlerSymbol = ip.getGlobalScope().getOrPhpNull(Constants.SESSION_HANDLER_VARIABLE); // コールバックは全て呼ぶ if (ip.getContext().getArgumentSymbolList().size() == 6) { // open(string $savePath, string $sessionName) Symbol openSymbol = ip.getContext().getArgumentSymbolList().get(0); operator.putArrayValue(sessionCallbackArraySymbol, "open", openSymbol); SymbolUtils.callCallable(ip, openSymbol, Lists.newArrayList(operator.string(), operator.string())); // close() Symbol closeSymbol = ip.getContext().getArgumentSymbolList().get(1); operator.putArrayValue(sessionCallbackArraySymbol, "close", closeSymbol); SymbolUtils.callCallable(ip, closeSymbol, Lists.newArrayList()); // read(string $sessionId) // read コールバックは、常にセッションエンコード (シリアライズ) された文字列を返さなければなりません。 Symbol readSymbol = ip.getContext().getArgumentSymbolList().get(2); operator.putArrayValue(sessionCallbackArraySymbol, "read", readSymbol); Symbol serializedSessionSymbol = SymbolUtils.callCallable(ip, readSymbol, Lists.newArrayList(sessionIdSymbol)); PhpCallable callable = ip.getFunction("session_decode"); if (callable != null) { operator.assign(sessionSymbol, SymbolUtils.callFunction(ip, callable, Lists.newArrayList(serializedSessionSymbol))); } // write(string $sessionId, string $data) // このコールバックが受け取るのは、現在のセッション ID とシリアライズ後のスーパーグローバル $_SESSION です。 Symbol writeSymbol = ip.getContext().getArgumentSymbolList().get(3); operator.putArrayValue(sessionCallbackArraySymbol, "write", writeSymbol); SymbolUtils.callCallable(ip, writeSymbol, Lists.newArrayList(sessionIdSymbol, serialize(ip, sessionSymbol))); // destroy($sessionId) Symbol destroySymbol = ip.getContext().getArgumentSymbolList().get(4); operator.putArrayValue(sessionCallbackArraySymbol, "destroy", destroySymbol); SymbolUtils.callCallable(ip, destroySymbol, Lists.newArrayList(sessionIdSymbol)); // gc($lifetime) Symbol gcSymbol = ip.getContext().getArgumentSymbolList().get(5); operator.putArrayValue(sessionCallbackArraySymbol, "gc", gcSymbol); SymbolUtils.callCallable(ip, gcSymbol, Lists.newArrayList(operator.integer())); } else { Symbol sessionhandlerSymbol = SymbolUtils.getArgument(ip, 0); operator.assign(sessionHandlerSymbol, sessionhandlerSymbol); // abstract public bool close ( void ) SymbolUtils.callMethod(ip, sessionhandlerSymbol, operator.createSymbol("close"), Lists.newArrayList()); // abstract public bool destroy ( string $session_id ) SymbolUtils.callMethod(ip, sessionhandlerSymbol, operator.createSymbol("destroy"), Lists.newArrayList(sessionIdSymbol)); // abstract public bool gc ( int $maxlifetime ) SymbolUtils.callMethod(ip, sessionhandlerSymbol, operator.createSymbol("gc"), Lists.newArrayList(operator.integer())); // abstract public bool open ( string $save_path , string $name ) SymbolUtils.callMethod(ip, sessionhandlerSymbol, operator.createSymbol("open"), Lists.newArrayList(operator.string(), operator.string())); // abstract public string read ( string $session_id ) Symbol serializedSessionSymbol = SymbolUtils.callMethod(ip, sessionhandlerSymbol, operator.createSymbol("read"), Lists.newArrayList(sessionIdSymbol)); PhpCallable callable = ip.getFunction("session_decode"); if (callable != null) { operator.assign(sessionSymbol, SymbolUtils.callFunction(ip, callable, Lists.newArrayList(serializedSessionSymbol))); } // abstract public bool write ( string $session_id , string $session_data ) SymbolUtils.callMethod(ip, sessionhandlerSymbol, operator.createSymbol("write"), Lists.newArrayList(sessionIdSymbol, serialize(ip, sessionSymbol))); } return operator.bool(); } } // function session_cache_limiter ($cache_limiter = null) {} public static class session_cache_limiter implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.string(); } } // function session_cache_expire ($new_cache_expire = null) {} public static class session_cache_expire implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.integer(); } } // function session_set_cookie_params ($lifetime, $path = null, $domain = null, $secure = false, $httponly = false) {} public static class session_set_cookie_params implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.null_(); } } // function session_get_cookie_params () {} public static class session_get_cookie_params implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.array(); } } // function session_write_close () {} public static class session_write_close implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.null_(); } } // function session_commit () {} // * Alias of <b>session_write_close</b> public static class session_commit extends session_write_close { } // function session_status () {} public static class session_status implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.integer(); } } // function session_abort() {} public static class session_abort implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.bool(); } } // function session_reset() {} public static class session_reset implements PhpCallable { @Override public Symbol call(Interpreter ip) { SymbolOperator operator = ip.getOperator(); return operator.bool(); } } }
[ "tc535mr2@gmail.com" ]
tc535mr2@gmail.com
e4d9ff387b1468704585047b44688a40234cb91e
08a8f8514d0e18cf30d9ca9ede3596b5c0696ee0
/Aula1/workspace/Aula5/src/main/java/Aula5/pedagio/CalculadorPedagio.java
e3cc176edb9da79b0ceaeab42c3d452a0db475e3
[]
no_license
screambr/Curso_Java
1af6d18e38d23a922ee11ecc467e4fa74cc68ed3
27f0b124ce6828093718eea1c649a6701dde5331
refs/heads/master
2021-01-19T04:48:23.534925
2017-01-21T19:34:45
2017-01-21T19:34:45
69,101,108
0
0
null
null
null
null
UTF-8
Java
false
false
521
java
package Aula5.pedagio; public class CalculadorPedagio { private double valorPorEixo; public CalculadorPedagio(double valorPorEixo) { this.valorPorEixo = valorPorEixo; } // public double calcular(Veiculo veiculo) { // if (veiculo instanceof PagaPedagio) { // PagaPedagio pagaPedagio = (PagaPedagio) veiculo; // return valorPorEixo * pagaPedagio.getQuantidadeEixos(); // } // return 0; // } public double calcular(PagaPedagio pagaPedagio) { return valorPorEixo * pagaPedagio.getQuantidadeEixos(); } }
[ "anderson.m.rodrigues@gmail.com" ]
anderson.m.rodrigues@gmail.com
17fc7bb0551a1c65936887dcfb4c689b95b87db7
e90e942e3e4f2756768a18db80874bc46e77ef68
/src/main/java/com/vuelogix/recordingmanager/recording/api/response/CameraRecordFetchData.java
e7bfc1e98ac8abc23a90b3b72fcbb0519a227d0a
[]
no_license
sanchez-89/vrm
5bedd14e0a303bf946b1028acd8679b51132a306
ed37e0c954baeca8dedcc31b699b40b88b8f49e1
refs/heads/master
2022-07-02T04:51:05.283311
2020-05-11T12:28:06
2020-05-11T12:28:06
262,972,883
0
0
null
null
null
null
UTF-8
Java
false
false
1,099
java
package com.vuelogix.recordingmanager.recording.api.response; import java.util.List; public class CameraRecordFetchData { private List<String> recordingIdList; private String startTime; private String endTime; private Boolean isScheduled; public List<String> getRecordingIdList() { return recordingIdList; } public void setRecordingIdList(List<String> recordingIdList) { this.recordingIdList = recordingIdList; } public String getStartTime() { return startTime; } public void setStartTime(String startTime) { this.startTime = startTime; } public String getEndTime() { return endTime; } public CameraRecordFetchData(List<String> recordingIdList, String startTime, String endTime, Boolean isScheduled) { super(); this.recordingIdList = recordingIdList; this.startTime = startTime; this.endTime = endTime; this.isScheduled = isScheduled; } public void setEndTime(String endTime) { this.endTime = endTime; } public Boolean getIsScheduled() { return isScheduled; } public void setIsScheduled(Boolean isScheduled) { this.isScheduled = isScheduled; } }
[ "sanchezphilip89@gmail.com" ]
sanchezphilip89@gmail.com
61ac0f872afefcaa20db85024c56ae407162885b
cdb9839c993554ef5c93b2657e97c64b2279e034
/src/main/java/org/example/WebApplicationInitializer.java
62dc4a83ac4a3b9a1512a76b91e1004eb4884bee
[ "MIT-0" ]
permissive
manish-in-java/spring-mvc-swagger
8cf173ed5e7d533746e857b9418db7bf5cdfe9e2
81dcbbcf302280fcf9158073e1316ba59657d911
refs/heads/master
2020-04-06T04:31:42.753460
2014-12-18T11:38:21
2014-12-18T11:38:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,758
java
package org.example; import com.mangofactory.swagger.configuration.SpringSwaggerConfig; import com.mangofactory.swagger.plugin.EnableSwagger; import com.mangofactory.swagger.plugin.SwaggerSpringMvcPlugin; import com.wordnik.swagger.model.ApiInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; /** * Initializes the web application. */ public class WebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { /** * {@inheritDoc} */ @Override protected Class<?>[] getRootConfigClasses() { return null; } /** * {@inheritDoc} */ @Override protected Class<?>[] getServletConfigClasses() { return new Class[] { WebConfiguration.class }; } /** * {@inheritDoc} */ @Override protected String[] getServletMappings() { return new String[] { "/" }; } } /** * Provides configuration for the application. */ @ComponentScan("org.example") @Configuration @EnableWebMvc @EnableSwagger class WebConfiguration { @Autowired SpringSwaggerConfig swaggerConfig; /** * Overrides default Swagger configuration. */ @Bean public SwaggerSpringMvcPlugin swaggerPlugin() { final ApiInfo apiInfo = new ApiInfo("Example API" , "Example API" , "" , "" , "" , ""); return new SwaggerSpringMvcPlugin(this.swaggerConfig).swaggerGroup("api").apiInfo(apiInfo); } }
[ "baxi.manish@welue.com" ]
baxi.manish@welue.com
0eed3435ff00243a71bdf11e6c6352c63f538cb0
ae8900be9a6e5e44b4772394027410e2deb823f8
/src/jiemian/Action/AllLoginUserAction.java
5b24d37370e3b150db734dd6b790dbeb17d78ddf
[]
no_license
zwb1997/Campus-labor-management-system
039ecb721ad033922124d97598b99515b8c09577
702ddef5fad0738ac30539380cf7646dfacd1875
refs/heads/master
2023-05-10T17:44:30.333767
2023-05-07T03:40:09
2023-05-07T03:40:09
161,011,437
2
0
null
null
null
null
UTF-8
Java
false
false
1,490
java
package jiemian.Action; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.apache.struts2.ServletActionContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Repository; import jiemian.Dao.AllLoginUserDao; import jiemian.entities.Guser; import jiemian.entities.Suser; import jiemian.entities.Tuser; @Repository("allloginuseraction") @Scope("prototype") public class AllLoginUserAction { @Autowired AllLoginUserDao allLoginUserDao; public String AllGuser() { HttpServletRequest request = ServletActionContext.getRequest(); String gm = request.getParameter("gmy"); List<Guser> llg = allLoginUserDao.findAllGuser(); request.setAttribute("ggl", llg); if(gm.equals("LhntjIRegRkOTK6Y")) return "success"; else return "error"; } public String AllSuser() { HttpServletRequest request = ServletActionContext.getRequest(); List<Suser> lls = allLoginUserDao.findAllSuser(); request.setAttribute("ssl", lls); return "success"; } public String AllTuser() { HttpServletRequest request = ServletActionContext.getRequest(); String tm = request.getParameter("tmy"); List<Tuser> llt = allLoginUserDao.findAllTuser(); request.setAttribute("ttl", llt); if(tm.equals("CudvShFyGkc7yPNo")) return "success"; else return "error"; } }
[ "IIIIInc@163.com" ]
IIIIInc@163.com
589406fd18fb344c85a1f0fc98bc702fa234015d
b73a2f36d39401a57075def556f5ced5592c90d4
/app/src/main/java/com/nirodha/kid/quiz10.java
991db7c64426b54cb00f63b0f8e25c8321a8797e
[]
no_license
Nirodha97/Kids_Songs_Android_App
d4cb16160aceee226979d3f3aa65464b23373fd5
3b197c1b0414740fb54a77458d9ce59f2e1db785
refs/heads/master
2022-11-05T14:11:02.111333
2020-06-29T23:20:20
2020-06-29T23:20:20
275,945,620
0
0
null
null
null
null
UTF-8
Java
false
false
1,003
java
package com.nirodha.kid; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TextView; import androidx.annotation.Nullable; public class quiz10 extends Activity { TextView q1,q2,q3; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.quiz10); q1 = (TextView) findViewById(R.id.q1); q2 = (TextView) findViewById(R.id.q2); q3 = (TextView) findViewById(R.id.q3); } public void river (View v){ q1.setText("CORRECT !"); } public void noriver(View v){ q1.setText("TRY AGAIN !"); } public void boat(View v){ q2.setText("CORRECT !"); } public void noboat(View v){ q2.setText("TRY AGAIN !"); } public void back(View v){ Intent intent = new Intent(this,dashboard.class); startActivity(intent); } }
[ "nirodhamwickramaratne@gmail.com" ]
nirodhamwickramaratne@gmail.com
80d6c6d9f96dec0b8a33ce22450f17e67d8c9445
09f35040a0f67cca745d54b98f1307fd4464144e
/src/lesson7/DemoHomeWork.java
2664be380deab85dc7595007c63ce0565afc1a71
[]
no_license
toniname/java-core-grom-by-toni
a57f74db083a370985a1192a8b3495d60de09c48
4c71955a4ea5b27d856272058b9da019827e83a2
refs/heads/master
2022-10-10T22:23:42.080780
2020-06-04T19:02:25
2020-06-04T19:02:25
263,029,012
0
0
null
null
null
null
UTF-8
Java
false
false
1,756
java
package lesson7; /*В классе DemoHomeWork создайте два метода createOrder() createOrderAndCallMethods() Первый метод должен возвращать объект класса Order с предыдущего ДЗ созданного с параметрами price = 100, dateCreated = текущая, isConfirmed = false, dateConfirmed = null, city = "Dnepr", country = "Ukraine", type = "Buy" Второй метод доллжен создавать объект с другими параметрами price = 100, dateCreated = текущая, isConfirmed = true, dateConfirmed = текущая, city = "Kiev", country = "Ukraine", type = "SomeValue" Вызывате все методы с класса Order через его объект и возвращать объект*/ import lesson6.Order; import java.util.Date; public class DemoHomeWork { Order createOrder() {//Order - тип возвращаемых данных Date dateCreated = new Date(); Order order = new Order(100, dateCreated, false, null, "Dnepr", "Ukraine", "Buy");//создание объекта класса и переприсвоение новыех значений полям класса return order; } Order createOrderAndCallMethods() {//Order - тип возвращаемых данных Date dateCreated = new Date(); Date dateConfirmed = new Date(); Order orderObject = new Order(100, dateCreated, true, dateConfirmed, "Kiev", "Ukraine", "SomeValue"); orderObject.isValidType(); orderObject.confirmOrder(); orderObject.checkPrice(); return orderObject; } }
[ "drednoyta1@ukr.net" ]
drednoyta1@ukr.net
fb02455d97810687229d56eee12403724a1d90a5
54565ff61051cd4ae3591455bc5f25205627a3ce
/src/com/tata/view/emoji/Places.java
2766e0e076ec090572cbaef869a8915241d34882
[]
no_license
bowen-code/TaTa
0504300df84455e1f1ed92f4bbf3694d98ef43a3
a8e1af5dd8857e94e77345e890796c6d99e5563c
refs/heads/master
2021-06-11T11:10:36.494885
2017-02-13T12:04:30
2017-02-13T12:04:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,476
java
/* * Copyright 2014 Ankush Sachdeva * * 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.tata.view.emoji; /** * @author Hieu Rocker (rockerhieu@gmail.com) */ public class Places { public static final Emojicon[] DATA = new Emojicon[]{ Emojicon.fromCodePoint(0x1f3e0), Emojicon.fromCodePoint(0x1f3e1), Emojicon.fromCodePoint(0x1f3eb), Emojicon.fromCodePoint(0x1f3e2), Emojicon.fromCodePoint(0x1f3e3), Emojicon.fromCodePoint(0x1f3e5), Emojicon.fromCodePoint(0x1f3e6), Emojicon.fromCodePoint(0x1f3ea), Emojicon.fromCodePoint(0x1f3e9), Emojicon.fromCodePoint(0x1f3e8), Emojicon.fromCodePoint(0x1f492), Emojicon.fromChar((char) 0x26ea), Emojicon.fromCodePoint(0x1f3ec), Emojicon.fromCodePoint(0x1f3e4), Emojicon.fromCodePoint(0x1f307), Emojicon.fromCodePoint(0x1f306), Emojicon.fromCodePoint(0x1f3ef), Emojicon.fromCodePoint(0x1f3f0), Emojicon.fromChar((char) 0x26fa), Emojicon.fromCodePoint(0x1f3ed), Emojicon.fromCodePoint(0x1f5fc), Emojicon.fromCodePoint(0x1f5fe), Emojicon.fromCodePoint(0x1f5fb), Emojicon.fromCodePoint(0x1f304), Emojicon.fromCodePoint(0x1f305), Emojicon.fromCodePoint(0x1f303), Emojicon.fromCodePoint(0x1f5fd), Emojicon.fromCodePoint(0x1f309), Emojicon.fromCodePoint(0x1f3a0), Emojicon.fromCodePoint(0x1f3a1), Emojicon.fromChar((char) 0x26f2), Emojicon.fromCodePoint(0x1f3a2), Emojicon.fromCodePoint(0x1f6a2), Emojicon.fromChar((char) 0x26f5), Emojicon.fromCodePoint(0x1f6a4), Emojicon.fromCodePoint(0x1f6a3), Emojicon.fromChar((char) 0x2693), Emojicon.fromCodePoint(0x1f680), Emojicon.fromChar((char) 0x2708), Emojicon.fromCodePoint(0x1f4ba), Emojicon.fromCodePoint(0x1f681), Emojicon.fromCodePoint(0x1f682), Emojicon.fromCodePoint(0x1f68a), Emojicon.fromCodePoint(0x1f689), Emojicon.fromCodePoint(0x1f69e), Emojicon.fromCodePoint(0x1f686), Emojicon.fromCodePoint(0x1f684), Emojicon.fromCodePoint(0x1f685), Emojicon.fromCodePoint(0x1f688), Emojicon.fromCodePoint(0x1f687), Emojicon.fromCodePoint(0x1f69d), Emojicon.fromCodePoint(0x1f68b), Emojicon.fromCodePoint(0x1f683), Emojicon.fromCodePoint(0x1f68e), Emojicon.fromCodePoint(0x1f68c), Emojicon.fromCodePoint(0x1f68d), Emojicon.fromCodePoint(0x1f699), Emojicon.fromCodePoint(0x1f698), Emojicon.fromCodePoint(0x1f697), Emojicon.fromCodePoint(0x1f695), Emojicon.fromCodePoint(0x1f696), Emojicon.fromCodePoint(0x1f69b), Emojicon.fromCodePoint(0x1f69a), Emojicon.fromCodePoint(0x1f6a8), Emojicon.fromCodePoint(0x1f693), Emojicon.fromCodePoint(0x1f694), Emojicon.fromCodePoint(0x1f692), Emojicon.fromCodePoint(0x1f691), Emojicon.fromCodePoint(0x1f690), Emojicon.fromCodePoint(0x1f6b2), Emojicon.fromCodePoint(0x1f6a1), Emojicon.fromCodePoint(0x1f69f), Emojicon.fromCodePoint(0x1f6a0), Emojicon.fromCodePoint(0x1f69c), Emojicon.fromCodePoint(0x1f488), Emojicon.fromCodePoint(0x1f68f), Emojicon.fromCodePoint(0x1f3ab), Emojicon.fromCodePoint(0x1f6a6), Emojicon.fromCodePoint(0x1f6a5), Emojicon.fromChar((char) 0x26a0), Emojicon.fromCodePoint(0x1f6a7), Emojicon.fromCodePoint(0x1f530), Emojicon.fromChar((char) 0x26fd), Emojicon.fromCodePoint(0x1f3ee), Emojicon.fromCodePoint(0x1f3b0), Emojicon.fromChar((char) 0x2668), Emojicon.fromCodePoint(0x1f5ff), Emojicon.fromCodePoint(0x1f3aa), Emojicon.fromCodePoint(0x1f3ad), Emojicon.fromCodePoint(0x1f4cd), Emojicon.fromCodePoint(0x1f6a9), Emojicon.fromChars("\ud83c\uddef\ud83c\uddf5"), Emojicon.fromChars("\ud83c\uddf0\ud83c\uddf7"), Emojicon.fromChars("\ud83c\udde9\ud83c\uddea"), Emojicon.fromChars("\ud83c\udde8\ud83c\uddf3"), Emojicon.fromChars("\ud83c\uddfa\ud83c\uddf8"), Emojicon.fromChars("\ud83c\uddeb\ud83c\uddf7"), Emojicon.fromChars("\ud83c\uddea\ud83c\uddf8"), Emojicon.fromChars("\ud83c\uddee\ud83c\uddf9"), Emojicon.fromChars("\ud83c\uddf7\ud83c\uddfa"), Emojicon.fromChars("\ud83c\uddec\ud83c\udde7"), }; }
[ "1304517442@qq.com" ]
1304517442@qq.com
54c370836842f66d5e7e2a43931e6c750d93e875
ccfdf34d358d048ee35186efff7713e7771b4d10
/src/main/java/com/web/BorrowController.java
ddf99e3e3b639d721cd750c08b614ae7b0e80487
[]
no_license
matriox1003/BookManagment-System
aaafecc49222f029e4ad5142e4393d0713eb92da
7ed124da54d933579e162be0f6a22197c2fdfedd
refs/heads/master
2023-03-12T17:18:03.830568
2021-02-27T13:08:12
2021-02-27T13:08:12
342,458,022
0
0
null
null
null
null
UTF-8
Java
false
false
1,904
java
package com.web; import java.io.IOException; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.entity.Users; import com.service.BorrowService; @Controller public class BorrowController { @Autowired private BorrowService borrowService; @ResponseBody @RequestMapping("/borrow/{bId}") public Map<String, Object> bookBorrow(@PathVariable int bId, HttpSession session, HttpServletResponse response ) { Map<String, Object> map = new HashMap<>(); Users user = (Users)session.getAttribute("user"); if (user == null) { try { response.sendRedirect("/login"); } catch (IOException e) { e.printStackTrace(); } return null; } int uId = user.getuId(); Integer affectRows = borrowService.insertBorrow(bId, uId); if (affectRows != 0) { map.put("status", 200); } else { map.put("status", 400); } return map; } @ResponseBody @RequestMapping("/return/{bId}") public Map<String, Object> bookReturn(@PathVariable int bId, HttpSession session) { Map<String, Object> map = new HashMap<>(); Users user = (Users)session.getAttribute("user"); int uId = user.getuId(); Integer affectRows = borrowService.updateBorrow(bId, uId); float penalty = borrowService.queryPenaltyById(bId, uId); borrowService.deleteBorrow(bId, uId); if (affectRows != 0) { map.put("status", 200); map.put("penalty", penalty); } else { map.put("status", 400); } return map; } }
[ "matriox1003@email.com" ]
matriox1003@email.com
d85f94b49ac080d8c1244c8891a121a7d634daa2
07879795b55dd97abb9cd084ac9712158650788a
/usite/src/com/chenjishi/u148/util/Constants.java
1785cbab448bcfadb10490f6dff413389d53861f
[ "MIT" ]
permissive
BreankingBad/usite
47d00e8c9a6a285c210f0be8d640399fc292ef8e
4e6284e504719f2b7ef3ac7ab380615b3c0dc96b
refs/heads/master
2020-12-01T01:15:15.024402
2015-02-08T10:47:46
2015-02-08T10:47:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,663
java
package com.chenjishi.u148.util; /** * Created with IntelliJ IDEA. * User: chenjishi * Date: 12-11-3 * Time: 下午6:59 * To change this template use File | Settings | File Templates. */ public class Constants { public static final String KEY_FEED = "feed"; public static final String KEY_FEED_LIST = "feed_list"; public static final String KEY_FEED_INDEX = "index"; public static final int MODE_DAY = 0; public static final int MODE_NIGHT = 1; public static final String EVENT_ARTICLE_SHARE = "ArticleShare"; public static final String EVENT_IMAGE_SHARE = "ArticleShare"; public static final String PARAM_TITLE = "title"; public static final String PARAM_URL = "url"; public static final String BASE_URL = "http://api.u148.net/json/"; public static final String API_FEED_LIST = BASE_URL + "%1$d/%2$d"; public static final String API_ARTICLE = BASE_URL + "article/%1$s"; public static final String API_ADD_FAVORITE = BASE_URL + "favourite?id=%1$s&token=%2$s"; public static final String API_DELETE_FAVORITE = BASE_URL + "del_favourite?id=%1$s&token=%2$s"; public static final String API_LOGIN = BASE_URL + "login"; public static final String API_REGISTER = BASE_URL + "register"; public static final String API_COMMENTS_GET = BASE_URL + "get_comment/%1$s/%2$d"; public static final String API_COMMENT_POST = BASE_URL + "comment"; public static final String API_FAVORITE_GET = BASE_URL + "get_favourite/0/%1$d?token=%2$s"; public static final String API_UPGRADE = BASE_URL + "version"; public static final String API_SEARCH = BASE_URL + "search/%1$d?keyword=%2$s"; }
[ "jishi@staff.xianguo.com" ]
jishi@staff.xianguo.com
150713750c15b21b7f287d56e678f78279efcc33
74c0d9045182918895e5b4b429db4b0dff831784
/src/com/lingnet/hcm/dao/laobao/WupinhistoryDao.java
018ae5d2f88eb7c35072b974025aafc09dc73cf1
[]
no_license
yuyuliuyu/LAOBAO
c7d43c5e0bb62caacdb81b9417aee1382cd560d7
b7e832d53ed6fd148d235d70db7ba6e868c5ca29
refs/heads/master
2020-03-15T10:40:21.773695
2018-05-08T06:10:09
2018-05-08T06:10:09
132,104,336
0
0
null
null
null
null
UTF-8
Java
false
false
221
java
package com.lingnet.hcm.dao.laobao; import java.util.HashMap; import com.lingnet.util.Pager; public interface WupinhistoryDao { HashMap<String, Object> getPersonByDepId(Pager pager, String searchData,String ids); }
[ "392544641@qq.com" ]
392544641@qq.com
2c17e3d932d9622e2898d86a66f644e52c86ac61
89e32bfd89e4fe1e6a6d21b49afd0a1c37e2d70a
/dtae/snippet250.java
c24b812c4e5e8e8187729ec35159ebaa0bc83764
[]
no_license
aqsa24/src
a622013d9bacbf1f3e9290390305a346c93f9e55
a3c3e723804c532815c31c0ebb134ca26b4e0c57
refs/heads/master
2021-01-19T15:39:13.630983
2014-12-29T09:37:58
2014-12-29T09:37:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,231
java
package dtae; import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class snippet250 { public static void main(String [] args) { final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new GridLayout()); final Text text = new Text(shell, SWT.SINGLE | SWT.BORDER); text.setLayoutData(new GridData(150, SWT.DEFAULT)); shell.pack(); shell.open(); final Shell popupShell = new Shell(display, SWT.ON_TOP); popupShell.setLayout(new FillLayout()); final Table table = new Table(popupShell, SWT.SINGLE); for (int i = 0; i < 5; i++) { new TableItem(table, SWT.NONE); } text.addListener(SWT.KeyDown, new Listener() { @Override public void handleEvent(Event event) { switch (event.keyCode) { case SWT.ARROW_DOWN: int index = (table.getSelectionIndex() + 1) % table.getItemCount(); table.setSelection(index); event.doit = false; break; case SWT.ARROW_UP: index = table.getSelectionIndex() - 1; if (index < 0) index = table.getItemCount() - 1; table.setSelection(index); event.doit = false; break; case SWT.CR: if (popupShell.isVisible() && table.getSelectionIndex() != -1) { text.setText(table.getSelection()[0].getText()); popupShell.setVisible(false); } break; case SWT.ESC: popupShell.setVisible(false); break; } } }); text.addListener(SWT.Modify, new Listener() { @Override public void handleEvent(Event event) { String string = text.getText(); if (string.length() == 0) { popupShell.setVisible(false); } else { TableItem[] items = table.getItems(); for (int i = 0; i < items.length; i++) { items[i].setText(string+2+3+4); } Rectangle textBounds = display.map(shell, null, text.getBounds()); popupShell.setBounds(textBounds.x, textBounds.y + textBounds.height, textBounds.width, 150); popupShell.setVisible(true); } } }); table.addListener(SWT.DefaultSelection, new Listener() { @Override public void handleEvent(Event event) { text.setText(table.getSelection()[0].getText()); popupShell.setVisible(false); } }); table.addListener(SWT.KeyDown, new Listener() { @Override public void handleEvent(Event event) { if (event.keyCode == SWT.ESC) { popupShell.setVisible(false); } } }); Listener focusOutListener = new Listener() { @Override public void handleEvent(Event event) { /* async is needed to wait until focus reaches its new Control */ display.asyncExec(new Runnable() { @Override public void run() { if (display.isDisposed()) return; Control control = display.getFocusControl(); if (control == null || (control != text && control != table)) { popupShell.setVisible(false); } } }); } }; table.addListener(SWT.FocusOut, focusOutListener); text.addListener(SWT.FocusOut, focusOutListener); shell.addListener(SWT.Move, new Listener() { @Override public void handleEvent(Event event) { popupShell.setVisible(false); } }); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
[ "aqsa_farooq2493@yahoo.com" ]
aqsa_farooq2493@yahoo.com
475827c50a683c95df4fa01626f1cc59415825d2
6283d5cc6d025f091b901ce3daa2e5ebea7ec538
/src/main/java/org/async/web/http/core/HTTPRequestProcessor.java
4d262dbc5d34f6c7931a6c68524d24882e0d17b3
[]
no_license
alun/async-web-server
7a931ce0e8a425c7bebd7a6a9c9b9b2ab673d595
b34ca26e1eb6a8a417eeabff1a321b8332dedad9
refs/heads/master
2021-01-10T19:51:03.443882
2010-06-21T11:32:48
2010-06-21T11:32:48
707,354
3
1
null
null
null
null
UTF-8
Java
false
false
4,501
java
package org.async.web.http.core; import java.io.IOException; import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; import java.nio.channels.WritableByteChannel; import java.util.HashMap; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import org.async.net.ClearableChannelProcessor; import org.async.net.io.ByteBufferASCIIReader; import org.async.net.io.ByteBufferWriter; import org.async.web.http.servlet.Controller; import org.async.web.http.servlet.FilterChain; import org.async.web.http.servlet.StateData; public class HTTPRequestProcessor implements ClearableChannelProcessor { private static Logger logger = Logger .getLogger("org.async.web.http.core.HTTPRequestProcessor"); private FilterChain filterChain; private class Data { Request request; Response response; ConnectionStatus status; StateData stateData; public Data(Request request, Response response, ConnectionStatus status) { super(); this.request = request; this.response = response; this.status = status; } } private ByteBufferASCIIReader reader; private Map<SelectionKey, Data> map = new HashMap<SelectionKey, Data>(); private ByteBufferWriter writer; public HTTPRequestProcessor() { } public void register(SelectionKey key, Request request, Response response) { key.attach(this); ConnectionStatus status = new ConnectionStatus(key); map.put(key, new Data(request, response, status)); if (filterChain != null) { request.setFilter(filterChain.initChain(request, response, status)); request.setChain(filterChain); } key.interestOps(SelectionKey.OP_WRITE | SelectionKey.OP_READ); } @Override public void accept(SelectionKey key) { throw new IllegalStateException(); } @Override public void connect(SelectionKey key) { throw new IllegalStateException(); } @Override public void close(SelectionKey key) { clear(key); try { key.channel().close(); key.cancel(); } catch (IOException e) { if (logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, e.getMessage(), e); } } } @Override public void read(SelectionKey key) { SocketChannel channel = (SocketChannel) key.channel(); try { reader.reset(); if (channel.read(reader.getBuffer()) == -1) { close(key); } } catch (IOException e) { close(key); if (logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, e.getMessage(), e); } } } @Override public void write(SelectionKey key) { Data data = map.get(key); writer.clear(); Controller<StateData> controller = data.request.getController(); if (data.stateData == null) { data.stateData = controller.createStateData(); } try { writer.setChannel((WritableByteChannel) key.channel()); if (data.request.getFilter() == null) { data.stateData = controller.handle(data.request, data.response, data.status, data.stateData); } else { data.request.getFilter().filter(data.request, data.response, data.status, filterChain); } writer.flush(); // TODO ConnectionStatus.close !response.close if (!data.status.isAlive()) { close(key); } } catch (HTTPException e) { if (logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, e.getMessage(), e); } try { HTTPStatusCodes.sendError(writer, e.getErrCode()); writer.close(); } catch (IOException e1) { } close(key); } catch (Exception e) { if (!data.response.isHeadersSent()) { try { HTTPStatusCodes.sendError(writer, 500); writer.close(); } catch (IOException e1) { } } if (logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, e.getMessage(), e); } close(key); } } public FilterChain getFilterChain() { return filterChain; } public void setFilterChain(FilterChain filterChain) { this.filterChain = filterChain; } public ByteBufferASCIIReader getReader() { return reader; } public void setReader(ByteBufferASCIIReader reader) { this.reader = reader; } public ByteBufferWriter getWriter() { return writer; } public void setWriter(ByteBufferWriter writer) { this.writer = writer; } @Override public void clear(SelectionKey key) { Data data = map.remove(key); if (data != null && data.stateData != null) { data.stateData.close(); } } @Override public boolean isFree(SelectionKey key) { return false; } @Override public boolean isService(SelectionKey key) { return false; } }
[ "mikhail.vorozhtsov@gmail.com" ]
mikhail.vorozhtsov@gmail.com
59c68c19dfb74cfcd164152a99b3f27b8fd35711
108a8b37dbb88cb7aa9dc8899d678a4d0082268f
/jFrame/src/jframe_main/Assignment_Listener.java
c61833ace0a52743b4d5fa19c3a236456bffbf29
[]
no_license
marietudiant-ray/internship
301c10eb5c1bc41e7a5c8853283aed774716ee24
73aa07924903cd90cdf1b877995ece3e8efd8801
refs/heads/master
2021-01-13T15:16:40.599925
2016-12-12T06:09:35
2016-12-12T06:09:35
76,227,042
0
0
null
null
null
null
UTF-8
Java
false
false
515
java
package jframe_main; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.SQLException; public class Assignment_Listener implements ActionListener { private Jframe_main adapter; public Assignment_Listener(Jframe_main adapter) { this.adapter=adapter; } public void actionPerformed(ActionEvent actionevent) { try { adapter.item5_actionPerformed(actionevent); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
[ "marietudiant@hotmail.com" ]
marietudiant@hotmail.com
6062d233e272daf8245acf7c9f166b5a1279806c
b7cea50957b8c2fe602bf4e6b1344ff28f8e94e8
/src/main/java/com/lucky/config/Swagger2Config.java
edd73396b7665ae28ea22ebfb6aaaeadbcb710e6
[]
no_license
xyptnjxn/lBlog
84822e8fbec4d8d5187cdb7ee653efc0d8068e9a
1ddc3b2eea2614eceab5ad666ef412925169e8a7
refs/heads/master
2023-05-28T13:24:51.743155
2021-06-20T15:31:05
2021-06-20T15:31:05
378,067,128
0
0
null
null
null
null
UTF-8
Java
false
false
4,102
java
package com.lucky.config; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.*; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.service.contexts.SecurityContext; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; import java.util.ArrayList; import java.util.List; /** * @author yunqing * @date 2019/12/17 10:23 */ @Configuration @EnableSwagger2 public class Swagger2Config extends WebMvcConfigurationSupport { @Bean public Docket createRestApi(){ return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .select() //为当前包下controller生成API文档 // .apis(RequestHandlerSelectors.basePackage("com.troila")) //为有@Api注解的Controller生成API文档 .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) //为有@ApiOperation注解的方法生成API文档 .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) //为任何接口生成API文档 // .apis(RequestHandlerSelectors.any()) .paths(PathSelectors.any()) .build(); //添加登录认证 /*.securitySchemes(securitySchemes()) .securityContexts(securityContexts());*/ } private ApiInfo apiInfo() { Contact contact = new Contact("lucky", "", "lucky****@gmail.com"); return new ApiInfoBuilder() .title("lblog接口文档") .description("lblog接口文档,描述词省略200字") .contact(contact) .version("1.0") .build(); } /** * 配置swagger2的静态资源路径 * @param registry */ @Override protected void addResourceHandlers(ResourceHandlerRegistry registry) { // 解决静态资源无法访问 registry.addResourceHandler("/**") .addResourceLocations("classpath:/static/"); // 解决swagger无法访问 registry.addResourceHandler("/swagger-ui.html") .addResourceLocations("classpath:/META-INF/resources/"); // 解决swagger的js文件无法访问 registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/"); } /** * 给API文档接口添加安全认证 */ /*private List<ApiKey> securitySchemes() { List<ApiKey> apiKeys = new ArrayList<>(); apiKeys.add(new ApiKey("Authorization", "Authorization", "header")); return apiKeys; } private List<SecurityContext> securityContexts() { List<SecurityContext> securityContexts = new ArrayList<>(); securityContexts.add(SecurityContext.builder() .securityReferences(defaultAuth()) .forPaths(PathSelectors.regex("^(?!auth).*$")).build()); return securityContexts; } private List<SecurityReference> defaultAuth() { AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; authorizationScopes[0] = authorizationScope; List<SecurityReference> securityReferences = new ArrayList<>(); securityReferences.add(new SecurityReference("Authorization", authorizationScopes)); return securityReferences; }*/ }
[ "3170105375@zju.edu.cn" ]
3170105375@zju.edu.cn
e2a7291337367a073bfd3d5722e0173cf312bb85
567867028ed8f6608e174a63e0b05a0fd6323d2b
/src/oba/bank/money/Bank.java
6518ceeb1a55bf163baffb0d7484b78f012d119d
[ "MIT" ]
permissive
blueturtle1134/OBA-bot
c66fe78d78224d9fb69511c79de9b36af16e76ed
bfbfd897359392c9f4e2138c52398051ffcdf21a
refs/heads/master
2020-08-22T16:15:14.843928
2019-11-17T00:46:18
2019-11-17T00:46:18
216,434,754
0
0
MIT
2019-11-17T00:43:48
2019-10-20T22:17:47
Java
UTF-8
Java
false
false
4,179
java
package oba.bank.money; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; import net.dv8tion.jda.api.entities.User; import oba.bank.bot.BankApplication; @JsonSerialize(using = Bank.BankSerializer.class) @JsonDeserialize(using = Bank.BankDeserializer.class) public class Bank { private Map<Long, Account> accounts; private long wringTime; private Map<String, Long> aliases; public long getWringTime() { return wringTime; } public void resetWring() { wringTime = System.currentTimeMillis(); } public Bank() { accounts = new HashMap<Long, Account>(); } public Account getAccount(long id) { if(!accounts.containsKey(id)) { open(BankApplication.getDiscord().getUserById(id)); } return accounts.get(id); } public int getBalance(long id) { if(!accounts.containsKey(id)) { open(BankApplication.getDiscord().getUserById(id)); } return accounts.get(id).getBalance(); } public void open(User user) { Account newAccount = new Account(user.getIdLong(), user.getName()); accounts.put(user.getIdLong(), newAccount); BankApplication.log("Created new account for "+newAccount.getName()+" ("+user.getIdLong()+")"); } public void change(long id, int delta) { if(!accounts.containsKey(id)) { open(BankApplication.getDiscord().getUserById(id)); } Account account = accounts.get(id); account.setBalance(account.getBalance()+delta); } public boolean addAlias(String alias, long account) { if(!aliases.containsKey(alias)&&accounts.containsKey(account)) { aliases.put(alias, account); return true; } return false; } public Account getAccount(String alias) { return accounts.get(aliases.get(alias)); } public void save(File saveFile) { ObjectMapper mapper = new ObjectMapper(); try { mapper.writeValue(saveFile, this); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static class BankSerializer extends StdSerializer<Bank> { private static final long serialVersionUID = 1L; public BankSerializer() { this(null); } public BankSerializer(Class<Bank> t) { super(t); } @Override public void serialize(Bank bank, JsonGenerator generator, SerializerProvider provider) throws IOException { generator.writeStartObject(); generator.writeArrayFieldStart("accounts"); for(Long a : bank.accounts.keySet()) { generator.writeObject(bank.accounts.get(a)); } generator.writeEndArray(); generator.writeNumberField("last_wring", bank.wringTime); generator.writeObjectField("aliases", bank.aliases); generator.writeEndObject(); } } public static class BankDeserializer extends StdDeserializer<Bank>{ private static final long serialVersionUID = 1L; public BankDeserializer() { this(null); } public BankDeserializer(Class<Bank> vc) { super(vc); } @SuppressWarnings("unchecked") @Override public Bank deserialize(JsonParser parser, DeserializationContext context) throws IOException, JsonProcessingException { Bank bank = new Bank(); JsonNode node = parser.getCodec().readTree(parser); ObjectMapper mapper = new ObjectMapper(); for(Account a : mapper.treeToValue(node.get("accounts"), Account[].class)) { bank.accounts.put(a.id, a); } bank.wringTime = mapper.treeToValue(node.get("last_wring"), long.class); bank.aliases = new HashMap<String, Long>(); bank.aliases = mapper.treeToValue(node.get("aliases"), bank.aliases.getClass()); return bank; } } }
[ "blueturtle1134@gmail.com" ]
blueturtle1134@gmail.com
87d21edf6b0d2e3277ece4d0c17ef95ff168ac2d
762a3b099b800ad8a82cd125e573befc048f8806
/src/IoT/HiveQueryExecutor.java
d671e68a8f5aa3bc105a6ed76f344c87d08d985a
[ "Apache-2.0" ]
permissive
Prashanth-Billa/Blaze-IoT-Analytics
a9d0def84368e48bb4613bb059a0ca4239175ccb
f9adad1880374495b208f019a06e47e185e43c1e
refs/heads/master
2021-01-15T14:31:18.260332
2016-06-14T01:33:52
2016-06-14T01:33:52
59,083,477
0
1
null
null
null
null
UTF-8
Java
false
false
2,410
java
package IoT; import java.net.ConnectException; import java.sql.*; public class HiveQueryExecutor { private static String driverName = "org.apache.hive.jdbc.HiveDriver"; public static String executeQuery(String query) throws SQLException { try {Class.forName(driverName); } catch (ClassNotFoundException e) { e.printStackTrace(); return "error :" + e.getMessage(); } StringBuilder str = new StringBuilder(); Connection con = null; Statement stmt = null; try{ // con = DriverManager.getConnection("jdbc:hive2://localhost:10000/default", "hadoop", ""); con = DriverManager.getConnection("jdbc:hive2://blazeEngine.azurehdinsight.net:443/default;ssl=true?hive.server2.transport.mode=http;hive.server2.thrift.http.path=/hive2", "blazeEngine", "January@2016"); stmt = con.createStatement(); }catch(SQLException e){ return "Please check the Connection to HDFS and Hive. Please validate the query." + e.getLocalizedMessage(); } catch(Exception e){ return "Please check the Connection to HDFS and Hive. Please validate the query." + e.getLocalizedMessage(); } ResultSet res = null; String r = ""; ResultSetMetaData resMeta = null; if(query.contains("DROP TABLE") || query.contains("CREATE TABLE") || query.contains("LOAD DATA")){ stmt.executeUpdate(query); stmt.close(); con.close(); return ""; }else{ res = stmt.executeQuery(query); resMeta = res.getMetaData(); while (res.next()) { for (int i = 1; i <= resMeta.getColumnCount(); i++) { int type = resMeta.getColumnType(i); if (type == Types.VARCHAR || type == Types.CHAR) { r = res.getString(i); r = r.replaceAll(" ", "_"); str.append(r); str.append(" "); } else { str.append(String.valueOf(res.getLong(i))); str.append(" "); } } str.append("<br/>"); } res.close(); stmt.close(); con.close(); return str.toString(); } } }
[ "pbilla@uci.edu" ]
pbilla@uci.edu
b8fead4ebb2743a5660728311595a3a21764757c
28e9ff6b879ffb632d87cb9af6f597d35f759993
/javaBeiFeng/src/main/java/ObServer/Person.java
e45b9531f13b19ab984e42716bcf9cd994f0b69e
[]
no_license
ncutlh/DesignPatternAll
d7bdac2f0757342ede6bf3afc0b777112bccc971
ca043344618e558754945fe6a7eb1ce0c56026d8
refs/heads/master
2020-04-17T20:36:39.054363
2019-01-30T08:56:07
2019-01-30T08:56:07
166,913,237
0
0
null
null
null
null
UTF-8
Java
false
false
595
java
package ObServer; import java.util.Observable; public class Person extends Observable { private String name; private String sex; private int age; public String getName() { return name; } public void setName(String name) { this.name = name; this.setChanged(); this.notifyObservers(); } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; this.setChanged(); this.notifyObservers(); } public int getAge() { return age; } public void setAge(int age) { this.setChanged(); this.notifyObservers(); this.age = age; } }
[ "liuhong" ]
liuhong
bbdf0c927207ea45832502fa70419624bf40bb88
d2fc1ca2d1be290e5089f08953bb729e1d5d608e
/app/src/main/java/br/com/testes/ecofacil/UserInterface/MapsExperiment/MapsFragment.java
6604a1af410fcd5e9a78bfdf55bc7ebded51deca
[]
no_license
shcpMindCrazy/EcoFacilApplication
7406ac8b910c519c251dc4eaba02d0cb0e9a7424
8da98f09502f66f0168cc345430b54869066e833
refs/heads/master
2020-03-15T18:25:32.907541
2018-05-05T23:25:34
2018-05-05T23:25:34
132,283,290
0
0
null
null
null
null
UTF-8
Java
false
false
9,286
java
package br.com.testes.ecofacil.UserInterface.MapsExperiment; import android.Manifest; import android.content.pm.PackageManager; import android.location.Location; import android.location.LocationManager; import android.net.http.AndroidHttpClient; import android.os.Build; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.ActivityCompat; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v4.content.ContextCompat; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.location.LocationListener; import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationServices; import com.google.android.gms.maps.CameraUpdate; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.GoogleMapOptions; import com.google.android.gms.maps.MapView; import com.google.android.gms.maps.MapsInitializer; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.CameraPosition; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.Polyline; import org.apache.http.HttpResponse; import org.apache.http.client.CookieStore; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.protocol.ClientContext; import org.apache.http.impl.client.BasicCookieStore; import org.apache.http.protocol.BasicHttpContext; import org.apache.http.protocol.HttpContext; import org.apache.http.util.EntityUtils; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; import br.com.testes.ecofacil.R; /** * Created by samue on 02/03/2018. */ public class MapsFragment extends Fragment implements OnMapReadyCallback, GoogleApiClient.OnConnectionFailedListener, GoogleApiClient.ConnectionCallbacks, LocationListener { //Componentes do Google Maps; public static final int MY_PERMISSIONS_REQUEST_LOCATION = 99; //Instanciamos esta variável para perminssão da Requisição de Localicação private GoogleApiClient mGoogleApiClient; //Instanciamos as configurações de API; private GoogleMap mGoogleMap; //Instanciamos o mapa de Google API; private MapView mapView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceStatus) { Log.i("Script", "MapsFragment.onCreateView()"); View viewMaps = inflater.inflate(R.layout.fragment_maps, container, false); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { checkLocationPermission(); } return viewMaps; } /* LISTENERS - OnMapReadyCallback */ @Override public void onMapReady(GoogleMap googleMap) { Log.i("Script", "MapsFragment.onMapReady()"); mGoogleMap = googleMap; mGoogleMap.getUiSettings().setMyLocationButtonEnabled(true); if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { // TODO: Consider calling // ActivityCompat#requestPermissions // here to request the missing permissions, and then overriding // public void onRequestPermissionsResult(int requestCode, String[] permissions, // int[] grantResults) // to handle the case where the user grants the permission. See the documentation // for ActivityCompat#requestPermissions for more details. return; } mGoogleMap.setMyLocationEnabled(true); //Initialize Google Play Services - Verificamos se esta aplicação possui a permissão necessária if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(getActivity(), //Esta declarada no XML - Manifest Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { //Iniciamos a API da Google connectionAPI(); //E a nossa localização atual é fornecida; mGoogleMap.setMyLocationEnabled(true); } } else { //Iniciamos a API da Google connectionAPI(); //E a nossa localização atual é fornecida; mGoogleMap.setMyLocationEnabled(true); } } /* LISTENERS - GoogleApiClient */ @Override public void onConnected(@Nullable Bundle bundle) { Log.i("Script.GoogleApiClient", "MapsFragment.onConnected()"); } @Override public void onConnectionSuspended(int i) { Log.i("Script.GoogleApiClient", "MapsFragment.onConnectionSuspended()"); } @Override public void onConnectionFailed(@NonNull ConnectionResult connectionResult) { Log.i("Script.GoogleApiClient", "MapsFragment.onConnectionFailed()"); } /* LISTENERS - LocationListener */ @Override public void onLocationChanged(Location location) { Log.i("Script.LocationListener", "MapsFragment.onLocationChanged()"); } /* LISTENERS - onCreateView */ @Override public void onResume() { //Android monitor annotation; Log.i("Script.MapsAPI", "MapsFragment.onResume()"); mapView.onResume(); super.onResume(); } @Override public void onPause() { //Android monitor annotation; Log.i("Script.MapsAPI", "MapsFragment.onPause()"); super.onPause(); mGoogleApiClient.disconnect(); mapView.onPause(); } @Override public void onDestroy() { //Android monitor annotation; Log.i("Script.MapsAPI", "MapsFragment.onDestroy()"); super.onDestroy(); mapView.onDestroy(); } @Override public void onLowMemory() { //Android monitor annotation; Log.i("Script.MapsAPI", "MapsFragment.onLowMemory()"); super.onLowMemory(); mapView.onLowMemory(); } /* MÉTODOS DE CONEXÃO DE API */ //Método de conexão de API - Synchronized permite que a execução deste seja em fila, organizada e sem atroplelos; private synchronized void connectionAPI() { Log.i("LOG", "EmergencyActivity.connectionAPI()"); //Configurações para a conexão da API LOCATION; mGoogleApiClient = new GoogleApiClient.Builder(getActivity()) .addOnConnectionFailedListener(this) .addConnectionCallbacks(this) .addApi(LocationServices.API) .build(); mGoogleApiClient.connect(); } /* MÉTODOS DE PERMISSÕES DE EXECUÇÃO; */ //Solicitação da permissão do uso de GPS; public boolean checkLocationPermission() { //Registramos o evento no Android Monitor; Log.i("Script.Permission", "MapsFragment.checkLocationPermission()"); if (ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { // Asking user if explanation is needed if (ActivityCompat.shouldShowRequestPermissionRationale(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION)) { // Show an expanation to the user *asynchronously* -- don't block // this thread waiting for the user's response! After the user // sees the explanation, try again to request the permission. //Prompt the user once explanation has been shown ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, MY_PERMISSIONS_REQUEST_LOCATION); } else { // No explanation needed, we can request the permission. ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, MY_PERMISSIONS_REQUEST_LOCATION); } return false; } else { return true; } } }
[ "samuel.paula11@etec.sp.gov.br" ]
samuel.paula11@etec.sp.gov.br
41f61fabec3cefe9e24be099700eb4352bc2665b
ff52e960f7adc44589c02b1f21fe7cd968b370e0
/Exámenes/Trimestre 1/Examen 1/Modelo b/Ex22img1.java
e2fcc5b67a072796f44f59293365b0532846c085
[]
no_license
IsmaelMaldo/Ejercicios-Java
5ba4894967477866600c16be331290dcc550f22e
0d74e0ef323bda7c76995d6cd642d1177b6fbbf2
refs/heads/master
2021-01-10T18:11:33.376941
2017-05-25T11:20:29
2017-05-25T11:20:29
70,040,322
3
0
null
null
null
null
UTF-8
Java
false
false
2,624
java
/* Ejercicio 1 * * @author Ismael Maldonado González * date 15/11/2016 * modelo B */ public class Ex22img1 { public static void main(String[] args){ // Realizando el cuestionario para la tarta System.out.printf("Elija un sabor (manzana, fresa o chocolate): "); String tarta = System.console().readLine().toLowerCase(); String choco = ""; if (tarta.equals("chocolate")) { System.out.printf("¿Qué tipo de chocolate quiere? (negro o blanco): "); choco = System.console().readLine().toLowerCase(); } System.out.printf("¿Quiere nata? (si o no): "); String nata = System.console().readLine().toLowerCase(); System.out.printf("¿Quiere ponerle un nombre? (si o no): "); String nombre = System.console().readLine().toLowerCase(); //Procesando las opciones double precio_tarta = 0; double nata_precio = -1; double nombre_precio = -1; switch (tarta) { case "chocolate": if (choco.equals("negro")) { precio_tarta = 14; } else if (choco.equals("blanco")) { precio_tarta = 15; } break; case "manzana": precio_tarta = 18; break; case "fresa": precio_tarta = 16; break; default: precio_tarta = 0; } if (nata.equals("si")) { nata_precio = 2.50; } else if (nata.equals("no")) { nata_precio = 0; } if (nombre.equals("si")) { nombre_precio = 2.75; } else if (nombre.equals("no")) { nombre_precio = 0; } // Realizando la impresión de las opciones elegidas System.out.println(precio_tarta); System.out.println(nata_precio); System.out.println(nombre_precio); // Según los condicionales que hemos puesto anteriormente, si el // precio de la tarta es menor de 10, el precio de la nata menor que // 0 y el precio del nombre menor que 0, cosa que según los // los requisitos del ejercicio es imposible, significa que algunas // de las opciones introducidas están mal if ((precio_tarta < 10) || (nata_precio < 0) || (nombre_precio < 0)) { System.out.printf("Error, alguna de las opciones introducidas no son correctas."); } else { System.out.printf("Tarta de %s: %.2f\n", tarta, precio_tarta); if (nata_precio > 1) { System.out.println("Con nata: 2'50"); precio_tarta = precio_tarta + nata_precio; } if (nombre_precio > 1) { System.out.println("Con nombre: 2'75"); precio_tarta = precio_tarta + nombre_precio; } System.out.printf("Total: %.2f\n", precio_tarta); } } }
[ "isma.forsaken@gmail.com" ]
isma.forsaken@gmail.com
d839b268c89346054cfa37088a79d1aaafb5290d
505b1cadeb686737f7b0ddbc2c5db7e9a05e06fd
/Deitel/src/JuegosMesa/Process.java
3d50623a32271541bc08cf9f81105bfbdb1085a7
[]
no_license
DanielMagallon/Programacion_en_Java
a6763f8982219651e37bcb475ce25b089b27a7bd
7237526546a5a39b200749a13c2f2a0be37ee68a
refs/heads/master
2022-02-04T09:29:34.781897
2019-08-02T05:45:49
2019-08-02T05:45:49
169,850,246
0
0
null
null
null
null
UTF-8
Java
false
false
53
java
package JuegosMesa; public class Process { }
[ "danielmagallon123@gmail.com" ]
danielmagallon123@gmail.com
1c2c4000e5a8457e89e99d1c4f0cfa78d7c65528
4cbf54777310ea81d8d9de47921efc008a0158dc
/Unit3_ImplementingObjectOrientedDesign/SelfDrivingCarBroken/src/ui/SelfDrivingCar.java
40a86629788deb5f9ae3b4961338224724bb4163
[]
no_license
chriswolfdesign/SoftwareConstruction_ObjectOrientedDesign
7a2bf6b34eee07213d2235e6e60f890184974c28
5816f38e49a85074ed90f6ceb38efa999c187962
refs/heads/master
2021-04-12T10:58:22.311895
2018-09-10T18:32:03
2018-09-10T18:32:03
126,343,175
0
0
null
null
null
null
UTF-8
Java
false
false
1,396
java
package ui; import model.*; import java.util.List; import java.util.ArrayList; public class SelfDrivingCar { private List<Wheel> wheels = new ArrayList<Wheel>(); private List<Brake> brakes = new ArrayList<Brake>(); private SpeedRegulator speedRegulator; private Engine engine; private Speedometer speedometer; private FrontSensor frontSensor; public SelfDrivingCar(int numSecondsToTest) { setup(); AutoDriver driver = new AutoDriver(this); driver.driveForward(numSecondsToTest); } private void setup() { engine = new Engine(); speedometer = new Speedometer(this); speedRegulator = new SpeedRegulator(this); frontSensor = new FrontSensor(); for (int i = 0; i < 4; i++) { Brake b = new Brake(); brakes.add(b); Wheel w = new Wheel(); wheels.add(w); b.setWheel(w); } } // getters public FrontSensor getFrontSensor() { return frontSensor; } public SpeedRegulator getSpeedRegulator() { return speedRegulator; } public Engine getEngine() { return engine; } public List<Brake> getBrakes() { return brakes; } public Speedometer getSpeedometer() { return speedometer; } public List<Wheel> getWheels() { return wheels; } public static void main(String[] args) { SelfDrivingCar car = new SelfDrivingCar(10); } }
[ "chriswolf@Chriss-MacBook-Pro.local" ]
chriswolf@Chriss-MacBook-Pro.local
d1a7d075d35713f5011225426671d3a9c6cce7dc
e43dd67e87ab40d281082b0d7756b63bcbe10948
/src/java/com/daleyzou/algorithm/SortArray.java
6a12f0be2bf7172a439c75b2f0541b1db9c277ee
[]
no_license
daleyzou/Interview
69cd19d4f22720f71a6ab861546d0d99d1d2a26e
0460d45dd9e5d2789bd987b8c745b7a99f98a7fb
refs/heads/master
2023-08-23T23:58:50.773224
2023-08-16T13:54:40
2023-08-16T13:54:40
141,951,919
0
1
null
null
null
null
UTF-8
Java
false
false
1,270
java
package com.daleyzou.algorithm; import java.util.*; /** * @Author: DaleyZou * @Description: 对 一个int数组 candidates 数组进行排序、去重 * @Date: Created in 10:43 2018-8-23 * @Modified By: */ public class SortArray { public static void main(String[] args){ /** 思路: 1、使用 HashSet 进行去重 2、将 HashSet 变为 TreeSet 3、使用 TreeSet 进行排序 4、将 Set 变为 Integer 数组 5、将 Integer 数组变为 int 数组 */ int[] candidates = {1,1,2,2,2,9,8,7,76,84,54,45}; // 初始化一个需要排序、去重的int数组 HashSet<Integer> hashSet = new HashSet<Integer>(); // 去重 for (int i = 0; i < candidates.length; i++){ hashSet.add(candidates[i]); } Set<Integer> set = new TreeSet(hashSet); // 利用TreeSet排序 Integer[] integers = set.toArray(new Integer[]{}); int[] result = new int[integers.length]; // 我们排序、去重后的结果数组 for (int i = 0; i < integers.length; i++){ result[i] = integers[i].intValue(); } Arrays.stream(result).forEach(System.out::println); // 将结果数组输出 } }
[ "daleyzou@163.com" ]
daleyzou@163.com
601c801ef629563fedb3d73fe2c5285b1480c723
33775e8e8d3acb98216f0f66b77173c4df4c0fb3
/src/main/java/ui/WaveListener.java
6074ffb3b1d2d087a7b8104ef80a2d19ab1731a3
[]
no_license
jontejj/lipid-bilayer
dfc537b184ad89fae6cbff0903d9659d6bf130d3
ffe3d9832c3d9630c6228691f920be8e9660a766
refs/heads/main
2023-03-30T00:46:23.175750
2021-03-25T08:56:02
2021-03-25T08:56:02
351,367,540
0
0
null
null
null
null
UTF-8
Java
false
false
2,430
java
/* Copyright 2018 jonatanjonsson * * 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 ui; import javafx.application.Platform; import javafx.collections.ObservableList; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.shape.Line; import physics.ObjectUpdatedListener; import physics.PhysicalObject; import physics.Vec2; @SuppressWarnings("restriction") public class WaveListener implements ObjectUpdatedListener { private final Group waveGroup; private double previousEndX; private double previousEndY; private int memory; private int index; public WaveListener(int memory, Vec2 start, Group waveGroup) { this.memory = memory; this.previousEndX = start.magnitude(); this.previousEndY = start.direction(); this.waveGroup = waveGroup; ObservableList<Node> children = waveGroup.getChildren(); for(int i = 0; i < memory; i++) { children.add(new Line(previousEndX, previousEndY, previousEndX, previousEndY)); } // Arc arc = new Arc(); // arc.setCenterX(50.0f); // arc.setCenterY(50.0f); // arc.setRadiusX(50.0f); // arc.setRadiusY(50.0f); // arc.setStartAngle(180.0f); // arc.setLength(180.0f); // arc.setStrokeWidth(1); // arc.setStroke(Color.CORAL); // arc.setStrokeType(StrokeType.INSIDE); // arc.setFill(null); // arc.setType(ArcType.OPEN); } @Override public void wasRotated(PhysicalObject obj, int newTotalDegrees) { } @Override public void newPosition(PhysicalObject obj, Vec2 pos) { Line line = (Line) waveGroup.getChildren().get(index % memory); final double cPreviousEndX = previousEndX; final double cpreviousEndY = previousEndY; Platform.runLater(() -> { line.setStartX(cPreviousEndX); line.setStartY(cpreviousEndY); line.setEndX(pos.magnitude()); line.setEndY(pos.direction()); }); previousEndX = pos.magnitude(); previousEndY = pos.direction(); index++; } }
[ "jontejj@gmail.com" ]
jontejj@gmail.com
22a3a2da9ca2605e24ec6ed5ef9052675b76cb1b
5dfe78a5ae9e6f77cc5969df11284d44d0a415d5
/app/src/main/java/com/appslelo/ebgsoldier/utils/Constant.java
911ca9c4abc4ae90f6371b8137d85793060c0aeb
[]
no_license
cmFodWx5YWRhdjEyMTA5/EbgSoldier
95c4baa96058755e04d063373ee81e7ce6100cb3
5acb6498c3ff39236a91570d6a60d07a06e8ec3e
refs/heads/master
2020-07-02T06:53:20.227953
2019-08-09T06:26:28
2019-08-09T06:26:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,429
java
package com.appslelo.ebgsoldier.utils; public class Constant { public static final int xOffSet = 0 ; public static final int yOffSet =50 ; public static final String TAG = "tsfapps"; public static final String YOUTUBE_LINK = "youtube_link"; public static final String YOUTUBE_URL = "https://www.youtube.com/watch?v="; public static final String FORGOT_PASS_LINK = "https://www.ebgsoldier.com/forgot_password/password_forgot.php"; public static final String IMAGE_URL = "http://earnbygame.com/uploads/match_image/"; public static final String DATE_FORMAT_dd_MMMM_yyyy = "dd MMMM yyyy"; public static final String DATE_FORMAT_yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss"; public static final String TIME_FORMAT_hh_mm = "hh:mm a"; public static final String APP_URL = "app_url"; public static final String TSF_SHARED_PREFENCE = "apartment_shared_pref"; public static final String ID = "str_id"; public static final String USER_WALLET = "user_wallet"; public static final String USER_BONUS = "user_bonus"; public static final String USER_ID = "user_id"; public static final String USER_TOTAL_KILL = "total_kill"; public static final String USER_RANK = "user_rank"; public static final String USER_LEVEL = "user_level"; public static final String USER_DOJ = "user_doj"; public static final String USER_PRO_PIC = "user_pic"; public static final String USER_STATUS = "user_status"; public static final String USER_NAME = "user_name"; public static final String USER_PUBG_NAME = "pubg_name"; public static final String USER_DOB ="uaer_flat_no"; public static final String USER_PHONE_NO="user_phone_no"; public static final String USER_EMAIL="user_email"; public static final String USER_REFERRAL_CODE ="user_padhar_no"; public static final String USER_NO_OF_REFERRAL ="user_apartment"; public static final String USER_MATCH_PLAYED ="user_area"; public static final String USER_TOTAL_EARNED ="user_city"; public static final String USER_ADDRESS ="user_address"; public static final String USER_LOCATION ="user_location"; public static final String USER_ADDED_AMOUNT ="user_pin_no"; public static final String EMPTY=""; public static final String SOON="This service will start soon..."; public static final String SERVICE_NOT="Service Not Available."; public static final int SHOW_PROGRESS_DIALOG = 1001; public static final int HIDE_PROGRESS_DIALOG = 1002; public static final long HIDE_PROGRESS_DIALOG_DELAY = 500; public static final String MID = "MID"; public static final String ORDER_ID = "ORDER_ID"; public static final String CUST_ID = "CUST_ID"; public static final String MOBILE_NO = "MOBILE_NO"; public static final String EMAIL = "EMAIL"; public static final String CHANNEL_ID = "CHANNEL_ID"; public static final String TXN_AMOUNT = "TXN_AMOUNT"; public static final String WEBSITE = "WEBSITE"; public static final String INDUSTRY_TYPE_ID = "INDUSTRY_TYPE_ID"; public static final String CALLBACK_URL = "CALLBACK_URL"; public static final String CHECKSUMHASH = "CHECKSUMHASH"; public static final String TXN_SUCCESS = "TXN_SUCCESS"; public static final String STATUS = "STATUS"; public static final String RESPMSG = "RESPMSG"; public static final String Txn_Success = "Txn Success"; }
[ "appslelo.com@gmail.com" ]
appslelo.com@gmail.com
1bd2935f08c47919e0ddcdbff5ac14020bc09445
397dff7aa444dc0a1d380b483365bf7e812936d9
/twister-ga/tga-src/edu/indiana/cs/salsa/twisterga/TgaMapTask.java
172630a9113ac3a545cb3bb04839179a61719a55
[]
no_license
dogatuncay/GA_Twister_Hadoop
364c3636bb464dbeed0e33c95bb985288eac6fd2
c355a6a26757147282ab77ed28e8c431c3b2a3bb
refs/heads/master
2021-03-12T20:20:38.550716
2012-11-03T18:55:25
2012-11-03T18:55:25
2,718,045
3
2
null
null
null
null
UTF-8
Java
false
false
2,586
java
package edu.indiana.cs.salsa.twisterga; import java.util.Random; import java.util.Vector; import cgl.imr.base.Key; import cgl.imr.base.MapOutputCollector; import cgl.imr.base.MapTask; import cgl.imr.base.TwisterException; import cgl.imr.base.Value; import cgl.imr.base.impl.JobConf; import cgl.imr.base.impl.MapperConf; import cgl.imr.types.StringKey; public class TgaMapTask implements MapTask { private int numReduceTasks = 0; public void close() throws TwisterException { //TODO Auto-generated method stub } //currently, Tga no static data to load public void configure(JobConf jobConf, MapperConf mapConf) throws TwisterException { this.numReduceTasks = jobConf.getNumReduceTasks(); //TODO Figure out what kind of static data I can put here /* this.jobConf = jobConf; FileData fileData = (FileData) mapConf.getDataPartition(); try { System.out.println(fileData.getFileName()); } catch (Exception e) { throw new TwisterException(e); } */ } /* * calculate the fitness value of each gene and emit genes to reducers * the emit key-value pair is <geneId, gene> */ public void map(MapOutputCollector collector, Key key, Value val) throws TwisterException { System.out.println("Tga Map starts here"); Population subPop = (Population)val; Vector<Gene> vecGene = subPop.getGenePool(); System.out.println("Mapper: " + this.toString() + "Gene vec size: " + vecGene.size()); Random rand = new Random(); for (int i = 0; i < vecGene.size(); i++) { Gene gene = vecGene.get(i); gene.setGeneId(rand.nextInt()); gene.calcFitValue(); } int keyNo = 0; for (Gene gene : subPop.getGenePool()) { //System.out.println("collect gene: " + gene.getGeneId()); //collector.collect(new StringKey("" + gene.getGeneId()), gene); //key should be a integer mod number of reducers so the workload can be distributed uniformly System.out.println("geneId " + gene.getGeneId()); collector.collect(new StringKey("" + (keyNo++ % this.numReduceTasks)), gene); } System.out.println("Tga Map ends here"); /* * if the converge is too slow, we can track the best gene here like UIUC did */ //MemCacheAddress memCacheKey = (MemCacheAddress) val; //int index = memCacheKey.getStart(); //int range = memCacheKey.getRange(); //System.out.println(val.toString()); //IntValue val1 = (IntValue)val; //System.out.println(val1.getVal()); //IntValue val2 = (IntValue)val; //System.out.println(val2.getVal()); //System.out.println(index); //System.out.println(range); } }
[ "dogatuncay@hotmail.com" ]
dogatuncay@hotmail.com
bd6ea736673556011c11660f17bb48de9f2426dd
d603ced697f72df5ef0d91f985c4898fc05d26e8
/src/com/lehms/messages/dataContracts/MedicalConditionDataContract.java
8816b0082ccc6ad0f90b5e2d34448cd3a2569d4e
[]
no_license
massimocelima/LEHMS
47a4c84eaa9cb41b55e0d984bafb620588a5b739
cd801ebd39aa97805e023318fc6bb07aa8c222ee
refs/heads/master
2020-12-24T13:28:36.944729
2011-05-03T13:43:42
2011-05-03T13:43:42
1,378,124
0
0
null
null
null
null
UTF-8
Java
false
false
293
java
package com.lehms.messages.dataContracts; import java.io.Serializable; public class MedicalConditionDataContract implements Serializable { public long MedicalConditionId; public String Code; public String Coding; public String Info; public String Name; }
[ "massimo_celima@tpg.com.au" ]
massimo_celima@tpg.com.au
0b2619f0109ce05594e2a2c16235c2e1cb9d5f22
c57f01f0d0d3ea08c2345b4946800676a5a99cd3
/src/test/java/testcases/tc2.java
922c44c291542c9a9eae54460bcbbab92ab1472e
[]
no_license
naresh401/naresh1
5f2338e873b0f2a87858cfc5b5f73e9b2b07b509
54732c2bb9ba3c0f712675ab96226411a148655a
refs/heads/master
2020-05-23T21:26:55.989425
2019-05-16T05:26:51
2019-05-16T05:26:51
186,954,906
0
0
null
null
null
null
UTF-8
Java
false
false
1,072
java
package testcases; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import junit.framework.Assert; import pagebjects.homepageobjects; import pagebjects.login; public class tc2 extends BaseClass { login lg; homepageobjects hpo; @BeforeClass public void launch(){ setUp("chrome"); maxbro(); } @Test() public void tc_002(){ log.info("login to homepage"); lg=new login(driver); lg.setusername(username); lg.setpassword(password); lg.clicksub(); log.info("verify homepage title"); verifyHomepage("OrangeHRM"); hpo=new homepageobjects(driver); log.info("click addemp button"); hpo.clickaddbtn(); String str=hpo.gettexttitle(); log.info("verify add emp text"); Assert.assertEquals(str, "PIM : Add Employee"); log.info("enter lastname"); hpo.setlastname("abc"); log.info("enter fristname"); hpo.setfristname("abvcs"); log.info("click submit"); hpo.clickonsave(); } @AfterClass public void close(){ driver.quit(); } }
[ "nareshanumula401@gmail.com" ]
nareshanumula401@gmail.com
e64c77a2434c1e559faa49e9334b764f5ab86bd6
64a0dc4aa411f122061d0275ce692c9fd59152ee
/ms-user-mgmt/src/main/java/users/UserController.java
adbf4cc2bebff0db14d7454802b395a6551538f2
[]
no_license
yeskas/micro-news
7d7bb9a42b679004f88c8e36f224294846178f42
f13182b8514b5164eae2113e79af3a6b7a17f21c
refs/heads/master
2020-03-07T15:10:26.431376
2018-04-23T01:42:18
2018-04-23T01:42:18
127,547,402
0
0
null
null
null
null
UTF-8
Java
false
false
1,335
java
package users; 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.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import users.User; import users.UserRepository; @Controller @RequestMapping(path="/users/") public class UserController { @Autowired private UserRepository userRepository; @PostMapping(path="/add") public @ResponseBody User addNewUser (@RequestParam(required = false) String name) { User user = new User(); user.setName(name); userRepository.save(user); return user; } @GetMapping(path="/get") public @ResponseBody User getUser (@RequestParam Integer id) { User user = userRepository.findById(id).get(); return user; } @PostMapping(path="/edit") public @ResponseBody User editUser (@RequestParam Integer id, @RequestParam String name) { User user = userRepository.findById(id).get(); user.setName(name); userRepository.save(user); return user; } @GetMapping(path="/all") public @ResponseBody Iterable<User> getAllUsers() { return userRepository.findAll(); } }
[ "yd.kassenov@gmail.com" ]
yd.kassenov@gmail.com
1a4b45c2fc3e404782f95e1298479dfaae1f8580
0ac05e3da06d78292fdfb64141ead86ff6ca038f
/OSWE/oswe/Manage/src/org/apache/jsp/jsp/sap/dialog_jsp.java
31897c56a3d9dd0edadd1a5c3f687e2e0bdb1d23
[]
no_license
qoo7972365/timmy
31581cdcbb8858ac19a8bb7b773441a68b6c390a
2fc8baba4f53d38dfe9c2b3afd89dcf87cbef578
refs/heads/master
2023-07-26T12:26:35.266587
2023-07-17T12:35:19
2023-07-17T12:35:19
353,889,195
7
1
null
null
null
null
UTF-8
Java
false
false
174,158
java
/* */ package org.apache.jsp.jsp.sap; /* */ /* */ import com.adventnet.appmanager.client.resourcemanagement.ManagedApplication; /* */ import com.adventnet.appmanager.client.sap.SAPGraph; /* */ import com.adventnet.appmanager.db.AMConnectionPool; /* */ import com.adventnet.appmanager.dbcache.ConfMonitorConfiguration; /* */ import com.adventnet.appmanager.logging.AMLog; /* */ import com.adventnet.appmanager.util.DBUtil; /* */ import com.adventnet.appmanager.util.EnterpriseUtil; /* */ import com.adventnet.appmanager.util.FormatUtil; /* */ import com.adventnet.awolf.tags.TimeChart; /* */ import com.adventnet.utilities.stringutils.StrUtil; /* */ import java.io.IOException; /* */ import java.net.InetAddress; /* */ import java.net.URLEncoder; /* */ import java.sql.ResultSet; /* */ import java.sql.SQLException; /* */ import java.util.ArrayList; /* */ import java.util.Date; /* */ import java.util.Enumeration; /* */ import java.util.HashMap; /* */ import java.util.Hashtable; /* */ import java.util.Iterator; /* */ import java.util.LinkedHashMap; /* */ import java.util.List; /* */ import java.util.Map; /* */ import java.util.Properties; /* */ import java.util.Set; /* */ import java.util.StringTokenizer; /* */ import java.util.Vector; /* */ import javax.servlet.http.HttpServletRequest; /* */ import javax.servlet.http.HttpSession; /* */ import javax.servlet.jsp.JspFactory; /* */ import javax.servlet.jsp.JspWriter; /* */ import javax.servlet.jsp.PageContext; /* */ import javax.servlet.jsp.tagext.BodyContent; /* */ import javax.swing.tree.DefaultMutableTreeNode; /* */ import org.apache.jasper.runtime.TagHandlerPool; /* */ import org.apache.struts.taglib.bean.DefineTag; /* */ import org.apache.taglibs.standard.tag.el.core.OutTag; /* */ import org.apache.taglibs.standard.tag.el.fmt.MessageTag; /* */ /* */ public final class dialog_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent /* */ { /* */ public static final String NAME_SEPARATOR = ">"; /* 46 */ public static final String ALERTCONFIG_TEXT = FormatUtil.getString("am.webclient.common.util.ALERTCONFIG_TEXT"); /* */ public static final String STATUS_SEPARATOR = "#"; /* */ public static final String MESSAGE_SEPARATOR = "MESSAGE"; /* 49 */ public static final String MGSTR = FormatUtil.getString("am.webclient.common.util.MGSTR"); /* 50 */ public static final String WEBMG = FormatUtil.getString("am.webclient.common.util.WEBMG"); /* 51 */ public static final String MGSTRs = FormatUtil.getString("am.webclient.common.util.MGSTRs"); /* */ public static final String MISTR = "Monitor"; /* */ public static final String MISTRs = "Monitors"; /* */ public static final String RCA_SEPARATOR = " --> "; /* */ /* */ public String getOptions(String value, String text, String tableName, boolean distinct) /* */ { /* 58 */ return getOptions(value, text, tableName, distinct, ""); /* */ } /* */ /* */ public String getOptions(String value, String text, String tableName, boolean distinct, String condition) /* */ { /* 63 */ ArrayList list = null; /* 64 */ StringBuffer sbf = new StringBuffer(); /* 65 */ ManagedApplication mo = new ManagedApplication(); /* 66 */ if (distinct) /* */ { /* 68 */ list = mo.getRows("SELECT distinct(" + value + ") FROM " + tableName); /* */ } /* */ else /* */ { /* 72 */ list = mo.getRows("SELECT " + value + "," + text + " FROM " + tableName + " " + condition); /* */ } /* */ /* 75 */ for (int i = 0; i < list.size(); i++) /* */ { /* 77 */ ArrayList row = (ArrayList)list.get(i); /* 78 */ sbf.append("<option value='" + row.get(0) + "'>"); /* 79 */ if (distinct) { /* 80 */ sbf.append(row.get(0)); /* */ } else /* 82 */ sbf.append(row.get(1)); /* 83 */ sbf.append("</option>"); /* */ } /* */ /* 86 */ return sbf.toString(); } /* */ /* 88 */ long j = 0L; /* */ /* */ private String getSeverityImageForAvailability(Object severity) { /* 91 */ if (severity == null) /* */ { /* 93 */ return "<img border=\"0\" src=\"/images/icon_availability_unknown.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* 95 */ if (severity.equals("5")) /* */ { /* 97 */ return "<img border=\"0\" src=\"/images/icon_availability_up.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* 99 */ if (severity.equals("1")) /* */ { /* 101 */ return "<img border=\"0\" src=\"/images/icon_availability_down.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* */ /* */ /* */ /* 106 */ return "<img border=\"0\" src=\"/images/icon_availability_unknown.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* */ /* */ /* */ /* */ private String getSeverityImage(Object severity) /* */ { /* 113 */ if (severity == null) /* */ { /* 115 */ return "<img border=\"0\" src=\"/images/icon_unknown_status.gif\" alt=\"Unknown\" title=\"" + FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.unknown") + "\" align=\"absmiddle\">"; /* */ } /* 117 */ if (severity.equals("1")) /* */ { /* 119 */ return "<img border=\"0\" src=\"/images/icon_critical.gif\" alt=\"Critical\" title=\"" + FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.critical") + "\" align=\"absmiddle\">"; /* */ } /* 121 */ if (severity.equals("4")) /* */ { /* 123 */ return "<img border=\"0\" src=\"/images/icon_warning.gif\" alt=\"Warning\" title=\"" + FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.warning") + "\" align=\"absmiddle\">"; /* */ } /* 125 */ if (severity.equals("5")) /* */ { /* 127 */ return "<img border=\"0\" src=\"/images/icon_clear.gif\" alt=\"Clear\" title=\"" + FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.clear") + "\" align=\"absmiddle\" >"; /* */ } /* */ /* */ /* */ /* 132 */ return "<img border=\"0\" src=\"/images/icon_unknown_status.gif\" alt=\"Unknown\" title=\"Unknown\" align=\"absmiddle\">"; /* */ } /* */ /* */ /* */ private String getSeverityStateForAvailability(Object severity) /* */ { /* 138 */ if (severity == null) /* */ { /* 140 */ return FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.unknown"); /* */ } /* 142 */ if (severity.equals("5")) /* */ { /* 144 */ return FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.up"); /* */ } /* 146 */ if (severity.equals("1")) /* */ { /* 148 */ return FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.down"); /* */ } /* */ /* */ /* 152 */ return FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.unknown"); /* */ } /* */ /* */ /* */ private String getSeverityState(Object severity) /* */ { /* 158 */ if (severity == null) /* */ { /* 160 */ return FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.unknown"); /* */ } /* 162 */ if (severity.equals("1")) /* */ { /* 164 */ return FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.critical"); /* */ } /* 166 */ if (severity.equals("4")) /* */ { /* 168 */ return FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.warning"); /* */ } /* 170 */ if (severity.equals("5")) /* */ { /* 172 */ return FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.clear"); /* */ } /* */ /* */ /* 176 */ return FormatUtil.getString("am.webclient.hometab.monitorssnapshot.key.unknown"); /* */ } /* */ /* */ /* */ private String getSeverityImage(int severity) /* */ { /* 182 */ return getSeverityImage("" + severity); /* */ } /* */ /* */ /* */ private String getSeverityImageForAvailability(int severity) /* */ { /* 188 */ if (severity == 5) /* */ { /* 190 */ return "<img border=\"0\" src=\"/images/icon_availability_up.gif\" alt=\"Up\" name=\"Image" + ++this.j + "\">"; /* */ } /* 192 */ if (severity == 1) /* */ { /* 194 */ return "<img border=\"0\" src=\"/images/icon_availability_down.gif\" alt=\"Down\" name=\"Image" + ++this.j + "\">"; /* */ } /* */ /* */ /* */ /* 199 */ return "<img border=\"0\" src=\"/images/icon_availability_unknown.gif\" alt=\"Unknown\" name=\"Image" + ++this.j + "\">"; /* */ } /* */ /* */ /* */ private String getSeverityImageForConfMonitor(String severity, boolean isAvailability) /* */ { /* 205 */ if (severity == null) /* */ { /* 207 */ return "<img border=\"0\" src=\"/images/icon_unknown_conf.png\" alt=\"Unknown\">"; /* */ } /* 209 */ if (severity.equals("5")) /* */ { /* 211 */ if (isAvailability) { /* 212 */ return "<img border=\"0\" src=\"/images/icon_up_conf.png\" alt='" + FormatUtil.getString("Up") + "' >"; /* */ } /* */ /* 215 */ return "<img border=\"0\" src=\"/images/icon_conf_hlt_clear.png\" alt='" + FormatUtil.getString("Clear") + "' >"; /* */ } /* */ /* 218 */ if ((severity.equals("4")) && (!isAvailability)) /* */ { /* 220 */ return "<img border=\"0\" src=\"/images/icon_warning_conf.png\" alt=\"Warning\">"; /* */ } /* 222 */ if (severity.equals("1")) /* */ { /* 224 */ if (isAvailability) { /* 225 */ return "<img border=\"0\" src=\"/images/icon_down_conf.png\" alt=\"Down\">"; /* */ } /* */ /* 228 */ return "<img border=\"0\" src=\"/images/icon_conf_hlt_critical.png\" alt=\"Critical\">"; /* */ } /* */ /* */ /* */ /* */ /* */ /* 235 */ return "<img border=\"0\" src=\"/images/icon_unknown_conf.png\" alt=\"Unknown\">"; /* */ } /* */ /* */ /* */ /* */ private String getSeverityImageForHealth(String severity) /* */ { /* 242 */ if (severity == null) /* */ { /* 244 */ return "<img border=\"0\" src=\"/images/icon_health_unknown.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* 246 */ if (severity.equals("5")) /* */ { /* 248 */ return "<img border=\"0\" src=\"/images/icon_health_clear.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* 250 */ if (severity.equals("4")) /* */ { /* 252 */ return "<img border=\"0\" src=\"/images/icon_health_warning.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* 254 */ if (severity.equals("1")) /* */ { /* 256 */ return "<img border=\"0\" src=\"/images/icon_health_critical.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* */ /* */ /* */ /* 261 */ return "<img border=\"0\" src=\"/images/icon_health_unknown.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* */ /* */ /* */ private String getas400SeverityImageForHealth(String severity) /* */ { /* 267 */ if (severity == null) /* */ { /* 269 */ return "<img border=\"0\" src=\"/images/icon_as400health_clear.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* 271 */ if (severity.equals("5")) /* */ { /* 273 */ return "<img border=\"0\" src=\"/images/icon_as400health_clear.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* 275 */ if (severity.equals("4")) /* */ { /* 277 */ return "<img border=\"0\" src=\"/images/icon_as400health_warning.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* 279 */ if (severity.equals("1")) /* */ { /* 281 */ return "<img border=\"0\" src=\"/images/icon_as400health_critical.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* */ /* */ /* */ /* 286 */ return "<img border=\"0\" src=\"/images/icon_as400health_clear.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* */ /* */ /* */ /* */ private String getSeverityImageForHealthWithoutMouseOver(String severity) /* */ { /* 293 */ if (severity == null) /* */ { /* 295 */ return "<img border=\"0\" src=\"/images/icon_health_unknown_nm.gif\" alt=\"Unknown\">"; /* */ } /* 297 */ if (severity.equals("5")) /* */ { /* 299 */ return "<img border=\"0\" src=\"/images/icon_health_clear_nm.gif\" alt=\"Clear\" >"; /* */ } /* 301 */ if (severity.equals("4")) /* */ { /* 303 */ return "<img border=\"0\" src=\"/images/icon_health_warning_nm.gif\" alt=\"Warning\">"; /* */ } /* 305 */ if (severity.equals("1")) /* */ { /* 307 */ return "<img border=\"0\" src=\"/images/icon_health_critical_nm.gif\" alt=\"Critical\">"; /* */ } /* */ /* */ /* */ /* 312 */ return "<img border=\"0\" src=\"/images/icon_health_unknown_nm.gif\" alt=\"Unknown\">"; /* */ } /* */ /* */ /* */ /* */ /* */ private String getSearchStrip(String map) /* */ { /* 320 */ StringBuffer out = new StringBuffer(); /* 321 */ out.append("<form action=\"/Search.do\" style=\"display:inline;\" >"); /* 322 */ out.append("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"breadcrumbs\">"); /* 323 */ out.append("<tr class=\"breadcrumbs\"> "); /* 324 */ out.append(" <td width=\"72%\" height=\"20\">&nbsp;&nbsp;&nbsp;&nbsp;" + map + "&nbsp; &nbsp;&nbsp;</td>"); /* 325 */ out.append(" <td width=\"9%\"> <input name=\"query\" type=\"text\" class=\"formtextsearch\" size=\"15\"></td>"); /* 326 */ out.append(" <td width=\"5%\"> &nbsp; <input name=\"Submit\" type=\"submit\" class=\"buttons\" value=\"Find\"></td>"); /* 327 */ out.append("</tr>"); /* 328 */ out.append("</form></table>"); /* 329 */ return out.toString(); /* */ } /* */ /* */ /* */ /* */ private String formatNumberForDotNet(String val) /* */ { /* 336 */ if (val == null) /* */ { /* 338 */ return "-"; /* */ } /* */ /* 341 */ String ret = FormatUtil.formatNumber(val); /* 342 */ String troubleshootlink = com.adventnet.appmanager.util.OEMUtil.getOEMString("company.troubleshoot.link"); /* 343 */ if (ret.indexOf("-1") != -1) /* */ { /* */ /* 346 */ return "- &nbsp;<a class=\"staticlinks\" href=\"http://" + troubleshootlink + "#m44\" target=\"_blank\">" + FormatUtil.getString("am.webclient.dotnet.troubleshoot") + "</a>"; /* */ } /* */ /* */ /* 350 */ return ret; /* */ } /* */ /* */ /* */ /* */ /* */ public String getHTMLTable(String[] headers, List tableData, String link, String deleteLink) /* */ { /* 358 */ StringBuffer out = new StringBuffer(); /* 359 */ out.append("<table align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"); /* 360 */ out.append("<tr>"); /* 361 */ for (int i = 0; i < headers.length; i++) /* */ { /* 363 */ out.append("<td valign=\"center\"height=\"28\" bgcolor=\"ACD5FE\" class=\"columnheading\">" + headers[i] + "</td>"); /* */ } /* 365 */ out.append("</tr>"); /* 366 */ for (int j = 0; j < tableData.size(); j++) /* */ { /* */ /* */ /* 370 */ if (j % 2 == 0) /* */ { /* 372 */ out.append("<tr class=\"whitegrayborder\">"); /* */ } /* */ else /* */ { /* 376 */ out.append("<tr class=\"yellowgrayborder\">"); /* */ } /* */ /* 379 */ List rowVector = (List)tableData.get(j); /* */ /* 381 */ for (int k = 0; k < rowVector.size(); k++) /* */ { /* */ /* 384 */ out.append("<td height=\"22\" >" + rowVector.get(k) + "</td>"); /* */ } /* */ /* */ /* 388 */ out.append("</tr>"); /* */ } /* 390 */ out.append("</table>"); /* 391 */ out.append("<table align=\"center\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tablebottom\">"); /* 392 */ out.append("<tr>"); /* 393 */ out.append("<td width=\"72%\" height=\"26\" ><A HREF=\"" + deleteLink + "\" class=\"staticlinks\">Delete</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"" + link + "\" class=\"staticlinks\">Add New</a>&nbsp;&nbsp;</td>"); /* 394 */ out.append("</tr>"); /* 395 */ out.append("</table>"); /* 396 */ return out.toString(); /* */ } /* */ /* */ /* */ public static String getSingleColumnDisplay(String header, Vector tableColumns) /* */ { /* 402 */ StringBuffer out = new StringBuffer(); /* 403 */ out.append("<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); /* 404 */ out.append("<table width=\"95%\" height=\"5\" cellpadding=\"5\" cellspacing=\"5\" class=\"lrbborder\">"); /* 405 */ out.append("<tr>"); /* 406 */ out.append("<td align=\"center\"> <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"lrborder\">"); /* 407 */ out.append("<tr>"); /* 408 */ out.append("<td width=\"3%\" bgcolor=\"ACD5FE\" class=\"columnheading\"> <input type=\"checkbox\" name=\"maincheckbox\" value=\"checkbox\"></td>"); /* 409 */ out.append("<td width=\"15%\" bgcolor=\"ACD5FE\" class=\"columnheading\"> Name </td>"); /* 410 */ out.append("</tr>"); /* 411 */ for (int k = 0; k < tableColumns.size(); k++) /* */ { /* */ /* 414 */ out.append("<tr>"); /* 415 */ out.append("<td class=\"yellowgrayborder\"><input type=\"checkbox\" name=\"checkbox" + k + "\" value=\"checkbox\"></td>"); /* 416 */ out.append("<td height=\"22\" class=\"yellowgrayborder\">" + tableColumns.elementAt(k) + "</td>"); /* 417 */ out.append("</tr>"); /* */ } /* */ /* 420 */ out.append("</table>"); /* 421 */ out.append("</table>"); /* 422 */ return out.toString(); /* */ } /* */ /* */ private String getAvailabilityImage(String severity) /* */ { /* 427 */ if (severity.equals("0")) /* */ { /* 429 */ return "<img src=\"/images/icon_critical.gif\" alt=\"Critical\" border=0 >"; /* */ } /* */ /* */ /* 433 */ return "<img src=\"/images/icon_clear.gif\" alt=\"Clear\" border=0>"; /* */ } /* */ /* */ /* */ /* */ public String getQuickLinksAndNotes(String quickLinkHeader, ArrayList quickLinkText, ArrayList quickLink, String quickNote, HttpSession session) /* */ { /* 440 */ return getQuickLinksAndNotes(quickLinkHeader, quickLinkText, quickLink, null, null, quickNote, session); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public String getQuickLinksAndNotes(String quickLinkHeader, ArrayList quickLinkText, ArrayList quickLink, String secondLevelLinkTitle, List[] secondLevelOfLinks, String quickNote, HttpSession session) /* */ { /* 453 */ StringBuffer out = new StringBuffer(); /* 454 */ out.append("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"leftmnutables\">"); /* 455 */ if ((quickLinkText != null) && (quickLink != null) && (quickLinkText.size() == quickLink.size())) /* */ { /* 457 */ out.append("<tr>"); /* 458 */ out.append("<td class=\"leftlinksheading\">" + quickLinkHeader + "d,.mfnjh.mdfnh.m,dfnh,.dfmn</td>"); /* 459 */ out.append("</tr>"); /* */ /* */ /* 462 */ for (int i = 0; i < quickLinkText.size(); i++) /* */ { /* 464 */ String borderclass = ""; /* */ /* */ /* 467 */ borderclass = "class=\"leftlinkstd\""; /* */ /* 469 */ out.append("<tr>"); /* */ /* 471 */ out.append("<td width=\"81%\" height=\"21\" " + borderclass + ">"); /* 472 */ out.append("<a href=\"" + (String)quickLink.get(i) + "\" class=\"staticlinks\">" + (String)quickLinkText.get(i) + "</a></td>"); /* 473 */ out.append("</tr>"); /* */ } /* */ } /* */ /* */ /* */ /* 479 */ out.append("</table><br>"); /* 480 */ out.append("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"leftmnutables\">"); /* 481 */ if ((secondLevelOfLinks != null) && (secondLevelLinkTitle != null)) /* */ { /* 483 */ List sLinks = secondLevelOfLinks[0]; /* 484 */ List sText = secondLevelOfLinks[1]; /* 485 */ if ((sText != null) && (sLinks != null) && (sLinks.size() == sText.size())) /* */ { /* */ /* 488 */ out.append("<tr>"); /* 489 */ out.append("<td class=\"leftlinksheading\">" + secondLevelLinkTitle + "</td>"); /* 490 */ out.append("</tr>"); /* 491 */ for (int i = 0; i < sText.size(); i++) /* */ { /* 493 */ String borderclass = ""; /* */ /* */ /* 496 */ borderclass = "class=\"leftlinkstd\""; /* */ /* 498 */ out.append("<tr>"); /* */ /* 500 */ out.append("<td width=\"81%\" height=\"21\" " + borderclass + ">"); /* 501 */ if (sLinks.get(i).toString().length() == 0) { /* 502 */ out.append((String)sText.get(i) + "</td>"); /* */ } /* */ else { /* 505 */ out.append("<a href=\"" + (String)sLinks.get(i) + "\" class=\"staticlinks\">" + (String)sText.get(i) + "</a></td>"); /* */ } /* 507 */ out.append("</tr>"); /* */ } /* */ } /* */ } /* 511 */ out.append("</table>"); /* 512 */ return out.toString(); /* */ } /* */ /* */ /* */ /* */ public String getQuickLinksAndNote(String quickLinkHeader, ArrayList quickLinkText, ArrayList quickLink, String secondLevelLinkTitle, List[] secondLevelOfLinks, String quickNote, HttpSession session, HttpServletRequest request) /* */ { /* 519 */ StringBuffer out = new StringBuffer(); /* 520 */ out.append("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"leftmnutables\">"); /* 521 */ if ((quickLinkText != null) && (quickLink != null) && (quickLinkText.size() == quickLink.size())) /* */ { /* 523 */ if ((request.isUserInRole("DEMO")) || (request.isUserInRole("ADMIN")) || (request.isUserInRole("ENTERPRISEADMIN"))) /* */ { /* 525 */ out.append("<tr>"); /* 526 */ out.append("<td class=\"leftlinksheading\">" + quickLinkHeader + "</td>"); /* 527 */ out.append("</tr>"); /* */ /* */ /* */ /* 531 */ for (int i = 0; i < quickLinkText.size(); i++) /* */ { /* 533 */ String borderclass = ""; /* */ /* */ /* 536 */ borderclass = "class=\"leftlinkstd\""; /* */ /* 538 */ out.append("<tr>"); /* */ /* 540 */ out.append("<td width=\"81%\" height=\"21\" " + borderclass + ">"); /* 541 */ if (((String)quickLinkText.get(i)).indexOf("a href") == -1) { /* 542 */ out.append("<a href=\"" + (String)quickLink.get(i) + "\" class=\"new-left-links\">" + (String)quickLinkText.get(i) + "</a>"); /* */ } /* */ else { /* 545 */ out.append((String)quickLinkText.get(i)); /* */ } /* */ /* 548 */ out.append("</td></tr>"); /* */ } /* */ } /* */ } /* */ /* 553 */ out.append("</table><br>"); /* 554 */ out.append("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"leftmnutables\">"); /* 555 */ if ((secondLevelOfLinks != null) && (secondLevelLinkTitle != null)) /* */ { /* 557 */ List sLinks = secondLevelOfLinks[0]; /* 558 */ List sText = secondLevelOfLinks[1]; /* 559 */ if ((sText != null) && (sLinks != null) && (sLinks.size() == sText.size())) /* */ { /* */ /* 562 */ out.append("<tr>"); /* 563 */ out.append("<td class=\"leftlinksheading\">" + secondLevelLinkTitle + "</td>"); /* 564 */ out.append("</tr>"); /* 565 */ for (int i = 0; i < sText.size(); i++) /* */ { /* 567 */ String borderclass = ""; /* */ /* */ /* 570 */ borderclass = "class=\"leftlinkstd\""; /* */ /* 572 */ out.append("<tr>"); /* */ /* 574 */ out.append("<td width=\"81%\" height=\"21\" " + borderclass + ">"); /* 575 */ if (sLinks.get(i).toString().length() == 0) { /* 576 */ out.append((String)sText.get(i) + "</td>"); /* */ } /* */ else { /* 579 */ out.append("<a href=\"" + (String)sLinks.get(i) + "\" class=\"new-left-links\">" + (String)sText.get(i) + "</a></td>"); /* */ } /* 581 */ out.append("</tr>"); /* */ } /* */ } /* */ } /* 585 */ out.append("</table>"); /* 586 */ return out.toString(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private String getSeverityClass(int status) /* */ { /* 599 */ switch (status) /* */ { /* */ case 1: /* 602 */ return "class=\"errorgrayborder\""; /* */ /* */ case 2: /* 605 */ return "class=\"errorgrayborder\""; /* */ /* */ case 3: /* 608 */ return "class=\"errorgrayborder\""; /* */ /* */ case 4: /* 611 */ return "class=\"errorgrayborder\""; /* */ /* */ case 5: /* 614 */ return "class=\"whitegrayborder\""; /* */ /* */ case 6: /* 617 */ return "class=\"whitegrayborder\""; /* */ } /* */ /* 620 */ return "class=\"whitegrayborder\""; /* */ } /* */ /* */ /* */ /* */ /* */ public String getTrimmedText(String stringToTrim, int lengthOfTrimmedString) /* */ { /* 628 */ return FormatUtil.getTrimmedText(stringToTrim, lengthOfTrimmedString); /* */ } /* */ /* */ public String getformatedText(String stringToTrim, int lengthOfTrimmedString, int lastPartStartsfrom) /* */ { /* 633 */ return FormatUtil.getformatedText(stringToTrim, lengthOfTrimmedString, lastPartStartsfrom); /* */ } /* */ /* */ private String getTruncatedAlertMessage(String messageArg) /* */ { /* 638 */ return FormatUtil.getTruncatedAlertMessage(messageArg); /* */ } /* */ /* */ private String formatDT(String val) /* */ { /* 643 */ return FormatUtil.formatDT(val); /* */ } /* */ /* */ private String formatDT(Long val) /* */ { /* 648 */ if (val != null) /* */ { /* 650 */ return FormatUtil.formatDT(val.toString()); /* */ } /* */ /* */ /* 654 */ return "-"; /* */ } /* */ /* */ private String formatDTwithOutYear(String val) /* */ { /* 659 */ if (val == null) { /* 660 */ return val; /* */ } /* */ try /* */ { /* 664 */ val = new java.text.SimpleDateFormat("MMM d h:mm a").format(new Date(Long.parseLong(val))); /* */ } /* */ catch (Exception e) {} /* */ /* */ /* 669 */ return val; /* */ } /* */ /* */ /* */ private String formatDTwithOutYear(Long val) /* */ { /* 675 */ if (val != null) /* */ { /* 677 */ return formatDTwithOutYear(val.toString()); /* */ } /* */ /* */ /* 681 */ return "-"; /* */ } /* */ /* */ /* */ private String formatAlertDT(String val) /* */ { /* 687 */ return val.substring(0, val.lastIndexOf(":")) + val.substring(val.lastIndexOf(":") + 3); /* */ } /* */ /* */ private String formatNumber(Object val) /* */ { /* 692 */ return FormatUtil.formatNumber(val); /* */ } /* */ /* */ private String formatNumber(long val) { /* 696 */ return FormatUtil.formatNumber(val); /* */ } /* */ /* */ private String formatBytesToKB(String val) /* */ { /* 701 */ return FormatUtil.formatBytesToKB(val) + " " + FormatUtil.getString("KB"); /* */ } /* */ /* */ private String formatBytesToMB(String val) /* */ { /* 706 */ return FormatUtil.formatBytesToMB(val) + " " + FormatUtil.getString("MB"); /* */ } /* */ /* */ private String getHostAddress(HttpServletRequest request) throws Exception /* */ { /* 711 */ String hostaddress = ""; /* 712 */ String ip = request.getHeader("x-forwarded-for"); /* 713 */ if (ip == null) /* 714 */ ip = request.getRemoteAddr(); /* 715 */ InetAddress add = null; /* 716 */ if (ip.equals("127.0.0.1")) { /* 717 */ add = InetAddress.getLocalHost(); /* */ } /* */ else /* */ { /* 721 */ add = InetAddress.getByName(ip); /* */ } /* 723 */ hostaddress = add.getHostName(); /* 724 */ if (hostaddress.indexOf('.') != -1) { /* 725 */ StringTokenizer st = new StringTokenizer(hostaddress, "."); /* 726 */ hostaddress = st.nextToken(); /* */ } /* */ /* */ /* 730 */ return hostaddress; /* */ } /* */ /* */ private String removeBr(String arg) /* */ { /* 735 */ return FormatUtil.replaceStringBySpecifiedString(arg, "<br>", "", 0); /* */ } /* */ /* */ /* */ private String getSeverityImageForMssqlAvailability(Object severity) /* */ { /* 741 */ if (severity == null) /* */ { /* 743 */ return "<img border=\"0\" src=\"/images/icon_esx_unknown.gif\" name=\"Image" + ++this.j + "\" onMouseOut=\"javascript:MM_swapImgRestore()\" onMouseOver=\"javascript:MM_swapImage('Image" + this.j + "','','/images/icon_esx_unknown.gif',1)\">"; /* */ } /* 745 */ if (severity.equals("5")) /* */ { /* 747 */ return "<img border=\"0\" src=\"/images/up_icon.gif\" name=\"Image" + ++this.j + "\" onMouseOut=\"javascript:MM_swapImgRestore()\" onMouseOver=\"javascript:MM_swapImage('Image" + this.j + "','','/images/up_icon.gif',1)\">"; /* */ } /* 749 */ if (severity.equals("1")) /* */ { /* 751 */ return "<img border=\"0\" src=\"/images/down_icon.gif\" name=\"Image" + ++this.j + "\" onMouseOut=\"javascript:MM_swapImgRestore()\" onMouseOver=\"javascript:MM_swapImage('Image" + this.j + "','','/images/down_icon.gif',1)\">"; /* */ } /* */ /* */ /* */ /* 756 */ return "<img border=\"0\" src=\"/images/icon_esx_unknown.gif\" name=\"Image" + ++this.j + "\" onMouseOut=\"javascript:MM_swapImgRestore()\" onMouseOver=\"javascript:MM_swapImage('Image" + this.j + "','','/images/icon_esx_unknown.gif',1)\">"; /* */ } /* */ /* */ public String getDependentChildAttribs(String resid, String attributeId) /* */ { /* 761 */ ResultSet set = null; /* 762 */ AMConnectionPool cp = AMConnectionPool.getInstance(); /* 763 */ String dependentChildQry = "select ANYCONDITIONVALUE from AM_RCARULESMAPPER where RESOURCEID=" + resid + " and ATTRIBUTE=" + attributeId; /* */ try { /* 765 */ set = AMConnectionPool.executeQueryStmt(dependentChildQry); /* 766 */ if (set.next()) { String str1; /* 767 */ if (set.getString("ANYCONDITIONVALUE").equals("-1")) { /* 768 */ return FormatUtil.getString("am.fault.rcatree.allrule.text"); /* */ } /* */ /* 771 */ return FormatUtil.getString("am.fault.rcatree.anyrule.text", new String[] { set.getString("ANYCONDITIONVALUE") }); /* */ } /* */ } /* */ catch (Exception e) /* */ { /* 776 */ e.printStackTrace(); /* */ } /* */ finally { /* 779 */ AMConnectionPool.closeStatement(set); /* */ } /* 781 */ return FormatUtil.getString("am.fault.rcatree.anyonerule.text"); /* */ } /* */ /* */ public String getConfHealthRCA(String key) { /* 785 */ StringBuffer rca = new StringBuffer(); /* 786 */ if ((key != null) && (key.indexOf("Root Cause :") != -1)) { /* 787 */ key = key.substring(key.indexOf("Root Cause :") + 17, key.length()); /* */ } /* */ /* 790 */ int rcalength = key.length(); /* 791 */ String split = "6. "; /* 792 */ int splitPresent = key.indexOf(split); /* 793 */ String div1 = "";String div2 = ""; /* 794 */ if ((rcalength < 300) || (splitPresent < 0)) /* */ { /* 796 */ if (rcalength > 180) { /* 797 */ rca.append("<span class=\"rca-critical-text\">"); /* 798 */ getRCATrimmedText(key, rca); /* 799 */ rca.append("</span>"); /* */ } else { /* 801 */ rca.append("<span class=\"rca-critical-text\">"); /* 802 */ rca.append(key); /* 803 */ rca.append("</span>"); /* */ } /* 805 */ return rca.toString(); /* */ } /* 807 */ div1 = key.substring(0, key.indexOf(split) - 4); /* 808 */ div2 = key.substring(key.indexOf(split), rcalength - 4); /* 809 */ rca.append("<div style='overflow: hidden; display: block; width: 100%; height: auto;'>"); /* 810 */ String rcaMesg = StrUtil.findReplace(div1, " --> ", "&nbsp;<img src=\"/images/img_arrow.gif\">&nbsp;"); /* 811 */ getRCATrimmedText(div1, rca); /* 812 */ rca.append("<span id=\"confrcashow\" class=\"confrcashow\" onclick=\"javascript:toggleSlide('confrcahide','confrcashow','confrcahidden');\"><img src=\"/images/icon_plus.gif\" width=\"9\" height=\"7\"> " + FormatUtil.getString("am.webclient.monitorinformation.show.text") + " </span></div>"); /* */ /* */ /* 815 */ rca.append("<div id='confrcahidden' style='display: none; width: 100%;'>"); /* 816 */ rcaMesg = StrUtil.findReplace(div2, " --> ", "&nbsp;<img src=\"/images/img_arrow.gif\">&nbsp;"); /* 817 */ getRCATrimmedText(div2, rca); /* 818 */ rca.append("<span id=\"confrcahide\" class=\"confrcashow\" onclick=\"javascript:toggleSlide('confrcashow','confrcahide','confrcahidden')\"><img src=\"/images/icon_minus.gif\" width=\"9\" height=\"7\"> " + FormatUtil.getString("am.webclient.monitorinformation.hide.text") + " </span></div>"); /* */ /* 820 */ return rca.toString(); /* */ } /* */ /* */ public void getRCATrimmedText(String msg, StringBuffer rca) /* */ { /* 825 */ String[] st = msg.split("<br>"); /* 826 */ for (int i = 0; i < st.length; i++) { /* 827 */ String s = st[i]; /* 828 */ if (s.length() > 180) { /* 829 */ s = s.substring(0, 175) + "....."; /* */ } /* 831 */ rca.append(s + "<br>"); /* */ } /* */ } /* */ /* 835 */ public String getConfHealthTime(String time) { if ((time != null) && (!time.trim().equals(""))) { /* 836 */ return new Date(com.adventnet.appmanager.reporting.ReportUtilities.roundOffToNearestSeconds(Long.parseLong(time))).toString(); /* */ } /* 838 */ return ""; /* */ } /* */ /* */ public String getHelpLink(String key) { /* 842 */ String helpText = FormatUtil.getString("am.webclient.contexthelplink.text"); /* 843 */ ret = "<a href=\"/help/index.html\" title=\"" + helpText + "\" target=\"newwindow\" class=\"headerwhitelinks\" ><img src=\"/images/helpIcon.png\"/></a>"; /* 844 */ ResultSet set = null; /* */ try { /* */ String str1; /* 847 */ if (key == null) { /* 848 */ return ret; /* */ } /* */ /* 851 */ if (DBUtil.searchLinks.containsKey(key)) { /* 852 */ return "<a href=\"" + (String)DBUtil.searchLinks.get(key) + "\" title=\"" + helpText + "\" target=\"newwindow\" class=\"headerwhitelinks\" ><img src=\"/images/helpIcon.png\"/></a>"; /* */ } /* */ /* 855 */ String query = "select LINK from AM_SearchDocLinks where NAME ='" + key + "'"; /* 856 */ AMConnectionPool cp = AMConnectionPool.getInstance(); /* 857 */ set = AMConnectionPool.executeQueryStmt(query); /* 858 */ if (set.next()) /* */ { /* 860 */ String helpLink = set.getString("LINK"); /* 861 */ DBUtil.searchLinks.put(key, helpLink); /* */ try /* */ { /* 864 */ AMConnectionPool.closeStatement(set); /* */ } /* */ catch (Exception exc) {} /* */ /* */ /* */ /* 870 */ return "<a href=\"" + helpLink + "\" title=\"" + helpText + "\" target=\"newwindow\" class=\"headerwhitelinks\" ><img src=\"/images/helpIcon.png\"/></a>"; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 889 */ return ret; /* */ } /* */ catch (Exception ex) {}finally /* */ { /* */ try /* */ { /* 880 */ if (set != null) { /* 881 */ AMConnectionPool.closeStatement(set); /* */ } /* */ } /* */ catch (Exception nullexc) {} /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public Properties getStatus(List entitylist) /* */ { /* 895 */ Properties temp = com.adventnet.appmanager.fault.FaultUtil.getStatus(entitylist, false); /* 896 */ for (Enumeration keys = temp.propertyNames(); keys.hasMoreElements();) /* */ { /* 898 */ String entityStr = (String)keys.nextElement(); /* 899 */ String mmessage = temp.getProperty(entityStr); /* 900 */ mmessage = mmessage.replaceAll("\"", "&quot;"); /* 901 */ temp.setProperty(entityStr, mmessage); /* */ } /* 903 */ return temp; /* */ } /* */ /* */ /* */ public Properties getStatus(List listOfResourceIDs, List listOfAttributeIDs) /* */ { /* 909 */ Properties temp = com.adventnet.appmanager.fault.FaultUtil.getStatus(listOfResourceIDs, listOfAttributeIDs); /* 910 */ for (Enumeration keys = temp.propertyNames(); keys.hasMoreElements();) /* */ { /* 912 */ String entityStr = (String)keys.nextElement(); /* 913 */ String mmessage = temp.getProperty(entityStr); /* 914 */ mmessage = mmessage.replaceAll("\"", "&quot;"); /* 915 */ temp.setProperty(entityStr, mmessage); /* */ } /* 917 */ return temp; /* */ } /* */ /* */ private void debug(String debugMessage) /* */ { /* 922 */ AMLog.debug("JSP : " + debugMessage); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ private String findReplace(String str, String find, String replace) /* */ { /* 932 */ String des = new String(); /* 933 */ while (str.indexOf(find) != -1) { /* 934 */ des = des + str.substring(0, str.indexOf(find)); /* 935 */ des = des + replace; /* 936 */ str = str.substring(str.indexOf(find) + find.length()); /* */ } /* 938 */ des = des + str; /* 939 */ return des; /* */ } /* */ /* */ private String getHideAndShowRCAMessage(String test, String id, String alert, String resourceid) /* */ { /* */ try /* */ { /* 946 */ if (alert == null) /* */ { /* 948 */ return "&nbsp;&nbsp;" + FormatUtil.getString("am.webclient.rcamessage.healthunknown.text"); /* */ } /* 950 */ if ((test == null) || (test.equals(""))) /* */ { /* 952 */ return "&nbsp;"; /* */ } /* */ /* 955 */ if ((alert != null) && (alert.equals("5"))) /* */ { /* 957 */ return "&nbsp;&nbsp;" + FormatUtil.getString("am.fault.rca.healthisclear.text") + ".&nbsp;" + FormatUtil.getString("am.webclient.nocriticalalarms.current.text"); /* */ } /* */ /* 960 */ int rcalength = test.length(); /* 961 */ if (rcalength < 300) /* */ { /* 963 */ return test; /* */ } /* */ /* */ /* 967 */ StringBuffer out = new StringBuffer(); /* 968 */ out.append("<div id='rcahidden' style='overflow: hidden; display: block; word-wrap: break-word; width: 500px; height: 100px'>"); /* 969 */ out.append(StrUtil.findReplace(test, " --> ", "&nbsp;<img src=\"/images/img_arrow.gif\">&nbsp;")); /* 970 */ out.append("</div>"); /* 971 */ out.append("<div align=\"right\" id=\"rcashow" + id + "\" style=\"display:block;\" onclick=\"javascript:document.getElementById('rcahidden').style.height='auto';hideDiv('rcashow" + id + "');showDiv('rcahide" + id + "');\"><span class=\"bcactive\"><img src=\"/images/icon_plus.gif\" width=\"9\" height=\"9\"> " + FormatUtil.getString("am.webclient.monitorinformation.show.text") + " </span> </div>"); /* 972 */ out.append("<div align=\"right\" id=\"rcahide" + id + "\" style=\"display:none;\" onclick=\"javascript:document.getElementById('rcahidden').style.height='100px',hideDiv('rcahide" + id + "');showDiv('rcashow" + id + "')\"><span class=\"bcactive\"><img src=\"/images/icon_minus.gif\" width=\"9\" height=\"9\"> " + FormatUtil.getString("am.webclient.monitorinformation.hide.text") + " </span> </div>"); /* 973 */ return out.toString(); /* */ /* */ } /* */ catch (Exception ex) /* */ { /* 978 */ ex.printStackTrace(); /* */ } /* 980 */ return test; /* */ } /* */ /* */ /* */ public Properties getAlerts(List monitorList, Hashtable availabilitykeys, Hashtable healthkeys) /* */ { /* 986 */ return getAlerts(monitorList, availabilitykeys, healthkeys, 1); /* */ } /* */ /* */ public Properties getAlerts(List monitorList, Hashtable availabilitykeys, Hashtable healthkeys, int type) /* */ { /* 991 */ ArrayList attribIDs = new ArrayList(); /* 992 */ ArrayList resIDs = new ArrayList(); /* 993 */ ArrayList entitylist = new ArrayList(); /* */ /* 995 */ for (int j = 0; (monitorList != null) && (j < monitorList.size()); j++) /* */ { /* 997 */ ArrayList row = (ArrayList)monitorList.get(j); /* */ /* 999 */ String resourceid = ""; /* 1000 */ String resourceType = ""; /* 1001 */ if (type == 2) { /* 1002 */ resourceid = (String)row.get(0); /* 1003 */ resourceType = (String)row.get(3); /* */ } /* 1005 */ else if (type == 3) { /* 1006 */ resourceid = (String)row.get(0); /* 1007 */ resourceType = "EC2Instance"; /* */ } /* */ else { /* 1010 */ resourceid = (String)row.get(6); /* 1011 */ resourceType = (String)row.get(7); /* */ } /* 1013 */ resIDs.add(resourceid); /* 1014 */ String healthid = com.adventnet.appmanager.dbcache.AMAttributesCache.getHealthId(resourceType); /* 1015 */ String availid = com.adventnet.appmanager.dbcache.AMAttributesCache.getAvailabilityId(resourceType); /* */ /* 1017 */ String healthentity = null; /* 1018 */ String availentity = null; /* 1019 */ if (healthid != null) { /* 1020 */ healthentity = resourceid + "_" + healthid; /* 1021 */ entitylist.add(healthentity); /* */ } /* */ /* 1024 */ if (availid != null) { /* 1025 */ availentity = resourceid + "_" + availid; /* 1026 */ entitylist.add(availentity); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 1040 */ Properties alert = getStatus(entitylist); /* 1041 */ return alert; /* */ } /* */ /* */ public void getSortedMonitorList(ArrayList monitorList, Properties alert, Hashtable availabilitykeys, Hashtable healthkeys) /* */ { /* 1046 */ int size = monitorList.size(); /* */ /* 1048 */ String[] severity = new String[size]; /* */ /* 1050 */ for (int j = 0; j < monitorList.size(); j++) /* */ { /* 1052 */ ArrayList row1 = (ArrayList)monitorList.get(j); /* 1053 */ String resourceName1 = (String)row1.get(7); /* 1054 */ String resourceid1 = (String)row1.get(6); /* 1055 */ severity[j] = alert.getProperty(resourceid1 + "#" + availabilitykeys.get(resourceName1)); /* 1056 */ if (severity[j] == null) /* */ { /* 1058 */ severity[j] = "6"; /* */ } /* */ } /* */ /* 1062 */ for (j = 0; j < severity.length; j++) /* */ { /* 1064 */ for (int k = j + 1; k < severity.length; k++) /* */ { /* 1066 */ int sev = severity[j].compareTo(severity[k]); /* */ /* */ /* 1069 */ if (sev > 0) { /* 1070 */ ArrayList t = (ArrayList)monitorList.get(k); /* 1071 */ monitorList.set(k, monitorList.get(j)); /* 1072 */ monitorList.set(j, t); /* 1073 */ String temp = severity[k]; /* 1074 */ severity[k] = severity[j]; /* 1075 */ severity[j] = temp; /* */ } /* */ } /* */ } /* */ /* */ /* 1081 */ int z = 0; /* 1082 */ for (j = 0; j < monitorList.size(); j++) /* */ { /* */ /* 1085 */ int i = 0; /* 1086 */ if ((!severity[j].equals("0")) && (!severity[j].equals("1")) && (!severity[j].equals("4"))) /* */ { /* */ /* 1089 */ i++; /* */ } /* */ else /* */ { /* 1093 */ z++; /* */ } /* */ } /* */ /* 1097 */ String[] hseverity = new String[monitorList.size()]; /* */ /* 1099 */ for (j = 0; j < z; j++) /* */ { /* */ /* 1102 */ hseverity[j] = severity[j]; /* */ } /* */ /* */ /* 1106 */ for (j = z; j < severity.length; j++) /* */ { /* */ /* 1109 */ ArrayList row1 = (ArrayList)monitorList.get(j); /* 1110 */ String resourceName1 = (String)row1.get(7); /* 1111 */ String resourceid1 = (String)row1.get(6); /* 1112 */ hseverity[j] = alert.getProperty(resourceid1 + "#" + healthkeys.get(resourceName1)); /* 1113 */ if (hseverity[j] == null) /* */ { /* 1115 */ hseverity[j] = "6"; /* */ } /* */ } /* */ /* */ /* 1120 */ for (j = 0; j < hseverity.length; j++) /* */ { /* 1122 */ for (int k = j + 1; k < hseverity.length; k++) /* */ { /* */ /* 1125 */ int hsev = hseverity[j].compareTo(hseverity[k]); /* */ /* */ /* 1128 */ if (hsev > 0) { /* 1129 */ ArrayList t = (ArrayList)monitorList.get(k); /* 1130 */ monitorList.set(k, monitorList.get(j)); /* 1131 */ monitorList.set(j, t); /* 1132 */ String temp1 = hseverity[k]; /* 1133 */ hseverity[k] = hseverity[j]; /* 1134 */ hseverity[j] = temp1; /* */ } /* */ } /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ public String getAllChildNodestoDisplay(ArrayList singlechilmos, String resIdTOCheck, String currentresourceidtree, Hashtable childmos, Hashtable availhealth, int level, HttpServletRequest request, HashMap extDeviceMap, HashMap site24x7List) /* */ { /* 1146 */ boolean isIt360 = com.adventnet.appmanager.util.Constants.isIt360; /* 1147 */ boolean forInventory = false; /* 1148 */ String trdisplay = "none"; /* 1149 */ String plusstyle = "inline"; /* 1150 */ String minusstyle = "none"; /* 1151 */ String haidTopLevel = ""; /* 1152 */ if (request.getAttribute("forInventory") != null) /* */ { /* 1154 */ if ("true".equals((String)request.getAttribute("forInventory"))) /* */ { /* 1156 */ haidTopLevel = request.getParameter("haid"); /* 1157 */ forInventory = true; /* 1158 */ trdisplay = "table-row;"; /* 1159 */ plusstyle = "none"; /* 1160 */ minusstyle = "inline"; /* */ } /* */ /* */ /* */ } /* */ else /* */ { /* 1167 */ haidTopLevel = resIdTOCheck; /* */ } /* */ /* 1170 */ ArrayList listtoreturn = new ArrayList(); /* 1171 */ StringBuffer toreturn = new StringBuffer(); /* 1172 */ Hashtable availabilitykeys = (Hashtable)availhealth.get("avail"); /* 1173 */ Hashtable healthkeys = (Hashtable)availhealth.get("health"); /* 1174 */ Properties alert = (Properties)availhealth.get("alert"); /* */ /* 1176 */ for (int j = 0; j < singlechilmos.size(); j++) /* */ { /* 1178 */ ArrayList singlerow = (ArrayList)singlechilmos.get(j); /* 1179 */ String childresid = (String)singlerow.get(0); /* 1180 */ String childresname = (String)singlerow.get(1); /* 1181 */ childresname = com.adventnet.appmanager.util.ExtProdUtil.decodeString(childresname); /* 1182 */ String childtype = ((String)singlerow.get(2) + "").trim(); /* 1183 */ String imagepath = ((String)singlerow.get(3) + "").trim(); /* 1184 */ String shortname = ((String)singlerow.get(4) + "").trim(); /* 1185 */ String unmanagestatus = (String)singlerow.get(5); /* 1186 */ String actionstatus = (String)singlerow.get(6); /* 1187 */ String linkclass = "monitorgp-links"; /* 1188 */ String titleforres = childresname; /* 1189 */ String titilechildresname = childresname; /* 1190 */ String childimg = "/images/trcont.png"; /* 1191 */ String flag = "enable"; /* 1192 */ String dcstarted = (String)singlerow.get(8); /* 1193 */ String configMonitor = ""; /* 1194 */ String configmsg = FormatUtil.getString("am.webclient.vcenter.esx.notconfigured.text"); /* 1195 */ if (("VMWare ESX/ESXi".equals(childtype)) && (!"2".equals(dcstarted))) /* */ { /* 1197 */ configMonitor = "&nbsp;&nbsp;<img src='/images/icon_ack.gif' align='absmiddle' style='width=16px;heigth:16px' border='0' title='" + configmsg + "' />"; /* */ } /* 1199 */ if (singlerow.get(7) != null) /* */ { /* 1201 */ flag = (String)singlerow.get(7); /* */ } /* 1203 */ String haiGroupType = "0"; /* 1204 */ if ("HAI".equals(childtype)) /* */ { /* 1206 */ haiGroupType = (String)singlerow.get(9); /* */ } /* 1208 */ childimg = "/images/trend.png"; /* 1209 */ String actionmsg = FormatUtil.getString("Actions Enabled"); /* 1210 */ String actionimg = "<img src=\"/images/alarm-icon.png\" border=\"0\" title=\"" + actionmsg + "\" />"; /* 1211 */ if ((actionstatus == null) || (actionstatus.equalsIgnoreCase("null")) || (actionstatus.equals("1"))) /* */ { /* 1213 */ actionimg = "<img src=\"/images/alarm-icon.png\" border=\"0\" title=\"" + actionmsg + "\" />"; /* */ } /* 1215 */ else if (actionstatus.equals("0")) /* */ { /* 1217 */ actionmsg = FormatUtil.getString("Actions Disabled"); /* 1218 */ actionimg = "<img src=\"/images/icon_actions_disabled.gif\" border=\"0\" title=\"" + actionmsg + "\" />"; /* */ } /* */ /* 1221 */ if ((unmanagestatus != null) && (!unmanagestatus.trim().equalsIgnoreCase("null"))) /* */ { /* 1223 */ linkclass = "disabledtext"; /* 1224 */ titleforres = titleforres + "-UnManaged"; /* */ } /* 1226 */ String availkey = childresid + "#" + availabilitykeys.get(childtype) + "#" + "MESSAGE"; /* 1227 */ String availmouseover = ""; /* 1228 */ if (alert.getProperty(availkey) != null) /* */ { /* 1230 */ availmouseover = "onmouseover=\"ddrivetip(this,event,'" + alert.getProperty(availkey).replace("\"", "&quot;") + "<br><span style=color: #000000;font-weight:bold;>" + FormatUtil.getString("am.webclient.tooltip.text") + "</span>',null,true,'#000000')\" onmouseout=\"hideddrivetip()\" "; /* */ } /* 1232 */ String healthkey = childresid + "#" + healthkeys.get(childtype) + "#" + "MESSAGE"; /* 1233 */ String healthmouseover = ""; /* 1234 */ if (alert.getProperty(healthkey) != null) /* */ { /* 1236 */ healthmouseover = "onmouseover=\"ddrivetip(this,event,'" + alert.getProperty(healthkey).replace("\"", "&quot;") + "<br><span style=color: #000000;font-weight:bold;>" + FormatUtil.getString("am.webclient.tooltip.text") + "</span>',null,true,'#000000')\" onmouseout=\"hideddrivetip()\" "; /* */ } /* */ /* 1239 */ String tempbgcolor = "class=\"whitegrayrightalign\""; /* 1240 */ int spacing = 0; /* 1241 */ if (level >= 1) /* */ { /* 1243 */ spacing = 40 * level; /* */ } /* 1245 */ if (childtype.equals("HAI")) /* */ { /* 1247 */ ArrayList singlechilmos1 = (ArrayList)childmos.get(childresid + ""); /* 1248 */ String tempresourceidtree = currentresourceidtree + "|" + childresid; /* 1249 */ String availimage = getSeverityImageForAvailability(alert.getProperty(childresid + "#" + availabilitykeys.get(childtype))); /* */ /* 1251 */ String availlink = "<a href=\"javascript:void(0);\" " + availmouseover + " onClick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid=" + childresid + "&attributeid=" + availabilitykeys.get(childtype) + "')\"> " + availimage + "</a>"; /* 1252 */ String healthimage = getSeverityImageForHealth(alert.getProperty(childresid + "#" + healthkeys.get(childtype))); /* 1253 */ String healthlink = "<a href=\"javascript:void(0);\" " + healthmouseover + " onClick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid=" + childresid + "&attributeid=" + healthkeys.get(childtype) + "')\"> " + healthimage + "</a>"; /* 1254 */ String editlink = "<a href=\"/showapplication.do?method=editApplication&fromwhere=allmonitorgroups&haid=" + childresid + "\" class=\"staticlinks\" title=\"" + FormatUtil.getString("am.webclient.maintenance.edit") + "\"><img align=\"center\" src=\"/images/icon_edit.gif\" border=\"0\" /></a>"; /* 1255 */ String imglink = "<img src=\"" + childimg + "\" align=\"center\" align=\"left\" border=\"0\" height=\"24\" width=\"24\">"; /* 1256 */ String checkbox = "<input type=\"checkbox\" name=\"select\" id=\"" + tempresourceidtree + "\" value=\"" + childresid + "\" onclick=\"selectAllChildCKbs('" + tempresourceidtree + "',this,this.form),deselectParentCKbs('" + tempresourceidtree + "',this,this.form)\" >"; /* 1257 */ String thresholdurl = "/showActionProfiles.do?method=getHAProfiles&haid=" + childresid; /* 1258 */ String configalertslink = " <a title='" + FormatUtil.getString("am.webclient.common.util.ALERTCONFIG_TEXT") + "' href=\"" + thresholdurl + "\" ><img src=\"images/icon_associateaction.gif\" align=\"center\" border=\"0\" title=\"" + FormatUtil.getString("am.webclient.common.util.ALERTCONFIG_TEXT") + "\" /></a>"; /* 1259 */ String associatelink = "<a href=\"/showresource.do?method=getMonitorForm&type=All&fromwhere=monitorgroupview&haid=" + childresid + "\" title=\"" + FormatUtil.getString("am.webclient.monitorgroupdetails.associatemonitors.text") + "\" ><img align=\"center\" src=\"images/icon_assoicatemonitors.gif\" border=\"0\" /></a>"; /* 1260 */ String removefromgroup = "<a class='staticlinks' href=\"javascript: removeMonitorFromGroup ('" + resIdTOCheck + "','" + childresid + "','" + haidTopLevel + "');\" title='" + FormatUtil.getString("am.webclient.monitorgroupdetails.remove.text") + "'><img width='13' align=\"center\" height='14' border='0' src='/images/icon_removefromgroup.gif'/></a>&nbsp;&nbsp;"; /* 1261 */ String configcustomfields = "<a href=\"javascript:void(0)\" onclick=\"fnOpenNewWindow('/jsp/MyField_Alarms.jsp?resourceid=" + childresid + "&mgview=true')\" title='" + FormatUtil.getString("am.myfield.assign.text") + "'><img align=\"center\" src=\"/images/icon_assigncustomfields.gif\" border=\"0\" /></a>"; /* */ /* 1263 */ if (!forInventory) /* */ { /* 1265 */ removefromgroup = ""; /* */ } /* */ /* 1268 */ String actions = "&nbsp;&nbsp;" + configalertslink + "&nbsp;&nbsp;" + removefromgroup + "&nbsp;&nbsp;"; /* */ /* 1270 */ if ((haiGroupType == null) || ((haiGroupType != null) && (!"1009".equals(haiGroupType)) && (!"1010".equals(haiGroupType)) && (!"1012".equals(haiGroupType)))) /* */ { /* 1272 */ actions = editlink + actions; /* */ } /* 1274 */ if ((haiGroupType == null) || ((haiGroupType != null) && (!"1009".equals(haiGroupType)) && (!"1010".equals(haiGroupType)) && (!"3".equals(haiGroupType)) && (!"1012".equals(haiGroupType)))) /* */ { /* 1276 */ actions = actions + associatelink; /* */ } /* 1278 */ actions = actions + "&nbsp;&nbsp;&nbsp;&nbsp;" + configcustomfields; /* 1279 */ String arrowimg = ""; /* 1280 */ if (request.isUserInRole("ENTERPRISEADMIN")) /* */ { /* 1282 */ actions = ""; /* 1283 */ arrowimg = "<img align=\"center\" hspace=\"3\" border=\"0\" src=\"/images/icon_arrow_childattribute_grey.gif\"/>"; /* 1284 */ checkbox = ""; /* 1285 */ childresname = childresname + "_" + com.adventnet.appmanager.server.framework.comm.CommDBUtil.getManagedServerNameWithPort(childresid); /* */ } /* 1287 */ if (isIt360) /* */ { /* 1289 */ actionimg = ""; /* 1290 */ actions = ""; /* 1291 */ arrowimg = "<img align=\"center\" hspace=\"3\" border=\"0\" src=\"/images/icon_arrow_childattribute_grey.gif\"/>"; /* 1292 */ checkbox = ""; /* */ } /* */ /* 1295 */ if (!request.isUserInRole("ADMIN")) /* */ { /* 1297 */ actions = ""; /* */ } /* 1299 */ if (request.isUserInRole("OPERATOR")) /* */ { /* 1301 */ checkbox = ""; /* */ } /* */ /* 1304 */ String resourcelink = ""; /* */ /* 1306 */ if ((flag != null) && (flag.equals("enable"))) /* */ { /* 1308 */ resourcelink = "<a href=\"javascript:void(0);\" onclick=\"toggleChildMos('#monitor" + tempresourceidtree + "'),toggleTreeImage('" + tempresourceidtree + "');\"><div id=\"monitorShow" + tempresourceidtree + "\" style=\"display:" + plusstyle + ";\"><img src=\"/images/icon_plus.gif\" border=\"0\" hspace=\"5\"></div><div id=\"monitorHide" + tempresourceidtree + "\" style=\"display:" + minusstyle + ";\"><img src=\"/images/icon_minus.gif\" border=\"0\" hspace=\"5\"></div> </a>" + checkbox + "<a href=\"/showapplication.do?haid=" + childresid + "&method=showApplication\" class=\"" + linkclass + "\">" + getTrimmedText(titilechildresname, 45) + "</a> "; /* */ } /* */ else /* */ { /* 1312 */ resourcelink = "<a href=\"javascript:void(0);\" onclick=\"toggleChildMos('#monitor" + tempresourceidtree + "'),toggleTreeImage('" + tempresourceidtree + "');\"><div id=\"monitorShow" + tempresourceidtree + "\" style=\"display:" + plusstyle + ";\"><img src=\"/images/icon_plus.gif\" border=\"0\" hspace=\"5\"></div><div id=\"monitorHide" + tempresourceidtree + "\" style=\"display:" + minusstyle + ";\"><img src=\"/images/icon_minus.gif\" border=\"0\" hspace=\"5\"></div> </a>" + checkbox + "" + getTrimmedText(titilechildresname, 45); /* */ } /* */ /* 1315 */ toreturn.append("<tr " + tempbgcolor + " id=\"#monitor" + currentresourceidtree + "\" style=\"display:" + trdisplay + ";\" width='100%'>"); /* 1316 */ toreturn.append("<td " + tempbgcolor + " width=\"3%\" >&nbsp;</td> "); /* 1317 */ toreturn.append("<td " + tempbgcolor + " width=\"47%\" style=\"padding-left: " + spacing + "px !important;\" title=" + childresname + ">" + arrowimg + resourcelink + "</td>"); /* 1318 */ toreturn.append("<td " + tempbgcolor + " width=\"15%\" align=\"left\">" + "<table><tr class='whitegrayrightalign'><td><div id='mgaction'>" + actions + "</div></td></tr></table></td>"); /* 1319 */ toreturn.append("<td " + tempbgcolor + " width=\"8%\" align=\"center\">" + availlink + "</td>"); /* 1320 */ toreturn.append("<td " + tempbgcolor + " width=\"7%\" align=\"center\">" + healthlink + "</td>"); /* 1321 */ if (!isIt360) /* */ { /* 1323 */ toreturn.append("<td " + tempbgcolor + " width=\"7%\" align=\"left\">" + actionimg + "</td>"); /* */ } /* */ else /* */ { /* 1327 */ toreturn.append("<td " + tempbgcolor + " width=\"7%\" align=\"left\">&nbsp;</td>"); /* */ } /* */ /* 1330 */ toreturn.append("</tr>"); /* 1331 */ if (childmos.get(childresid + "") != null) /* */ { /* 1333 */ String toappend = getAllChildNodestoDisplay(singlechilmos1, childresid + "", tempresourceidtree, childmos, availhealth, level + 1, request, extDeviceMap, site24x7List); /* 1334 */ toreturn.append(toappend); /* */ } /* */ else /* */ { /* 1338 */ String assocMessage = "<td " + tempbgcolor + " colspan=\"2\"><span class=\"bodytext\" style=\"padding-left: " + (spacing + 10) + "px !important;\"> &nbsp;&nbsp;&nbsp;&nbsp;" + FormatUtil.getString("am.webclient.monitorgroupdetails.nomonitormessage.text") + "</span><span class=\"bodytext\">"; /* 1339 */ if ((!request.isUserInRole("ENTERPRISEADMIN")) && (!request.isUserInRole("DEMO")) && (!request.isUserInRole("OPERATOR"))) /* */ { /* */ /* 1342 */ assocMessage = assocMessage + FormatUtil.getString("am.webclient.monitorgroupdetails.click.text") + " <a href=\"/showresource.do?method=getMonitorForm&type=All&haid=" + childresid + "&fromwhere=monitorgroupview\" class=\"staticlinks\" >" + FormatUtil.getString("am.webclient.monitorgroupdetails.linktoadd.text") + "</span></td>"; /* */ } /* */ /* */ /* 1346 */ if ((haiGroupType == null) || ((haiGroupType != null) && (!"1009".equals(haiGroupType)) && (!"1010".equals(haiGroupType)) && (!"3".equals(haiGroupType)) && (!"1012".equals(haiGroupType)))) /* */ { /* 1348 */ toreturn.append("<tr " + tempbgcolor + " id=\"#monitor" + tempresourceidtree + "\" style=\"display: " + trdisplay + ";\" width='100%'>"); /* 1349 */ toreturn.append("<td " + tempbgcolor + " width=\"3%\" >&nbsp;</td> "); /* 1350 */ toreturn.append(assocMessage); /* 1351 */ toreturn.append("<td " + tempbgcolor + " >&nbsp;</td> "); /* 1352 */ toreturn.append("<td " + tempbgcolor + " >&nbsp;</td> "); /* 1353 */ toreturn.append("<td " + tempbgcolor + " >&nbsp;</td> "); /* 1354 */ toreturn.append("</tr>"); /* */ } /* */ } /* */ } /* */ else /* */ { /* 1360 */ String resourcelink = null; /* 1361 */ boolean hideEditLink = false; /* 1362 */ if ((extDeviceMap != null) && (extDeviceMap.get(childresid) != null)) /* */ { /* 1364 */ String link1 = (String)extDeviceMap.get(childresid); /* 1365 */ hideEditLink = true; /* 1366 */ if (isIt360) /* */ { /* 1368 */ resourcelink = "<a href=" + link1 + " class=\"" + linkclass + "\" title=\"" + titleforres + "\">" + getTrimmedText(childresname, 45) + "</a>"; /* */ } /* */ else /* */ { /* 1372 */ resourcelink = "<a href=\"javascript:MM_openBrWindow('" + link1 + "','ExternalDevice','width=950,height=600,top=50,left=75,scrollbars=yes,resizable=yes')\" class=\"" + linkclass + "\" title=\"" + titleforres + "\">" + getTrimmedText(childresname, 45) + "</a>"; /* */ } /* 1374 */ } else if ((site24x7List != null) && (site24x7List.containsKey(childresid))) /* */ { /* 1376 */ hideEditLink = true; /* 1377 */ String link2 = URLEncoder.encode((String)site24x7List.get(childresid)); /* 1378 */ resourcelink = "<a href=\"javascript:MM_openBrWindow('" + link2 + "','Site24x7','width=950,height=600,top=50,left=75,scrollbars=yes,resizable=yes')\" class=\"" + linkclass + "\" title=\"" + titleforres + "\">" + getTrimmedText(childresname, 45) + "</a>"; /* */ /* */ } /* */ else /* */ { /* 1383 */ resourcelink = "<a href=\"/showresource.do?resourceid=" + childresid + "&method=showResourceForResourceID&haid=" + resIdTOCheck + "\" class=\"" + linkclass + "\" title=\"" + titleforres + "\">" + getTrimmedText(childresname, 45) + "</a>"; /* */ } /* */ /* 1386 */ String imglink = "<img src=\"" + childimg + "\" align=\"left\" border=\"0\" height=\"24\" width=\"24\" />"; /* 1387 */ String checkbox = "<input type=\"checkbox\" name=\"select\" id=\"" + currentresourceidtree + "|" + childresid + "\" value=\"" + childresid + "\" onclick=\"deselectParentCKbs('" + currentresourceidtree + "|" + childresid + "',this,this.form);\" >"; /* 1388 */ String key = childresid + "#" + availabilitykeys.get(childtype) + "#" + "MESSAGE"; /* 1389 */ String availimage = getSeverityImageForAvailability(alert.getProperty(childresid + "#" + availabilitykeys.get(childtype))); /* 1390 */ String healthimage = getSeverityImageForHealth(alert.getProperty(childresid + "#" + healthkeys.get(childtype))); /* 1391 */ String availlink = "<a href=\"javascript:void(0);\" " + availmouseover + "onClick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid=" + childresid + "&attributeid=" + availabilitykeys.get(childtype) + "')\"> " + availimage + "</a>"; /* 1392 */ String healthlink = "<a href=\"javascript:void(0);\" " + healthmouseover + " onClick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid=" + childresid + "&attributeid=" + healthkeys.get(childtype) + "')\"> " + healthimage + "</a>"; /* 1393 */ String editlink = "<a href=\"/showresource.do?haid=" + resIdTOCheck + "&resourceid=" + childresid + "&resourcename=" + childresname + "&type=" + childtype + "&method=showdetails&editPage=true&moname=" + childresname + "\" class=\"staticlinks\" title=\"" + FormatUtil.getString("am.webclient.maintenance.edit") + "\"><img align=\"center\" src=\"/images/icon_edit.gif\" border=\"0\" /></a>"; /* 1394 */ String thresholdurl = "/showActionProfiles.do?method=getResourceProfiles&admin=true&all=true&resourceid=" + childresid; /* 1395 */ String configalertslink = " <a href=\"" + thresholdurl + "\" title='" + FormatUtil.getString("am.webclient.common.util.ALERTCONFIG_TEXT") + "'><img src=\"images/icon_associateaction.gif\" align=\"center\" border=\"0\" /></a>"; /* 1396 */ String img2 = "<img src=\"/images/trvline.png\" align=\"absmiddle\" border=\"0\" height=\"15\" width=\"15\"/>"; /* 1397 */ String removefromgroup = "<a class='staticlinks' href=\"javascript: removeMonitorFromGroup ('" + resIdTOCheck + "','" + childresid + "','" + haidTopLevel + "');\" title='" + FormatUtil.getString("am.webclient.monitorgroupdetails.remove.text") + "'><img width='13' align=\"center\" height='14' border='0' src='/images/icon_removefromgroup.gif'/></a>"; /* 1398 */ String configcustomfields = "<a href=\"javascript:void(0)\" onclick=\"fnOpenNewWindow('/jsp/MyField_Alarms.jsp?resourceid=" + childresid + "&mgview=true')\" title='" + FormatUtil.getString("am.myfield.assign.text") + "'><img align=\"center\" src=\"/images/icon_assigncustomfields.gif\" border=\"0\" /></a>"; /* */ /* 1400 */ if (hideEditLink) /* */ { /* 1402 */ editlink = "&nbsp;&nbsp;&nbsp;"; /* */ } /* 1404 */ if (!forInventory) /* */ { /* 1406 */ removefromgroup = ""; /* */ } /* 1408 */ String actions = "&nbsp;&nbsp;" + configalertslink + "&nbsp;&nbsp;" + removefromgroup + "&nbsp;&nbsp;"; /* 1409 */ if (!com.adventnet.appmanager.util.Constants.sqlManager) { /* 1410 */ actions = actions + configcustomfields; /* */ } /* 1412 */ if ((haiGroupType == null) || ((haiGroupType != null) && (!"1009".equals(haiGroupType)) && (!"1010".equals(haiGroupType)) && (!"1012".equals(haiGroupType)))) /* */ { /* 1414 */ actions = editlink + actions; /* */ } /* 1416 */ String managedLink = ""; /* 1417 */ if ((request.isUserInRole("ENTERPRISEADMIN")) && (!com.adventnet.appmanager.util.Constants.isIt360)) /* */ { /* 1419 */ checkbox = "<img hspace=\"3\" border=\"0\" src=\"/images/icon_arrow_childattribute_grey.gif\"/>"; /* 1420 */ actions = ""; /* 1421 */ if (Integer.parseInt(childresid) >= com.adventnet.appmanager.server.framework.comm.Constants.RANGE) { /* 1422 */ managedLink = "&nbsp; <a target=\"mas_window\" href=\"/showresource.do?resourceid=" + childresid + "&type=" + childtype + "&moname=" + URLEncoder.encode(childresname) + "&resourcename=" + URLEncoder.encode(childresname) + "&method=showdetails&aam_jump=true&useHTTP=" + (!isIt360) + "\"><img border=\"0\" title=\"View Monitor details in Managed Server console\" src=\"/images/jump.gif\"/></a>"; /* */ } /* */ } /* 1425 */ if ((isIt360) || (request.isUserInRole("OPERATOR"))) /* */ { /* 1427 */ checkbox = ""; /* */ } /* */ /* 1430 */ if (!request.isUserInRole("ADMIN")) /* */ { /* 1432 */ actions = ""; /* */ } /* 1434 */ toreturn.append("<tr " + tempbgcolor + " id=\"#monitor" + currentresourceidtree + "\" style=\"display: " + trdisplay + ";\" width='100%'>"); /* 1435 */ toreturn.append("<td " + tempbgcolor + " width=\"3%\" >&nbsp;</td> "); /* 1436 */ toreturn.append("<td " + tempbgcolor + " width=\"47%\" nowrap=\"false\" style=\"padding-left: " + spacing + "px !important;\" >" + checkbox + "&nbsp;<img align='absmiddle' border=\"0\" title='" + shortname + "' src=\"" + imagepath + "\"/>&nbsp;" + resourcelink + managedLink + configMonitor + "</td>"); /* 1437 */ if (isIt360) /* */ { /* 1439 */ toreturn.append("<td " + tempbgcolor + " width=\"15%\" align=\"left\">&nbsp;</td>"); /* */ } /* */ else /* */ { /* 1443 */ toreturn.append("<td " + tempbgcolor + " width=\"15%\" align=\"left\">" + "<table><tr class='whitegrayrightalign'><td><div id='mgaction'>" + actions + "</div></td></tr></table></td>"); /* */ } /* 1445 */ toreturn.append("<td " + tempbgcolor + " width=\"8%\" align=\"center\">" + availlink + "</td>"); /* 1446 */ toreturn.append("<td " + tempbgcolor + " width=\"7%\" align=\"center\">" + healthlink + "</td>"); /* 1447 */ if (!isIt360) /* */ { /* 1449 */ toreturn.append("<td " + tempbgcolor + " width=\"7%\" align=\"left\">" + actionimg + "</td>"); /* */ } /* */ else /* */ { /* 1453 */ toreturn.append("<td " + tempbgcolor + " width=\"7%\" align=\"left\">&nbsp;</td>"); /* */ } /* 1455 */ toreturn.append("</tr>"); /* */ } /* */ } /* 1458 */ return toreturn.toString(); /* */ } /* */ /* */ public String getSeverityImageForHealthWithLink(Properties alert, String resourceid, String healthid) /* */ { /* */ try /* */ { /* 1465 */ StringBuilder toreturn = new StringBuilder(); /* 1466 */ String severity = alert.getProperty(resourceid + "#" + healthid); /* 1467 */ String v = "<script>var v = '<span style=\"color: #000000;font-weight:bold;\">';</script>"; /* 1468 */ String message = alert.getProperty(resourceid + "#" + healthid + "#" + "MESSAGE"); /* 1469 */ String title = ""; /* 1470 */ message = EnterpriseUtil.decodeString(message); /* 1471 */ message = FormatUtil.findReplace(message, "'", "\\'"); /* 1472 */ message = FormatUtil.findReplace(message, "\"", "&quot;"); /* 1473 */ if (("1".equals(severity)) || ("4".equals(severity))) /* */ { /* 1475 */ title = " onmouseover=\"ddrivetip(this,event,'" + message + "<br>'+v+'" + FormatUtil.getString("am.webclient.tooltip.text") + "</span>',null,true,'#000000')\" onmouseout='hideddrivetip()'"; /* */ } /* 1477 */ else if ("5".equals(severity)) /* */ { /* 1479 */ title = "title='" + FormatUtil.getString("am.fault.rca.healthisclear.text") + "'"; /* */ } /* */ else /* */ { /* 1483 */ title = "title='" + FormatUtil.getString("am.webclient.rcamessage.healthunknown.text") + "'"; /* */ } /* 1485 */ String link = "<a href='javascript:void(0)' " + title + " onClick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid=" + resourceid + "&attributeid=" + healthid + "')\">"; /* 1486 */ toreturn.append(v); /* */ /* 1488 */ toreturn.append(link); /* 1489 */ if (severity == null) /* */ { /* 1491 */ toreturn.append("<img border=\"0\" src=\"/images/icon_health_unknown.gif\" name=\"Image" + ++this.j + "\">"); /* */ } /* 1493 */ else if (severity.equals("5")) /* */ { /* 1495 */ toreturn.append("<img border=\"0\" src=\"/images/icon_health_clear.gif\" name=\"Image" + ++this.j + "\">"); /* */ } /* 1497 */ else if (severity.equals("4")) /* */ { /* 1499 */ toreturn.append("<img border=\"0\" src=\"/images/icon_health_warning.gif\" name=\"Image" + ++this.j + "\">"); /* */ } /* 1501 */ else if (severity.equals("1")) /* */ { /* 1503 */ toreturn.append("<img border=\"0\" src=\"/images/icon_health_critical.gif\" name=\"Image" + ++this.j + "\">"); /* */ /* */ } /* */ else /* */ { /* 1508 */ toreturn.append("<img border=\"0\" src=\"/images/icon_health_unknown.gif\" name=\"Image" + ++this.j + "\">"); /* */ } /* 1510 */ toreturn.append("</a>"); /* 1511 */ return toreturn.toString(); /* */ } /* */ catch (Exception ex) /* */ { /* 1515 */ ex.printStackTrace(); /* */ } /* 1517 */ return "<img border=\"0\" src=\"/images/icon_health_unknown.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* */ /* */ private String getSeverityImageForAvailabilitywithLink(Properties alert, String resourceid, String availabilityid) /* */ { /* */ try /* */ { /* 1524 */ StringBuilder toreturn = new StringBuilder(); /* 1525 */ String severity = alert.getProperty(resourceid + "#" + availabilityid); /* 1526 */ String v = "<script>var v = '<span style=\"color: #000000;font-weight:bold;\">';</script>"; /* 1527 */ String message = alert.getProperty(resourceid + "#" + availabilityid + "#" + "MESSAGE"); /* 1528 */ if (message == null) /* */ { /* 1530 */ message = ""; /* */ } /* */ /* 1533 */ message = FormatUtil.findReplace(message, "'", "\\'"); /* 1534 */ message = FormatUtil.findReplace(message, "\"", "&quot;"); /* */ /* 1536 */ String link = "<a href='javascript:void(0)' onmouseover=\"ddrivetip(this,event,'" + message + "<br>'+v+'" + FormatUtil.getString("am.webclient.tooltip.text") + "</span>',null,true,'#000000')\" onmouseout='hideddrivetip()' onClick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid=" + resourceid + "&attributeid=" + availabilityid + "')\">"; /* 1537 */ toreturn.append(v); /* */ /* 1539 */ toreturn.append(link); /* */ /* 1541 */ if (severity == null) /* */ { /* 1543 */ toreturn.append("<img border=\"0\" src=\"/images/icon_availability_unknown.gif\" name=\"Image" + ++this.j + "\">"); /* */ } /* 1545 */ else if (severity.equals("5")) /* */ { /* 1547 */ toreturn.append("<img border=\"0\" src=\"/images/icon_availability_up.gif\" name=\"Image" + ++this.j + "\">"); /* */ } /* 1549 */ else if (severity.equals("1")) /* */ { /* 1551 */ toreturn.append("<img border=\"0\" src=\"/images/icon_availability_down.gif\" name=\"Image" + ++this.j + "\">"); /* */ /* */ } /* */ else /* */ { /* 1556 */ toreturn.append("<img border=\"0\" src=\"/images/icon_availability_unknown.gif\" name=\"Image" + ++this.j + "\">"); /* */ } /* 1558 */ toreturn.append("</a>"); /* 1559 */ return toreturn.toString(); /* */ } /* */ catch (Exception ex) {} /* */ /* */ /* */ /* 1565 */ return "<img border=\"0\" src=\"/images/icon_availabilitynunknown.gif\" name=\"Image" + ++this.j + "\">"; /* */ } /* */ /* 1568 */ public ArrayList getPermittedActions(HashMap actionmap, HashMap invokeActions) { ArrayList actionsavailable = new ArrayList(); /* 1569 */ if (invokeActions != null) { /* 1570 */ Iterator iterator = invokeActions.keySet().iterator(); /* 1571 */ while (iterator.hasNext()) { /* 1572 */ String actionid = (String)invokeActions.get((String)iterator.next()); /* 1573 */ if (actionmap.containsKey(actionid)) { /* 1574 */ actionsavailable.add(actionid); /* */ } /* */ } /* */ } /* */ /* 1579 */ return actionsavailable; /* */ } /* */ /* */ public String getActionParams(HashMap methodArgumentsMap, String rowId, String managedObjectName, String resID, String resourcetype, Properties commonValues) { /* 1583 */ String actionLink = ""; /* 1584 */ AMConnectionPool cp = AMConnectionPool.getInstance(); /* 1585 */ String query = ""; /* 1586 */ ResultSet rs = null; /* 1587 */ String methodName = (String)methodArgumentsMap.get("METHODNAME"); /* 1588 */ String isJsp = (String)methodArgumentsMap.get("ISPOPUPJSP"); /* 1589 */ if ((isJsp != null) && (isJsp.equalsIgnoreCase("No"))) { /* 1590 */ actionLink = "method=" + methodName; /* */ } /* 1592 */ else if ((isJsp != null) && (isJsp.equalsIgnoreCase("Yes"))) { /* 1593 */ actionLink = methodName; /* */ } /* 1595 */ ArrayList methodarglist = (ArrayList)methodArgumentsMap.get(methodName); /* 1596 */ Iterator itr = methodarglist.iterator(); /* 1597 */ boolean isfirstparam = true; /* 1598 */ HashMap popupProps = (HashMap)methodArgumentsMap.get("POPUP-PROPS"); /* 1599 */ while (itr.hasNext()) { /* 1600 */ HashMap argmap = (HashMap)itr.next(); /* 1601 */ String argtype = (String)argmap.get("TYPE"); /* 1602 */ String argname = (String)argmap.get("IDENTITY"); /* 1603 */ String paramname = (String)argmap.get("PARAMETER"); /* 1604 */ String typeId = com.adventnet.appmanager.util.Constants.getTypeId(resourcetype); /* 1605 */ if ((isfirstparam) && (isJsp != null) && (isJsp.equalsIgnoreCase("Yes"))) { /* 1606 */ isfirstparam = false; /* 1607 */ if (actionLink.indexOf("?") > 0) /* */ { /* 1609 */ actionLink = actionLink + "&"; /* */ } /* */ else /* */ { /* 1613 */ actionLink = actionLink + "?"; /* */ } /* */ } /* */ else { /* 1617 */ actionLink = actionLink + "&"; /* */ } /* 1619 */ String paramValue = null; /* 1620 */ String tempargname = argname; /* 1621 */ if (commonValues.getProperty(tempargname) != null) { /* 1622 */ paramValue = commonValues.getProperty(tempargname); /* */ } /* */ else { /* 1625 */ if (argtype.equalsIgnoreCase("Argument")) { /* 1626 */ String dbType = com.adventnet.appmanager.db.DBQueryUtil.getDBType(); /* 1627 */ if (dbType.equals("mysql")) { /* 1628 */ argname = "`" + argname + "`"; /* */ } /* */ else { /* 1631 */ argname = "\"" + argname + "\""; /* */ } /* 1633 */ query = "select " + argname + " as VALUE from AM_ARGS_" + typeId + " where RESOURCEID=" + resID; /* */ try { /* 1635 */ rs = AMConnectionPool.executeQueryStmt(query); /* 1636 */ if (rs.next()) { /* 1637 */ paramValue = rs.getString("VALUE"); /* 1638 */ commonValues.setProperty(tempargname, paramValue); /* */ } /* */ } /* */ catch (SQLException e) { /* 1642 */ e.printStackTrace(); /* */ } /* */ finally { /* */ try { /* 1646 */ AMConnectionPool.closeStatement(rs); /* */ } /* */ catch (Exception exc) { /* 1649 */ exc.printStackTrace(); /* */ } /* */ } /* */ } /* */ /* 1654 */ if ((argtype.equalsIgnoreCase("Rowid")) && (rowId != null)) { /* 1655 */ paramValue = rowId; /* */ } /* 1657 */ else if ((argtype.equalsIgnoreCase("MO")) && (managedObjectName != null)) { /* 1658 */ paramValue = managedObjectName; /* */ } /* 1660 */ else if (argtype.equalsIgnoreCase("ResourceId")) { /* 1661 */ paramValue = resID; /* */ } /* 1663 */ else if (argtype.equalsIgnoreCase("TypeId")) { /* 1664 */ paramValue = com.adventnet.appmanager.util.Constants.getTypeId(resourcetype); /* */ } /* */ } /* 1667 */ actionLink = actionLink + paramname + "=" + paramValue; /* */ } /* 1669 */ if ((popupProps != null) && (popupProps.size() > 0)) { /* 1670 */ actionLink = actionLink + "|" + (String)popupProps.get("WinName") + "|"; /* 1671 */ actionLink = actionLink + "width=" + (String)popupProps.get("Width") + ",height=" + (String)popupProps.get("Height") + ",Top=" + (String)popupProps.get("Top") + ",Left=" + (String)popupProps.get("Left") + ",scrollbars=" + (String)popupProps.get("IsScrollBar") + ",resizable=" + (String)popupProps.get("IsResizable"); /* */ } /* 1673 */ return actionLink; /* */ } /* */ /* 1676 */ public String getActionColDetails(HashMap columnDetails, ArrayList actionsavailable, HashMap actionmap, float width, HashMap rowDetails, String rowid, String resourcetype, String resID, String id1, String availValue, String healthValue, String bgclass, Boolean isdisable, String primaryColId, Properties commonValues) { StringBuilder toreturn = new StringBuilder(); /* 1677 */ String dependentAttribute = null; /* 1678 */ String align = "left"; /* */ /* 1680 */ dependentAttribute = (String)columnDetails.get("DEPENDENTATTRIBUTE"); /* 1681 */ String displayType = (String)columnDetails.get("DISPLAYTYPE"); /* 1682 */ HashMap invokeActionsMap = (HashMap)((HashMap)columnDetails.get("INVOCATION")).get("ACTIONS"); /* 1683 */ HashMap invokeTooltip = (HashMap)((HashMap)columnDetails.get("INVOCATION")).get("TOOLTIP"); /* 1684 */ HashMap textOrImageValue = (HashMap)((HashMap)columnDetails.get("INVOCATION")).get("VALUES"); /* 1685 */ HashMap dependentValueMap = (HashMap)((HashMap)columnDetails.get("INVOCATION")).get("DEPENDENTVALUE"); /* 1686 */ HashMap dependentImageMap = (HashMap)((HashMap)columnDetails.get("INVOCATION")).get("DEPENDENTIMAGE"); /* 1687 */ if ((displayType != null) && (displayType.equals("Image"))) { /* 1688 */ align = "center"; /* */ } /* */ /* 1691 */ boolean iscolumntoDisplay = actionsavailable != null; /* 1692 */ String actualdata = ""; /* */ /* 1694 */ if ((dependentAttribute != null) && (!dependentAttribute.trim().equals(""))) { /* 1695 */ if (dependentAttribute.equalsIgnoreCase("Availability")) { /* 1696 */ actualdata = availValue; /* */ } /* 1698 */ else if (dependentAttribute.equalsIgnoreCase("Health")) { /* 1699 */ actualdata = healthValue; /* */ } else { /* */ try /* */ { /* 1703 */ String attributeName = ConfMonitorConfiguration.getInstance().getAttributeName(resourcetype, dependentAttribute).toUpperCase(); /* 1704 */ actualdata = (String)rowDetails.get(attributeName); /* */ } /* */ catch (Exception e) { /* 1707 */ e.printStackTrace(); /* */ } /* */ } /* */ } /* */ /* */ /* 1713 */ if ((actionmap != null) && (actionmap.size() > 0) && (iscolumntoDisplay)) { /* 1714 */ toreturn.append("<td width='" + width + "%' align='" + align + "' class='" + bgclass + "' >"); /* 1715 */ toreturn.append("<table>"); /* 1716 */ toreturn.append("<tr>"); /* 1717 */ for (int orderId = 1; orderId <= textOrImageValue.size(); orderId++) { /* 1718 */ String displayValue = (String)textOrImageValue.get(Integer.toString(orderId)); /* 1719 */ String actionName = (String)invokeActionsMap.get(Integer.toString(orderId)); /* 1720 */ String dependentValue = (String)dependentValueMap.get(Integer.toString(orderId)); /* 1721 */ String toolTip = ""; /* 1722 */ String hideClass = ""; /* 1723 */ String textStyle = ""; /* 1724 */ boolean isreferenced = true; /* 1725 */ if (invokeTooltip.get(Integer.toString(orderId)) != null) { /* 1726 */ toolTip = (String)invokeTooltip.get(Integer.toString(orderId)); /* 1727 */ toolTip = toolTip.replaceAll("\"", "&quot;"); /* 1728 */ hideClass = "hideddrivetip()"; /* */ } /* 1730 */ if ((dependentValue != null) && (!dependentValue.equals("Null")) && (!dependentValue.equals(""))) { /* 1731 */ StringTokenizer valueList = new StringTokenizer(dependentValue, ","); /* 1732 */ while (valueList.hasMoreTokens()) { /* 1733 */ String dependentVal = valueList.nextToken(); /* 1734 */ if ((actualdata != null) && (actualdata.equals(dependentVal))) { /* 1735 */ if ((dependentImageMap != null) && (dependentImageMap.get(dependentValue) != null)) { /* 1736 */ displayValue = (String)dependentImageMap.get(dependentValue); /* */ } /* 1738 */ toolTip = ""; /* 1739 */ hideClass = ""; /* 1740 */ isreferenced = false; /* 1741 */ textStyle = "disabledtext"; /* 1742 */ break; /* */ } /* */ } /* */ } /* 1746 */ if ((isdisable.booleanValue()) || (actualdata == null)) { /* 1747 */ toolTip = ""; /* 1748 */ hideClass = ""; /* 1749 */ isreferenced = false; /* 1750 */ textStyle = "disabledtext"; /* 1751 */ if (dependentImageMap != null) { /* 1752 */ if ((dependentValue != null) && (!dependentValue.equals("Null")) && (!dependentValue.equals("")) && (dependentImageMap.get(dependentValue) != null)) { /* 1753 */ displayValue = (String)dependentImageMap.get(dependentValue); /* */ } /* */ else { /* 1756 */ displayValue = (String)dependentImageMap.get(Integer.toString(orderId)); /* */ } /* */ } /* */ } /* 1760 */ if ((actionsavailable.contains(actionName)) && (actionmap.get(actionName) != null)) { /* 1761 */ Boolean confirmBox = (Boolean)((HashMap)actionmap.get(actionName)).get("CONFIRMATION"); /* 1762 */ String confirmmsg = (String)((HashMap)actionmap.get(actionName)).get("MESSAGE"); /* 1763 */ String isJSP = (String)((HashMap)actionmap.get(actionName)).get("ISPOPUPJSP"); /* 1764 */ String managedObject = (String)rowDetails.get(primaryColId); /* 1765 */ String actionLinks = getActionParams((HashMap)actionmap.get(actionName), rowid, managedObject, resID, resourcetype, commonValues); /* */ /* 1767 */ toreturn.append("<td width='" + width / actionsavailable.size() + "%' align='" + align + "' class='staticlinks'>"); /* 1768 */ if (isreferenced) { /* 1769 */ toreturn.append("<a href=\"javascript:triggerAction('" + actionLinks + "','" + id1 + "','" + confirmBox + "','" + FormatUtil.getString(confirmmsg) + "','" + isJSP + "');\" class='staticlinks' onMouseOver=\"ddrivetip(this,event,'" + FormatUtil.getString(toolTip).replace("\"", "&quot;") + "',false,true,'#000000',100,'lightyellow')\" onmouseout=\"" + hideClass + "\">"); /* */ } /* */ else /* */ { /* 1773 */ toreturn.append("<a href=\"javascript:void(0);\" class='staticlinks' onMouseOver=\"ddrivetip(this,event,'" + FormatUtil.getString(toolTip).replace("\"", "&quot;") + "',false,true,'#000000',100,'lightyellow')\" onmouseout=\"" + hideClass + "\">"); } /* 1774 */ if ((displayValue != null) && (displayType != null) && (displayType.equals("Image"))) { /* 1775 */ toreturn.append("<img src=\"" + displayValue + "\" hspace=\"4\" border=\"0\" align=\"absmiddle\"/>"); /* 1776 */ } else if ((displayValue != null) && (displayType != null) && (displayType.equals("Text"))) { /* 1777 */ toreturn.append("<span class=\"" + textStyle + "\">"); /* 1778 */ toreturn.append(FormatUtil.getString(displayValue)); /* */ } /* 1780 */ toreturn.append("</span>"); /* 1781 */ toreturn.append("</a>"); /* 1782 */ toreturn.append("</td>"); /* */ } /* */ } /* 1785 */ toreturn.append("</tr>"); /* 1786 */ toreturn.append("</table>"); /* 1787 */ toreturn.append("</td>"); /* */ } else { /* 1789 */ toreturn.append("<td width='" + width + "%' align='" + align + "' class='" + bgclass + "' > - </td>"); /* */ } /* */ /* 1792 */ return toreturn.toString(); /* */ } /* */ /* */ public String getMOCollectioTime(ArrayList rows, String tablename, String attributeid, String resColumn) { /* 1796 */ String colTime = null; /* 1797 */ AMConnectionPool cp = AMConnectionPool.getInstance(); /* 1798 */ if ((rows != null) && (rows.size() > 0)) { /* 1799 */ Iterator<String> itr = rows.iterator(); /* 1800 */ String maxColQuery = ""; /* 1801 */ for (;;) { if (itr.hasNext()) { /* 1802 */ maxColQuery = "select max(COLLECTIONTIME) from " + tablename + " where ATTRIBUTEID=" + attributeid + " and " + resColumn + "=" + (String)itr.next(); /* 1803 */ ResultSet maxCol = null; /* */ try { /* 1805 */ maxCol = AMConnectionPool.executeQueryStmt(maxColQuery); /* 1806 */ while (maxCol.next()) { /* 1807 */ if (colTime == null) { /* 1808 */ colTime = Long.toString(maxCol.getLong(1)); /* */ } /* */ else { /* 1811 */ colTime = colTime + "," + Long.toString(maxCol.getLong(1)); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* 1820 */ AMLog.debug("Graph Query for att " + attributeid + " :" + maxColQuery); /* */ try { /* 1822 */ if (maxCol != null) /* 1823 */ AMConnectionPool.closeStatement(maxCol); /* */ } catch (Exception e) { /* 1825 */ e.printStackTrace(); /* */ } /* */ } /* */ catch (Exception e) {}finally /* */ { /* 1820 */ AMLog.debug("Graph Query for att " + attributeid + " :" + maxColQuery); /* */ try { /* 1822 */ if (maxCol != null) /* 1823 */ AMConnectionPool.closeStatement(maxCol); /* */ } catch (Exception e) { /* 1825 */ e.printStackTrace(); /* */ } /* */ } /* */ } /* */ } } /* 1830 */ return colTime; /* */ } /* */ /* 1833 */ public String getTableName(String attributeid, String baseid) { String tablenameqry = "select ATTRIBUTEID,DATATABLE,VALUE_COL from AM_ATTRIBUTES_EXT where ATTRIBUTEID=" + attributeid; /* 1834 */ tablename = null; /* 1835 */ ResultSet rsTable = null; /* 1836 */ AMConnectionPool cp = AMConnectionPool.getInstance(); /* */ try { /* 1838 */ rsTable = AMConnectionPool.executeQueryStmt(tablenameqry); /* 1839 */ while (rsTable.next()) { /* 1840 */ tablename = rsTable.getString("DATATABLE"); /* 1841 */ if ((tablename.equals("AM_ManagedObjectData")) && (rsTable.getString("VALUE_COL").equals("RESPONSETIME"))) { /* 1842 */ tablename = "AM_Script_Numeric_Data_" + baseid; /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 1855 */ return tablename; /* */ } /* */ catch (Exception e) /* */ { /* 1846 */ e.printStackTrace(); /* */ } finally { /* */ try { /* 1849 */ if (rsTable != null) /* 1850 */ AMConnectionPool.closeStatement(rsTable); /* */ } catch (Exception e) { /* 1852 */ e.printStackTrace(); /* */ } /* */ } /* */ } /* */ /* */ public String getArgsListtoShowonClick(HashMap showArgsMap, String row) { /* 1858 */ String argsList = ""; /* 1859 */ ArrayList showArgslist = new ArrayList(); /* */ try { /* 1861 */ if (showArgsMap.get(row) != null) { /* 1862 */ showArgslist = (ArrayList)showArgsMap.get(row); /* 1863 */ if (showArgslist != null) { /* 1864 */ for (int i = 0; i < showArgslist.size(); i++) { /* 1865 */ if (argsList.trim().equals("")) { /* 1866 */ argsList = (String)showArgslist.get(i); /* */ } /* */ else { /* 1869 */ argsList = argsList + "," + (String)showArgslist.get(i); /* */ } /* */ } /* */ } /* */ } /* */ } /* */ catch (Exception e) { /* 1876 */ e.printStackTrace(); /* 1877 */ return ""; /* */ } /* 1879 */ return argsList; /* */ } /* */ /* */ public String getArgsListToHideOnClick(HashMap hideArgsMap, String row) /* */ { /* 1884 */ String argsList = ""; /* 1885 */ ArrayList hideArgsList = new ArrayList(); /* */ try /* */ { /* 1888 */ if (hideArgsMap.get(row) != null) /* */ { /* 1890 */ hideArgsList = (ArrayList)hideArgsMap.get(row); /* 1891 */ if (hideArgsList != null) /* */ { /* 1893 */ for (int i = 0; i < hideArgsList.size(); i++) /* */ { /* 1895 */ if (argsList.trim().equals("")) /* */ { /* 1897 */ argsList = (String)hideArgsList.get(i); /* */ } /* */ else /* */ { /* 1901 */ argsList = argsList + "," + (String)hideArgsList.get(i); /* */ } /* */ } /* */ } /* */ } /* */ } /* */ catch (Exception ex) /* */ { /* 1909 */ ex.printStackTrace(); /* */ } /* 1911 */ return argsList; /* */ } /* */ /* */ public String getTableActionsList(ArrayList tActionList, HashMap actionmap, String tableName, Properties commonValues, String resourceId, String resourceType) { /* 1915 */ StringBuilder toreturn = new StringBuilder(); /* 1916 */ StringBuilder addtoreturn = new StringBuilder(); /* */ /* */ /* */ /* */ /* */ /* */ /* 1923 */ if ((tActionList != null) && (tActionList.size() > 0)) { /* 1924 */ Iterator itr = tActionList.iterator(); /* 1925 */ while (itr.hasNext()) { /* 1926 */ Boolean confirmBox = Boolean.valueOf(false); /* 1927 */ String confirmmsg = ""; /* 1928 */ String link = ""; /* 1929 */ String isJSP = "NO"; /* 1930 */ HashMap tactionMap = (HashMap)itr.next(); /* 1931 */ boolean isTableAction = tactionMap.containsKey("ACTION-NAME"); /* 1932 */ String actionName = isTableAction ? (String)tactionMap.get("ACTION-NAME") : (String)tactionMap.get("LINK-NAME"); /* 1933 */ String actionId = (String)tactionMap.get("ACTIONID"); /* 1934 */ if ((actionId != null) && (actionName != null) && (!actionName.trim().equals("")) && (!actionId.trim().equals("")) && /* 1935 */ (actionmap.containsKey(actionId))) { /* 1936 */ HashMap methodArgumentsMap = (HashMap)actionmap.get(actionId); /* 1937 */ HashMap popupProps = (HashMap)methodArgumentsMap.get("POPUP-PROPS"); /* 1938 */ confirmBox = (Boolean)methodArgumentsMap.get("CONFIRMATION"); /* 1939 */ confirmmsg = (String)methodArgumentsMap.get("MESSAGE"); /* 1940 */ isJSP = (String)methodArgumentsMap.get("ISPOPUPJSP"); /* */ /* 1942 */ link = getActionParams(methodArgumentsMap, null, null, resourceId, resourceType, commonValues); /* */ /* */ /* */ /* */ /* */ /* 1948 */ if (isTableAction) { /* 1949 */ toreturn.append("<option value=" + actionId + ">" + FormatUtil.getString(actionName) + "</option>"); /* */ } /* */ else { /* 1952 */ tableName = "Link"; /* 1953 */ toreturn.append("<td align=\"right\" style=\"padding-right:10px\">"); /* 1954 */ toreturn.append("<a class=\"bodytextboldwhiteun\" style='cursor:pointer' "); /* 1955 */ toreturn.append("onClick=\"javascript:customLinks('" + actionId + "','" + resourceId + "')\">" + FormatUtil.getString(actionName)); /* 1956 */ toreturn.append("</a></td>"); /* */ } /* 1958 */ addtoreturn.append("<input type='hidden' id='" + tableName + "_" + actionId + "_isJSP' value='" + isJSP + "'/>"); /* 1959 */ addtoreturn.append("<input type='hidden' id='" + tableName + "_" + actionId + "_confirmBox' value='" + confirmBox + "'/>"); /* 1960 */ addtoreturn.append("<input type='hidden' id='" + tableName + "_" + actionId + "_confirmmsg' value='" + FormatUtil.getString(confirmmsg) + "'/>"); /* 1961 */ addtoreturn.append("<input type='hidden' id='" + tableName + "_" + actionId + "_link' value='" + link + "'/>"); /* */ } /* */ } /* */ } /* */ /* */ /* 1967 */ return toreturn.toString() + addtoreturn.toString(); /* */ } /* */ /* */ /* */ public void printMGTree(DefaultMutableTreeNode rootNode, StringBuilder builder) /* */ { /* 1973 */ for (Enumeration<DefaultMutableTreeNode> enu = rootNode.children(); enu.hasMoreElements();) /* */ { /* 1975 */ DefaultMutableTreeNode node = (DefaultMutableTreeNode)enu.nextElement(); /* 1976 */ Properties prop = (Properties)node.getUserObject(); /* 1977 */ String mgID = prop.getProperty("label"); /* 1978 */ String mgName = prop.getProperty("value"); /* 1979 */ String isParent = prop.getProperty("isParent"); /* 1980 */ int mgIDint = Integer.parseInt(mgID); /* 1981 */ if ((EnterpriseUtil.isAdminServer()) && (mgIDint > EnterpriseUtil.RANGE)) /* */ { /* 1983 */ mgName = mgName + "(" + com.adventnet.appmanager.server.framework.comm.CommDBUtil.getManagedServerNameWithPort(mgID) + ")"; /* */ } /* 1985 */ builder.append("<LI id='" + prop.getProperty("label") + "_list' ><A "); /* 1986 */ if (node.getChildCount() > 0) /* */ { /* 1988 */ if ((prop.getProperty("isParent") != null) && (prop.getProperty("isParent").equals("true"))) /* */ { /* 1990 */ builder.append("style='background-color:#f9f9f9;border-bottom: 1px solid #ECECEC;border-top:none; border-right:none; border-left:none;'"); /* */ } /* 1992 */ else if ((prop.getProperty("isParent") != null) && (prop.getProperty("isParent").equals("false"))) /* */ { /* 1994 */ builder.append(" style='padding-left:").append(node.getLevel() * 15 + "px;'"); /* */ } /* */ else /* */ { /* 1998 */ builder.append(" style='padding-left:").append(node.getLevel() * 15 + "px;'"); /* */ } /* */ /* */ /* */ } /* 2003 */ else if ((prop.getProperty("isParent") != null) && (prop.getProperty("isParent").equals("true"))) /* */ { /* 2005 */ builder.append("style='background-color:#f9f9f9;border-bottom: 1px solid #ECECEC;border-top:none; border-right:none; border-left:none;'"); /* */ } /* 2007 */ else if ((prop.getProperty("isParent") != null) && (prop.getProperty("isParent").equals("false"))) /* */ { /* 2009 */ builder.append(" style='padding-left:").append(node.getLevel() * 15 + "px;'"); /* */ } /* */ else /* */ { /* 2013 */ builder.append(" style='padding-left:").append(node.getLevel() * 15 + "px;'"); /* */ } /* */ /* 2016 */ builder.append(" onmouseout=\"changeStyle(this);\" onmouseover=\"SetSelected(this)\" onclick=\"SelectMonitorGroup('service_list_left1','" + prop.getProperty("value") + "','" + prop.getProperty("label") + "','leftimage1')\"> "); /* 2017 */ if ((prop.getProperty("isParent") != null) && (prop.getProperty("isParent").equals("true"))) /* */ { /* 2019 */ builder.append("<img src='images/icon_monitors_mg.png' alt='' style='position:relative; top:5px;'/><b>" + prop.getProperty("value") + "</b></a></li>"); /* */ } /* */ else /* */ { /* 2023 */ builder.append(prop.getProperty("value") + "</a></li>"); /* */ } /* 2025 */ if (node.getChildCount() > 0) /* */ { /* 2027 */ builder.append("<UL>"); /* 2028 */ printMGTree(node, builder); /* 2029 */ builder.append("</UL>"); /* */ } /* */ } /* */ } /* */ /* 2034 */ public String getColumnGraph(LinkedHashMap graphData, HashMap attidMap) { Iterator it = graphData.keySet().iterator(); /* 2035 */ StringBuffer toReturn = new StringBuffer(); /* 2036 */ String table = "-"; /* */ try { /* 2038 */ java.text.DecimalFormat twoDecPer = new java.text.DecimalFormat("###,###.##"); /* 2039 */ LinkedHashMap attVsWidthProps = new LinkedHashMap(); /* 2040 */ float total = 0.0F; /* 2041 */ while (it.hasNext()) { /* 2042 */ String attName = (String)it.next(); /* 2043 */ String data = (String)attidMap.get(attName.toUpperCase()); /* 2044 */ boolean roundOffData = false; /* 2045 */ if ((data != null) && (!data.equals(""))) { /* 2046 */ if (data.indexOf(",") != -1) { /* 2047 */ data = data.replaceAll(",", ""); /* */ } /* */ try { /* 2050 */ float value = Float.parseFloat(data); /* 2051 */ if (value == 0.0F) { /* */ continue; /* */ } /* 2054 */ total += value; /* 2055 */ attVsWidthProps.put(attName, value + ""); /* */ } /* */ catch (Exception e) { /* 2058 */ e.printStackTrace(); /* */ } /* */ } /* */ } /* */ /* 2063 */ Iterator attVsWidthList = attVsWidthProps.keySet().iterator(); /* 2064 */ while (attVsWidthList.hasNext()) { /* 2065 */ String attName = (String)attVsWidthList.next(); /* 2066 */ String data = (String)attVsWidthProps.get(attName); /* 2067 */ HashMap graphDetails = (HashMap)graphData.get(attName); /* 2068 */ String unit = graphDetails.get("Unit") != null ? "(" + FormatUtil.getString((String)graphDetails.get("Unit")) + ")" : ""; /* 2069 */ String toolTip = graphDetails.get("ToolTip") != null ? "title=\"" + FormatUtil.getString((String)graphDetails.get("ToolTip")) + " - " + data + unit + "\"" : ""; /* 2070 */ String className = (String)graphDetails.get("ClassName"); /* 2071 */ float percentage = Float.parseFloat(data) * 100.0F / total; /* 2072 */ if (percentage < 1.0F) /* */ { /* 2074 */ data = percentage + ""; /* */ } /* 2076 */ toReturn.append("<td class=\"" + className + "\" width=\"" + twoDecPer.format(percentage) + "%\"" + toolTip + "><img src=\"/images/spacer.gif\" height=\"10\" width=\"90%\"></td>"); /* */ } /* 2078 */ if (toReturn.length() > 0) { /* 2079 */ table = "<table align=\"center\" width =\"90%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"graphborder\"><tr>" + toReturn.toString() + "</tr></table>"; /* */ } /* */ } /* */ catch (Exception e) { /* 2083 */ e.printStackTrace(); /* */ } /* 2085 */ return table; /* */ } /* */ /* */ /* */ public String[] splitMultiConditionThreshold(String criticalcondition, String criticalThValue) /* */ { /* 2091 */ String[] splitvalues = { criticalcondition, criticalThValue }; /* 2092 */ List<String> criticalThresholdValues = com.adventnet.appmanager.util.AMRegexUtil.getThresholdGroups(criticalcondition, true); /* 2093 */ System.out.println("CRITICALTHGROPS " + criticalThresholdValues); /* 2094 */ if ((criticalThresholdValues != null) && (criticalThresholdValues.size() > 5)) { /* 2095 */ String condition1 = (String)criticalThresholdValues.get(0); /* 2096 */ String thvalue1 = (String)criticalThresholdValues.get(1); /* 2097 */ String conditionjoiner = (String)criticalThresholdValues.get(4); /* 2098 */ String condition2 = (String)criticalThresholdValues.get(5); /* 2099 */ String thvalue2 = (String)criticalThresholdValues.get(6); /* */ /* */ /* 2102 */ StringBuilder multiplecondition = new StringBuilder(condition1); /* 2103 */ multiplecondition.append(" ").append(thvalue1).append(" ").append(conditionjoiner).append(" ").append(condition2).append(" ").append(thvalue2); /* 2104 */ splitvalues[0] = multiplecondition.toString(); /* 2105 */ splitvalues[1] = ""; /* */ } /* */ /* 2108 */ return splitvalues; /* */ } /* */ /* */ public Map<String, String[]> setSelectedCondition(String condition, int thresholdType) /* */ { /* 2113 */ LinkedHashMap<String, String[]> conditionsMap = new LinkedHashMap(); /* 2114 */ if (thresholdType != 3) { /* 2115 */ conditionsMap.put("LT", new String[] { "", "<" }); /* 2116 */ conditionsMap.put("GT", new String[] { "", ">" }); /* 2117 */ conditionsMap.put("EQ", new String[] { "", "=" }); /* 2118 */ conditionsMap.put("LE", new String[] { "", "<=" }); /* 2119 */ conditionsMap.put("GE", new String[] { "", ">=" }); /* 2120 */ conditionsMap.put("NE", new String[] { "", "!=" }); /* */ } else { /* 2122 */ conditionsMap.put("CT", new String[] { "", "am.fault.conditions.string.contains" }); /* 2123 */ conditionsMap.put("DC", new String[] { "", "am.fault.conditions.string.doesnotcontain" }); /* 2124 */ conditionsMap.put("QL", new String[] { "", "am.fault.conditions.string.equalto" }); /* 2125 */ conditionsMap.put("NQ", new String[] { "", "am.fault.conditions.string.notequalto" }); /* 2126 */ conditionsMap.put("SW", new String[] { "", "am.fault.conditions.string.startswith" }); /* 2127 */ conditionsMap.put("EW", new String[] { "", "am.fault.conditions.string.endswith" }); /* */ } /* 2129 */ String[] updateSelected = (String[])conditionsMap.get(condition); /* 2130 */ if (updateSelected != null) { /* 2131 */ updateSelected[0] = "selected"; /* */ } /* 2133 */ return conditionsMap; /* */ } /* */ /* */ public String getCustomMessage(String monitorType, String commaSeparatedMsgId, String uiElement, ArrayList<String> listOfIdsToRemove) { /* */ try { /* 2138 */ StringBuffer toreturn = new StringBuffer(""); /* 2139 */ if (commaSeparatedMsgId != null) { /* 2140 */ StringTokenizer msgids = new StringTokenizer(commaSeparatedMsgId, ","); /* 2141 */ int count = 0; /* 2142 */ while (msgids.hasMoreTokens()) { /* 2143 */ String id = msgids.nextToken(); /* 2144 */ String message = ConfMonitorConfiguration.getInstance().getMessageTextForId(monitorType, id); /* 2145 */ String image = ConfMonitorConfiguration.getInstance().getMessageImageForId(monitorType, id); /* 2146 */ count++; /* 2147 */ if (!listOfIdsToRemove.contains("MESSAGE_" + id)) { /* 2148 */ if (toreturn.length() == 0) { /* 2149 */ toreturn.append("<table width=\"100%\">"); /* */ } /* 2151 */ toreturn.append("<tr><td width=\"100%\" class=\"msg-table-width\"><table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody><tr>"); /* 2152 */ if (!image.trim().equals("")) { /* 2153 */ toreturn.append("<td class=\"msg-table-width-bg\"><img width=\"18\" height=\"18\" alt=\"Icon\" src=\"" + image + "\">&nbsp;</td>"); /* */ } /* 2155 */ toreturn.append("<td class=\"msg-table-width\"><div id=\"htmlMessage\">" + message + "</div></td>"); /* 2156 */ toreturn.append("</tr></tbody></table></td></tr>"); /* */ } /* */ } /* 2159 */ if (toreturn.length() > 0) { /* 2160 */ toreturn.append("TABLE".equals(uiElement) ? "<tr><td><img src=\"../images/spacer.gif\" width=\"10\"></td></tr></table>" : "</table>"); /* */ } /* */ } /* */ /* 2164 */ return toreturn.toString(); /* */ } /* */ catch (Exception e) { /* 2167 */ e.printStackTrace(); } /* 2168 */ return ""; /* */ } /* */ /* */ /* */ /* */ /* 2174 */ private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory(); /* */ /* */ /* */ /* */ /* */ /* 2180 */ private static Map<String, Long> _jspx_dependants = new HashMap(1); /* 2181 */ static { _jspx_dependants.put("/jsp/util.jspf", Long.valueOf(1473429417000L)); } /* */ /* */ /* */ private TagHandlerPool _005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody; /* */ /* */ private TagHandlerPool _005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer; /* */ private TagHandlerPool _005fjspx_005ftagPool_005ffmt_005fmessage; /* */ private TagHandlerPool _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody; /* */ private javax.el.ExpressionFactory _el_expressionfactory; /* */ private org.apache.tomcat.InstanceManager _jsp_instancemanager; /* */ public Map<String, Long> getDependants() /* */ { /* 2193 */ return _jspx_dependants; /* */ } /* */ /* */ public void _jspInit() { /* 2197 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody = TagHandlerPool.getTagHandlerPool(getServletConfig()); /* 2198 */ this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer = TagHandlerPool.getTagHandlerPool(getServletConfig()); /* 2199 */ this._005fjspx_005ftagPool_005ffmt_005fmessage = TagHandlerPool.getTagHandlerPool(getServletConfig()); /* 2200 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody = TagHandlerPool.getTagHandlerPool(getServletConfig()); /* 2201 */ this._el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); /* 2202 */ this._jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); /* */ } /* */ /* */ public void _jspDestroy() { /* 2206 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.release(); /* 2207 */ this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.release(); /* 2208 */ this._005fjspx_005ftagPool_005ffmt_005fmessage.release(); /* 2209 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.release(); /* */ } /* */ /* */ /* */ public void _jspService(HttpServletRequest request, javax.servlet.http.HttpServletResponse response) /* */ throws IOException, javax.servlet.ServletException /* */ { /* 2216 */ HttpSession session = null; /* */ /* */ /* 2219 */ JspWriter out = null; /* 2220 */ Object page = this; /* 2221 */ JspWriter _jspx_out = null; /* 2222 */ PageContext _jspx_page_context = null; /* */ /* */ try /* */ { /* 2226 */ response.setContentType("text/html;charset=UTF-8"); /* 2227 */ PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "/jsp/ErrorPage.jsp", true, 8192, true); /* */ /* 2229 */ _jspx_page_context = pageContext; /* 2230 */ javax.servlet.ServletContext application = pageContext.getServletContext(); /* 2231 */ javax.servlet.ServletConfig config = pageContext.getServletConfig(); /* 2232 */ session = pageContext.getSession(); /* 2233 */ out = pageContext.getOut(); /* 2234 */ _jspx_out = out; /* */ /* 2236 */ out.write("<!-- $Id$-->\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); /* 2237 */ SAPGraph sapGraph = null; /* 2238 */ sapGraph = (SAPGraph)_jspx_page_context.getAttribute("sapGraph", 2); /* 2239 */ if (sapGraph == null) { /* 2240 */ sapGraph = new SAPGraph(); /* 2241 */ _jspx_page_context.setAttribute("sapGraph", sapGraph, 2); /* */ } /* 2243 */ out.write(10); /* 2244 */ out.write(10); /* 2245 */ out.write("<!--$Id$ -->\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); /* */ /* 2247 */ DefineTag _jspx_th_bean_005fdefine_005f0 = (DefineTag)this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.get(DefineTag.class); /* 2248 */ _jspx_th_bean_005fdefine_005f0.setPageContext(_jspx_page_context); /* 2249 */ _jspx_th_bean_005fdefine_005f0.setParent(null); /* */ /* 2251 */ _jspx_th_bean_005fdefine_005f0.setId("available"); /* */ /* 2253 */ _jspx_th_bean_005fdefine_005f0.setName("colors"); /* */ /* 2255 */ _jspx_th_bean_005fdefine_005f0.setProperty("AVAILABLE"); /* */ /* 2257 */ _jspx_th_bean_005fdefine_005f0.setType("java.lang.String"); /* 2258 */ int _jspx_eval_bean_005fdefine_005f0 = _jspx_th_bean_005fdefine_005f0.doStartTag(); /* 2259 */ if (_jspx_th_bean_005fdefine_005f0.doEndTag() == 5) { /* 2260 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f0); /* */ } /* */ else { /* 2263 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f0); /* 2264 */ String available = null; /* 2265 */ available = (String)_jspx_page_context.findAttribute("available"); /* 2266 */ out.write(10); /* */ /* 2268 */ DefineTag _jspx_th_bean_005fdefine_005f1 = (DefineTag)this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.get(DefineTag.class); /* 2269 */ _jspx_th_bean_005fdefine_005f1.setPageContext(_jspx_page_context); /* 2270 */ _jspx_th_bean_005fdefine_005f1.setParent(null); /* */ /* 2272 */ _jspx_th_bean_005fdefine_005f1.setId("unavailable"); /* */ /* 2274 */ _jspx_th_bean_005fdefine_005f1.setName("colors"); /* */ /* 2276 */ _jspx_th_bean_005fdefine_005f1.setProperty("UNAVAILABLE"); /* */ /* 2278 */ _jspx_th_bean_005fdefine_005f1.setType("java.lang.String"); /* 2279 */ int _jspx_eval_bean_005fdefine_005f1 = _jspx_th_bean_005fdefine_005f1.doStartTag(); /* 2280 */ if (_jspx_th_bean_005fdefine_005f1.doEndTag() == 5) { /* 2281 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f1); /* */ } /* */ else { /* 2284 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f1); /* 2285 */ String unavailable = null; /* 2286 */ unavailable = (String)_jspx_page_context.findAttribute("unavailable"); /* 2287 */ out.write(10); /* */ /* 2289 */ DefineTag _jspx_th_bean_005fdefine_005f2 = (DefineTag)this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.get(DefineTag.class); /* 2290 */ _jspx_th_bean_005fdefine_005f2.setPageContext(_jspx_page_context); /* 2291 */ _jspx_th_bean_005fdefine_005f2.setParent(null); /* */ /* 2293 */ _jspx_th_bean_005fdefine_005f2.setId("unmanaged"); /* */ /* 2295 */ _jspx_th_bean_005fdefine_005f2.setName("colors"); /* */ /* 2297 */ _jspx_th_bean_005fdefine_005f2.setProperty("UNMANAGED"); /* */ /* 2299 */ _jspx_th_bean_005fdefine_005f2.setType("java.lang.String"); /* 2300 */ int _jspx_eval_bean_005fdefine_005f2 = _jspx_th_bean_005fdefine_005f2.doStartTag(); /* 2301 */ if (_jspx_th_bean_005fdefine_005f2.doEndTag() == 5) { /* 2302 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f2); /* */ } /* */ else { /* 2305 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f2); /* 2306 */ String unmanaged = null; /* 2307 */ unmanaged = (String)_jspx_page_context.findAttribute("unmanaged"); /* 2308 */ out.write(10); /* */ /* 2310 */ DefineTag _jspx_th_bean_005fdefine_005f3 = (DefineTag)this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.get(DefineTag.class); /* 2311 */ _jspx_th_bean_005fdefine_005f3.setPageContext(_jspx_page_context); /* 2312 */ _jspx_th_bean_005fdefine_005f3.setParent(null); /* */ /* 2314 */ _jspx_th_bean_005fdefine_005f3.setId("scheduled"); /* */ /* 2316 */ _jspx_th_bean_005fdefine_005f3.setName("colors"); /* */ /* 2318 */ _jspx_th_bean_005fdefine_005f3.setProperty("SCHEDULED"); /* */ /* 2320 */ _jspx_th_bean_005fdefine_005f3.setType("java.lang.String"); /* 2321 */ int _jspx_eval_bean_005fdefine_005f3 = _jspx_th_bean_005fdefine_005f3.doStartTag(); /* 2322 */ if (_jspx_th_bean_005fdefine_005f3.doEndTag() == 5) { /* 2323 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f3); /* */ } /* */ else { /* 2326 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f3); /* 2327 */ String scheduled = null; /* 2328 */ scheduled = (String)_jspx_page_context.findAttribute("scheduled"); /* 2329 */ out.write(10); /* */ /* 2331 */ DefineTag _jspx_th_bean_005fdefine_005f4 = (DefineTag)this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.get(DefineTag.class); /* 2332 */ _jspx_th_bean_005fdefine_005f4.setPageContext(_jspx_page_context); /* 2333 */ _jspx_th_bean_005fdefine_005f4.setParent(null); /* */ /* 2335 */ _jspx_th_bean_005fdefine_005f4.setId("critical"); /* */ /* 2337 */ _jspx_th_bean_005fdefine_005f4.setName("colors"); /* */ /* 2339 */ _jspx_th_bean_005fdefine_005f4.setProperty("CRITICAL"); /* */ /* 2341 */ _jspx_th_bean_005fdefine_005f4.setType("java.lang.String"); /* 2342 */ int _jspx_eval_bean_005fdefine_005f4 = _jspx_th_bean_005fdefine_005f4.doStartTag(); /* 2343 */ if (_jspx_th_bean_005fdefine_005f4.doEndTag() == 5) { /* 2344 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f4); /* */ } /* */ else { /* 2347 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f4); /* 2348 */ String critical = null; /* 2349 */ critical = (String)_jspx_page_context.findAttribute("critical"); /* 2350 */ out.write(10); /* */ /* 2352 */ DefineTag _jspx_th_bean_005fdefine_005f5 = (DefineTag)this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.get(DefineTag.class); /* 2353 */ _jspx_th_bean_005fdefine_005f5.setPageContext(_jspx_page_context); /* 2354 */ _jspx_th_bean_005fdefine_005f5.setParent(null); /* */ /* 2356 */ _jspx_th_bean_005fdefine_005f5.setId("clear"); /* */ /* 2358 */ _jspx_th_bean_005fdefine_005f5.setName("colors"); /* */ /* 2360 */ _jspx_th_bean_005fdefine_005f5.setProperty("CLEAR"); /* */ /* 2362 */ _jspx_th_bean_005fdefine_005f5.setType("java.lang.String"); /* 2363 */ int _jspx_eval_bean_005fdefine_005f5 = _jspx_th_bean_005fdefine_005f5.doStartTag(); /* 2364 */ if (_jspx_th_bean_005fdefine_005f5.doEndTag() == 5) { /* 2365 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f5); /* */ } /* */ else { /* 2368 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f5); /* 2369 */ String clear = null; /* 2370 */ clear = (String)_jspx_page_context.findAttribute("clear"); /* 2371 */ out.write(10); /* */ /* 2373 */ DefineTag _jspx_th_bean_005fdefine_005f6 = (DefineTag)this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.get(DefineTag.class); /* 2374 */ _jspx_th_bean_005fdefine_005f6.setPageContext(_jspx_page_context); /* 2375 */ _jspx_th_bean_005fdefine_005f6.setParent(null); /* */ /* 2377 */ _jspx_th_bean_005fdefine_005f6.setId("warning"); /* */ /* 2379 */ _jspx_th_bean_005fdefine_005f6.setName("colors"); /* */ /* 2381 */ _jspx_th_bean_005fdefine_005f6.setProperty("WARNING"); /* */ /* 2383 */ _jspx_th_bean_005fdefine_005f6.setType("java.lang.String"); /* 2384 */ int _jspx_eval_bean_005fdefine_005f6 = _jspx_th_bean_005fdefine_005f6.doStartTag(); /* 2385 */ if (_jspx_th_bean_005fdefine_005f6.doEndTag() == 5) { /* 2386 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f6); /* */ } /* */ else { /* 2389 */ this._005fjspx_005ftagPool_005fbean_005fdefine_0026_005ftype_005fproperty_005fname_005fid_005fnobody.reuse(_jspx_th_bean_005fdefine_005f6); /* 2390 */ String warning = null; /* 2391 */ warning = (String)_jspx_page_context.findAttribute("warning"); /* 2392 */ out.write(10); /* 2393 */ out.write(10); /* */ /* 2395 */ String isTabletStr = (String)request.getSession().getAttribute("isTablet"); /* 2396 */ boolean isTablet = (isTabletStr != null) && (isTabletStr.trim().equals("true")); /* */ /* 2398 */ out.write(10); /* 2399 */ out.write(10); /* 2400 */ out.write(10); /* 2401 */ out.write(10); /* 2402 */ out.write(10); /* */ /* 2404 */ String resourceid = request.getParameter("resourceid"); /* 2405 */ String seven_days_text = FormatUtil.getString("am.webclient.common.sevendays.tooltip.text"); /* 2406 */ String thiry_days_text = FormatUtil.getString("am.webclient.common.thirtydays.tooltip.text"); /* 2407 */ String xaxis_time = FormatUtil.getString("am.webclient.common.axisname.time.text"); /* 2408 */ String yaxis_utilization = FormatUtil.getString("UTILIZATION"); /* 2409 */ String yaxis_enqueuerequests = FormatUtil.getString("ENQUEUEREQUESTS"); /* 2410 */ String yaxis_frontendresponsetime = FormatUtil.getString("FRONTENDRESPONSETIME"); /* 2411 */ String yaxis_loadplusgentime = FormatUtil.getString("LOADPLUSGENTIME"); /* 2412 */ String yaxis_dbrequesttime = FormatUtil.getString("DBREQUESTTIME"); /* 2413 */ String yaxis_queuetime = FormatUtil.getString("QUEUETIME"); /* 2414 */ String yaxis_esact = FormatUtil.getString("ESACT"); /* 2415 */ String yaxis_pagingrate = FormatUtil.getString("PAGINGRATE"); /* 2416 */ String yaxis_hitratio = FormatUtil.getString("HITRATIO"); /* 2417 */ String yaxis_dirused = FormatUtil.getString("DIRECTORYUSED"); /* 2418 */ String yaxis_spaceused = FormatUtil.getString("SPACEUSED"); /* */ /* 2420 */ ArrayList resIDs = (ArrayList)request.getAttribute("resIDs"); /* 2421 */ ArrayList attribIDs = new ArrayList(); /* 2422 */ for (int i = 3702; i < 3704; i++) /* */ { /* 2424 */ attribIDs.add("" + i); /* */ } /* 2426 */ for (int i = 3733; i < 3740; i++) /* */ { /* 2428 */ attribIDs.add("" + i); /* */ } /* */ /* 2431 */ Properties alert = getStatus(resIDs, attribIDs); /* */ /* 2433 */ String encodeurl = URLEncoder.encode("/showresource.do?method=showResourceForResourceID&resourceid=" + resourceid + "&datatype=4"); /* */ /* 2435 */ out.write("\n\n<br>\n\n<table width=\"98%\" class=\"lrtbdarkborder\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n <td colspan=\"2\" class=\"tableheadingbborder\" >"); /* 2436 */ out.print(FormatUtil.getString("Dialog Overview")); /* 2437 */ out.write("</td>\n</tr>\n<tr>\n<td class=\"rbborder\">\n <table width=\"98%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n \t<tr align=\"center\">\n <td>\n \t"); /* */ /* 2439 */ sapGraph.setParameter(resourceid, "dialogresponsetime"); /* */ /* 2441 */ out.write("\n "); /* */ /* 2443 */ TimeChart _jspx_th_awolf_005ftimechart_005f0 = (TimeChart)this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.get(TimeChart.class); /* 2444 */ _jspx_th_awolf_005ftimechart_005f0.setPageContext(_jspx_page_context); /* 2445 */ _jspx_th_awolf_005ftimechart_005f0.setParent(null); /* */ /* 2447 */ _jspx_th_awolf_005ftimechart_005f0.setDataSetProducer("sapGraph"); /* */ /* 2449 */ _jspx_th_awolf_005ftimechart_005f0.setWidth("350"); /* */ /* 2451 */ _jspx_th_awolf_005ftimechart_005f0.setHeight("175"); /* */ /* 2453 */ _jspx_th_awolf_005ftimechart_005f0.setLegend("false"); /* */ /* 2455 */ _jspx_th_awolf_005ftimechart_005f0.setXaxisLabel(xaxis_time); /* */ /* 2457 */ _jspx_th_awolf_005ftimechart_005f0.setYaxisLabel(yaxis_frontendresponsetime); /* 2458 */ int _jspx_eval_awolf_005ftimechart_005f0 = _jspx_th_awolf_005ftimechart_005f0.doStartTag(); /* 2459 */ if (_jspx_eval_awolf_005ftimechart_005f0 != 0) { /* 2460 */ if (_jspx_eval_awolf_005ftimechart_005f0 != 1) { /* 2461 */ out = _jspx_page_context.pushBody(); /* 2462 */ _jspx_th_awolf_005ftimechart_005f0.setBodyContent((BodyContent)out); /* 2463 */ _jspx_th_awolf_005ftimechart_005f0.doInitBody(); /* */ } /* */ for (;;) { /* 2466 */ out.write("\n "); /* 2467 */ int evalDoAfterBody = _jspx_th_awolf_005ftimechart_005f0.doAfterBody(); /* 2468 */ if (evalDoAfterBody != 2) /* */ break; /* */ } /* 2471 */ if (_jspx_eval_awolf_005ftimechart_005f0 != 1) { /* 2472 */ out = _jspx_page_context.popBody(); /* */ } /* */ } /* 2475 */ if (_jspx_th_awolf_005ftimechart_005f0.doEndTag() == 5) { /* 2476 */ this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.reuse(_jspx_th_awolf_005ftimechart_005f0); /* */ } /* */ else { /* 2479 */ this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.reuse(_jspx_th_awolf_005ftimechart_005f0); /* 2480 */ out.write("\n </td>\n\t</tr>\n\t</table>\n</td>\n<td class=\"bottomborder\">\n <table width=\"98%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n \t<tr align=\"center\">\n <td>\n \t"); /* */ /* 2482 */ sapGraph.setParameter(resourceid, "dbrequesttime"); /* */ /* 2484 */ out.write("\n "); /* */ /* 2486 */ TimeChart _jspx_th_awolf_005ftimechart_005f1 = (TimeChart)this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.get(TimeChart.class); /* 2487 */ _jspx_th_awolf_005ftimechart_005f1.setPageContext(_jspx_page_context); /* 2488 */ _jspx_th_awolf_005ftimechart_005f1.setParent(null); /* */ /* 2490 */ _jspx_th_awolf_005ftimechart_005f1.setDataSetProducer("sapGraph"); /* */ /* 2492 */ _jspx_th_awolf_005ftimechart_005f1.setWidth("350"); /* */ /* 2494 */ _jspx_th_awolf_005ftimechart_005f1.setHeight("175"); /* */ /* 2496 */ _jspx_th_awolf_005ftimechart_005f1.setLegend("false"); /* */ /* 2498 */ _jspx_th_awolf_005ftimechart_005f1.setXaxisLabel(xaxis_time); /* */ /* 2500 */ _jspx_th_awolf_005ftimechart_005f1.setYaxisLabel(yaxis_dbrequesttime); /* 2501 */ int _jspx_eval_awolf_005ftimechart_005f1 = _jspx_th_awolf_005ftimechart_005f1.doStartTag(); /* 2502 */ if (_jspx_eval_awolf_005ftimechart_005f1 != 0) { /* 2503 */ if (_jspx_eval_awolf_005ftimechart_005f1 != 1) { /* 2504 */ out = _jspx_page_context.pushBody(); /* 2505 */ _jspx_th_awolf_005ftimechart_005f1.setBodyContent((BodyContent)out); /* 2506 */ _jspx_th_awolf_005ftimechart_005f1.doInitBody(); /* */ } /* */ for (;;) { /* 2509 */ out.write("\n "); /* 2510 */ int evalDoAfterBody = _jspx_th_awolf_005ftimechart_005f1.doAfterBody(); /* 2511 */ if (evalDoAfterBody != 2) /* */ break; /* */ } /* 2514 */ if (_jspx_eval_awolf_005ftimechart_005f1 != 1) { /* 2515 */ out = _jspx_page_context.popBody(); /* */ } /* */ } /* 2518 */ if (_jspx_th_awolf_005ftimechart_005f1.doEndTag() == 5) { /* 2519 */ this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.reuse(_jspx_th_awolf_005ftimechart_005f1); /* */ } /* */ else { /* 2522 */ this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.reuse(_jspx_th_awolf_005ftimechart_005f1); /* 2523 */ out.write("\n </td>\n\t</tr>\n\t</table>\n</td>\n</tr>\n<tr>\n<td class=\"rbborder\">\n <table width=\"98%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n \t<tr align=\"center\">\n <td>\n \t"); /* */ /* 2525 */ sapGraph.setParameter(resourceid, "loadplusgentime"); /* */ /* 2527 */ out.write("\n "); /* */ /* 2529 */ TimeChart _jspx_th_awolf_005ftimechart_005f2 = (TimeChart)this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.get(TimeChart.class); /* 2530 */ _jspx_th_awolf_005ftimechart_005f2.setPageContext(_jspx_page_context); /* 2531 */ _jspx_th_awolf_005ftimechart_005f2.setParent(null); /* */ /* 2533 */ _jspx_th_awolf_005ftimechart_005f2.setDataSetProducer("sapGraph"); /* */ /* 2535 */ _jspx_th_awolf_005ftimechart_005f2.setWidth("350"); /* */ /* 2537 */ _jspx_th_awolf_005ftimechart_005f2.setHeight("175"); /* */ /* 2539 */ _jspx_th_awolf_005ftimechart_005f2.setLegend("false"); /* */ /* 2541 */ _jspx_th_awolf_005ftimechart_005f2.setXaxisLabel(xaxis_time); /* */ /* 2543 */ _jspx_th_awolf_005ftimechart_005f2.setYaxisLabel(yaxis_loadplusgentime); /* 2544 */ int _jspx_eval_awolf_005ftimechart_005f2 = _jspx_th_awolf_005ftimechart_005f2.doStartTag(); /* 2545 */ if (_jspx_eval_awolf_005ftimechart_005f2 != 0) { /* 2546 */ if (_jspx_eval_awolf_005ftimechart_005f2 != 1) { /* 2547 */ out = _jspx_page_context.pushBody(); /* 2548 */ _jspx_th_awolf_005ftimechart_005f2.setBodyContent((BodyContent)out); /* 2549 */ _jspx_th_awolf_005ftimechart_005f2.doInitBody(); /* */ } /* */ for (;;) { /* 2552 */ out.write("\n "); /* 2553 */ int evalDoAfterBody = _jspx_th_awolf_005ftimechart_005f2.doAfterBody(); /* 2554 */ if (evalDoAfterBody != 2) /* */ break; /* */ } /* 2557 */ if (_jspx_eval_awolf_005ftimechart_005f2 != 1) { /* 2558 */ out = _jspx_page_context.popBody(); /* */ } /* */ } /* 2561 */ if (_jspx_th_awolf_005ftimechart_005f2.doEndTag() == 5) { /* 2562 */ this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.reuse(_jspx_th_awolf_005ftimechart_005f2); /* */ } /* */ else { /* 2565 */ this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.reuse(_jspx_th_awolf_005ftimechart_005f2); /* 2566 */ out.write("\n </td>\n\t</tr>\n\t</table>\n</td>\n<td class=\"bottomborder\">\n <table width=\"98%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n \t<tr align=\"center\">\n <td>\n \t"); /* */ /* 2568 */ sapGraph.setParameter(resourceid, "queuetime"); /* */ /* 2570 */ out.write("\n "); /* */ /* 2572 */ TimeChart _jspx_th_awolf_005ftimechart_005f3 = (TimeChart)this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.get(TimeChart.class); /* 2573 */ _jspx_th_awolf_005ftimechart_005f3.setPageContext(_jspx_page_context); /* 2574 */ _jspx_th_awolf_005ftimechart_005f3.setParent(null); /* */ /* 2576 */ _jspx_th_awolf_005ftimechart_005f3.setDataSetProducer("sapGraph"); /* */ /* 2578 */ _jspx_th_awolf_005ftimechart_005f3.setWidth("350"); /* */ /* 2580 */ _jspx_th_awolf_005ftimechart_005f3.setHeight("175"); /* */ /* 2582 */ _jspx_th_awolf_005ftimechart_005f3.setLegend("false"); /* */ /* 2584 */ _jspx_th_awolf_005ftimechart_005f3.setXaxisLabel(xaxis_time); /* */ /* 2586 */ _jspx_th_awolf_005ftimechart_005f3.setYaxisLabel(yaxis_queuetime); /* 2587 */ int _jspx_eval_awolf_005ftimechart_005f3 = _jspx_th_awolf_005ftimechart_005f3.doStartTag(); /* 2588 */ if (_jspx_eval_awolf_005ftimechart_005f3 != 0) { /* 2589 */ if (_jspx_eval_awolf_005ftimechart_005f3 != 1) { /* 2590 */ out = _jspx_page_context.pushBody(); /* 2591 */ _jspx_th_awolf_005ftimechart_005f3.setBodyContent((BodyContent)out); /* 2592 */ _jspx_th_awolf_005ftimechart_005f3.doInitBody(); /* */ } /* */ for (;;) { /* 2595 */ out.write("\n "); /* 2596 */ int evalDoAfterBody = _jspx_th_awolf_005ftimechart_005f3.doAfterBody(); /* 2597 */ if (evalDoAfterBody != 2) /* */ break; /* */ } /* 2600 */ if (_jspx_eval_awolf_005ftimechart_005f3 != 1) { /* 2601 */ out = _jspx_page_context.popBody(); /* */ } /* */ } /* 2604 */ if (_jspx_th_awolf_005ftimechart_005f3.doEndTag() == 5) { /* 2605 */ this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.reuse(_jspx_th_awolf_005ftimechart_005f3); /* */ } /* */ else { /* 2608 */ this._005fjspx_005ftagPool_005fawolf_005ftimechart_0026_005fyaxisLabel_005fxaxisLabel_005fwidth_005flegend_005fheight_005fdataSetProducer.reuse(_jspx_th_awolf_005ftimechart_005f3); /* 2609 */ out.write("\n </td>\n\t</tr>\n\t</table>\n</td>\n</tr>\n<tr>\n<td colspan=\"2\" align=\"center\" >\n\t<table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" >\n <tr>\n\t<td height=\"35\" class=\"columnheadingb\"><span class=\"bodytextbold\">"); /* 2610 */ if (_jspx_meth_fmt_005fmessage_005f0(_jspx_page_context)) /* */ return; /* 2612 */ out.write("</span></td>\n\t<td height=\"35\" class=\"columnheadingb\"><span class=\"bodytextbold\">"); /* 2613 */ if (_jspx_meth_fmt_005fmessage_005f1(_jspx_page_context)) /* */ return; /* 2615 */ out.write("</span></td>\n\t<td height=\"35\" class=\"columnheadingb\"><span class=\"bodytextbold\">"); /* 2616 */ if (_jspx_meth_fmt_005fmessage_005f2(_jspx_page_context)) /* */ return; /* 2618 */ out.write("</span></td>\n\t<td height=\"35\" class=\"columnheadingb\"><br></td>\n\t</tr>\n\n<tr >\n<td class=\"whitegrayborder\" width=\"70%\" title=\""); /* 2619 */ out.print(FormatUtil.getString("FRONTENDRESPONSETIMEHELP")); /* 2620 */ out.write(34); /* 2621 */ out.write(62); /* 2622 */ out.write(10); /* 2623 */ out.print(FormatUtil.getString("FRONTENDRESPONSETIME")); /* 2624 */ out.write("\n</td>\n<td class=\"whitegrayborder\" align=\"right\">"); /* 2625 */ if (_jspx_meth_c_005fout_005f0(_jspx_page_context)) /* */ return; /* 2627 */ out.write("&nbsp;"); /* 2628 */ out.print(FormatUtil.getString("ms")); /* 2629 */ out.write("</td>\n<td class=\"whitegrayborder\" align=\"center\"><a href=\"javascript:void(0)\" onclick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid="); /* 2630 */ out.print(resourceid); /* 2631 */ out.write("&attributeid=3734')\">"); /* 2632 */ out.print(getSeverityImage(alert.getProperty(resourceid + "#" + "3734"))); /* 2633 */ out.write("</a></td>\n<td class=\"whitegrayborder\" align=\"center\"><a href=\"javascript:void(0)\" onClick=\"fnOpenNewWindow('/showHistoryData.do?method=getData&resourceid="); /* 2634 */ if (_jspx_meth_c_005fout_005f1(_jspx_page_context)) /* */ return; /* 2636 */ out.write("&attributeid=3734&period=-7&resourcename="); /* 2637 */ if (_jspx_meth_c_005fout_005f2(_jspx_page_context)) /* */ return; /* 2639 */ out.write("',740,550)\"><img src=\"/images/icon_7daysdata.gif\" width=\"24\" height=\"16\" hspace=\"5\" vspace=\"5\" border=\"0\" title=\""); /* 2640 */ out.print(seven_days_text); /* 2641 */ out.write("\"></a></td>\n</tr>\n\n<tr>\n<td class=\"yellowgrayborder\" width=\"70%\" title=\""); /* 2642 */ out.print(FormatUtil.getString("RESPONSETIMEHELP")); /* 2643 */ out.write(34); /* 2644 */ out.write(62); /* 2645 */ out.write(10); /* 2646 */ out.print(FormatUtil.getString("RESPONSETIME")); /* 2647 */ out.write("\n</td>\n<td class=\"yellowgrayborder\" align=\"right\">"); /* 2648 */ if (_jspx_meth_c_005fout_005f3(_jspx_page_context)) /* */ return; /* 2650 */ out.write("&nbsp;"); /* 2651 */ out.print(FormatUtil.getString("ms")); /* 2652 */ out.write("</td>\n<td class=\"yellowgrayborder\" align=\"center\"><a href=\"javascript:void(0)\" onclick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid="); /* 2653 */ out.print(resourceid); /* 2654 */ out.write("&attributeid=3736')\">"); /* 2655 */ out.print(getSeverityImage(alert.getProperty(resourceid + "#" + "3736"))); /* 2656 */ out.write("</a></td>\n<td class=\"yellowgrayborder\" align=\"center\">-</td>\n</tr>\n\n<tr >\n<td class=\"whitegrayborder\" width=\"70%\" title=\""); /* 2657 */ out.print(FormatUtil.getString("QUEUETIMEHELP")); /* 2658 */ out.write(34); /* 2659 */ out.write(62); /* 2660 */ out.write(10); /* 2661 */ out.print(FormatUtil.getString("QUEUETIME")); /* 2662 */ out.write("\n</td>\n<td class=\"whitegrayborder\" align=\"right\">"); /* 2663 */ if (_jspx_meth_c_005fout_005f4(_jspx_page_context)) /* */ return; /* 2665 */ out.write("&nbsp;"); /* 2666 */ out.print(FormatUtil.getString("ms")); /* 2667 */ out.write("</td>\n<td class=\"whitegrayborder\" align=\"center\"><a href=\"javascript:void(0)\" onclick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid="); /* 2668 */ out.print(resourceid); /* 2669 */ out.write("&attributeid=3733')\">"); /* 2670 */ out.print(getSeverityImage(alert.getProperty(resourceid + "#" + "3733"))); /* 2671 */ out.write("</a></td>\n<td class=\"whitegrayborder\" align=\"center\">-</td>\n</tr>\n\n<tr >\n<td class=\"yellowgrayborder\" width=\"70%\" title=\""); /* 2672 */ out.print(FormatUtil.getString("LOADPLUSGENTIMEHELP")); /* 2673 */ out.write(34); /* 2674 */ out.write(62); /* 2675 */ out.write(10); /* 2676 */ out.print(FormatUtil.getString("LOADPLUSGENTIME")); /* 2677 */ out.write("\n</td>\n<td class=\"yellowgrayborder\" align=\"right\">"); /* 2678 */ if (_jspx_meth_c_005fout_005f5(_jspx_page_context)) /* */ return; /* 2680 */ out.write("&nbsp;"); /* 2681 */ out.print(FormatUtil.getString("ms")); /* 2682 */ out.write("</td>\n<td class=\"yellowgrayborder\" align=\"center\"><a href=\"javascript:void(0)\" onclick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid="); /* 2683 */ out.print(resourceid); /* 2684 */ out.write("&attributeid=3737')\">"); /* 2685 */ out.print(getSeverityImage(alert.getProperty(resourceid + "#" + "3737"))); /* 2686 */ out.write("</a></td>\n<td class=\"yellowgrayborder\" align=\"center\">-</td>\n</tr>\n\n<tr >\n<td class=\"whitegrayborder\" width=\"70%\" title=\""); /* 2687 */ out.print(FormatUtil.getString("DBREQUESTTIMEHELP")); /* 2688 */ out.write(34); /* 2689 */ out.write(62); /* 2690 */ out.write(10); /* 2691 */ out.print(FormatUtil.getString("DBREQUESTTIME")); /* 2692 */ out.write("\n</td>\n<td class=\"whitegrayborder\" align=\"right\">"); /* 2693 */ if (_jspx_meth_c_005fout_005f6(_jspx_page_context)) /* */ return; /* 2695 */ out.write("&nbsp;"); /* 2696 */ out.print(FormatUtil.getString("ms")); /* 2697 */ out.write("</td>\n<td class=\"whitegrayborder\" align=\"center\"><a href=\"javascript:void(0)\" onclick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid="); /* 2698 */ out.print(resourceid); /* 2699 */ out.write("&attributeid=3739')\">"); /* 2700 */ out.print(getSeverityImage(alert.getProperty(resourceid + "#" + "3739"))); /* 2701 */ out.write("</a></td>\n<td class=\"whitegrayborder\" align=\"center\">-</td>\n</tr>\n\n<tr >\n<td class=\"yellowgrayborder\" width=\"70%\" title=\""); /* 2702 */ out.print(FormatUtil.getString("NETWORKTIMEHELP")); /* 2703 */ out.write(34); /* 2704 */ out.write(62); /* 2705 */ out.write(10); /* 2706 */ out.print(FormatUtil.getString("NETWORKTIME")); /* 2707 */ out.write("\n</td>\n<td class=\"yellowgrayborder\" align=\"right\">"); /* 2708 */ if (_jspx_meth_c_005fout_005f7(_jspx_page_context)) /* */ return; /* 2710 */ out.write("&nbsp;"); /* 2711 */ out.print(FormatUtil.getString("ms")); /* 2712 */ out.write("</td>\n<td class=\"yellowgrayborder\" align=\"center\"><a href=\"javascript:void(0)\" onclick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid="); /* 2713 */ out.print(resourceid); /* 2714 */ out.write("&attributeid=3738')\">"); /* 2715 */ out.print(getSeverityImage(alert.getProperty(resourceid + "#" + "3738"))); /* 2716 */ out.write("</a></td>\n<td class=\"yellowgrayborder\" align=\"center\">-</td>\n</tr>\n\n<tr >\n<td class=\"whitegrayborder\" width=\"70%\" title=\""); /* 2717 */ out.print(FormatUtil.getString("USERSLOGGEDINHELP")); /* 2718 */ out.write(34); /* 2719 */ out.write(62); /* 2720 */ out.write(10); /* 2721 */ out.print(FormatUtil.getString("USERSLOGGEDIN")); /* 2722 */ out.write("\n</td>\n<td class=\"whitegrayborder\" align=\"right\">"); /* 2723 */ if (_jspx_meth_c_005fout_005f8(_jspx_page_context)) /* */ return; /* 2725 */ out.write("</td>\n<td class=\"whitegrayborder\" align=\"center\"><a href=\"javascript:void(0)\" onclick=\"fnOpenNewWindow('/jsp/RCA.jsp?resourceid="); /* 2726 */ out.print(resourceid); /* 2727 */ out.write("&attributeid=3735')\">"); /* 2728 */ out.print(getSeverityImage(alert.getProperty(resourceid + "#" + "3735"))); /* 2729 */ out.write("</a></td>\n<td class=\"whitegrayborder\" align=\"center\">-</td>\n</tr>\n\n<tr>\n\t<td colspan=\"4\" align=\"right\" class=\"yellowgrayborder\"><img src=\"/images/icon_associateaction.gif\" align=\"absmiddle\" >&nbsp;<a href=\"/jsp/ThresholdActionConfiguration.jsp?resourceid="); /* 2730 */ out.print(resourceid); /* 2731 */ out.write("&attributeIDs=3734,3736,3733,3737,3739,3738,3735&attributeToSelect=3734&redirectto="); /* 2732 */ out.print(encodeurl); /* 2733 */ out.write("\" class=\"staticlinks\">"); /* 2734 */ out.print(ALERTCONFIG_TEXT); /* 2735 */ out.write("</a>&nbsp;</td>\n</tr>\n</table>\n\n</td>\n</tr>\n</table>\n\n"); /* */ } /* 2737 */ } } } } } } } } } } } catch (Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)) { /* 2738 */ out = _jspx_out; /* 2739 */ if ((out != null) && (out.getBufferSize() != 0)) /* 2740 */ try { out.clearBuffer(); } catch (IOException e) {} /* 2741 */ if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); /* */ } /* */ } finally { /* 2744 */ _jspxFactory.releasePageContext(_jspx_page_context); /* */ } /* */ } /* */ /* */ private boolean _jspx_meth_fmt_005fmessage_005f0(PageContext _jspx_page_context) throws Throwable /* */ { /* 2750 */ PageContext pageContext = _jspx_page_context; /* 2751 */ JspWriter out = _jspx_page_context.getOut(); /* */ /* 2753 */ MessageTag _jspx_th_fmt_005fmessage_005f0 = (MessageTag)this._005fjspx_005ftagPool_005ffmt_005fmessage.get(MessageTag.class); /* 2754 */ _jspx_th_fmt_005fmessage_005f0.setPageContext(_jspx_page_context); /* 2755 */ _jspx_th_fmt_005fmessage_005f0.setParent(null); /* 2756 */ int _jspx_eval_fmt_005fmessage_005f0 = _jspx_th_fmt_005fmessage_005f0.doStartTag(); /* 2757 */ if (_jspx_eval_fmt_005fmessage_005f0 != 0) { /* 2758 */ if (_jspx_eval_fmt_005fmessage_005f0 != 1) { /* 2759 */ out = _jspx_page_context.pushBody(); /* 2760 */ _jspx_th_fmt_005fmessage_005f0.setBodyContent((BodyContent)out); /* 2761 */ _jspx_th_fmt_005fmessage_005f0.doInitBody(); /* */ } /* */ for (;;) { /* 2764 */ out.write("table.heading.attribute"); /* 2765 */ int evalDoAfterBody = _jspx_th_fmt_005fmessage_005f0.doAfterBody(); /* 2766 */ if (evalDoAfterBody != 2) /* */ break; /* */ } /* 2769 */ if (_jspx_eval_fmt_005fmessage_005f0 != 1) { /* 2770 */ out = _jspx_page_context.popBody(); /* */ } /* */ } /* 2773 */ if (_jspx_th_fmt_005fmessage_005f0.doEndTag() == 5) { /* 2774 */ this._005fjspx_005ftagPool_005ffmt_005fmessage.reuse(_jspx_th_fmt_005fmessage_005f0); /* 2775 */ return true; /* */ } /* 2777 */ this._005fjspx_005ftagPool_005ffmt_005fmessage.reuse(_jspx_th_fmt_005fmessage_005f0); /* 2778 */ return false; /* */ } /* */ /* */ private boolean _jspx_meth_fmt_005fmessage_005f1(PageContext _jspx_page_context) throws Throwable /* */ { /* 2783 */ PageContext pageContext = _jspx_page_context; /* 2784 */ JspWriter out = _jspx_page_context.getOut(); /* */ /* 2786 */ MessageTag _jspx_th_fmt_005fmessage_005f1 = (MessageTag)this._005fjspx_005ftagPool_005ffmt_005fmessage.get(MessageTag.class); /* 2787 */ _jspx_th_fmt_005fmessage_005f1.setPageContext(_jspx_page_context); /* 2788 */ _jspx_th_fmt_005fmessage_005f1.setParent(null); /* 2789 */ int _jspx_eval_fmt_005fmessage_005f1 = _jspx_th_fmt_005fmessage_005f1.doStartTag(); /* 2790 */ if (_jspx_eval_fmt_005fmessage_005f1 != 0) { /* 2791 */ if (_jspx_eval_fmt_005fmessage_005f1 != 1) { /* 2792 */ out = _jspx_page_context.pushBody(); /* 2793 */ _jspx_th_fmt_005fmessage_005f1.setBodyContent((BodyContent)out); /* 2794 */ _jspx_th_fmt_005fmessage_005f1.doInitBody(); /* */ } /* */ for (;;) { /* 2797 */ out.write("table.heading.value"); /* 2798 */ int evalDoAfterBody = _jspx_th_fmt_005fmessage_005f1.doAfterBody(); /* 2799 */ if (evalDoAfterBody != 2) /* */ break; /* */ } /* 2802 */ if (_jspx_eval_fmt_005fmessage_005f1 != 1) { /* 2803 */ out = _jspx_page_context.popBody(); /* */ } /* */ } /* 2806 */ if (_jspx_th_fmt_005fmessage_005f1.doEndTag() == 5) { /* 2807 */ this._005fjspx_005ftagPool_005ffmt_005fmessage.reuse(_jspx_th_fmt_005fmessage_005f1); /* 2808 */ return true; /* */ } /* 2810 */ this._005fjspx_005ftagPool_005ffmt_005fmessage.reuse(_jspx_th_fmt_005fmessage_005f1); /* 2811 */ return false; /* */ } /* */ /* */ private boolean _jspx_meth_fmt_005fmessage_005f2(PageContext _jspx_page_context) throws Throwable /* */ { /* 2816 */ PageContext pageContext = _jspx_page_context; /* 2817 */ JspWriter out = _jspx_page_context.getOut(); /* */ /* 2819 */ MessageTag _jspx_th_fmt_005fmessage_005f2 = (MessageTag)this._005fjspx_005ftagPool_005ffmt_005fmessage.get(MessageTag.class); /* 2820 */ _jspx_th_fmt_005fmessage_005f2.setPageContext(_jspx_page_context); /* 2821 */ _jspx_th_fmt_005fmessage_005f2.setParent(null); /* 2822 */ int _jspx_eval_fmt_005fmessage_005f2 = _jspx_th_fmt_005fmessage_005f2.doStartTag(); /* 2823 */ if (_jspx_eval_fmt_005fmessage_005f2 != 0) { /* 2824 */ if (_jspx_eval_fmt_005fmessage_005f2 != 1) { /* 2825 */ out = _jspx_page_context.pushBody(); /* 2826 */ _jspx_th_fmt_005fmessage_005f2.setBodyContent((BodyContent)out); /* 2827 */ _jspx_th_fmt_005fmessage_005f2.doInitBody(); /* */ } /* */ for (;;) { /* 2830 */ out.write("table.heading.status"); /* 2831 */ int evalDoAfterBody = _jspx_th_fmt_005fmessage_005f2.doAfterBody(); /* 2832 */ if (evalDoAfterBody != 2) /* */ break; /* */ } /* 2835 */ if (_jspx_eval_fmt_005fmessage_005f2 != 1) { /* 2836 */ out = _jspx_page_context.popBody(); /* */ } /* */ } /* 2839 */ if (_jspx_th_fmt_005fmessage_005f2.doEndTag() == 5) { /* 2840 */ this._005fjspx_005ftagPool_005ffmt_005fmessage.reuse(_jspx_th_fmt_005fmessage_005f2); /* 2841 */ return true; /* */ } /* 2843 */ this._005fjspx_005ftagPool_005ffmt_005fmessage.reuse(_jspx_th_fmt_005fmessage_005f2); /* 2844 */ return false; /* */ } /* */ /* */ private boolean _jspx_meth_c_005fout_005f0(PageContext _jspx_page_context) throws Throwable /* */ { /* 2849 */ PageContext pageContext = _jspx_page_context; /* 2850 */ JspWriter out = _jspx_page_context.getOut(); /* */ /* 2852 */ OutTag _jspx_th_c_005fout_005f0 = (OutTag)this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(OutTag.class); /* 2853 */ _jspx_th_c_005fout_005f0.setPageContext(_jspx_page_context); /* 2854 */ _jspx_th_c_005fout_005f0.setParent(null); /* */ /* 2856 */ _jspx_th_c_005fout_005f0.setValue("${dialogInfo.FRONTENDRESPONSETIME}"); /* 2857 */ int _jspx_eval_c_005fout_005f0 = _jspx_th_c_005fout_005f0.doStartTag(); /* 2858 */ if (_jspx_th_c_005fout_005f0.doEndTag() == 5) { /* 2859 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f0); /* 2860 */ return true; /* */ } /* 2862 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f0); /* 2863 */ return false; /* */ } /* */ /* */ private boolean _jspx_meth_c_005fout_005f1(PageContext _jspx_page_context) throws Throwable /* */ { /* 2868 */ PageContext pageContext = _jspx_page_context; /* 2869 */ JspWriter out = _jspx_page_context.getOut(); /* */ /* 2871 */ OutTag _jspx_th_c_005fout_005f1 = (OutTag)this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(OutTag.class); /* 2872 */ _jspx_th_c_005fout_005f1.setPageContext(_jspx_page_context); /* 2873 */ _jspx_th_c_005fout_005f1.setParent(null); /* */ /* 2875 */ _jspx_th_c_005fout_005f1.setValue("${param.resourceid}"); /* 2876 */ int _jspx_eval_c_005fout_005f1 = _jspx_th_c_005fout_005f1.doStartTag(); /* 2877 */ if (_jspx_th_c_005fout_005f1.doEndTag() == 5) { /* 2878 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f1); /* 2879 */ return true; /* */ } /* 2881 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f1); /* 2882 */ return false; /* */ } /* */ /* */ private boolean _jspx_meth_c_005fout_005f2(PageContext _jspx_page_context) throws Throwable /* */ { /* 2887 */ PageContext pageContext = _jspx_page_context; /* 2888 */ JspWriter out = _jspx_page_context.getOut(); /* */ /* 2890 */ OutTag _jspx_th_c_005fout_005f2 = (OutTag)this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(OutTag.class); /* 2891 */ _jspx_th_c_005fout_005f2.setPageContext(_jspx_page_context); /* 2892 */ _jspx_th_c_005fout_005f2.setParent(null); /* */ /* 2894 */ _jspx_th_c_005fout_005f2.setValue("${param.resourcename}"); /* 2895 */ int _jspx_eval_c_005fout_005f2 = _jspx_th_c_005fout_005f2.doStartTag(); /* 2896 */ if (_jspx_th_c_005fout_005f2.doEndTag() == 5) { /* 2897 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f2); /* 2898 */ return true; /* */ } /* 2900 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f2); /* 2901 */ return false; /* */ } /* */ /* */ private boolean _jspx_meth_c_005fout_005f3(PageContext _jspx_page_context) throws Throwable /* */ { /* 2906 */ PageContext pageContext = _jspx_page_context; /* 2907 */ JspWriter out = _jspx_page_context.getOut(); /* */ /* 2909 */ OutTag _jspx_th_c_005fout_005f3 = (OutTag)this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(OutTag.class); /* 2910 */ _jspx_th_c_005fout_005f3.setPageContext(_jspx_page_context); /* 2911 */ _jspx_th_c_005fout_005f3.setParent(null); /* */ /* 2913 */ _jspx_th_c_005fout_005f3.setValue("${dialogInfo.RESPONSETIME}"); /* 2914 */ int _jspx_eval_c_005fout_005f3 = _jspx_th_c_005fout_005f3.doStartTag(); /* 2915 */ if (_jspx_th_c_005fout_005f3.doEndTag() == 5) { /* 2916 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f3); /* 2917 */ return true; /* */ } /* 2919 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f3); /* 2920 */ return false; /* */ } /* */ /* */ private boolean _jspx_meth_c_005fout_005f4(PageContext _jspx_page_context) throws Throwable /* */ { /* 2925 */ PageContext pageContext = _jspx_page_context; /* 2926 */ JspWriter out = _jspx_page_context.getOut(); /* */ /* 2928 */ OutTag _jspx_th_c_005fout_005f4 = (OutTag)this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(OutTag.class); /* 2929 */ _jspx_th_c_005fout_005f4.setPageContext(_jspx_page_context); /* 2930 */ _jspx_th_c_005fout_005f4.setParent(null); /* */ /* 2932 */ _jspx_th_c_005fout_005f4.setValue("${dialogInfo.QUEUETIME}"); /* 2933 */ int _jspx_eval_c_005fout_005f4 = _jspx_th_c_005fout_005f4.doStartTag(); /* 2934 */ if (_jspx_th_c_005fout_005f4.doEndTag() == 5) { /* 2935 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f4); /* 2936 */ return true; /* */ } /* 2938 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f4); /* 2939 */ return false; /* */ } /* */ /* */ private boolean _jspx_meth_c_005fout_005f5(PageContext _jspx_page_context) throws Throwable /* */ { /* 2944 */ PageContext pageContext = _jspx_page_context; /* 2945 */ JspWriter out = _jspx_page_context.getOut(); /* */ /* 2947 */ OutTag _jspx_th_c_005fout_005f5 = (OutTag)this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(OutTag.class); /* 2948 */ _jspx_th_c_005fout_005f5.setPageContext(_jspx_page_context); /* 2949 */ _jspx_th_c_005fout_005f5.setParent(null); /* */ /* 2951 */ _jspx_th_c_005fout_005f5.setValue("${dialogInfo.LOADPLUSGENTIME}"); /* 2952 */ int _jspx_eval_c_005fout_005f5 = _jspx_th_c_005fout_005f5.doStartTag(); /* 2953 */ if (_jspx_th_c_005fout_005f5.doEndTag() == 5) { /* 2954 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f5); /* 2955 */ return true; /* */ } /* 2957 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f5); /* 2958 */ return false; /* */ } /* */ /* */ private boolean _jspx_meth_c_005fout_005f6(PageContext _jspx_page_context) throws Throwable /* */ { /* 2963 */ PageContext pageContext = _jspx_page_context; /* 2964 */ JspWriter out = _jspx_page_context.getOut(); /* */ /* 2966 */ OutTag _jspx_th_c_005fout_005f6 = (OutTag)this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(OutTag.class); /* 2967 */ _jspx_th_c_005fout_005f6.setPageContext(_jspx_page_context); /* 2968 */ _jspx_th_c_005fout_005f6.setParent(null); /* */ /* 2970 */ _jspx_th_c_005fout_005f6.setValue("${dialogInfo.DBREQUESTTIME}"); /* 2971 */ int _jspx_eval_c_005fout_005f6 = _jspx_th_c_005fout_005f6.doStartTag(); /* 2972 */ if (_jspx_th_c_005fout_005f6.doEndTag() == 5) { /* 2973 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f6); /* 2974 */ return true; /* */ } /* 2976 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f6); /* 2977 */ return false; /* */ } /* */ /* */ private boolean _jspx_meth_c_005fout_005f7(PageContext _jspx_page_context) throws Throwable /* */ { /* 2982 */ PageContext pageContext = _jspx_page_context; /* 2983 */ JspWriter out = _jspx_page_context.getOut(); /* */ /* 2985 */ OutTag _jspx_th_c_005fout_005f7 = (OutTag)this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(OutTag.class); /* 2986 */ _jspx_th_c_005fout_005f7.setPageContext(_jspx_page_context); /* 2987 */ _jspx_th_c_005fout_005f7.setParent(null); /* */ /* 2989 */ _jspx_th_c_005fout_005f7.setValue("${dialogInfo.NETWORKTIME}"); /* 2990 */ int _jspx_eval_c_005fout_005f7 = _jspx_th_c_005fout_005f7.doStartTag(); /* 2991 */ if (_jspx_th_c_005fout_005f7.doEndTag() == 5) { /* 2992 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f7); /* 2993 */ return true; /* */ } /* 2995 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f7); /* 2996 */ return false; /* */ } /* */ /* */ private boolean _jspx_meth_c_005fout_005f8(PageContext _jspx_page_context) throws Throwable /* */ { /* 3001 */ PageContext pageContext = _jspx_page_context; /* 3002 */ JspWriter out = _jspx_page_context.getOut(); /* */ /* 3004 */ OutTag _jspx_th_c_005fout_005f8 = (OutTag)this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(OutTag.class); /* 3005 */ _jspx_th_c_005fout_005f8.setPageContext(_jspx_page_context); /* 3006 */ _jspx_th_c_005fout_005f8.setParent(null); /* */ /* 3008 */ _jspx_th_c_005fout_005f8.setValue("${dialogInfo.USERSLOGGEDIN}"); /* 3009 */ int _jspx_eval_c_005fout_005f8 = _jspx_th_c_005fout_005f8.doStartTag(); /* 3010 */ if (_jspx_th_c_005fout_005f8.doEndTag() == 5) { /* 3011 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f8); /* 3012 */ return true; /* */ } /* 3014 */ this._005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f8); /* 3015 */ return false; /* */ } /* */ } /* Location: C:\Program Files (x86)\ManageEngine\AppManager12\working\WEB-INF\lib\AdventNetAppManagerWebClient.jar!\org\apache\jsp\jsp\sap\dialog_jsp.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "qoo7972365@gmail.com" ]
qoo7972365@gmail.com
465cf363738e5c800ebb24a9da9f06a13e5b9dfa
ed9bce5f78d60629c5c7d4bcbd61b252971ec30b
/Recurrence/src/q1.java
6419a1385c5b703565de18faf31a62554f8ce3a7
[]
no_license
shajinihubert/50.001-Java-Exercises
4b24544d422bda39138e46ddecbdb18d24b2929f
ce386fb09a8a1052fdaa6e5a1e248d2e99a11ba8
refs/heads/master
2021-01-13T14:59:14.194302
2016-12-16T06:23:28
2016-12-16T06:23:28
76,627,566
0
0
null
null
null
null
UTF-8
Java
false
false
424
java
public class q1 { public static String reverse(String str) { System.out.println("input string ="+str); String result; String[] array = str.split(" "); if (array.length<2){ return result = str; } else{ return result =reverse(str.substring(str.indexOf(' ')+1)) + " "+ array[0]; } } public static void main(String[] args){ System.out.println(reverse("man are fish")); } }
[ "shajini_hubert@mymail.sutd.edu.sg" ]
shajini_hubert@mymail.sutd.edu.sg
bfffa5d08e02dd6622860e9a7fbaaf5b9acf3cdf
213242f04b60202e9bb86bbeb4d16bff62332290
/bytemall-product/src/main/java/com/iat/bytemall/product/dao/AttrAttrgroupRelationDao.java
675e8d19c2fa8172da476e4d74749023af8fb040
[]
no_license
coffeerr/bytemall
5a93740e39a0bad57fc3b6291fbbd05e75dabea7
c6b1af3d3057feccacf082359e19c1a47fe35f7e
refs/heads/main
2023-03-19T00:17:39.896627
2021-03-15T08:42:35
2021-03-15T08:42:35
347,240,649
0
0
null
null
null
null
UTF-8
Java
false
false
429
java
package com.iat.bytemall.product.dao; import com.iat.bytemall.product.entity.AttrAttrgroupRelationEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** * 属性&属性分组关联 * * @author desmand * @email chris1998@qq.com * @date 2021-03-13 10:57:19 */ @Mapper public interface AttrAttrgroupRelationDao extends BaseMapper<AttrAttrgroupRelationEntity> { }
[ "chriso1998@qq.com" ]
chriso1998@qq.com
be1a13dccb78e5d22e37c01ab34755e18d82c821
d3270d11af708cdefc2da1b896167168d6a87735
/src/com/rajiv/ThreeSum/ThreeSum.java
9bd7faead9aaa9f0c5a7e68c90c3a02619dc4ab3
[]
no_license
gyawalirajiv/leetcode-problems
e37e7468087ada7e06de7139829c8074895b140f
6d97f497010ce2a7c91a46d2b7f04d4aeb34f201
refs/heads/master
2023-03-08T22:19:17.495501
2021-02-17T08:49:11
2021-02-17T08:49:11
315,528,030
0
0
null
null
null
null
UTF-8
Java
false
false
1,289
java
package com.rajiv.ThreeSum; import java.lang.reflect.Array; import java.util.Arrays; import java.util.LinkedList; import java.util.List; public class ThreeSum { public static void main(String[] args) { System.out.println(threeSum(new int[]{-1,0,1,2,-1,-4})); } public static List<List<Integer>> threeSum(int[] nums) { Arrays.sort(nums); // [-4,-1,-1,0,1,2] List<List<Integer>> output = new LinkedList<>(); for(int i = 0; i < nums.length - 2; i++){ if(i == 0 || nums[i] != nums[i-1]){ int left = i+1; int right = nums.length - 1; int sum = -1 * nums[i]; while(left < right){ if(nums[left] + nums[right] == sum){ output.add(Arrays.asList(nums[i], nums[left], nums[right])); while(left < right && nums[left] == nums[left+1]) left++; while(left < right && nums[right] == nums[right-1]) right--; left++; right--; } else if(nums[left] + nums[right] < sum) { left++; } else right--; } } } return output; } }
[ "gyawalirajiv@gmail.com" ]
gyawalirajiv@gmail.com
96a08f2d10a72d7ef8b73a17a7eb4d3b03137bda
b2050d21ba7280e5a8853e28f87f0f0cb0dc9153
/proj0/helloWorld.java
abae69b35c3d4b18009a0e10cbf83430ad554fd3
[]
no_license
cwang81/cs61b
48527fc0573ae530edd387292927cf49f520371a
b5309affd737496324b64e1738a8009d84dfb5cf
refs/heads/master
2022-11-28T19:12:48.917199
2020-08-12T21:58:22
2020-08-12T21:58:22
275,915,670
0
0
null
null
null
null
UTF-8
Java
false
false
110
java
public class helloWorld { public static void main(String[] args){ System.out.println("HelloQiuQiu!"); } }
[ "chenghaowangbc400@gmail.com" ]
chenghaowangbc400@gmail.com
3cdccd6b91b38a2ba0c2cc3c85dca69f58c07e27
846ce9921c6830f62ea4b1c5522de26b5da512f0
/inbound-endpoints/http-inbound/components/org.wso2.carbon.gateway.inbounds.http/src/main/java/org/wso2/carbon/gateway/inbounds/http/HTTPListenerManager.java
713ebaaccfc4bdf2362412d7f1d84daa98adcebe
[]
no_license
isudana/carbon-gateway
b6162ec4a5257d7ddb3c9eadfe7132809be37feb
523ab32ad2384166de4fcc3acd6edb8d8dbfa693
refs/heads/master
2021-01-10T10:20:12.890888
2016-04-27T10:16:24
2016-04-27T10:16:24
55,281,606
1
11
null
2020-08-25T14:12:49
2016-04-02T06:40:54
Java
UTF-8
Java
false
false
5,555
java
/* * Copyright (c) 2016, WSO2 Inc. (http://wso2.com) All Rights Reserved. * <p> * WSO2 Inc. 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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.wso2.carbon.gateway.inbounds.http; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.wso2.carbon.gateway.core.inbound.InboundEPDeployer; import org.wso2.carbon.gateway.core.inbound.InboundEndpoint; import org.wso2.carbon.messaging.TransportListener; import org.wso2.carbon.messaging.TransportListenerManager; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /** * An InboundEndpoint Manager class * <p> * This acts as the Deployer for HTTP Inbound Endpoint as well as a Transport Listener Manager */ public class HTTPListenerManager implements TransportListenerManager, InboundEPDeployer { private Map<String, TransportListener> listenerMap = new ConcurrentHashMap<>(); private Map<String, InboundEndpoint> earlyInbounds = new ConcurrentHashMap<>(); private Map<String, InboundEndpoint> deployedInbounds = new ConcurrentHashMap<>(); private static final Logger logger = LoggerFactory.getLogger(HTTPListenerManager.class); private static HTTPListenerManager inboundEndpointDeployer = new HTTPListenerManager(); public static HTTPListenerManager getInstance() { return inboundEndpointDeployer; } private HTTPListenerManager() { } @Override public TransportListener getTransportListener(String s) { return null; } @Override public synchronized void registerTransportListener(String id, TransportListener transportListener) { listenerMap.put(id, transportListener); for (Map.Entry entry : earlyInbounds.entrySet()) { //TODO check relevant mapping listeners deploy((InboundEndpoint) entry.getValue()); earlyInbounds.remove(entry.getKey()); } } public synchronized void deploy(InboundEndpoint inboundEndpoint) { if (listenerMap.size() == 0) { earlyInbounds.put(inboundEndpoint.getName(), inboundEndpoint); return; } if (inboundEndpoint instanceof HTTPInboundEP) { int port = ((HTTPInboundEP) inboundEndpoint).getPort(); String host = ((HTTPInboundEP) inboundEndpoint).getHost(); String name = inboundEndpoint.getName(); TransportListener transportListener = listenerMap.get("netty-gw"); if (transportListener != null) { InboundEndpoint deployedInbound = deployedInbounds.get(name); if (deployedInbound != null) { //if already deployed and updating port or host if (!((((HTTPInboundEP) deployedInbound).getHost().equals(host)) && ((HTTPInboundEP) deployedInbound).getPort() == port)) { transportListener.stopListening(((HTTPInboundEP) deployedInbound).getHost(), ((HTTPInboundEP) deployedInbound).getPort()); deployedInbounds.remove(name); } else { // if not updating port or host no need to update transport listener deployedInbounds.put(name, inboundEndpoint); return; } } else { //reusing already open ports for (Map.Entry entry : deployedInbounds.entrySet()) { if (port == (((HTTPInboundEP) entry.getValue()).getPort()) && (((HTTPInboundEP) entry.getValue()).getHost().equals(host))) { deployedInbounds.put(name, inboundEndpoint); logger.info("Reusing already open port " + port + " in host " + host + " for " + " Inbound Endpoint " + name); return; } } } /* if (inboundEndpoint instanceof HTTPSInboundEP) { transportListener.listen(host, port, ((HTTPSInboundEP) inboundEndpoint).getParMap()); } else {*/ transportListener.listen(host, port); //} deployedInbounds.put(name, inboundEndpoint); } else { earlyInbounds.put(inboundEndpoint.getName(), inboundEndpoint); } } } public void undeploy(InboundEndpoint inboundEndpoint) { deployedInbounds.remove(inboundEndpoint.getName()); TransportListener transportListener = listenerMap.get("netty-gw"); if (inboundEndpoint instanceof HTTPInboundEP && transportListener != null) { transportListener.stopListening(((HTTPInboundEP) inboundEndpoint).getHost(), ((HTTPInboundEP) inboundEndpoint).getPort()); } } }
[ "isudana@gmail.com" ]
isudana@gmail.com
c1b0c5bf384a111f5a0126b441161beeaa283116
7f0de0563be05e1e15d395426e7fd95abb12f9b6
/src/ex10accessmodifier/sub/E01AccessModifier2.java
a3a4235a0de9c037036339aaf9e8f886bdc0cb6d
[]
no_license
psipsi1988/K01JAVA
84abc032588faebb589ee633c57bca7b4c8f93e7
5de496455941316b7fbe1986facbcd2f1bc2bccc
refs/heads/master
2021-04-20T05:05:58.319257
2020-04-10T08:52:33
2020-04-10T08:52:33
249,656,795
0
0
null
null
null
null
UTF-8
Java
false
false
643
java
package ex10accessmodifier.sub; class DefaultClass2 { void myFunc() { System.out.println("DefaultClass클래스의 myFunc()메소드 호출"); } } public class E01AccessModifier2 { private int privateVar; int defaultVar; public int publicVar; private void privateMethod(){ privateVar = 400; System.out.println("privateMethod() 메소드 호출"); } void defaultMethod() { privateVar = 500; System.out.println("defaultMethod() 메소드 호출"); } public void publicMethod() { privateVar = 600; System.out.println("publicMethod() 메소드 호출"); privateMethod(); } }
[ "psipsi1988@naver.com" ]
psipsi1988@naver.com
093772db8367540e964c01a164f76754a9748b1d
f97543ab6df9aa3d14dbe64481db0b15062ab135
/mt-demo/src/main/java/com/java/bootcamp/projects/mt/cl/CLDemo.java
e9ac70f5e69082692e29f0b347c10cda42efbfff
[ "MIT" ]
permissive
jveverka/java-boot-camp
a2d8185b29ff5837442100235593a9df8e8df28a
1ebb59b7c349a6d73a35dea7d0ef759ae39bf168
refs/heads/master
2023-07-20T12:17:32.605355
2022-01-22T09:54:12
2022-01-22T09:54:12
215,098,540
3
10
MIT
2023-07-07T21:55:12
2019-10-14T16:55:10
Java
UTF-8
Java
false
false
616
java
package com.java.bootcamp.projects.mt.cl; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; public class CLDemo { private final CountDownLatch cl; private boolean clicked; public CLDemo() { this.cl = new CountDownLatch(1); this.clicked = false; } public void click() { this.clicked = true; this.cl.countDown(); } public boolean await(long timeout, TimeUnit timeUnit) throws InterruptedException{ return this.cl.await(timeout, timeUnit); } public boolean isClicked() { return clicked; } }
[ "gergej123@gmail.com" ]
gergej123@gmail.com
aedb0d965098024447f6dd643426175c381d0a27
555635ead970fcef8626d261e2ee9ff898a3114e
/src/ru/avalon/java/dev/j10/labs/Application.java
35bfc25ca6589338192efa4dab6d2b0cf2fcecbb
[]
no_license
avalon-dev-j110/laboratornaya-rabota-no4-LAV007
fa7329acf77f01609c115784a90a29df1ca797a1
6fdeb1a6a10231e8ca2ae16499f253cab30ff3c4
refs/heads/master
2021-05-18T12:54:37.160291
2020-03-30T08:53:09
2020-03-30T08:53:09
251,250,906
0
1
null
2020-03-31T15:53:33
2020-03-30T08:53:08
Java
UTF-8
Java
false
false
3,647
java
package ru.avalon.java.dev.j10.labs; import java.util.Comparator; public class Application { public static void main(String[] args) { /* * TODO(Студент): Проинициализируйте массив strings * * Массив слелдует проинициализировать таким образом, * чтобы он содержал 20 строк, расположенных не * по порядку. */ String[] strings = null; /* * TODO(Студент): Проинициализируйте массив persons * * 1. Создайте класс, реализующий интерфейс Person. * * 2. Проинициализируйте массив persons 20 * экземплярыми созданного класса. */ Person[] persons = null; /* * TODO(Студент): Проинициализируйте переменную sort * * 1. Создайте класс, реализующий интерфейс Sort * * 2. Проинициализируйте переменную sort экземпляром * созданного класса. */ Sort sort = null; /* * TODO(Студент): Проинициализируйте переменную comparator * * 1. Создайте класс, реализующий интерфейс Comparator. * Подумайте о контексте, в котором будет * использоваться экземпляр. * * 2. Проинициализируйте переменную comparator * экземпляром созданного класса. */ Comparator comparator = null; /* * TODO(Студент): Отсортируйте массив persons по возрастанию * * 1. Если всё сделано правильно, предложенный вызов * метода sort должен отсортировать массив по * возрастанию. * * 2. С использованием отладчика убедитесь в том, * что массив отсортирован по возрастанию. */ sort.sort(persons); /* * TODO(Студент): Отсортируйте массив strings по возрастанию * * 1. Если всё сделано правильно, предложенный вызов * метода sort должен отсортировать массив по * возрастанию. * * 2. С использованием отладчика убедитесь в том, * что массив отсортирован по возрастанию. */ sort.sort(strings); /* * TODO(Студент): Отсортируйте массив strings по убыванию * * 1. Подумайте о том, какой Comparator следует * передать, чтобы массив сортировался по убыванию. * * 2. С использованием отладчика убедитесь в том, * что массив отсортирован по убыванию. */ sort.sort(strings, comparator); } }
[ "47462070+konivex@users.noreply.github.com" ]
47462070+konivex@users.noreply.github.com
4ce9c9e31f948dbd8bd567eba70f9b4c018abdbf
3972171a718bac358cce3ae5c5beb120fbedc242
/src/heap/HFPage.java
f8c7be6ac8c1abea7ef1208863d1e03640bf9031
[]
no_license
kavita6ak/minibase
36d7150da8fe672381f5a8b7cc6a60ec0e9588a6
d7ec72ab9e65afea0defb507cdbdae06a675a39a
refs/heads/master
2021-01-22T14:40:20.730523
2016-04-07T02:47:21
2016-04-07T02:47:21
54,596,955
7
6
null
2016-03-23T22:21:26
2016-03-23T22:21:26
null
UTF-8
Java
false
false
18,769
java
/* File HFPage.java */ package heap; import global.Convert; import global.GlobalConst; import global.PageId; import global.RID; import java.io.IOException; import diskmgr.Page; /** * Define constant values for INVALID_SLOT and EMPTY_SLOT */ interface ConstSlot{ int INVALID_SLOT = -1; int EMPTY_SLOT = -1; } /** Class heap file page. * The design assumes that records are kept compacted when * deletions are performed. */ public class HFPage extends Page implements ConstSlot, GlobalConst{ public static final int SIZE_OF_SLOT = 4; public static final int DPFIXED = 4 * 2 + 3 * 4; public static final int SLOT_CNT = 0; public static final int USED_PTR = 2; public static final int FREE_SPACE = 4; public static final int TYPE = 6; public static final int PREV_PAGE = 8; public static final int NEXT_PAGE = 12; public static final int CUR_PAGE = 16; /* Warning: These items must all pack tight, (no padding) for the current implementation to work properly. Be careful when modifying this class. */ /** * number of slots in use */ private short slotCnt; /** * offset of first used byte by data records in data[] */ private short usedPtr; /** * number of bytes free in data[] */ private short freeSpace; /** * an arbitrary value used by subclasses as needed */ private short type; /** * backward pointer to data page */ private PageId prevPage = new PageId(); /** * forward pointer to data page */ private PageId nextPage = new PageId(); /** * page number of this page */ protected PageId curPage = new PageId(); /** * Default constructor */ public HFPage () { } /** * Constructor of class HFPage * open a HFPage and make this HFpage piont to the given page * @param page the given page in Page type */ public HFPage(Page page) { data = page.getpage(); } /** * Constructor of class HFPage * open a existed hfpage * @param apage a page in buffer pool */ public void openHFpage(Page apage) { data = apage.getpage(); } /** * Constructor of class HFPage * initialize a new page * @param pageNo the page number of a new page to be initialized * @param apage the Page to be initialized * @see Page * @exception IOException I/O errors */ public void init(PageId pageNo, Page apage) throws IOException { data = apage.getpage(); slotCnt = 0; // no slots in use Convert.setShortValue (slotCnt, SLOT_CNT, data); curPage.pid = pageNo.pid; Convert.setIntValue (curPage.pid, CUR_PAGE, data); nextPage.pid = prevPage.pid = INVALID_PAGE; Convert.setIntValue (prevPage.pid, PREV_PAGE, data); Convert.setIntValue (nextPage.pid, NEXT_PAGE, data); usedPtr = (short) MAX_SPACE; // offset in data array (grow backwards) Convert.setShortValue (usedPtr, USED_PTR, data); freeSpace = (short) (MAX_SPACE - DPFIXED); // amount of space available Convert.setShortValue (freeSpace, FREE_SPACE, data); } /** * @return byte array */ public byte [] getHFpageArray() { return data; } /** * Dump contents of a page * @exception IOException I/O errors */ public void dumpPage() throws IOException { int i, n ; int length, offset; curPage.pid = Convert.getIntValue (CUR_PAGE, data); nextPage.pid = Convert.getIntValue (NEXT_PAGE, data); usedPtr = Convert.getShortValue (USED_PTR, data); freeSpace = Convert.getShortValue (FREE_SPACE, data); slotCnt = Convert.getShortValue (SLOT_CNT, data); System.out.println("dumpPage"); System.out.println("curPage= " + curPage.pid); System.out.println("nextPage= " + nextPage.pid); System.out.println("usedPtr= " + usedPtr); System.out.println("freeSpace= " + freeSpace); System.out.println("slotCnt= " + slotCnt); for (i= 0, n=DPFIXED; i < slotCnt; n +=SIZE_OF_SLOT, i++) { length = Convert.getShortValue (n, data); offset = Convert.getShortValue (n+2, data); System.out.println("slotNo " + i +" offset= " + offset); System.out.println("slotNo " + i +" length= " + length); } } /** * @return PageId of previous page * @exception IOException I/O errors */ public PageId getPrevPage() throws IOException { prevPage.pid = Convert.getIntValue (PREV_PAGE, data); return prevPage; } /** * sets value of prevPage to pageNo * @param pageNo page number for previous page * @exception IOException I/O errors */ public void setPrevPage(PageId pageNo) throws IOException { prevPage.pid = pageNo.pid; Convert.setIntValue (prevPage.pid, PREV_PAGE, data); } /** * @return page number of next page * @exception IOException I/O errors */ public PageId getNextPage() throws IOException { nextPage.pid = Convert.getIntValue (NEXT_PAGE, data); return nextPage; } /** * sets value of nextPage to pageNo * @param pageNo page number for next page * @exception IOException I/O errors */ public void setNextPage(PageId pageNo) throws IOException { nextPage.pid = pageNo.pid; Convert.setIntValue (nextPage.pid, NEXT_PAGE, data); } /** * @return page number of current page * @exception IOException I/O errors */ public PageId getCurPage() throws IOException { curPage.pid = Convert.getIntValue (CUR_PAGE, data); return curPage; } /** * sets value of curPage to pageNo * @param pageNo page number for current page * @exception IOException I/O errors */ public void setCurPage(PageId pageNo) throws IOException { curPage.pid = pageNo.pid; Convert.setIntValue (curPage.pid, CUR_PAGE, data); } /** * @return the ype * @exception IOException I/O errors */ public short getType() throws IOException { type = Convert.getShortValue (TYPE, data); return type; } /** * sets value of type * @param valtype an arbitrary value * @exception IOException I/O errors */ public void setType(short valtype) throws IOException { type = valtype; Convert.setShortValue (type, TYPE, data); } /** * @return slotCnt used in this page * @exception IOException I/O errors */ public short getSlotCnt() throws IOException { slotCnt = Convert.getShortValue (SLOT_CNT, data); return slotCnt; } /** * sets slot contents * @param slotno the slot number * @param length length of record the slot contains * @param offset offset of record * @exception IOException I/O errors */ public void setSlot(int slotno, int length, int offset) throws IOException { int position = DPFIXED + slotno * SIZE_OF_SLOT; Convert.setShortValue((short)length, position, data); Convert.setShortValue((short)offset, position+2, data); } /** * @param slotno slot number * @exception IOException I/O errors * @return the length of record the given slot contains */ public short getSlotLength(int slotno) throws IOException { int position = DPFIXED + slotno * SIZE_OF_SLOT; short val= Convert.getShortValue(position, data); return val; } /** * @param slotno slot number * @exception IOException I/O errors * @return the offset of record the given slot contains */ public short getSlotOffset(int slotno) throws IOException { int position = DPFIXED + slotno * SIZE_OF_SLOT; short val= Convert.getShortValue(position +2, data); return val; } /** * inserts a new record onto the page, returns RID of this record * @param record a record to be inserted * @return RID of record, null if sufficient space does not exist * @exception IOException I/O errors * in C++ Status insertRecord(char *recPtr, int recLen, RID& rid) */ public RID insertRecord ( byte [] record) throws IOException { RID rid = new RID(); int recLen = record.length; int spaceNeeded = recLen + SIZE_OF_SLOT; // Start by checking if sufficient space exists. // This is an upper bound check. May not actually need a slot // if we can find an empty one. freeSpace = Convert.getShortValue (FREE_SPACE, data); if (spaceNeeded > freeSpace) { return null; } else { // look for an empty slot slotCnt = Convert.getShortValue (SLOT_CNT, data); int i; short length; for (i= 0; i < slotCnt; i++) { length = getSlotLength(i); if (length == EMPTY_SLOT) break; } if(i == slotCnt) //use a new slot { // adjust free space freeSpace -= spaceNeeded; Convert.setShortValue (freeSpace, FREE_SPACE, data); slotCnt++; Convert.setShortValue (slotCnt, SLOT_CNT, data); } else { // reusing an existing slot freeSpace -= recLen; Convert.setShortValue (freeSpace, FREE_SPACE, data); } usedPtr = Convert.getShortValue (USED_PTR, data); usedPtr -= recLen; // adjust usedPtr Convert.setShortValue (usedPtr, USED_PTR, data); //insert the slot info onto the data page setSlot(i, recLen, usedPtr); // insert data onto the data page System.arraycopy (record, 0, data, usedPtr, recLen); curPage.pid = Convert.getIntValue (CUR_PAGE, data); rid.pageNo.pid = curPage.pid; rid.slotNo = i; return rid ; } } /** * delete the record with the specified rid * @param rid the record ID * @exception InvalidSlotNumberException Invalid slot number * @exception IOException I/O errors * in C++ Status deleteRecord(const RID& rid) */ public void deleteRecord ( RID rid ) throws IOException, InvalidSlotNumberException { int slotNo = rid.slotNo; short recLen = getSlotLength (slotNo); slotCnt = Convert.getShortValue (SLOT_CNT, data); // first check if the record being deleted is actually valid if ((slotNo >= 0) && (slotNo < slotCnt) && (recLen > 0)) { // The records always need to be compacted, as they are // not necessarily stored on the page in the order that // they are listed in the slot index. // offset of record being deleted int offset = getSlotOffset(slotNo); usedPtr = Convert.getShortValue (USED_PTR, data); int newSpot= usedPtr + recLen; int size = offset - usedPtr; // shift bytes to the right System.arraycopy(data, usedPtr, data, newSpot, size); // now need to adjust offsets of all valid slots that refer // to the left of the record being removed. (by the size of the hole) int i, n, chkoffset; for (i = 0, n = DPFIXED; i < slotCnt; n +=SIZE_OF_SLOT, i++) { if ((getSlotLength(i) >= 0)) { chkoffset = getSlotOffset(i); if(chkoffset < offset) { chkoffset += recLen; Convert.setShortValue((short)chkoffset, n+2, data); } } } // move used Ptr forwar usedPtr += recLen; Convert.setShortValue (usedPtr, USED_PTR, data); // increase freespace by size of hole freeSpace = Convert.getShortValue(FREE_SPACE, data); freeSpace += recLen; Convert.setShortValue (freeSpace, FREE_SPACE, data); setSlot(slotNo, EMPTY_SLOT, 0); // mark slot free } else { throw new InvalidSlotNumberException (null, "HEAPFILE: INVALID_SLOTNO"); } } /** * @return RID of first record on page, null if page contains no records. * @exception IOException I/O errors * in C++ Status firstRecord(RID& firstRid) * */ public RID firstRecord() throws IOException { RID rid = new RID(); // find the first non-empty slot slotCnt = Convert.getShortValue (SLOT_CNT, data); int i; short length; for (i= 0; i < slotCnt; i++) { length = getSlotLength (i); if (length != EMPTY_SLOT) break; } if(i== slotCnt) return null; // found a non-empty slot rid.slotNo = i; curPage.pid= Convert.getIntValue(CUR_PAGE, data); rid.pageNo.pid = curPage.pid; return rid; } /** * @return RID of next record on the page, null if no more * records exist on the page * @param curRid current record ID * @exception IOException I/O errors * in C++ Status nextRecord (RID curRid, RID& nextRid) */ public RID nextRecord (RID curRid) throws IOException { RID rid = new RID(); slotCnt = Convert.getShortValue (SLOT_CNT, data); int i=curRid.slotNo; short length; // find the next non-empty slot for (i++; i < slotCnt; i++) { length = getSlotLength(i); if (length != EMPTY_SLOT) break; } if(i >= slotCnt) return null; // found a non-empty slot rid.slotNo = i; curPage.pid = Convert.getIntValue(CUR_PAGE, data); rid.pageNo.pid = curPage.pid; return rid; } /** * copies out record with RID rid into record pointer. * <br> * Status getRecord(RID rid, char *recPtr, int& recLen) * @param rid the record ID * @return a tuple contains the record * @exception InvalidSlotNumberException Invalid slot number * @exception IOException I/O errors * @see Tuple */ public Tuple getRecord ( RID rid ) throws IOException, InvalidSlotNumberException { short recLen; short offset; byte []record; PageId pageNo = new PageId(); pageNo.pid= rid.pageNo.pid; curPage.pid = Convert.getIntValue (CUR_PAGE, data); int slotNo = rid.slotNo; // length of record being returned recLen = getSlotLength (slotNo); slotCnt = Convert.getShortValue (SLOT_CNT, data); if (( slotNo >=0) && (slotNo < slotCnt) && (recLen >0) && (pageNo.pid == curPage.pid)) { offset = getSlotOffset (slotNo); record = new byte[recLen]; System.arraycopy(data, offset, record, 0, recLen); Tuple tuple = new Tuple(record, 0, recLen); return tuple; } else { throw new InvalidSlotNumberException (null, "HEAPFILE: INVALID_SLOTNO"); } } /** * returns a tuple in a byte array[pageSize] with given RID rid. * <br> * in C++ Status returnRecord(RID rid, char*& recPtr, int& recLen) * @param rid the record ID * @return a tuple with its length and offset in the byte array * @exception InvalidSlotNumberException Invalid slot number * @exception IOException I/O errors * @see Tuple */ public Tuple returnRecord ( RID rid ) throws IOException, InvalidSlotNumberException { short recLen; short offset; PageId pageNo = new PageId(); pageNo.pid = rid.pageNo.pid; curPage.pid = Convert.getIntValue (CUR_PAGE, data); int slotNo = rid.slotNo; // length of record being returned recLen = getSlotLength (slotNo); slotCnt = Convert.getShortValue (SLOT_CNT, data); if (( slotNo >=0) && (slotNo < slotCnt) && (recLen >0) && (pageNo.pid == curPage.pid)) { offset = getSlotOffset (slotNo); Tuple tuple = new Tuple(data, offset, recLen); return tuple; } else { throw new InvalidSlotNumberException (null, "HEAPFILE: INVALID_SLOTNO"); } } /** * returns the amount of available space on the page. * @return the amount of available space on the page * @exception IOException I/O errors */ public int available_space() throws IOException { freeSpace = Convert.getShortValue (FREE_SPACE, data); return (freeSpace - SIZE_OF_SLOT); } /** * Determining if the page is empty * @return true if the HFPage is has no records in it, false otherwise * @exception IOException I/O errors */ public boolean empty() throws IOException { int i; short length; // look for an empty slot slotCnt = Convert.getShortValue (SLOT_CNT, data); for (i= 0; i < slotCnt; i++) { length = getSlotLength(i); if (length != EMPTY_SLOT) return false; } return true; } /** * Compacts the slot directory on an HFPage. * WARNING -- this will probably lead to a change in the RIDs of * records on the page. You CAN'T DO THIS on most kinds of pages. * @exception IOException I/O errors */ protected void compact_slot_dir() throws IOException { int current_scan_posn = 0; // current scan position int first_free_slot = -1; // An invalid position. boolean move = false; // Move a record? -- initially false short length; short offset; slotCnt = Convert.getShortValue (SLOT_CNT, data); freeSpace = Convert.getShortValue (FREE_SPACE, data); while (current_scan_posn < slotCnt) { length = getSlotLength (current_scan_posn); if ((length == EMPTY_SLOT) && (move == false)) { move = true; first_free_slot = current_scan_posn; } else if ((length != EMPTY_SLOT) && (move == true)) { offset = getSlotOffset (current_scan_posn); // slot[first_free_slot].length = slot[current_scan_posn].length; // slot[first_free_slot].offset = slot[current_scan_posn].offset; setSlot ( first_free_slot, length, offset); // Mark the current_scan_posn as empty // slot[current_scan_posn].length = EMPTY_SLOT; setSlot (current_scan_posn, EMPTY_SLOT, 0); // Now make the first_free_slot point to the next free slot. first_free_slot++; // slot[current_scan_posn].length == EMPTY_SLOT !! while (getSlotLength (first_free_slot) != EMPTY_SLOT) { first_free_slot++; } } current_scan_posn++; } if (move == true) { // Adjust amount of free space on page and slotCnt freeSpace += SIZE_OF_SLOT * (slotCnt - first_free_slot); slotCnt = (short) first_free_slot; Convert.setShortValue (freeSpace, FREE_SPACE, data); Convert.setShortValue (slotCnt, SLOT_CNT, data); } } }
[ "laxmikant.nitk@gmail.com" ]
laxmikant.nitk@gmail.com
368f4f54abb7e3bde1e1b4fd15dbaf394fab152f
239e161bfe0776ca2b5d4ab4b0d6eeaadfe3e6f8
/SoomlaAndroidStore/src/com/soomla/store/data/StoreInfo.java
681eaa8bc6342c375af7c4b879995ca0005d0907
[ "MIT" ]
permissive
jandujar/android-store
4ad4ac0d588960528e50f9a684bfc928629ff935
638f9231632c0c4611d820995f9356064b9c182b
refs/heads/master
2021-01-18T10:25:34.321915
2012-12-10T17:51:41
2012-12-10T17:51:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
13,155
java
/* * Copyright (C) 2012 Soomla Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.soomla.store.data; import android.database.Cursor; import android.text.TextUtils; import android.util.Log; import com.soomla.billing.util.AESObfuscator; import com.soomla.store.IStoreAssets; import com.soomla.store.StoreConfig; import com.soomla.store.domain.data.*; import com.soomla.store.exceptions.VirtualItemNotFoundException; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.Arrays; import java.util.LinkedList; import java.util.List; /** * This class holds the store's meta data including: * - Virtual Currencies definitions * - Virtual Currency Packs definitions * - Virtual Goods definitions * - Virtual Categories definitions */ public class StoreInfo { public static StoreInfo getInstance(){ if (sInstance == null){ sInstance = new StoreInfo(); } return sInstance; } /** * This function initializes StoreInfo. On first initialization, when the * database doesn't have any previous version of the store metadata, StoreInfo * is being loaded from the given {@link IStoreAssets}. After the first initialization, * StoreInfo will be initialized from the database. * NOTE: If you want to override the current StoreInfo, you'll have to bump the * database version (the old database will be destroyed). */ public void initialize(IStoreAssets storeAssets){ if (storeAssets == null){ Log.e(TAG, "The given store assets can't be null !"); return; } if (!initializeFromDB()){ /// fall-back here if the json doesn't exist, we load the store from the given {@link IStoreAssets}. mVirtualCategories = Arrays.asList(storeAssets.getVirtualCategories()); mVirtualCurrencies = Arrays.asList(storeAssets.getVirtualCurrencies()); mVirtualCurrencyPacks = Arrays.asList(storeAssets.getVirtualCurrencyPacks()); mVirtualGoods = Arrays.asList(storeAssets.getVirtualGoods()); mGoogleManagedItems = Arrays.asList(storeAssets.getGoogleManagedItems()); // put StoreInfo in the database as JSON String store_json = toJSONObject().toString(); if (StorageManager.getInstance().getObfuscator() != null){ store_json = StorageManager.getInstance().getObfuscator().obfuscateString(store_json); } StorageManager.getInstance().getDatabase().setStoreInfo(store_json); } } public boolean initializeFromDB() { // first, trying to load StoreInfo from the local DB. Cursor cursor = StorageManager.getInstance().getDatabase().getMetaData(); if (cursor != null) { String storejson = ""; try { int storeVal = cursor.getColumnIndexOrThrow( StoreDatabase.METADATA_COLUMN_STOREINFO); if (cursor.moveToNext()) { storejson = cursor.getString(storeVal); if (TextUtils.isEmpty(storejson)){ if (StoreConfig.debug){ Log.d(TAG, "store json is not in DB yet "); } return false; } if (StorageManager.getInstance().getObfuscator() != null){ storejson = StorageManager.getInstance().getObfuscator().unobfuscateToString(storejson); } if (StoreConfig.debug){ Log.d(TAG, "the metadata json (from DB) is " + storejson); } } } catch (AESObfuscator.ValidationException e) { e.printStackTrace(); } finally { cursor.close(); } if (!TextUtils.isEmpty(storejson)){ try { fromJSONObject(new JSONObject(storejson)); // everything went well... StoreInfo is initialized from the local DB. // it's ok to return now. return true; } catch (JSONException e) { if (StoreConfig.debug){ Log.d(TAG, "Can't parse metadata json. Going to return false and make " + "StoreInfo load from static data.: " + storejson); } } } } return false; } /** * Use this function if you need to know the definition of a specific virtual currency pack. * @param productId is the requested pack's product id. * @return the definition of the virtual pack requested. * @throws VirtualItemNotFoundException */ public VirtualCurrencyPack getPackByGoogleProductId(String productId) throws VirtualItemNotFoundException { for(VirtualCurrencyPack p : mVirtualCurrencyPacks){ if (p.getmGoogleItem().getProductId().equals(productId)){ return p; } } throw new VirtualItemNotFoundException("productId", productId); } /** * Use this function if you need to know the definition of a specific virtual currency pack. * @param itemId is the requested pack's item id. * @return the definition of the virtual pack requested. * @throws VirtualItemNotFoundException */ public VirtualCurrencyPack getPackByItemId(String itemId) throws VirtualItemNotFoundException { for(VirtualCurrencyPack p : mVirtualCurrencyPacks){ if (p.getItemId().equals(itemId)){ return p; } } throw new VirtualItemNotFoundException("itemId", itemId); } /** * Use this function if you need to know the definition of a specific virtual good. * @param itemId is the requested good's item id. * @return the definition of the virtual good requested. * @throws VirtualItemNotFoundException */ public VirtualGood getVirtualGoodByItemId(String itemId) throws VirtualItemNotFoundException { for(VirtualGood g : mVirtualGoods){ if (g.getItemId().equals(itemId)){ return g; } } throw new VirtualItemNotFoundException("itemId", itemId); } /** * Use this function if you need to know the definition of a specific virtual category. * @param id is the requested category's id. * @return the definition of the requested category. * @throws VirtualItemNotFoundException */ public VirtualCategory getVirtualCategoryById(int id) throws VirtualItemNotFoundException { for(VirtualCategory c : mVirtualCategories){ if (c.getmId() == id){ return c; } } throw new VirtualItemNotFoundException("id", "" + id); } /** * Use this function if you need to know the definition of a specific virtual currency. * @param itemId is the requested currency's item id. * @return the definition of the virtual currency requested. * @throws VirtualItemNotFoundException */ public VirtualCurrency getVirtualCurrencyByItemId(String itemId) throws VirtualItemNotFoundException { for(VirtualCurrency c : mVirtualCurrencies){ if (c.getItemId().equals(itemId)){ return c; } } throw new VirtualItemNotFoundException("itemId", itemId); } /** * Use this function if you need to know the definition of a specific google MANAGED item. * @param productId is the requested MANAGED item's product id. * @return the definition of the MANAGED item requested. * @throws VirtualItemNotFoundException */ public GoogleMarketItem getGoogleManagedItemByProductId(String productId) throws VirtualItemNotFoundException { for (GoogleMarketItem gmi : mGoogleManagedItems){ if (gmi.getProductId().equals(productId)){ return gmi; } } throw new VirtualItemNotFoundException("productId", productId); } /** Getters **/ public List<VirtualCurrency> getVirtualCurrencies(){ return mVirtualCurrencies; } public List<VirtualCurrencyPack> getCurrencyPacks() { return mVirtualCurrencyPacks; } public List<VirtualGood> getVirtualGoods() { return mVirtualGoods; } /** Private functions **/ private StoreInfo() { } private void fromJSONObject(JSONObject jsonObject) throws JSONException{ JSONArray virtualCategories = jsonObject.getJSONArray(JSONConsts.STORE_VIRTUALCATEGORIES); mVirtualCategories = new LinkedList<VirtualCategory>(); for(int i=0; i<virtualCategories.length(); i++){ JSONObject o = virtualCategories.getJSONObject(i); mVirtualCategories.add(new VirtualCategory(o)); } JSONArray virtualCurrencies = jsonObject.getJSONArray(JSONConsts.STORE_VIRTUALCURRENCIES); mVirtualCurrencies = new LinkedList<VirtualCurrency>(); for (int i=0; i<virtualCurrencies.length(); i++){ JSONObject o = virtualCurrencies.getJSONObject(i); mVirtualCurrencies.add(new VirtualCurrency(o)); } JSONArray currencyPacks = jsonObject.getJSONArray(JSONConsts.STORE_CURRENCYPACKS); mVirtualCurrencyPacks = new LinkedList<VirtualCurrencyPack>(); for (int i=0; i<currencyPacks.length(); i++){ JSONObject o = currencyPacks.getJSONObject(i); mVirtualCurrencyPacks.add(new VirtualCurrencyPack(o)); } JSONArray virtualGoods = jsonObject.getJSONArray(JSONConsts.STORE_VIRTUALGOODS); mVirtualGoods = new LinkedList<VirtualGood>(); for (int i=0; i<virtualGoods.length(); i++){ JSONObject o = virtualGoods.getJSONObject(i); mVirtualGoods.add(new VirtualGood(o)); } JSONArray googleManagedItems = jsonObject.getJSONArray(JSONConsts.STORE_GOOGLEMANAGED); mGoogleManagedItems = new LinkedList<GoogleMarketItem>(); for (int i=0; i<googleManagedItems.length(); i++){ JSONObject o = googleManagedItems.getJSONObject(i); mGoogleManagedItems.add(new GoogleMarketItem(o)); } } /** * Converts StoreInfo to a JSONObject. * @return a JSONObject representation of the StoreInfo. */ public JSONObject toJSONObject(){ JSONArray virtualCategories = new JSONArray(); for (VirtualCategory cat : mVirtualCategories){ virtualCategories.put(cat.toJSONObject()); } JSONArray virtualCurrencies = new JSONArray(); for(VirtualCurrency c : mVirtualCurrencies){ virtualCurrencies.put(c.toJSONObject()); } JSONArray currencyPacks = new JSONArray(); for(VirtualCurrencyPack pack : mVirtualCurrencyPacks){ currencyPacks.put(pack.toJSONObject()); } JSONArray virtualGoods = new JSONArray(); for(VirtualGood good : mVirtualGoods){ virtualGoods.put(good.toJSONObject()); } JSONArray googleManagedItems = new JSONArray(); for(GoogleMarketItem gmi : mGoogleManagedItems){ googleManagedItems.put(gmi.toJSONObject()); } JSONObject jsonObject = new JSONObject(); try { jsonObject.put(JSONConsts.STORE_VIRTUALCATEGORIES, virtualCategories); jsonObject.put(JSONConsts.STORE_VIRTUALCURRENCIES, virtualCurrencies); jsonObject.put(JSONConsts.STORE_VIRTUALGOODS, virtualGoods); jsonObject.put(JSONConsts.STORE_CURRENCYPACKS, currencyPacks); jsonObject.put(JSONConsts.STORE_GOOGLEMANAGED, googleManagedItems); } catch (JSONException e) { if (StoreConfig.debug){ Log.d(TAG, "An error occurred while generating JSON object."); } } return jsonObject; } /** Private members **/ private static final String TAG = "SOOMLA StoreInfo"; private static StoreInfo sInstance = null; private List<VirtualCurrency> mVirtualCurrencies; private List<VirtualCurrencyPack> mVirtualCurrencyPacks; private List<VirtualGood> mVirtualGoods; private List<VirtualCategory> mVirtualCategories; private List<GoogleMarketItem> mGoogleManagedItems; }
[ "refaeldakar@gmail.com" ]
refaeldakar@gmail.com
4428bbfc6db3863f0e757fc90f27e884f64478e3
f3e13d66e456b823a3889d6b366a38b6dfee85f8
/app/src/main/java/com/example/todo/Constants.java
07b6e00b476367bfabd4f1b017b746da3ea40112
[]
no_license
Ablay09/TodoDatabase
30da98d0921fe495e23477067672acf8ee30f70b
1026d193d9122cab989d90a98ff77103e8089dd7
refs/heads/master
2020-08-23T04:46:17.782178
2019-10-21T11:05:30
2019-10-21T11:05:30
216,546,897
0
0
null
null
null
null
UTF-8
Java
false
false
269
java
package com.example.todo; public class Constants { public static final int CREATE_TO_DO_REQUEST = 100; public static final int UPDATE_TO_DO_REQUEST = 101; public static final String TODO = "todo"; public static final String POSITION = "position"; }
[ "ablay.yedilbayev@gmail.com" ]
ablay.yedilbayev@gmail.com
1ae2b02a11bff276b10a95bea9a9c1a0a07cc263
fbefaa524e4bce30bd3f3b117d8665be8cd8390f
/imageselector/src/main/java/com/zhihu/matisse/internal/model/SelectedVideoItemCollection.java
9edad7dc7fbb887181c5bbd47abd13d6c007a523
[]
no_license
lqjymt/imgPicker
6c99b6d9993453024a616834fa0d2fe7ad84a644
28907dd1ce70743f13f76c24e02a83001741e0c3
refs/heads/master
2023-07-12T21:10:09.588463
2021-08-23T08:24:40
2021-08-23T08:24:40
399,006,932
0
0
null
null
null
null
UTF-8
Java
false
false
6,947
java
/* * Copyright 2017 Zhihu Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.zhihu.matisse.internal.model; import android.content.Context; import android.content.res.Resources; import android.net.Uri; import android.os.Bundle; import com.zhihu.matisse.R; import com.zhihu.matisse.internal.entity.IncapableCause; import com.zhihu.matisse.internal.entity.Item; import com.zhihu.matisse.internal.entity.SelectionSpec; import com.zhihu.matisse.internal.ui.widget.CheckView; import com.zhihu.matisse.internal.utils.PathUtils; import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @SuppressWarnings("unused") public class SelectedVideoItemCollection { public static final String STATE_SELECTION = "state_selection"; public static final String STATE_COLLECTION_TYPE = "state_collection_type"; /** * Empty collection */ public static final int COLLECTION_UNDEFINED = 0x00; /** * Collection only with images */ public static final int COLLECTION_IMAGE = 0x01; /** * Collection only with videos */ public static final int COLLECTION_VIDEO = 0x01 << 1; /** * Collection with images and videos. */ public static final int COLLECTION_MIXED = COLLECTION_IMAGE | COLLECTION_VIDEO; private final Context mContext; private Set<Item> mItems; private int mCollectionType = COLLECTION_UNDEFINED; public SelectedVideoItemCollection(Context context) { mContext = context; } public void onCreate(Bundle bundle) { if (bundle == null) { mItems = new LinkedHashSet<>(); } else { List<Item> saved = bundle.getParcelableArrayList(STATE_SELECTION); mItems = new LinkedHashSet<>(saved); mCollectionType = bundle.getInt(STATE_COLLECTION_TYPE, COLLECTION_UNDEFINED); } } public void setDefaultSelection(List<Item> uris) { mItems.addAll(uris); } public void onSaveInstanceState(Bundle outState) { outState.putParcelableArrayList(STATE_SELECTION, new ArrayList<>(mItems)); outState.putInt(STATE_COLLECTION_TYPE, mCollectionType); } public Bundle getDataWithBundle() { Bundle bundle = new Bundle(); bundle.putParcelableArrayList(STATE_SELECTION, new ArrayList<>(mItems)); bundle.putInt(STATE_COLLECTION_TYPE, mCollectionType); return bundle; } public boolean add(Item item) { boolean added = mItems.add(item); mCollectionType = COLLECTION_VIDEO; return added; } public boolean remove(Item item) { boolean removed = mItems.remove(item); if (removed) { if (mItems.size() == 0) { mCollectionType = COLLECTION_UNDEFINED; } else { if (mCollectionType == COLLECTION_MIXED) { refineCollectionType(); } } } return removed; } public void overwrite(ArrayList<Item> items, int collectionType) { if (items.size() == 0) { mCollectionType = COLLECTION_UNDEFINED; } else { mCollectionType = collectionType; } mItems.clear(); mItems.addAll(items); } public List<Item> asList() { return new ArrayList<>(mItems); } public List<Uri> asListOfUri() { List<Uri> uris = new ArrayList<>(); for (Item item : mItems) { uris.add(item.getContentUri()); } return uris; } public List<String> asListOfString() { List<String> paths = new ArrayList<>(); for (Item item : mItems) { paths.add(PathUtils.getPath(mContext, item.getContentUri())); } return paths; } public boolean isEmpty() { return mItems == null || mItems.isEmpty(); } public boolean isSelected(Item item) { return mItems.contains(item); } public IncapableCause isAcceptable(Item item) { if (maxSelectableReached()) { int maxSelectable = currentMaxSelectable(); String cause; try { cause = mContext.getResources().getString( R.string.error_over_count, maxSelectable ); } catch (Resources.NotFoundException e) { cause = mContext.getString( R.string.error_over_count, maxSelectable ); } catch (NoClassDefFoundError e) { cause = mContext.getString( R.string.error_over_count, maxSelectable ); } return new IncapableCause(cause); } return null; } public boolean maxSelectableReached() { return mItems.size() == currentMaxSelectable(); } // depends private int currentMaxSelectable() { return 1; } public int getCollectionType() { return mCollectionType; } private void refineCollectionType() { boolean hasImage = false; boolean hasVideo = false; for (Item i : mItems) { if (i.isImage() && !hasImage) hasImage = true; if (i.isVideo() && !hasVideo) hasVideo = true; } if (hasImage && hasVideo) { mCollectionType = COLLECTION_MIXED; } else if (hasImage) { mCollectionType = COLLECTION_IMAGE; } else if (hasVideo) { mCollectionType = COLLECTION_VIDEO; } } /** * Determine whether there will be conflict media types. A user can only select images and videos at the same time * while {@link SelectionSpec#mediaTypeExclusive} is set to false. */ public boolean typeConflict(Item item) { return SelectionSpec.getInstance().mediaTypeExclusive && ((item.isImage() && (mCollectionType == COLLECTION_VIDEO || mCollectionType == COLLECTION_MIXED)) || (item.isVideo() && (mCollectionType == COLLECTION_IMAGE || mCollectionType == COLLECTION_MIXED))); } public int count() { return mItems.size(); } public int checkedNumOf(Item item) { int index = new ArrayList<>(mItems).indexOf(item); return index == -1 ? CheckView.UNCHECKED : index + 1; } }
[ "18273213055@163.com" ]
18273213055@163.com
44a3de6e8ad60b7eccd7995f662cc9adf3729717
a361796d8622df104f1574f9d23405057f695892
/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/metatype/tests/BugTests.java
ea51857659039d666b91dcbdb80954b909d6bb3e
[]
no_license
istvansajtos/rt.equinox.bundles
21bd0eaa72275c0d9a166c1af5dc333dc5ae5a6b
9a629bedb55831fd7099eda0057ad887ac53f2fe
refs/heads/master
2020-12-03T07:52:15.532255
2016-02-29T14:27:06
2016-02-29T14:27:06
53,125,957
0
0
null
2016-03-04T10:01:25
2016-03-04T10:01:25
null
UTF-8
Java
false
false
4,430
java
/******************************************************************************* * Copyright (c) 2011 IBM Corporation and others * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.equinox.metatype.tests; import org.osgi.framework.Bundle; import org.osgi.service.metatype.*; public class BugTests extends AbstractTest { private Bundle bundle; /* * A cardinality of zero should not require a default value to be specified. */ public void test334642() { MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle); assertNotNull("Metatype information not found", mti); //$NON-NLS-1$ ObjectClassDefinition ocd = mti.getObjectClassDefinition("org.eclipse.equinox.metatype.tests.tb3", null); //$NON-NLS-1$ assertNotNull("Object class definition not found", ocd); //$NON-NLS-1$ AttributeDefinition[] ads = ocd.getAttributeDefinitions(ObjectClassDefinition.ALL); assertNotNull("Attribute definitions not found", ads); //$NON-NLS-1$ assertEquals("Wrong number of attribute definitions", 3, ads.length); //$NON-NLS-1$ AttributeDefinition ad = findAttributeDefinitionById("password1", ads); //$NON-NLS-1$ assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$ assertEquals("Wrong cardinality", 0, ad.getCardinality()); //$NON-NLS-1$ assertNull("Default value should be null", ad.getDefaultValue()); //$NON-NLS-1$ assertNotNull("Validation should be present", ad.validate(getFirstDefaultValue(ad.getDefaultValue()))); //$NON-NLS-1$ assertTrue("Validation should fail", ad.validate(getFirstDefaultValue(ad.getDefaultValue())).length() > 0); //$NON-NLS-1$ ad = findAttributeDefinitionById("password2", ads); //$NON-NLS-1$ assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$ assertEquals("Wrong cardinality", 0, ad.getCardinality()); //$NON-NLS-1$ assertNull("Default value should be null", ad.getDefaultValue()); //$NON-NLS-1$ assertNotNull("Validation should be present", ad.validate(getFirstDefaultValue(ad.getDefaultValue()))); //$NON-NLS-1$ assertTrue("Validation should fail", ad.validate(getFirstDefaultValue(ad.getDefaultValue())).length() > 0); //$NON-NLS-1$ ad = findAttributeDefinitionById("string1", ads); //$NON-NLS-1$ assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$ assertEquals("Wrong cardinality", 0, ad.getCardinality()); //$NON-NLS-1$ assertEquals("Only one default value should exist", 1, ad.getDefaultValue().length); //$NON-NLS-1$ assertEquals("Wrong default value", "Hello, world!", getFirstDefaultValue(ad.getDefaultValue())); //$NON-NLS-1$ //$NON-NLS-2$ assertValidationPass(escape(getFirstDefaultValue(ad.getDefaultValue())), ad); } /* * StringIndexOutOfBoundsException when description or name attributes are an empty string */ public void test341963() { MetaTypeInformation mti = metatype.getMetaTypeInformation(bundle); assertNotNull("Metatype information not found", mti); //$NON-NLS-1$ ObjectClassDefinition ocd = mti.getObjectClassDefinition("ocd2", null); //$NON-NLS-1$ assertNotNull("Object class definition not found", ocd); //$NON-NLS-1$ assertEquals("Wrong name", "", ocd.getName()); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Wrong description", "", ocd.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$ AttributeDefinition[] ads = ocd.getAttributeDefinitions(ObjectClassDefinition.ALL); assertNotNull("Attribute definitions not found", ads); //$NON-NLS-1$ assertEquals("Wrong number of attribute definitions", 1, ads.length); //$NON-NLS-1$ AttributeDefinition ad = findAttributeDefinitionById("ad1", ads); //$NON-NLS-1$ assertNotNull("Attribute definition not found", ad); //$NON-NLS-1$ assertEquals("Wrong name", "", ad.getName()); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Wrong description", "", ad.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$ } protected void setUp() throws Exception { super.setUp(); bundle = bundleInstaller.installBundle("tb3"); //$NON-NLS-1$ bundle.start(); } protected void tearDown() throws Exception { bundle.stop(); super.tearDown(); } }
[ "twatson" ]
twatson
042b96578f81b8e7031046f5f067b18d86186199
dee666205ccfc682727abbad419d09ce924b080d
/Verify/src/com/px/util/Controller.java
62ddb75925c8c5c4db229edb560ed5ed08a0365b
[]
no_license
BardonX/GenerateVerificationCode
7d5346ff8c4ffac3360cadca4303e52c4f996c66
57a8e7e3d187f8841e1fc2f205ca874044a15a84
refs/heads/master
2021-01-20T14:55:38.478121
2017-05-09T02:31:57
2017-05-09T02:31:57
90,692,757
1
0
null
null
null
null
GB18030
Java
false
false
914
java
package com.px.util; import java.io.IOException; import javax.enterprise.inject.New; import javax.jms.Session; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; public class Controller extends HttpServlet { private static final long serialVersionUID = 1L; @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.setCharacterEncoding("utf-8"); resp.setCharacterEncoding("utf-8"); String code=req.getParameter("code"); HttpSession session=req.getSession(); String sessionString=session.getAttribute("vailcode").toString(); if(code.equals(sessionString)){ resp.getWriter().print("验证成功"); }else{ resp.getWriter().print("验证失败"); } } }
[ "panxuan45@gmail.com" ]
panxuan45@gmail.com
9f2aaa9a463f1ea948db63c58b87eebaa96b01f0
69824fef1d11ee59c47a193075d7402cee410f5d
/jOOQ-test/src/test/java/org/jooq/test/firebird/generatedclasses/tables/records/TExoticTypesRecord.java
eac618f377f4a8f4d7723c5eacd3608d1805a31e
[ "Apache-2.0" ]
permissive
gquintana/jOOQ
5db0590dfbabecc702f61afe6f63cca206472261
4a5105d4054606fb021808169394a118113422b4
refs/heads/master
2020-12-06T23:27:19.420528
2014-08-26T11:33:22
2014-08-26T11:33:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,347
java
/** * This class is generated by jOOQ */ package org.jooq.test.firebird.generatedclasses.tables.records; /** * This class is generated by jOOQ. */ @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) @javax.persistence.Entity @javax.persistence.Table(name = "T_EXOTIC_TYPES") public class TExoticTypesRecord extends org.jooq.impl.UpdatableRecordImpl<org.jooq.test.firebird.generatedclasses.tables.records.TExoticTypesRecord> implements org.jooq.Record2<java.lang.Integer, java.util.UUID>, org.jooq.test.firebird.generatedclasses.tables.interfaces.ITExoticTypes { private static final long serialVersionUID = 870199176; /** * Setter for <code>T_EXOTIC_TYPES.ID</code>. */ @Override public void setId(java.lang.Integer value) { setValue(0, value); } /** * Getter for <code>T_EXOTIC_TYPES.ID</code>. */ @javax.persistence.Id @javax.persistence.Column(name = "ID", unique = true, nullable = false) @javax.validation.constraints.NotNull @Override public java.lang.Integer getId() { return (java.lang.Integer) getValue(0); } /** * Setter for <code>T_EXOTIC_TYPES.UU</code>. */ @Override public void setUu(java.util.UUID value) { setValue(1, value); } /** * Getter for <code>T_EXOTIC_TYPES.UU</code>. */ @javax.persistence.Column(name = "UU", length = 36) @Override public java.util.UUID getUu() { return (java.util.UUID) getValue(1); } // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- /** * {@inheritDoc} */ @Override public org.jooq.Record1<java.lang.Integer> key() { return (org.jooq.Record1) super.key(); } // ------------------------------------------------------------------------- // Record2 type implementation // ------------------------------------------------------------------------- /** * {@inheritDoc} */ @Override public org.jooq.Row2<java.lang.Integer, java.util.UUID> fieldsRow() { return (org.jooq.Row2) super.fieldsRow(); } /** * {@inheritDoc} */ @Override public org.jooq.Row2<java.lang.Integer, java.util.UUID> valuesRow() { return (org.jooq.Row2) super.valuesRow(); } /** * {@inheritDoc} */ @Override public org.jooq.Field<java.lang.Integer> field1() { return org.jooq.test.firebird.generatedclasses.tables.TExoticTypes.T_EXOTIC_TYPES.ID; } /** * {@inheritDoc} */ @Override public org.jooq.Field<java.util.UUID> field2() { return org.jooq.test.firebird.generatedclasses.tables.TExoticTypes.T_EXOTIC_TYPES.UU; } /** * {@inheritDoc} */ @Override public java.lang.Integer value1() { return getId(); } /** * {@inheritDoc} */ @Override public java.util.UUID value2() { return getUu(); } /** * {@inheritDoc} */ @Override public TExoticTypesRecord value1(java.lang.Integer value) { setId(value); return this; } /** * {@inheritDoc} */ @Override public TExoticTypesRecord value2(java.util.UUID value) { setUu(value); return this; } /** * {@inheritDoc} */ @Override public TExoticTypesRecord values(java.lang.Integer value1, java.util.UUID value2) { return this; } // ------------------------------------------------------------------------- // FROM and INTO // ------------------------------------------------------------------------- /** * {@inheritDoc} */ @Override public void from(org.jooq.test.firebird.generatedclasses.tables.interfaces.ITExoticTypes from) { setId(from.getId()); setUu(from.getUu()); } /** * {@inheritDoc} */ @Override public <E extends org.jooq.test.firebird.generatedclasses.tables.interfaces.ITExoticTypes> E into(E into) { into.from(this); return into; } // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- /** * Create a detached TExoticTypesRecord */ public TExoticTypesRecord() { super(org.jooq.test.firebird.generatedclasses.tables.TExoticTypes.T_EXOTIC_TYPES); } /** * Create a detached, initialised TExoticTypesRecord */ public TExoticTypesRecord(java.lang.Integer id, java.util.UUID uu) { super(org.jooq.test.firebird.generatedclasses.tables.TExoticTypes.T_EXOTIC_TYPES); setValue(0, id); setValue(1, uu); } }
[ "lukas.eder@gmail.com" ]
lukas.eder@gmail.com
dd42addfc37be9b178e8f0873c32e967c8bcf50a
36fc3ed0c1fbc53298a25328d880a55b10d3a5b4
/BMDKMobileExample/gen/com/actuate/developer/bmdkmobile/BuildConfig.java
91cb5465469dee38a93ebf80f56b79a0b8361dbf
[]
no_license
czl349095941/birt-mobile-framework-android
21e77d775e119f4ae6322e30f4af6df13b69d720
3ad3419b38bbd140ac906dada18053d1f36dd0cb
refs/heads/master
2021-01-21T09:38:42.323142
2014-09-09T18:24:57
2014-09-09T18:24:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
174
java
/** Automatically generated file. DO NOT MODIFY */ package com.actuate.developer.bmdkmobile; public final class BuildConfig { public final static boolean DEBUG = true; }
[ "kclark@actuate.com" ]
kclark@actuate.com
5a5ea9a3b669b17a47200c54c80855253f419233
449f62ce61f637e568b393fcde769cf00e5cf9c4
/selendroid-server/src/main/java/org/openqa/selendroid/server/handler/NewSession.java
2e5db068c7280925cba35e1a978b9dba240ba1df
[ "Apache-2.0" ]
permissive
innamuri/selendroid
55009e9178db65f45381da39a098b84207415d6a
c7125a0fb6e1f73b37faf0b9cd741f3832f730b2
refs/heads/master
2021-01-18T06:11:10.183445
2013-02-25T09:02:31
2013-02-25T09:02:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,667
java
/* * Copyright 2012 selendroid committers. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package org.openqa.selendroid.server.handler; import org.openqa.selendroid.server.RequestHandler; import org.openqa.selendroid.server.Response; import org.openqa.selendroid.server.exceptions.SelendroidException; import org.openqa.selendroid.util.SelendroidLogger; import org.webbitserver.HttpRequest; import com.google.gson.JsonObject; public class NewSession extends RequestHandler { public NewSession(HttpRequest request) { super(request); } @Override public Response handle() { SelendroidLogger.log("new session command"); JsonObject payload = getPayload(); JsonObject desiredCapabilities = payload.getAsJsonObject("desiredCapabilities"); desiredCapabilities.addProperty("version", "0.1"); String sessionID = null; try { sessionID = getAndroidDriver().initializeSession(desiredCapabilities); } catch (SelendroidException e) { SelendroidLogger.logError("Error while creating new session: ", e); return new Response(null, 33, e); } return new Response(sessionID, 0, desiredCapabilities); } }
[ "ddary@acm.org" ]
ddary@acm.org
ff779ad6f34c9528b7bef27ad1f19098ae28ada4
ce085e7c714d5567adb425b73ac41f04385cad31
/org/spongepowered/tools/obfuscation/service/ObfuscationServices.java
a0724803ef3c27147bb09f461401feb5a46ceb66
[ "Apache-2.0" ]
permissive
yunusborazan/ninehack
d2dcad0549f7fdea1e4a1f634147be20ebae8ff2
d40415b9ff5d1e8d4c325d98e1213bbcff0cf218
refs/heads/main
2023-08-16T17:24:34.012936
2021-09-18T03:17:47
2021-09-18T03:17:47
407,855,541
1
0
Apache-2.0
2021-09-18T12:33:42
2021-09-18T12:33:41
null
UTF-8
Java
false
false
4,260
java
/* */ package org.spongepowered.tools.obfuscation.service; /* */ /* */ import java.util.Collection; /* */ import java.util.HashSet; /* */ import java.util.ServiceConfigurationError; /* */ import java.util.ServiceLoader; /* */ import java.util.Set; /* */ import javax.tools.Diagnostic; /* */ import org.spongepowered.tools.obfuscation.ObfuscationType; /* */ import org.spongepowered.tools.obfuscation.interfaces.IMixinAnnotationProcessor; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public final class ObfuscationServices /* */ { /* */ private static ObfuscationServices instance; /* */ private final ServiceLoader<IObfuscationService> serviceLoader; /* 56 */ private final Set<IObfuscationService> services = new HashSet<IObfuscationService>(); /* */ /* */ /* */ /* */ /* */ private ObfuscationServices() { /* 62 */ this.serviceLoader = ServiceLoader.load(IObfuscationService.class, getClass().getClassLoader()); /* */ } /* */ /* */ /* */ /* */ /* */ public static ObfuscationServices getInstance() { /* 69 */ if (instance == null) { /* 70 */ instance = new ObfuscationServices(); /* */ } /* 72 */ return instance; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void initProviders(IMixinAnnotationProcessor ap) { /* */ try { /* 82 */ for (IObfuscationService service : this.serviceLoader) { /* 83 */ if (!this.services.contains(service)) { /* 84 */ this.services.add(service); /* */ /* 86 */ String serviceName = service.getClass().getSimpleName(); /* */ /* 88 */ Collection<ObfuscationTypeDescriptor> obfTypes = service.getObfuscationTypes(); /* 89 */ if (obfTypes != null) { /* 90 */ for (ObfuscationTypeDescriptor obfType : obfTypes) { /* */ try { /* 92 */ ObfuscationType type = ObfuscationType.create(obfType, ap); /* 93 */ ap.printMessage(Diagnostic.Kind.NOTE, serviceName + " supports type: \"" + type + "\""); /* 94 */ } catch (Exception ex) { /* 95 */ ex.printStackTrace(); /* */ } /* */ } /* */ } /* */ } /* */ } /* 101 */ } catch (ServiceConfigurationError serviceError) { /* 102 */ ap.printMessage(Diagnostic.Kind.ERROR, serviceError.getClass().getSimpleName() + ": " + serviceError.getMessage()); /* 103 */ serviceError.printStackTrace(); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ public Set<String> getSupportedOptions() { /* 111 */ Set<String> supportedOptions = new HashSet<String>(); /* 112 */ for (IObfuscationService provider : this.serviceLoader) { /* 113 */ Set<String> options = provider.getSupportedOptions(); /* 114 */ if (options != null) { /* 115 */ supportedOptions.addAll(options); /* */ } /* */ } /* 118 */ return supportedOptions; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public IObfuscationService getService(Class<? extends IObfuscationService> serviceClass) { /* 128 */ for (IObfuscationService service : this.serviceLoader) { /* 129 */ if (serviceClass.getName().equals(service.getClass().getName())) { /* 130 */ return service; /* */ } /* */ } /* 133 */ return null; /* */ } /* */ } /* Location: C:\Users\tarka\Downloads\ninehack-1.0.1-release.jar!\org\spongepowered\tools\obfuscation\service\ObfuscationServices.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
[ "66845682+christallinqq@users.noreply.github.com" ]
66845682+christallinqq@users.noreply.github.com
5b279b804b9cf5f33f1f95832b92a84395515373
bd46e0a53ff71933112f10fda4c8af680ec65fbc
/src/main/java/expression_tree/PlatformFactory.java
b237b04dc9c0560880f80ce7f6f6cdb4e7ab6f2e
[]
no_license
zghib/experiment
8e98eee72e149d0cc010f6c54affa10be0795fc7
ee6518146b9419f3d7154422d3a333d7ba6fbbad
refs/heads/master
2021-01-10T01:41:41.654341
2016-03-03T13:04:42
2016-03-03T14:09:54
52,965,937
0
0
null
null
null
null
UTF-8
Java
false
false
2,190
java
package expression_tree; import java.util.HashMap; public class PlatformFactory { /** * This interface uses the Command pattern to create @a Platform * implementations at runtime. */ private static interface IPlatformFactoryCommand { public Platform execute(); } /** * HashMap used to map strings containing the Java platform names * and dispatch the execute() method of the associated @a Platform * implementation. */ private HashMap<String, IPlatformFactoryCommand> platformMap = new HashMap<String, IPlatformFactoryCommand>(); /** * Ctor that stores the objects that perform input and output for * a particular platform, such as CommandLinePlatform or the * AndroidPlatform. */ public PlatformFactory(final Object input, final Object output) { /** * The "Sun Microsystems Inc." string maps to a command object * that creates an @a CommandLinePlatform implementation. */ platformMap.put("Sun Microsystems Inc.", new IPlatformFactoryCommand() { public Platform execute() { return new CommandLinePlatform(input, output); } }); /** * The "Oracle Corporation" string maps to a command object * that creates an @a CommandLinePlatform implementation. */ platformMap.put("Oracle Corporation", new IPlatformFactoryCommand() { public Platform execute() { return new CommandLinePlatform(input, output); } }); } /** * Create a new @a Platform object based on underlying Java * platform. */ public Platform makePlatform() { String name = System.getProperty("java.specification.vendor"); return platformMap.get(name).execute(); } }
[ "ion.zghibarta@schneider-electric.com" ]
ion.zghibarta@schneider-electric.com
15c5a4f3f6154b42c81f6cfac69bff3400d710ca
9a7b38bee424b79233ad207bf8e49970466e47eb
/LvShuAdmin/src/main/java/com/lvshu/service/ManualService.java
005d37f3ebf95e1bb171f47942d4bec14ae79c62
[]
no_license
kongshaoyang/LvshuAdmin
2d39e027c5260026545315c7e3ca4b58b7c6ad1b
6e7c9834005cec4f9cfd76a51dc36ae67c1247f2
refs/heads/master
2020-12-02T07:57:54.138416
2017-07-11T07:12:09
2017-07-11T07:12:09
96,753,474
0
0
null
null
null
null
UTF-8
Java
false
false
2,327
java
package com.lvshu.service; import com.lvshu.common.DateEx; import com.lvshu.common.TableID; import com.lvshu.mapper.ManualMapper; import com.lvshu.model.Manual; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * Created by 田原 on 2016/12/22. */ @Service public class ManualService { @Autowired private ManualMapper manualMapper; public List<Manual> getManualList(String userNum) throws Exception { List<Manual> list = null; try { list = manualMapper.getManualList(userNum); } catch (Exception e) { throw e; } return list; } public Manual getManualByManualNum(String manualNum) throws Exception { Manual manual = null; try { manual = manualMapper.getManualByManualNum(manualNum); } catch (Exception e) { throw e; } return manual; } public List<Manual> searchManualByManualName(String manualName) throws Exception { List<Manual> list = null; try { list = manualMapper.searchManualByManualName(manualName); } catch (Exception e) { throw e; } return list; } public void addManual(Manual manual) throws Exception { try { String manualNum = manualMapper.getManualNum(); manualNum = TableID.getTabId(manualNum, TableID.MANUAL_PREFIX); DateEx dt = new DateEx(); manual.setManualNum(manualNum); manual.setCreateTime(dt.getDateTimeStandard()); manual.setLastUpdateTime(dt.getDateTimeStandard()); manualMapper.addManual(manual); } catch (Exception e) { throw e; } } public Integer updateManual(Manual manual) throws Exception{ int iRet = 0; try{ iRet = manualMapper.updateManual(manual); } catch (Exception e){ throw e; } return iRet; } public Integer deleteManual(String manualNum) throws Exception{ int iRet = 0; try{ iRet = manualMapper.deleteManual(manualNum); } catch (Exception e){ throw e; } return iRet; } }
[ "1339194845@qq.com" ]
1339194845@qq.com
7307125355507a12c9a6cdc74692417379c95dfe
128da67f3c15563a41b6adec87f62bf501d98f84
/com/emt/proteus/duchampopt/wcsset_1739.java
93f691b9edc74b550527e9441faa007712826f7d
[]
no_license
Creeper20428/PRT-S
60ff3bea6455c705457bcfcc30823d22f08340a4
4f6601fb0dd00d7061ed5ee810a3252dcb2efbc6
refs/heads/master
2020-03-26T03:59:25.725508
2018-08-12T16:05:47
2018-08-12T16:05:47
73,244,383
0
0
null
null
null
null
UTF-8
Java
false
false
2,365
java
/* */ package com.emt.proteus.duchampopt; /* */ /* */ import com.emt.proteus.runtime.api.Env; /* */ import com.emt.proteus.runtime.api.Frame; /* */ import com.emt.proteus.runtime.api.Function; /* */ import com.emt.proteus.runtime.api.ImplementedFunction; /* */ /* */ public final class wcsset_1739 extends ImplementedFunction /* */ { /* */ public static final int FNID = Integer.MAX_VALUE; /* 11 */ public static final Function _instance = new wcsset_1739(); /* 12 */ public final Function resolve() { return _instance; } /* */ /* 14 */ public wcsset_1739() { super("wcsset_1739", 3, false); } /* */ /* */ public int execute(int paramInt1, int paramInt2, int paramInt3) /* */ { /* 18 */ call(paramInt1, paramInt2, paramInt3); /* 19 */ return 0; /* */ } /* */ /* */ public int execute(Env paramEnv, Frame paramFrame, int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfInt, int paramInt4) /* */ { /* 24 */ int i = paramFrame.getI32(paramArrayOfInt[paramInt4]); /* 25 */ paramInt4 += 2; /* 26 */ paramInt3--; /* 27 */ int j = paramFrame.getI32(paramArrayOfInt[paramInt4]); /* 28 */ paramInt4 += 2; /* 29 */ paramInt3--; /* 30 */ int k = paramFrame.getI32(paramArrayOfInt[paramInt4]); /* 31 */ paramInt4 += 2; /* 32 */ paramInt3--; /* 33 */ call(i, j, k); /* 34 */ return paramInt4; /* */ } /* */ /* */ /* */ public static void call(int paramInt1, int paramInt2, int paramInt3) /* */ { /* 40 */ int i = 0; /* */ /* */ /* */ /* */ try /* */ { /* 46 */ if (paramInt1 < 4) /* */ { /* 48 */ paramInt3 = 3 - paramInt3; /* 49 */ i = 0; /* */ /* */ for (;;) /* */ { /* 53 */ com.emt.proteus.runtime.api.MainMemory.setI8(paramInt2 + 104 + (paramInt1 + i), (byte)0); /* 54 */ i += 1; /* 55 */ if (i == paramInt3) { /* */ break; /* */ } /* */ } /* */ } /* */ return; /* */ } /* */ finally {} /* */ } /* */ } /* Location: /home/jkim13/Desktop/emediatrack/codejar_s.jar!/com/emt/proteus/duchampopt/wcsset_1739.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "kimjoey79@gmail.com" ]
kimjoey79@gmail.com
49444caa23cd31c3fe3c33b4b62e57dd4e820ab3
9153e012d97dad2d8fe8f852f0bfeed4cb73bde5
/app/src/test/java/com/example/wikiwebview/ExampleUnitTest.java
acc1eb423b21914efbf4f953a2c7570dba9743e3
[]
no_license
casstarng/WikiWebView
303bbff8c0606f3a711244bebb41266ccbd81021
cd32f105cbeea1e97d0ebaed774880f14c8590f8
refs/heads/master
2020-04-21T19:41:49.887735
2019-02-09T01:11:37
2019-02-09T01:11:37
169,816,482
0
0
null
null
null
null
UTF-8
Java
false
false
384
java
package com.example.wikiwebview; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "catarng@cisco.com" ]
catarng@cisco.com
49999100b214e14e69cfff45871e841042fca877
b9746f8820b09e0bf665b1aceefa4c0cdf75e428
/app/src/main/java/com/example/anadministrator/recyclerview_moretypes/MyRecycleViewAdapter.java
a0e352932c8a386d32ecb1574eb461c3c0a1a177
[]
no_license
zhangqifan1/RecyclerView_MoreTypes
57f7112ea67d7760286552ff0ba545d88229b18b
846af090e29b659f0ae21777fac7ad3d4a2e3f8b
refs/heads/master
2021-01-23T14:11:29.663252
2017-09-07T01:38:06
2017-09-07T01:38:06
102,676,867
0
0
null
null
null
null
UTF-8
Java
false
false
4,379
java
package com.example.anadministrator.recyclerview_moretypes; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.youth.banner.Banner; import java.util.ArrayList; import java.util.List; /** * Created by 张祺钒 * on2017/9/6. */ public class MyRecycleViewAdapter extends RecyclerView.Adapter<MyRecycleViewAdapter.MyViewHolder> implements View.OnClickListener { private List<String> list; private Context context; private View view; private List<Integer> listImages=new ArrayList<>(); public MyRecycleViewAdapter(List<String> list, Context context) { this.list = list; this.context = context; listImages.add(R.drawable.e); listImages.add(R.drawable.d); } @Override public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view; if(viewType==Type){ view = View.inflate(context, R.layout.headeriew, null); return new MyViewHolder(view); } else if (viewType == Type0) { view = View.inflate(context, R.layout.item, null); return new MyViewHolder(view); } else if (viewType == Type1) { view = View.inflate(context, R.layout.item1, null); return new MyViewHolder(view); } else { view = View.inflate(context, R.layout.item2, null); return new MyViewHolder(view); } } @Override public void onClick(View view) { if (mMyItemclickListener != null) { mMyItemclickListener.itemclick(view, (Integer) view.getTag()); } } public interface MyItemclickListener { void itemclick(View view, int position); } public MyItemclickListener mMyItemclickListener; public void setmMyItemclickListener(MyItemclickListener mMyItemclickListener) { this.mMyItemclickListener = mMyItemclickListener; } @Override public void onBindViewHolder(MyViewHolder holder, int position) { int type = getItemViewType(position); switch (type) { case Type: holder.banner.setImageLoader(new GlideImageLoader()) // .isAutoPlay(false) .setDelayTime(3000) .setImages(listImages) .start(); break; case Type0: holder.tv_title.setText(list.get(position)); break; case Type1: holder.tv1.setText(list.get(position)); holder.tv2.setText(list.get(position + 2)); break; case Type2: holder.image1.setImageResource(R.drawable.d); holder.image2.setImageResource(R.drawable.e); break; default: break; } holder.itemView.setTag(position); } public final int Type = 212; public final int Type0 = 1; public final int Type1 = 2; public final int Type2 = 3; @Override public int getItemViewType(int position) { if (position==0) { return Type; } else if (position % 3 == 0) { return Type0; } else if (position % 3 == 1) { return Type1; } else { return Type2; } } @Override public int getItemCount() { return list.size(); } class MyViewHolder extends RecyclerView.ViewHolder { private final ImageView iv_icon; private final TextView tv_title; private final ImageView image1; private final ImageView image2; private final TextView tv1; private final TextView tv2; private final Banner banner; public MyViewHolder(View itemView) { super(itemView); banner = itemView.findViewById(R.id.banner); iv_icon = itemView.findViewById(R.id.iv_icon); tv_title = itemView.findViewById(R.id.tv_title); image1 = itemView.findViewById(R.id.image1); image2 = itemView.findViewById(R.id.image2); tv1 = itemView.findViewById(R.id.tv1); tv2 = itemView.findViewById(R.id.tv2); } } }
[ "852780161@qq.com" ]
852780161@qq.com
0616c5a290769b5f271ecdd4bff2830e6712a200
729806c16f1ca762ea9b11d4fc5185c88e339176
/src/main/java/com/example/course/config/TestConfig.java
86e1227a87714a163906305aa6706023581ddaf9
[]
no_license
rr2222/springboot-etude
18ae7084f8cbb16f0d2c237d9662cbe19f104d28
cf8151b6385bdd9e87cb76581e6a674c1d7f5d88
refs/heads/main
2023-04-03T21:04:48.030147
2021-04-21T04:53:10
2021-04-21T04:53:10
351,270,861
0
0
null
null
null
null
UTF-8
Java
false
false
3,099
java
package com.example.course.config; import com.example.course.entities.*; import com.example.course.enums.OrderStatus; import com.example.course.repositories.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import java.time.Instant; import java.util.Arrays; @Configuration @Profile("test") public class TestConfig implements CommandLineRunner { @Autowired private UserRepository userRepository; @Autowired private OrderRepository orderRepository; @Autowired private CategoryRepository categoryRepository; @Autowired ProductRepository productRepository; @Autowired OrderItemRepository orderItemRepository; @Override public void run(String... args) throws Exception { User u1 = new User(null, "Maria Brown", "maria@gmail.com", "988888888", "123456"); User u2 = new User(null, "Alex Green", "alex@gmail.com", "977777777", "123456"); Order o1 = new Order(null, Instant.parse("2019-06-20T19:53:07Z"), OrderStatus.PAID, u1); Order o2 = new Order(null, Instant.parse("2019-07-21T03:42:10Z"), OrderStatus.WAITING_PAYMENT, u2); Order o3 = new Order(null, Instant.parse("2019-07-22T15:21:22Z"), OrderStatus.WAITING_PAYMENT, u1); Category cat1 = new Category(null, "Electronics"); Category cat2 = new Category(null, "Books"); Category cat3 = new Category(null, "Computers"); Product p1 = new Product(null, "The Lord of the Rings", "Lorem ipsum dolor sit amet, consectetur.", 90.5, ""); Product p2 = new Product(null, "Smart TV", "Nulla eu imperdiet purus. Maecenas ante.", 2190.0, ""); Product p3 = new Product(null, "Macbook Pro", "Nam eleifend maximus tortor, at mollis.", 1250.0, ""); Product p4 = new Product(null, "PC Gamer", "Donec aliquet odio ac rhoncus cursus.", 1200.0, ""); Product p5 = new Product(null, "Rails for Dummies", "Cras fringilla convallis sem vel faucibus.", 100.99, ""); p1.getCategories().add(cat2); p2.getCategories().add(cat1); p2.getCategories().add(cat3); p3.getCategories().add(cat3); p4.getCategories().add(cat3); p5.getCategories().add(cat2); userRepository.saveAll(Arrays.asList(u1, u2)); orderRepository.saveAll(Arrays.asList(o1,o2,o3)); categoryRepository.saveAll(Arrays.asList(cat1, cat2, cat3)); productRepository.saveAll(Arrays.asList(p1,p2,p3,p4,p5)); OrderItem oi1 = new OrderItem(o1, p1, 2, p1.getPrice()); OrderItem oi2 = new OrderItem(o1, p3, 1, p3.getPrice()); OrderItem oi3 = new OrderItem(o2, p3, 2, p3.getPrice()); OrderItem oi4 = new OrderItem(o3, p5, 2, p5.getPrice()); orderItemRepository.saveAll(Arrays.asList(oi1,oi2,oi3,oi4)); Payment pay1 = new Payment(null, Instant.parse("2019-06-20T21:53:07Z"), o1); o1.setPayment(pay1); orderRepository.save(o1); } }
[ "ruither.carvalho@gmail.com" ]
ruither.carvalho@gmail.com
cb901f8b5b62443b04f94f0aac22e9c8066dcc58
113f6fda1a6bfff24bd4acf48e4e15d3405d3dae
/GoogleChat/src/ChatServlet.java
fc8feaa833f2e15d264ea3471cb3065ddc2cdc8f
[]
no_license
danielmedalsi1234/ServletDBTzlil
10b27f8e1dcc61adf0292e8a005fe21986bd8657
dc2a1ccc5e8a0484a7d96462768c059c1a87a308
refs/heads/master
2020-03-20T19:48:35.775243
2018-06-17T12:44:30
2018-06-17T12:44:34
137,654,954
0
0
null
null
null
null
UTF-8
Java
false
false
4,298
java
import javax.servlet.ServletException; import java.io.*; import java.sql.*; import java.util.ArrayList; import java.util.List; public class ChatServlet extends javax.servlet.http.HttpServlet { public static final String SET_MESSAGE = "first_name="; public static final String GET_MESSAGES = "get_message="; private List<String> messages; public static final String pathToDesktop = "/home/danielmedalsi1234/Desktop/"; @Override public void init() throws ServletException { messages = new ArrayList<>(); } protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException { } protected void doGet (javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException { String queryString = request.getQueryString(); if (queryString == null) return; if (queryString.startsWith(GET_MESSAGES)) { int from = Integer.valueOf(queryString.substring(GET_MESSAGES.length())); StringBuilder stringBuilder = new StringBuilder(); for (int i = from; i < messages.size() - 1; i++) { stringBuilder.append(messages.get(i) + "&"); } if (messages.size() > 0 && from <= messages.size() - 1) stringBuilder.append(messages.get(messages.size() - 1)); response.getWriter().write(stringBuilder.toString()); } else if (queryString.startsWith(SET_MESSAGE)) { if (messages.size() > 300) { return; } this.messages.add(queryString.substring(SET_MESSAGE.length())); for (int i=0;i<messages.size();i++){ response.getWriter().write("\n" + i + ":"+ messages.get(i)); System.out.println(messages.get(i)); } try { InsertDataToTableDB(); } catch (Exception e) { e.printStackTrace(); } } } public static Connection getConnection() throws Exception { try { String driver = "com.mysql.jdbc.Driver"; String url = "jdbc:mysql://localhost:3306/users"; String user_name = "root"; String password = "de12de9578641"; Class.forName(driver); Connection conn = DriverManager.getConnection(url, user_name, password); System.out.println("connected"); return conn; } catch (Exception e) { e.printStackTrace(); } return null; } public static void CreateTableDB() throws Exception { final String UserName = "dani1"; final int password = 1234; final int id = 1; try { Connection connection = getConnection(); PreparedStatement insert = connection.prepareStatement("create table test (\n" + " id int unsigned auto_increment not null,\n" + " first_name varchar(32) not null,\n" + " last_name varchar(32) not null,\n" + " date_created timestamp default now(),\n" + " is_admin boolean,\n" + " num_points int,\n" + " primary key (id)\n" + ");"); insert.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } finally { System.out.println("insert complete!"); } } public static void InsertDataToTableDB() throws Exception { String query = " insert into user (user_name,password,id)" + " values ('roei',11234112,279879993)"; try { Connection connection = getConnection(); PreparedStatement insert = connection.prepareStatement(query); insert.executeUpdate(); System.out.println("try-insert done"); connection.close(); } catch (Exception e) { e.printStackTrace(); System.out.println("erorr insert"); } finally { System.out.println("finaly - insert"); } } }
[ "danielmedalsi1234@gmail.com" ]
danielmedalsi1234@gmail.com
77e4179bdef2f309dc343439d182748ef6492de4
34c72edf209a8dd0f09ab72bf14838df41dc6d8d
/Backend/servRegistrarTarjeta/src/java/co/dpenad3/config/GenericApplication.java
0398ebcd05751607068650cac19ebc46ba4f4552
[]
no_license
dpenad3/Gestor-Apuestas
8a0bca04ae6a52d22c4e0dab34883aca7c685693
a0b9a19d31f168bc2f8021ef1eae632a73ccd5f1
refs/heads/master
2023-01-13T00:52:52.178294
2020-06-10T00:04:56
2020-06-10T00:04:56
247,559,661
0
1
null
2023-01-07T16:29:06
2020-03-15T22:05:52
Java
UTF-8
Java
false
false
686
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 co.dpenad3.config; import co.dpenad3.servicios.Operaciones; import javax.ws.rs.ApplicationPath; import org.glassfish.jersey.server.ResourceConfig; /** * * @author Vinni - vinni9@gmail.com */ @ApplicationPath("app") public class GenericApplication extends ResourceConfig{ public GenericApplication (){ register(Operaciones.class); // Estas son las clases que contienen los servicios register(new CORSFilter()); register(new CORSRequestFilter()); } }
[ "dpenad3@ucentral.edu.co" ]
dpenad3@ucentral.edu.co
9ca5299c727efcdac409bf74510ef12b1ef9e7a6
70462cef7c215e195a08afdaf6af8dbe32cba7fb
/src/test/java/com/it/epolice/agent/ImageInfoTest.java
14c3d6a4cb2cf3d05c8254f848f9ca5748dc28c7
[]
no_license
wldandan/it-agent
b1eb242b948dd104f85c508012ac257d65acb62f
f2ee9827339ffa84eac09bec6d93dbc0036e84be
refs/heads/master
2021-01-22T19:49:52.690499
2014-04-04T11:55:23
2014-04-04T11:55:23
17,801,476
1
0
null
null
null
null
GB18030
Java
false
false
858
java
package com.it.epolice.agent; import static org.junit.Assert.*; import java.text.SimpleDateFormat; import org.junit.Test; import com.it.epolice.agent.image.ImageInfo; import com.it.epolice.agent.image.ImageNameConfig; public class ImageInfoTest { @Test public void testSimpleGoodPassOfParse() { String picName = "机号017车道B12014年03月13日01时30分30秒RX09D1H1驶向北至南违章超速时速61公里_S"; ImageInfo info = ImageNameConfig.load().parse(picName); assertEquals("017", info.getCamId()); assertEquals("B1", info.getLane()); assertEquals("2014-03-13 01:30:30", new SimpleDateFormat("YYYY-MM-dd HH:mm:ss").format(info.getTime())); assertEquals("RX09D1H1", info.getCarNumber()); assertEquals("驶向北至南违章超速时速61公里", info.getRegulationDesc()); assertEquals("S", info.getRegulationType()); } }
[ "xjtu_hfdang@163.com" ]
xjtu_hfdang@163.com
b4beb2de3b9283576a5b329ba7b19bcb1447f6ea
e0f0dc0f445b41557281060f17fdabba364c74ca
/ProcureAki/app/src/main/java/br/com/kingsoft/procureaki/model/Cidade.java
f9a8b7b3e6ddd4f54ee20978d9a4fa94931ddd3a
[]
no_license
ValerioBezerra/android
bbf05907c69ce9daa92ca09f5a07e8372d95a8ff
16b91a0b1a91f3e0b6f34d9a7febda0291b6ca97
refs/heads/master
2021-03-27T16:01:42.445343
2016-09-15T00:57:07
2016-09-15T00:57:07
40,610,060
0
0
null
null
null
null
UTF-8
Java
false
false
742
java
package br.com.kingsoft.procureaki.model; import java.io.Serializable; @SuppressWarnings("serial") public class Cidade implements Serializable { private int id; private String nome; private String uf; public Cidade() { this.id = 0; this.nome = ""; this.uf = ""; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getUf() { return uf; } public void setUf(String uf) { this.uf = uf; } public String toString() { if (uf.equals("")) { return this.nome; } else { return this.nome + " - " + this.uf; } } }
[ "valeriobezerra.dev@gmail.com" ]
valeriobezerra.dev@gmail.com
884eb944a58ed588b18824829e6b61e58f1eedb2
ad67bbfb5b6a0ad7ecfc3feb41f2de0428b9207d
/src/io/github/techno_coder/fairies/FairyHandlers/manual/FairyManualQuickMove.java
a1159007474e7e25884bcc98f6ec433962c5d949
[]
no_license
Techno-coder/Fairies
15a7914f90d2de8b79bca71eeb9fcb5c461fb169
cfffbd42eee9d4e92e8f407adeadf4e4b193d5e2
refs/heads/master
2021-01-11T17:19:06.158197
2017-01-22T20:26:42
2017-01-22T20:26:42
79,743,305
0
0
null
null
null
null
UTF-8
Java
false
false
1,491
java
package io.github.techno_coder.fairies.FairyHandlers.manual; import io.github.techno_coder.fairies.Fairy; import io.github.techno_coder.fairies.FairyHandlers.IFairyHandler; public class FairyManualQuickMove implements IFairyHandler { int currentDegree = 0; @Override public void runHandler(Fairy fairy, String command) { if (command.equals("QL")) { if(currentDegree == 90) fairy.rotate(180); if(currentDegree == 0) fairy.rotate(-90); if(currentDegree == 180) fairy.rotate(90); fairy.move(fairy.getEnergy()); currentDegree = -90; } if(command.equals("QR")) { if(currentDegree == -90) fairy.rotate(180); if(currentDegree == 0) fairy.rotate(90); if(currentDegree == 180) fairy.rotate(-90); fairy.move(fairy.getEnergy()); currentDegree = 90; } if(command.equals("QU")) { if(currentDegree == -90) fairy.rotate(90); if(currentDegree == 180) fairy.rotate(180); if(currentDegree == 90) fairy.rotate(-90); fairy.move(fairy.getEnergy()); currentDegree = 0; } if (command.equals("QD")) { if(currentDegree == -90) fairy.rotate(-90); if(currentDegree == 0) fairy.rotate(180); if(currentDegree == 90) fairy.rotate(90); fairy.move(fairy.getEnergy()); currentDegree = 180; } } }
[ "zhiyuanqi@hotmail.co.nz" ]
zhiyuanqi@hotmail.co.nz
fae70fcc43edf5ea94c7de92e2c745e0ff0d1392
b77cb2cad70d719843baea284af926d7ceb98b16
/Bean/ReactionTableRecord.java
acaca5cdb633c8db412c6a5f2bde4e750d305b6f
[]
no_license
piaoyaocdl/BaoBiaoFuWu
9cef7d26ededfc37e4e6298c49bae5218d12c465
cd76cb8be9d912d4835696f8af50fa5704cd8f19
refs/heads/master
2021-01-10T05:36:20.093159
2016-01-06T07:31:25
2016-01-06T07:31:25
47,692,422
0
0
null
null
null
null
UTF-8
Java
false
false
6,454
java
package deefw; // Generated 2015-12-29 13:42:08 by Hibernate Tools 4.3.1.Final import java.util.Date; /** * ReactionTableRecord generated by hbm2java */ public class ReactionTableRecord implements java.io.Serializable { private int id; private CheckBill checkBill; private Integer reagentId; private String reagentName; private Integer batchId; private String batchNo; private String method; private String res1; private String res2; private String res3; private String res4; private String res5; private String res6; private String res7; private String res8; private String res9; private String res10; private String res11; private String result; private char reportRes; private String remark; private String recordName; private Date recordTime; private String res12; private String res13; private String res14; private String res15; private String res16; private Character item; private String sampleNo; public ReactionTableRecord() { } public ReactionTableRecord(int id, CheckBill checkBill, char reportRes) { this.id = id; this.checkBill = checkBill; this.reportRes = reportRes; } public ReactionTableRecord(int id, CheckBill checkBill, Integer reagentId, String reagentName, Integer batchId, String batchNo, String method, String res1, String res2, String res3, String res4, String res5, String res6, String res7, String res8, String res9, String res10, String res11, String result, char reportRes, String remark, String recordName, Date recordTime, String res12, String res13, String res14, String res15, String res16, Character item, String sampleNo) { this.id = id; this.checkBill = checkBill; this.reagentId = reagentId; this.reagentName = reagentName; this.batchId = batchId; this.batchNo = batchNo; this.method = method; this.res1 = res1; this.res2 = res2; this.res3 = res3; this.res4 = res4; this.res5 = res5; this.res6 = res6; this.res7 = res7; this.res8 = res8; this.res9 = res9; this.res10 = res10; this.res11 = res11; this.result = result; this.reportRes = reportRes; this.remark = remark; this.recordName = recordName; this.recordTime = recordTime; this.res12 = res12; this.res13 = res13; this.res14 = res14; this.res15 = res15; this.res16 = res16; this.item = item; this.sampleNo = sampleNo; } public int getId() { return this.id; } public void setId(int id) { this.id = id; } public CheckBill getCheckBill() { return this.checkBill; } public void setCheckBill(CheckBill checkBill) { this.checkBill = checkBill; } public Integer getReagentId() { return this.reagentId; } public void setReagentId(Integer reagentId) { this.reagentId = reagentId; } public String getReagentName() { return this.reagentName; } public void setReagentName(String reagentName) { this.reagentName = reagentName; } public Integer getBatchId() { return this.batchId; } public void setBatchId(Integer batchId) { this.batchId = batchId; } public String getBatchNo() { return this.batchNo; } public void setBatchNo(String batchNo) { this.batchNo = batchNo; } public String getMethod() { return this.method; } public void setMethod(String method) { this.method = method; } public String getRes1() { return this.res1; } public void setRes1(String res1) { this.res1 = res1; } public String getRes2() { return this.res2; } public void setRes2(String res2) { this.res2 = res2; } public String getRes3() { return this.res3; } public void setRes3(String res3) { this.res3 = res3; } public String getRes4() { return this.res4; } public void setRes4(String res4) { this.res4 = res4; } public String getRes5() { return this.res5; } public void setRes5(String res5) { this.res5 = res5; } public String getRes6() { return this.res6; } public void setRes6(String res6) { this.res6 = res6; } public String getRes7() { return this.res7; } public void setRes7(String res7) { this.res7 = res7; } public String getRes8() { return this.res8; } public void setRes8(String res8) { this.res8 = res8; } public String getRes9() { return this.res9; } public void setRes9(String res9) { this.res9 = res9; } public String getRes10() { return this.res10; } public void setRes10(String res10) { this.res10 = res10; } public String getRes11() { return this.res11; } public void setRes11(String res11) { this.res11 = res11; } public String getResult() { return this.result; } public void setResult(String result) { this.result = result; } public char getReportRes() { return this.reportRes; } public void setReportRes(char reportRes) { this.reportRes = reportRes; } public String getRemark() { return this.remark; } public void setRemark(String remark) { this.remark = remark; } public String getRecordName() { return this.recordName; } public void setRecordName(String recordName) { this.recordName = recordName; } public Date getRecordTime() { return this.recordTime; } public void setRecordTime(Date recordTime) { this.recordTime = recordTime; } public String getRes12() { return this.res12; } public void setRes12(String res12) { this.res12 = res12; } public String getRes13() { return this.res13; } public void setRes13(String res13) { this.res13 = res13; } public String getRes14() { return this.res14; } public void setRes14(String res14) { this.res14 = res14; } public String getRes15() { return this.res15; } public void setRes15(String res15) { this.res15 = res15; } public String getRes16() { return this.res16; } public void setRes16(String res16) { this.res16 = res16; } public Character getItem() { return this.item; } public void setItem(Character item) { this.item = item; } public String getSampleNo() { return this.sampleNo; } public void setSampleNo(String sampleNo) { this.sampleNo = sampleNo; } }
[ "piaoyaocdl@163.com" ]
piaoyaocdl@163.com
477852caccbf94d53d0a4b217b2cbe1e8deef12f
c108784319bd1ba8e378645b03f44c0ca51ab8d1
/src/main/java/ru/belonogoff/spring/MusicPlayer.java
b6c0924e235613b9f6a0e873efc6e47f9e2e128f
[]
no_license
Belonogoff/Spring_config
6b3fe70d4d9f95935f425e13928a3cfad74a96e0
a340b15e020f9f29b95eced9cf98d5011875d87e
refs/heads/master
2023-02-15T05:05:12.237823
2020-12-30T18:06:31
2021-01-03T20:54:27
325,000,893
0
0
null
null
null
null
UTF-8
Java
false
false
671
java
package ru.belonogoff.spring; import org.springframework.beans.factory.annotation.Value; import java.util.List; import java.util.Random; public class MusicPlayer { @Value("${musicPlayer.name}") private String name; @Value("${musicPlayer.volume}") private int volume; List<Music> playList; public MusicPlayer(List<Music> playList) { this.playList = playList; } public String playMusic() { Random random = new Random(); return "Playing: " + playList.get(random.nextInt(2)).getSong(); } public String getName() { return name; } public int getVolume() { return volume; } }
[ "belonogoff90@gmail.com" ]
belonogoff90@gmail.com
6bd23983f6182fadec37035159f4b770251afd2f
ae0c0a5ce6c2610bb4500ddb54370826687fbdbe
/leige-security-core/src/main/java/com/leige/security/core/config/MyPasswordEncoder.java
6c26741ed1f4a5dd59d74c252210c80575a7e972
[]
no_license
leige6/leige-security
d0ba95c3934de489ebd764cdfda26a0f5bfc4a41
fdd3bb4ed6db0a2fae9c46bb9772d469cef8aa5a
refs/heads/master
2020-05-17T17:05:28.717448
2019-04-30T08:00:14
2019-04-30T08:00:14
157,368,864
1
0
null
null
null
null
UTF-8
Java
false
false
653
java
package com.leige.security.core.config; import com.leige.security.core.utils.Md5Util; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Component; /** * Created by mac on 2018/11/13. */ @Component public class MyPasswordEncoder implements PasswordEncoder { @Override public String encode(CharSequence charSequence) { return Md5Util.md5Encode(charSequence.toString()); } @Override public boolean matches(CharSequence charSequence, String s) { String passwordInput= Md5Util.md5Encode(charSequence.toString()); return s.equals(passwordInput); } }
[ "Fang201314" ]
Fang201314
2f3ceb89e3b6c1a8376475731436c4689c15ceb0
282aeffd27874a70a67924f42de3a346d695aa6a
/app/src/main/java/idi/francesc/footballleague/PartitsContract.java
180ebff8f291c5baba5cd90e3ce100b08b552fd9
[]
no_license
flapedriza/AndroidFootball
932fd569f0045f7953bfcbe4f64d157b41732adc
0cce8800c5445c5ff87b91f63a3568dffe07bff2
refs/heads/master
2021-01-15T11:24:03.678987
2016-06-06T18:38:39
2016-06-06T18:38:39
59,238,474
0
0
null
null
null
null
UTF-8
Java
false
false
670
java
package idi.francesc.footballleague; import android.provider.BaseColumns; /** * Created by Francesc Lapedriza. */ public class PartitsContract { public PartitsContract() {} public static abstract class PartitsEntry implements BaseColumns { public static final String TABLE_NAME = "partits"; public static final String COLUMN_NAME_LOCAL = "local"; public static final String COLUMN_NAME_VISITANT = "visitant"; public static final String COLUMN_NAME_DATA = "data"; public static final String COLUMN_NAME_GOLS_LOCAL = "golslocal"; public static final String COLUMN_NAME_GOLS_VISITANT = "golsvisitant"; } }
[ "franklapedriza@gmail.com" ]
franklapedriza@gmail.com
196c5087ebdd4aad21857635a73a17d8975b0233
13cdecbca9b3b778ef7fbf3a9441e31893c98c8a
/src/app/Math.java
d090e7abd45f087db4b158b7d6527aa92f4f5199
[]
no_license
ahoward2/java-swing-gui
743a9a2339c6abaacd356c37bee79d6a389f6e92
b24ff1b56a7e4a45b385d4d415d56ed8aeb10425
refs/heads/master
2020-09-06T05:08:36.469577
2019-11-12T21:03:21
2019-11-12T21:03:21
220,333,124
2
0
null
null
null
null
UTF-8
Java
false
false
360
java
package app; import java.math.BigDecimal; import java.math.RoundingMode; public class Math { public double round(double value, int places) { if (places < 0) throw new IllegalArgumentException(); BigDecimal bd = new BigDecimal(Double.toString(value)); bd = bd.setScale(places, RoundingMode.HALF_UP); return bd.doubleValue(); } }
[ "ahoward2@unca.edu" ]
ahoward2@unca.edu
719cc72f98d204ecea674483954dd061d8e0126b
755e4287ada85299d8f1582c23c9338bb3df920f
/app/src/main/java/com/gdmec/jacky/myguard/m9advancedtools/utils/SmsReducitionUtils.java
628405d3455c5f0a259778d1921c97221502719e
[]
no_license
gdmec07150812/MyGuard
12a57c133908e9eb2867aa1f43b2f02db5296ad2
4154d87a7e7f56c687d5a8dd8b10f6e3bdbd1e49
refs/heads/master
2021-01-13T03:07:06.606615
2016-12-29T14:53:59
2016-12-29T14:53:59
77,159,863
2
0
null
null
null
null
UTF-8
Java
false
false
4,160
java
package com.gdmec.jacky.myguard.m9advancedtools.utils; import android.app.Activity; import android.content.ContentResolver; import android.content.ContentValues; import android.net.Uri; import android.os.Environment; import android.util.Xml; import com.gdmec.jacky.myguard.m9advancedtools.entity.SmsInfo; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.File; import java.io.FileInputStream; import java.io.IOException; /** * Created by dell-pc on 2016/12/19. */ public class SmsReducitionUtils { private boolean flag = true; public void setFlag(boolean flag) { this.flag = flag; } public boolean reducitionSms(Activity context, SmsReducitionCallBack callBack) throws XmlPullParserException, IOException { File file = new File(Environment.getExternalStorageDirectory(), "backup.xml"); if (file.exists()) { FileInputStream is = new FileInputStream(file); XmlPullParser parser = Xml.newPullParser(); parser.setInput(is, "utf-8"); SmsInfo smsInfo = null; int eventType = parser.getEventType(); Integer max = null; int progress = 0; ContentResolver resolver = context.getContentResolver(); Uri uri = Uri.parse("content://sms/"); while (eventType != XmlPullParser.END_DOCUMENT & flag) { switch (eventType) { case XmlPullParser.START_TAG: if ("smss".equals(parser.getName())) { String maxStr = parser.getAttributeValue(0); max = new Integer(maxStr); callBack.beforeSmsReducition(max); } else if ("sms".equals(parser.getName())) { smsInfo = new SmsInfo(); } else if ("body".equals(parser.getName())) { try { smsInfo.body = Crypto.decrypt("123", parser.nextText()); } catch (Exception e) { e.printStackTrace(); //此条短息还原失败 smsInfo.body = "短信还原失败"; } } else if ("address".equals(parser.getName())) { smsInfo.address = parser.nextText(); } else if ("type".equals(parser.getName())) { smsInfo.type = parser.nextText(); } else if ("date".equals(parser.getName())) { smsInfo.date = parser.nextText(); } break; case XmlPullParser.END_TAG: if ("sms".equals(parser.getName())) { //向短息数据库中插入一条数据 ContentValues values = new ContentValues(); values.put("address", smsInfo.address); values.put("type", smsInfo.type); values.put("date", smsInfo.date); values.put("body", smsInfo.body); resolver.insert(uri, values); smsInfo = null; progress++; callBack.onSmsReducition(progress); } break; } eventType = parser.next(); } if (eventType == XmlPullParser.END_DOCUMENT & max != null) { if (progress < max) { callBack.onSmsReducition(max); } } } else { //如果backup.xml文件不存在,则说明没有备份短信 UiUtils.showToast(context, "您还没有备份短信"); } return flag; } public interface SmsReducitionCallBack { void beforeSmsReducition(int size); void onSmsReducition(int process); } }
[ "499042532@qq.com" ]
499042532@qq.com
0769f23220dd910b7f15656aa6dfb28350afafe4
ed64824e35d1146d6ece52658447f7b2f1192f29
/src/main/java/com/depth/cms/content/service/CommentFacade.java
bb6147c2fe2a2652a0f70e0dcfe678ba5f560b0f
[]
no_license
starmonnXL/depth
ec738e29fdbf6c4083819b2181c3a517b27c98df
50ad5fa17d46e2c84642cb77b57856183d7a80ef
refs/heads/master
2021-05-14T15:19:21.817685
2018-01-02T08:27:24
2018-01-02T08:36:46
115,989,936
0
1
null
null
null
null
UTF-8
Java
false
false
3,359
java
package com.depth.cms.content.service; import com.depth.cms.commons.page.BizPageResponse; import com.depth.cms.commons.page.Page; import com.depth.cms.content.entity.CommentEntity; import com.depth.cms.content.exception.SDKException; import java.util.List; import java.util.Map; /** * 文章评论服务 * <p>@author weifeng 作者</p> */ public interface CommentFacade { /** * 添加评论 * @param params (articleId:文章id; content:评论内容; aa01:评论人id) * @return 评论 */ CommentEntity add(Map<String, Object> params) throws SDKException; /** * 修改评论 * @param comment 新的评论内容 */ void update(CommentEntity comment) throws SDKException; /** * 删除指定评论 * @param id 指定评论id */ void deleteById(Long id) throws SDKException; /** * 逻辑删除评论 * @param id 指定评论id * @throws SDKException */ void logicDeleteById(Long id) throws SDKException; /** * 查询指定评论 * @param id 评论id * @return 评论 */ CommentEntity getById(Long id) throws SDKException; /** * 查询一页的评论 <p> * 可接受的查询参数:<br/> * <code>aId</code>文章编号<br/> * <code>state</code>状态<br/> * <code>beginDate</code>评论时间日期起<br/> * <code>endDate</code>评论时间日期止<br/> * <code>commentatorId</code>评论人编号<br/> * </p> * * @return 评论分页 */ BizPageResponse<List<CommentEntity>> findWithPage(Page page) throws SDKException; /** * 查询一页状态正常的评论 **<p> * 可接受的查询参数:<br/> * <code>aId</code>文章编号<br/> * <code>beginDate</code>评论时间日期起<br/> * <code>endDate</code>评论时间日期止<br/> * <code>commentatorId</code>评论人编号<br/> * </p> * * @return 评论分页 * <pre> id 评论id * <pre> articleId 文章id * <pre> content 评论内容 * <pre> report 举报量 * <pre> likes 点赞数 * <pre> aa01 评论人 * <pre> aa02 评论时间 * */ BizPageResponse<List<Map<String,Object>>> findNormalWithPage(Page page) throws SDKException; /** * 查询一页状态正常的评论 **<p> * 可接受的查询参数:<br/> * <code>aId</code>文章编号<br/> * <code>beginDate</code>评论时间日期起<br/> * <code>endDate</code>评论时间日期止<br/> * <code>commentatorId</code>评论人编号<br/> * </p> * * @return 评论分页 */ BizPageResponse<List<CommentEntity>> findNormalPage(Page page) throws SDKException; /** * 查询一页状态正常且被举报过的评论 <p> * 可接受的查询参数:<br/> * <code>aId</code>文章编号<br/> * <code>beginDate</code>评论时间日期起<br/> * <code>endDate</code>评论时间日期止<br/> * </p> * * @return 评论分页 */ BizPageResponse<List<CommentEntity>> findReportComment(Page page) throws SDKException; /** * 根据文章编号统计正常评论数 * @param aId 文章编号 * @return 评论数量 */ Integer countCommentByAid(Long aId) throws SDKException; }
[ "starmoonXL@outlook.com" ]
starmoonXL@outlook.com
86dfbdd4f431ff2b373b0c882a600fb2133d1336
0532dc07c38145bd49311fc6c2f54e2183b49d5d
/src.java/org/anodyneos/servlet/xsl/xalan/BBCode.java
eaea856c37d40a1bba5d14b67ed41ee69f4fcab3
[ "Apache-2.0", "MIT" ]
permissive
jvasileff/aos-servlet
4a8d4202fc185c6b1a4cc3424799ec58584839de
c69f988f23a818d5a1844b84e83439370dd650a2
refs/heads/master
2020-04-06T07:12:16.609606
2010-03-29T04:17:14
2010-03-29T04:17:14
1,376,820
0
1
null
null
null
null
UTF-8
Java
false
false
2,253
java
package org.anodyneos.servlet.xsl.xalan; import javax.xml.transform.TransformerException; import org.apache.xalan.extensions.ExpressionContext; import org.apache.xalan.extensions.XSLProcessorContext; import org.apache.xalan.templates.ElemExtensionCall; import org.apache.xpath.objects.XObject; import org.w3c.dom.Document; import org.w3c.dom.DocumentFragment; public class BBCode extends Extension { private AutoHtmlParserUrlGen autoHtmlParserUrlGen; public BBCode() { super(); } public void init (XSLProcessorContext context, ElemExtensionCall extElem) throws TransformerException { XObject xobj; AutoHtmlParserUrlGen alug = null; xobj = getAttributeAsSelect("urlGenerator", context, extElem); autoHtmlParserUrlGen = (AutoHtmlParserUrlGen) xobj.object(); } public DocumentFragment bbCode( XSLProcessorContext context, ElemExtensionCall extElem) throws TransformerException, ParseException { XObject xobj; String inString = null; xobj = getAttributeAsSelect("select", context, extElem); if (xobj != null) { inString = xobj.str(); } if((null == inString) || (inString.length() == 0)) { inString = extElem.getAttribute ("text", context.getContextNode(), context.getTransformer()); } Document doc = context.getContextNode().getOwnerDocument(); DocumentFragment docFrag = doc.createDocumentFragment(); BBCodeParserDom ald = new BBCodeParserDom(new java.io.StringReader(inString), docFrag); if (null != autoHtmlParserUrlGen) { ald.setUrlGen(autoHtmlParserUrlGen); } return (DocumentFragment) ald.process(); } public DocumentFragment bbCode( ExpressionContext eContext, String inString) throws TransformerException, ParseException { Document doc = eContext.getContextNode().getOwnerDocument(); DocumentFragment docFrag = doc.createDocumentFragment(); BBCodeParserDom ald = new BBCodeParserDom(new java.io.StringReader(inString), docFrag); if (null != autoHtmlParserUrlGen) { ald.setUrlGen(autoHtmlParserUrlGen); } return (DocumentFragment) ald.process(); } }
[ "git@netcc.us" ]
git@netcc.us
0a78d23bdfb782bb9677369bd34c494ffdc72d6d
2c937f6c258c948180b9db7514c36c99616e6143
/src/main/java/com/qa/BECS/pages/LogoutPage.java
5ffd94aac99335ce260b0e7c7e236e6f561fdffe
[]
no_license
srilakshmi-95/BECS_Selenium
c9f0a9da96a7c77974226b2fa1b15b12ba1c3f28
802ffd1588228343656cb48349ff9c1b17e04566
refs/heads/main
2023-01-30T14:22:50.814830
2020-12-14T07:47:05
2020-12-14T07:47:05
317,515,702
0
0
null
null
null
null
UTF-8
Java
false
false
503
java
package com.qa.BECS.pages; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class LogoutPage extends BasePage { @FindBy(id ="ctl00_lnkbtnLogout") WebElement logout; //Initializing the page object public LogoutPage() { PageFactory.initElements(driver, this); } public void accountLogout() throws InterruptedException { Thread.sleep(2000); logout.click(); } }
[ "srilakshmi.shivanand@gmail.com" ]
srilakshmi.shivanand@gmail.com
223438f72710ae32ae35c8ac4aa501ed1ed8889c
bc4bf51cc41410d6e4483797f606e01cbb16aa38
/Vendor/NCBI eutils/src/gov/nih/nlm/ncbi/www/soap/eutils/efetch_gene/AnnotDescrSequenceE.java
e9fc360d6bc933d434aa18e767bd3e58c9f219c1
[ "BSD-2-Clause" ]
permissive
milot-mirdita/GeMuDB
088533f38c4093317c5802ed1babd05d5e39c944
336988a7e3baa29a4fcae0807353c12abc54143b
refs/heads/master
2020-05-07T12:25:38.592087
2014-05-12T21:23:28
2014-05-12T21:23:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
17,018
java
/** * AnnotDescrSequenceE.java * * This file was auto-generated from WSDL * by the Apache Axis2 version: 1.6.2 Built on : Apr 17, 2012 (05:34:40 IST) */ package gov.nih.nlm.ncbi.www.soap.eutils.efetch_gene; /** * AnnotDescrSequenceE bean class */ @SuppressWarnings({"unchecked","unused"}) public class AnnotDescrSequenceE implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Annot-descrSequence Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_gene Namespace Prefix = ns1 */ /** * field for Annotdesc */ protected gov.nih.nlm.ncbi.www.soap.eutils.efetch_gene.Annotdesc_type0 localAnnotdesc ; /** * Auto generated getter method * @return gov.nih.nlm.ncbi.www.soap.eutils.efetch_gene.Annotdesc_type0 */ public gov.nih.nlm.ncbi.www.soap.eutils.efetch_gene.Annotdesc_type0 getAnnotdesc(){ return localAnnotdesc; } /** * Auto generated setter method * @param param Annotdesc */ public void setAnnotdesc(gov.nih.nlm.ncbi.www.soap.eutils.efetch_gene.Annotdesc_type0 param){ this.localAnnotdesc=param; } /** * * @param parentQName * @param factory * @return org.apache.axiom.om.OMElement */ public org.apache.axiom.om.OMElement getOMElement ( final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(this,parentQName); return factory.createOMElement(dataSource,parentQName); } public void serialize(final javax.xml.namespace.QName parentQName, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ serialize(parentQName,xmlWriter,false); } public void serialize(final javax.xml.namespace.QName parentQName, javax.xml.stream.XMLStreamWriter xmlWriter, boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ java.lang.String prefix = null; java.lang.String namespace = null; if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_gene"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Annot-descrSequence", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Annot-descrSequence", xmlWriter); } } if (localAnnotdesc==null){ throw new org.apache.axis2.databinding.ADBException("Annotdesc cannot be null!!"); } localAnnotdesc.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_gene","Annotdesc"), xmlWriter); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_gene")){ return "ns1"; } return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); } /** * Utility method to write an element start tag. */ private void writeStartElement(java.lang.String prefix, java.lang.String namespace, java.lang.String localPart, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); if (writerPrefix != null) { xmlWriter.writeStartElement(namespace, localPart); } else { if (namespace.length() == 0) { prefix = ""; } else if (prefix == null) { prefix = generatePrefix(namespace); } xmlWriter.writeStartElement(prefix, localPart, namespace); xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } } /** * Util method to write an attribute with the ns prefix */ private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ if (xmlWriter.getPrefix(namespace) == null) { xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } xmlWriter.writeAttribute(namespace,attName,attValue); } /** * Util method to write an attribute without the ns prefix */ private void writeAttribute(java.lang.String namespace,java.lang.String attName, java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ if (namespace.equals("")) { xmlWriter.writeAttribute(attName,attValue); } else { registerPrefix(xmlWriter, namespace); xmlWriter.writeAttribute(namespace,attName,attValue); } } /** * Util method to write an attribute without the ns prefix */ private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String attributeNamespace = qname.getNamespaceURI(); java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); if (attributePrefix == null) { attributePrefix = registerPrefix(xmlWriter, attributeNamespace); } java.lang.String attributeValue; if (attributePrefix.trim().length() > 0) { attributeValue = attributePrefix + ":" + qname.getLocalPart(); } else { attributeValue = qname.getLocalPart(); } if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attributeValue); } else { registerPrefix(xmlWriter, namespace); xmlWriter.writeAttribute(namespace, attName, attributeValue); } } /** * method to handle Qnames */ private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String namespaceURI = qname.getNamespaceURI(); if (namespaceURI != null) { java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); if (prefix == null) { prefix = generatePrefix(namespaceURI); xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix,namespaceURI); } if (prefix.trim().length() > 0){ xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } else { // i.e this is the default namespace xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } } else { xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } } private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (qnames != null) { // we have to store this data until last moment since it is not possible to write any // namespace data after writing the charactor data java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); java.lang.String namespaceURI = null; java.lang.String prefix = null; for (int i = 0; i < qnames.length; i++) { if (i > 0) { stringToWrite.append(" "); } namespaceURI = qnames[i].getNamespaceURI(); if (namespaceURI != null) { prefix = xmlWriter.getPrefix(namespaceURI); if ((prefix == null) || (prefix.length() == 0)) { prefix = generatePrefix(namespaceURI); xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix,namespaceURI); } if (prefix.trim().length() > 0){ stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } else { stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } } else { stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } } xmlWriter.writeCharacters(stringToWrite.toString()); } } /** * Register a namespace prefix */ private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = xmlWriter.getPrefix(namespace); if (prefix == null) { prefix = generatePrefix(namespace); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); } xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } return prefix; } /** * databinding method to get an XML representation of this object * */ public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException{ java.util.ArrayList elementList = new java.util.ArrayList(); java.util.ArrayList attribList = new java.util.ArrayList(); elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_gene", "Annotdesc")); if (localAnnotdesc==null){ throw new org.apache.axis2.databinding.ADBException("Annotdesc cannot be null!!"); } elementList.add(localAnnotdesc); return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); } /** * Factory class that keeps the parse method */ public static class Factory{ /** * static method to create the object * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element * Postcondition: If this object is an element, the reader is positioned at its end element * If this object is a complex type, the reader is positioned at the end element of its outer element */ public static AnnotDescrSequenceE parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ AnnotDescrSequenceE object = new AnnotDescrSequenceE(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_gene","Annotdesc").equals(reader.getName())){ object.setAnnotdesc(gov.nih.nlm.ncbi.www.soap.eutils.efetch_gene.Annotdesc_type0.Factory.parse(reader)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class }
[ "root@proteinsuite.com" ]
root@proteinsuite.com
4737393308ae1d00510e01f5326140b83247055e
943133e6977b3f31795861e6e3d3a9c95105ad51
/ToDoListClient/src/home/to_do_list/TeamMemberController.java
594d116a299c7a577f7fdd1cd499a9a41b3017b9
[]
no_license
SarrahMohamed/To-Do-List-Client
7c8490fd246819c7943f08fae5906163c5268137
0759365e20fd4cb8ba2d8e286d98dc7047f51d68
refs/heads/master
2020-12-14T02:44:37.255179
2020-01-17T14:50:53
2020-01-17T14:50:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,569
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 home.to_do_list; import Entity.User; import com.jfoenix.controls.JFXButton; import home.Notifications; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.ResourceBundle; import java.util.logging.Level; import java.util.logging.Logger; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Alert; import javafx.scene.control.ListView; import javafx.scene.input.MouseEvent; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import server_request.Server; /** * FXML Controller class * * @author sara */ public class TeamMemberController implements Initializable { @FXML private ListView listViewOfTeamMember; private ToDoList todolist; @FXML private JFXButton assignTeamMemberToTask; @FXML private ListView listViewOfassignedTeamMember; List<User> teamMemberAssigned; List<Notifications> notificationsList; TaskInfo currntTask; Server server = null; /** * Initializes the controller class. */ @Override public void initialize(URL url, ResourceBundle rb) { try { server = new Server(); } catch (IOException ex) { showAleart(Alert.AlertType.ERROR, "Connection lost", "Error update List"); } currntTask = ListAdapterOfTasksList.getCurrntTask(); teamMemberAssigned = new ArrayList<User>(); todolist = ToDoListController.getTodoList(); // TODO ToDoList todolist = new ToDoList(); ArrayList<User> teamMateInToDo = null; try { teamMateInToDo = getTeamMemberInToDo(); if (teamMateInToDo != null) { for (int i = 0; i < teamMateInToDo.size(); i++) { listViewOfTeamMember.getItems().add(teamMateInToDo.get(i)); listViewOfTeamMember.setCellFactory((param) -> { return new ListAdapter(); }); } } } catch (JSONException ex) { Logger.getLogger(TaskInformationViewController.class.getName()).log(Level.SEVERE, null, ex); } try { ////// /* try { notificationsList=getNotification(); for (int i = 0; i < notificationsList.size(); i++) { if(notificationsList.get(i).getStatus()==1) { User user; String[] typrOfRequest = new String[2]; typrOfRequest[0] = "getUser"; typrOfRequest[1] = String.valueOf(notificationsList.get(i).getToUserId()); JSONObject resultOfGetUser= server.get(typrOfRequest); String userName=resultOfGetUser.getString("user name"); int id =notificationsList.get(i).getToUserId(); user =new User(); user.setUserName(userName); user.setId(id); teamMemberAssigned.add(user); listViewOfTeamMember.getItems().remove(user); } } } catch (JSONException ex) { Logger.getLogger(TeamMemberController.class.getName()).log(Level.SEVERE, null, ex); }*/ teamMemberAssigned = getTaskMemberInToDo(); } catch (JSONException ex) { Logger.getLogger(TeamMemberController.class.getName()).log(Level.SEVERE, null, ex); } if (teamMemberAssigned != null) { for (int i = 0; i < teamMemberAssigned.size(); i++) { listViewOfassignedTeamMember.getItems().add(teamMemberAssigned.get(i)); listViewOfassignedTeamMember.setCellFactory((param) -> { return new ListAdapterOfTaskMemberRequest((ListView<User>) param); }); } } ////// listViewOfTeamMember.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { // User teamMember= (User) listViewOfTeamMember.getSelectionModel().getSelectedItem(); // teamMemberAssigned.add(teamMember); } }); } /**/ private ArrayList<User> getTaskMemberInToDo() throws JSONException { String[] typrOfRequest = new String[2]; typrOfRequest[0] = "getTaskMemberInToDo"; typrOfRequest[1] = String.valueOf(currntTask.getId()); JSONObject resultOfGetTeamMember = server.get(typrOfRequest); ArrayList<User> taskMemberInfoList = null; if (resultOfGetTeamMember != null) { JSONArray jsonArrayOfTeamMeber = resultOfGetTeamMember.getJSONArray("listOfTaskMember"); taskMemberInfoList = new ArrayList<User>(); for (int i = 0; i < jsonArrayOfTeamMeber.length(); i++) { JSONObject taskMember = jsonArrayOfTeamMeber.getJSONObject(i); String username = taskMember.getString("userName"); int userId = (int) taskMember.get("id"); User TeamMember = new User(); TeamMember.setUserName(username); TeamMember.setId(userId); taskMemberInfoList.add(TeamMember); } } return taskMemberInfoList; } /**/ private ArrayList<User> getTeamMemberInToDo() throws JSONException { String[] typrOfRequest = new String[2]; typrOfRequest[0] = "getTeamMemberInToDo"; typrOfRequest[1] = String.valueOf(todolist.getId()); JSONObject resultOfGetTeamMember = server.get(typrOfRequest); ArrayList<User> teamMemberInfoList = null; if (resultOfGetTeamMember != null) { JSONArray jsonArrayOfTeamMeber = resultOfGetTeamMember.getJSONArray("listOfTeamMember"); teamMemberInfoList = new ArrayList<User>(); for (int i = 0; i < jsonArrayOfTeamMeber.length(); i++) { JSONObject teammember = jsonArrayOfTeamMeber.getJSONObject(i); String username = teammember.getString("userName"); int userId = (int) teammember.get("id"); User TeamMember = new User(); TeamMember.setUserName(username); TeamMember.setId(userId); teamMemberInfoList.add(TeamMember); } } return teamMemberInfoList; } public List<Notifications> getNotification() throws JSONException { String[] typrOfRequest = new String[2]; typrOfRequest[0] = "getnotificationInTask"; typrOfRequest[1] = String.valueOf(currntTask.getId()); Server server = null; try { server = new Server(); } catch (IOException ex) { showAleart(Alert.AlertType.ERROR, "Connection lost", "Error update List"); } JSONObject resultOfGetNotifications = server.get(typrOfRequest); ArrayList<Notifications> listOfnotification = null; if (resultOfGetNotifications != null) { JSONArray jsonArrayOfNotification = resultOfGetNotifications.getJSONArray("listOfNotifications"); listOfnotification = new ArrayList<Notifications>(); for (int i = 0; i < jsonArrayOfNotification.length(); i++) { JSONObject notifications = jsonArrayOfNotification.getJSONObject(i); int id = notifications.getInt("id"); int fromUserId = notifications.getInt("fromUserId"); int toUserId = notifications.getInt("toUserId"); int type = notifications.getInt("type"); int status = notifications.getInt("status"); Notifications notification = new Notifications(); notification.setId(id); notification.setFromUserId(fromUserId); notification.setToUserId(toUserId); notification.setStatus(status); notification.setType(type); listOfnotification.add(notification); } } return listOfnotification; } private void showAleart(Alert.AlertType type, String title, String content) { Alert alert = new Alert(type); alert.setTitle(title); alert.setContentText(content); alert.showAndWait(); } @FXML private void assignTeamMembertoTask(ActionEvent event) throws JSONException { JSONObject notificationDataJsonObject = ListAdapter.getNotificationObjectAsJson(); sendNotificationToDataBase(notificationDataJsonObject); for (int i = 0; i < teamMemberAssigned.size(); i++) { listViewOfTeamMember.getItems().remove(teamMemberAssigned.get(i)); // listViewOfassignedTeamMember.getItems().add(teamMemberAssigned.get(i)); } teamMemberAssigned = new ArrayList<User>(); } public void sendNotificationToDataBase(JSONObject notificationDataJsonObject) { Server server; try { server = new Server(); server.post(new String[]{"Assignnotification"}, notificationDataJsonObject); } catch (IOException ex) { showAleart(Alert.AlertType.ERROR, "Connection lost", "Error update List"); } } }
[ "sarazedan287@gmail.com" ]
sarazedan287@gmail.com
c75567c83f5699bb2741f16b06adcd28bae63942
b3cdb19683d20a83c41d620bad8b78b79251a52f
/src/main/java/zw/co/econet/smsgateway/services/rest/SmsResponse.java
99f475855a7d7395671e38e287ff15658d5e1601
[]
no_license
longveeshaw/smsgateway
8f48672f27de33fcea088b4da5f41070ccd6390e
0308c08a4e555879937bc691d0a0dd74b654d3b4
refs/heads/master
2020-09-08T20:05:35.995409
2017-04-22T18:08:02
2017-04-22T18:08:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
297
java
package zw.co.econet.smsgateway.services.rest; import lombok.Data; import javax.xml.bind.annotation.XmlRootElement; import java.util.List; @Data @XmlRootElement public class SmsResponse { private List<OutboundResponse> outboundResponses; private List<InboundRequest> inboundRequests; }
[ "batsie200@gmail.com" ]
batsie200@gmail.com
9e7ab73ab4084b1ff50ed10ed7124899ac9a25b5
c47bd9de64db3645f9415323b202306c50ad8cf5
/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/command/hive/CommandUtil.java
2d2dcb5a2eb281a02189213244d7aecaa5c2982d
[ "Apache-2.0", "MIT", "BSD-3-Clause", "BSD-2-Clause" ]
permissive
scharanjit/sentry-kerberos-demo
6dca2285b133ab3bae4e90ba3c5cc47118d7630c
7e9921a8afe151c16c7e7779a169b656fd3bd739
refs/heads/master
2022-10-24T01:20:41.502173
2016-06-24T08:11:31
2016-06-24T08:11:31
61,621,595
0
0
Apache-2.0
2022-10-12T19:49:31
2016-06-21T09:40:29
Java
UTF-8
Java
false
false
6,123
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.sentry.provider.db.tools.command.hive; import org.apache.commons.lang.StringUtils; import org.apache.sentry.core.common.utils.SentryConstants; import org.apache.sentry.core.common.utils.KeyValue; import org.apache.sentry.core.common.utils.PolicyFileConstants; import org.apache.sentry.provider.db.service.thrift.TSentryGrantOption; import org.apache.sentry.provider.db.service.thrift.TSentryPrivilege; import org.apache.sentry.service.thrift.ServiceConstants; public final class CommandUtil { public static final String SPLIT_CHAR = ","; private CommandUtil() { // Make constructor private to avoid instantiation } // parse the privilege in String and get the TSentryPrivilege as result public static TSentryPrivilege convertToTSentryPrivilege(String privilegeStr) throws Exception { TSentryPrivilege tSentryPrivilege = new TSentryPrivilege(); for (String authorizable : SentryConstants.AUTHORIZABLE_SPLITTER.split(privilegeStr)) { KeyValue tempKV = new KeyValue(authorizable); String key = tempKV.getKey(); String value = tempKV.getValue(); if (PolicyFileConstants.PRIVILEGE_SERVER_NAME.equalsIgnoreCase(key)) { tSentryPrivilege.setServerName(value); } else if (PolicyFileConstants.PRIVILEGE_DATABASE_NAME.equalsIgnoreCase(key)) { tSentryPrivilege.setDbName(value); } else if (PolicyFileConstants.PRIVILEGE_TABLE_NAME.equalsIgnoreCase(key)) { tSentryPrivilege.setTableName(value); } else if (PolicyFileConstants.PRIVILEGE_COLUMN_NAME.equalsIgnoreCase(key)) { tSentryPrivilege.setColumnName(value); } else if (PolicyFileConstants.PRIVILEGE_URI_NAME.equalsIgnoreCase(key)) { tSentryPrivilege.setURI(value); } else if (PolicyFileConstants.PRIVILEGE_ACTION_NAME.equalsIgnoreCase(key)) { tSentryPrivilege.setAction(value); } else if (PolicyFileConstants.PRIVILEGE_GRANT_OPTION_NAME.equalsIgnoreCase(key)) { TSentryGrantOption grantOption = "true".equalsIgnoreCase(value) ? TSentryGrantOption.TRUE : TSentryGrantOption.FALSE; tSentryPrivilege.setGrantOption(grantOption); } } tSentryPrivilege.setPrivilegeScope(getPrivilegeScope(tSentryPrivilege)); validatePrivilegeHierarchy(tSentryPrivilege); return tSentryPrivilege; } // for the different hierarchy for hive: // 1: server->url // 2: server->database->table->column // if both of them are found in the privilege string, the privilege scope will be set as // PrivilegeScope.URI private static String getPrivilegeScope(TSentryPrivilege tSentryPrivilege) { ServiceConstants.PrivilegeScope privilegeScope = ServiceConstants.PrivilegeScope.SERVER; if (!StringUtils.isEmpty(tSentryPrivilege.getURI())) { privilegeScope = ServiceConstants.PrivilegeScope.URI; } else if (!StringUtils.isEmpty(tSentryPrivilege.getColumnName())) { privilegeScope = ServiceConstants.PrivilegeScope.COLUMN; } else if (!StringUtils.isEmpty(tSentryPrivilege.getTableName())) { privilegeScope = ServiceConstants.PrivilegeScope.TABLE; } else if (!StringUtils.isEmpty(tSentryPrivilege.getDbName())) { privilegeScope = ServiceConstants.PrivilegeScope.DATABASE; } return privilegeScope.toString(); } // check the privilege value for the specific privilege scope // eg, for the table scope, server and database can't be empty private static void validatePrivilegeHierarchy(TSentryPrivilege tSentryPrivilege) throws Exception { String serverName = tSentryPrivilege.getServerName(); String dbName = tSentryPrivilege.getDbName(); String tableName = tSentryPrivilege.getTableName(); String columnName = tSentryPrivilege.getColumnName(); String uri = tSentryPrivilege.getURI(); if (ServiceConstants.PrivilegeScope.SERVER.toString().equals(tSentryPrivilege.getPrivilegeScope())) { if (StringUtils.isEmpty(serverName)) { throw new IllegalArgumentException("The hierarchy of privilege is not correct."); } } else if (ServiceConstants.PrivilegeScope.URI.toString().equals(tSentryPrivilege.getPrivilegeScope())) { if (StringUtils.isEmpty(serverName) || StringUtils.isEmpty(uri)) { throw new IllegalArgumentException("The hierarchy of privilege is not correct."); } } else if (ServiceConstants.PrivilegeScope.DATABASE.toString().equals(tSentryPrivilege.getPrivilegeScope())) { if (StringUtils.isEmpty(serverName) || StringUtils.isEmpty(dbName)) { throw new IllegalArgumentException("The hierarchy of privilege is not correct."); } } else if (ServiceConstants.PrivilegeScope.TABLE.toString().equals(tSentryPrivilege.getPrivilegeScope())) { if (StringUtils.isEmpty(serverName) || StringUtils.isEmpty(dbName) || StringUtils.isEmpty(tableName)) { throw new IllegalArgumentException("The hierarchy of privilege is not correct."); } } else if (ServiceConstants.PrivilegeScope.COLUMN.toString().equals(tSentryPrivilege.getPrivilegeScope()) && (StringUtils.isEmpty(serverName) || StringUtils.isEmpty(dbName) || StringUtils.isEmpty(tableName) || StringUtils.isEmpty(columnName))) { throw new IllegalArgumentException("The hierarchy of privilege is not correct."); } } }
[ "charanjit.singh@imaginea.com" ]
charanjit.singh@imaginea.com
9a37176aa339b488dd538d18fd4ecc34b0368692
b53b243e395400a652be3c9cb9b16b52aaa6c093
/src/main/java/dolar/services/ScrapDolar.java
a822c7462940ff38f515e8591cad3bb8740c6f06
[]
no_license
hanspoo/dobs-back
6b88f9a932b280460732e1c6b6b1850b271d077a
6c070036022661855c3c940d68a005d514582269
refs/heads/master
2021-08-28T12:54:34.242985
2020-02-23T12:11:35
2020-02-23T12:11:35
242,511,003
0
0
null
2021-08-23T21:19:05
2020-02-23T12:16:00
HTML
UTF-8
Java
false
false
166
java
package dolar.services; import java.time.LocalDate; import java.util.Map; public interface ScrapDolar { Map<LocalDate, Double> recuperarDatos(Integer desde); }
[ "hans@welinux.cl" ]
hans@welinux.cl
671c22fed102c7a227521013cf5dbed057394b36
85da76f1a7046483c58816b81a68ad92f2dfd655
/mavenribbon/src/main/java/com/example/mavenribbon/HelloService.java
a5d23c09a0a297f4bffb2071c90df59978e94276
[]
no_license
yemaommm/springCloudDemo
c20060ed8fccc6bc7f72ebed6585072a5d27cdb4
2b6806cb7dbbcdf7489f20d29979fa4424b594aa
refs/heads/master
2021-05-05T13:33:06.828094
2017-10-24T03:28:39
2017-10-24T03:28:39
104,996,737
0
0
null
null
null
null
UTF-8
Java
false
false
637
java
package com.example.mavenribbon; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; import javax.annotation.Resource; @Service public class HelloService { @Resource(name = "restTemplate") RestTemplate rt; public String hiService(String name){ return rt.getForObject("http://SERVICE-HI/hi?name="+name,String.class); // return rt.getForObject("http://127.0.0.1:8762/hi?name="+name,String.class); // return rt.getForEntity("http://SERVICE-HI/hi?name="+name,String.class).getBody(); } }
[ "46729977@qq.com" ]
46729977@qq.com
9ba677c2f5982b5dc04eda51e1981783a864a598
41d7fa3e678199e09a8f67949820d37690d94b48
/ocraft-s2client-protocol/src/main/java/com/github/ocraft/s2client/protocol/unit/Unit.java
70f01c0164efd880457528c17fb42b436ebef92a
[ "MIT" ]
permissive
JasperGeurtz/ocraft-s2client
c9ce32be61da46e07a1ca311170ea4e2153b5b06
868a86228129619d09431bef47a29b0d40c6fc78
refs/heads/master
2020-03-31T21:30:57.521428
2018-10-11T13:26:24
2018-10-11T13:26:24
152,583,548
0
0
MIT
2018-10-11T11:52:11
2018-10-11T11:52:11
null
UTF-8
Java
false
false
20,183
java
package com.github.ocraft.s2client.protocol.unit; /*- * #%L * ocraft-s2client-protocol * %% * Copyright (C) 2017 - 2018 Ocraft Project * %% * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * #L% */ import SC2APIProtocol.Raw; import com.github.ocraft.s2client.protocol.GeneralizableAbility; import com.github.ocraft.s2client.protocol.Strings; import com.github.ocraft.s2client.protocol.data.*; import com.github.ocraft.s2client.protocol.spatial.Point; import java.io.Serializable; import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.function.UnaryOperator; import static com.github.ocraft.s2client.protocol.Constants.nothing; import static com.github.ocraft.s2client.protocol.DataExtractor.tryGet; import static com.github.ocraft.s2client.protocol.Errors.required; import static com.github.ocraft.s2client.protocol.Preconditions.require; import static java.util.stream.Collectors.*; public final class Unit implements Serializable, GeneralizableAbility<Unit> { private static final long serialVersionUID = 7550391852510629664L; private static final Boolean DEFAULT_ON_SCREEN = false; private static final Boolean DEFAULT_BLIP = false; private final DisplayType displayType; private final Alliance alliance; private final Tag tag; private final UnitType type; private final int owner; private final Point position; private final float facing; private final float radius; private final float buildProgress; // Range: [0.0, 1.0] private final CloakState cloakState; private final Float detectRange; private final Float radarRange; private final Boolean selected; private final boolean onScreen; // Visible and within the camera frustrum. private final boolean blip; // Detected by sensor tower private final Boolean powered; // Not populated for snapshots private final Float health; private final Float healthMax; private final Float shield; private final Float shieldMax; private final Float energy; private final Float energyMax; private final Integer mineralContents; private final Integer vespeneContents; private final Boolean flying; private final Boolean burrowed; // Not populated for enemies private final List<UnitOrder> orders; private final Tag addOnTag; private final List<PassengerUnit> passengers; private final Integer cargoSpaceTaken; private final Integer cargoSpaceMax; private final Set<Buff> buffs; private final Integer assignedHarvesters; private final Integer idealHarvesters; private final Float weaponCooldown; private final Tag engagedTargetTag; private Unit(Raw.Unit sc2ApiUnit) { displayType = tryGet(Raw.Unit::getDisplayType, Raw.Unit::hasDisplayType) .apply(sc2ApiUnit).map(DisplayType::from).orElseThrow(required("display type")); alliance = tryGet(Raw.Unit::getAlliance, Raw.Unit::hasAlliance) .apply(sc2ApiUnit).map(Alliance::from).orElseThrow(required("alliance")); tag = tryGet(Raw.Unit::getTag, Raw.Unit::hasTag).apply(sc2ApiUnit).map(Tag::from).orElseThrow(required("tag")); type = tryGet(Raw.Unit::getUnitType, Raw.Unit::hasUnitType) .apply(sc2ApiUnit).map(Units::from).orElseThrow(required("unit type")); owner = tryGet(Raw.Unit::getOwner, Raw.Unit::hasOwner).apply(sc2ApiUnit).orElseThrow(required("owner")); position = tryGet(Raw.Unit::getPos, Raw.Unit::hasPos) .apply(sc2ApiUnit).map(Point::from).orElseThrow(required("position")); facing = tryGet(Raw.Unit::getFacing, Raw.Unit::hasFacing).apply(sc2ApiUnit).orElseThrow(required("facing")); radius = tryGet(Raw.Unit::getRadius, Raw.Unit::hasRadius).apply(sc2ApiUnit).orElseThrow(required("radius")); buildProgress = tryGet(Raw.Unit::getBuildProgress, Raw.Unit::hasBuildProgress) .apply(sc2ApiUnit).orElseThrow(required("build progress")); cloakState = tryGet(Raw.Unit::getCloak, Raw.Unit::hasCloak) .apply(sc2ApiUnit).map(CloakState::from).orElse(nothing()); detectRange = tryGet(Raw.Unit::getDetectRange, Raw.Unit::hasDetectRange).apply(sc2ApiUnit).orElse(nothing()); radarRange = tryGet(Raw.Unit::getRadarRange, Raw.Unit::hasRadarRange).apply(sc2ApiUnit).orElse(nothing()); selected = tryGet(Raw.Unit::getIsSelected, Raw.Unit::hasIsSelected).apply(sc2ApiUnit).orElse(nothing()); onScreen = tryGet(Raw.Unit::getIsOnScreen, Raw.Unit::hasIsOnScreen).apply(sc2ApiUnit).orElse(DEFAULT_ON_SCREEN); blip = tryGet(Raw.Unit::getIsBlip, Raw.Unit::hasIsBlip).apply(sc2ApiUnit).orElse(DEFAULT_BLIP); powered = tryGet(Raw.Unit::getIsPowered, Raw.Unit::hasIsPowered).apply(sc2ApiUnit).orElse(nothing()); health = tryGet(Raw.Unit::getHealth, Raw.Unit::hasHealth).apply(sc2ApiUnit).orElse(nothing()); healthMax = tryGet(Raw.Unit::getHealthMax, Raw.Unit::hasHealthMax).apply(sc2ApiUnit).orElse(nothing()); shield = tryGet(Raw.Unit::getShield, Raw.Unit::hasShield).apply(sc2ApiUnit).orElse(nothing()); shieldMax = tryGet(Raw.Unit::getShieldMax, Raw.Unit::hasShieldMax).apply(sc2ApiUnit).orElse(nothing()); energy = tryGet(Raw.Unit::getEnergy, Raw.Unit::hasEnergy).apply(sc2ApiUnit).orElse(nothing()); energyMax = tryGet(Raw.Unit::getEnergyMax, Raw.Unit::hasEnergyMax).apply(sc2ApiUnit).orElse(nothing()); mineralContents = tryGet(Raw.Unit::getMineralContents, Raw.Unit::hasMineralContents) .apply(sc2ApiUnit).orElse(nothing()); vespeneContents = tryGet(Raw.Unit::getVespeneContents, Raw.Unit::hasVespeneContents) .apply(sc2ApiUnit).orElse(nothing()); flying = tryGet(Raw.Unit::getIsFlying, Raw.Unit::hasIsFlying).apply(sc2ApiUnit).orElse(nothing()); burrowed = tryGet(Raw.Unit::getIsBurrowed, Raw.Unit::hasIsBurrowed).apply(sc2ApiUnit).orElse(nothing()); orders = sc2ApiUnit.getOrdersList().stream().map(UnitOrder::from) .collect(collectingAndThen(toList(), Collections::unmodifiableList)); addOnTag = tryGet(Raw.Unit::getAddOnTag, Raw.Unit::hasAddOnTag) .apply(sc2ApiUnit).map(Tag::from).orElse(nothing()); passengers = sc2ApiUnit.getPassengersList().stream().map(PassengerUnit::from) .collect(collectingAndThen(toList(), Collections::unmodifiableList)); cargoSpaceTaken = tryGet(Raw.Unit::getCargoSpaceTaken, Raw.Unit::hasCargoSpaceTaken) .apply(sc2ApiUnit).orElse(nothing()); cargoSpaceMax = tryGet(Raw.Unit::getCargoSpaceMax, Raw.Unit::hasCargoSpaceMax) .apply(sc2ApiUnit).orElse(nothing()); buffs = sc2ApiUnit.getBuffIdsList().stream().map(Buffs::from) .collect(collectingAndThen(toSet(), Collections::unmodifiableSet)); assignedHarvesters = tryGet(Raw.Unit::getAssignedHarvesters, Raw.Unit::hasAssignedHarvesters) .apply(sc2ApiUnit).orElse(nothing()); idealHarvesters = tryGet(Raw.Unit::getIdealHarvesters, Raw.Unit::hasIdealHarvesters) .apply(sc2ApiUnit).orElse(nothing()); weaponCooldown = tryGet(Raw.Unit::getWeaponCooldown, Raw.Unit::hasWeaponCooldown) .apply(sc2ApiUnit).orElse(nothing()); engagedTargetTag = tryGet(Raw.Unit::getEngagedTargetTag, Raw.Unit::hasEngagedTargetTag) .apply(sc2ApiUnit).map(Tag::from).orElse(nothing()); } private Unit(Unit original, UnaryOperator<Ability> generalize) { this.displayType = original.displayType; this.alliance = original.alliance; this.tag = original.tag; this.type = original.type; this.owner = original.owner; this.position = original.position; this.facing = original.facing; this.radius = original.radius; this.buildProgress = original.buildProgress; this.cloakState = original.cloakState; this.detectRange = original.detectRange; this.radarRange = original.radarRange; this.selected = original.selected; this.onScreen = original.onScreen; this.blip = original.blip; this.powered = original.powered; this.health = original.health; this.healthMax = original.healthMax; this.shield = original.shield; this.shieldMax = original.shieldMax; this.energy = original.energy; this.energyMax = original.energyMax; this.mineralContents = original.mineralContents; this.vespeneContents = original.vespeneContents; this.flying = original.flying; this.burrowed = original.burrowed; this.orders = original.orders.stream() .map(order -> order.generalizeAbility(generalize)) .collect(collectingAndThen(toList(), Collections::unmodifiableList)); this.addOnTag = original.addOnTag; this.passengers = original.passengers; this.cargoSpaceTaken = original.cargoSpaceTaken; this.cargoSpaceMax = original.cargoSpaceMax; this.buffs = original.buffs; this.assignedHarvesters = original.assignedHarvesters; this.idealHarvesters = original.idealHarvesters; this.weaponCooldown = original.weaponCooldown; this.engagedTargetTag = original.engagedTargetTag; } public static Unit from(Raw.Unit sc2ApiUnit) { require("sc2api unit", sc2ApiUnit); return new Unit(sc2ApiUnit); } public DisplayType getDisplayType() { return displayType; } public Alliance getAlliance() { return alliance; } public Tag getTag() { return tag; } public UnitType getType() { return type; } public int getOwner() { return owner; } public Point getPosition() { return position; } public float getFacing() { return facing; } public float getRadius() { return radius; } public float getBuildProgress() { return buildProgress; } public Optional<CloakState> getCloakState() { return Optional.ofNullable(cloakState); } public Optional<Float> getDetectRange() { return Optional.ofNullable(detectRange); } public Optional<Float> getRadarRange() { return Optional.ofNullable(radarRange); } public Optional<Boolean> getSelected() { return Optional.ofNullable(selected); } public boolean isOnScreen() { return onScreen; } public boolean isBlip() { return blip; } public Optional<Boolean> getPowered() { return Optional.ofNullable(powered); } public Optional<Float> getHealth() { return Optional.ofNullable(health); } public Optional<Float> getHealthMax() { return Optional.ofNullable(healthMax); } public Optional<Float> getShield() { return Optional.ofNullable(shield); } public Optional<Float> getShieldMax() { return Optional.ofNullable(shieldMax); } public Optional<Float> getEnergy() { return Optional.ofNullable(energy); } public Optional<Float> getEnergyMax() { return Optional.ofNullable(energyMax); } public Optional<Integer> getMineralContents() { return Optional.ofNullable(mineralContents); } public Optional<Integer> getVespeneContents() { return Optional.ofNullable(vespeneContents); } public Optional<Boolean> getFlying() { return Optional.ofNullable(flying); } public Optional<Boolean> getBurrowed() { return Optional.ofNullable(burrowed); } public List<UnitOrder> getOrders() { return orders; } public Optional<Tag> getAddOnTag() { return Optional.ofNullable(addOnTag); } public List<PassengerUnit> getPassengers() { return passengers; } public Optional<Integer> getCargoSpaceTaken() { return Optional.ofNullable(cargoSpaceTaken); } public Optional<Integer> getCargoSpaceMax() { return Optional.ofNullable(cargoSpaceMax); } public Set<Buff> getBuffs() { return buffs; } public Optional<Integer> getAssignedHarvesters() { return Optional.ofNullable(assignedHarvesters); } public Optional<Integer> getIdealHarvesters() { return Optional.ofNullable(idealHarvesters); } public Optional<Float> getWeaponCooldown() { return Optional.ofNullable(weaponCooldown); } public Optional<Tag> getEngagedTargetTag() { return Optional.ofNullable(engagedTargetTag); } @Override public Unit generalizeAbility(UnaryOperator<Ability> generalize) { return new Unit(this, generalize); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Unit unit = (Unit) o; return owner == unit.owner && Float.compare(unit.facing, facing) == 0 && Float.compare(unit.radius, radius) == 0 && Float.compare(unit.buildProgress, buildProgress) == 0 && onScreen == unit.onScreen && blip == unit.blip && displayType == unit.displayType && alliance == unit.alliance && tag.equals(unit.tag) && type == unit.type && position.equals(unit.position) && cloakState == unit.cloakState && (detectRange != null ? detectRange.equals(unit.detectRange) : unit.detectRange == null) && (radarRange != null ? radarRange.equals(unit.radarRange) : unit.radarRange == null) && (selected != null ? selected.equals(unit.selected) : unit.selected == null) && (powered != null ? powered.equals(unit.powered) : unit.powered == null) && (health != null ? health.equals(unit.health) : unit.health == null) && (healthMax != null ? healthMax.equals(unit.healthMax) : unit.healthMax == null) && (shield != null ? shield.equals(unit.shield) : unit.shield == null) && (shieldMax != null ? shieldMax.equals(unit.shieldMax) : unit.shieldMax == null) && (energy != null ? energy.equals(unit.energy) : unit.energy == null) && (energyMax != null ? energyMax.equals(unit.energyMax) : unit.energyMax == null) && (mineralContents != null ? mineralContents.equals(unit.mineralContents) : unit.mineralContents == null) && (vespeneContents != null ? vespeneContents.equals(unit.vespeneContents) : unit.vespeneContents == null) && (flying != null ? flying.equals(unit.flying) : unit.flying == null) && (burrowed != null ? burrowed.equals(unit.burrowed) : unit.burrowed == null) && orders.equals(unit.orders) && (addOnTag != null ? addOnTag.equals(unit.addOnTag) : unit.addOnTag == null) && passengers.equals(unit.passengers) && (cargoSpaceTaken != null ? cargoSpaceTaken.equals(unit.cargoSpaceTaken) : unit.cargoSpaceTaken == null) && (cargoSpaceMax != null ? cargoSpaceMax.equals(unit.cargoSpaceMax) : unit.cargoSpaceMax == null) && buffs.equals(unit.buffs) && (assignedHarvesters != null ? assignedHarvesters.equals(unit.assignedHarvesters) : unit.assignedHarvesters == null) && (idealHarvesters != null ? idealHarvesters.equals(unit.idealHarvesters) : unit.idealHarvesters == null) && (weaponCooldown != null ? weaponCooldown.equals(unit.weaponCooldown) : unit.weaponCooldown == null) && (engagedTargetTag != null ? engagedTargetTag.equals(unit.engagedTargetTag) : unit.engagedTargetTag == null); } @Override public int hashCode() { int result = displayType.hashCode(); result = 31 * result + alliance.hashCode(); result = 31 * result + tag.hashCode(); result = 31 * result + type.hashCode(); result = 31 * result + owner; result = 31 * result + position.hashCode(); result = 31 * result + (facing != +0.0f ? Float.floatToIntBits(facing) : 0); result = 31 * result + (radius != +0.0f ? Float.floatToIntBits(radius) : 0); result = 31 * result + (buildProgress != +0.0f ? Float.floatToIntBits(buildProgress) : 0); result = 31 * result + (cloakState != null ? cloakState.hashCode() : 0); result = 31 * result + (detectRange != null ? detectRange.hashCode() : 0); result = 31 * result + (radarRange != null ? radarRange.hashCode() : 0); result = 31 * result + (selected != null ? selected.hashCode() : 0); result = 31 * result + (onScreen ? 1 : 0); result = 31 * result + (blip ? 1 : 0); result = 31 * result + (powered != null ? powered.hashCode() : 0); result = 31 * result + (health != null ? health.hashCode() : 0); result = 31 * result + (healthMax != null ? healthMax.hashCode() : 0); result = 31 * result + (shield != null ? shield.hashCode() : 0); result = 31 * result + (shieldMax != null ? shieldMax.hashCode() : 0); result = 31 * result + (energy != null ? energy.hashCode() : 0); result = 31 * result + (energyMax != null ? energyMax.hashCode() : 0); result = 31 * result + (mineralContents != null ? mineralContents.hashCode() : 0); result = 31 * result + (vespeneContents != null ? vespeneContents.hashCode() : 0); result = 31 * result + (flying != null ? flying.hashCode() : 0); result = 31 * result + (burrowed != null ? burrowed.hashCode() : 0); result = 31 * result + orders.hashCode(); result = 31 * result + (addOnTag != null ? addOnTag.hashCode() : 0); result = 31 * result + passengers.hashCode(); result = 31 * result + (cargoSpaceTaken != null ? cargoSpaceTaken.hashCode() : 0); result = 31 * result + (cargoSpaceMax != null ? cargoSpaceMax.hashCode() : 0); result = 31 * result + buffs.hashCode(); result = 31 * result + (assignedHarvesters != null ? assignedHarvesters.hashCode() : 0); result = 31 * result + (idealHarvesters != null ? idealHarvesters.hashCode() : 0); result = 31 * result + (weaponCooldown != null ? weaponCooldown.hashCode() : 0); result = 31 * result + (engagedTargetTag != null ? engagedTargetTag.hashCode() : 0); return result; } @Override public String toString() { return Strings.toJson(this); } }
[ "ocraftproject@gmail.com" ]
ocraftproject@gmail.com
b42f469a0c16ec36b19fac88390143d5d6d4e3f3
208b2ec8ec2616f5b6c64cbe43d4cf8d7c2198ce
/AuthorKonoplyanikAS/src/by/training/epam/bean/OrderStore.java
48335b5f550acf2e6f81d0f369080b06d2ba1cf0
[]
no_license
artsemy/AuthorKonoplyanikAS
93ba573eb5e074151dedeb4d60261aa37c7e00ba
aeabe4ba406dd67ecc456366a863cafad3bb7c1e
refs/heads/master
2021-04-03T00:34:52.416877
2020-09-14T12:21:19
2020-09-14T12:21:19
248,341,582
0
0
null
null
null
null
UTF-8
Java
false
false
2,238
java
package by.training.epam.bean; import java.io.Serializable; import java.util.List; public class OrderStore implements Serializable { private static final long serialVersionUID = 1L; private int id; private Order order; private Delivery delivery; private List<DrinkStore> drinks; public OrderStore() {} public OrderStore(int id, Order order, Delivery delivery, List<DrinkStore> drinks) { this.id = id; this.order = order; this.delivery = delivery; this.drinks = drinks; } public int getId() { return id; } public void setId(int id) { this.id = id; } public Order getOrder() { return order; } public void setOrder(Order order) { this.order = order; } public Delivery getDelivery() { return delivery; } public void setDelivery(Delivery delivery) { this.delivery = delivery; } public List<DrinkStore> getDrinks() { return drinks; } public void setDrinks(List<DrinkStore> drinks) { this.drinks = drinks; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((delivery == null) ? 0 : delivery.hashCode()); result = prime * result + ((drinks == null) ? 0 : drinks.hashCode()); result = prime * result + id; result = prime * result + ((order == null) ? 0 : order.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; OrderStore other = (OrderStore) obj; if (delivery == null) { if (other.delivery != null) return false; } else if (!delivery.equals(other.delivery)) return false; if (drinks == null) { if (other.drinks != null) return false; } else if (!drinks.equals(other.drinks)) return false; if (id != other.id) return false; if (order == null) { if (other.order != null) return false; } else if (!order.equals(other.order)) return false; return true; } @Override public String toString() { return "OrderStore [id=" + id + ", order=" + order + ", delivery=" + delivery + ", drinks=" + drinks + "]"; } }
[ "artemiy.konoplyanik@gmail.com" ]
artemiy.konoplyanik@gmail.com
b3ebdeadc365266a84cdb3e90aaf333fb6b1c7c9
0e6d2b8b3dcad19817e41ad3c6f797f7884a89aa
/app/src/main/java/com/example/al/genredemo/genres/classical/classicalAdapters/ClassicalViewPagerAdapter.java
b5bfd81ffbc4689fd02ddc231da0df2ea050fd40
[]
no_license
andegwa1/GenreDemo
d536db880ee19b181f0417160c58b951dab18a4c
8f188d755624ec76638e6ad9d47a3ce6d223847e
refs/heads/master
2021-06-20T21:58:18.281181
2017-07-17T13:37:23
2017-07-17T13:37:33
97,223,472
0
0
null
null
null
null
UTF-8
Java
false
false
752
java
package com.example.al.genredemo.genres.classical.classicalAdapters; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import java.util.ArrayList; public class ClassicalViewPagerAdapter extends FragmentPagerAdapter { private ArrayList<Fragment> list; public ClassicalViewPagerAdapter(FragmentManager fm) { super(fm); } public ClassicalViewPagerAdapter(FragmentManager fm, ArrayList<Fragment> list) { super(fm); this.list = list; } @Override public Fragment getItem(int position) { return list.get(position); } @Override public int getCount() { return list.size(); } }
[ "andegwa1@student.gsu.edu" ]
andegwa1@student.gsu.edu
9788975b05b344c03312dee1fdda06f88c6d78e0
756be5a11e265763e60f01ba4f89f0f2e8f3ea4a
/thread/ThreadJoinExample1.java
3b4207cfbeeeca916bb2adf3321326412ebcd48e
[]
no_license
pradeep-kumar-1705807/Java-Practice-Programs
31f820bbba2f8c144366b155dbe5de78f37f7163
603622b9d237e389ddf1809eaa9f70296f760799
refs/heads/master
2021-05-25T08:25:52.096203
2020-04-07T09:02:11
2020-04-07T09:02:11
253,739,122
0
0
null
null
null
null
UTF-8
Java
false
false
790
java
public class ThreadJoinExample1 extends Thread { String str; ThreadJoinExample1(String s) { str=s; this.start(); } public void run() { try { for(int i=0;i<10;i++) { System.out.println("Thread :"+str+" is running"); Thread.sleep(1000); } } catch(InterruptedException e) { System.out.println("hello World "); } } public static void main(String args[]) { ThreadJoinExample1 t1=new ThreadJoinExample1("one"); ThreadJoinExample1 t2=new ThreadJoinExample1("two"); ThreadJoinExample1 t3=new ThreadJoinExample1("three"); try { System.out.println(t1.isAlive()); t1.join(); System.out.println(t1.isAlive()); t2.join(); } catch(InterruptedException e) { System.out.println("hello World 2"); } } }
[ "1705807@kiit.ac.in" ]
1705807@kiit.ac.in
3c907fafc4c167fc94321ccfecb7baa9132a45d3
9d6363313ed74869af701e032741854e5d8c7084
/src/main/java/org/fbi/hmfsjm/helper/MD5Helper.java
b40642f4f6bab8f2939563ae63d05b45ec709465
[]
no_license
liveqmock/lnkapp-hmfs-jm
a70c2534d1af66b2d065f0a4574b7880fb6813b2
fdb712f4790b1224909f4d607564608456dc601b
refs/heads/master
2022-08-18T16:41:02.616934
2014-11-28T08:17:45
2014-11-28T08:17:45
35,888,701
0
1
null
2022-07-29T07:17:17
2015-05-19T14:51:06
Java
GB18030
Java
false
false
1,589
java
package org.fbi.hmfsjm.helper; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; /** * MD5 */ public class MD5Helper { final static char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; private static MessageDigest messagedigest = null; static { try { messagedigest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { System.err.println(MD5Helper.class.getName() + "MD5初始失败!"); e.printStackTrace(); } } public static String getMD5String(String s) { return getMD5String(s.getBytes()); } public static String getMD5String(byte[] bytes) { messagedigest.update(bytes); return bufferToHex(messagedigest.digest()); } private static String bufferToHex(byte bytes[]) { return bufferToHex(bytes, 0, bytes.length); } private static String bufferToHex(byte bytes[], int m, int n) { StringBuffer stringbuffer = new StringBuffer(2 * n); int k = m + n; for (int l = m; l < k; l++) { appendHexPair(bytes[l], stringbuffer); } return stringbuffer.toString(); } private static void appendHexPair(byte bt, StringBuffer stringbuffer) { // 取字节中高 4 位的数字转换 char c0 = hexDigits[(bt & 0xf0) >> 4]; // 取字节中低 4 位的数字转换 char c1 = hexDigits[bt & 0xf]; stringbuffer.append(c0); stringbuffer.append(c1); } }
[ "izhangxiaobo@gmail.com" ]
izhangxiaobo@gmail.com
66911ceb0c1dafdb912046ba3793f8442bb51293
6f12ec0c7e5db187f0234095fc4b883d37af1b31
/AndroidCode/app/src/main/java/com/shuoyao/myapplication/RegisterActivity.java
4bc2acbf0ae4a4548741c22ab193eebd9954bb97
[]
no_license
shuoyao/catchmeup
5f56703123fd60d30b1f6316fdccc412a24844d8
a7c180b5ba4884ee34b8bbe5d6a158d5b4d9aea7
refs/heads/master
2021-01-10T03:51:46.918520
2016-09-04T17:57:17
2016-09-04T17:57:17
54,252,035
0
0
null
null
null
null
UTF-8
Java
false
false
13,554
java
package com.shuoyao.myapplication; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.annotation.TargetApi; import android.app.LoaderManager; import android.content.CursorLoader; import android.content.Intent; import android.content.Loader; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.database.Cursor; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.provider.ContactsContract; import android.support.annotation.NonNull; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.text.TextUtils; import android.view.KeyEvent; import android.view.View; import android.view.inputmethod.EditorInfo; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import com.parse.ParseException; import com.parse.ParseUser; import com.parse.SignUpCallback; import java.util.ArrayList; import java.util.List; import static android.Manifest.permission.READ_CONTACTS; /** * Activity which displays a login screen to the user. */ public class RegisterActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks<Cursor> { private String TAG = RegisterActivity.class.getSimpleName(); // TODO: Implement verify password block /** * Id to identity READ_CONTACTS permission request. */ private static final int REQUEST_READ_CONTACTS = 0; /** * Counter to determine the number of times user has tried to log in */ private static int num_login_attempts = 0; // UI references. private EditText mNameView; private AutoCompleteTextView mEmailView; private EditText mPasswordView; private EditText mPasswordView2; private View mProgressView; private View mLoginFormView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_signup); // Set up the login form. mNameView = (EditText) findViewById(R.id.register_name); mEmailView = (AutoCompleteTextView) findViewById(R.id.register_email); Intent i = getIntent(); mEmailView.setText(i.getStringExtra(LoginActivity.EXTRA_EMAIL)); populateAutoComplete(); mPasswordView = (EditText) findViewById(R.id.register_password); mPasswordView2 = (EditText) findViewById(R.id.register_password2); mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) { if (id == R.id.login || id == EditorInfo.IME_NULL) { attemptRegistration(); return true; } return false; } }); Button mEmailRegisterButton = (Button) findViewById(R.id.email_register_button); mEmailRegisterButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { attemptRegistration(); } }); mLoginFormView = findViewById(R.id.login_form); mProgressView = findViewById(R.id.login_progress); } private void resetLoginAttempts() { SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit(); editor.putInt(LoginActivity.mLoginAttempts, 0); editor.commit(); } private int incrementLoginAttempts() { SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit(); int previous = PreferenceManager.getDefaultSharedPreferences(this).getInt(LoginActivity.mLoginAttempts, -1); editor.putInt(LoginActivity.mLoginAttempts, previous + 1); editor.commit(); return previous+1; } private void setLogin(String name, String email) { SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit(); editor.putString(LoginActivity.mName, name); editor.putString(LoginActivity.mEmail, email); editor.commit(); } private void populateAutoComplete() { if (!mayRequestContacts()) { return; } getLoaderManager().initLoader(0, null, this); } private boolean mayRequestContacts() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { return true; } if (checkSelfPermission(READ_CONTACTS) == PackageManager.PERMISSION_GRANTED) { return true; } if (shouldShowRequestPermissionRationale(READ_CONTACTS)) { Snackbar.make(mEmailView, R.string.permission_rationale, Snackbar.LENGTH_INDEFINITE) .setAction(android.R.string.ok, new View.OnClickListener() { @Override @TargetApi(Build.VERSION_CODES.M) public void onClick(View v) { requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS); } }); } else { requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS); } return false; } /** * Callback received when a permissions request has been completed. */ @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == REQUEST_READ_CONTACTS) { if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { populateAutoComplete(); } } } /** * Attempts to sign in or register the account specified by the login form. * If there are form errors (invalid email, missing fields, etc.), the * errors are presented and no actual login attempt is made. */ private void attemptRegistration() { // Reset errors. mNameView.setError(null); mEmailView.setError(null); mPasswordView.setError(null); mPasswordView2.setError(null); // Store values at the time of the registration attempt. //!!!!!!!!!!!turn everything to lower case and put in user table String name = mNameView.getText().toString().toLowerCase(); String email = mEmailView.getText().toString().toLowerCase(); String password = mPasswordView.getText().toString(); String password2 = mPasswordView2.getText().toString(); boolean cancel = false; View focusView = null; // Check for a valid password, if the user entered one. if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) { mPasswordView.setError(getString(R.string.error_invalid_password)); focusView = mPasswordView; cancel = true; } if (!password.equals(password2)) { mPasswordView.setError("Password does not match"); focusView = mPasswordView; cancel = true; } // Check for a valid email address. if (TextUtils.isEmpty(email)) { mEmailView.setError(getString(R.string.error_field_required)); focusView = mEmailView; cancel = true; } else if (!isEmailValid(email)) { mEmailView.setError(getString(R.string.error_invalid_email)); focusView = mEmailView; cancel = true; } if (cancel) { // There was an error; don't attempt login and focus the first // form field with an error. focusView.requestFocus(); } else { // Show a progress spinner, and kick off a background task to // perform the user login attempt. showProgress(true); ParseUser user = new ParseUser(); user.setUsername(email); user.setPassword(password); user.setEmail(email); user.put("name", name); user.signUpInBackground(new SignUpCallback() { public void done(ParseException e) { if (e == null) { showProgress(false); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); SharedPreferences.Editor sharedPreferencesEditor = sharedPreferences.edit(); sharedPreferencesEditor.putString("defaultFrequency", "30"); ParseUser.getCurrentUser().put("defaultFrequency", "30"); sharedPreferencesEditor.commit(); goHome(); } else { showProgress(false); mEmailView.setError(getString(R.string.error_user_exists)); mEmailView.requestFocus(); } } }); } } private void goHome() { Intent i = new Intent(this, MainActivity.class); startActivity(i); finish(); } private boolean isEmailValid(String email) { //TODO: Replace this with your own logic - changed to must contain @, . and index of . > index of @ return email.contains("@") && email.contains(".") && email.lastIndexOf(".") > email.lastIndexOf("@"); } private boolean isPasswordValid(String password) { //TODO: Replace this with your own logic return password.length() > 4; } /** * Shows the progress UI and hides the login form. */ @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) private void showProgress(final boolean show) { // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow // for very easy animations. If available, use these APIs to fade-in // the progress spinner. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime); mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); mLoginFormView.animate().setDuration(shortAnimTime).alpha( show ? 0 : 1).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); } }); mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); mProgressView.animate().setDuration(shortAnimTime).alpha( show ? 1 : 0).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); } }); } else { // The ViewPropertyAnimator APIs are not available, so simply show // and hide the relevant UI components. mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); } } @Override public Loader<Cursor> onCreateLoader(int i, Bundle bundle) { return new CursorLoader(this, // Retrieve data rows for the device user's 'profile' contact. Uri.withAppendedPath(ContactsContract.Profile.CONTENT_URI, ContactsContract.Contacts.Data.CONTENT_DIRECTORY), ProfileQuery.PROJECTION, // Select only email addresses. ContactsContract.Contacts.Data.MIMETYPE + " = ?", new String[]{ContactsContract.CommonDataKinds.Email .CONTENT_ITEM_TYPE}, // Show primary email addresses first. Note that there won't be // a primary email address if the user hasn't specified one. ContactsContract.Contacts.Data.IS_PRIMARY + " DESC"); } @Override public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) { List<String> emails = new ArrayList<>(); cursor.moveToFirst(); while (!cursor.isAfterLast()) { emails.add(cursor.getString(ProfileQuery.ADDRESS)); cursor.moveToNext(); } addEmailsToAutoComplete(emails); } @Override public void onLoaderReset(Loader<Cursor> cursorLoader) { } private interface ProfileQuery { String[] PROJECTION = { ContactsContract.CommonDataKinds.Email.ADDRESS, ContactsContract.CommonDataKinds.Email.IS_PRIMARY, }; int ADDRESS = 0; int IS_PRIMARY = 1; } private void addEmailsToAutoComplete(List<String> emailAddressCollection) { //Create adapter to tell the AutoCompleteTextView what to show in its dropdown list. ArrayAdapter<String> adapter = new ArrayAdapter<>(RegisterActivity.this, android.R.layout.simple_dropdown_item_1line, emailAddressCollection); mEmailView.setAdapter(adapter); } }
[ "shuoyao@berkeley.edu" ]
shuoyao@berkeley.edu