blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
ffe33c74ab9ccf66f7a1f6dba8c8d3668d1a3b8a
c8e5f82ea3f650acec8430b1d9cabd05c73dc34c
/src/de/pk/control/spiel/phasen/ExplorationsPhase.java
cb0e734a95cfddac7f4ee7c308a144207c1388c7
[]
no_license
SloopsaiC/Prog2PK
dcaa03c7c895154b314ba0aeccf3eb4051fa84db
727264cbf32c5d851ba6b4e31dee1bbcb5f1c522
refs/heads/master
2020-05-14T10:18:09.884401
2019-06-05T21:06:55
2019-06-05T21:06:55
181,757,292
1
0
null
null
null
null
UTF-8
Java
false
false
1,142
java
package de.pk.control.spiel.phasen; import de.pk.control.app.Anwendung; import de.pk.control.spiel.Dungeon; import de.pk.control.spielbrett.spielbrettObjekte.lebendigeObjekte.Held; import de.pk.model.karte.generator.Richtung; import de.pk.model.position.KachelPosition; public class ExplorationsPhase extends Phase { @Override public void startePhaseMit(Held held) { Dungeon aktiverDungeon = Anwendung.getInstanz().getAktivesSpiel().getAktiverDungeon(); KachelPosition positionDesHelden = aktiverDungeon.getSpielbrett().findeSpielbrettObjekt(held); Richtung kantenRichtung = positionDesHelden.getKantenRichtungFallsAnKante(); // Generiere eine neue Kachel falls der Held am Rand steht if ((kantenRichtung != null) && (aktiverDungeon.getSpielbrett().getKachelBei(aktiverDungeon.getSpielbrett() .getPositionKachel(positionDesHelden.getKachel()).addiere(kantenRichtung.getVersatz())) == null)) { aktiverDungeon.generiereUndFuegeNeueKachelZuSpielbrettHinzu(kantenRichtung, aktiverDungeon.getSpielbrett().getPositionKachel(positionDesHelden.getKachel())); } super.beendePhase(); } }
[ "43387968+SloopsaiC@users.noreply.github.com" ]
43387968+SloopsaiC@users.noreply.github.com
2b7b3c45a471e98602939ceb84e0d38e968dbf01
dc16434402e482a12b93b8f2d5d68c5ae4a271f0
/rechercheDeValeur/src/rechercheDeValeur/MaxMin.java
cb9cab37b15fae219c1078e882a5dd9446b99903
[]
no_license
bankass79/applicationWebSpring
7478c6752a6b397185fb545589a5f93462487396
0dab68864eb1151f52f8a4d7fb51c5b7e26223ca
refs/heads/master
2021-01-21T05:16:43.238276
2017-02-28T14:02:54
2017-02-28T14:02:54
83,164,798
0
0
null
null
null
null
UTF-8
Java
false
false
716
java
package rechercheDeValeur; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class MaxMin { public static void main(String[] args) { ArrayList <Integer> val= new ArrayList<Integer> (); Scanner sc= new Scanner (System.in); for (int j=0; j<5; j++){ System.out.println("Saisissez les valeurs de la liste"); int value=sc.nextInt(); val.add(value); } int max=0; int min=0; for(int i=0; i<val.size(); i++){ max=Collections.max(val); min=Collections.min(val); } System.out.println("la valeur max est:"+ max+ " "+ "et la valeur minimale est:"+ min); } }
[ "amadoumguindo@yahoo.fr" ]
amadoumguindo@yahoo.fr
5f6bae4683df4142d40f25121262812719830b5f
569978dc7e2bcd8087e05d51668c16c69446557d
/src/NotifyVsNotifyAll.java
489d460893ccc2db62f2ba4f682c2bfa6fdda8be
[]
no_license
dengwenbo/StudyMultithreading
14ae636e82b501eafcd2e84ebf692813f7cee4c2
4c49a18c82084096309581d2fa1c3e3b86005d2c
refs/heads/master
2020-04-12T20:15:15.612619
2019-03-11T14:42:26
2019-03-11T14:42:26
162,730,625
0
0
null
null
null
null
GB18030
Java
false
false
2,216
java
import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; public class NotifyVsNotifyAll { public static void main(String[] args) throws Exception { ExecutorService executorService = Executors.newCachedThreadPool(); for (int i = 0; i < 5; i++) { executorService.execute(new Task2()); } executorService.execute(new Task2()); Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { boolean prod = true; @Override public void run() { if (prod) { System.out.println("notify()"); Task1.blocker.prod(); prod = false; } else { System.out.println("notifyall()"); Task1.blocker.prodAll(); prod = true; } } }, 400, 400); /*; @Override public void run(){ }*/ TimeUnit.SECONDS.sleep(5); timer.cancel(); System.out.println("timer cancled"); TimeUnit.MILLISECONDS.sleep(500); System.out.println("Task2.block2,prodAll()"); Task2.blocker.prodAll(); System.out.println("Shutting dowm"); executorService.shutdownNow(); } } class Blocker{ synchronized void WaitingCall(){ try{ while(!Thread.interrupted()){ wait(); System.out.println(Thread.currentThread()+""); } }catch(InterruptedException e){ System.out.println("第一个线程出现异常"); } } synchronized void prod(){ notify(); } synchronized void prodAll(){ notifyAll(); } } class Task2 implements Runnable{ static Blocker blocker = new Blocker(); @Override public void run() { blocker.WaitingCall(); } } class Task1 implements Runnable{ static Blocker blocker = new Blocker(); @Override public void run() { blocker.WaitingCall(); } }
[ "1204385451@qq.com" ]
1204385451@qq.com
654382910d7035441d9c3fec47b79eafbf165da9
e905d5c77b57cb66b5c164a217105500e326b2b0
/module1_tla/test/src/OOP_technique/returning_methods.java
522fd1caa7fee134f7d48534dadf7572b37cfa86
[]
no_license
rose14dava/activities_roseanndava
7612abc746c84933060f14ea56ee4520e1bca302
f383907a2cda410c2df364d5c1d8df9ecfff58a1
refs/heads/main
2023-01-07T13:30:25.222003
2020-11-04T23:47:28
2020-11-04T23:47:28
302,590,722
0
0
null
null
null
null
UTF-8
Java
false
false
877
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 OOP_technique; ;import java.util.AbstractCollection; import java.util.Scanner; import javax.swing.JOptionPane; /** * * @author hp */ public class returning_methods extends manipulated_String { public static void main(String arg[]){ System.out.print("List of array data "+""+ARY()+"\n\n"); System.out.println("The given String: "+pr); String num = JOptionPane.showInputDialog(null,"number for charAt:"); cc(num); System.out.println(""+pr()); String numb = JOptionPane.showInputDialog(null,"put String for indexOf:"); qq(numb); System.out.println(""+p()); } }
[ "noreply@github.com" ]
noreply@github.com
c47199d465533e2a9f4e80903f3b109b34cd03fb
51710fd4cb37db774d37ed10922ba066c0d7caef
/app/src/main/java/com/example/user/wordcounter/MainActivity.java
c8647680dc3820897cb48d2bed5030ccc609884f
[]
no_license
stephenedwardng/WordCount
8b504bd340e0b24c1be8974b90770d0316bd2955
8021c836ce2d50bf9c1253d712d20070baf284bf
refs/heads/master
2020-12-02T22:23:45.986679
2017-07-04T11:02:53
2017-07-04T11:02:53
96,125,789
0
0
null
null
null
null
UTF-8
Java
false
false
1,110
java
package com.example.user.wordcounter; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends AppCompatActivity { EditText sentenceEditText; Button buttonSentence; Sentence sentence; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); sentenceEditText = (EditText)findViewById(R.id.sentenceId); buttonSentence = (Button)findViewById(R.id.buttonId); } public void onButtonClicked(View button) { String phrase = sentenceEditText.getText().toString(); sentence = new Sentence(phrase); Log.d("count", sentence.prettyCountWords()); Intent intent = new Intent(this, ShowCountActivity.class); intent.putExtra("countWords", sentence.prettyCountWords()); startActivity(intent); } }
[ "stephenedwardng@outlook.com" ]
stephenedwardng@outlook.com
bedb95702be7c05530f022920c81972270e3138d
090aaa551abc2e7498f521c95393b6bf0cfc360b
/Decoration.java
b48408fc9e6ba37cceae05c81812f26d59d6f168
[]
no_license
arashjava/DecoratorPattern-CarOptions
41eedc295f57eca0d4f381995dd2f7ff1a49b453
7acca94ca241e7ea41a27500675fde764d44a4ac
refs/heads/master
2020-04-10T22:20:30.886260
2018-03-11T17:04:54
2018-03-11T17:04:54
124,299,772
0
0
null
null
null
null
UTF-8
Java
false
false
557
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 mydecoratorpattern; /** * * @author arash */ abstract class Decoration implements GeneralInt{ protected GeneralInt myCar; public Decoration(GeneralInt newCar){ myCar= newCar; } public String getOptions(){ return myCar.getOption(); } public Double getPrice(){ return myCar.getPrice(); } }
[ "shadmaniarash@gmail.com" ]
shadmaniarash@gmail.com
e06ece0b2b2931916633f7a96d201f6fe35c644e
a8a7cc6bae2a202941e504aea4356e2a959e5e95
/jenkow-activiti/modules/activiti-engine/src/main/java/org/activiti/engine/delegate/Expression.java
fb702a3232ed766f25af943d9c96dfab78e88ff1
[ "Apache-2.0" ]
permissive
jenkinsci/jenkow-plugin
aed5d5db786ad260c16cebecf5c6bbbcbf498be5
228748890476b2f17f80b618c8d474a4acf2af8b
refs/heads/master
2023-08-19T23:43:15.544100
2013-05-14T00:49:56
2013-05-14T00:49:56
4,395,961
2
4
null
2022-12-20T22:37:41
2012-05-21T16:58:26
Java
UTF-8
Java
false
false
827
java
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.activiti.engine.delegate; /** * @author Frederik Heremans */ public interface Expression { Object getValue(VariableScope variableScope); void setValue(Object value, VariableScope variableScope); String getExpressionText(); }
[ "m2spring@springdot.org" ]
m2spring@springdot.org
46f408d11c37317641b22a8d94249954e1754e1e
e977c424543422f49a25695665eb85bfc0700784
/benchmark/icse15/950980/buggy-version/mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/TransposeJob.java
9b9cf76992a8a79245800d234fd3e4bb4079194d
[]
no_license
amir9979/pattern-detector-experiment
17fcb8934cef379fb96002450d11fac62e002dd3
db67691e536e1550245e76d7d1c8dced181df496
refs/heads/master
2022-02-18T10:24:32.235975
2019-09-13T15:42:55
2019-09-13T15:42:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,214
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.mahout.math.hadoop; import org.apache.commons.cli2.Option; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.mapred.FileInputFormat; import org.apache.hadoop.mapred.FileOutputFormat; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.MapReduceBase; import org.apache.hadoop.mapred.Mapper; import org.apache.hadoop.mapred.OutputCollector; import org.apache.hadoop.mapred.Reducer; import org.apache.hadoop.mapred.Reporter; import org.apache.hadoop.mapred.SequenceFileInputFormat; import org.apache.hadoop.mapred.SequenceFileOutputFormat; import org.apache.hadoop.util.ToolRunner; import org.apache.mahout.common.AbstractJob; import org.apache.mahout.math.RandomAccessSparseVector; import org.apache.mahout.math.SequentialAccessSparseVector; import org.apache.mahout.math.Vector; import org.apache.mahout.math.VectorWritable; import java.io.IOException; import java.util.Iterator; import java.util.Map; /** * TODO: rewrite to use helpful combiner. */ public class TransposeJob extends AbstractJob { public static final String NUM_ROWS_KEY = "SparseRowMatrix.numRows"; public static void main(String[] args) throws Exception { ToolRunner.run(new TransposeJob(), args); } @Override public int run(String[] strings) throws Exception { Option numRowsOpt = buildOption("numRows", "nr", "Number of rows of the input matrix"); Option numColsOpt = buildOption("numCols", "nc", "Number of columns of the input matrix"); Map<String,String> parsedArgs = parseArguments(strings, numRowsOpt, numColsOpt); Configuration originalConf = getConf(); String inputPathString = originalConf.get("mapred.input.dir"); String outputTmpPathString = parsedArgs.get("--tempDir"); int numRows = Integer.parseInt(parsedArgs.get("--numRows")); int numCols = Integer.parseInt(parsedArgs.get("--numCols")); DistributedRowMatrix matrix = new DistributedRowMatrix(inputPathString, outputTmpPathString, numRows, numCols); matrix.configure(new JobConf(getConf())); matrix.transpose(); return 0; } public static JobConf buildTransposeJobConf(Path matrixInputPath, Path matrixOutputPath, int numInputRows) throws IOException { JobConf conf = new JobConf(TransposeJob.class); conf.setJobName("TransposeJob: " + matrixInputPath + " transpose -> " + matrixOutputPath); FileSystem fs = FileSystem.get(conf); matrixInputPath = fs.makeQualified(matrixInputPath); matrixOutputPath = fs.makeQualified(matrixOutputPath); conf.setInt(NUM_ROWS_KEY, numInputRows); FileInputFormat.addInputPath(conf, matrixInputPath); conf.setInputFormat(SequenceFileInputFormat.class); FileOutputFormat.setOutputPath(conf, matrixOutputPath); conf.setMapperClass(TransposeMapper.class); conf.setReducerClass(TransposeReducer.class); conf.setMapOutputKeyClass(IntWritable.class); conf.setMapOutputValueClass(DistributedRowMatrix.MatrixEntryWritable.class); conf.setOutputFormat(SequenceFileOutputFormat.class); conf.setOutputKeyClass(IntWritable.class); conf.setOutputValueClass(VectorWritable.class); return conf; } public static class TransposeMapper extends MapReduceBase implements Mapper<IntWritable,VectorWritable,IntWritable,DistributedRowMatrix.MatrixEntryWritable> { @Override public void map(IntWritable r, VectorWritable v, OutputCollector<IntWritable, DistributedRowMatrix.MatrixEntryWritable> out, Reporter reporter) throws IOException { DistributedRowMatrix.MatrixEntryWritable entry = new DistributedRowMatrix.MatrixEntryWritable(); Iterator<Vector.Element> it = v.get().iterateNonZero(); int row = r.get(); entry.setCol(row); entry.setRow(-1); // output "row" is captured in the key while (it.hasNext()) { Vector.Element e = it.next(); r.set(e.index()); entry.setVal(e.get()); out.collect(r, entry); } } } public static class TransposeReducer extends MapReduceBase implements Reducer<IntWritable,DistributedRowMatrix.MatrixEntryWritable,IntWritable,VectorWritable> { //private JobConf conf; private int newNumCols; @Override public void configure(JobConf conf) { //this.conf = conf; newNumCols = conf.getInt(NUM_ROWS_KEY, Integer.MAX_VALUE); } @Override public void reduce(IntWritable outRow, Iterator<DistributedRowMatrix.MatrixEntryWritable> it, OutputCollector<IntWritable, VectorWritable> out, Reporter reporter) throws IOException { RandomAccessSparseVector tmp = new RandomAccessSparseVector(newNumCols, 100); while (it.hasNext()) { DistributedRowMatrix.MatrixEntryWritable e = it.next(); tmp.setQuick(e.getCol(), e.getVal()); } SequentialAccessSparseVector outVector = new SequentialAccessSparseVector(tmp); out.collect(outRow, new VectorWritable(outVector)); } } }
[ "durieuxthomas@hotmail.com" ]
durieuxthomas@hotmail.com
c310b6183cf8b714b3e32b9484404ab09aeff3b8
0215ada60ef1d20759ee2bf72e89f4b6e36b91f5
/Software Engineering Project/CVEditor/src/input/FileLoader.java
a008b9f919412ed31dcc6c5b99c717e69eee45b2
[]
no_license
cterizi/CSE_Projects
377bd35fa2620c98b7e80adf3a230e57fe56d5f5
b6f9e1afa52109704532b4634e3a0077983f2067
refs/heads/master
2021-05-01T06:19:18.788198
2018-02-15T17:25:12
2018-02-15T17:25:12
121,136,939
0
0
null
null
null
null
UTF-8
Java
false
false
17,696
java
package input; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Set; import javax.swing.JOptionPane; import cv.CustomCV; import output.TXTExporter; import section.AdditionalInformationSection; import section.CareerSummarySection; import section.CoreStrengthsSection; import section.EducationAndTrainingSection; import section.FurtherCoursesSection; import section.GeneralInformationSection; import section.InterestsSection; import section.ProfessionalExperienceSection; import section.ProfessionalProfileSection; import section.Section; import section.SkillsAndExperienceSection; import utils.EducationElement; import utils.JobCareerElement; import utils.ProfessionalExperience; import utils.Skill; import java.lang.reflect.*; import java.util.*; public abstract class FileLoader { private String fullPath; private HashMap<String, Method> methodMap = new HashMap<String, Method>(); private HashMap<String, Section> sectionMap = new HashMap<String, Section>(); private static ArrayList<Section> sectionList = new ArrayList<Section>(); private static LineReader lineReader; private static FileLoader currentLoader; private static Field field = new Field("", ""); private static int pendingElements = 0; private static boolean firstElement = true; private String lastSection = ""; private ExtractedField lastExtractedField = new ExtractedField(); private HashSet<String> currentSections = new HashSet<String>(); abstract public ExtractedField extractField(String line); abstract public String getSectionName(String line); abstract public boolean skip(String line); public FileLoader(){ try { init(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } } public void init() throws NoSuchMethodException, SecurityException{ methodMap.put("Additional Information", FileLoader.class.getMethod("readAdditionalInformation")); methodMap.put("Career Summary", FileLoader.class.getMethod("readCareerSummary")); methodMap.put("Core Strengths", FileLoader.class.getMethod("readCoreStrengths")); methodMap.put("Education And Training", FileLoader.class.getMethod("readEducationAndTraining")); methodMap.put("Further Courses", FileLoader.class.getMethod("readFurtherCourses")); methodMap.put("General Information", FileLoader.class.getMethod("readGeneralInformation")); methodMap.put("Interests", FileLoader.class.getMethod("readInterests")); methodMap.put("Professional Experience", FileLoader.class.getMethod("readProfessionalExperience")); methodMap.put("Professional Profile", FileLoader.class.getMethod("readProfessionalProfile")); methodMap.put("Skills And Experience", FileLoader.class.getMethod("readSkillsAndExperience")); } public boolean loadFile(FileLoader currentLoader, String fullPath){ currentSections.clear(); sectionList.clear(); setFullPath(fullPath); this.currentLoader = currentLoader; lineReader = new LineReader(fullPath); String sectionName; while(lineReader.getCurrentLine() != null){ sectionName = getNextSectionName(); if(currentSections.contains(sectionName)){ return(false); } currentSections.add(sectionName); if (!sectionName.equals("")){ lastSection = sectionName; if(!readSection(sectionName)){ return false; } } else if (lineReader.getCurrentLine() != null && !sectionName.equals("EOF")){ return false; } } writeCV(); return true; } public static boolean readGeneralInformation(){ GeneralInformationSection generalInformationSection = new GeneralInformationSection(); field = currentLoader.getNextExtractedField().getField(); if(!updateField("Name:", field, generalInformationSection, "setName", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); if(!updateField("Address:", field, generalInformationSection, "setAddress", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); if(!updateField("Telephone(Home):", field, generalInformationSection, "setHomeTelephone", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); if(!updateField("Telephone(Mobile):", field, generalInformationSection, "setMobileTelephone", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); if(!updateField("Email:", field, generalInformationSection, "setEmail", String.class)){ return(false); } sectionList.add(generalInformationSection); return(true); } public static boolean readProfessionalProfile(){ ProfessionalProfileSection professionalProfileSection = new ProfessionalProfileSection(); field = currentLoader.getNextExtractedField().getField(); if(!updateField("Professional Profile", field, professionalProfileSection, "setText", String.class)){ return(false); } sectionList.add(professionalProfileSection); return(true); } public static boolean readCoreStrengths(){ CoreStrengthsSection coreStrengthsSection = new CoreStrengthsSection(); field = currentLoader.getNextExtractedField().getField(); if(!updateField("Core Strengths", field, coreStrengthsSection, "setText", String.class)){ return(false); } sectionList.add(coreStrengthsSection); return(true); } public static boolean readProfessionalExperience(){ ProfessionalExperienceSection professionalExperienceSection = new ProfessionalExperienceSection(); firstElement = true; boolean correctSection = readProfessionalExperienceElement(professionalExperienceSection); while(correctSection){ correctSection = readProfessionalExperienceElement(professionalExperienceSection); } if (pendingElements > 0){ return false; } sectionList.add(professionalExperienceSection); return(true); } public static boolean readEducationAndTraining(){ EducationAndTrainingSection educationAndTrainingSection = new EducationAndTrainingSection(); firstElement = true; boolean correctSection = readEducationSection(educationAndTrainingSection); while(correctSection){ correctSection = readEducationSection(educationAndTrainingSection); } if (pendingElements > 0){ return false; } sectionList.add(educationAndTrainingSection); return(true); } public static boolean readFurtherCourses(){ FurtherCoursesSection furtherCoursesSection = new FurtherCoursesSection(); firstElement = true; boolean correctSection = readEducationSection(furtherCoursesSection); while(correctSection){ correctSection = readEducationSection(furtherCoursesSection); } if (pendingElements > 0){ return false; } sectionList.add(furtherCoursesSection); return(true); } public static boolean readAdditionalInformation(){ AdditionalInformationSection additionalInformationSection = new AdditionalInformationSection(); field = currentLoader.getNextExtractedField().getField(); if(!updateField("Additional Information", field, additionalInformationSection, "setText", String.class)){ return(false); } sectionList.add(additionalInformationSection); return(true); } public static boolean readInterests(){ InterestsSection interestsSection = new InterestsSection(); field = currentLoader.getNextExtractedField().getField(); if(!updateField("Interests", field, interestsSection, "setText", String.class)){ return(false); } sectionList.add(interestsSection); return(true); } public static boolean readCareerSummary(){ CareerSummarySection careerSummarySection = new CareerSummarySection(); firstElement = true; boolean correctSection = readCareerSummarySection(careerSummarySection); while(correctSection){ correctSection = readCareerSummarySection(careerSummarySection); } if (pendingElements > 0){ return false; } sectionList.add(careerSummarySection); return(true); } public static boolean readSkillsAndExperience(){ SkillsAndExperienceSection skillsAndExperienceSection = new SkillsAndExperienceSection(); firstElement = true; boolean correctSection = readSkillsAndExperienceElement(skillsAndExperienceSection); while(correctSection){ correctSection = readSkillsAndExperienceElement(skillsAndExperienceSection); } if (pendingElements > 0){ return false; } sectionList.add(skillsAndExperienceSection); return(true); } public static boolean readSkillsAndExperienceElement(SkillsAndExperienceSection section){ Skill skill = new Skill(); int skillCounter = 1; if (firstElement){ field = currentLoader.getNextExtractedField().getField(); } if(!updateField("ExperienceOn:", field, skill, "setExperienceName", String.class)){ return(false); } pendingElements = pendingElements + 1; field = currentLoader.getNextExtractedField().getField(); while(updateField("Skill" + skillCounter + ":", field, skill, "addSkill", String.class)){ skillCounter = skillCounter + 1; field = currentLoader.getNextExtractedField().getField(); } firstElement = false; pendingElements = pendingElements - 1; ((SkillsAndExperienceSection)section).addSkill(skill); return(true); } public static boolean readCareerSummarySection(Section section){ JobCareerElement jobCareerElement = new JobCareerElement("Career Summary"); if (firstElement){ field = currentLoader.getNextExtractedField().getField(); } if(!updateField("Career Summary Company Name:", field, jobCareerElement, "setCompanyName", String.class)){ return(false); } pendingElements = pendingElements + 1; field = currentLoader.getNextExtractedField().getField(); if(!updateField("Job:", field, jobCareerElement, "setJob", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); if(!updateField("Title:", field, jobCareerElement, "setTitle", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); if(!updateField("Date:", field, jobCareerElement, "setDate", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); firstElement = false; pendingElements = pendingElements - 1; ((CareerSummarySection)section).addJobCareerElement(jobCareerElement); return(true); } public static boolean readEducationSection(Section section){ EducationElement educationElement = new EducationElement(); if (firstElement){ field = currentLoader.getNextExtractedField().getField(); } if(!updateField("Name:", field, educationElement, "setName", String.class)){ return(false); } pendingElements = pendingElements + 1; field = currentLoader.getNextExtractedField().getField(); if(!updateField("Establishment:", field, educationElement, "setEstablishment", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); if(!updateField("Location:", field, educationElement, "setLocation", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); if(!updateField("Date:", field, educationElement, "setDate", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); firstElement = false; pendingElements = pendingElements - 1; if (section.getSectionName().equals("Education And Training")){ ((EducationAndTrainingSection)section).addEducationAndTraining(educationElement); } else { ((FurtherCoursesSection)section).addFurtherCourse(educationElement); } return(true); } public static boolean readProfessionalExperienceElement(ProfessionalExperienceSection section){ ProfessionalExperience professionalExperience = new ProfessionalExperience(); int achievementCounter = 1; if (firstElement){ field = currentLoader.getNextExtractedField().getField(); } if(!updateField("Professional Experience Company Name:", field, professionalExperience, "setCompanyName", String.class)){ return(false); } pendingElements = pendingElements + 1; field = currentLoader.getNextExtractedField().getField(); if(!updateField("Job:", field, professionalExperience, "setJob", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); if(!updateField("Title:", field, professionalExperience, "setTitle", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); if(!updateField("Date:", field, professionalExperience, "setDate", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); if(!updateField("Responsibilities:", field, professionalExperience, "setParagraphOfResponsibilities", String.class)){ return(false); } field = currentLoader.getNextExtractedField().getField(); while(updateField("Achievement" + achievementCounter + ":", field, professionalExperience, "addAchievement", String.class)){ achievementCounter = achievementCounter + 1; field = currentLoader.getNextExtractedField().getField(); } firstElement = false; pendingElements = pendingElements - 1; section.addProfessionalExperience(professionalExperience); return(true); } public void setFullPath(String fullPath){ this.fullPath = fullPath; } public Set getSectionNames(){ return(methodMap.keySet()); } public static boolean updateField(String expectedField, Field field, Object updateObject, String methodName, Class argumentClass){ if (!expectedField.equals(field.getLabel())){ return false; } try { try { Class searchClass = getSearchClass(updateObject.getClass(), methodName, argumentClass); /* Class searchClass = updateObject.getClass(); if (hasSuperClass(updateObject)){ searchClass = searchClass.getSuperclass(); }*/ searchClass.getDeclaredMethod(methodName, argumentClass).invoke(updateObject, field.getField()); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { e.printStackTrace(); } } catch (NoSuchMethodException | SecurityException e) { e.printStackTrace(); } return true; } public static boolean hasSuperClass(Object object){ String superClassName = object.getClass().getSuperclass().getName(); return !superClassName.equals("java.lang.Object") && !superClassName.equals("section.Section"); } public static Class getSearchClass(Class c, String methodName, Class argumentClass){ if (hasMethod(c, methodName)){ if (hasMethod(c.getSuperclass(), methodName)){ return c.getSuperclass(); } } return c; } public static boolean hasMethod(Class c, String methodName){ Method[] methods = c.getMethods(); for (Method m : methods) { if (m.getName().equals(methodName)) { return true; } } return false; } public boolean readSection(String sectionName){ try { return (boolean)methodMap.get(sectionName).invoke(null); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } return false; } public String getNextSectionName(){ String sectionLine = readNextSectionLine(); if (!isSection(sectionLine)){ return ""; } return currentLoader.getSectionName(sectionLine); } public String readNextSectionLine() { if (!firstElement){ firstElement = true; return lineReader.getCurrentLine(); } lineReader.readLine(); while(lineReader.getCurrentLine() != null){ if(currentLoader.skip(lineReader.getCurrentLine()) || lineReader.getCurrentLine().trim().isEmpty()){ lineReader.readLine(); continue; } if (isSection(getSectionName(lineReader.getCurrentLine()))){ return lineReader.getCurrentLine(); } else if (lineReader.getCurrentLine() != null){ return ""; } } return "EOF"; } public ExtractedField getNextExtractedField(){ if (lastExtractedField.hasFieldsToRead()){ lastExtractedField = extractField("~~~~~"); return lastExtractedField; } lineReader.readLine(); while(lineReader.getCurrentLine() != null){ if(skip(lineReader.getCurrentLine()) || lineReader.getCurrentLine().trim().isEmpty()){ lineReader.readLine(); continue; } break; } String line = lineReader.getCurrentLine(); if (line == null){ lastExtractedField = new ExtractedField(); return lastExtractedField; } lastExtractedField = extractField(line); return lastExtractedField; } public boolean isSection(String sectionLine){ return getSectionNames().contains(currentLoader.getSectionName(sectionLine)); } public ArrayList<Section> getSectionList(){ return(sectionList); } public String getLastSection(){ return lastSection; } public void writeCV(){ CustomCV customCV = new CustomCV(sectionList); TXTExporter txtExporter = new TXTExporter(); txtExporter.writeFile(customCV, "C:\\Users\\Chryssa\\Desktop\\customCV.txt"); } }
[ "chryssa.terizi@gmail.com" ]
chryssa.terizi@gmail.com
583ff61391cf80db212345818110d98c8c21d652
43e322de3539b248ff711be04e89fed2d0ac7287
/JavaDevelopment/UserRegistration/src/main/java/com/fdmgroup/userregistration/RegistrationController.java
36b25ef01679f46dcde2ead6d5d69469917637b3
[]
no_license
trejiiten/SoftwareDevelopment
d07500033042cd481b5c90bfeb69d6d76c564aac
7587ee5afc1e4687121a9fcefff4142313b4b6ed
refs/heads/master
2023-02-10T06:34:26.340411
2019-09-26T04:01:45
2019-09-26T04:01:45
203,074,096
0
0
null
null
null
null
UTF-8
Java
false
false
586
java
package com.fdmgroup.userregistration; public class RegistrationController { private UserFactory userFactory; private Dao<User, String> dao; public RegistrationController(UserFactory userFactory, Dao<User, String> dao) { this.userFactory = userFactory; this.dao = dao; } public void registerNewUser(String name, String password, String roll) { userFactory.createUser(name, password, roll); } public void registerNewUser(String username, String name, String password, String roll) { userFactory.createUser(username, name, password, roll); } }
[ "trejiiten@gmail.com" ]
trejiiten@gmail.com
b6300d22754d217369a49a279cfb7fcd0a121b5b
b49ee04177c483ab7dab6ee2cd3cabb44a159967
/medicineDaChen/src/main/java/com/dachen/medicine/activity/ModifyPasswordActivity.java
c25f35a658262bc85580cecec21b4503d27e4214
[]
no_license
butaotao/MedicineProject
8a22a98a559005bb95fee51b319535b117f93d5d
8e57c1e0ee0dac2167d379edd9d97306b52d3165
refs/heads/master
2020-04-09T17:29:36.570453
2016-09-13T09:17:05
2016-09-13T09:17:05
68,094,294
0
1
null
null
null
null
UTF-8
Java
false
false
4,619
java
package com.dachen.medicine.activity; import android.os.Bundle; import android.support.annotation.Nullable; import android.text.TextUtils; import com.dachen.medicine.R; import com.dachen.medicine.app.Constants; import com.dachen.medicine.app.MedicineApplication; import com.dachen.medicine.common.utils.LogUtils; import com.dachen.medicine.common.utils.SharedPreferenceUtil; import com.dachen.medicine.common.utils.ToastUtils; import com.dachen.medicine.db.MedicineURIField; import com.dachen.medicine.db.table.TableUser; import com.dachen.medicine.entity.LoginRegisterResult; import com.dachen.medicine.entity.Result; import com.dachen.medicine.entity.User; import com.dachen.medicine.net.HttpManager; import com.dachen.medicine.net.HttpManager.OnHttpListener; import com.dachen.medicine.view.ClearEditText; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnClick; /** * 修改密码 * * @author lmc * */ public class ModifyPasswordActivity extends BaseActivity implements OnHttpListener { private static final String TAG = ModifyPasswordActivity.class .getSimpleName(); @Nullable @Bind(R.id.modifyPwdActivity_oldPwd) ClearEditText mOldPwdView; @Nullable @Bind(R.id.modifyPwdActivity_newPwd) ClearEditText mNewPwdView; @Nullable @Bind(R.id.modifyPwdActivity_confirmPwd) ClearEditText mConfirmPwdView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_modify_pwd); ButterKnife.bind(this); } @Nullable @OnClick(R.id.modifyPwdActivity_back_btn) void onBackBtnClicked() { finish(); } @Nullable @OnClick(R.id.modifyPwdActivity_submit) void onSubmitBtnClicked() { final String oldPwd = mOldPwdView.getText().toString(); final String newPwd = mNewPwdView.getText().toString(); String confirmPwd = mConfirmPwdView.getText().toString(); if (TextUtils.isEmpty(oldPwd)) { mOldPwdView.requestFocus(); ToastUtils.showToast( "请输入旧密码"); return; } if (TextUtils.isEmpty(newPwd)) { mNewPwdView.requestFocus(); ToastUtils.showToast("请输入新密码"); return; } if (newPwd.length() < 6 || newPwd.length() > 18) { mNewPwdView.requestFocus(); ToastUtils.showToast( "新密码长度为6-18位字符"); return; } if (TextUtils.isEmpty(confirmPwd)) { mConfirmPwdView.requestFocus(); ToastUtils.showToast("请输入确认密码"); return; } if (!newPwd.equals(confirmPwd)) { mConfirmPwdView.requestFocus(); ToastUtils.showToast( "新密码两次输入不一致"); return; } String id = SharedPreferenceUtil.getString("id", null); //User user = UserInfoInDB.getUser(id); /*LogUtils.burtLog("users---" + user.getUserId() + "===" + user.getToken());*/ login( SharedPreferenceUtil.getString("id", ""), oldPwd, newPwd, SharedPreferenceUtil.getString("session", "")); } public void login(String userId, String oldPwd, String newPwd, String token) { Map<String, String> params = new HashMap<String, String>(); params.put("userId", userId); params.put("oldPassword", oldPwd); params.put("newPassword", newPwd); params.put("access_token", token); new HttpManager().post(Constants.MODIFY_PWD, LoginRegisterResult.class, params, this, false, 1); } @Override public void onSuccess(Result entity) { // TODO Auto-generated method stub if (entity instanceof LoginRegisterResult) { if (entity.resultCode==1) { LoginRegisterResult logins = (LoginRegisterResult) entity; SharedPreferenceUtil.putString("session", logins.data.getAccess_token()); SharedPreferenceUtil.putString("id", logins.data.getUserId()); User user = logins.data.getUser(); LogUtils.burtLog("logins.data.access_token-----" + logins.data.access_token); user.setPassword("jiayou123"); user.setToken(logins.data.access_token); user.setDescription("bbt"); LogUtils.burtLog("user===" + user); MedicineApplication .getApplication() .getContentResolver() .insert(MedicineURIField.DOWNLOAD_TASK_URI, TableUser.buildContentValues(user)); ToastUtils.showToast("修改密码成功"); finish(); }else { ToastUtils.showToast(entity.resultMsg); } } } @Override public void onSuccess(ArrayList response) { // TODO Auto-generated method stub } @Override public void onFailure(Exception e, String errorMsg,int s) { // TODO Auto-generated method stub ToastUtils.showToast(getString(R.string.connect_error)); } }
[ "1802928215@qq.com" ]
1802928215@qq.com
1030fa383fb3fb78aa6ac62748026e4f9379345c
f3cedc00c536faf208f1f3135b6db2a4fcc6d614
/src/main/java/br/com/simconsult/painel/security/jwt/Teste.java
7578f3bf01bb121f43079bf01a44550096f471d7
[]
no_license
adrianoaguiardez/painel-backed
bb96674f7541e339eb613672c240bb133836582c
87ab23ed5f2e2fbb7b33f85b0b6e1f100709821a
refs/heads/main
2023-04-16T04:34:15.989390
2021-04-30T13:29:12
2021-04-30T13:29:12
351,267,825
0
0
null
null
null
null
UTF-8
Java
false
false
156
java
package br.com.simconsult.painel.security.jwt; public class Teste { public static void main(String[] args) { // TODO Auto-generated method stub } }
[ "adrianoaguiardez@gmail.com" ]
adrianoaguiardez@gmail.com
243dafc1f23141b4b6f20b420c41c9933592cd10
5d60a13300e24cbea0ebf71f5548c6d4334911e1
/src/main/java/me/sahar/blog/controllers/BlogController.java
6bff69dadb9e4244ab617607b7c171a5976a8ed3
[]
no_license
SaharSam/A-Blog-With-Spring-Boot-And-Vue.js
636bf1af5f5809aeb4e01f990c03af47da5359e6
9a0ffd870fa178f7ef50bd0096ac0ddf0573ea2a
refs/heads/master
2022-12-02T08:29:24.212326
2020-08-21T14:41:47
2020-08-21T14:41:47
286,954,324
0
0
null
null
null
null
UTF-8
Java
false
false
940
java
package me.sahar.blog.controllers; import me.sahar.blog.entities.Post; import me.sahar.blog.services.PostService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import java.util.Date; import java.util.List; @RestController public class BlogController { @Autowired private PostService postService; @GetMapping ( value = "/") public String Index() { return "Index"; } @GetMapping ( value = "/posts") public List<Post> Posts() { return postService.getAllPosts(); } @GetMapping ( value = "/post") public void PublishPost(@RequestBody Post post) { if (post.getCreatedDate() == null) post.setCreatedDate(new Date() ); postService.insert(post); } }
[ "52576006+SaharSam@users.noreply.github.com" ]
52576006+SaharSam@users.noreply.github.com
5fbce226d41a24eec4a088cf0236628234df0734
ca5a0651ad0fdc1828e6fe10eafdfb6dca19a0c7
/Mtap/src/basics/overrriding/GST.java
04228bf044f3ae0f24dd62614c2479e2788cb79e
[]
no_license
abdultanveer/Mtap_java
0e15b4d58aa6e3067addee5bb1f9dc7dd4a1d617
64cebe7241cc288436dfba7055e6ee11d5cada91
refs/heads/master
2023-07-02T07:56:25.998155
2021-07-29T10:56:58
2021-07-29T10:56:58
389,624,854
0
0
null
null
null
null
UTF-8
Java
false
false
254
java
package basics.overrriding; public class GST extends IncomeTax{ @Override public int calculatTax(int income) { int oldTax = super.calculatTax(income); int gst = 0; if(income > 1000) { gst = 100; } return oldTax + gst; } }
[ "abdul.tanveer@gmail.com" ]
abdul.tanveer@gmail.com
5d2054d269938d48d013ce7babffd76ad3af509a
f86533af95606b8f87884b6c634cfa5b3cc7357c
/builder/src/main/java/com/design/builder/model/BenzModel.java
02e166b33bb61d1d13575e837c3a74fe49347b74
[]
no_license
anders1556/design-pattern
b10752de98e1639fbdca8a065ff7f900f34a9128
2deba9a8fd2ef38253a4a242771c2a5f22660375
refs/heads/master
2021-01-25T10:44:32.499949
2014-01-21T02:43:31
2014-01-21T02:43:31
22,457,321
0
1
null
null
null
null
UTF-8
Java
false
false
519
java
package com.design.builder.model; public class BenzModel extends CarModel{ protected void alarm() { System.out.println("奔驰车的喇叭声音是这个样子的..."); } protected void engineBoom() { System.out.println("奔驰车的引擎室这个声音的..."); } protected void start() { System.out.println("奔驰车跑起来是这个样子的..."); } protected void stop() { System.out.println("奔驰车应该这样停车..."); } }
[ "meiling.sun@payegis.com" ]
meiling.sun@payegis.com
6264a3c118f2b839a17d8cf18cb25c6e18f3e8f1
a883c5253d3cbac82bbe4e8104666d2262ef63a8
/appointment/appointment-common-model/src/main/java/com/appointment/company/Company.java
b13bbc8949cb1c60e2e01350892a610fa678271b
[]
no_license
huhjunn/wanlida02
6408e00a2f695ade753a28840aaab2fb75c56f2f
0e14476f6aba1d4b62af31a978d09e0386f9d69a
refs/heads/master
2022-12-24T03:01:00.035840
2019-08-22T05:48:20
2019-08-22T05:48:20
201,592,064
0
0
null
2022-12-16T08:00:45
2019-08-10T06:49:24
Java
UTF-8
Java
false
false
600
java
package com.appointment.company; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.util.Date; //@TableName("ds_appointment") @Data public class Company { private String id; private String dsName; private String password; private String name; private String phone; private Date applicationDate; private String shortMessage; private String dailyAppointment; private String weeklyAppointment; private String coachCancelTime; private String studentCancelTime; private String lateNum; private String truancyNum; }
[ "1794391140@qq.com" ]
1794391140@qq.com
8903ae98d7d3d781db80768405f6c8bc25494cc9
3ff5d3d9a11a4f0f7345218ffe8a2b856ee2cf14
/src/main/java/dc/servicos/dao/comercial/ICondicaoPagamentoDAO.java
4c91003b000c59e12eacf1ad4ec479dcb515d09a
[]
no_license
dotcompany/SISTEMA-ERP-EM-JAVA-GWT-VAADIN
2515b908be09181e00d4ae2ff0e32a657143cdf3
e807910118c1d281d8b916dc3f79f405cb27d8c4
refs/heads/master
2021-03-24T12:53:23.785812
2017-06-27T11:36:55
2017-06-27T11:36:55
12,715,650
1
2
null
2018-03-22T03:00:28
2013-09-09T23:44:00
Java
UTF-8
Java
false
false
200
java
package dc.servicos.dao.comercial; import dc.entidade.comercial.CondicaoPagamento; import dc.model.dao.AbstractDAO; public interface ICondicaoPagamentoDAO extends AbstractDAO<CondicaoPagamento> { }
[ "douglasrehem@gmail.com" ]
douglasrehem@gmail.com
af2d42df5955d5eea7c1496c6990dce28d4b269d
5fa0f88e4d1c5f8a55f94d3c009d810283be8f30
/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/LocalVarAggregateFunction.java
afcd2ba73b67d067a75693735d0cdc92dbf14106
[ "MIT", "BSD-3-Clause", "PostgreSQL", "Apache-2.0" ]
permissive
apache/asterixdb
6ec720f0e78d53b020d4febe4f1f0bf8e9776676
d3a31a6bf9e1f1ad2dde81b877079132b85a38a5
refs/heads/master
2023-09-06T03:27:15.992827
2023-09-05T22:01:33
2023-09-06T01:31:44
31,976,266
244
132
null
2023-08-31T23:32:14
2015-03-10T19:06:29
Java
UTF-8
Java
false
false
2,775
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.asterix.runtime.aggregates.std; import org.apache.asterix.om.functions.BuiltinFunctions; import org.apache.asterix.om.types.ATypeTag; import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier; import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext; import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory; import org.apache.hyracks.api.exceptions.HyracksDataException; import org.apache.hyracks.api.exceptions.SourceLocation; import org.apache.hyracks.data.std.api.IPointable; import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference; public class LocalVarAggregateFunction extends AbstractSingleVarStatisticsAggregateFunction { private final boolean isPop; public LocalVarAggregateFunction(IScalarEvaluatorFactory[] args, IEvaluatorContext context, boolean isPop, SourceLocation sourceLoc) throws HyracksDataException { super(args, context, sourceLoc); this.isPop = isPop; } @Override public void step(IFrameTupleReference tuple) throws HyracksDataException { processDataValues(tuple); } @Override public void finish(IPointable result) throws HyracksDataException { finishPartialResults(result); } @Override public void finishPartial(IPointable result) throws HyracksDataException { finish(result); } @Override protected void processNull() { aggType = ATypeTag.NULL; } @Override protected boolean skipStep() { return aggType == ATypeTag.NULL; } @Override protected FunctionIdentifier getFunctionIdentifier() { if (isPop) { return BuiltinFunctions.VAR_POP; } else { return BuiltinFunctions.VAR_SAMP; } } @Override protected boolean getM3Flag() { return false; } @Override protected boolean getM4Flag() { return false; } }
[ "dmitry.lychagin@couchbase.com" ]
dmitry.lychagin@couchbase.com
bc30e9d9531208b06c15c5ed78b570b2fc30f40b
0b8f38c51d5b12fe27202ab093c1360d36f7d9eb
/src/main/java/be/rochus/repository/VlasResultRepository.java
884651202a67142d3841dd30f2f68d7ef76378d1
[]
no_license
limburgie/rochus
41c63ba65252152cd8336a3b9085697646803761
0a8c7c62bc80619f129315e5cf58e57f85b06d9b
refs/heads/master
2020-04-05T23:04:04.650260
2013-10-06T12:24:36
2013-10-06T12:24:36
13,347,360
0
0
null
null
null
null
UTF-8
Java
false
false
372
java
package be.rochus.repository; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import be.rochus.domain.VlasResult; public interface VlasResultRepository extends JpaRepository<VlasResult, Long> { @Query("FROM VlasResult ORDER BY date DESC") List<VlasResult> getResults(); }
[ "p.mesotten@aca-it.be" ]
p.mesotten@aca-it.be
ec0d8e09d49fc5b4208b972a33ac1d55390c1ed2
deb4c926d2b3cd115d0b2e6a0592eb5b3c1fd254
/src/main/java/io/codefresh/conf/tree/ConfNode.java
8bb4285705dbba1a28a6742859fc08a44f38618c
[ "Apache-2.0" ]
permissive
somyagitaccount/plain-jar-sample-lib
f46c0f4e19b2718ae05b19f4b3cf22e3bf5b2eaa
e15323577a33e116bbf25d2da6946ac6ca2ac5e8
refs/heads/master
2022-04-09T12:27:54.609775
2020-02-08T12:22:29
2020-02-08T12:22:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,394
java
/* * Copyright 2011 Kapelonis Kostis * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.codefresh.conf.tree; import java.util.LinkedHashMap; import java.util.Map; /** * @author kkapelonis */ public abstract class ConfNode { private Map<String,ConfNode> children = new LinkedHashMap<String,ConfNode>(); private ConfNode parent = null; private String comment = null; private String name = null; public ConfNode (ConfNode parent) { this.parent = parent; } public String getComment () { return comment; } public void setComment (String comment) { this.comment = comment; } public Map<String,ConfNode> getChildren () { return children; } public ConfNode getParent () { return parent; } public String getName () { return name; } public void setName (String name) { this.name = name; } public abstract String getValue(); }
[ "kostis@codefresh.io" ]
kostis@codefresh.io
5e3ad92400018f5cf4369ef87678278eb2b2c2c6
d3975bc98f9f9da7bf1927486ebf00f25c422def
/uiBuilder/src/uxcomponents/ScreenFlowActivity.java
e256d46f51e02eda0c5ec7ca1771ab04f19cffa5
[]
no_license
UiBuilder/TestBuilder
a6b50eed1ca4f1bb77f0cdcdf08103f39a1cfc94
5a1fb6e32626e40fe4afcfe21fd43b279b6a57fe
refs/heads/master
2021-01-19T18:56:48.175034
2013-07-04T07:57:16
2013-07-04T07:57:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,254
java
package uxcomponents; import java.util.ArrayList; import android.app.Activity; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.content.ContentResolver; import android.content.ContentUris; import android.content.ContentValues; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.FrameLayout; import android.widget.RelativeLayout; import android.widget.RelativeLayout.LayoutParams; import android.widget.TextView; import data.ScreenProvider; import de.ur.rk.uibuilder.R; public class ScreenFlowActivity extends Activity { private ScreenFlowDesignFragment design; private ScreenFlowScreensFragment screens; private FragmentManager fragmentManager; private FrameLayout sections; private FrameLayout designArea; private int projectId; private Bundle startingBundle; @Override public void onBackPressed() { // TODO Auto-generated method stub ArrayList<View> screens = design.getFlow(); ContentResolver resolver = getContentResolver(); for (View screen: screens) { TextView label = (TextView) screen.findViewById(R.id.screenname); String labelText = label.getText().toString(); RelativeLayout.LayoutParams params = (LayoutParams) screen.getLayoutParams(); int x = params.leftMargin; int y = params.topMargin; Log.d("inserting x", String.valueOf(x)); ContentValues values = new ContentValues(); values.put(ScreenProvider.KEY_FLOW_LABEL, labelText); values.put(ScreenProvider.KEY_FLOW_PROJECT_ID, projectId); values.put(ScreenProvider.KEY_FLOW_X, x); values.put(ScreenProvider.KEY_FLOW_Y, y); if (screen.getTag() == null) { resolver.insert(ScreenProvider.CONTENT_URI_FLOW, values); Log.d("screen", "inserted"); } else { Log.d("screen", "updated"); Uri screenUri = ContentUris.withAppendedId(ScreenProvider.CONTENT_URI_FLOW, (Integer)screen.getTag()); resolver.update(screenUri, values, null, null); } } finish(); overridePendingTransition(R.anim.activity_transition_from_left_in, R.anim.activity_transition_to_right_out); } @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.layout_project_screenflow_root); fragmentManager = getFragmentManager(); startingBundle = getIntent().getExtras(); projectId = startingBundle.getInt(ScreenProvider.KEY_ID); initFragments(); } private void initFragments() { design = new ScreenFlowDesignFragment(); design.setArguments(startingBundle); screens = new ScreenFlowScreensFragment(); screens.setArguments(startingBundle); sections = (FrameLayout) findViewById(R.id.screenflow_section_container); designArea = (FrameLayout) findViewById(R.id.screenflow_design_area); FragmentTransaction init = fragmentManager.beginTransaction(); init.add(sections.getId(), screens); init.add(designArea.getId(), design); init.setCustomAnimations(R.animator.to_left_in, R.animator.to_left_out); init.commit(); } @Override protected void onResume() { // TODO Auto-generated method stub super.onResume(); } }
[ "fulosio@gmail.com" ]
fulosio@gmail.com
aebda459374bd24d3ad7a89f8df10b48e0a7091b
6404ac646e701b0039b3dec3abb023d3058da573
/JAVA programs/cPHP/PrimernoControlno2/goshoProjectExam2/src/Document.java
ef797bb26aab0c6d2c5ed1fcf4624d0365e5b7b9
[]
no_license
YovoManolov/GithubRepJava
0b6ffa5234bcca3dec1ac78f491b1d96882420e8
307f11e11d384ae0dbf7b2634210656be539d92f
refs/heads/master
2023-01-09T23:26:01.806341
2021-03-28T13:41:36
2021-03-28T13:41:36
85,554,350
0
0
null
null
null
null
WINDOWS-1251
Java
false
false
1,320
java
//създавам клас както е даден по условие с дадени променливи public class Document { private String name; private float progress; private double income; private String faculty; private DocumentType type; // съзадавам променлива за типът на документа. public Document(String name,float progress,double income,String faculty,DocumentType type) { //правя си конструктор, който създава документ по подадени параметри. this.name = name; this.progress = progress; this.income = income; this.faculty = faculty; this.type = type; } // слагам гетъри и сетъри public String getName() { return name; } public void setName(String name) { this.name = name; } public float getProgress() { return progress; } public void setProgress(float progress) { this.progress = progress; } public double getIncome() { return income; } public void setIncome(double income) { this.income = income; } public String getFaculty() { return faculty; } public void setFaculty(String faculty) { this.faculty = faculty; } public DocumentType getType() { return type; } public void setType(DocumentType type) { this.type = type; } }
[ "yovo.manolov@abv.bg" ]
yovo.manolov@abv.bg
a474696f44f234f9566f12b4537d1d00d5b657b5
0875cef3763ce9de01794ca801d16d3ae3400e6e
/duan1_QLKhachSan/src/BLL/BLL_KH.java
d14bacce024bc719bd6d8e03d38261a0c2554e14
[]
no_license
lannv1101/duan1_QLyKhachSan
5f11219c42ad91f5374c907a7fb836304afee524
d372b0651b1df29b1d44ebe0cd7fde9dfce1b65b
refs/heads/master
2023-07-02T09:33:40.635411
2021-08-02T16:35:02
2021-08-02T16:35:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,318
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 BLL; import GUI.thongbao; import java.sql.ResultSet; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; /** * * @author ADMIN */ public class BLL_KH { public static boolean KT_Them(DTO.DTO_KH KH) { ResultSet rs = DAO.DAO_KhachHang.LayKH(); try { while (rs.next()) { if (rs.getString("MaKhachHang").matches(KH.getMaKH())) { thongbao.loi("Mã khách hàng đã dùng"); return false; } } } catch (SQLException ex) { Logger.getLogger(BLL_KH.class.getName()).log(Level.SEVERE, null, ex); } if (KH.getMaKH().trim().equals("") || KH.getTenKH().trim().equals("") || KH.getTuoi().trim().equals("") || KH.getCMND().trim().equals("")) { thongbao.ktlai("Không để trống thông tin"); return false; } if (KH.getCMND().length()!=10) { thongbao.ktlai("Nhập lại số CMND"); return false; } return true; } public static void dodulieu(JTable tbl) { DefaultTableModel tblModel = (DefaultTableModel) tbl.getModel(); tblModel.setRowCount(0); Object obj[] = new Object[2]; ResultSet rs = DAO.DAO_KhachHang.LayKH(); try { while (rs.next()) { obj[0] = rs.getString("MaKhachHang"); obj[1] = rs.getString("TenKhachHang"); tblModel.addRow(obj); } } catch (SQLException ex) { System.out.println("lỗi đổ table"); } } public static void TimKiem(JTable tbl,String tukhoa) { DefaultTableModel tblModel = (DefaultTableModel) tbl.getModel(); tblModel.setRowCount(0); Object obj[] = new Object[2]; ResultSet rs = DAO.DAO_KhachHang.TimKiem(tukhoa); try { while (rs.next()) { obj[0] = rs.getString("MaKhachHang"); obj[1] = rs.getString("TenKhachHang"); tblModel.addRow(obj); } } catch (SQLException ex) { System.out.println("lỗi đổ table"); } } public static boolean KT_Xoa(String MaKH) { ResultSet rs = DAO.DAO_ThuePhong.LayTatCa(); try { while (rs.next()) { if (rs.getString("MaKhachHang").matches(MaKH)) { thongbao.loi("Khách hàng đã hoặc đang thuê phòng"); return false; } } } catch (SQLException ex) { Logger.getLogger(BLL_KH.class.getName()).log(Level.SEVERE, null, ex); } return true; } public static boolean KT_Sua(DTO.DTO_KH KH) { if (KH.getMaKH().trim().equals("") || KH.getTenKH().trim().equals("") || KH.getTuoi().trim().equals("") || KH.getCMND().trim().equals("")) { thongbao.ktlai("Không để trống thông tin"); return false; } return true; } }
[ "nguyenvulan1998@gmail.com" ]
nguyenvulan1998@gmail.com
bcd7b11ea020d9b4daabdf2e927d48c6bb357369
c05ccbccb87c2593efe7f6941fd2d586a43dfe66
/android-client/Occupy/src/com/room/proximity/occupy/ListBeaconsActivity.java
ca6a8a9e93d7dabf8824e3cf65c5719120516cd0
[]
no_license
lawlessc/room-proximity
40763bfe00a91f9d4018d4201e0797e3d2367516
041d14a911ebf81f4f8de9310205b30519335b41
refs/heads/master
2021-01-21T12:39:56.088918
2014-05-28T16:27:53
2014-05-28T16:27:53
17,981,062
1
1
null
null
null
null
UTF-8
Java
false
false
12,290
java
package com.room.proximity.occupy; import java.util.ArrayList; import java.util.Collections; import java.util.List; import android.app.Activity; import android.bluetooth.BluetoothAdapter; import android.content.Intent; import android.os.Bundle; import android.os.RemoteException; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.Button; import android.widget.CompoundButton; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import android.widget.ToggleButton; import com.estimote.sdk.Beacon; import com.estimote.sdk.BeaconManager; import com.estimote.sdk.Region; import com.estimote.sdk.utils.L; import com.room.proximity.occupy.R.color; /** * Based on work of wiktorgworek@google.com (Wiktor Gworek) */ public class ListBeaconsActivity extends Activity { private static final String TAG = ListBeaconsActivity.class.getSimpleName(); public static final String EXTRAS_TARGET_ACTIVITY = "extrasTargetActivity"; public static final String EXTRAS_BEACON = "extrasBeacon"; private static final int REQUEST_ENABLE_BT = 1234; private static final String ESTIMOTE_BEACON_PROXIMITY_UUID = "B9407F30-F5F8-466E-AFF9-25556B57FE6D"; private static final String ESTIMOTE_IOS_PROXIMITY_UUID = "8492E75F-4FD6-469D-B132-043FE94921D8"; private static final Region ALL_ESTIMOTE_BEACONS_REGION = new Region("rid", null, null, null); private BeaconManager beaconManager; private LeDeviceListAdapter adapter; private ProgressBar progressBar; private View vScan; private int scanningTime; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); overridePendingTransition(R.anim.activity_open_translate,R.anim.activity_close_scale); final TextView testInfo = (TextView)findViewById(R.id.testModeInfo); // Configure device list. adapter = new LeDeviceListAdapter(this); ListView list = (ListView) findViewById(R.id.device_list); list.setAdapter(adapter); list.setOnItemClickListener(createOnItemClickListener()); // Configure verbose debug logging. L.enableDebugLogging(false); // Configure BeaconManager. beaconManager = new BeaconManager(this); try { beaconManager.stopRanging(ALL_ESTIMOTE_BEACONS_REGION); beaconManager.stopMonitoring(ALL_ESTIMOTE_BEACONS_REGION); beaconManager.setBackgroundScanPeriod(5000, 30000); beaconManager.setForegroundScanPeriod(7000, 5000); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } final Button btnScan = (Button)findViewById(R.id.btnScan); btnScan.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { scan(null); } }); final ToggleButton toggleDummy = (ToggleButton) findViewById(R.id.DummyMode); toggleDummy.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { // The toggle is enabled toggleDummy.setBackgroundColor(color.red); dummyBeacon(); testInfo.setVisibility(View.VISIBLE); try { beaconManager.stopRanging(ALL_ESTIMOTE_BEACONS_REGION); beaconManager.stopMonitoring(ALL_ESTIMOTE_BEACONS_REGION); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { // The toggle is disabled toggleDummy.setBackgroundDrawable(null); testInfo.setVisibility(View.GONE); adapter.replaceWith(Collections.<Beacon>emptyList()); } } }); final ToggleButton toggleTest = (ToggleButton) findViewById(R.id.TestMode); toggleTest.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { // The toggle is enabled toggleTest.setBackgroundColor(color.red); testBeacon();; testInfo.setVisibility(View.VISIBLE); btnScan.setEnabled(false); try { beaconManager.stopRanging(ALL_ESTIMOTE_BEACONS_REGION); beaconManager.stopMonitoring(ALL_ESTIMOTE_BEACONS_REGION); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { // The toggle is disabled toggleTest.setBackgroundDrawable(null); testInfo.setVisibility(View.GONE); btnScan.setEnabled(true); adapter.replaceWith(Collections.<Beacon>emptyList()); } } }); //scan the first time the app is opened scan(null); } public void dummyBeacon(){ Beacon jupiter = new Beacon("B9407F30-F5F8-466E-AFF9-25556B57FE6D", "test_beacon", "FE:85:EE:7F:E7:6B", 666, 49567, 5, 45); Beacon saturn = new Beacon("B9407F30-F5F8-466E-AFF9-25556B57FE6D", "test_beacon", "FE:85:EE:7F:E7:6B", 55149, 5016, 5, 45); Beacon neptune = new Beacon("B9407F30-F5F8-466E-AFF9-25556B57FE6D", "test_beacon", "FE:85:EE:7F:E7:6B", 24723, 63838, 5, 45); List<Beacon> dummyBeacon = new ArrayList<Beacon>(2); dummyBeacon.add(jupiter); dummyBeacon.add(saturn); dummyBeacon.add(neptune); adapter.replaceWith(dummyBeacon); } public void testBeacon(){ Beacon jupiter_test = new Beacon("B9407F30-F5F8-466E-AFF9-25556B57FE6D", "Jupiter", "FE:85:EE:7F:E7:6B", 111, 49567, 5, 45); Beacon saturn_test = new Beacon("B9407F30-F5F8-466E-AFF9-25556B57FE6D", "Saturn", "FE:85:EE:7F:E7:6B", 111, 49567, 5, 45); Beacon neptune_test = new Beacon("B9407F30-F5F8-466E-AFF9-25556B57FE6D", "Neptune", "FE:85:EE:7F:E7:6B", 111, 49567, 5, 45); List<Beacon> dummyBeacon = new ArrayList<Beacon>(2); dummyBeacon.add(jupiter_test); dummyBeacon.add(saturn_test); dummyBeacon.add(neptune_test); adapter.replaceWith(dummyBeacon); } private void startProgress(){ progressBar = (ProgressBar)findViewById(R.id.progressBar); progressBar.setVisibility(0); } private void endProgress(){ vScan = (View)findViewById(R.id.btnScan); progressBar.setVisibility(8); vScan.setVisibility(View.VISIBLE); } public void scan(View view){ scanningTime=0; startProgress(); connectToService(); beaconManager.setRangingListener(new BeaconManager.RangingListener() { @Override public void onBeaconsDiscovered(Region region, final List<Beacon> beacons) { // Note that results are not delivered on UI thread. runOnUiThread(new Runnable() { @Override public void run() { scanningTime +=1; List<Beacon> estimoteBeacons = filterBeacons(beacons); adapter.replaceWith(estimoteBeacons); endProgress(); if(scanningTime>0) { try { beaconManager.stopRanging(ALL_ESTIMOTE_BEACONS_REGION); beaconManager.stopMonitoring(ALL_ESTIMOTE_BEACONS_REGION); Log.e("ranging", "stopped searching"); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }); } }); } private List<Beacon> filterBeacons(List<Beacon> beacons) { List<Beacon> filteredBeacons = new ArrayList<Beacon>(beacons.size()); for (Beacon beacon : beacons) { if (beacon.getProximityUUID().equalsIgnoreCase(ESTIMOTE_BEACON_PROXIMITY_UUID) || beacon.getProximityUUID().equalsIgnoreCase(ESTIMOTE_IOS_PROXIMITY_UUID)) { filteredBeacons.add(beacon); } } return filteredBeacons; } @Override protected void onDestroy() { beaconManager.disconnect(); super.onDestroy(); } @Override protected void onPause(){ super.onPause(); // overridePendingTransition(R.anim.activity_open_scale,R.anim.activity_close_translate); } @Override protected void onStart() { super.onStart(); // Check if device supports Bluetooth Low Energy. if (!beaconManager.hasBluetooth()) { Toast.makeText(this, "Device does not have Bluetooth Low Energy", Toast.LENGTH_LONG).show(); return; } // If Bluetooth is not enabled, let user enable it. if (!beaconManager.isBluetoothEnabled()) { Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT); } else { } } @Override protected void onStop() { try { beaconManager.stopRanging(ALL_ESTIMOTE_BEACONS_REGION); } catch (RemoteException e) { Log.d(TAG, "Error while stopping ranging", e); } super.onStop(); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_ENABLE_BT) { if (resultCode == Activity.RESULT_OK) { connectToService(); } else { Toast.makeText(this, "Bluetooth not enabled", Toast.LENGTH_LONG).show(); getActionBar().setSubtitle("Bluetooth not enabled"); } } super.onActivityResult(requestCode, resultCode, data); } private void connectToService() { adapter.replaceWith(Collections.<Beacon>emptyList()); beaconManager.connect(new BeaconManager.ServiceReadyCallback() { @Override public void onServiceReady() { try { beaconManager.startRanging(ALL_ESTIMOTE_BEACONS_REGION); Log.e("ranging", "started searching"); } catch (RemoteException e) { Toast.makeText(ListBeaconsActivity.this, "Cannot start ranging, something terrible happened", Toast.LENGTH_LONG).show(); Log.e(TAG, "Cannot start ranging", e); } } }); } private AdapterView.OnItemClickListener createOnItemClickListener() { return new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent intent = new Intent(ListBeaconsActivity.this, OccupyNowActivity.class); intent.putExtra(EXTRAS_BEACON, adapter.getItem(position)); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Log.e("Activity","StartActivtiy - ListBeacons"); startActivity(intent); } }; } }
[ "fergal.m.carroll@gmail.com" ]
fergal.m.carroll@gmail.com
a86643b6a5da9cbadfa73e5be50245210b6b1ec5
24034df05451d1379cd5d067fd04119989e79ad4
/modules/ioc-unit-resteasy/src/test/java/com/oneandone/iocunit/restassuredtest/http/HeaderResource.java
0251f9261c4df2d21274e349a35cfba13d27d735
[ "Apache-2.0" ]
permissive
isabella232/ioc-unit
da0c604b0a21c97d8e023b4563e9e59527c5a4ba
70d14ab1e514622e574023b6889806132d3e4b48
refs/heads/master
2023-03-08T15:48:51.039896
2021-01-02T16:52:10
2021-01-02T16:52:10
331,292,518
0
0
Apache-2.0
2021-02-24T04:04:53
2021-01-20T11:56:56
null
UTF-8
Java
false
false
768
java
package com.oneandone.iocunit.restassuredtest.http; import javax.ws.rs.GET; import javax.ws.rs.HeaderParam; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; /** * @author aschoerk */ @Path("/header") public class HeaderResource { @GET @Produces(MediaType.APPLICATION_JSON) public Response header(@HeaderParam("headerName") String headerValue, @HeaderParam("User-Agent") String userAgent) { final String entity = "{\"headerName\" : \"" + headerValue + "\", \"user-agent\" : \"" + userAgent + "\"}"; return Response .ok() .entity(entity) .header("Content-Length", entity.length()) .build(); } }
[ "andreas.schoerk@1und1.de" ]
andreas.schoerk@1und1.de
6711f0c073f0c3c2dc71179f8e0c6507756f5b66
b6c1c3ad8e3a0930e389ef8d4bee6ef37a967c0d
/21-02-2020/SpringBootSecurity/src/main/java/com/example/demo/controller/MyUSerDetailsService.java
776b0bdb94f2e17eac1f79a5d2f1cab63480bcab
[ "Apache-2.0" ]
permissive
saikrishna2409/My-First-Repo
547c24e5a36aa768d7d3573f5c3d49164b138596
63b9289598886552a8fd77c867040c2aacbd97cd
refs/heads/master
2023-07-28T05:41:26.596583
2022-10-18T06:50:47
2022-10-18T06:50:47
231,077,012
0
0
Apache-2.0
2023-03-03T01:30:37
2019-12-31T11:19:20
Java
UTF-8
Java
false
false
737
java
package com.example.demo.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; @Service public class MyUSerDetailsService implements UserDetailsService{ @Autowired UserRepository repo; @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { User user= repo.findByUsername(username); if(user==null) throw new UsernameNotFoundException("Üser 404"); return new UserPrincipal(user); } }
[ "w.saikrishnakumarraju1234@gmail.com" ]
w.saikrishnakumarraju1234@gmail.com
88caed44495cb4c4583adc9eb68ebbf7ac0f61b1
d05df16fe00473d0080f8258f184c7a8e438edf1
/duckhunt_livewallpaper/src/com/geekyouup/android/wallpaper/DuckHuntWallpaper.java
7863c20d61f8aaed7c01dd51b62b23d87700972c
[]
no_license
geekyouup/android-duckhunt-livewallpaper
9ec57c86e1f75b63c2c257bccc9db4a02ae65542
d63dd828b18d15392157e53e3e01d5c3def6ebf3
refs/heads/master
2021-01-13T02:03:15.657873
2011-03-10T06:56:48
2011-03-10T06:56:48
39,562,689
0
0
null
null
null
null
UTF-8
Java
false
false
6,681
java
package com.geekyouup.android.wallpaper; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.SystemClock; import android.service.wallpaper.WallpaperService; import android.view.MotionEvent; import android.view.SurfaceHolder; /* * This animated wallpaper draws a rotating wireframe cube. */ public class DuckHuntWallpaper extends WallpaperService { private final Handler mHandler = new Handler(); @Override public void onCreate() { super.onCreate(); } @Override public void onDestroy() { super.onDestroy(); } @Override public Engine onCreateEngine() { return new CubeEngine(this); } class CubeEngine extends Engine { private final Paint mPaint = new Paint(); private final Paint mTextPaint = new Paint(); private float mOffset; private float mTouchX = 50; private float mTouchY = 50; private long mStartTime; private DuckObject mDuck; private Drawable mFireImage; private Bitmap mBackgroundImage; private Rect mFullScreenRect; private boolean mFiring = false; private Context mContext; private boolean mDrawFire = false; private int mMissed = 0; private int mHit = 0; private int mCanvasHeight = 480; private int mCanvasWidth = 320; private final Runnable mDrawCube = new Runnable() { public void run() { updatePhysics(); drawFrame(); } }; private boolean mVisible; public CubeEngine(Context context) { // Create a Paint to draw the lines for our cube mContext=context; mDuck = new DuckObject(context, mCanvasHeight, mCanvasWidth); mBackgroundImage = BitmapFactory.decodeResource(context.getResources(),R.drawable.background2); mFireImage = context.getResources().getDrawable(R.drawable.fire); mFullScreenRect = new Rect(0,0,mCanvasWidth,mCanvasHeight); mTextPaint.setColor(0xff1010ff); mTextPaint.setTextSize(30); mTextPaint.setAntiAlias(true); mStartTime = SystemClock.elapsedRealtime(); } //callback to say object has been hit or moved offscreen public void objectComplete(boolean objectHit) { //object hit or not, when to schedule next one if(objectHit)mHit++; else mMissed++; } @Override public void onCreate(SurfaceHolder surfaceHolder) { super.onCreate(surfaceHolder); // By default we don't get touch events, so enable them. setTouchEventsEnabled(true); } @Override public void onDestroy() { super.onDestroy(); mHandler.removeCallbacks(mDrawCube); } @Override public void onVisibilityChanged(boolean visible) { mVisible = visible; if (visible) { drawFrame(); } else { mHandler.removeCallbacks(mDrawCube); } } @Override public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height) { super.onSurfaceChanged(holder, format, width, height); // store the center of the surface, so we can draw the cube in the right spot mCanvasHeight = height; mCanvasWidth = width; mFullScreenRect = new Rect(0,0,width,height); mDuck = new DuckObject(mContext, height, width); drawFrame(); } @Override public void onSurfaceCreated(SurfaceHolder holder) { super.onSurfaceCreated(holder); } @Override public void onSurfaceDestroyed(SurfaceHolder holder) { super.onSurfaceDestroyed(holder); mVisible = false; mHandler.removeCallbacks(mDrawCube); } @Override public void onOffsetsChanged(float xOffset, float yOffset,float xStep, float yStep, int xPixels, int yPixels) { mOffset = xOffset; drawFrame(); } /* * Store the position of the touch event so we can use it for drawing later */ @Override public void onTouchEvent(MotionEvent event) { mTouchX = event.getX(); mTouchY = event.getY(); mFiring=true; mDrawFire=true; super.onTouchEvent(event); } public void updatePhysics() { mDuck.updatePhysics(this, mFiring, (int) mTouchX, (int) mTouchY); if(mFiring) mFiring=false; } /* * Draw one frame of the animation. This method gets called repeatedly * by posting a delayed Runnable. You can do any drawing you want in * here. This example draws a wireframe cube. */ void drawFrame() { final SurfaceHolder holder = getSurfaceHolder(); Canvas c = null; try { c = holder.lockCanvas(); if (c != null) { // draw something //c.drawColor(0xff222222); c.drawBitmap(mBackgroundImage, null, mFullScreenRect, null); //c.drawText("Hello Richard", mTouchX, mTouchY, mTextPaint); if(mDrawFire) { mFireImage.setBounds((int) mTouchX-16, (int)mTouchY-11, (int)mTouchX+16,(int) mTouchY+11); mFireImage.draw(c); mDrawFire=false; } c.drawText(mMissed+"", 10, mCanvasHeight-10, mTextPaint); c.drawText(mHit+"", mCanvasWidth-10-mTextPaint.measureText(mHit+""), mCanvasHeight-10, mTextPaint); mDuck.draw(c); } } finally { if (c != null) holder.unlockCanvasAndPost(c); } // Reschedule the next redraw mHandler.removeCallbacks(mDrawCube); if (mVisible) { mHandler.postDelayed(mDrawCube, 1000 / 25); } } } }
[ "richard.hyndman@gmail.com" ]
richard.hyndman@gmail.com
6b0bed9b5e574a2d7f0da6e6a90b0434225ef3b9
13ad97802a97fa48ffe1f728657c8a35f4bc847a
/scr/you.java
7d3cfd56049abac08da490554836d047a4d39dd0
[]
no_license
yuio0208/larmar
284451aea45ebe4b10ce919ac665bb4dd090a84a
711112ac60b01e608f43021bad73aebe8b5467d1
refs/heads/master
2023-05-31T08:19:09.903828
2021-06-17T04:37:02
2021-06-17T04:37:02
355,746,641
0
0
null
null
null
null
UHC
Java
false
false
7,841
java
package scr; import java.util.Scanner; public class you { public static void main6548(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); while (true) { System.out.print("Which money do you want? " + "\n1:USD" + "\n2:EUR" + "\n3:JPY" + "\n4:EXIT\n "); int a = sc.nextInt(); switch (a) { case 1: int b = sc.nextInt(); double USD = 1134.4; double num = b / USD; String temp = ""; int outputUSD = (int) (num * 100) / 100; int outputUSD100 = (int) ((num * 100) / 100) / 100; int outputUSD50 = (int) (((num * 100) / 100) % 100) / 50; int outputUSD10 = (int) ((((num * 100) / 100) % 100) % 50) / 10; int outputUSD5 = (int) (((((num * 100) / 100) % 100) % 50) % 10) / 5; int outputUSD1 = (int) ((((((num * 100) / 100) % 100) % 50) % 10) % 5) / 1; int changeUSD = (int) (b - (outputUSD * USD)); int changeUSD500 = (int) ((b - (outputUSD * USD))) / 500; int changeUSD100 = (int) ((b - ((outputUSD * USD))) % 500) / 100; int changeUSD50 = (int) ((b - (((outputUSD * USD))) % 500) % 100) / 50; int changeUSD10 = (int) ((b - ((((outputUSD * USD))) % 500) % 100) % 50) / 10; int changeUSD5 = (int) ((b - (((((outputUSD * USD))) % 500) % 100) % 50) % 10) / 5; int changeUSD1 = (int) ((b - ((((((outputUSD * USD))) % 500) % 100) % 50) % 10) % 5) / 1; temp += "원화 입력" + b; System.out.println("원화 입력 : " + b); temp += "1: USD"; System.out.println("1: USD"); System.out.println("환전결과 : " + outputUSD + "달러"); System.out.println("100달러 : " + outputUSD100 + "장"); System.out.println("50달러 : " + outputUSD50 + "장"); System.out.println("10달러 : " + outputUSD10 + "장"); System.out.println("5달러 : " + outputUSD5 + "장"); System.out.println("1달러 : " + outputUSD1 + "장"); System.out.println("거스름돈 : " + changeUSD + "원"); System.out.println("500원 : " + changeUSD500 + "개"); System.out.println("100원 : " + changeUSD100 + "개"); System.out.println("50원 : " + changeUSD50 + "개"); System.out.println("10원 : " + changeUSD10 + "개"); System.out.println("5원 : " + changeUSD5 + "개"); System.out.println("1원 : " + changeUSD1 + "개"); break; case 2: b = sc.nextInt(); double EUR = 1333.13; double num1 = b / EUR; int outputEUR = (int) (num1 * 100) / 100; int outputEUR500 = (int) ((num1 * 100) / 100) / 500; int outputEUR200 = (int) (((num1 * 100) / 100) % 500) / 200; int outputEUR100 = (int) ((((num1 * 100) / 100) % 500) % 200) / 100; int outputEUR50 = (int) (((((num1 * 100) / 100) % 500) % 200) % 100) / 50; int outputEUR20 = (int) ((((((num1 * 100) / 100) % 500) % 200) % 100) % 50) / 20; int outputEUR10 = (int) (((((((num1 * 100) / 100) % 500) % 200) % 100) % 50) % 20) / 10; int outputEUR5 = (int) ((((((((num1 * 100) / 100) % 500) % 200) % 100) % 50) % 20) % 10) / 5; int outputEUR2 = (int) (((((((((num1 * 100) / 100) % 500) % 200) % 100) % 50) % 20) % 10) % 5) / 2; int outputEUR1 = (int) ((((((((((num1 * 100) / 100) % 500) % 200) % 100) % 50) % 20) % 10) % 5) % 2) / 1; int changeEUR = (int) (b - outputEUR * EUR); int changeEUR500 = (int) (b - (outputEUR * EUR)) / 500; int changeEUR100 = (int) ((b - (outputEUR * EUR)) % 500) / 100; int changeEUR50 = (int) (((b - (outputEUR * EUR)) % 500) % 100) / 50; int changeEUR10 = (int) ((((b - (outputEUR * EUR)) % 500) % 100) % 50) / 10; int changeEUR5 = (int) (((((b - (outputEUR * EUR)) % 500) % 100) % 50) % 10) / 5; int changeEUR1 = (int) ((((((b - (outputEUR * EUR)) % 500) % 100) % 50) % 10) % 5) / 1; System.out.println("원화 입력 : " + b); System.out.println("2: EUR"); System.out.println("환전결과 : " + outputEUR + "유로"); System.out.println("500유로 : " + outputEUR500 + "장"); System.out.println("200유로 : " + outputEUR200 + "장"); System.out.println("100유로 : " + outputEUR100 + "장"); System.out.println("50유로 : " + outputEUR50 + "장"); System.out.println("20유로 : " + outputEUR20 + "장"); System.out.println("10유로 : " + outputEUR10 + "장"); System.out.println("5유로 : " + outputEUR5 + "장"); System.out.println("2유로 : " + outputEUR2 + "개"); System.out.println("1유로 : " + outputEUR1 + "개"); System.out.println("거스름돈 : " + changeEUR + "원"); System.out.println("500원 : " + changeEUR500 + "개"); System.out.println("100원 : " + changeEUR100 + "개"); System.out.println("50원 : " + changeEUR50 + "개"); System.out.println("10원 : " + changeEUR10 + "개"); System.out.println("5원 : " + changeEUR5 + "개"); System.out.println("1원 : " + changeEUR1 + "개"); break; case 3: b = sc.nextInt(); double JPY = 10.30; double num2 = b / JPY; int outputJPY = (int) (num2 * 100) / 100; int outputJPY10000 = (int) ((num2 * 100) / 100) / 10000; int outputJPY5000 = (int) (((num2 * 100) / 100) % 10000) / 5000; int outputJPY2000 = (int) ((((num2 * 100) / 100) % 10000) % 5000) / 2000; int outputJPY1000 = (int) (((((num2 * 100) / 100) % 10000) % 5000) % 2000) / 1000; int outputJPY500 = (int) ((((((num2 * 100) / 100) % 10000) % 5000) % 2000) % 1000) / 500; int outputJPY100 = (int) (((((((num2 * 100) / 100) % 10000) % 5000) % 2000) % 1000) % 500) / 100; int outputJPY50 = (int) ((((((((num2 * 100) / 100) % 10000) % 5000) % 2000) % 1000) % 500) % 100) / 50; int outputJPY10 = (int) (((((((((num2 * 100) / 100) % 10000) % 5000) % 2000) % 1000) % 500) % 100) % 50) / 10; int outputJPY5 = (int) ((((((((((num2 * 100) / 100) % 10000) % 5000) % 2000) % 1000) % 500) % 100) % 50) % 10) / 5; int outputJPY1 = (int) (((((((((((num2 * 100) / 100) % 10000) % 5000) % 2000) % 1000) % 500) % 100) % 50) % 10) % 5) / 1; int changeJPY = (int) (b - (outputJPY * JPY)); int changeJPY500 = (int) ((b - (outputJPY * JPY))) / 500; int changeJPY100 = (int) ((b - ((outputJPY * JPY))) % 500) / 100; int changeJPY50 = (int) ((b - (((outputJPY * JPY))) % 500) % 100) / 50; int changeJPY10 = (int) ((b - ((((outputJPY * JPY))) % 500) % 100) % 50) / 10; int changeJPY5 = (int) ((b - (((((outputJPY * JPY))) % 500) % 100) % 50) % 10) / 5; int changeJPY1 = (int) ((b - ((((((outputJPY * JPY))) % 500) % 100) % 50) % 10) % 5) / 1; System.out.println("원화 입력 : " + b); System.out.println("3: JPY"); System.out.println("환전결과 : " + outputJPY + "엔"); System.out.println("10000엔: " + outputJPY10000 + "장"); System.out.println("5000엔: " + outputJPY5000 + "장"); System.out.println("2000엔 : " + outputJPY2000 + "장"); System.out.println("1000엔 : " + outputJPY1000 + "장"); System.out.println("500엔 : " + outputJPY500 + "개"); System.out.println("100엔 : " + outputJPY100 + "개"); System.out.println("50엔 : " + outputJPY50 + "개"); System.out.println("10엔 : " + outputJPY10 + "개"); System.out.println("5엔 : " + outputJPY5 + "개"); System.out.println("1엔 : " + outputJPY1 + "개"); System.out.println("거스름돈 : " + changeJPY + "원"); System.out.println("500원 : " + changeJPY500 + "개"); System.out.println("100원 : " + changeJPY100 + "개"); System.out.println("50원 : " + changeJPY50 + "개"); System.out.println("10원 : " + changeJPY10 + "개"); System.out.println("5원 : " + changeJPY5 + "개"); System.out.println("1원 : " + changeJPY1 + "개"); break; case 4: break; } } } }
[ "noreply@github.com" ]
noreply@github.com
74c054c96bbe1b78a887006eea14f1f3d3ce6b01
1dc4c13ff1a2eabea0b6df5e6ea7cb8ed8c8569b
/MyPRP/src/nekio/myprp/recursos/utilerias/gui/swing/PanelFormulario.java
484f93617bfe0f8e35fa5ffc074dc5ffa070e8a7
[]
no_license
nekio/nekio
0914b910b40bbed90a31ef42bde3d53b17c1b41a
09ffb06505e334f333579f625d68af62f21932e1
refs/heads/master
2021-01-01T19:06:26.540734
2014-09-15T19:29:45
2014-09-15T19:29:45
33,142,871
1
0
null
null
null
null
UTF-8
Java
false
false
7,214
java
package nekio.myprp.recursos.utilerias.gui.swing; /** * * @author Nekio */ import java.awt.BorderLayout; import java.awt.Component; import java.util.ArrayList; import java.util.List; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import nekio.myprp.recursos.utilerias.Globales; import nekio.myprp.recursos.utilerias.plantillas.swing.SwingJPanel; public class PanelFormulario extends SwingJPanel{ private static final long serialVersionUID = 1L; private String esquemaBD; private List<String> tablasForaneas; private List<String> camposBD; private List valoresBD; private List<Globales.TipoDato> tiposDatoBD; private List<String> valoresLOV; private List<List> camposExtrasLOV; private boolean nuevo; private List registrosLlave; private List registrosNoLlave; private List registrosLlaveValor; private List registrosNoLlaveValor; private List objetosCampos; public PanelFormulario(){ this(null, null, null, null); } public PanelFormulario(List<String> camposBD, List valoresBD, List<Globales.TipoDato> tiposDatoBD, List<String> valoresLOV){ this(camposBD, valoresBD, tiposDatoBD, valoresLOV, null); } public PanelFormulario(List<String> camposBD, List valoresBD, List<Globales.TipoDato> tiposDatoBD, List<String> valoresLOV, String esquemaBD){ this(null, camposBD, valoresBD, tiposDatoBD, valoresLOV, null, esquemaBD); } public PanelFormulario(List<String> tablasForaneas, List<String> camposBD, List valoresBD, List<Globales.TipoDato> tiposDatoBD, List<String> valoresLOV, List<List> camposExtrasLOV, String esquemaBD){ this(tablasForaneas, camposBD, valoresBD, tiposDatoBD, valoresLOV, camposExtrasLOV, esquemaBD, false); } public PanelFormulario(List<String> tablasForaneas, List<String> camposBD, List valoresBD, List<Globales.TipoDato> tiposDatoBD, List<String> valoresLOV, List<List> camposExtrasLOV, String esquemaBD, boolean nuevo){ this.tablasForaneas = tablasForaneas; this.camposBD = camposBD; this.valoresBD = valoresBD; this.tiposDatoBD = tiposDatoBD; this.valoresLOV = valoresLOV; this.camposExtrasLOV = camposExtrasLOV; this.esquemaBD = esquemaBD; this.nuevo = nuevo; inicializarPanel(); } private void inicializarPanel(){ this.setLayout(new BorderLayout()); if(camposBD != null){ identificarRegistros(); agregarComponentes(); agregarEscuchadores(); } this.setVisible(true); } @Override public void agregarComponentes(){ JPanel pnlTabla = new JPanel(new BorderLayout()); /* PANEL DE LLAVES*/ JPanel pnlLlaves = new JPanel(new BorderLayout()); pnlLlaves.add(new JLabel(" Llaves:"),"North"); pnlLlaves.add(agregarLlaves(),"Center"); pnlTabla.add(pnlLlaves,"North"); JPanel pnlCampos = new JPanel(new BorderLayout()); pnlCampos.add(new JLabel(" Campos:"),"North"); pnlCampos.add(agregarCampos()); pnlTabla.add(pnlCampos, "Center"); this.add(pnlTabla,"Center"); } @Override public void agregarEscuchadores() { } private Box agregarLlaves(){ String campo = null; String tablaForanea = null; Object valor = null; Globales.TipoDato tipoDato = null; String valorLOV = null; List<String> camposExtraLOV = null; int campos = registrosLlave.size(); JPanel pnlLlaves = new JPanel(); pnlLlaves.setLayout(new BoxLayout(pnlLlaves, BoxLayout.Y_AXIS)); Box caja=Box.createVerticalBox(); caja.add(new JScrollPane(pnlLlaves)); PanelCampo pnlLlave = null; for(int i=0; i<campos; i++){ campo = String.valueOf(registrosLlave.get(i)); valor = registrosLlaveValor.get(i); tipoDato = tiposDatoBD.get(i); // El indice de los valores LOV esta desfazado en una posicion // respecto del indice en los registros de Llaves if(i!=0){ try{ valorLOV = valoresLOV.get(i-1); }catch(Exception e){} try{ camposExtraLOV = camposExtrasLOV.get(i-1); }catch(Exception e){} try{ tablaForanea = tablasForaneas.get(i-1); }catch(Exception e){} } pnlLlave = new PanelCampo(tablaForanea, campo, valor, tipoDato, true, valorLOV, esquemaBD, camposExtraLOV, nuevo); pnlLlaves.add(pnlLlave, Component.CENTER_ALIGNMENT); objetosCampos.add(pnlLlave.obtenerObjeto()); } return caja; } private Box agregarCampos(){ String campo = null; Object valor = null; Globales.TipoDato tipoDato = null; int llaves = this.registrosLlave.size(); int campos = this.registrosNoLlave.size(); JPanel pnlCampos = new JPanel(); pnlCampos.setLayout(new BoxLayout(pnlCampos, BoxLayout.Y_AXIS)); Box caja=Box.createVerticalBox(); caja.add(new JScrollPane(pnlCampos)); PanelCampo pnlCampo = null; for(int i=0; i<campos; i++){ campo = String.valueOf(registrosNoLlave.get(i)); valor = registrosNoLlaveValor.get(i); tipoDato = tiposDatoBD.get(llaves+i); pnlCampo = new PanelCampo(campo, valor, tipoDato, false, esquemaBD, nuevo); pnlCampos.add(pnlCampo, Component.CENTER_ALIGNMENT); objetosCampos.add(pnlCampo.obtenerObjeto()); } return caja; } private void identificarRegistros(){ String campo = null; Object valor = null; registrosLlave = new ArrayList(); registrosLlaveValor = new ArrayList(); registrosNoLlave = new ArrayList(); registrosNoLlaveValor = new ArrayList(); objetosCampos = new ArrayList(); for(int i=0; i<camposBD.size(); i++){ campo = camposBD.get(i); try{ valor = valoresBD.get(i); }catch(Exception e){} if(campo.toUpperCase().startsWith(Globales.BD_TABLA_ID.toUpperCase())){ registrosLlave.add(campo); registrosLlaveValor.add(valor); }else{ registrosNoLlave.add(campo); registrosNoLlaveValor.add(valor); } } } public List getObjetosCampos() { return objetosCampos; } }
[ "ivan.carrillo.88@gmail.com@8237a79a-abb5-6d77-78af-c8b5f61cad0c" ]
ivan.carrillo.88@gmail.com@8237a79a-abb5-6d77-78af-c8b5f61cad0c
aee85ef0e9ca80adf445bf13ea95c61932be0da3
91b97c8ed5659a0a746fab6af310427ba7a35146
/app/src/main/java/com/sgj/john/mousepaint/fragment/CardFragment.java
57917de8c824b0b0516a4fde5ba02d53d2eb72ac
[]
no_license
Rain-drops/MousePaint
565182a0eee586e61525c10e4ec19c2a773109ff
da86eb41f904a3dedb2207307cadfb4656ecb634
refs/heads/master
2021-01-10T16:07:32.988756
2016-05-04T02:24:23
2016-05-04T02:24:23
58,016,236
2
0
null
null
null
null
UTF-8
Java
false
false
5,004
java
package com.sgj.john.mousepaint.fragment; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.text.Html; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.bumptech.glide.Glide; import com.sgj.john.mousepaint.DetialActivity; import com.sgj.john.mousepaint.R; import com.sgj.john.mousepaint.customview.HtmlTextView; import com.sgj.john.mousepaint.model.Card; import com.sgj.john.mousepaint.utils.AppUtils; /** * 精选漫画 */ public class CardFragment extends AbsBaseFragment implements View.OnClickListener { protected Card mCard; protected TextView mAuthorText; protected ImageView mBottomEdgeImageView; protected TextView mBravoNumText; protected RelativeLayout mCardLayout; protected ImageView mCoverImageView; protected HtmlTextView mDigestText; protected TextView digestText; protected TextView mSubTitleText; protected TextView mTitleText; /** * 当你小心翼翼的创建了一个带有重要参数的Fragment的之后,一旦由于什么原因(横竖屏切换)导致你的Fragment重新创建。 * ——-很遗憾的告诉你,你之前传递的参数都不见了,因为recreate你的Fragment的时候,调用的是默认构造函数。 * 而使用系统推荐的 Fragment.setArguments(Bundle)来传递参数。就可以有效的避免这一个问题,当你的Fragment销毁的时候, * 其中的Bundle会保存下来,当要重新创建的时候会检查Bundle是否为null,如果不为null,就会使用bundle作为参数来重新创建fragment. * @param card * @return */ public static CardFragment getInstance(Card card){ CardFragment localCardFragment = new CardFragment(); Bundle localBundle = new Bundle(); localBundle.putSerializable("card", card); localCardFragment.setArguments(localBundle); return localCardFragment; } @Override protected void initActions(View paramView) { } @Override protected void initData() { this.mCard = (Card) getArguments().getSerializable("card"); } @Override protected View initView(LayoutInflater parpmLayoutInflater) { View view = parpmLayoutInflater.inflate(R.layout.fragment_card, null); mAuthorText = (TextView) view.findViewById(R.id.text_author); mBottomEdgeImageView = (ImageView) view.findViewById(R.id.image_bottom_edge); mBravoNumText = (TextView) view.findViewById(R.id.text_bravos); mCardLayout = (RelativeLayout) view.findViewById(R.id.box_card); mCardLayout.setOnClickListener(this); mCoverImageView = (ImageView) view.findViewById(R.id.image_cover); // mDigestText = (HtmlTextView) view.findViewById(R.id.text_digest); digestText = (TextView) view.findViewById(R.id.text_digest); mSubTitleText = (TextView) view.findViewById(R.id.text_subtitle); mTitleText = (TextView) view.findViewById(R.id.text_title); mTitleText.setText(this.mCard.getTitle()); mSubTitleText.setText(this.mCard.getSubTitle()); this.mBravoNumText.setText("No." + this.mCard.getUpNum()); // this.mDigestText.setText(this.mCard.getDigest()); this.digestText.setText(this.mCard.getDigest()); this.mAuthorText.setText(Html.fromHtml("<B>" + this.mCard.getAuthorName() + "</B>")); initAndDisplayCoverImage(); return view; } /** * 初始化和显示封面图片 */ private void initAndDisplayCoverImage() { int coverWidth = AppUtils.getScreenDisplayMetrics(getActivity()).widthPixels - 2 * getResources().getDimensionPixelSize(R.dimen.card_margin); int coverHeight = (int) (180.0F * (coverWidth / 320.0F)); //用于child view(子视图) 向 parent view(父视图)传达自己的意愿 ViewGroup.LayoutParams localLayoutParams = this.mCoverImageView.getLayoutParams(); localLayoutParams.height = Float.valueOf(coverHeight).intValue(); Glide.with(getActivity()).load(mCard.getCoverImgerUrl()).centerCrop().into(mCoverImageView); } @Override public void onDestroy() { this.mCoverImageView.setImageBitmap(null); super.onDestroy(); } @Override public void onDestroyView() { this.mCoverImageView.setImageBitmap(null); super.onDestroyView(); } @Override public void onClick(View v) { switch (v.getId()){ case R.id.box_card: Intent intent = new Intent(); intent.putExtra("bookId", mCard.getId()); intent.setClass(getActivity(), DetialActivity.class); startActivity(intent); break; } } }
[ "710637881@qq.com" ]
710637881@qq.com
97d7daaf89b296178bb7440941c9f11adce4af4d
ccb6cc379d19f36e751aa1e462c2abc8a6217367
/src/main/java/cn/com/gene/weixin/MD5.java
2372b85474d451559c40f51ed483f0155458704e
[]
no_license
uu04418/genealogy
83bbb4e0632a31ce14701ba4533f990495b1db1c
7e58c39f37760629581ad12000b45590534dc296
refs/heads/master
2020-04-17T16:31:09.271743
2019-01-21T03:39:07
2019-01-21T03:39:07
166,743,538
0
0
null
null
null
null
UTF-8
Java
false
false
1,503
java
package cn.com.gene.weixin; import java.security.MessageDigest; /** * User: rizenguo * Date: 2014/10/23 * Time: 15:43 */ public class MD5 { private final static String[] hexDigits = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}; /** * 转换字节数组为16进制字串 * @param b 字节数组 * @return 16进制字串 */ public static String byteArrayToHexString(byte[] b) { StringBuilder resultSb = new StringBuilder(); for (byte aB : b) { resultSb.append(byteToHexString(aB)); } return resultSb.toString(); } /** * 转换byte到16进制 * @param b 要转换的byte * @return 16进制格式 */ private static String byteToHexString(byte b) { int n = b; if (n < 0) { n = 256 + n; } int d1 = n / 16; int d2 = n % 16; return hexDigits[d1] + hexDigits[d2]; } /** * MD5编码 * @param origin 原始字符串 * @return 经过MD5加密之后的结果 */ public static String MD5Encode(String origin) { String resultString = null; try { resultString = origin; MessageDigest md = MessageDigest.getInstance("MD5"); resultString = byteArrayToHexString(md.digest(resultString.getBytes())); } catch (Exception e) { e.printStackTrace(); } return resultString; } }
[ "lucy" ]
lucy
26436fa1d03b6ba9b715a875474ffc2919167116
0c591fb0a14df2967639ecdd091c41ca58ccc4b4
/com/google/android/gms/tagmanager/zzax.java
5145344f8355fbfd5f63fda08cb882f9241cceac
[]
no_license
AleksandrinaKrumova2/Tado
8dfa355c0287ba630f175fbae84a033df0a4cfe6
19fdac6c4b04edf26360298bd8be43b240a1b605
refs/heads/master
2020-03-07T22:49:32.201011
2018-04-12T13:26:47
2018-04-12T13:26:47
127,763,263
0
0
null
null
null
null
UTF-8
Java
false
false
4,870
java
package com.google.android.gms.tagmanager; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteException; import android.database.sqlite.SQLiteOpenHelper; import android.os.Build.VERSION; import com.google.firebase.analytics.FirebaseAnalytics.Param; import com.tado.android.installation.CreateHomeContactDetailsActivity; import com.tado.android.onboarding.OnboardingPageFragment; import java.util.HashSet; import java.util.Set; final class zzax extends SQLiteOpenHelper { private /* synthetic */ zzat zzkfa; zzax(zzat com_google_android_gms_tagmanager_zzat, Context context, String str) { this.zzkfa = com_google_android_gms_tagmanager_zzat; super(context, str, null, 1); } private static boolean zza(String str, SQLiteDatabase sQLiteDatabase) { Cursor cursor; String str2; String valueOf; Throwable th; Cursor cursor2 = null; try { Cursor query = sQLiteDatabase.query("SQLITE_MASTER", new String[]{CreateHomeContactDetailsActivity.INTENT_NAME}, "name=?", new String[]{str}, null, null, null); try { boolean moveToFirst = query.moveToFirst(); if (query == null) { return moveToFirst; } query.close(); return moveToFirst; } catch (SQLiteException e) { cursor = query; try { str2 = "Error querying for table "; valueOf = String.valueOf(str); zzdj.zzcu(valueOf.length() == 0 ? new String(str2) : str2.concat(valueOf)); if (cursor != null) { cursor.close(); } return false; } catch (Throwable th2) { cursor2 = cursor; th = th2; if (cursor2 != null) { cursor2.close(); } throw th; } } catch (Throwable th3) { th = th3; cursor2 = query; if (cursor2 != null) { cursor2.close(); } throw th; } } catch (SQLiteException e2) { cursor = null; str2 = "Error querying for table "; valueOf = String.valueOf(str); if (valueOf.length() == 0) { } zzdj.zzcu(valueOf.length() == 0 ? new String(str2) : str2.concat(valueOf)); if (cursor != null) { cursor.close(); } return false; } catch (Throwable th4) { th = th4; if (cursor2 != null) { cursor2.close(); } throw th; } } public final SQLiteDatabase getWritableDatabase() { SQLiteDatabase sQLiteDatabase = null; try { sQLiteDatabase = super.getWritableDatabase(); } catch (SQLiteException e) { this.zzkfa.mContext.getDatabasePath("google_tagmanager.db").delete(); } return sQLiteDatabase == null ? super.getWritableDatabase() : sQLiteDatabase; } public final void onCreate(SQLiteDatabase sQLiteDatabase) { zzbs.zzlo(sQLiteDatabase.getPath()); } public final void onDowngrade(SQLiteDatabase sQLiteDatabase, int i, int i2) { } public final void onOpen(SQLiteDatabase sQLiteDatabase) { if (VERSION.SDK_INT < 15) { Cursor rawQuery = sQLiteDatabase.rawQuery("PRAGMA journal_mode=memory", null); try { rawQuery.moveToFirst(); } finally { rawQuery.close(); } } if (zza("datalayer", sQLiteDatabase)) { Cursor rawQuery2 = sQLiteDatabase.rawQuery("SELECT * FROM datalayer WHERE 0", null); Set hashSet = new HashSet(); try { String[] columnNames = rawQuery2.getColumnNames(); for (Object add : columnNames) { hashSet.add(add); } if (!hashSet.remove(OnboardingPageFragment.FEATURE_KEY) || !hashSet.remove(Param.VALUE) || !hashSet.remove("ID") || !hashSet.remove("expires")) { throw new SQLiteException("Database column missing"); } else if (!hashSet.isEmpty()) { throw new SQLiteException("Database has extra columns"); } } finally { rawQuery2.close(); } } else { sQLiteDatabase.execSQL(zzat.zzkeu); } } public final void onUpgrade(SQLiteDatabase sQLiteDatabase, int i, int i2) { } }
[ "noreply@github.com" ]
noreply@github.com
7edc1c5e149b57e76a29fdb03abd73aa28937118
86f15f533223a0f86848eb14fc982a70efee87ba
/POS/src/main/java/com/sinolife/pos/common/dto/PosSurvivalDueDTO.java
4a16f8a2e3bbbab3113722b15efc89058752f58c
[]
no_license
wangmingshun/soft
4567ba7551b2a36aea8d97c7146ca5f4803b9757
9dc3342de21ae8b62f10717783226ef3c58170b0
refs/heads/master
2020-04-06T06:59:10.295796
2016-07-24T15:45:45
2016-07-24T15:45:45
64,008,542
1
2
null
null
null
null
UTF-8
Java
false
false
4,524
java
package com.sinolife.pos.common.dto; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import org.springframework.format.annotation.DateTimeFormat; /** * 生存金应领表DTO */ public class PosSurvivalDueDTO implements Serializable { /** * */ private static final long serialVersionUID = 1001557494096076389L; private String policyNo; //保单号 private Integer prodSeq; //产品序号 private Integer survivalSeq; //生存金给付序号 private String productCode; //产品代码 @DateTimeFormat(pattern="yyyy-MM-dd") private Date payDueDate; //应领日期 private BigDecimal payDueSum; //应领金额 private BigDecimal interestSum; //利息金额 private String payDueSeq; //应付流水号 private String payDueFlag; //应付标志 private String validFlag; //有效标志 private String payFactFlag; //实付标志 private String pkSerial; //数据主键 private String survivalType; //生存金类型 /* 非表字段属性 */ private String productAbbrName; //险种简称 private String productFullName; //险种全称 private boolean checked; //是否选中 private String canBeSelectedFlag;//是否可选 private String message; //不可选消息 private String agreeMaturitySum; // 协议满期金额 private String branchPercent;// 特殊件—协议满期 分公司承担比例 private String backBenefit;// 既得利益 public String getBranchPercent() { return branchPercent; } public void setBranchPercent(String branchPercent) { this.branchPercent = branchPercent; } public String getBackBenefit() { return backBenefit; } public void setBackBenefit(String backBenefit) { this.backBenefit = backBenefit; } public String getAgreeMaturitySum() { return agreeMaturitySum; } public void setAgreeMaturitySum(String agreeMaturitySum) { this.agreeMaturitySum = agreeMaturitySum; } /* 属性存取 */ public String getPolicyNo() { return policyNo; } public void setPolicyNo(String policyNo) { this.policyNo = policyNo; } public Integer getProdSeq() { return prodSeq; } public void setProdSeq(Integer prodSeq) { this.prodSeq = prodSeq; } public Integer getSurvivalSeq() { return survivalSeq; } public void setSurvivalSeq(Integer survivalSeq) { this.survivalSeq = survivalSeq; } public String getProductCode() { return productCode; } public void setProductCode(String productCode) { this.productCode = productCode; } public Date getPayDueDate() { return payDueDate; } public void setPayDueDate(Date payDueDate) { this.payDueDate = payDueDate; } public BigDecimal getPayDueSum() { return payDueSum; } public void setPayDueSum(BigDecimal payDueSum) { this.payDueSum = payDueSum; } public BigDecimal getInterestSum() { return interestSum; } public void setInterestSum(BigDecimal interestSum) { this.interestSum = interestSum; } public String getPayDueSeq() { return payDueSeq; } public void setPayDueSeq(String payDueSeq) { this.payDueSeq = payDueSeq; } public String getPayDueFlag() { return payDueFlag; } public void setPayDueFlag(String payDueFlag) { this.payDueFlag = payDueFlag; } public String getValidFlag() { return validFlag; } public void setValidFlag(String validFlag) { this.validFlag = validFlag; } public String getPayFactFlag() { return payFactFlag; } public void setPayFactFlag(String payFactFlag) { this.payFactFlag = payFactFlag; } public String getPkSerial() { return pkSerial; } public void setPkSerial(String pkSerial) { this.pkSerial = pkSerial; } public String getProductAbbrName() { return productAbbrName; } public void setProductAbbrName(String productAbbrName) { this.productAbbrName = productAbbrName; } public String getProductFullName() { return productFullName; } public void setProductFullName(String productFullName) { this.productFullName = productFullName; } public boolean isChecked() { return checked; } public void setChecked(boolean checked) { this.checked = checked; } public String getCanBeSelectedFlag() { return canBeSelectedFlag; } public void setCanBeSelectedFlag(String canBeSelectedFlag) { this.canBeSelectedFlag = canBeSelectedFlag; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getSurvivalType() { return survivalType; } public void setSurvivalType(String survivalType) { this.survivalType = survivalType; } }
[ "461514274@qq.com" ]
461514274@qq.com
c8e2b1ca16fdcdef2ccb6fd4430a693c71006f53
1f2820e37c105cd013c12a1570cea1c5ed9a061c
/code/MMServerEngine/src/main/java/com/mm/engine/framework/control/job/JobDb.java
f3d153f87270a476dc6384c46049b89f5ad4c299
[]
no_license
xuerong/SingleServerEngine
de1f0145aba9d265e1d2aab981eb17df887c5cef
e5c74b4a445c4be1fe7d4cd3bb8995a2dbdb93f9
refs/heads/master
2021-06-26T03:22:26.810677
2018-04-06T03:07:14
2018-04-06T03:07:14
95,869,883
0
0
null
null
null
null
UTF-8
Java
false
false
1,578
java
package com.mm.engine.framework.control.job; import com.mm.engine.framework.data.persistence.orm.annotation.DBEntity; import java.io.Serializable; import java.sql.Timestamp; import java.util.Date; /** * Created by apple on 16-10-2. */ @DBEntity(tableName = "job",pks = {"id"}) public class JobDb implements Serializable { private String id; // private Timestamp startDate; // 执行时间,之所以不用delay,是因为如重启服务器的时候要加载job, private int db; // 是否持久化,跟随系统启动而启动的一般不需要db, private String method; private String serviceClass; private Object[] params; // 参数要能够序列化 public JobDb(){} public String getId() { return id; } public void setId(String id) { this.id = id; } public Timestamp getStartDate() { return startDate; } public void setStartDate(Timestamp startDate) { this.startDate = startDate; } public int getDb() { return db; } public void setDb(int db) { this.db = db; } public String getMethod() { return method; } public void setMethod(String method) { this.method = method; } public String getServiceClass() { return serviceClass; } public void setServiceClass(String serviceClass) { this.serviceClass = serviceClass; } public Object[] getParams() { return params; } public void setParams(Object[] params) { this.params = params; } }
[ "zhengyuzhen@elex-tech.com" ]
zhengyuzhen@elex-tech.com
0d090c82fc7881d3794761c0f79a4a95e0a7934e
e007d43804fb464a8c414e6c58c6059b05003235
/src/main/java/com/codapes/siswisp/model/UsuarioModel.java
adc73d681d99a30c9edd3a68c2d6984d8d689377
[]
no_license
christian1607/siswisp
127f8b17dc3829afe91dc24a0557196a78b1c1d4
97ba9b08517e3d61b57ab115f18542cc027aaf8b
refs/heads/master
2021-06-04T02:23:30.126827
2018-07-19T15:27:56
2018-07-19T15:27:56
56,817,532
1
0
null
null
null
null
UTF-8
Java
false
false
2,369
java
package com.codapes.siswisp.model; import java.util.Date; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.springframework.format.annotation.DateTimeFormat; public class UsuarioModel { //Usuario private String nombreUsuario; private String apellido; private String direccion; private String telefono; //Equipo private int equipo; //CuentaUsuario private String user; private String password; private String velocidad; private long pagoMensual; @Temporal(TemporalType.DATE) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private Date fechaInicio; public String getNombreUsuario() { return nombreUsuario; } public void setNombreUsuario(String nombreUsuario) { this.nombreUsuario = nombreUsuario; } public String getApellido() { return apellido; } public void setApellido(String apellido) { this.apellido = apellido; } public String getDireccion() { return direccion; } public void setDireccion(String direccion) { this.direccion = direccion; } public String getTelefono() { return telefono; } public void setTelefono(String telefono) { this.telefono = telefono; } public void setEquipo(int equipo) { this.equipo = equipo; } public int getEquipo() { return equipo; } public String getUser() { return user; } public void setUser(String user) { this.user = user; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getVelocidad() { return velocidad; } public void setVelocidad(String velocidad) { this.velocidad = velocidad; } public long getPagoMensual() { return pagoMensual; } public void setPagoMensual(long pagoMensual) { this.pagoMensual = pagoMensual; } public Date getFechaInicio() { return fechaInicio; } public void setFechaInicio(Date fechaInicio) { this.fechaInicio = fechaInicio; } }
[ "christian.altamirano.ayala@gmail.com" ]
christian.altamirano.ayala@gmail.com
79e55d2f9f0c6d2cbfec8fb84cced72cede8b3ae
709bea6d3ced91613b2a8c9b254d6d3856397fbf
/docDecanat/src/main/java/dec/docDecanat/data/entity/GroupSubject.java
cec4e1224132dfb7bd085949d0e36f1bbf4aa002
[]
no_license
rashidovn/docDecanat
5aff278d72b58caee624efd6a105a16c78feb3de
e35c5bcc49d77d46f1a81d6d1126bfacda59a63c
refs/heads/master
2020-12-30T21:54:51.952832
2014-10-26T06:41:09
2014-10-26T06:43:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,879
java
package dec.docDecanat.data.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity @Table(name="link_group_semester_subject") public class GroupSubject { private Long id; private double esoGradeCurrent; private double esoGradeMax; private Integer esoStudyCount; private double hoursCourseProject; //(КП) часы на курсовой проект private double hoursCourseWork; // (КР) часы на курсовую работу private double hoursControlDistance; //(КРЗ) часы на контроль работы заочника private double hoursConsult; // часы на консультацию private double hoursControlSelfStudy; // часы на контроль самостоятельной работы private GroupSemester groupSemester; private Subject subject; public GroupSubject() { super(); } public GroupSubject(double esoGradeCurrent, double esoGradeMax, Integer esoStudyCount, double hoursCourseProject, double hoursCourseWork, double hoursControlDistance, double hoursConsult, double hoursControlSelfStudy) { super(); this.esoGradeCurrent = esoGradeCurrent; this.esoGradeMax = esoGradeMax; this.esoStudyCount = esoStudyCount; this.hoursCourseProject = hoursCourseProject; this.hoursCourseWork = hoursCourseWork; this.hoursControlDistance = hoursControlDistance; this.hoursConsult = hoursConsult; this.hoursControlSelfStudy = hoursControlSelfStudy; } @Id @Column(name="id_link_group_semester_subject") @GeneratedValue public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Column(name="esogradecurrent") public double getEsoGradeCurrent() { return esoGradeCurrent; } public void setEsoGradeCurrent(double esoGradeCurrent) { this.esoGradeCurrent = esoGradeCurrent; } @Column(name="esogrademax") public double getEsoGradeMax() { return esoGradeMax; } public void setEsoGradeMax(double esoGradeMax) { this.esoGradeMax = esoGradeMax; } @Column(name="esostudycount") public Integer getEsoStudyCount() { return esoStudyCount; } public void setEsoStudyCount(Integer esoStudyCount) { this.esoStudyCount = esoStudyCount; } @Column(name="hourscourseproject") public double getHoursCourseProject() { return hoursCourseProject; } public void setHoursCourseProject(double hoursCourseProject) { this.hoursCourseProject = hoursCourseProject; } @Column(name="hourscoursework") public double getHoursCourseWork() { return hoursCourseWork; } public void setHoursCourseWork(double hoursCourseWork) { this.hoursCourseWork = hoursCourseWork; } @Column(name="hourscontroldistance") public double getHoursControlDistance() { return hoursControlDistance; } public void setHoursControlDistance(double hoursControlDistance) { this.hoursControlDistance = hoursControlDistance; } @Column(name="hoursconsult") public double getHoursConsult() { return hoursConsult; } public void setHoursConsult(double hoursConsult) { this.hoursConsult = hoursConsult; } @Column(name="hourscontrolselfstudy") public double getHoursControlSelfStudy() { return hoursControlSelfStudy; } public void setHoursControlSelfStudy(double hoursControlSelfStudy) { this.hoursControlSelfStudy = hoursControlSelfStudy; } @ManyToOne @JoinColumn(name="id_link_group_semester") public GroupSemester getGroupSemester() { return groupSemester; } public void setGroupSemester(GroupSemester groupSemester) { this.groupSemester = groupSemester; } @ManyToOne @JoinColumn(name="id_subject") public Subject getSubject() { return subject; } public void setSubject(Subject subject) { this.subject = subject; } }
[ "dmmax24@gmail.com" ]
dmmax24@gmail.com
8d236d5499acd01be8fb9cbf3b2089bb81e3b190
ac80e0cf542dd47123398b069f2b28a4546748bc
/TeamCode/src/main/java/org/team11392/lib/Config.java
ce474a7fb177760887305fa1459129c09a1df955
[]
no_license
HighOakRobotics/Leaf_Guard2018RC
d7663bf91685806e54fe7442e43bd9970a115f47
99bed9f26c854a2b22b4ee3414ec9d97c5a6bd36
refs/heads/master
2021-09-14T10:26:07.110087
2018-02-21T05:02:34
2018-02-21T05:02:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
262
java
package org.team11392.lib; public class Config extends VuforiaKeyClass { final boolean mrOutputDebug = true; final int mrOutputLines = 8; final double DRIVE_CPM = 1440; final double driveAdjuster = 1.0; final boolean enableDogeCV = false; }
[ "lu_haoqin@outlook.com" ]
lu_haoqin@outlook.com
fefa7923ef4ea4b62d071a86599ed8cab227f3e7
dba87418d2286ce141d81deb947305a0eaf9824f
/sources/p011io/reactivex/internal/util/QueueDrain.java
03dc6dc5d18a0afb6834d82f38e44cbef8676f94
[]
no_license
Sluckson/copyOavct
1f73f47ce94bb08df44f2ba9f698f2e8589b5cf6
d20597e14411e8607d1d6e93b632d0cd2e8af8cb
refs/heads/main
2023-03-09T12:14:38.824373
2021-02-26T01:38:16
2021-02-26T01:38:16
341,292,450
0
1
null
null
null
null
UTF-8
Java
false
false
403
java
package p011io.reactivex.internal.util; import org.reactivestreams.Subscriber; /* renamed from: io.reactivex.internal.util.QueueDrain */ public interface QueueDrain<T, U> { boolean accept(Subscriber<? super U> subscriber, T t); boolean cancelled(); boolean done(); boolean enter(); Throwable error(); int leave(int i); long produced(long j); long requested(); }
[ "lucksonsurprice94@gmail.com" ]
lucksonsurprice94@gmail.com
b6fcd119288bea321d5ef52f1058cb37de85d872
5b3f3d3dfc4916a7add978dbd8518a2e55b8d5b9
/mall-order/src/main/java/com/firenay/mall/order/vo/SpuInfoVo.java
79660b0fff19e553b76639e75c7a879346d9ecef
[]
no_license
wz1371/e-mall
38b4c4dc98a3b2f4bbce2fd6374ed122da66948d
88ab945f0519988bc32ccdead4542dc417af86fe
refs/heads/master
2023-01-22T15:17:25.056205
2020-12-05T01:29:20
2020-12-05T01:29:20
318,676,160
3
0
null
null
null
null
UTF-8
Java
false
false
684
java
package com.firenay.mall.order.vo; import lombok.Data; import java.math.BigDecimal; import java.util.Date; /** * <p>Title: SpuInfoVo</p> * Description: * date:2020/7/2 0:45 */ @Data public class SpuInfoVo { private Long id; /** * 商品名称 */ private String spuName; /** * 商品描述 */ private String spuDescription; /** * 所属分类id */ private Long catalogId; /** * 品牌id */ private Long brandId; /** * */ private BigDecimal weight; /** * 上架状态[0 - 下架,1 - 上架] */ private Integer publishStatus; /** * 创建时间 */ private Date createTime; /** * 更新时间 */ private Date updateTime; }
[ "wz1371@nyu.edu" ]
wz1371@nyu.edu
ec593430e707f5907574133361590a133882e0a8
f1c7517d4ccab0807fa3ae5917aff0dc28d66fd4
/JAVA SE/LAB3/constrover.java
9d28c395aa7632c6e12c2569002e7d2697c53b90
[]
no_license
kiranpoojary/MCA
0a14b5913f8101126530fb0c10b9652a9d76c2d7
0bc4e52cc6e5e2e32ef6cb4da0a60c5dbecd2d96
refs/heads/master
2020-04-01T23:06:41.742663
2019-08-29T18:36:37
2019-08-29T18:36:37
153,742,451
0
0
null
null
null
null
UTF-8
Java
false
false
707
java
import java.io.*; class Constrclass { Constrclass() { System.out.println("in deafault constructor"); } Constrclass(int a) { System.out.println("in one argument(int) constructor:value recieved :"+a); } Constrclass(double a) { System.out.println("in one argument(double) constructor:value recieved :"+a); } Constrclass(int a, int b) { System.out.println("in two(int,int) argument constructor:value recieved :"+a+" "+b); } } class Mainclass31 { public static void main(String args[]) { Constrclass obj1=new Constrclass(); Constrclass obj2=new Constrclass(10); Constrclass obj3=new Constrclass(3.142); Constrclass obj4=new Constrclass(10,100); } }
[ "noreply@github.com" ]
noreply@github.com
c8c69510078fcf3dc5babd7876d1321b71a5f683
cd0e868ee6bad34570b7bb982d6ec308d380fff7
/keepCash/habile_customer/src/main/java/com/org/customer/command/CommandProcessingResultBuilder.java
0a3533591191fc327ac53dc785c0708d1705ff79
[]
no_license
cloudbankin/keepCash
dbdcf05f5315f2d383d8ddc6a6293a1cf22bfd27
686f8cfc680028bb8952f2f96312db5aeb04531e
refs/heads/master
2023-01-09T17:26:18.561868
2019-09-16T12:00:14
2019-09-16T12:00:14
193,434,564
0
0
null
null
null
null
UTF-8
Java
false
false
3,853
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 com.org.customer.command; import java.util.Map; /** * Represents the successful result of an REST API call that results in * processing a command. */ public class CommandProcessingResultBuilder { private Long commandId; private Long officeId; private Long groupId; private Long clientId; private Long loanId; private Long savingsId; private String resourceIdentifier; private Long entityId; private Long subEntityId; private String transactionId; private Map<String, Object> changes; private Long productId; private boolean rollbackTransaction = false; public CommandProcessingResult build() { return CommandProcessingResult.fromDetails(this.commandId, this.officeId, this.groupId, this.clientId, this.loanId, this.savingsId, this.resourceIdentifier, this.entityId, this.transactionId, this.changes, this.productId, this.rollbackTransaction, this.subEntityId); } public CommandProcessingResultBuilder withCommandId(final Long withCommandId) { this.commandId = withCommandId; return this; } public CommandProcessingResultBuilder with(final Map<String, Object> withChanges) { this.changes = withChanges; return this; } public CommandProcessingResultBuilder withResourceIdAsString(final String withResourceIdentifier) { this.resourceIdentifier = withResourceIdentifier; return this; } public CommandProcessingResultBuilder withEntityId(final Long withEntityId) { this.entityId = withEntityId; return this; } public CommandProcessingResultBuilder withSubEntityId(final Long withSubEntityId) { this.subEntityId = withSubEntityId; return this; } public CommandProcessingResultBuilder withOfficeId(final Long withOfficeId) { this.officeId = withOfficeId; return this; } public CommandProcessingResultBuilder withClientId(final Long withClientId) { this.clientId = withClientId; return this; } public CommandProcessingResultBuilder withGroupId(final Long withGroupId) { this.groupId = withGroupId; return this; } public CommandProcessingResultBuilder withLoanId(final Long withLoanId) { this.loanId = withLoanId; return this; } public CommandProcessingResultBuilder withSavingsId(final Long withSavingsId) { this.savingsId = withSavingsId; return this; } public CommandProcessingResultBuilder withTransactionId(final String withTransactionId) { this.transactionId = withTransactionId; return this; } public CommandProcessingResultBuilder withProductId(final Long productId) { this.productId = productId; return this; } public CommandProcessingResultBuilder setRollbackTransaction(final boolean rollbackTransaction) { this.rollbackTransaction = this.rollbackTransaction || rollbackTransaction; return this; } }
[ "saranya.p@habile.in" ]
saranya.p@habile.in
da402bdb810ffff5c7823d8b5ed6eaa4bc657ab9
a274221034e445189eaf93aa5f6bf89659621b74
/app/src/main/java/com/mario/myapplication/MainActivity.java
65b3a1cbfd347800ce574fb5f0ed670ae7e685e1
[]
no_license
MarioDeLeonRecinos/PDM_LABO2_00353715_Ejercicio2
7d7469d9c2f98d40c9ebfa74e39db04d438221fc
0d42908a4be897303d7cb4a96db47b82558f8ca3
refs/heads/master
2020-04-29T05:34:00.152453
2019-03-15T22:34:44
2019-03-15T22:34:44
175,887,218
0
0
null
null
null
null
UTF-8
Java
false
false
1,697
java
package com.mario.myapplication; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.ImageView; import java.util.ArrayList; import java.util.Random; public class MainActivity extends AppCompatActivity implements View.OnClickListener{ private ArrayList<Integer> lista= new ArrayList<Integer>(); private ImageView img1,img2,img3,img4,img5,img6,img7,img8,img9; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); lista.add(R.drawable.paisaje1); lista.add(R.drawable.magunas); lista.add(R.drawable.pampa); img1=findViewById(R.id.ima1); img2=findViewById(R.id.ima2); img3=findViewById(R.id.ima3); img4=findViewById(R.id.ima4); img5=findViewById(R.id.ima5); img6=findViewById(R.id.ima6); img7=findViewById(R.id.ima7); img8=findViewById(R.id.ima8); img9=findViewById(R.id.ima9); img1.setOnClickListener(this); img2.setOnClickListener(this); img3.setOnClickListener(this); img4.setOnClickListener(this); img5.setOnClickListener(this); img6.setOnClickListener(this); img7.setOnClickListener(this); img8.setOnClickListener(this); img9.setOnClickListener(this); } @Override public void onClick(View v){ ImageView imagen = findViewById(v.getId()); Random rand = new Random(); int num = (int)rand.nextInt(lista.size()); imagen.setImageResource(lista.get(num)); } }
[ "00353715@uca.edu.sv" ]
00353715@uca.edu.sv
23d8b6a02c22d70ceb03493eedc0a000c36f3d43
1e73b27b9660ef5f995da1ce80888fdeda97cadd
/app/src/main/java/com/tracking/locationmanager/MainActivity.java
b6be9e62b8e0ca9cc5d9adf0f5537a58b08fc9b7
[]
no_license
armandopinzonvera/serviceLocation
4cb323a54a72c5ea243d4a78ba3b6cb65429f2b2
7038ed1d17e9b9c19561301229684b2a1fb4e43c
refs/heads/master
2023-03-04T22:25:02.808446
2021-02-10T16:30:03
2021-02-10T16:30:03
325,894,010
0
0
null
null
null
null
UTF-8
Java
false
false
1,897
java
package com.tracking.locationmanager; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.location.Location; import android.location.LocationManager; import android.os.Bundle; import android.util.Log; import android.widget.TextView; public class MainActivity extends AppCompatActivity { TextView latitud, longitud; private LocationManager locationManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); latitud = (TextView)findViewById(R.id.latitud); longitud = (TextView)findViewById(R.id.longitud); localizacion(); } private void localizacion() { if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission (this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{ Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION }, 99); } locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if(locationManager !=null){ /*latitud.setText(String.valueOf(location.getLatitude())); longitud.setText(String.valueOf(location.getLongitude()));*/ Log.d("UBICACION1", String.valueOf(location.getLongitude())); Log.d("UBICACION2", String.valueOf(location.getLatitude())); } } }
[ "armandopinzonvera@gmail.com" ]
armandopinzonvera@gmail.com
1ac1d0adf5e0de9fa74daae3be2ba61de1409497
426aa26b28d7463449ea43b444a0b7d18e13c992
/um-webapp/src/main/java/com/baeldung/um/web/controller/RoleController.java
2a802374dfc25c7dc59ae422c305d1edad2430fb
[]
no_license
mborciuch/spring-with-jenkins-test
6b69a041b090095a3ba0cf68d258869c2444e4ee
0385702bf1cfd65fae5786fea8573a17c8306997
refs/heads/master
2023-02-07T17:52:53.662011
2019-09-02T08:59:52
2019-09-02T09:01:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,637
java
package com.baeldung.um.web.controller; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.security.access.annotation.Secured; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.util.UriComponentsBuilder; import com.baeldung.common.util.QueryConstants; import com.baeldung.common.web.controller.AbstractController; import com.baeldung.common.web.controller.ISortingController; import com.baeldung.um.persistence.model.Role; import com.baeldung.um.service.IRoleService; import com.baeldung.um.util.UmMappings; import com.baeldung.um.util.Um.Privileges; @Controller @RequestMapping(value = UmMappings.ROLES) public class RoleController extends AbstractController<Role, Role> implements ISortingController<Role> { @Autowired private IRoleService service; public RoleController() { super(Role.class); } // API // search @RequestMapping(params = { QueryConstants.Q_PARAM }, method = RequestMethod.GET) @ResponseBody @Secured(Privileges.CAN_ROLE_READ) public List<Role> searchAll(@RequestParam(QueryConstants.Q_PARAM) final String queryString) { return searchAllInternal(queryString); } @RequestMapping(params = { QueryConstants.Q_PARAM, QueryConstants.PAGE, QueryConstants.SIZE }, method = RequestMethod.GET) @ResponseBody @Secured(Privileges.CAN_ROLE_READ) public List<Role> searchAllPaginated(@RequestParam(QueryConstants.Q_PARAM) final String queryString, @RequestParam(value = QueryConstants.PAGE) final int page, @RequestParam(value = QueryConstants.SIZE) final int size) { return searchAllPaginatedInternal(queryString, page, size); } // find - all/paginated @Override @RequestMapping(params = { QueryConstants.PAGE, QueryConstants.SIZE, QueryConstants.SORT_BY }, method = RequestMethod.GET) @ResponseBody @Secured(Privileges.CAN_ROLE_READ) public List<Role> findAllPaginatedAndSorted(@RequestParam(value = QueryConstants.PAGE) final int page, @RequestParam(value = QueryConstants.SIZE) final int size, @RequestParam(value = QueryConstants.SORT_BY) final String sortBy, @RequestParam(value = QueryConstants.SORT_ORDER) final String sortOrder, final UriComponentsBuilder uriBuilder, final HttpServletResponse response) { return findPaginatedAndSortedInternal(page, size, sortBy, sortOrder, uriBuilder, response); } @Override @RequestMapping(params = { QueryConstants.PAGE, QueryConstants.SIZE }, method = RequestMethod.GET) @ResponseBody @Secured(Privileges.CAN_ROLE_READ) public List<Role> findAllPaginated(@RequestParam(value = QueryConstants.PAGE) final int page, @RequestParam(value = QueryConstants.SIZE) final int size, final UriComponentsBuilder uriBuilder, final HttpServletResponse response) { return findPaginatedInternal(page, size, uriBuilder, response); } @Override @RequestMapping(params = { QueryConstants.SORT_BY }, method = RequestMethod.GET) @ResponseBody @Secured(Privileges.CAN_ROLE_READ) public List<Role> findAllSorted(@RequestParam(value = QueryConstants.SORT_BY) final String sortBy, @RequestParam(value = QueryConstants.SORT_ORDER) final String sortOrder) { return findAllSortedInternal(sortBy, sortOrder); } @Override @RequestMapping(method = RequestMethod.GET) @ResponseBody @Secured(Privileges.CAN_ROLE_READ) public List<Role> findAll(final HttpServletRequest request, final UriComponentsBuilder uriBuilder, final HttpServletResponse response) { return findAllInternal(request, uriBuilder, response); } // find - one @RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseBody @Secured(Privileges.CAN_ROLE_READ) public Role findOne(@PathVariable("id") final Long id, final UriComponentsBuilder uriBuilder, final HttpServletResponse response) { return findOneInternal(id, uriBuilder, response); } // create @RequestMapping(method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) @Secured(Privileges.CAN_ROLE_WRITE) public void create(@RequestBody @Valid final Role resource, final UriComponentsBuilder uriBuilder, final HttpServletResponse response) { createInternal(resource, uriBuilder, response); } // update @RequestMapping(value = "/{id}", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @Secured(Privileges.CAN_ROLE_WRITE) public void update(@PathVariable("id") final Long id, @RequestBody @Valid final Role resource) { updateInternal(id, resource); } // delete @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) @Secured(Privileges.CAN_ROLE_WRITE) public void delete(@PathVariable("id") final Long id) { deleteByIdInternal(id); } // Spring @Override protected final IRoleService getService() { return service; } }
[ "michal123borciuch@gmail.com" ]
michal123borciuch@gmail.com
d240f6ea0882cdf4918946e2297896f59fdce191
504f0ba5c18ccc7393e6715f1ce9b236c4f6d99f
/live-20161101/src/main/java/com/aliyun/live20161101/models/SendRoomUserNotificationRequest.java
e3f9cbc3aa34badc5c8a368b952904048efa120b
[ "Apache-2.0" ]
permissive
jhz-duanmeng/alibabacloud-java-sdk
77f69351dee8050f9c40d7e19b05cf613d2448d6
ac8bfeb15005d3eac06091bbdf50e7ed3e891c38
refs/heads/master
2023-01-16T04:30:12.898713
2020-11-25T11:45:31
2020-11-25T11:45:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,080
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.live20161101.models; import com.aliyun.tea.*; public class SendRoomUserNotificationRequest extends TeaModel { @NameInMap("AppId") @Validation(required = true) public String appId; @NameInMap("RoomId") @Validation(required = true) public String roomId; @NameInMap("AppUid") @Validation(required = true) public String appUid; @NameInMap("ToAppUid") @Validation(required = true) public String toAppUid; @NameInMap("Data") @Validation(required = true) public String data; @NameInMap("Priority") public Integer priority; public static SendRoomUserNotificationRequest build(java.util.Map<String, ?> map) throws Exception { SendRoomUserNotificationRequest self = new SendRoomUserNotificationRequest(); return TeaModel.build(map, self); } public SendRoomUserNotificationRequest setAppId(String appId) { this.appId = appId; return this; } public String getAppId() { return this.appId; } public SendRoomUserNotificationRequest setRoomId(String roomId) { this.roomId = roomId; return this; } public String getRoomId() { return this.roomId; } public SendRoomUserNotificationRequest setAppUid(String appUid) { this.appUid = appUid; return this; } public String getAppUid() { return this.appUid; } public SendRoomUserNotificationRequest setToAppUid(String toAppUid) { this.toAppUid = toAppUid; return this; } public String getToAppUid() { return this.toAppUid; } public SendRoomUserNotificationRequest setData(String data) { this.data = data; return this; } public String getData() { return this.data; } public SendRoomUserNotificationRequest setPriority(Integer priority) { this.priority = priority; return this; } public Integer getPriority() { return this.priority; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
7a0adec756c1130172abe0348ac15c85a3f4e6f4
e0854a5f833400a131f61096fd0cad9827d75deb
/EventBusSample/app/src/main/java/com/iusmaharjan/eventbussample/ChargingEvent.java
aafedc0a56ed940592ed122dd1e56829172cc321
[]
no_license
iusmaharjan/Learning-Android
61dedecee2d91808eaa2d625ba8655cf2f4a2817
7cf79eefa2fc417566db0300fde4eab8eea5f7a4
refs/heads/master
2021-01-21T13:57:21.395849
2016-05-16T05:47:06
2016-05-16T05:47:06
54,725,680
0
0
null
null
null
null
UTF-8
Java
false
false
228
java
package com.iusmaharjan.eventbussample; public class ChargingEvent { private String data; public ChargingEvent(String data) { this.data = data; } public String getData() { return data; } }
[ "ius.maharjan@gmail.com" ]
ius.maharjan@gmail.com
1c17eafa2a5bb3d0f5c59cebe30d3f8372d0d299
b9916952f1a3819a6ae75eebef36b37e7e04d911
/src/main/java/library/exception/CopyNotFoundException.java
678cfde4eb55cf4e578734b7e87e8dbf86e5d3e5
[]
no_license
rahulpatil-99/spring-start-up
66761a7aa846f4c7a3676b37f22024739e5a8bb8
d1c30ed413ebbadee9cdd8d0bd9f51b32bd977c3
refs/heads/master
2020-03-23T13:07:33.011340
2018-09-25T16:03:39
2018-09-25T16:03:39
141,601,393
0
0
null
null
null
null
UTF-8
Java
false
false
181
java
package library.exception; public class CopyNotFoundException extends Throwable { public CopyNotFoundException() { super("Copy is not available in the stock"); } }
[ "rp7187655@gmail.com" ]
rp7187655@gmail.com
817e38e214928c67c39f701c4f2d2b563a0c816c
ffc9a81b330f16dda01192ddc0fad9cc69158e76
/main/java/com/wolfenterprisesllc/prisongourmet/MainActivity.java
def69499e6505e001e1db27830ab64619159ac74
[]
no_license
medicma/PrisonGourmet2019
7e544890d9d672e4417278fda621cf64886c124e
43f3329d87cbb1a0d1e8e069b678e6cb158137d3
refs/heads/master
2020-04-17T05:34:31.032721
2019-01-17T19:49:59
2019-01-17T19:49:59
166,286,337
0
0
null
null
null
null
UTF-8
Java
false
false
9,282
java
package com.wolfenterprisesllc.prisongourmet; import android.content.Intent; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.WindowManager; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.parse.FindCallback; import com.parse.ParseACL; import com.parse.ParseException; import com.parse.ParseObject; import com.parse.ParseQuery; import com.parse.ParseUser; import com.wolfenterprisesllc.prisongourmet.dummy.DummyContent; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity implements ItemFragment.OnListFragmentInteractionListener { protected DataHolder globalHolder; private List<RecipieHolder> recipieHolderList = new ArrayList<>(); private RecyclerViewAdapter mAdapter; public RecyclerView recyclerView; RecipieHolder mine; @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); setContentView(R.layout.activity_main); TextView intro = findViewById(R.id.txtIntro); ImageView cover = findViewById(R.id.ivCover); Toolbar toolbar = findViewById(R.id.toolbar); toolbar.setTitle("Welcome to Prison Gourmet!"); setSupportActionBar(toolbar); globalHolder = ((DataHolder) getApplication()); recyclerView = findViewById(R.id.myList); cover.setVisibility(View.VISIBLE); intro.setVisibility(View.VISIBLE); ParseUser.enableAutomaticUser(); ParseACL defaultACL = new ParseACL(); defaultACL.setPublicReadAccess(true); defaultACL.setWriteAccess(ParseUser.getCurrentUser(), false); ParseACL.setDefaultACL(defaultACL, true); mAdapter = new RecyclerViewAdapter(recipieHolderList); recyclerView.setHasFixedSize(true); RecyclerView.LayoutManager mlayoutManager = new LinearLayoutManager(getApplicationContext()); recyclerView.setLayoutManager(mlayoutManager); recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL)); recyclerView.setAdapter(mAdapter); recyclerView.addOnItemTouchListener(new RecyclerTouchListener(getApplicationContext(), recyclerView, new RecyclerTouchListener.ClickListener() { @Override public void onClick(View view, int position) { RecipieHolder holder = recipieHolderList.get(position); holder.setRecipie(recipieHolderList.get(position).getRecipie()); Intent intent = new Intent(getApplicationContext(), Recipie.class); intent.putExtra("recipieName", recipieHolderList.get(position).getRecipie()); Animation anim = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.anim); view.startAnimation(anim); startActivity(intent); } @Override public void onLongClick(View view, int position) { } })); Button favorites = findViewById(R.id.btnFavorites); favorites.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Animation anim = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.anim); anim.cancel(); TextView intro = findViewById(R.id.txtIntro); ImageView cover = findViewById(R.id.ivCover); Button exit = findViewById(R.id.btnExit); exit.setVisibility(View.VISIBLE); cover.setVisibility(View.INVISIBLE); intro.setVisibility(View.INVISIBLE); FragmentManager fragmentManager = getSupportFragmentManager(); ItemFragment fragment = new ItemFragment(); RecyclerView rv = findViewById(R.id.myList); rv.setVisibility(View.INVISIBLE); FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.fragment_list, fragment); fragmentTransaction.addToBackStack(null); fragmentTransaction.setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out); fragmentTransaction.commit(); } }); Button exit = findViewById(R.id.btnExit); if (exit != null) { exit.setText(R.string.Exit); exit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent homeIntent = new Intent(Intent.ACTION_MAIN); homeIntent.addCategory(Intent.CATEGORY_HOME); homeIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(homeIntent); } }); } doThis(); } private void doThis() { // ParseQuery<ParseObject> queryRecipies = ParseQuery.getQuery("Recipies"); queryRecipies.orderByAscending("Name"); queryRecipies.findInBackground(new FindCallback<ParseObject>() { @Override public void done(List<ParseObject> list1, ParseException e) { if (e == null) { ArrayList<String> listHolder = new ArrayList<>(); for (int i = 0; i < list1.size(); i++) { try { listHolder.add(list1.get(i).getString("Name")); } catch (Exception ex) { ex.printStackTrace(); } if (!listHolder.isEmpty()) { mine = new RecipieHolder(listHolder.toString().replace("[", "").replace("]", "")); recipieHolderList.add(mine); listHolder.clear(); } else { Toast.makeText(getApplicationContext(), "Oops. There was an error. Please try again or contact us if the problem persists. MA01", Toast.LENGTH_SHORT).show(); } } mAdapter.notifyDataSetChanged(); } } }); } private void goToUrl() { Uri uriUrl = Uri.parse("http://fireladychicago.wix.com/theprisongourmet"); Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl); startActivity(launchBrowser); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); return true; } private void goToUrl(String url) { Uri uriUrl = Uri.parse(url); Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl); startActivity(launchBrowser); } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); switch (item.getItemId()) { case R.id.contact: String[] TO = {"wolfnremtreview@yahoo.com"}; Intent emailIntent = new Intent(Intent.ACTION_SEND); emailIntent.setData(Uri.parse("mailto:theprisongourmet@gmail.com")); emailIntent.setType("text/plain"); startActivity(Intent.createChooser(emailIntent, "Choose an Email client to use:")); break; case R.id.action_settings: final Intent intent = new Intent(android.provider.Settings.ACTION_SETTINGS); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); break; case R.id.website: goToUrl(); break; case R.id.chef: goToUrl("http://fireladychicago.wix.com/theprisongourmet#!chef/c42f"); break; case R.id.blog: goToUrl("http://fireladychicago.wix.com/theprisongourmet#!blog/t0cr0"); break; default: break; } return super.onOptionsItemSelected(item); } @Override public void onListFragmentInteraction(DummyContent.DummyItem item) { } }
[ "noreply@github.com" ]
noreply@github.com
4af9b25e4820ca44e4c50698e242ab3cdc00ba52
c610d151e27a645470e32b2f459f8a949fdb4dab
/src/main/java/com/sb/lob/Order.java
8077a516608d7879001455a438692185178f86ed
[]
no_license
andyd40/live-order-board
5ab8fa225ce7fb464f9426f05246f05424b56c07
c96b6dfd7ade9db34fae1ba2a3ecd53384b5ef8f
refs/heads/master
2020-06-13T16:39:49.742726
2019-07-01T17:37:33
2019-07-01T17:37:33
194,714,922
0
0
null
null
null
null
UTF-8
Java
false
false
743
java
package com.sb.lob; import java.math.BigDecimal; public class Order { private final String user; private final BigDecimal quantity; private final BigDecimal price; private final OrderType orderType; public Order (String user, BigDecimal quantity, BigDecimal price, OrderType orderType) { this.user = user; this.quantity = quantity; this.price = price; this.orderType = orderType; } public String getUser() { return user; } public BigDecimal getQuantity() { return quantity; } public BigDecimal getPrice() { return price; } public OrderType getOrderType() { return orderType; } }
[ "noreply@github.com" ]
noreply@github.com
dddf2be0560c339d63fa0dc5cc78f48ffea26eb9
de8352e5c16a07cef7ea827ef0810c0fd0397cdc
/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java
4db1b9ec00b65a664e885b2f0e7b6d51dadb3fcf
[ "Apache-2.0" ]
permissive
Danthunder/spring-framework-5.0.x-comment
4ad4087071c03912165d742c7fb613c6a3108361
3ee356efb5e70c2b73a3a97790b202f1e9ce7743
refs/heads/master
2022-04-21T15:34:35.507411
2020-04-24T07:27:00
2020-04-24T07:56:15
258,418,483
1
0
null
null
null
null
UTF-8
Java
false
false
4,095
java
/* * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.context.annotation; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.aop.config.AopConfigUtils; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.core.annotation.AnnotationAttributes; import org.springframework.core.type.AnnotationMetadata; /** * Registers an auto proxy creator against the current {@link BeanDefinitionRegistry} * as appropriate based on an {@code @Enable*} annotation having {@code mode} and * {@code proxyTargetClass} attributes set to the correct values. * * @author Chris Beams * @since 3.1 * @see EnableAspectJAutoProxy */ public class AutoProxyRegistrar implements ImportBeanDefinitionRegistrar { private final Log logger = LogFactory.getLog(getClass()); /** * Register, escalate, and configure the standard auto proxy creator (APC) against the * given registry. Works by finding the nearest annotation declared on the importing * {@code @Configuration} class that has both {@code mode} and {@code proxyTargetClass} * attributes. If {@code mode} is set to {@code PROXY}, the APC is registered; if * {@code proxyTargetClass} is set to {@code true}, then the APC is forced to use * subclass (CGLIB) proxying. * <p>Several {@code @Enable*} annotations expose both {@code mode} and * {@code proxyTargetClass} attributes. It is important to note that most of these * capabilities end up sharing a {@linkplain AopConfigUtils#AUTO_PROXY_CREATOR_BEAN_NAME * single APC}. For this reason, this implementation doesn't "care" exactly which * annotation it finds -- as long as it exposes the right {@code mode} and * {@code proxyTargetClass} attributes, the APC can be registered and configured all * the same. */ @Override public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { boolean candidateFound = false; Set<String> annTypes = importingClassMetadata.getAnnotationTypes(); for (String annType : annTypes) { AnnotationAttributes candidate = AnnotationConfigUtils.attributesFor(importingClassMetadata, annType); if (candidate == null) { continue; } Object mode = candidate.get("mode"); Object proxyTargetClass = candidate.get("proxyTargetClass"); if (mode != null && proxyTargetClass != null && AdviceMode.class == mode.getClass() && Boolean.class == proxyTargetClass.getClass()) { candidateFound = true; if (mode == AdviceMode.PROXY) { AopConfigUtils.registerAutoProxyCreatorIfNecessary(registry); if ((Boolean) proxyTargetClass) { // 如果是CGLIB子类代理 AopConfigUtils.forceAutoProxyCreatorToUseClassProxying(registry); return; } } } } if (!candidateFound && logger.isWarnEnabled()) { String name = getClass().getSimpleName(); logger.warn(String.format("%s was imported but no annotations were found " + "having both 'mode' and 'proxyTargetClass' attributes of type " + "AdviceMode and boolean respectively. This means that auto proxy " + "creator registration and configuration may not have occurred as " + "intended, and components may not be proxied as expected. Check to " + "ensure that %s has been @Import'ed on the same class where these " + "annotations are declared; otherwise remove the import of %s " + "altogether.", name, name, name)); } } }
[ "dandanwdn@163.com" ]
dandanwdn@163.com
aff941ecf3ab4300f597088e3c3f04f21da79a4f
15e9813d81bade4d36921474ec63fef461e01fbd
/app/src/main/java/com/example/ll300/driple/models/User.java
782c5a9dc475b8af3bdae77fc7563d01e2dcb091
[ "Apache-2.0" ]
permissive
LENGYUANL/driple
55c56a4fc9e7c6225566e8d800a7793e1c0f91e9
05da569db6dbc2c53b6d5f210e6c6b708169d89a
refs/heads/master
2021-08-15T02:46:55.984247
2017-11-16T03:43:03
2017-11-16T03:43:03
110,001,282
0
0
null
null
null
null
UTF-8
Java
false
false
171
java
package com.example.ll300.driple.Models; /** * Created by ll300 on 2017/8/24. */ public class User { public String name; public String avatar_url; }
[ "lengyuan2236@gmail.com" ]
lengyuan2236@gmail.com
eca910371b20679218350a49eff73ed18688b4ab
c1d4d48573dd01083df651d86612f842d0fcecf4
/src/com/practice/dp/MaximumSumNoLargerThanK.java
14508c2d28cc414ca0038f7b8a637ce711efe869
[]
no_license
SonaliOberoi/TargetInterview
ed93fc9eee92852d63ae752c7e2512fcc9550c8e
42296b83c7fb61d92229954e890ddd0419dff9ca
refs/heads/master
2023-03-02T04:06:37.640951
2021-02-07T23:02:56
2021-02-07T23:02:56
111,259,940
0
0
null
null
null
null
UTF-8
Java
false
false
1,517
java
package com.practice.dp; import com.sun.source.tree.Tree; import java.util.HashSet; import java.util.*; //https://leetcode.com/problems/max-sum-of-rectangle-no-larger-than-k/ public class MaximumSumNoLargerThanK { public int maxSumSubmatrix(int[][] matrix, int k) { if(matrix == null || matrix.length < 1) { return 0; } int rowLen = matrix.length; int colLen = matrix[0].length; int answer = Integer.MIN_VALUE; for(int i=0;i<colLen;i++) { int[] temp = new int[rowLen]; for(int j=i;j<colLen;j++) { for(int r=0;r<rowLen;r++) { temp[r] = temp[r] + matrix[r][j]; } answer = Math.max(answer, maxSumUtil(temp, k)); } } return answer == Integer.MIN_VALUE ? k : answer; } private int maxSumUtil(int[] a, int k) { int max = Integer.MIN_VALUE; int sumj = 0; TreeSet<Integer> ts = new TreeSet(); ts.add(0); for(int i=0;i<a.length;i++){ sumj += a[i]; Integer gap = ts.ceiling(sumj - k); if(gap != null) max = Math.max(max, sumj - gap); ts.add(sumj); } return max; } public static void main(String args[]) { MaximumSumNoLargerThanK maximumSumNoLargerThanK = new MaximumSumNoLargerThanK(); int[][] matrix = {{2,2,-1}}; System.out.println(maximumSumNoLargerThanK.maxSumSubmatrix(matrix, 0)); } }
[ "sonagarg@amazon.com" ]
sonagarg@amazon.com
ad43e767701330c23541d55d78fae52f5f2965fb
2d1f0891855ce2bd72eaafce6f46680be1a673a6
/src/main/java/org/myproject/web/Test.java
73fe3715b9b4e71a870331cdf042824cdf21907f
[]
no_license
warrior-battle/ssm
01013befe1a527860f77d83e50d6c42d7ad89551
5397a5004e38bf43d1064a9cf3f9951e2aaa672d
refs/heads/master
2020-04-29T07:57:32.888645
2019-03-17T12:09:55
2019-03-17T12:09:55
175,969,894
1
0
null
null
null
null
UTF-8
Java
false
false
821
java
package org.myproject.web; import org.myproject.entity.User; import org.myproject.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller @RequestMapping // 第一级路径为空 public class Test { @Autowired private UserService userService; @RequestMapping(value = "/hello", method = RequestMethod.GET) public String hello(Model model) { User user=userService.getUserOne(1); System.out.println("hello"); System.out.println(user.getUserName()); model.addAttribute("commandList", "hello"); model.addAttribute("page","good"); return "index"; } }
[ "fushe368@sina.cn" ]
fushe368@sina.cn
2c0aa32c6bb2d19cab951740eac336d66ccc049d
c46749f7b32e9dbfd6ac5a6afa5a9e74b51c6538
/src/main/java/com/sica/web/rest/FuncionarioResource.java
4f262a5366a6097db92829247420890a7c7aca22
[]
no_license
BulkSecurityGeneratorProject/sicapuc20201
ce3866aeb7b60b216e1082a0613d847d940012a0
06fc0bc4a3346cb01684281981325b8e3a9cced3
refs/heads/master
2022-12-17T15:17:34.684364
2020-04-02T01:32:22
2020-04-02T01:32:22
296,613,251
0
0
null
2020-09-18T12:20:51
2020-09-18T12:20:50
null
UTF-8
Java
false
false
5,159
java
package com.sica.web.rest; import com.sica.service.FuncionarioService; import com.sica.web.rest.errors.BadRequestAlertException; import com.sica.service.dto.FuncionarioDTO; import io.github.jhipster.web.util.HeaderUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing {@link com.sica.domain.Funcionario}. */ @RestController @RequestMapping("/api") public class FuncionarioResource { private final Logger log = LoggerFactory.getLogger(FuncionarioResource.class); private static final String ENTITY_NAME = "funcionario"; @Value("${jhipster.clientApp.name}") private String applicationName; private final FuncionarioService funcionarioService; public FuncionarioResource(FuncionarioService funcionarioService) { this.funcionarioService = funcionarioService; } /** * {@code POST /funcionarios} : Create a new funcionario. * * @param funcionarioDTO the funcionarioDTO to create. * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new funcionarioDTO, or with status {@code 400 (Bad Request)} if the funcionario has already an ID. * @throws URISyntaxException if the Location URI syntax is incorrect. */ @PostMapping("/funcionarios") public ResponseEntity<FuncionarioDTO> createFuncionario(@Valid @RequestBody FuncionarioDTO funcionarioDTO) throws URISyntaxException { log.debug("REST request to save Funcionario : {}", funcionarioDTO); if (funcionarioDTO.getId() != null) { throw new BadRequestAlertException("A new funcionario cannot already have an ID", ENTITY_NAME, "idexists"); } FuncionarioDTO result = funcionarioService.save(funcionarioDTO); return ResponseEntity.created(new URI("/api/funcionarios/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString())) .body(result); } /** * {@code PUT /funcionarios} : Updates an existing funcionario. * * @param funcionarioDTO the funcionarioDTO to update. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated funcionarioDTO, * or with status {@code 400 (Bad Request)} if the funcionarioDTO is not valid, * or with status {@code 500 (Internal Server Error)} if the funcionarioDTO couldn't be updated. * @throws URISyntaxException if the Location URI syntax is incorrect. */ @PutMapping("/funcionarios") public ResponseEntity<FuncionarioDTO> updateFuncionario(@Valid @RequestBody FuncionarioDTO funcionarioDTO) throws URISyntaxException { log.debug("REST request to update Funcionario : {}", funcionarioDTO); if (funcionarioDTO.getId() == null) { throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); } FuncionarioDTO result = funcionarioService.save(funcionarioDTO); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, funcionarioDTO.getId().toString())) .body(result); } /** * {@code GET /funcionarios} : get all the funcionarios. * * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of funcionarios in body. */ @GetMapping("/funcionarios") public List<FuncionarioDTO> getAllFuncionarios() { log.debug("REST request to get all Funcionarios"); return funcionarioService.findAll(); } /** * {@code GET /funcionarios/:id} : get the "id" funcionario. * * @param id the id of the funcionarioDTO to retrieve. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the funcionarioDTO, or with status {@code 404 (Not Found)}. */ @GetMapping("/funcionarios/{id}") public ResponseEntity<FuncionarioDTO> getFuncionario(@PathVariable Long id) { log.debug("REST request to get Funcionario : {}", id); Optional<FuncionarioDTO> funcionarioDTO = funcionarioService.findOne(id); return ResponseUtil.wrapOrNotFound(funcionarioDTO); } /** * {@code DELETE /funcionarios/:id} : delete the "id" funcionario. * * @param id the id of the funcionarioDTO to delete. * @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}. */ @DeleteMapping("/funcionarios/{id}") public ResponseEntity<Void> deleteFuncionario(@PathVariable Long id) { log.debug("REST request to delete Funcionario : {}", id); funcionarioService.delete(id); return ResponseEntity.noContent().headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString())).build(); } }
[ "tarcisio.filo2@gmail.com" ]
tarcisio.filo2@gmail.com
c996397a618e2768aabdb36ee32344cd5933b313
4efb9a6cd0d7b9e88ceeebdb6c26f3d5a1401742
/MyDeepNavigation/app/src/androidTest/java/com/naufalrzld/mydeepnavigation/ExampleInstrumentedTest.java
2d4af5f9072d658a71602155f0eebe4a563d9144
[]
no_license
naufalrzld/Dicoding
b27a1f7f3eee2ee8ac78218b7186ccfb9d08e984
33cdac3c7f375c82802a8a7ed709739a08fa2c58
refs/heads/master
2021-04-03T05:14:06.934022
2018-05-23T07:07:53
2018-05-23T07:07:53
124,624,168
0
0
null
null
null
null
UTF-8
Java
false
false
763
java
package com.naufalrzld.mydeepnavigation; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.naufalrzld.mydeepnavigation", appContext.getPackageName()); } }
[ "naufalrzld@gmail.com" ]
naufalrzld@gmail.com
6fac956ac44f19e5617e6fff04e72850448dcceb
a15b21b3896e88bb3cbad5703194dd6f7dd3e373
/app/src/main/java/com/nextwin/pianika/ultraman/Menu.java
808b32f60f727095a803f201855a34e0dfc9c8f1
[]
no_license
cahtegal/project14
7e813cbae5fda0d7d1efc33623da247d226d2120
ead417c55ddfa27711c4db71935a08ef4aa457bd
refs/heads/master
2020-04-13T04:17:05.431571
2018-12-24T06:11:40
2018-12-24T06:11:40
133,218,868
0
0
null
null
null
null
UTF-8
Java
false
false
10,275
java
package com.nextwin.pianika.ultraman; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.media.MediaPlayer; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.Uri; import android.os.Handler; import android.support.annotation.NonNull; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.animation.BounceInterpolator; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.google.android.gms.ads.AdListener; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdView; import com.google.android.gms.ads.InterstitialAd; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; public class Menu extends AppCompatActivity { ImageView imgPlay,imgShare,imgTheme,imgRateUs, imgBg; public static int tema = 0; public static int bg = 0; InterstitialAd mInterstitialAd; final AnimatorSet animatorSet = new AnimatorSet(); public static boolean iklanOpen = false, isUtama = false; public static MediaPlayer mpSound = new MediaPlayer(); public static boolean moveClass = false; MediaPlayer mpSound1 = new MediaPlayer(); TextView teksSound; String value = "ca-app-pub-5730449577374867/5281757865"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.menu); deklarasi(); action(); startAnimationPlay(); } @Override protected void onPause() { super.onPause(); if (mpSound.isPlaying()){ mpSound.pause(); } } @Override protected void onDestroy() { super.onDestroy(); if (mpSound.isPlaying()) { mpSound.stop(); teksSound.setText("SOUND ON"); } } @Override protected void onResume() { super.onResume(); iklanOpen = false; isUtama = false; if (!mpSound.isPlaying() && !moveClass) { mpSound = MediaPlayer.create(Menu.this, R.raw.backround_sound); mpSound.start(); teksSound.setText("SOUND OFF"); } } private void deklarasi() { mpSound1 = MediaPlayer.create(Menu.this,R.raw.tok); mpSound.setLooping(true); teksSound = findViewById(R.id.teksSound); imgPlay = findViewById(R.id.imgPlay); imgShare = findViewById(R.id.imgShare); imgTheme = findViewById(R.id.imgTheme); imgRateUs = findViewById(R.id.btnRateUs); imgBg = findViewById(R.id.btnBg); } private void action() { teksSound.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { moveClass = false; if (mpSound.isPlaying()) { mpSound.stop(); teksSound.setText("SOUND ON"); } else { mpSound = MediaPlayer.create(Menu.this, R.raw.backround_sound); mpSound.start(); teksSound.setText("SOUND OFF"); } } }); imgShare.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mpSound1.start(); Intent sendIntent; sendIntent = new Intent(android.content.Intent.ACTION_SEND); sendIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); sendIntent.putExtra(Intent.EXTRA_TEXT, "Play this Piano Mini Jojo Siwa for Kids for fun\n\nhttps://play.google.com/store/apps/details?id="+BuildConfig.APPLICATION_ID); sendIntent.setType("text/plain"); startActivity(Intent.createChooser(sendIntent, "Share with")); } }); imgPlay.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mpSound1.start(); iklan(); } }); imgTheme.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mpSound1.start(); startActivity(new Intent(Menu.this, WarnaPianika.class)); moveClass = true; } }); imgBg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mpSound1.start(); startActivity(new Intent(Menu.this, Background.class)); moveClass = true; } }); imgRateUs.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mpSound1.start(); String appPackageName = BuildConfig.APPLICATION_ID; // getPackageName() from Context or Activity object try { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName))); } catch (ActivityNotFoundException e) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName))); } } }); } @Override public void onBackPressed() { mpSound1.start(); dialogOut(); } private void dialogOut() { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Menu.this); alertDialogBuilder.setTitle("Quit"); alertDialogBuilder .setMessage("Quit from the game now ?") .setCancelable(false) .setPositiveButton("Yeah", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); finish(); } }) .setNegativeButton("No, I like this game", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); } private void iklan() { LayoutInflater inflater = LayoutInflater.from(Menu.this); View dialog_layout = inflater.inflate(R.layout.loading, null); AlertDialog.Builder dialLoad = new AlertDialog.Builder(Menu.this); dialLoad.setView(dialog_layout); final AlertDialog theDialog = dialLoad.create(); theDialog.show(); mInterstitialAd = new InterstitialAd(this); mInterstitialAd.setAdUnitId(value); mInterstitialAd.setAdListener(new AdListener() { @Override public void onAdLoaded() { super.onAdLoaded(); if(mInterstitialAd.isLoaded()) { mInterstitialAd.show(); if (!iklanOpen) { iklanOpen = true; theDialog.dismiss(); } } } @Override public void onAdOpened() { super.onAdOpened(); } @Override public void onAdClosed() { super.onAdClosed(); if (!isUtama) { isUtama = true; startActivity(new Intent(Menu.this,Utama.class)); moveClass = true; } } @Override public void onAdLeftApplication() { super.onAdLeftApplication(); } @Override public void onAdFailedToLoad(int i) { super.onAdFailedToLoad(i); if (!isUtama) { theDialog.dismiss(); isUtama = true; startActivity(new Intent(Menu.this,Utama.class)); moveClass = true; } } }); AdRequest adRequest = new AdRequest.Builder().build(); mInterstitialAd.loadAd(adRequest); new Handler().postDelayed(new Runnable() { @Override public void run() { if (!iklanOpen) { theDialog.dismiss(); iklanOpen = true; if (!isUtama) { isUtama = true; startActivity(new Intent(Menu.this,Utama.class)); moveClass = true; } } } },3000); } private void startAnimationPlay() { ObjectAnimator scaleY = ObjectAnimator.ofFloat(imgPlay, "scaleY", 1.5f); scaleY.setDuration(200); ObjectAnimator scaleYBack = ObjectAnimator.ofFloat(imgPlay, "scaleY", 1f); scaleYBack.setDuration(500); scaleYBack.setInterpolator(new BounceInterpolator()); animatorSet.setStartDelay(600); animatorSet.playSequentially(scaleY, scaleYBack); animatorSet.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { animatorSet.setStartDelay(500); animatorSet.start(); } }); imgPlay.setLayerType(View.LAYER_TYPE_HARDWARE, null); animatorSet.start(); } }
[ "syaeful.faozi93@gmail.com" ]
syaeful.faozi93@gmail.com
9327cdae362c62fee90014276109fe4c80cfc05b
b9068e06646fc1ac9291d9a68a109891a4077f9b
/app/src/test/java/com/example/munawar/pay/ExampleUnitTest.java
dc75e3e756ffbce3047350f99d2477c7fb6f019f
[]
no_license
munawarbhutto34/Pay
08a577b06e01accd7680e41477faef9961516760
c27d59fda29a76844bba030919e2375a1bed6eaf
refs/heads/master
2020-04-23T22:27:26.956359
2019-02-19T15:49:32
2019-02-19T15:49:32
171,502,485
0
0
null
null
null
null
UTF-8
Java
false
false
384
java
package com.example.munawar.pay; 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); } }
[ "bhuttomunawar@gmail.com" ]
bhuttomunawar@gmail.com
a42240dd415c0b9ec2f2911fd73a18f2d3dc31d1
185b3ec7060f290556751f15de09669d70a81d60
/src/main/java/com/ruoyi/project/production/productionLine/service/ProductionLineServiceImpl.java
5a9b4a1c638b4650d0c6eae2f26915ebc2aea87d
[ "MIT" ]
permissive
rainey520/factory
e3ff5ee4a70b05a58f7d6f769037c3476b3b3892
915ccb60d78ab833686f183c7e5598734cab838d
refs/heads/master
2022-09-28T23:56:22.250362
2019-11-28T02:44:12
2019-11-28T02:44:12
219,398,326
0
0
MIT
2022-09-01T23:15:06
2019-11-04T02:10:09
JavaScript
UTF-8
Java
false
false
15,071
java
package com.ruoyi.project.production.productionLine.service; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.constant.WorkConstants; import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.framework.jwt.JwtUtil; import com.ruoyi.project.device.devCompany.domain.DevCompany; import com.ruoyi.project.device.devCompany.mapper.DevCompanyMapper; import com.ruoyi.project.device.devList.domain.DevList; import com.ruoyi.project.device.devList.mapper.DevListMapper; import com.ruoyi.project.iso.sop.mapper.SopMapper; import com.ruoyi.project.iso.sopLine.mapper.SopLineMapper; import com.ruoyi.project.production.devWorkOrder.domain.DevWorkOrder; import com.ruoyi.project.production.devWorkOrder.mapper.DevWorkOrderMapper; import com.ruoyi.project.production.productionLine.domain.ProductionLine; import com.ruoyi.project.production.productionLine.mapper.ProductionLineMapper; import com.ruoyi.project.production.workstation.domain.Workstation; import com.ruoyi.project.production.workstation.mapper.WorkstationMapper; import com.ruoyi.project.system.user.domain.User; import com.ruoyi.project.system.user.mapper.UserMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import java.util.*; /** * 生产线 服务层实现 * * @author ruoyi * @date 2019-04-11 */ @Service("productionLine") public class ProductionLineServiceImpl implements IProductionLineService { @Autowired private ProductionLineMapper productionLineMapper; @Autowired private UserMapper userMapper; @Autowired private DevCompanyMapper devCompanyMapper; @Autowired private DevWorkOrderMapper devWorkOrderMapper; @Autowired private WorkstationMapper workstationMapper; @Autowired private DevListMapper devListMapper; @Autowired private SopMapper sopMapper; @Autowired private SopLineMapper sopLineMapper; /** * 查询生产线信息 * * @param id 生产线ID * @return 生产线信息 */ @Override public ProductionLine selectProductionLineById(Integer id) { return productionLineMapper.selectProductionLineById(id); } /** * 查询生产线列表 * * @param productionLine 生产线信息 * @return 生产线集合 */ @Override public List<ProductionLine> selectProductionLineList(ProductionLine productionLine, HttpServletRequest request) { User u = JwtUtil.getTokenUser(request); if (u == null) return Collections.emptyList(); if (!User.isAdmin(u)) { productionLine.setCompanyId(u.getCompanyId()); } List<ProductionLine> list = productionLineMapper.selectProductionLineList(productionLine); for (ProductionLine line : list) { User user = userMapper.selectUserInfoById(line.getCreate_by() == null ? 0 : line.getCreate_by()); if (user != null) line.setCreateName(user.getUserName()); User user1 = userMapper.selectUserInfoById(line.getDeviceLiable() == null ? 0 : line.getDeviceLiable()); if (user1 != null) line.setDeviceLiableName(user1.getUserName()); DevCompany devCompany = devCompanyMapper.selectDevCompanyById(line.getCompanyId() == null ? 0 : line.getCompanyId()); if (devCompany != null) line.setComName(devCompany.getComName()); user = userMapper.selectUserInfoById(line.getDeviceLiableTow() == null ? 0 : line.getDeviceLiableTow()); if (user != null) line.setDeviceLiableTowName(user.getUserName()); } return list; } /** * 新增生产线 * * @param productionLine 生产线信息 * @return 结果 */ @Override // @DataSource(DataSourceType.SLAVE) public int insertProductionLine(ProductionLine productionLine, HttpServletRequest request) { User user = JwtUtil.getTokenUser(request); if (user == null) { throw new BusinessException(UserConstants.NOT_LOGIN); } // 查看用户公司等级 DevCompany company = devCompanyMapper.selectDevCompanyById(JwtUtil.getUser().getCompanyId()); if (company == null) { throw new BusinessException("用户所在的公司不存在或者被删除"); } if (company.getSign() == 0) { List<ProductionLine> productionLines = productionLineMapper.selectAllDef0(user.getCompanyId()); if (StringUtils.isNotEmpty(productionLines) && productionLines.size() >= 3) { throw new BusinessException("非VIP用户最多只能新增三条产线"); } } productionLine.setCompanyId(user.getCompanyId()); productionLine.setCreate_by(user.getUserId().intValue()); productionLine.setCreateTime(new Date()); return productionLineMapper.insertProductionLine(productionLine); } /** * 修改生产线 * * @param productionLine 生产线信息 * @return 结果 */ @Override // @DataSource(value = DataSourceType.SLAVE) public int updateProductionLine(ProductionLine productionLine, HttpServletRequest request) { ProductionLine line = productionLineMapper.selectProductionLineById(productionLine.getId()); User sysUser = JwtUtil.getTokenUser(request); // 在线用户 checkDeviceLiable(sysUser, line); return productionLineMapper.updateProductionLine(productionLine); } /** * 删除生产线对象 * * @param id 需要删除的数据ID * @return 结果 */ @Override @Transactional public int deleteProductionLineById(Integer id, HttpServletRequest request) { User sysUser = JwtUtil.getTokenUser(request); // 在线用户 ProductionLine productionLine = productionLineMapper.selectProductionLineById(id); if (productionLine != null && !User.isAdmin(sysUser) && !sysUser.getLoginName().equals(sysUser.getCreateBy())) { // 非系统用户或者非注册用户 // 删除的时候判断是否为该工单的负责人 // 查询产线信息 checkDeviceLiable(sysUser, productionLine); } if (productionLine != null) { //查询是否有工单信息 DevWorkOrder workOrder = devWorkOrderMapper.selectWorkByLineId(id); if (workOrder != null) { throw new BusinessException("该产线有未完成工单,不能删除..."); } } //查询对应产线的工位信息 List<Workstation> workstations = workstationMapper.selectAllByLineId(id); if (workstations != null && workstations.size() > 0) { DevList devList = null; for (Workstation workstation : workstations) { //将对应硬件设置为未配置 if (workstation.getDevId() > 0) { devList = devListMapper.selectDevListById(workstation.getDevId()); if (devList != null) { devList.setSign(0); devListMapper.updateDevSign(devList); } } if (workstation.getcId() > 0) { devList = devListMapper.selectDevListById(workstation.getcId()); if (devList != null) { devList.setSign(0); devListMapper.updateDevSign(devList); } } if (workstation.geteId() > 0) { devList = devListMapper.selectDevListById(workstation.geteId()); if (devList != null) { devList.setSign(0); devListMapper.updateDevSign(devList); } } //删除工位 workstationMapper.deleteWorkstationById(workstation.getId()); } } // 删除相关SOP配置 sopMapper.deleteSopByLineId(sysUser.getCompanyId(),id); sopLineMapper.deleteSopLineByLineId(sysUser.getCompanyId(),id); return productionLineMapper.deleteProductionLineById(id); } @Override public List<Map<String, Object>> selectLineDev(int id) { return productionLineMapper.selectLineDev(id); } /** * 保存相关产线IO口配置 * * @param line * @return */ @Override public int updateLineConfigClear(ProductionLine line, HttpServletRequest request) { User sysUser = JwtUtil.getTokenUser(request); // 在线用户 ProductionLine productionLine = productionLineMapper.selectProductionLineById(line.getId()); // 查询产线信息 checkDeviceLiable(sysUser, productionLine); try { if (line == null || line.getId() == null) return 0; if (line.getDevIo() != null && line.getDevIo().length > 0) { //将其产线修改为自动 line.setManual(0); productionLineMapper.updateProductionLine(line); } else { //将其修改为手动 line.setManual(1); productionLineMapper.updateProductionLine(line); } //将其产线配置清空 productionLineMapper.updateLineConfigClear(line.getId()); if (line.getDevIo() != null && line.getDevIo().length > 0) { for (Integer ioId : line.getDevIo()) { //修改对应IO口的配置相关产线 productionLineMapper.updateLineConfig(ioId, line.getId()); } if (line.getIsSign() > 0) { productionLineMapper.updateIoSignLine(line.getIsSign()); } else { //获取第一个默认为警戒线判断依据 productionLineMapper.updateIoSignLine(line.getDevIo()[0]); } } } catch (Exception e) { e.printStackTrace(); return 0; } return 1; } /** * 校验登录用户是否为生产线的责任人 * * @param sysUser * @param productionLine */ private void checkDeviceLiable(User sysUser, ProductionLine productionLine) { if (!User.isAdmin(sysUser) && !sysUser.getLoginName().equals(sysUser.getCreateBy())) { // 非系统用户或者非注册用户 //不属于第一或者第二责任人不允许修改产线 if (productionLine.getDeviceLiable() != null && productionLine.getDeviceLiableTow() != null) { if (sysUser.getUserId().longValue() != productionLine.getDeviceLiable() && sysUser.getUserId().longValue() != productionLine.getDeviceLiableTow()) { throw new BusinessException("不是产线责任人,没有权限"); } } else { throw new BusinessException("请先配置全产线责任人"); } } } /** * 查询对应公司的所有生产线 * * @return */ @Override // @DataSource(value = DataSourceType.SLAVE) public List<ProductionLine> selectAllProductionLineByCompanyId() { User user = JwtUtil.getUser(); if (user == null) return Collections.emptyList(); return productionLineMapper.selectAllProductionLineByCompanyId(user.getCompanyId()); } /** * 通过生产线id查询责任人名称 * * @param lineId * @return */ @Override // @DataSource(value = DataSourceType.SLAVE) public Map findDeviceLiableByLineId(Integer lineId) { ProductionLine productionLine = productionLineMapper.selectProductionLineById(lineId); Map<String, Object> map = new HashMap<>(16); map.put("user1", findName(productionLine.getDeviceLiable())); map.put("user2", findName(productionLine.getDeviceLiableTow())); return map; } /** * 通过用户id查询用户名称(责任人) * * @param userId * @return deviceLiable */ private User findName(Integer userId) { return userMapper.selectUserInfoById(userId); } /** * 查询对应公司的所有生产线信息 * * @return */ public List<ProductionLine> selectProductionLineAll(Cookie[] cookies) { User user = JwtUtil.getTokenCookie(cookies); Integer companyId = null; if (!User.isAdmin(user)) { // 非系统用户 companyId = user.getCompanyId(); } return productionLineMapper.selectAllProductionLineByCompanyId(companyId); } /** * 通过作业指导书id查询未配置的产线信息 * * @param isoId 作业指导书id * @param companyId 公司id * @return 结果 */ @Override public List<ProductionLine> selectLineNotConfigByIsoId(Integer isoId, Integer companyId) { return productionLineMapper.selectAllProductionLineByCompanyId(companyId); } /** * 校验产线名的唯一性 * * @param productionLine 产线对象 * @return 结果 */ @Override public String checkLineNameUnique(ProductionLine productionLine) { ProductionLine uniqueLine = productionLineMapper.selectProductionLineByName(JwtUtil.getUser().getCompanyId(), productionLine.getLineName()); if (StringUtils.isNotNull(uniqueLine) && !uniqueLine.getId().equals(productionLine.getId())) { return WorkConstants.LINE_NAME_NOT_UNIQUE; } return WorkConstants.LINE_NAME_UNIQUE; } /** * app端查询流水线列表 * * @param productionLine 流水线对象 * @return 结果 */ @Override public List<ProductionLine> appSelectLineList(ProductionLine productionLine) { User user = JwtUtil.getUser(); if (user == null) { return Collections.emptyList(); } if (productionLine == null) { return productionLineMapper.selectAllDef0(user.getCompanyId()); } else { productionLine.setCompanyId(user.getCompanyId()); List<ProductionLine> productionLines = productionLineMapper.selectProductionLineList(productionLine); for (ProductionLine line : productionLines) { user = userMapper.selectUserInfoById(line.getDeviceLiable() == null ? 0 : line.getDeviceLiable()); if (user != null) { line.setDeviceLiableName(user.getUserName()); } user = userMapper.selectUserInfoById(line.getDeviceLiableTow() == null ? 0 : line.getDeviceLiableTow()); if (user != null) { line.setDeviceLiableTowName(user.getUserName()); } } return productionLines; } } }
[ "1305219970@qq.com" ]
1305219970@qq.com
6220a261696bf484b6f2db4123e791939c6ca899
770e05cc888dc73ae12c37d82116feea07af1111
/exercise/Tutorial/src/javatutorial/JavaTutorial22.java
b619c145b3bcba7fcef557ead481e977aebea398
[]
no_license
bangsacerdas/java_basic
3e90e139e17e970676dd30a3c3c2d126e1b33c8e
0213831ac3dc3c5a6fc2198ad375c9aadfaddcf6
refs/heads/master
2021-01-01T16:33:40.880735
2017-07-21T08:27:21
2017-07-21T08:27:21
97,859,540
1
0
null
null
null
null
UTF-8
Java
false
false
531
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 javatutorial; /** * * @author jupiterzhuo */ class counter{ int count =0; public counter() { count++; System.out.println("Counter " + count); } } public class JavaTutorial22 { public static void main(String[] args) { counter c1= new counter(); counter c2= new counter(); } }
[ "jupiterzhuo@bangsacerdas.com" ]
jupiterzhuo@bangsacerdas.com
93b5e6d6392ba72f824c92456471594fa11503a1
2de9111e6a54f68155e7d479d347239216ec4f24
/src/pl/blueenergy/document/DocumentDao.java
bcc9b0f8341e9f21b54cc901f1ffc54b691eca7a
[]
no_license
MO-PL/Java-Task-3
d9e549a27895feab77fc519d7ff8fa9b20a3ca67
765bdcc4ab91ac5de441e5ad0fbb0ebd57c61351
refs/heads/main
2023-04-12T00:01:46.665172
2021-05-12T22:13:43
2021-05-12T22:13:43
366,859,847
0
0
null
null
null
null
UTF-8
Java
false
false
3,982
java
package pl.blueenergy.document; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Random; import pl.blueenergy.organization.User; public class DocumentDao { public List<Document> getAllDocumentsInDatabase(){ List<Document> documents = new ArrayList<>(); Questionnaire questionnaire = new Questionnaire(); questionnaire.setCreationDate(getRandomPastDate()); questionnaire.setRemoved(false); questionnaire.setTitle("Ankieta kulinarna"); Question question = new Question(); question.setQuestionText("Które z dań wybrałbyś na jutrzejszy obiad?"); question.getPossibleAnswers().add("Szaszłyki drobiowe"); question.getPossibleAnswers().add("Falafele w tortilli"); question.getPossibleAnswers().add("Jajko sadzone ze szpinakiem i ziemniakami"); questionnaire.getQuestions().add(question); question = new Question(); question.setQuestionText("Jakie warzywo uważasz za najzdrowsze?"); question.getPossibleAnswers().add("Kalafior"); question.getPossibleAnswers().add("Ziemniak"); question.getPossibleAnswers().add("Rzodkiewka"); question.getPossibleAnswers().add("Marchewka"); questionnaire.getQuestions().add(question); documents.add(questionnaire); //************************************************************************************** questionnaire = new Questionnaire(); questionnaire.setCreationDate(getRandomPastDate()); questionnaire.setRemoved(false); questionnaire.setTitle("Ankieta komputerowa"); question = new Question(); question.setQuestionText("Które procesory twoim zdaniem " + "mają najlepszą relację jakości do ceny?"); question.getPossibleAnswers().add("AMD"); question.getPossibleAnswers().add("Intel"); question.getPossibleAnswers().add("IBM Power"); questionnaire.getQuestions().add(question); question = new Question(); question.setQuestionText("Jaka jest minimalna ilość ramu " + "która wymagana jest aby wygodnie programować w Javie?"); question.getPossibleAnswers().add("2GB"); question.getPossibleAnswers().add("4GB"); question.getPossibleAnswers().add("8GB"); question.getPossibleAnswers().add("16GB"); question.getPossibleAnswers().add("32GB"); question.getPossibleAnswers().add("64GB"); questionnaire.getQuestions().add(question); documents.add(questionnaire); //************************************************************************************** ApplicationForHolidays applicationForHolidays = new ApplicationForHolidays(); applicationForHolidays.setSince(getRandomPastDate()); applicationForHolidays.setTo(getRandomPastDate()); User user = new User(); user.setName("Jan"); user.setSurname("Kowalski"); user.setLogin("jankowalski60"); applicationForHolidays.setUserWhoRequestAboutHolidays(user); documents.add(applicationForHolidays); applicationForHolidays = new ApplicationForHolidays(); applicationForHolidays.setSince(getRandomPastDate()); applicationForHolidays.setTo(getRandomPastDate()); user = new User(); user.setName("Agnieszka"); user.setSurname("Nowak"); user.setLogin("nowaczka"); applicationForHolidays.setUserWhoRequestAboutHolidays(user); documents.add(applicationForHolidays); applicationForHolidays = new ApplicationForHolidays(); applicationForHolidays.setSince(getRandomPastDate()); applicationForHolidays.setTo(getRandomPastDate()); user = new User(); user.setName("Roman"); user.setSurname("Andrzejczyk"); user.setLogin("romuś1999"); applicationForHolidays.setUserWhoRequestAboutHolidays(user); documents.add(applicationForHolidays); return documents; } private Date getRandomPastDate() { Random random = new Random(); Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DATE, random.nextInt(20) * (-1)); return calendar.getTime(); } }
[ "maciej.z.olejniczak@gmail.com" ]
maciej.z.olejniczak@gmail.com
e84cb489c9520593c592617854e8fec5bfe4dda8
052dba1e3425fdc14ca9c3eaf4b3a4c3b860de80
/src/main/java/com/test/reportFoundtion/MyConfigListener.java
d91ba84d375f6b578b28ecee1405f57cf63e5ec9
[]
no_license
Jagannath619/Simplilearn_Android
62cb421fa05b8423767af11b421f74e30a8997dc
8bca96b33f46ceac96f5ed92cf1e107242e00435
refs/heads/master
2020-04-05T13:31:20.242353
2017-07-12T10:52:55
2017-07-12T10:52:55
94,859,687
0
0
null
null
null
null
UTF-8
Java
false
false
667
java
package com.test.reportFoundtion; import org.testng.IConfigurationListener2; import org.testng.ITestResult; public class MyConfigListener implements IConfigurationListener2 { public void onConfigurationSuccess(ITestResult tr) { System.out.println("on configuration success"); } public void onConfigurationFailure(ITestResult tr) { System.out.println("on configuration failure"); } public void onConfigurationSkip(ITestResult tr) { System.out.println("on configuration skip"); } public void beforeConfiguration(ITestResult tr) { System.out.println("called before the configuration method is invoked"); } }
[ "jagannath.panda619@gmail.com" ]
jagannath.panda619@gmail.com
42855af79e910daeaaaf69b381ad2b27f241a155
a04dabb5509f7517e50eca862479e1c2c6717191
/TPM_Lab3-master/app/src/main/java/com/codepath/debuggingchallenges/activities/ChangeBackgroundActivity.java
95d9c5ebc0d05b152c7dffd8eb23bb2391051b60
[]
no_license
TPMQC/Lab-3
09b16276ed5b6f7d67419567170541909905e7db
4d8e103ee65ff2c9ed75a6ba3dd49a38a49e20bd
refs/heads/master
2020-04-09T00:39:35.095077
2018-11-30T23:22:24
2018-11-30T23:22:24
159,876,030
1
0
null
null
null
null
UTF-8
Java
false
false
1,149
java
package com.codepath.debuggingchallenges.activities; import android.graphics.Color; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.Toast; import com.codepath.debuggingchallenges.R; public class ChangeBackgroundActivity extends AppCompatActivity { private int oldColor = Color.BLUE; private Button myButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_change_background); myButton = findViewById(R.id.btnGo); myButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onGoClick(); } });} public void onGoClick() { View mainView = findViewById(R.id.background_id); mainView.setBackgroundColor(getNextColor()); } private int getNextColor() { int newColor = (oldColor == Color.BLUE) ? Color.RED : Color.BLUE; oldColor = newColor; return newColor; } }
[ "purpleinklingyu@gmail.com" ]
purpleinklingyu@gmail.com
b5a3c527f9d7fcb5a315ba8c17a797fc5e60ef0d
3ed2795f19694a77da65680c0f175c082cdbf2d9
/idoss-backend/test/net/lintasarta/permohonan/dao/TPelaksanaanDAOTest.java
1c42334b13f35f98657b398180dd60248648f57f
[]
no_license
Edi030174/lapp
f8d2cc5c9da536291d05b45618e4fb42d1b4de03
fc72f191758769997de0ed17e777e182ceb717ab
refs/heads/master
2021-01-23T15:58:26.761336
2011-02-28T05:44:17
2011-02-28T05:44:17
40,702,243
0
0
null
null
null
null
UTF-8
Java
false
false
6,045
java
package net.lintasarta.permohonan.dao; import net.lintasarta.permohonan.model.TPelaksanaan; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; //import java.sql.Date; import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; /** * Created by Joshua * Date: Jun 24, 2010 * Time: 9:07:54 AM */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( locations = { "classpath:META-INF/spring/spring-config.xml", "classpath:META-INF/spring/datasource.xml", "classpath:META-INF/spring/spring-idoss-security-config.xml", "classpath:META-INF/spring/spring-dao-idoss-pengaduan-config.xml", "classpath:META-INF/spring/spring-dao-idoss-permohonan-config.xml" } ) public class TPelaksanaanDAOTest { @Autowired private TPelaksanaanDAO tPelaksanaanDAO; @Test public void testGetCountAllTPelaksanaan() throws Exception { assertEquals(1005, tPelaksanaanDAO.getCountAllTPelaksanaan()); } @Test public void testGetAllTPelaksanaan() throws Exception { List<TPelaksanaan> tPelaksanaans = tPelaksanaanDAO.getAllTPelaksanaan(); String updateduserActual = null; for (TPelaksanaan tPelaksanaan : tPelaksanaans){ updateduserActual = tPelaksanaan.getUpdated_user(); } String updateduserExpected = "0606"; assertEquals(updateduserExpected, updateduserActual); } @Test public void testGetTPelaksanaanByTIdossPelaksanaanId() throws Exception { String t_idoss_pelaksanaan_id = "JOSH121"; TPelaksanaan tPelaksanaan = tPelaksanaanDAO.getTPelaksanaanByTIdossPelaksanaanId(t_idoss_pelaksanaan_id); assertNotNull(tPelaksanaan); assertEquals("JOSH121",tPelaksanaan.getT_idoss_pelaksanaan_id()); } @Test public void testGetTPelaksananByIdPelaksana() throws Exception { String idPelaksana = "4234324"; List<TPelaksanaan> tPelaksanaans = tPelaksanaanDAO.getTPelaksananByIdPelaksana(idPelaksana); String idPelaksanaActual = null; for (TPelaksanaan pelaksanaan : tPelaksanaans) { idPelaksanaActual = pelaksanaan.getId_pelaksana(); } String idPelaksanaExpected = "4234324"; assertEquals(idPelaksanaExpected,idPelaksanaActual); } @Test public void testGetTPelaksananByStatusPerubahan() throws Exception { String statusPerubahan = "OPEN"; List<TPelaksanaan> tPelaksanaans = tPelaksanaanDAO.getTPelaksananByStatusPerubahan(statusPerubahan); String statusperubahanActual = null; for (TPelaksanaan tPelaksanaan : tPelaksanaans) { statusperubahanActual = tPelaksanaan.getStatus_perubahan(); } String statusperubahanExpected = "OPEN"; assertEquals(statusperubahanExpected, statusperubahanActual); } @Test public void testGetTPelaksananByIdPelaksanaStatus() throws Exception { String idPelaksana = "4234324"; String statusPerubahan = "OPEN"; TPelaksanaan tPelaksanaan = new TPelaksanaan(); tPelaksanaan.setId_pelaksana(idPelaksana); tPelaksanaan.setStatus_perubahan(statusPerubahan); List<TPelaksanaan> tPelaksanaans = tPelaksanaanDAO.getTPelaksananByIdPelaksanaStatus(tPelaksanaan); String statusperubahanActual = null; for (TPelaksanaan pelaksanaan : tPelaksanaans) { statusperubahanActual=pelaksanaan.getStatus_perubahan(); } String statusperubahanExpected = "OPEN"; assertEquals(statusperubahanExpected, statusperubahanActual); } @Test public void testCreateTPelaksanaan() throws Exception { int z = tPelaksanaanDAO.getCountAllTPelaksanaan(); TPelaksanaan tPelaksanaan = new TPelaksanaan(); tPelaksanaan.setT_idoss_pelaksanaan_id("ZZZ999"); Timestamp now = new Timestamp(Calendar.getInstance().getTimeInMillis()); tPelaksanaan.setTgl_permohonan(now); tPelaksanaan.setRfs("9"); tPelaksanaan.setId_pelaksana("333"); tPelaksanaan.setCreated_date(now); tPelaksanaan.setCreated_user("333333"); Timestamp ts = new Timestamp(Calendar.getInstance().getTimeInMillis()); tPelaksanaan.setUpdated_date(ts); tPelaksanaan.setUpdated_user("6363"); tPelaksanaanDAO.createTPelaksanaan(tPelaksanaan); assertEquals(z + 1, tPelaksanaanDAO.getCountAllTPelaksanaan()); } @Test public void testSaveOrUpdateTPelaksanaan() throws ParseException { String t_idoss_pelaksanaan_id = "00555FSHOPHAR2010"; TPelaksanaan tPelaksanaan = tPelaksanaanDAO.getTPelaksanaanByTIdossPelaksanaanId(t_idoss_pelaksanaan_id); tPelaksanaan.setRfs("RFS76"); // Date now = new Date(Calendar.getInstance().getTimeInMillis()); String tglIsian = "1976-01-26 06:05:10"; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); java.util.Date tglDate = sdf.parse(tglIsian); // Timestamp ts = new Timestamp(tglDate.getTime()); Timestamp dt = new Timestamp(tglDate.getTime()); tPelaksanaan.setRfs_date(dt); tPelaksanaan.setId_pelaksana("7676"); tPelaksanaan.setNama_pelaksana("Ants"); tPelaksanaan.setStatus_perubahan("CLOSED"); tPelaksanaanDAO.saveOrUpdateTPelaksanaan(tPelaksanaan); String namaPelaksanaActual = tPelaksanaan.getNama_pelaksana(); String namaPelaksanaExpected = "Ants"; assertEquals(namaPelaksanaExpected, namaPelaksanaActual); } }
[ "antonius.sianturi@59eea869-dece-0caf-8a99-c029baa0b33b" ]
antonius.sianturi@59eea869-dece-0caf-8a99-c029baa0b33b
92991fccbc3c71d3d6bed2569a7ef3839c5a1a44
d8cf27f076b5c3ae2c2d615d9d734082da32d29d
/springbootdemos/src/main/java/com/springboot/basics/springbootdemos/BooksController.java
be82404a44cad039984b55c5a859964436b39f19
[]
no_license
zerak222/microservices
c2d35e662a472d714de76b3919e8c5cf85691351
7d9fb79bd8993bfbf07d3e6798ce199a80a09313
refs/heads/main
2023-03-09T10:45:14.710616
2021-02-27T14:52:00
2021-02-27T14:52:00
337,397,408
0
0
null
null
null
null
UTF-8
Java
false
false
537
java
package com.springboot.basics.springbootdemos; import java.util.ArrayList; import java.util.List; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class BooksController { @GetMapping("/books") public List<Book> getAllBooks(){ List<Book> listOfBooks = new ArrayList<Book>(); listOfBooks.add(new Book(1, "A", "AAA")); listOfBooks.add(new Book(2, "B", "BBB")); listOfBooks.add(new Book(3, "C", "CCC")); return listOfBooks; } }
[ "Rakesh.Nagapuri@planonsoftware.com" ]
Rakesh.Nagapuri@planonsoftware.com
7913335cef888aa09bc04f620f1182a93f139f3b
44c380f26ba39415e3e7fa432398c4e604f1a670
/WriteToFile.java
b2c37c6412ad4485842193c681b6c1da2e08cbf8
[]
no_license
Transpoze/SoftwareReliability
9e778b8c56a73f6bdbad4fc01968c188273a749f
d11af717d29fcb809816033adc67aa4ed087fcce
refs/heads/master
2021-06-30T06:47:15.317924
2017-09-18T21:40:49
2017-09-18T21:40:49
103,994,682
0
0
null
null
null
null
UTF-8
Java
false
false
526
java
package Software_Reliability.src; import java.io.IOException; import java.io.PrintWriter; public class WriteToFile { RandomArray ra = new RandomArray(); public void writeTo(String theFile, int numberOfArrays, int lengthOfArray) { try { PrintWriter writer = new PrintWriter(theFile, "UTF-8"); for (int i = 0; i < numberOfArrays; i++) { writer.println(ra.getRandArray(lengthOfArray)); } writer.close(); } catch (IOException e) { System.out.println("Error occured while writing to file!"); } } }
[ "noreply@github.com" ]
noreply@github.com
9542d8dc1e0b918ba4850eaba51effd5fd710763
5c8efd34d7078ab764a66028b5fc0a392501ab47
/src/ex6/Controlador.java
29432e1624d0d931957382edee6852cb0307468b
[]
no_license
LabEngenharia201702/N2Lista1
3210cd8c38b156fb395611d826e65cbe65e449f4
89f91308a654ebaf4ad53614826fd678a5eceed8
refs/heads/master
2021-08-22T11:00:04.598269
2017-11-30T02:07:15
2017-11-30T02:07:15
112,014,866
0
0
null
null
null
null
UTF-8
Java
false
false
4,450
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 ex6; import java.util.ArrayList; import java.util.List; import java.util.Scanner; /** * * @author diego */ public class Controlador { List<Componente> componentes= new ArrayList<>(); FabricaDecoracao fd=new FabricaDecoracao(); FabricaTicket ft= new FabricaTicket(); Componente componente; /*** * Cria um novo ticket e o adiciona em 'componentes' */ public void CriarTicket() { componente= ft.criarComponente("ticket");//Cria um Ticket componente.setTexto(DigitarTexto("ticket"));//Define o texto do ticket String tipoDecoracao; //Adiciona um cabecalho caso o usuário deseje tipoDecoracao="cabecalho"; if(ConfirmarDecoracao(tipoDecoracao)) AdicionarDecoracao( tipoDecoracao); //Adiciona um rodape caso o cliente deseje tipoDecoracao="rodape"; if(ConfirmarDecoracao(tipoDecoracao)) AdicionarDecoracao( tipoDecoracao); componentes.add(componente);//Adiciona o novo ticket na lista } void VisualizarTickets() { String separador="---------------------------------------"; for(Componente c: componentes) { System.out.println(separador); Componente n=c; Rodape rodape; Cabecalho cabecalho; Ticket ticket; if(n instanceof Rodape) { rodape= (Rodape) n; n=rodape.getComponente(); } else rodape=null; if (n instanceof Cabecalho) { cabecalho=(Cabecalho)n; n=cabecalho.getComponente(); } else { cabecalho=null; } ticket=(Ticket)n; System.out.println("Ticket: "+ticket.getTexto()); if(cabecalho!=null) { System.out.println("Cabecalho: "+cabecalho.getTexto()); } if(rodape!=null) { System.out.println("Rodape: "+rodape.getTexto()); } } System.out.println(separador); } /*** * Mostra o menu das opcoes disponíveis */ public void ExibirMenu() { System.out.println("1 - Adicionar Ticket"); System.out.println("2 - Ver Tickets"); System.out.println("0 - Sair"); } /*** * * @param item É necessário saber de onde esse texto é para que sej informado ao usuário * @return */ public String DigitarTexto(String item) { String texto; Scanner scanner = new Scanner(System.in); System.out.println("Digite o texto do "+item+" : "); texto=scanner.next(); return texto; } /*** * Pergunta ao usuário se deseja receber uma Decoração do tipoDecoracao * @param tipoDecoracao Informa o tipo da Decoracao * @return Retorna true caso a resposta seja afirmativa */ boolean ConfirmarDecoracao(String tipoDecoracao) { String resposta; Scanner scanner= new Scanner(System.in); System.out.print("Deseja "+tipoDecoracao+"?[S/N]: "); resposta=scanner.next(); if(resposta.trim().toUpperCase().equals("S")) return true; return false; } /*** * * @param c Componente que será decorado * @param tipoDecoracao Tipo de decoracao que será adicionada */ private void AdicionarDecoracao(String tipoDecoracao) { Decoracao decoracao=(Decoracao) fd.criarComponente(tipoDecoracao);// Cria uma nova Decoracao do tipoDecoracao decoracao.setComponente(componente); //Faz com que o componente seja decorado componente=decoracao;// É alterado a referencia do Componente para a Decoracao porque ela encapsula o COmponente dentro dela, portanto ele não é perdido componente.setTexto(DigitarTexto(tipoDecoracao)); //Define o texto que está na nova Decoracao } }
[ "diego-gonzaga@live.com" ]
diego-gonzaga@live.com
61298224e723e04151a872014f7b030fe28ac830
f3ace548bf9fd40e8e69f55e084c8d13ad467c1c
/src/mutants/SequentialHeap/AOIS_106/SequentialHeap.java
bd21a119d4067cb6c0c39980760740078986febf
[]
no_license
phantomDai/concurrentProgramTesting
307d008f3bba8cdcaf8289bdc10ddf5cabdb8a04
8ac37f73c0413adfb1ea72cb6a8f7201c55c88ac
refs/heads/master
2021-05-06T21:18:13.238925
2017-12-06T11:10:01
2017-12-06T11:10:02
111,872,421
0
0
null
null
null
null
UTF-8
Java
false
false
3,019
java
package mutants.SequentialHeap.AOIS_106; // Author : ysma public class SequentialHeap<T> implements PQueue<T> { private static final int ROOT = 1; int next; HeapNode<T>[] heap; public SequentialHeap( int capacity ) { next = 1; heap = (HeapNode<T>[]) new SequentialHeap.HeapNode[capacity + 1]; for (int i = 0; i < capacity + 1; i++) { heap[i] = new HeapNode<T>(); } } public void add( T item, int priority ) { int child = next++; heap[child].init( item, priority ); while (child > ROOT) { int parent = child / 2; int oldChild = child; if (heap[child].priority < heap[parent].priority) { swap( child, parent ); child = parent; } else { return; } } } public T getMin() { return heap[ROOT].item; } public T removeMin() { int bottom = --next; T item = heap[ROOT].item; swap( ROOT, bottom ); if (bottom == ROOT) { return item; } int child = 0; int parent = ROOT; while (parent < heap.length / 2) { int left = parent * 2; int right = parent * 2 + 1; if (left >= next) { break; } else { if (right >= next || heap[left].priority < heap[right].priority) { child = left; } else { child = right; } } if (--heap[child].priority < heap[parent].priority) { swap( parent, child ); parent = child; } else { break; } } return item; } private void swap( int i, int j ) { HeapNode<T> node = heap[i]; heap[i] = heap[j]; heap[j] = node; } public boolean isEmpty() { return next == 0; } public void sanityCheck() { int stop = next; for (int i = ROOT; i < stop; i++) { int left = i * 2; int right = i * 2 + 1; if (left < stop && heap[left].priority < heap[i].priority) { System.out.println( "Heap property violated:" ); System.out.printf( "\theap[%d] = %d, left child heap[%d] = %d\n", i, heap[i].priority, left, heap[left].priority ); } if (right < stop && heap[right].priority < heap[i].priority) { System.out.println( "Heap property violated:" ); System.out.printf( "\theap[%d] = %d, right child heap[%d] = %d\n", i, heap[i].priority, right, heap[right].priority ); } } } private static class HeapNode<S> { int priority; S item; public void init( S myItem, int myPriority ) { item = myItem; priority = myPriority; } } }
[ "zxmantou@163.com" ]
zxmantou@163.com
250aef14bd40ceedbcb2c83ff3ff464056d983f0
91cb4f8619a8077495f0c85a1a7168d3fb6953ee
/message-code/src/main/java/com/message/entity/SubscribeInfo.java
4a6467fb3f06b78a7139fcc83ef46defe7522c06
[]
no_license
zhouyu5408/message
4518f36f4b8ad9a2f896ce973d79aaae50d09861
402ee0c029a48d12baaf8c6e12662a2487123d75
refs/heads/master
2020-03-21T17:45:44.746551
2018-06-27T09:25:51
2018-06-27T09:25:51
138,851,877
0
0
null
null
null
null
GB18030
Java
false
false
2,759
java
package com.message.entity; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; /** * 订阅人中间类,用于封装订阅人需要的信息 * * @Date: 2017年12月28日 下午5:25:10 <br/> * * @author zhouyu * @version 1.0 Copyright (YLINK) , All Rights Reserved. * @since JDK 1.7 */ @JsonInclude(Include.NON_NULL) public class SubscribeInfo { /** * 用户编号 */ private String userId; /** * 用户姓名 */ private String userName; /** * 登录名 */ private String loginName; /** * 邮箱 */ private String email; /** * 电话号码 */ private String phoneNum; /** * 订阅方式(邮件/短信/弹窗) */ private String deliveryWay; /** * 订阅的处理类 */ private String msgObject; private String id;// 便于前端取数据之用 private String text;// 便于前端取数据之用 public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; this.id = userId; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; this.text = userName; } public String getLoginName() { return loginName; } public void setLoginName(String loginName) { this.loginName = loginName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPhoneNum() { return phoneNum; } public void setPhoneNum(String phoneNum) { this.phoneNum = phoneNum; } public String getDeliveryWay() { return deliveryWay; } public void setDeliveryWay(String deliveryWay) { this.deliveryWay = deliveryWay; } public String getMsgObject() { return msgObject; } public void setMsgObject(String msgObject) { this.msgObject = msgObject; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getText() { return text; } public void setText(String text) { this.text = text; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((userId == null) ? 0 : userId.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; SubscribeInfo other = (SubscribeInfo) obj; if (userId == null) { if (other.userId != null) return false; } else if (!userId.equals(other.userId)) return false; return true; } }
[ "zhouyu@cenboomh.com" ]
zhouyu@cenboomh.com
5fb3932750060177b4db31fb81032aabdc07a063
0b2a08ae557bd8dafba5f37b49fede0d844da4a5
/src/main/java/coveredcallscreener/domain/json/stock/GoogleStockJson.java
317910c4f8fa4c14374763434fd320e39c459481
[]
no_license
ygenest/CoveredCallScreener
8d8d7f4d787ed93ccd7219cecc1f0cea079931ea
1268a2837ad83afc855f3deae1a0c223a466c599
refs/heads/Develop
2021-01-15T21:44:25.391072
2017-12-14T10:23:23
2017-12-14T10:23:23
27,274,562
2
1
null
2016-10-28T16:02:36
2014-11-28T16:31:56
Java
UTF-8
Java
false
false
20,094
java
package coveredcallscreener.domain.json.stock; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonInclude(JsonInclude.Include.NON_NULL) @Generated("org.jsonschema2pojo") @JsonPropertyOrder({ "symbol", "exchange", "id", "t", "e", "name", "f_reuters_url", "f_recent_quarter_date", "f_annual_date", "f_ttm_date", "financials", "kr_recent_quarter_date", "kr_annual_date", "kr_ttm_date", "keyratios", "c", "l", "cp", "ccol", "op", "hi", "lo", "vo", "avvo", "hi52", "lo52", "mc", "pe", "fwpe", "beta", "eps", "dy", "ldiv", "shares", "instown", "eo", "sid", "sname", "iid", "iname", "related", "summary", "management", "moreresources", "events" }) public class GoogleStockJson { @JsonProperty("symbol") private String symbol; @JsonProperty("exchange") private String exchange; @JsonProperty("id") private String id; @JsonProperty("t") private String t; @JsonProperty("e") private String e; @JsonProperty("name") private String name; @JsonProperty("f_reuters_url") private String fReutersUrl; @JsonProperty("f_recent_quarter_date") private String fRecentQuarterDate; @JsonProperty("f_annual_date") private String fAnnualDate; @JsonProperty("f_ttm_date") private String fTtmDate; @JsonProperty("financials") private List<Financial> financials = new ArrayList<Financial>(); @JsonProperty("kr_recent_quarter_date") private String krRecentQuarterDate; @JsonProperty("kr_annual_date") private String krAnnualDate; @JsonProperty("kr_ttm_date") private String krTtmDate; @JsonProperty("keyratios") private List<Keyratio> keyratios = new ArrayList<Keyratio>(); @JsonProperty("c") private String c; @JsonProperty("l") private String l; @JsonProperty("cp") private String cp; @JsonProperty("ccol") private String ccol; @JsonProperty("op") private String op; @JsonProperty("hi") private String hi; @JsonProperty("lo") private String lo; @JsonProperty("vo") private String vo; @JsonProperty("avvo") private String avvo; @JsonProperty("hi52") private String hi52; @JsonProperty("lo52") private String lo52; @JsonProperty("mc") private String mc; @JsonProperty("pe") private String pe; @JsonProperty("fwpe") private String fwpe; @JsonProperty("beta") private String beta; @JsonProperty("eps") private String eps; @JsonProperty("dy") private String dy; @JsonProperty("ldiv") private String ldiv; @JsonProperty("shares") private String shares; @JsonProperty("instown") private String instown; @JsonProperty("eo") private String eo; @JsonProperty("sid") private String sid; @JsonProperty("sname") private String sname; @JsonProperty("iid") private String iid; @JsonProperty("iname") private String iname; @JsonProperty("related") private List<Related> related = new ArrayList<Related>(); @JsonProperty("summary") private List<Summary> summary = new ArrayList<Summary>(); @JsonProperty("management") private List<Management> management = new ArrayList<Management>(); @JsonProperty("moreresources") private List<Moreresource> moreresources = new ArrayList<Moreresource>(); @JsonProperty("events") private List<Object> events = new ArrayList<Object>(); @JsonIgnore private Map<String, Object> additionalProperties = new HashMap<String, Object>(); /** * * @return * The symbol */ @JsonProperty("symbol") public String getSymbol() { return symbol; } /** * * @param symbol * The symbol */ @JsonProperty("symbol") public void setSymbol(String symbol) { this.symbol = symbol; } /** * * @return * The exchange */ @JsonProperty("exchange") public String getExchange() { return exchange; } /** * * @param exchange * The exchange */ @JsonProperty("exchange") public void setExchange(String exchange) { this.exchange = exchange; } /** * * @return * The id */ @JsonProperty("id") public String getId() { return id; } /** * * @param id * The id */ @JsonProperty("id") public void setId(String id) { this.id = id; } /** * * @return * The t */ @JsonProperty("t") public String getT() { return t; } /** * * @param t * The t */ @JsonProperty("t") public void setT(String t) { this.t = t; } /** * * @return * The e */ @JsonProperty("e") public String getE() { return e; } /** * * @param e * The e */ @JsonProperty("e") public void setE(String e) { this.e = e; } /** * * @return * The name */ @JsonProperty("name") public String getName() { return name; } /** * * @param name * The name */ @JsonProperty("name") public void setName(String name) { this.name = name; } /** * * @return * The fReutersUrl */ @JsonProperty("f_reuters_url") public String getFReutersUrl() { return fReutersUrl; } /** * * @param fReutersUrl * The f_reuters_url */ @JsonProperty("f_reuters_url") public void setFReutersUrl(String fReutersUrl) { this.fReutersUrl = fReutersUrl; } /** * * @return * The fRecentQuarterDate */ @JsonProperty("f_recent_quarter_date") public String getFRecentQuarterDate() { return fRecentQuarterDate; } /** * * @param fRecentQuarterDate * The f_recent_quarter_date */ @JsonProperty("f_recent_quarter_date") public void setFRecentQuarterDate(String fRecentQuarterDate) { this.fRecentQuarterDate = fRecentQuarterDate; } /** * * @return * The fAnnualDate */ @JsonProperty("f_annual_date") public String getFAnnualDate() { return fAnnualDate; } /** * * @param fAnnualDate * The f_annual_date */ @JsonProperty("f_annual_date") public void setFAnnualDate(String fAnnualDate) { this.fAnnualDate = fAnnualDate; } /** * * @return * The fTtmDate */ @JsonProperty("f_ttm_date") public String getFTtmDate() { return fTtmDate; } /** * * @param fTtmDate * The f_ttm_date */ @JsonProperty("f_ttm_date") public void setFTtmDate(String fTtmDate) { this.fTtmDate = fTtmDate; } /** * * @return * The financials */ @JsonProperty("financials") public List<Financial> getFinancials() { return financials; } /** * * @param financials * The financials */ @JsonProperty("financials") public void setFinancials(List<Financial> financials) { this.financials = financials; } /** * * @return * The krRecentQuarterDate */ @JsonProperty("kr_recent_quarter_date") public String getKrRecentQuarterDate() { return krRecentQuarterDate; } /** * * @param krRecentQuarterDate * The kr_recent_quarter_date */ @JsonProperty("kr_recent_quarter_date") public void setKrRecentQuarterDate(String krRecentQuarterDate) { this.krRecentQuarterDate = krRecentQuarterDate; } /** * * @return * The krAnnualDate */ @JsonProperty("kr_annual_date") public String getKrAnnualDate() { return krAnnualDate; } /** * * @param krAnnualDate * The kr_annual_date */ @JsonProperty("kr_annual_date") public void setKrAnnualDate(String krAnnualDate) { this.krAnnualDate = krAnnualDate; } /** * * @return * The krTtmDate */ @JsonProperty("kr_ttm_date") public String getKrTtmDate() { return krTtmDate; } /** * * @param krTtmDate * The kr_ttm_date */ @JsonProperty("kr_ttm_date") public void setKrTtmDate(String krTtmDate) { this.krTtmDate = krTtmDate; } /** * * @return * The keyratios */ @JsonProperty("keyratios") public List<Keyratio> getKeyratios() { return keyratios; } /** * * @param keyratios * The keyratios */ @JsonProperty("keyratios") public void setKeyratios(List<Keyratio> keyratios) { this.keyratios = keyratios; } /** * * @return * The c */ @JsonProperty("c") public String getC() { return c; } /** * * @param c * The c */ @JsonProperty("c") public void setC(String c) { this.c = c; } /** * * @return * The l */ @JsonProperty("l") public String getL() { return l; } /** * * @param l * The l */ @JsonProperty("l") public void setL(String l) { this.l = l; } /** * * @return * The cp */ @JsonProperty("cp") public String getCp() { return cp; } /** * * @param cp * The cp */ @JsonProperty("cp") public void setCp(String cp) { this.cp = cp; } /** * * @return * The ccol */ @JsonProperty("ccol") public String getCcol() { return ccol; } /** * * @param ccol * The ccol */ @JsonProperty("ccol") public void setCcol(String ccol) { this.ccol = ccol; } /** * * @return * The op */ @JsonProperty("op") public String getOp() { return op; } /** * * @param op * The op */ @JsonProperty("op") public void setOp(String op) { this.op = op; } /** * * @return * The hi */ @JsonProperty("hi") public String getHi() { return hi; } /** * * @param hi * The hi */ @JsonProperty("hi") public void setHi(String hi) { this.hi = hi; } /** * * @return * The lo */ @JsonProperty("lo") public String getLo() { return lo; } /** * * @param lo * The lo */ @JsonProperty("lo") public void setLo(String lo) { this.lo = lo; } /** * * @return * The vo */ @JsonProperty("vo") public String getVo() { return vo; } /** * * @param vo * The vo */ @JsonProperty("vo") public void setVo(String vo) { this.vo = vo; } /** * * @return * The avvo */ @JsonProperty("avvo") public String getAvvo() { return avvo; } /** * * @param avvo * The avvo */ @JsonProperty("avvo") public void setAvvo(String avvo) { this.avvo = avvo; } /** * * @return * The hi52 */ @JsonProperty("hi52") public String getHi52() { return hi52; } /** * * @param hi52 * The hi52 */ @JsonProperty("hi52") public void setHi52(String hi52) { this.hi52 = hi52; } /** * * @return * The lo52 */ @JsonProperty("lo52") public String getLo52() { return lo52; } /** * * @param lo52 * The lo52 */ @JsonProperty("lo52") public void setLo52(String lo52) { this.lo52 = lo52; } /** * * @return * The mc */ @JsonProperty("mc") public String getMc() { return mc; } /** * * @param mc * The mc */ @JsonProperty("mc") public void setMc(String mc) { this.mc = mc; } /** * * @return * The pe */ @JsonProperty("pe") public String getPe() { return pe; } /** * * @param pe * The pe */ @JsonProperty("pe") public void setPe(String pe) { this.pe = pe; } /** * * @return * The fwpe */ @JsonProperty("fwpe") public String getFwpe() { return fwpe; } /** * * @param fwpe * The fwpe */ @JsonProperty("fwpe") public void setFwpe(String fwpe) { this.fwpe = fwpe; } /** * * @return * The beta */ @JsonProperty("beta") public String getBeta() { return beta; } /** * * @param beta * The beta */ @JsonProperty("beta") public void setBeta(String beta) { this.beta = beta; } /** * * @return * The eps */ @JsonProperty("eps") public String getEps() { return eps; } /** * * @param eps * The eps */ @JsonProperty("eps") public void setEps(String eps) { this.eps = eps; } /** * * @return * The dy */ @JsonProperty("dy") public String getDy() { return dy; } /** * * @param dy * The dy */ @JsonProperty("dy") public void setDy(String dy) { this.dy = dy; } /** * * @return * The ldiv */ @JsonProperty("ldiv") public String getLdiv() { return ldiv; } /** * * @param ldiv * The ldiv */ @JsonProperty("ldiv") public void setLdiv(String ldiv) { this.ldiv = ldiv; } /** * * @return * The shares */ @JsonProperty("shares") public String getShares() { return shares; } /** * * @param shares * The shares */ @JsonProperty("shares") public void setShares(String shares) { this.shares = shares; } /** * * @return * The instown */ @JsonProperty("instown") public String getInstown() { return instown; } /** * * @param instown * The instown */ @JsonProperty("instown") public void setInstown(String instown) { this.instown = instown; } /** * * @return * The eo */ @JsonProperty("eo") public String getEo() { return eo; } /** * * @param eo * The eo */ @JsonProperty("eo") public void setEo(String eo) { this.eo = eo; } /** * * @return * The sid */ @JsonProperty("sid") public String getSid() { return sid; } /** * * @param sid * The sid */ @JsonProperty("sid") public void setSid(String sid) { this.sid = sid; } /** * * @return * The sname */ @JsonProperty("sname") public String getSname() { return sname; } /** * * @param sname * The sname */ @JsonProperty("sname") public void setSname(String sname) { this.sname = sname; } /** * * @return * The iid */ @JsonProperty("iid") public String getIid() { return iid; } /** * * @param iid * The iid */ @JsonProperty("iid") public void setIid(String iid) { this.iid = iid; } /** * * @return * The iname */ @JsonProperty("iname") public String getIname() { return iname; } /** * * @param iname * The iname */ @JsonProperty("iname") public void setIname(String iname) { this.iname = iname; } /** * * @return * The related */ @JsonProperty("related") public List<Related> getRelated() { return related; } /** * * @param related * The related */ @JsonProperty("related") public void setRelated(List<Related> related) { this.related = related; } /** * * @return * The summary */ @JsonProperty("summary") public List<Summary> getSummary() { return summary; } /** * * @param summary * The summary */ @JsonProperty("summary") public void setSummary(List<Summary> summary) { this.summary = summary; } /** * * @return * The management */ @JsonProperty("management") public List<Management> getManagement() { return management; } /** * * @param management * The management */ @JsonProperty("management") public void setManagement(List<Management> management) { this.management = management; } /** * * @return * The moreresources */ @JsonProperty("moreresources") public List<Moreresource> getMoreresources() { return moreresources; } /** * * @param moreresources * The moreresources */ @JsonProperty("moreresources") public void setMoreresources(List<Moreresource> moreresources) { this.moreresources = moreresources; } /** * * @return * The events */ @JsonProperty("events") public List<Object> getEvents() { return events; } /** * * @param events * The events */ @JsonProperty("events") public void setEvents(List<Object> events) { this.events = events; } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } @Override public String toString() { String s= "symbol:"+symbol+ " exchange:"+exchange+ " id:"+id+ " t:"+t+ " e:"+e+ " name:"+name+ " f_reuters_url:"+fReutersUrl+ " f_recent_quarter_date:"+fRecentQuarterDate+ " f_annual_date:"+fAnnualDate+ " f_ttm_date:"+fTtmDate+ " financials:"+financials+ " kr_recent_quarter_date:"+krRecentQuarterDate+ " kr_annual_date:"+krAnnualDate+ " kr_ttm_date:"+krTtmDate+ " keyratios:"+keyratios+ " c:"+c+ " l:"+l+ " cp:"+cp+ " ccol:"+ccol+ " op:"+op+ " hi:"+hi+ " lo:"+lo+ " vo:"+vo+ " avvo:"+avvo+ " hi52:"+hi52+ " lo52:"+lo52+ " mc:"+mc+ " pe:"+pe+ " fwpe:"+fwpe+ " beta:"+beta+ " eps:"+eps+ " dy:"+dy+ " ldiv:"+ldiv+ " shares:"+shares+ " instown:"+instown+ " eo:"+eo+ " sid:"+sid+ " sname:"+sname+ " iid:"+iid+ " iname:"+iname+ " related:"+related+ " summary:"+summary+ " management:"+management+ " moreresources:"+moreresources+ " events:"+events; return s; } }
[ "yvestablet@gmail.com" ]
yvestablet@gmail.com
0301b0e56c1165f0545ba10424f86cbeedb028e4
b89ebc72449c8100c45187843aa5402b5d27a813
/application/src/main/java/com/sap/cloud/sdk/tutorial/addressmgr/commands/UpdateAddressCommand.java
98234ec2f1a1fc08525c529cd538425b8bccfcea
[]
no_license
dassoumya87/address-manager
736e7d320407b94122eb80919c2201081aeecd5e
90c3141cb9c05ff21f14852d132f1445b800edd0
refs/heads/master
2020-07-30T20:40:48.460930
2019-10-29T06:22:20
2019-10-29T06:22:20
210,352,766
1
0
null
null
null
null
UTF-8
Java
false
false
1,612
java
package com.sap.cloud.sdk.tutorial.addressmgr.commands; import com.sap.cloud.sdk.odatav2.connectivity.ODataUpdateResult; import com.sap.cloud.sdk.s4hana.connectivity.ErpHttpDestination; import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.businesspartner.BusinessPartnerAddress; import com.sap.cloud.sdk.s4hana.datamodel.odata.services.BusinessPartnerService; import com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultBusinessPartnerService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class UpdateAddressCommand { private static final Logger logger = LoggerFactory.getLogger(UpdateAddressCommand.class); private final BusinessPartnerService businessPartnerService; private final BusinessPartnerAddress addressToUpdate; private final ErpHttpDestination destination; public UpdateAddressCommand(ErpHttpDestination destination, BusinessPartnerAddress addressToUpdate) { this(destination, new DefaultBusinessPartnerService(), addressToUpdate); } public UpdateAddressCommand(ErpHttpDestination destination, BusinessPartnerService businessPartnerService, BusinessPartnerAddress addressToUpdate) { this.destination = destination; this.businessPartnerService = businessPartnerService; this.addressToUpdate = addressToUpdate; } public Integer execute() throws Exception { final ODataUpdateResult oDataUpdateResult = businessPartnerService .updateBusinessPartnerAddress(addressToUpdate) .execute(destination); return oDataUpdateResult.getHttpStatusCode(); } }
[ "soumya.ranjan.das@sap.com" ]
soumya.ranjan.das@sap.com
9e16deae2be0a957db16ff687c07f24e64a2ba13
cfa83cc0d0a4f997e2c133af2343ed1da060f08b
/StanleysProject/StorageLocationInterface.java
9e0ac0b1094474650bc863b7955d75da49bc9210
[]
no_license
dealant/Project2
29cab9a12d2740e8a4d4a87752f4d3f88ebb1425
eb67c117bbaf75f655dc7857a1a2abb58fd5c8f6
refs/heads/master
2022-11-21T13:15:18.055908
2020-07-15T05:34:17
2020-07-15T05:34:17
279,709,990
0
0
null
null
null
null
UTF-8
Java
false
false
882
java
/** * Requirements for the StorageLocation class * * @author Bill Barry * @version 2020-04-30 */ public interface StorageLocationInterface { //note: constructor should take storage location designation parameter // as well as a base price public String getDesignation(); public int getRowCount(); public int getUnitsPerRowCount(int rowIdx); public StorageUnit getStorageUnit(int rowIdx, int spaceIdx); public Customer getCustomer(int custIdx); public int getCustomerCount(); public int addCustomer(Customer customer); public StorageUnit[] getCustomerUnits(Customer customer); public StorageUnit[] getEmptyUnits(); public StorageUnit[] getEmptyUnits(Class<? extends StorageUnit> soughtClass); public double chargeMonthlyRent(); public double getUnitBasePrice(); public double getMultiUnitDiscount(); }
[ "alan361206@gmail.com" ]
alan361206@gmail.com
465915363f098fc88efbe57eaa74a48f769255f7
eace11a5735cfec1f9560e41a9ee30a1a133c5a9
/AMT/experiment/lab/ACMC修正前/traditional_mutants/double_feeCalculation(int,int,boolean,double,double)/AORB_9/AirlinesBaggageBillingService.java
b0337e469c09930d1b122369fcc81ab61b4ed448
[]
no_license
phantomDai/mypapers
eb2fc0fac5945c5efd303e0206aa93d6ac0624d0
e1aa1236bbad5d6d3b634a846cb8076a1951485a
refs/heads/master
2021-07-06T18:27:48.620826
2020-08-19T12:17:03
2020-08-19T12:17:03
162,563,422
0
1
null
null
null
null
UTF-8
Java
false
false
1,916
java
// This is a mutant program. // Author : ysma public class AirlinesBaggageBillingService { int airClass = 0; int area = 0; double luggage = 0; double benchmark = 0; double takealong = 0; double luggagefee = 0; int tln = 0; boolean isStudent = false; double economicfee = 0; public double feeCalculation( int airClass, int area, boolean isStudent, double luggage, double economicfee ) { this.airClass = this.preairclass( airClass ); this.area = this.prearea( area ); switch (this.airClass) { case 0 : benchmark = 40; break; case 1 : benchmark = 30; break; case 2 : benchmark = 20; break; case 3 : benchmark = 0; break; } if (this.area == 1) { takealong = 7; tln = 1; if (isStudent) { benchmark = 30; } } if (this.area == 0) { switch (this.airClass) { case 0 : tln = 2; takealong = 5; break; case 1 : tln = 1; takealong = 5; break; case 2 : tln = 1; takealong = 5; break; case 3 : tln = 1; takealong = 5; break; } } if (benchmark > luggage) { luggage = benchmark; } return luggagefee = (luggage - benchmark) * economicfee / 0.015; } public int preairclass( int airClass ) { int result = 0; result = airClass % 4; return result; } public int prearea( int area ) { int result = 0; result = area % 2; return result; } }
[ "daihepeng@sina.cn" ]
daihepeng@sina.cn
251b1919ca5ac74faf76d42fc00f8964763d3491
360c472864772bbcff68db8d071380fa860ba927
/src/main/java/com/cortez/cursomc/resources/ClienteResource.java
f6a4a0ae035609855b0fb9daade1f488b3ed5552
[]
no_license
HerlonCortez/cursomc
85f13411f16dd336dd8784cb287ade623988c31e
8d5f304a2192575c90324a3491958044dc518891
refs/heads/master
2022-11-04T21:16:19.022858
2020-07-07T02:47:22
2020-07-07T02:47:22
276,120,058
0
0
null
null
null
null
UTF-8
Java
false
false
827
java
package com.cortez.cursomc.resources; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import com.cortez.cursomc.domain.Cliente; import com.cortez.cursomc.services.ClienteService; @RestController @RequestMapping(value="/clientes") public class ClienteResource { @Autowired private ClienteService service; @RequestMapping(value = "/{id}",method=RequestMethod.GET) public ResponseEntity<?> find(@PathVariable Integer id) { Cliente obj = service.buscar(id); return ResponseEntity.ok().body(obj); } }
[ "noklyn@gmail.com" ]
noklyn@gmail.com
f1c381babb1dbcc28aeac1f5dc6c6f4b6319b093
e100074cd3235b47d6a6249c76e06e7b4a95be85
/MySET-Android/MySET/src/com/spamgame/myset/FavouriteFragment.java
0daf792634ce98cb75c5ff2405b796ee0e1e190e
[]
no_license
zaapam/my_set
89a3e14818b092cd364966bb8b6ffcac7b866bde
7c93ffbcd3ba399cd4cd16dfd6b5099dc0e0e78c
refs/heads/master
2020-04-05T22:49:51.179539
2014-08-05T12:40:08
2014-08-05T12:40:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,000
java
package com.spamgame.myset; import java.util.ArrayList; import org.json.JSONObject; import com.androidquery.AQuery; import com.androidquery.callback.AjaxStatus; import com.spamgame.myset.adapter.SETObjectAdapter; import com.spamgame.myset.util.SETObject; import eu.erikw.PullToRefreshListView; import android.content.Context; import android.os.AsyncTask; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; public class FavouriteFragment extends Fragment implements OnClickListener { private PullToRefreshListView listView; private SETObjectAdapter adapter; private Button btnAdd; private EditText textAdd; private ArrayList<SETObject> listSymbol; private AQuery aq; @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // TODO Auto-generated method stub View rootView = inflater.inflate(R.layout.fragment_favourite, container, false); Log.d(AppConfig.LOG, "Hello MySET"); //String[] values = new String[]{ "Message1", "Message2", "Message3" }; listSymbol = new ArrayList<SETObject>(); //ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, values); adapter = new SETObjectAdapter(getActivity(), listSymbol); //setListAdapter(adapter); listView = (PullToRefreshListView)rootView.findViewById(R.id.favourite_list); listView.setAdapter(adapter); aq = new AQuery(getActivity()); textAdd = (EditText)rootView.findViewById(R.id.edit_add_favourite); btnAdd = (Button)rootView.findViewById(R.id.btn_add_favourite); btnAdd.setOnClickListener(this); getActivity().runOnUiThread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub Log.d(AppConfig.LOG, "Load..."); String url = "http://www.google.com/uds/GnewsSearch?q=Obama&v=1.0"; aq.ajax(url, JSONObject.class, FavouriteFragment.this, "bindData"); } }); return rootView; } public void bindData(String url, JSONObject json, AjaxStatus status) { Log.d(AppConfig.LOG, "Favourite binddata"); listSymbol.add(new SETObject("BLAND", 2.18, 0.6, 2.13)); listSymbol.add(new SETObject("BLAND-W3", 0.73, 0.6, 10.57)); listSymbol.add(new SETObject("TRUE", 12.30, 0.8, 4.57)); listSymbol.add(new SETObject("EFORL", 1.41, -0.6, -5.28)); adapter.notifyDataSetChanged(); } private void doAddSymbol() { String symbol = textAdd.getText().toString(); listSymbol.add(new SETObject("TEST", 1.41, -0.6, -5.28)); adapter.notifyDataSetChanged(); } private class DataTask extends AsyncTask<Void, Void, String[]> { @Override protected String[] doInBackground(Void... params) { // Simulates a background job. try { Thread.sleep(2000); } catch (InterruptedException e) { ; } return null; } @Override protected void onPostExecute(String[] result) { //mListItems.addFirst("Added after refresh..."); // Call onRefreshComplete when the list has been refreshed. //((PullToRefreshListView) getListView()).onRefreshComplete(); super.onPostExecute(result); } } @Override public void onClick(View v) { // TODO Auto-generated method stub if (v == btnAdd) { doAddSymbol(); textAdd.clearFocus(); final InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(getView().getWindowToken(), 0); } } }
[ "settapak@gmail.com" ]
settapak@gmail.com
e2424adaf95a381bef27686ecfee8d87836cd4cf
a3d387dc7b29428a54ba8846acb285e2a4711e98
/source/main/java/org/openbakery/racecontrol/plugin/admin/messages/web/AdminMessagesPage.java
b3daad90b37d3d7dd134020b8d17ab3610e6dbbd
[ "Apache-2.0" ]
permissive
openbakery/LFS-Racecontrol
f5a6f133cc2d360af6c2dbc8d74fe8e229875234
d98a2d5f4f51d95fe71ddc06b4deb70ccb8ec5b9
refs/heads/master
2020-12-24T13:44:34.034389
2015-02-20T18:49:31
2015-02-20T18:49:31
3,834,597
0
0
null
null
null
null
UTF-8
Java
false
false
2,271
java
package org.openbakery.racecontrol.plugin.admin.messages.web; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.openbakery.racecontrol.persistence.PersistenceException; import org.openbakery.racecontrol.plugin.admin.messages.data.AdminMessage; import org.openbakery.racecontrol.plugin.admin.messages.service.AdminMessagesService; import org.openbakery.racecontrol.service.ServiceLocateException; import org.openbakery.racecontrol.service.ServiceLocator; import org.openbakery.racecontrol.web.RaceControlPage; import org.openbakery.racecontrol.web.bean.Visibility; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public abstract class AdminMessagesPage extends RaceControlPage { public AdminMessagesPage(PageParameters parameters) { super(parameters); } private Logger log = LoggerFactory.getLogger(AdminMessagesPage.class); public AdminMessagesService getAdminMessageService() { ServiceLocator serviceLocator = getSession().getServiceLocator(); try { return (AdminMessagesService) serviceLocator.getService(AdminMessagesService.class); } catch (ServiceLocateException e) { error("Internal error!"); log.error(e.getMessage(), e); } return null; } public void store(AdminMessage message) { try { getAdminMessageService().store(message); } catch (PersistenceException e) { error("Unable to store the message"); log.error(e.getMessage(), e); } } public void delete(AdminMessage message) { try { getAdminMessageService().delete(message); } catch (PersistenceException e) { error("Unable to remove the message"); log.error(e.getMessage(), e); } } public void sendToAllUsers(AdminMessage message) { if (isClientConnected()) { getAdminMessageService().showAdminMessage(message); } else { error("Client is not connected, so cannot send message"); } } private boolean isClientConnected() { return getSession().getServiceLocator().getRaceService().getClient().isConnected(); } @Override public Visibility getVisibility() { return Visibility.AUTHENTICATED; } public void hideAllMessages() { if (isClientConnected()) { getAdminMessageService().hideAllMessages(); } else { error("Client is not connected, so cannot send message"); } } }
[ "rene@openbakery.org" ]
rene@openbakery.org
2fa67a1e08532a1c2ef5f2a0fc0fd33eff5da6c2
ffa1c56bbd76f855f970af11dfeaf33fdfcf00b6
/senior-day08/src/src/com/atguigu/java/GenericTest.java
251dcd5986975862c04c3cbe419ba50696783e07
[]
no_license
mengxiaoZzz/Java-study
d1b1ac73c40c9f5882629d4e8211c97e513653c7
72671502f6f717a01cd6ab1d71fa8e539c6cd0ef
refs/heads/main
2023-04-04T05:53:38.942805
2021-04-17T06:31:44
2021-04-17T06:31:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,092
java
package src.com.atguigu.java; import org.junit.Test; import java.util.*; /** * * 泛型的使用 * 1.jdk 5.0新增的特性 * * 2.在集合中使用泛型: * 总结: * ① 集合接口或集合类在jdk5.0时都修改为带泛型的结构。 * ② 在实例化集合类时,可以指明具体的泛型类型 * ③ 指明完以后,在集合类或接口中凡是定义类或接口时,内部结构(比如:方法、构造器、属性等)使用到类的泛型的位置,都指定为实例化的泛型类型。 * 比如:add(E e) --->实例化以后:add(Integer e) * ④ 注意点:泛型的类型必须是类,不能是基本数据类型。需要用到基本数据类型的位置,拿包装类替换 * ⑤ 如果实例化时,没有指明泛型的类型。默认类型为java.lang.Object类型。 * * 3.如何自定义泛型结构:泛型类、泛型接口;泛型方法。见 GenericTest1.java * * @author shkstart * @create 2019 上午 9:59 */ public class GenericTest { //在集合中使用泛型之前的情况: @Test public void test1(){ ArrayList list = new ArrayList(); //需求:存放学生的成绩 list.add(78); list.add(76); list.add(89); list.add(88); //问题一:类型不安全 // list.add("Tom"); for(Object score : list){ //问题二:强转时,可能出现ClassCastException int stuScore = (Integer) score; System.out.println(stuScore); } } //在集合中使用泛型的情况:以ArrayList为例 @Test public void test2(){ ArrayList<Integer> list = new ArrayList<Integer>(); list.add(78); list.add(87); list.add(99); list.add(65); //编译时,就会进行类型检查,保证数据的安全 // list.add("Tom"); //方式一: // for(Integer score : list){ // //避免了强转操作 // int stuScore = score; // // System.out.println(stuScore); // // } //方式二: Iterator<Integer> iterator = list.iterator(); while(iterator.hasNext()){ int stuScore = iterator.next(); System.out.println(stuScore); } } //在集合中使用泛型的情况:以HashMap为例 @Test public void test3(){ // Map<String,Integer> map = new HashMap<String,Integer>(); //jdk7新特性:类型推断 Map<String,Integer> map = new HashMap<>(); map.put("Tom",87); map.put("Jerry",87); map.put("Jack",67); // map.put(123,"ABC"); //泛型的嵌套 Set<Map.Entry<String,Integer>> entry = map.entrySet(); Iterator<Map.Entry<String, Integer>> iterator = entry.iterator(); while(iterator.hasNext()){ Map.Entry<String, Integer> e = iterator.next(); String key = e.getKey(); Integer value = e.getValue(); System.out.println(key + "----" + value); } } }
[ "1243952362@qq.com" ]
1243952362@qq.com
e4ffb2c1159aafb47e1af866bc2d349a59d0b029
3b9f9900ac3e6492878f98dd7842f27cd2143cee
/src/main/java/dslayer/draxy/events/actmethods/Nevoa.java
b41ab63b50de61d74551199ada8ced076a7bb5ec
[]
no_license
Castruu/DemonSlayerSkills
e549c4ec94b66326e737f84964a039b45d7bc754
b3bdf38606ccb41bd4b48d02c9d777d8ed7fb8aa
refs/heads/main
2023-07-02T06:22:27.120406
2021-08-03T23:53:42
2021-08-03T23:53:42
391,476,325
1
2
null
null
null
null
UTF-8
Java
false
false
1,035
java
package dslayer.draxy.events.actmethods; import dslayer.draxy.DSMain; import org.bukkit.*; import org.bukkit.entity.Damageable; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import java.util.concurrent.TimeUnit; public class Nevoa implements IActiveMethods{ @Override public void spawnAttack(Player player, double damage) { Chunk chunk = player.getLocation().getChunk(); Location location = player.getLocation(); location.add(0, 1 ,0); Bukkit.getScheduler().runTaskAsynchronously(DSMain.getInstance(), () -> { float x = 0, z = 0; while (x <= 10) { x++; z++; player.getWorld().spigot().playEffect(location, Effect.CLOUD, 0,0, x + 2, 0, z + 2, 0, 30, 50 ); try {TimeUnit.MILLISECONDS.sleep(100);} catch (Exception e) {e.printStackTrace();} } applyDamage(player, 10, damage); }); } }
[ "noreply@github.com" ]
noreply@github.com
bb26e10bc33ea4ce888438ffe3932116ab1bfe63
b067d5061e4ae5e3e7f010175694bf2802706485
/American/ravv-service/src/main/java/cn/farwalker/ravv/service/web/webmodel/biz/IWebModelService.java
40bf45efc0962ec2445b136ac2dde20a71496dff
[]
no_license
lizhenghong20/web
7cf5a610ec19a0b8f7ba662131e56171fffabf9b
8941e68a2cf426b831e8219aeea8555568f95256
refs/heads/master
2022-11-05T18:02:47.842268
2019-06-10T02:22:32
2019-06-10T02:22:32
190,309,917
0
0
null
2022-10-12T20:27:42
2019-06-05T02:09:30
Java
UTF-8
Java
false
false
242
java
package cn.farwalker.ravv.service.web.webmodel.biz; import cn.farwalker.ravv.service.web.webmodel.model.WebModelBo; import java.util.List; public interface IWebModelService { List<WebModelBo> getAllModel(); String insertData(); }
[ "simple.ding816@gmail.com" ]
simple.ding816@gmail.com
37dda627643c431fa1bba5ba9c4c1671301227e4
ea98a911ee3eb6b90cc85bc505095f47ef994a81
/Singleton.java
80a2ccca65d65727b3fada2ebebb9776aaf143a2
[]
no_license
KaZzy12/Brasserie-Java
0bda6b6e22b3f36a87d1ebb6f2d35e2b6421ca02
5228a17eea6464e1e19bc8b364d180158be24ad8
refs/heads/master
2021-01-23T05:35:59.384378
2015-08-14T16:47:43
2015-08-14T16:47:43
35,673,333
0
0
null
null
null
null
UTF-8
Java
false
false
1,541
java
package DataAccess; import Exceptions.DataException; import java.sql.Connection; import java.sql.SQLException; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; public class Singleton { private static Connection connexionUnique; public static Connection getInstance() throws DataException { if (connexionUnique == null) { try { Context ctx = new InitialContext(); DataSource source = (DataSource)ctx.lookup("jdbc/BrassLagneaux"); connexionUnique = source.getConnection(); } catch(SQLException ex) { throw new DataException(); } catch(NamingException ex) { throw new DataException(); } } return connexionUnique; } public static void fermerConnexion() throws DataException { if(connexionUnique != null) { try { connexionUnique.close(); } catch(SQLException e) { throw new DataException(); } } } } --------------------------------------------------------------------- package Exceptions; public class DataException extends Exception { public String getMessage () { return "Une erreur est survenue lors de la connexion"; } }
[ "xthel0@gmail.com" ]
xthel0@gmail.com
3e2c7b65f5e642b9a736c36ce26593293dbbe044
427d7603ab4f3985ec61870b12e3b648a66efc23
/yn-job/src/main/java/com/yn/controller/ImportData4DayTable.java
9c9ea208f3966da94f6cba2efb5ade8cf956aabf
[]
no_license
jiafan940618/younen
b993a9403cc3baf53a99db65570d3b7e8560b200
d10658b678e07c8dc454b4e504ea74912bfbea4c
refs/heads/master
2021-09-01T12:42:35.316376
2017-12-27T01:27:21
2017-12-27T01:27:21
115,467,328
0
1
null
null
null
null
UTF-8
Java
false
false
5,744
java
package com.yn.controller; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import com.yn.dao.mapper.AmmeterMapper; import com.yn.model.AmPhaseRecord; import com.yn.model.Ammeter; import com.yn.model.ElecDataDay; import com.yn.service.AmPhaseRecordService; import com.yn.service.AmmeterService; import com.yn.service.ElecDataDayService; import com.yn.utils.DateUtil; @RestController @RequestMapping("/job/iddt") public class ImportData4DayTable { @Autowired private ElecDataDayService elecDataDayService; @Autowired private AmmeterService ammeterService; @Autowired private AmmeterMapper ammeterMapper; @Autowired private AmPhaseRecordService amPhaseRecordService; @RequestMapping(value = "/doImportData/{date}", method = RequestMethod.GET) public Object job(@PathVariable("date") String date) { System.out.println("start"); ElecDataDay dataDay = new ElecDataDay(); List<Ammeter> findAll = ammeterMapper.selectAllByMapper(); findAll.forEach(ammeter -> { AmPhaseRecord aprR = new AmPhaseRecord(); aprR.setcAddr(Integer.parseInt(ammeter.getcAddr())); aprR.setdType(ammeter.getdType()); aprR.setiAddr(ammeter.getiAddr()); aprR.setDealt(0); aprR.setDate(date);// 设置需要导入的时间。 aprR.setwAddr(0); aprR.setdAddr(1L); try { // 此处设置时间,即当天表只处理当天数据。 aprR.setTable(DateUtil.formatDate(DateUtil.formatString(date, "yyyy_MM_dd"), "yyMMdd")); } catch (ParseException e1) { e1.printStackTrace(); } AmPhaseRecord max1 = amPhaseRecordService.findMaxData(aprR); AmPhaseRecord min1 = amPhaseRecordService.findMinData(aprR); if (max1 != null && min1 != null) { Double kwh = max1.getKwhTotal() - min1.getKwhTotal(); dataDay.setDel(0); dataDay.setdAddr(max1.getdAddr()); dataDay.setdType(max1.getdType()); dataDay.setDevConfCode(date); dataDay.setKw(max1.getKw()); Long s = max1.getMeterTime(); Long min = min1.getMeterTime(); Date format = null; try { format = new SimpleDateFormat("yyMMddHHmmss").parse(s.toString()); dataDay.setRecordTime(new SimpleDateFormat("yyyy-MM-dd").format(format)); format = new SimpleDateFormat("yyMMddHHmmss").parse(min.toString()); String string = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(format); dataDay.setCreateDtm(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(string)); } catch (ParseException e) { e.printStackTrace(); } dataDay.setAmmeterCode(max1.getcAddr().toString()); dataDay.setType(max1.getdAddr().toString().indexOf("1") == 0 ? 1 : 2); dataDay.setwAddr(0); dataDay.setKwh(kwh); elecDataDayService.insertData(dataDay); } aprR.setdAddr(11L); AmPhaseRecord max11 = amPhaseRecordService.findMaxData(aprR); AmPhaseRecord min11 = amPhaseRecordService.findMinData(aprR); if (max11 != null && min11 != null) { Double kwh = max11.getKwhTotal() - min11.getKwhTotal(); dataDay.setDel(0); dataDay.setdAddr(max11.getdAddr()); dataDay.setdType(max11.getdType()); dataDay.setDevConfCode(date); dataDay.setKw(max11.getKw()); Long s = max11.getMeterTime(); Long min = min11.getMeterTime(); Date format = null; try { format = new SimpleDateFormat("yyMMddHHmmss").parse(s.toString()); dataDay.setRecordTime(new SimpleDateFormat("yyyy-MM-dd").format(format)); format = new SimpleDateFormat("yyMMddHHmmss").parse(min.toString()); String string = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(format); dataDay.setCreateDtm(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(string)); } catch (ParseException e) { e.printStackTrace(); } dataDay.setAmmeterCode(max11.getcAddr().toString()); dataDay.setType(max11.getdAddr().toString().indexOf("1") == 0 ? 1 : 2); dataDay.setwAddr(0); dataDay.setKwh(kwh); elecDataDayService.insertData(dataDay); } aprR.setdAddr(2L); AmPhaseRecord max2 = amPhaseRecordService.findMaxData(aprR); AmPhaseRecord min2 = amPhaseRecordService.findMinData(aprR); if (max2 != null && min2 != null) { Double kwh = max2.getKwhTotal() - min2.getKwhTotal(); dataDay.setDel(0); dataDay.setdAddr(max2.getdAddr()); dataDay.setdType(max2.getdType()); dataDay.setDevConfCode(date); dataDay.setKw(max2.getKw()); Long s = max2.getMeterTime(); Long min = min2.getMeterTime(); Date format = null; try { format = new SimpleDateFormat("yyMMddHHmmss").parse(s.toString()); dataDay.setRecordTime(new SimpleDateFormat("yyyy-MM-dd").format(format)); format = new SimpleDateFormat("yyMMddHHmmss").parse(min.toString()); String string = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(format); dataDay.setCreateDtm(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(string)); } catch (ParseException e) { e.printStackTrace(); } dataDay.setAmmeterCode(max2.getcAddr().toString()); dataDay.setType(max2.getdAddr().toString().indexOf("1") == 0 ? 1 : 2); dataDay.setwAddr(0); dataDay.setKwh(kwh); elecDataDayService.insertData(dataDay); } }); System.out.println("end"); return 666+"::::"+date+"::老子天下第一、因为骚。"; } }
[ "1097842122@qq.com" ]
1097842122@qq.com
edc8c5854882c18107f82c75fe40b1d5c27a159b
7c46a44f1930b7817fb6d26223a78785e1b4d779
/soap/src/java/com/zimbra/soap/admin/message/GetVersionInfoResponse.java
75d12a02cdc67921910bb36d1f416fe886307b21
[]
no_license
Zimbra/zm-mailbox
20355a191c7174b1eb74461a6400b0329907fb02
8ef6538e789391813b65d3420097f43fbd2e2bf3
refs/heads/develop
2023-07-20T15:07:30.305312
2023-07-03T06:44:00
2023-07-06T10:09:53
85,609,847
67
128
null
2023-09-14T10:12:10
2017-03-20T18:07:01
Java
UTF-8
Java
false
false
1,724
java
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2011, 2012, 2013, 2014, 2016 Synacor, Inc. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software Foundation, * version 2 of the License. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with this program. * If not, see <https://www.gnu.org/licenses/>. * ***** END LICENSE BLOCK ***** */ package com.zimbra.soap.admin.message; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import com.zimbra.common.soap.AdminConstants; import com.zimbra.soap.admin.type.VersionInfo; @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement(name=AdminConstants.E_GET_VERSION_INFO_RESPONSE) public class GetVersionInfoResponse { /** * @zm-api-field-description Version information */ @XmlElement(name=AdminConstants.A_VERSION_INFO_INFO, required=true) private final VersionInfo info; /** * no-argument constructor wanted by JAXB */ @SuppressWarnings("unused") private GetVersionInfoResponse() { this((VersionInfo)null); } public GetVersionInfoResponse(VersionInfo info) { this.info = info; } public VersionInfo getInfo() { return info; } }
[ "shriram.vishwanathan@synacor.com" ]
shriram.vishwanathan@synacor.com
d6011a2d4c49e9fd64709052b95fe9ab99a772d9
2008b62ea2a0b7aed5008084d63255fded86b202
/src/main/java/com/epam/university/java/core/task060/NodeImpl.java
8541580dd21e9eff7647d57f2efa608ed0aa4b3d
[]
no_license
gun-pi/epam-java-cources
323cb30c836212410baab73de4882380e775d6d1
f5dd5c4f9cf2f7592ed441077ebbb5552d084901
refs/heads/master
2023-01-14T08:50:12.654535
2020-11-25T11:20:11
2020-11-25T11:20:11
288,532,323
0
0
null
2020-08-18T18:24:58
2020-08-18T18:24:57
null
UTF-8
Java
false
false
1,527
java
package com.epam.university.java.core.task060; public class NodeImpl implements Node { private int key; private String value; private Node prev; private Node next; public NodeImpl(int key, String value) { this.key = key; this.value = value; } /** * Getter for value. * * @return value of Node. */ @Override public String getValue() { return value; } /** * Setter for value. * * @param value of Node */ @Override public void setValue(String value) { this.value = value; } /** * Getter for key. * * @return key of Node. */ @Override public int getKey() { return key; } /** * Setter for key. * * @param key of Node */ @Override public void setKey(int key) { this.key = key; } /** * Getter for previous Node. * * @return previous Node. */ @Override public Node getPrev() { return prev; } /** * Setter for previous Node. * * @param prev Node. */ @Override public void setPrev(Node prev) { this.prev = prev; } /** * Getter for next Node. * * @return next Node. */ @Override public Node getNext() { return next; } /** * Setter for next Node. * * @param next Node. */ @Override public void setNext(Node next) { this.next = next; } }
[ "gunpavel.i@gmail.com" ]
gunpavel.i@gmail.com
e31ecee3652aae3b37cfbd4f0dd12895bf95c60e
13c502784d3520fe1205389487f6ff7c91732846
/leetcode/src/main/java/com/yunhui/leetcode/array/SingleNumber_II.java
2cbdd1a1b14bc8f979f232e1f7521901c1c08ecf
[]
no_license
kingrocy/javaer
d5c6fc4de124c8a2a4c9a3b6267a83e7e7e7d66a
3e3f79a59a80096d1676857f628e1826952342bc
refs/heads/master
2022-10-07T09:30:36.490423
2021-03-04T08:11:30
2021-03-04T08:11:30
251,542,808
0
0
null
2022-10-04T23:57:21
2020-03-31T08:26:42
Java
UTF-8
Java
false
false
760
java
package com.yunhui.leetcode.array; import java.util.HashMap; import java.util.Map; import java.util.Set; /** * @Date : 2021/2/17 2:12 下午 * @Author : dushaoyun */ public class SingleNumber_II { public int singleNumber(int[] nums) { Map<Integer, Integer> dict = new HashMap<>(); for (int num : nums) { if (dict.containsKey(num)) { dict.put(num, dict.get(num) + 1); } else { dict.put(num, 1); } } Set<Map.Entry<Integer, Integer>> entries = dict.entrySet(); for (Map.Entry<Integer, Integer> entry : entries) { if (entry.getValue() == 1) { return entry.getKey(); } } return -1; } }
[ "dushaoyun@souche.com" ]
dushaoyun@souche.com
6ee2c472ffe0a69de7bfb71b377da6212597ecf2
83fe92dfc61c57a4326fa1bbd3c113ad687ccfee
/src/main/java/mac/hack/mixin/MixinSkyProperties.java
3853916af00abb51e1ee519d0332f610905cf08f
[]
no_license
roighteously/SkidHack
510e93317e3a540cb7df30be0db3f5c2949abb2f
ca50646ba096f76dafb9e8800dba7f21f4dfb4fe
refs/heads/main
2023-07-22T18:19:45.719502
2021-01-17T01:32:31
2021-01-17T01:32:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,037
java
package mac.hack.mixin; import mac.hack.MacHack; import mac.hack.event.events.EventSkyColor; import net.minecraft.client.render.SkyProperties; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(SkyProperties.class) public class MixinSkyProperties { @Inject(at = @At("HEAD"), method = "getSkyColor", cancellable = true) public void getSkyColor(float skyAngle, float tickDelta, CallbackInfoReturnable<float[]> ci) { EventSkyColor.SkyColor event = new EventSkyColor.SkyColor(tickDelta); MacHack.eventBus.post(event); if (event.isCancelled()) { ci.setReturnValue(null); ci.cancel(); } else if (event.getColor() != null) { ci.setReturnValue(new float[]{(float) event.getColor().x, (float) event.getColor().y, (float) event.getColor().z, 1f}); ci.cancel(); } } }
[ "74295674+ChiquitaV2@users.noreply.github.com" ]
74295674+ChiquitaV2@users.noreply.github.com
fd4aae3d32252331d1909bf91527243478b932f4
7b8fca085ef38296cd55e1e7ed0885989a017c6b
/src/test/java/glory/json/obj2/Book.java
ea58435803248723e79c2afcb3c6665ccbff1b73
[]
no_license
HEIGHMAN/gloryJson
be4754e8d1bd2380a9ed719ca3448f81f69a070c
8c30c6daf04c24490626f6555f2935cb9c04c056
refs/heads/master
2022-07-03T18:31:43.848412
2020-03-20T03:15:24
2020-03-20T03:17:40
248,642,599
0
0
null
2022-06-17T03:01:13
2020-03-20T01:36:19
Java
UTF-8
Java
false
false
508
java
package glory.json.obj2; public class Book { private String bName; private float bPrice; public Book(){} public Book(String bName, float bPrice) { this.bName = bName; this.bPrice = bPrice; } public String getbName() { return bName; } public void setbName(String bName) { this.bName = bName; } public float getbPrice() { return bPrice; } public void setbPrice(float bPrice) { this.bPrice = bPrice; } }
[ "1721945636@qq.com" ]
1721945636@qq.com
dc6a2499903b8989790fb059486bda5ac4f04358
321a28befe85e6215fe908130c8d848d5a8f6a9f
/fellowshipprograms/src/basics/Armstrong.java
067289c4dc0c8eb7b767d20ba45fe04134e94b45
[]
no_license
Priya1508/bridgelabz-programs
950dbe164649cafb1819cb7b363f5f2e5fc3b872
c060e3d208665277e9f20367d5ad8f31b17abf9f
refs/heads/master
2020-09-22T18:59:39.769255
2019-12-02T06:35:57
2019-12-02T06:35:57
225,302,743
0
0
null
null
null
null
UTF-8
Java
false
false
661
java
package basics; import java.util.Scanner; public class Armstrong { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("Enter a number: "); Scanner sc=new Scanner (System.in); int n=sc.nextInt(); int sum=0,rem,product=1; int temp=n; int count=0; if(n>0) { rem=n%10; count++; n=n/10; } int count1=count; if(n>0) { rem=n%10; while(count1>0) { product=product*rem; count--; } sum=sum+product; n=n/10; } if(n==sum) { System.out.println("Number is armstrong"); } else { System.out.println("Not a armstrong number"); } sc.close(); } }
[ "you@example.com" ]
you@example.com
4d0ca52c1590050b176c8a2d71e845956efb4f40
20eb62855cb3962c2d36fda4377dfd47d82eb777
/newEvaluatedBugs/Jsoup_44_buggy/mutated/426/Collector.java
e357fe0343c3b7b881113c7b0e8e0deae4697d23
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,432
java
package org.jsoup.select; import org.jsoup.nodes.Element; import org.jsoup.nodes.Node; /** * Collects a list of elements that match the supplied criteria. * * @author Jonathan Hedley */ public class Collector { private Collector() { } /** Build a list of elements, by visiting root and every descendant of root, and testing it against the evaluator. @param eval Evaluator to test elements against @param root root of tree to descend @return list of matches; empty if none */ public static Elements collect (Evaluator eval, Element root) { Elements elements = new Elements(); new NodeTraversor(new Accumulator(root, elements, eval)).traverse(root); return elements; } private static class Accumulator implements NodeVisitor { private final Element root; private final Elements elements; private final Evaluator eval; Accumulator(Element root, Elements elements, Evaluator eval) { this.root = root; this.elements = elements; this.eval = eval; } public void head(Node node, int depth) { if (node instanceof Element) { Element el = (Element) node; if (eval.matches(el, el)) elements.add(el); } } public void tail(Node node, int depth) { // void } } }
[ "justinwm@163.com" ]
justinwm@163.com
04a8388b2b270ee807224f2dd456397ce0c692ef
88b6ca28b4e8f964dc647780e56dfd34853bd9bc
/Grpc/android-interop-testing/app/src/main/java/io/grpc/android/integrationtest/TesterOkHttpChannelBuilder.java
44fcf317704e71d209bf5c1f84b2ff97a9a66c4d
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
Housum/javaporject
512a8710c76e1fd5803d99c283bcf6c4fbcbcbd0
a0eb5e1aa4eed79c5cc2155b3b1682280c003162
refs/heads/master
2020-06-10T18:05:54.480446
2017-04-09T03:49:08
2017-04-09T03:49:08
75,916,833
1
0
null
null
null
null
UTF-8
Java
false
false
5,933
java
/* * Copyright 2016, Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package io.grpc.android.integrationtest; import android.annotation.TargetApi; import android.net.SSLCertificateSocketFactory; import android.os.Build; import android.support.annotation.Nullable; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import io.grpc.okhttp.NegotiationType; import io.grpc.okhttp.OkHttpChannelBuilder; import java.io.InputStream; import java.lang.reflect.Method; import java.security.KeyStore; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import javax.security.auth.x500.X500Principal; /** * A helper class to create a OkHttp based channel. */ class TesterOkHttpChannelBuilder { public static ManagedChannel build(String host, int port, @Nullable String serverHostOverride, boolean useTls, @Nullable InputStream testCa, @Nullable String androidSocketFactoryTls) { ManagedChannelBuilder<?> channelBuilder = ManagedChannelBuilder.forAddress(host, port); ((OkHttpChannelBuilder) channelBuilder).maxMessageSize(16 * 1024 * 1024); if (serverHostOverride != null) { // Force the hostname to match the cert the server uses. channelBuilder.overrideAuthority(serverHostOverride); } if (useTls) { try { SSLSocketFactory factory; if (androidSocketFactoryTls != null) { factory = getSslCertificateSocketFactory(testCa, androidSocketFactoryTls); } else { factory = getSslSocketFactory(testCa); } ((OkHttpChannelBuilder) channelBuilder).negotiationType(NegotiationType.TLS); ((OkHttpChannelBuilder) channelBuilder).sslSocketFactory(factory); } catch (Exception e) { throw new RuntimeException(e); } } else { channelBuilder.usePlaintext(true); } return channelBuilder.build(); } private static SSLSocketFactory getSslSocketFactory(@Nullable InputStream testCa) throws Exception { if (testCa == null) { return (SSLSocketFactory) SSLSocketFactory.getDefault(); } SSLContext context = SSLContext.getInstance("TLS"); context.init(null, getTrustManagers(testCa) , null); return context.getSocketFactory(); } @TargetApi(14) private static SSLCertificateSocketFactory getSslCertificateSocketFactory( @Nullable InputStream testCa, String androidSocketFatoryTls) throws Exception { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH /* API level 14 */) { throw new RuntimeException( "android_socket_factory_tls doesn't work with API level less than 14."); } SSLCertificateSocketFactory factory = (SSLCertificateSocketFactory) SSLCertificateSocketFactory.getDefault(5000 /* Timeout in ms*/); // Use HTTP/2.0 byte[] h2 = "h2".getBytes(); byte[][] protocols = new byte[][]{h2}; if (androidSocketFatoryTls.equals("alpn")) { Method setAlpnProtocols = factory.getClass().getDeclaredMethod("setAlpnProtocols", byte[][].class); setAlpnProtocols.invoke(factory, new Object[] { protocols }); } else if (androidSocketFatoryTls.equals("npn")) { Method setNpnProtocols = factory.getClass().getDeclaredMethod("setNpnProtocols", byte[][].class); setNpnProtocols.invoke(factory, new Object[]{protocols}); } else { throw new RuntimeException("Unknown protocol: " + androidSocketFatoryTls); } if (testCa != null) { factory.setTrustManagers(getTrustManagers(testCa)); } return factory; } private static TrustManager[] getTrustManagers(InputStream testCa) throws Exception { KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); ks.load(null); CertificateFactory cf = CertificateFactory.getInstance("X.509"); X509Certificate cert = (X509Certificate) cf.generateCertificate(testCa); X500Principal principal = cert.getSubjectX500Principal(); ks.setCertificateEntry(principal.getName("RFC2253"), cert); // Set up trust manager factory to use our key store. TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); trustManagerFactory.init(ks); return trustManagerFactory.getTrustManagers(); } }
[ "cwxlqb1314a" ]
cwxlqb1314a
01310a016292826e388f988fe0ca1d00c230ad7d
a58b9b6f565a122c8163df9e1ef2ce34c800b19e
/wcm/widget/kit_organograma/src/main/java/com/fluig/kitintranet/rest/BirthdayProxy.java
1aef43c6a7c6af354abbcfb4038e68d4445aa5b8
[]
no_license
ricardoprotheus/kit-intranet
608cf7247d1ec543ad2bf3be156280ea1d719106
720f78e7fe91dbf1b485e635e63cb81bc687a5de
refs/heads/main
2023-03-21T00:25:18.875769
2021-03-07T10:26:19
2021-03-07T10:26:19
345,315,503
0
0
null
null
null
null
UTF-8
Java
false
false
1,348
java
package com.fluig.kitintranet.rest; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import com.fluig.kitintranet.parse.model.PersonVO; import com.fluig.kitintranet.parse.services.RMServices; import com.fluig.util.Utils; import com.totvs.technology.wcm.sdk.rest.WCMRest; @Path("/organizationchart") @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public class BirthdayProxy extends WCMRest { public static final String SERVICE = "/wsDataServer/IwsDataServer"; @GET @Path("birthday") @Produces(MediaType.APPLICATION_JSON) public Response today(@QueryParam("code") String code, @QueryParam("user") String user, @QueryParam("password") String password, @QueryParam("url") String url) { RMServices rm = new RMServices(url, user, password); String result = null; try { PersonVO teams = rm.getPerson(code); result = Utils.objectToJSON(teams); } catch (Exception e) { System.out.println("Error obtaining data from the RM service: " + e.getMessage()); } return Response.status(Status.OK).entity(result).build(); } }
[ "ricardo.protheus@outlook.com" ]
ricardo.protheus@outlook.com
38bebbe1173f916e5394b785f22169fb19477b4e
c7186bd6b888c57995367377c80c10d7057f73da
/src/main/java/bo/com/ahosoft/estructuracion/adapter/DocumentoHtml.java
8a3fc09e53d56b4419f7cf24964ca20967be5683
[]
no_license
Arturo1214/desing-patterns
c8f50ff6c3006fa16f300eae6486404d9f57c6b0
964ecc7e4b2c0e85a40598d15011eeefa2e95cdc
refs/heads/master
2021-07-15T14:40:14.753688
2017-10-18T20:18:45
2017-10-18T20:18:45
106,472,660
0
0
null
null
null
null
UTF-8
Java
false
false
643
java
package bo.com.ahosoft.estructuracion.adapter; /** * Created by : Arturo Herrera o. * Date : 10-10-17 - 10:40 AM * Project : desing-patterns * Package : bo.com.ahosoft.estructuracion.adapter **/ public class DocumentoHtml implements Documento{ protected String contenido; public void setContenido(String contenido) { this.contenido = contenido; } public void dibuja() { System.out.println("Dibuja el documento HTML: " + contenido); } public void imprime() { System.out.println("Imprime el documento HTML: " + contenido); } }
[ "arturoherreraocana@gmail.com" ]
arturoherreraocana@gmail.com
ae33d4694d4f3862a9cb92eea2668d9df3f425c8
419f3eaed329f1ebb0b87597f1f70f492c44dc80
/src/UbiquitousReligions.java
b51a195c0b28d1d386b1f1aa5379fdb368bc452b
[]
no_license
thisAAY/UVA
2329f4d30faa0f4e03e365585fde3d6f8a590c28
85de4dc27ae2e3bf6863619badbbd8fd7f8cf4c3
refs/heads/master
2020-03-08T17:01:13.168218
2015-03-07T16:30:33
2015-03-07T16:30:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,502
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * * @author Alejandro E. Garces */ public class UbiquitousReligions{ static int[] ids; static int[] sizes; static int sets; static int N; public static void init(int n){ N = n; sets = n; ids = new int[n]; sizes = new int[n]; for(int i=0;i<n;i++) { ids[i] = i; sizes[i] = 1; } } public static int root(int i) { return ids[i] == i?i:(ids[i] = root(ids[i])); } public static void union(int i, int j) { int u = root(i); int v = root(j); if(u == v)return; if(sizes[u] > sizes[v]) { sizes[u] += sizes[v]; ids[v] = u; }else{ sizes[v] += sizes[u]; ids[u] = v; } sets--; } public static void main(String[] args) throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); boolean first = true; int test = 1; while( true) { String[] read = in.readLine().split("[ ]+"); int n = Integer.parseInt(read[0]); int m = Integer.parseInt(read[1]); if(n == 0 && m == 0)break; init(n+1); for(int i=0;i<m;i++) { read = in.readLine().split("[ ]+"); int u = Integer.parseInt(read[0]); int v = Integer.parseInt(read[1]); union(u, v); } System.out.println("Case "+(test++)+": "+(sets+1)); } in.close(); System.exit(0); } }
[ "allegea@gmail.com" ]
allegea@gmail.com
a2dc6638e76daece09142afa035cdf4a6c0d7004
19de0597a5790bab6ff021899b4479506ae0829a
/java/src/hu/holyoil/crewmate/IStorageCapable.java
a7dbe5228bdad784d88a009944ab13cc3f405f8c
[]
no_license
bbucsy/projlab_holy_oil
e703a3ac579555a6c62f91051d7fbb5572c88d30
a1c4e9b953e7f7c22dabbd935abb461f9cacd409
refs/heads/master
2023-05-02T06:22:36.234536
2021-05-09T09:46:04
2021-05-09T09:46:04
342,634,410
0
1
null
null
null
null
UTF-8
Java
false
false
1,025
java
package hu.holyoil.crewmate; import hu.holyoil.resource.AbstractBaseResource; import hu.holyoil.storage.PlayerStorage; /** * Interface amely lehetővé teszi a telepeseknek hogy tudjanak: * <p> tárolni, * gyártani, * nyersanyagot felvenni és lerakni.</p> */ public interface IStorageCapable extends IStepping { /** * Robot gyártása */ void CraftRobot(); /** * Teleporter gyártása */ void CraftTeleportGate(); /** * Visszaadja a telepes inventory-ját a jelenlegi állapotban * @return a telepes inventory-ja */ PlayerStorage GetStorage(); /** * A telepes lerak egy teleportert az aktuális aszteroidáján */ void PlaceTeleporter(); /** * A telepes egy nyersanyaggal feltölti az aszteroidát ami a tárolójában van * @param abstractBaseResource egy telepesnél található nyersanyag */ void PlaceResource(AbstractBaseResource abstractBaseResource); }
[ "noreply@github.com" ]
noreply@github.com
c12787dc9a66c185d70b674e4c05130711f1d3cc
0219b8a6b816e0c5f5be10e721e73f125738c43f
/src/main/java/Foodbox/example/Foodbox/repository/LoginRepository.java
63caa6d98caeb3dcd16815946347ad637f1a9b1c
[]
no_license
bridgecrew-perf7/foodbox-deploy
5024edcd1405b618073c16f919ac8e092d5f246d
9da91b730407ef72691a63161e6c81045d1eb13f
refs/heads/main
2023-08-29T06:30:40.499969
2021-11-05T12:42:53
2021-11-05T12:42:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
585
java
package Foodbox.example.Foodbox.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import Foodbox.example.Foodbox.entity.AdminLogin; @Repository public interface LoginRepository extends JpaRepository<AdminLogin, Long> { @Query("SELECT p FROM AdminLogin p WHERE p.adminName=:keyword AND p.role=:role") public AdminLogin search(@Param("keyword") String keyword, @Param("role") String role); }
[ "sudipcep2006@gmail.com" ]
sudipcep2006@gmail.com
d22f85f648e79de3d9a08ff4a2269e59758e9db0
b0859aa5fec7af031a263a7760703d853b762b82
/ERP DEV/STERP-Beans/src/main/java/com/sterp/multitenant/tenant/assesmenttool/entity/CandidateProfile.java
279555fb6b81af10bf1ab4c0605fca1436847bbd
[]
no_license
KatiyarAman/AssessmentTool
bb09e53a3cbd160cb9e4211fbd15e5b6a97a1dbb
37e8a1ecd37324b445814fc0b3c1177f01e727d0
refs/heads/master
2023-08-13T12:50:23.665615
2021-09-28T02:50:08
2021-09-28T02:50:08
411,115,244
0
0
null
null
null
null
UTF-8
Java
false
false
8,675
java
package com.sterp.multitenant.tenant.assesmenttool.entity; import java.time.LocalDate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import com.sterp.multitenant.tenant.assesmenttool.enumtype.ExperienceCountUnit; @Entity @Table(name = "candidate_profile") public class CandidateProfile { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(name = "candidate_id") private Long candidateId; @Column(name = "permanent_address") private String permanentAddress; @Column(name="permanent_state_id") private Integer permanentStateId; @Column(name="permanent_country_id") private Integer permanentCountryId; @Column(name="permanent_pincode") private Integer permanentPincode; @Column(name = "city_id") private Integer cityId; @Column(name="current_city_id") private Integer currentCityId; @Column(name = "current_address") private String currentAddress; @Column(name="current_state_id") private Integer currentStateId; @Column(name="current_country_id") private Integer currentCountryId; @Column(name="current_pincode") private Integer currentPincode; @Column(name = "is_same_to_permanent") private Boolean isSameTOPermanent; @Column(name = "father_name") private String fatherName; @Column(name = "date_of_birth") private LocalDate dateOfBirth; @Column(name = "total_experience") private Double totalExperience; @Column(name = "total_experience_unit") @Enumerated(EnumType.STRING) private ExperienceCountUnit totalExperienceUnit; @Column(name = "relavant_experience") private Double relavantExperience; @Column(name = "relavant_experience_unit") @Enumerated(EnumType.STRING) private ExperienceCountUnit relavantExperienceUnit; @Column(name="current_ctc") private Double currentCtc; @Column(name = "expected_ctc") private Double expectedCtc; @Column(name = "marital_status") private String maritalStatus; @Column(name = "profile_title") private String profileTitle; @Column(name = "allow_sms") private Boolean allowSms; @Column(name = "allow_email") private Boolean allowEmail; @Column(name = "gender") private String gender; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getCandidateId() { return candidateId; } public void setCandidateId(Long candidateId) { this.candidateId = candidateId; } public String getPermanentAddress() { return permanentAddress; } public void setPermanentAddress(String permanentAddress) { this.permanentAddress = permanentAddress; } public Integer getCityId() { return cityId; } public void setCityId(Integer cityId) { this.cityId = cityId; } public String getCurrentAddress() { return currentAddress; } public void setCurrentAddress(String currentAddress) { this.currentAddress = currentAddress; } public Boolean getIsSameTOPermanent() { return isSameTOPermanent; } public void setIsSameTOPermanent(Boolean isSameTOPermanent) { this.isSameTOPermanent = isSameTOPermanent; } public String getFatherName() { return fatherName; } public void setFatherName(String fatherName) { this.fatherName = fatherName; } public LocalDate getDateOfBirth() { return dateOfBirth; } public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; } public Double getTotalExperience() { return totalExperience; } public void setTotalExperience(Double totalExperience) { this.totalExperience = totalExperience; } public ExperienceCountUnit getTotalExperienceUnit() { return totalExperienceUnit; } public void setTotalExperienceUnit(ExperienceCountUnit totalExperienceUnit) { this.totalExperienceUnit = totalExperienceUnit; } public Double getRelavantExperience() { return relavantExperience; } public void setRelavantExperience(Double relavantExperience) { this.relavantExperience = relavantExperience; } public ExperienceCountUnit getRelavantExperienceUnit() { return relavantExperienceUnit; } public void setRelavantExperienceUnit(ExperienceCountUnit relavantExperienceUnit) { this.relavantExperienceUnit = relavantExperienceUnit; } public Double getCurrentCtc() { return currentCtc; } public void setCurrentCtc(Double currentCtc) { this.currentCtc = currentCtc; } public Double getExpectedCtc() { return expectedCtc; } public void setExpectedCtc(Double expectedCtc) { this.expectedCtc = expectedCtc; } public String getMaritalStatus() { return maritalStatus; } public void setMaritalStatus(String maritalStatus) { this.maritalStatus = maritalStatus; } public String getProfileTitle() { return profileTitle; } public void setProfileTitle(String profileTitle) { this.profileTitle = profileTitle; } public Boolean getAllowSms() { return allowSms; } public void setAllowSms(Boolean allowSms) { this.allowSms = allowSms; } public Boolean getAllowEmail() { return allowEmail; } public void setAllowEmail(Boolean allowEmail) { this.allowEmail = allowEmail; } public String getGender() { return gender; } public Integer getCurrentCityId() { return currentCityId; } public void setCurrentCityId(Integer currentCityId) { this.currentCityId = currentCityId; } public void setGender(String gender) { this.gender = gender; } public Integer getPermanentStateId() { return permanentStateId; } public void setPermanentStateId(Integer permanentStateId) { this.permanentStateId = permanentStateId; } public Integer getPermanentCountryId() { return permanentCountryId; } public void setPermanentCountryId(Integer permanentCountryId) { this.permanentCountryId = permanentCountryId; } public Integer getPermanentPincode() { return permanentPincode; } public void setPermanentPincode(Integer permanentPincode) { this.permanentPincode = permanentPincode; } public Integer getCurrentStateId() { return currentStateId; } public void setCurrentStateId(Integer currentStateId) { this.currentStateId = currentStateId; } public Integer getCurrentCountryId() { return currentCountryId; } public void setCurrentCountryId(Integer currentCountryId) { this.currentCountryId = currentCountryId; } public Integer getCurrentPincode() { return currentPincode; } public void setCurrentPincode(Integer currentPincode) { this.currentPincode = currentPincode; } @Override public String toString() { return "CandidateProfile [id=" + id + ", candidateId=" + candidateId + ", permanentAddress=" + permanentAddress + ", cityId=" + cityId + ", currentAddress=" + currentAddress + ", isSameTOPermanent=" + isSameTOPermanent + ", fatherName=" + fatherName + ", dateOfBirth=" + dateOfBirth + ", totalExperience=" + totalExperience + ", totalExperienceUnit=" + totalExperienceUnit + ", relavantExperience=" + relavantExperience + ", relavantExperienceUnit=" + relavantExperienceUnit + ", currentCtc=" + currentCtc + ", expectedCtc=" + expectedCtc + ", maritalStatus=" + maritalStatus + ", profileTitle=" + profileTitle + ", allowSms=" + allowSms + ", allowEmail=" + allowEmail + ", gender=" + gender + ", getId()=" + getId() + ", getCandidateId()=" + getCandidateId() + ", getPermanentAddress()=" + getPermanentAddress() + ", getCityId()=" + getCityId() + ", getCurrentAddress()=" + getCurrentAddress() + ", getIsSameTOPermanent()=" + getIsSameTOPermanent() + ", getFatherName()=" + getFatherName() + ", getDateOfBirth()=" + getDateOfBirth() + ", getTotalExperience()=" + getTotalExperience() + ", getTotalExperienceUnit()=" + getTotalExperienceUnit() + ", getRelavantExperience()=" + getRelavantExperience() + ", getRelavantExperienceUnit()=" + getRelavantExperienceUnit() + ", getCurrentCtc()=" + getCurrentCtc() + ", getExpectedCtc()=" + getExpectedCtc() + ", getMaritalStatus()=" + getMaritalStatus() + ", getProfileTitle()=" + getProfileTitle() + ", getAllowSms()=" + getAllowSms() + ", getAllowEmail()=" + getAllowEmail() + ", getGender()=" + getGender() + ", getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()=" + super.toString() + "]"; } }
[ "aman.katiyar@moglix.com" ]
aman.katiyar@moglix.com
379bc79227c1a935c63bab5f2c2e076dec17662b
81105bf1f9acd9da64d14e91534734c92ea727f6
/Lectures and Assignments/Lecture 16-Heap and Priority Queue/priorityQueue/PriorityQueue.java
cabaf74d1c0eb5826c0419ed3a14de5fbfbd4905
[]
no_license
valarmorghulis1632/CN
7658c7675371756d728fb216399a5c836e3ce842
03f5d74dd12068487fba7cb66b10db93d20f13de
refs/heads/master
2023-03-02T14:59:40.480370
2021-02-03T13:57:05
2021-02-03T13:57:05
335,640,731
0
0
null
null
null
null
UTF-8
Java
false
false
1,110
java
package priorityQueue; import java.util.ArrayList; public abstract class PriorityQueue<T> { ArrayList<PriorityNode<T>> heap; final static int MAX_SIZE = 10; PriorityQueue() { this.heap = new ArrayList<>(); } T remove() { T data = heap.get(0).data; heap.set(0, heap.get(size())); heap.remove(size()); shiftDown(0); return data; } void swap(int index, int highestPriority) { PriorityNode<T> node = heap.get(index); heap.set(index, heap.get(highestPriority)); heap.set(highestPriority, node); } int getLeftIndex(int index){ int leftIndex = 2*index+1; if(leftIndex>size()){ return -1; } return leftIndex; } int getRightIndex(int index){ int rightIndex = 2*index+2; if(rightIndex>size()){ return -1; } return rightIndex; } int size() { return heap.size() - 1; } public void add(T data, int priority) { PriorityNode<T> newNode = new PriorityNode<>(data, priority); heap.add(newNode); shiftUp(size()); } abstract void shiftUp(int index); abstract void shiftDown(int index); int getParentIndex(int index){ return (index-1)/2; } }
[ "ahdeshwal1632@gmail.com" ]
ahdeshwal1632@gmail.com
cad9b63b34875fc8733b9eb7a44c9a8562843ff5
d1184b4bbdd1e12d0525357fdee392bbd43e2ac7
/src/com/javaex/ex10/BookShop.java
c353d2ddefe336a9226eb2c36c06f5eef3feb65c
[]
no_license
werg147/Practice05
0e7d3b737b779fa407e4f3b05e6ba51edbc74a8f
bf5490c69ab431f7fdb06b5df113526636fe85f8
refs/heads/master
2023-01-14T22:24:52.274959
2020-11-29T16:47:26
2020-11-29T16:47:26
316,157,287
0
0
null
null
null
null
UTF-8
Java
false
false
1,883
java
package com.javaex.ex10; import java.util.Scanner; public class BookShop { public static void main(String[] args) { Book[] books = new Book[10]; books[0] = new Book(1, "트와일라잇", "스테파니메이어"); books[1] = new Book(2, "뉴문", "스테파니메이어"); books[2] = new Book(3, "이클립스", "스테파니메이어"); books[3] = new Book(4, "브레이킹던", "스테파니메이어"); books[4] = new Book(5, "아리랑", "조정래"); books[5] = new Book(6, "젊은그들", "김동인"); books[6] = new Book(7, "아프니깐 청춘이다", "김난도"); books[7] = new Book(8, "귀천", "천상병"); books[8] = new Book(9, "태백산맥", "조정래"); books[9] = new Book(10, "풀하우스", "원수연"); System.out.println("*****도서 정보 출력하기******"); displayBookInfo(books); System.out.println(""); Scanner scanner = new Scanner(System.in); System.out.print("대여 하고 싶은 책의 번호를 입력하세요:"); int num = scanner.nextInt(); // (1) 입력된 번호에 맞는 책을 찾아 대여 되었음(상태코드=0)을 체크 합니다. // 코드작성 for(int i=0; i<books.length; i++) { if(i==(num-1)) { books[i].rent(num); } } System.out.println("*****도서 정보 출력하기******"); displayBookInfo(books); scanner.close(); } //(2)전달받은 배열을 모두 출력하는 메소드 private static void displayBookInfo(Book[] books) { //코드작성 for(int i=0; i<books.length; i++) { books[i].print(); } } }
[ "werg1@DESKTOP-9B10C7H" ]
werg1@DESKTOP-9B10C7H
74ce06c7af1276d48c0381a170256dc87126e272
250867b18dc80cb5697844fa2d2c50b1e0ed1330
/src/main/java/com/uahage/api/dto/PlaceRestaurantDetailResponse.java
107806437e899670b5123b8aa719c3a1ee38073c
[]
no_license
gojaebeom/UahageApiServer-Spring
608eedd4ccc484fd04b87db87e415720838d6f91
134cb2cd165c9ee07fd5b466c3d563fc35833327
refs/heads/main
2023-08-11T19:25:17.912691
2021-09-27T07:22:10
2021-09-27T07:22:10
383,720,300
0
0
null
null
null
null
UTF-8
Java
false
false
655
java
package com.uahage.api.dto; import lombok.*; import java.util.HashMap; import java.util.List; @Getter @ToString public class PlaceRestaurantDetailResponse { // default private Long id; private String name; private String address; private String phone; private Float lat; private Float lon; private Long categoryId; private Boolean isBookmarked; private Float reviewTotal; // info private HashMap<String, Object> info; // facility private HashMap<String, Object> facility; // menu private List<HashMap<String,Object>> menu; // images private List<HashMap<String,Object>> images; }
[ "const.gjb@gmail.com" ]
const.gjb@gmail.com
ac543fc08dc80fcf3749f47ee524fa1f48184ca7
f4e14d0060ddd85a94c13bc93f07023e9ccdabe6
/Game.java
0eaf60c3a03d1b8727fbb63a5cf8c07fbda6382d
[]
no_license
arbihysko/javaproject
1555dd1e6ee341b3edcdd57b3dad27786d30bd59
1c018cf6933615434e605e16b5675150c93dfbe3
refs/heads/master
2022-04-03T22:34:58.598218
2020-02-12T02:12:47
2020-02-12T02:12:47
238,951,980
0
0
null
null
null
null
UTF-8
Java
false
false
16,751
java
import javafx.application.Application; import javafx.application.Platform; import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleIntegerProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.control.cell.PropertyValueFactory; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.stage.Stage; import java.sql.Array; import java.util.*; import javax.swing.*; import java.util.Timer; import java.util.concurrent.TimeUnit; public class Game { Stage stage; Scene gameScene; //gameSpecs private int playerNumber; private String[] playerNames; private int[][] points; //kjo variabel do te mbaje numrin per try static int chance; static int raund; static int playerAtTurn; public static String[] raunds = { "Njesha", "Dysha", "Tresha", "Katra", "Pesa", "Gjashta", "Piket e siperme", "Bonus", "Tre me nje vlere", "Kater me nje vlere", "Tre dhe Dy", "Kater te njepasnjeshme", "Pese te njepasnjeshme", "E njejta vlere", "Cdo Rast", "Piket e siperme", "Total" }; //random object Random rand = new Random(System.currentTimeMillis()); //deklarimi i ListViews qe do te perdoren per te shfaqur piket ListView<String> raundsListView; ListView<Integer> playerOnePts; ListView<Integer> playerTwoPts; ListView<Integer> playerThreePts; ListView<Integer> playerFourPts; //deklarimi -> ZARAT private CheckBox dice1; private CheckBox dice2; private CheckBox dice3; private CheckBox dice4; private CheckBox dice5; //perdoren te Timer static Timer setTimeout = new Timer(); static int timerTurnMax; static int timerTurn = 0; //constuctor me numrin e players dhe emrat public Game(int num, String[] names, Stage stage){ this.stage = stage; playerNumber = num; for (int i = 0; i < num; i++) { names[i] = Character.toUpperCase(names[i].charAt(0)) + names[i].substring(1,names[i].length()).toLowerCase(); } playerNames = names; points = new int[num][17]; this.generateGame(); } //gjeneron pamjen per lojen public void generateGame(){ //setting the layout -> BORDERPANE BorderPane gameLayout = new BorderPane(); HBox gameIndicator = new HBox(50); Label raundIndicator = new Label("Raundi 1"); Label playerIndicator = new Label(playerNames[0]); Label tryIndicator = new Label("Shanci 1"); gameIndicator.getChildren().addAll(playerIndicator,raundIndicator,tryIndicator); gameIndicator.setAlignment(Pos.CENTER); gameIndicator.setPadding(new Insets(0,0,20,0)); gameLayout.setTop(gameIndicator); BorderPane.setAlignment(gameIndicator, Pos.CENTER); //tableTop VBox centerUnit = new VBox(10); HBox tableHeader = new HBox(20); Label roundsLabel = new Label("Raundi"); roundsLabel.getStyleClass().add("roundsLabel"); Label player1 = new Label(playerNames[0]); tableHeader.getChildren().addAll(roundsLabel, player1); tableHeader.setAlignment(Pos.CENTER); //center content HBox scores = new HBox(20); //shfaq raundet raundsListView = new ListView<>(); raundsListView.setMinWidth(300); raundsListView.getStyleClass().add("roundsList"); for (int i = 0; i < 17; i++) { raundsListView.getItems().add(raunds[i]); } //shfaq piket per player1 playerOnePts = new ListView<>(); playerOnePts.getStyleClass().add("bigList"); scores.getChildren().addAll(raundsListView, playerOnePts); if (playerNumber>1){ Label player2 = new Label(playerNames[1]); tableHeader.getChildren().add(player2); playerTwoPts = new ListView<>(); playerTwoPts.getStyleClass().add("bigList"); scores.getChildren().add(playerTwoPts); } if (playerNumber>2){ Label player3 = new Label(playerNames[2]); tableHeader.getChildren().add(player3); playerThreePts = new ListView<>(); playerThreePts.getStyleClass().add("bigList"); scores.getChildren().add(playerThreePts); } if(playerNumber==4){ Label player4 = new Label(playerNames[3]); tableHeader.getChildren().add(player4); playerFourPts = new ListView<>(); playerFourPts.getStyleClass().add("bigList"); scores.getChildren().add(playerFourPts); } scores.setAlignment(Pos.CENTER); centerUnit.getChildren().add(tableHeader); centerUnit.getChildren().add(scores); gameLayout.setCenter(centerUnit); //Sektori i poshtem VBox bottomSection = new VBox(20); //Do te mbaje zarat HBox dices = new HBox(20); //inizializon zarat me nje vlere random dhe vendosim figurat int randomNr = rand.nextInt(6)+1; dice1 = new CheckBox(""+randomNr); dice1.setStyle("-fx-background-image: url('public/images/zari-"+randomNr+".png')"); randomNr = rand.nextInt(6)+1; dice2 = new CheckBox("" + (randomNr)); dice2.setStyle("-fx-background-image: url('public/images/zari-"+randomNr+".png')"); randomNr = rand.nextInt(6)+1; dice3 = new CheckBox("" + (randomNr)); dice3.setStyle("-fx-background-image: url('public/images/zari-"+randomNr+".png')"); randomNr = rand.nextInt(6)+1; dice4 = new CheckBox(""+(randomNr)); dice4.setStyle("-fx-background-image: url('public/images/zari-"+randomNr+".png')"); randomNr = rand.nextInt(6)+1; dice5 = new CheckBox(""+(randomNr)); dice5.setStyle("-fx-background-image: url('public/images/zari-"+randomNr+".png')"); dices.getChildren().addAll(dice1, dice2, dice3, dice4, dice5); dices.setAlignment(Pos.CENTER); //Do te mbaje butonat e nevojshem per lojen HBox buttons = new HBox(20); //Creating the buttons Button throwDices = new Button("Hidh Zaret"); Button skip = new Button("Skip"); throwDices.getStyleClass().add("btn-blue"); skip.getStyleClass().add("btn-red"); int[] dicesVals = new int[5]; skip.setOnMouseClicked(e -> { if ((raund==5||raund==14)&&playerAtTurn==playerNumber-1) updateSpecial(stage, playerNumber, points, dicesVals, playerOnePts, playerTwoPts, playerThreePts, playerFourPts, playerNames); else { playerAtTurn++; chance = 0; } int thisRaund=raund+1; if (playerAtTurn==playerNumber) thisRaund=raund+2; playerIndicator.setText(playerNames[(playerAtTurn==playerNumber)?0:playerAtTurn]); raundIndicator.setText("Raundi " + thisRaund); tryIndicator.setText("Shanci 1"); throwDices.setText("Hidh Zaret"); throwDices.setDisable(false); skip.setDisable(true); }); skip.setDisable(true); dice1.setOnAction(e -> throwDices.setDisable(false)); dice2.setOnAction(e -> throwDices.setDisable(false)); dice3.setOnAction(e -> throwDices.setDisable(false)); dice4.setOnAction(e -> throwDices.setDisable(false)); dice5.setOnAction(e -> throwDices.setDisable(false)); //gjenerojme nje numer random per sa here do behet animimi timerTurnMax = rand.nextInt(5)+10; // timerTurnMax = 2; throwDices.setOnAction(event -> { //marrim zarat e selektuar.. nese jemi ne try e pare do na ktheje te gjithe zarat ArrayList<CheckBox> selectedDices = getSelectedDices(dice1,dice2,dice3,dice4,dice5); //Timer per Animimin e zareve Timer diceAnimationDelay = new Timer(); //funksioni qe do te thirret periodikisht diceAnimationDelay.scheduleAtFixedRate(new TimerTask() { @Override public void run() { //disable the buttons throwDices.setDisable(true); skip.setDisable(true); //JavaFx hack Platform.runLater(()-> { //ne fund te animimit if (++timerTurn > timerTurnMax) { diceAnimationDelay.cancel(); timerTurn = 0; //enable buttons if (chance == 3) { throwDices.setDisable(false); throwDices.setText("Hidh Zaret"); } else { skip.setDisable(false); throwDices.setText("Provo Perseri"); } } //ndrron numrin e zarave for (CheckBox selectedDice : selectedDices) { int randomNr = rand.nextInt(6) + 1; selectedDice.setText("" + randomNr); selectedDice.setStyle("-fx-background-image: url('public/images/zari-" + randomNr + ".png')"); } }); } },0, 120); setTimeout.schedule(new TimerTask() { @Override public void run() { Platform.runLater(() -> { //Deselect the selected dices for (CheckBox selectedDice : selectedDices) { selectedDice.setSelected(false); } dicesVals[0] = Integer.parseInt(dice1.getText()); dicesVals[1] = Integer.parseInt(dice2.getText()); dicesVals[2] = Integer.parseInt(dice3.getText()); dicesVals[3] = Integer.parseInt(dice4.getText()); dicesVals[4] = Integer.parseInt(dice5.getText()); if (playerAtTurn == playerNumber){ playerAtTurn = 0; raund++; } points[playerAtTurn][raund] = CalcPts.calcPoits(raund, dicesVals, points, playerAtTurn); updatePtsList(points[playerAtTurn][raund], playerOnePts, playerTwoPts, playerThreePts, playerFourPts); // System.out.println("Chance: "+ chance + "\nRaund: "+raund+"\nTurn: "+playerAtTurn+"\n"); if ((raund==5||raund==14)&&chance==3&&(playerAtTurn==(playerNumber-1))) { updateSpecial(stage, playerNumber, points, dicesVals, playerOnePts, playerTwoPts, playerThreePts, playerFourPts, playerNames); } if (chance==3) { playerAtTurn++; chance = 0; } tryIndicator.setText("Shanci "+(chance+1)); playerIndicator.setText(playerNames[(playerAtTurn==playerNumber)?0:playerAtTurn]); raundIndicator.setText("Raundi "+(raund+1)); }); } }, ((120*timerTurnMax)+200)); }); //konfigurojme butonat ne layout buttons.getChildren().addAll(throwDices, skip); buttons.setAlignment(Pos.CENTER_RIGHT); buttons.setMaxWidth(350); bottomSection.getChildren().addAll(buttons, dices); bottomSection.setAlignment(Pos.CENTER); gameLayout.setBottom(bottomSection); gameLayout.setPadding(new Insets(50)); //Scene settings gameScene = new Scene(gameLayout, 1024, 600); gameScene.getStylesheets().add("public/styles/game.css"); stage.setScene(gameScene); stage.setMaximized(true); stage.setOnCloseRequest(e -> { setTimeout.cancel(); }); } //ky funksion do te ktheje zarat e selektuar static ArrayList<CheckBox> getSelectedDices(CheckBox dice1, CheckBox dice2, CheckBox dice3, CheckBox dice4, CheckBox dice5){ ArrayList<CheckBox> dices = new ArrayList<>(); //nese jemi ne try e pare kthe te gjithe zarat if (chance == 0){ dices.add(dice1); dices.add(dice2); dices.add(dice3); dices.add(dice4); dices.add(dice5); } else { //gjej zarat e selektuar if (dice1.isSelected()) dices.add(dice1); if (dice2.isSelected()) dices.add(dice2); if (dice3.isSelected()) dices.add(dice3); if (dice4.isSelected()) dices.add(dice4); if (dice5.isSelected()) dices.add(dice5); } chance ++; return dices; } public static void updatePtsList(int pts, ListView<Integer> playerOnePts, ListView<Integer> playerTwoPts, ListView<Integer> playerThreePts, ListView<Integer> playerFourPts){ if (playerAtTurn==0) { if (chance <= 3) { try { playerOnePts.getItems().set(raund, pts); } catch (Exception ex) { playerOnePts.getItems().add(pts); } } } else if (playerAtTurn==1) { if (chance <= 3) { try { playerTwoPts.getItems().set(raund, pts); } catch (Exception ex) { playerTwoPts.getItems().add(pts); } } } else if (playerAtTurn==2) { if (chance <= 3) { try { playerThreePts.getItems().set(raund, pts); } catch (Exception ex) { playerThreePts.getItems().add(pts); } } } else if (playerAtTurn==3) { if (chance <= 3) { try { playerFourPts.getItems().set(raund, pts); } catch (Exception ex) { playerFourPts.getItems().add(pts); } } } } static void updateSpecial(Stage stage, int playerNumber, int[][] points, int[] dicesVals, ListView<Integer> playerOnePts, ListView<Integer> playerTwoPts, ListView<Integer> playerThreePts, ListView<Integer> playerFourPts, String[] playerNames) { if (raund==5) { raund++; for (int i = 0; i < playerNumber; i++) { playerAtTurn = i; points[i][6] = CalcPts.calcPoits(6, dicesVals, points, playerAtTurn); updatePtsList(points[i][6], playerOnePts, playerTwoPts, playerThreePts, playerFourPts); } raund++; for (int i = 0; i < playerNumber; i++) { playerAtTurn = i; points[i][7] = CalcPts.calcPoits(7, dicesVals, points, playerAtTurn); updatePtsList(points[i][6], playerOnePts, playerTwoPts, playerThreePts, playerFourPts); } raund++; chance = 0; playerAtTurn = 0; } else { raund++; for (int i = 0; i < playerNumber; i++) { playerAtTurn = i; points[i][15] = CalcPts.calcPoits(15, dicesVals, points, playerAtTurn); updatePtsList(points[i][15], playerOnePts, playerTwoPts, playerThreePts, playerFourPts); } raund++; for (int i = 0; i < playerNumber; i++) { playerAtTurn = i; points[i][16] = CalcPts.calcPoits(16, dicesVals, points, playerAtTurn); updatePtsList(points[i][16], playerOnePts, playerTwoPts, playerThreePts, playerFourPts); } // game over if (playerNumber==1) EndGame.endGameSolo(stage, points[0][16]); else EndGame.multiPlayerEnd(stage, playerNumber,points,playerNames); } } }
[ "arbi.hysko.3@gmail.com" ]
arbi.hysko.3@gmail.com
9bc38a2fecd8cee956a623a69ee6886daa057a37
8767bf1de1c46bfbc8c2cc01aba9d3d4de130eee
/test/level19/lesson05/task04/Solution.java
5e451ba8a240f35296ffcba52db4518ac7c34a32
[]
no_license
nenya-alex/javarush
8070e682c31f6b74164d26872a5927ac0e6e8703
eac49e3c0edcdaa1790ab2fbbc3425ad7ef7ddac
refs/heads/master
2016-09-02T01:41:22.197290
2015-09-05T14:55:51
2015-09-05T14:55:51
41,964,779
1
1
null
null
null
null
UTF-8
Java
false
false
1,169
java
package com.javarush.test.level19.lesson05.task04; /* Замена знаков Считать с консоли 2 имени файла. Первый Файл содержит текст. Заменить все точки "." на знак "!", вывести во второй файл. Закрыть потоки ввода-вывода. */ import java.io.*; import java.util.ArrayList; public class Solution { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String file1 = reader.readLine(); String file2 = reader.readLine(); // String file1 = "C:/1.txt"; // String file2 = "C:/2.txt"; reader.close(); FileReader fr = new FileReader(file1); FileWriter fw = new FileWriter(file2); while (fr.ready()) { int k = fr.read(); if (k==46) { fw.write(33); } else { fw.write(k); } } fr.close(); fw.close(); } }
[ "alexni@ukr.net" ]
alexni@ukr.net
89f371548122baf3a80f262bfddf5f827a960f79
2e6d92fcad38533c147a387a396d92ac5156dad0
/apm-collector/apm-collector-queue/src/main/java/org/skywalking/apm/collector/queue/disruptor/DisruptorEventHandler.java
ebb4ea9e781b12295a9e617e34ff240a0997c821
[ "Apache-2.0" ]
permissive
nutzam/sky-walking
c4b10ffca983c6b6b55d8cad1e3e1c9266502072
29bfe3eb5e38950e698aa12edcdfe7c63e13475b
refs/heads/master
2023-08-25T10:27:21.913406
2017-10-19T12:01:09
2017-10-19T12:01:09
104,169,913
0
1
null
2017-09-20T05:29:46
2017-09-20T05:29:46
null
UTF-8
Java
false
false
2,630
java
/* * Copyright 2017, OpenSkywalking Organization All rights reserved. * * 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. * * Project repository: https://github.com/OpenSkywalking/skywalking */ package org.skywalking.apm.collector.queue.disruptor; import com.lmax.disruptor.EventHandler; import com.lmax.disruptor.RingBuffer; import org.skywalking.apm.collector.core.queue.EndOfBatchCommand; import org.skywalking.apm.collector.core.queue.MessageHolder; import org.skywalking.apm.collector.core.queue.QueueEventHandler; import org.skywalking.apm.collector.core.queue.QueueExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * @author pengys5 */ public class DisruptorEventHandler implements EventHandler<MessageHolder>, QueueEventHandler { private final Logger logger = LoggerFactory.getLogger(DisruptorEventHandler.class); private RingBuffer<MessageHolder> ringBuffer; private QueueExecutor executor; DisruptorEventHandler(RingBuffer<MessageHolder> ringBuffer, QueueExecutor executor) { this.ringBuffer = ringBuffer; this.executor = executor; } /** * Receive the message from disruptor, when message in disruptor is empty, then send the cached data * to the next workers. * * @param event published to the {@link RingBuffer} * @param sequence of the event being processed * @param endOfBatch flag to indicate if this is the last event in a batch from the {@link RingBuffer} */ public void onEvent(MessageHolder event, long sequence, boolean endOfBatch) { Object message = event.getMessage(); event.reset(); executor.execute(message); if (endOfBatch) { executor.execute(new EndOfBatchCommand()); } } /** * Push the message into disruptor ring buffer. * * @param message of the data to process. */ public void tell(Object message) { long sequence = ringBuffer.next(); try { ringBuffer.get(sequence).setMessage(message); } finally { ringBuffer.publish(sequence); } } }
[ "8082209@qq.com" ]
8082209@qq.com