blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
626a7e8d8555463f1de5ab641721ed70f23d06fa | c7b468a87cf9bc2ad748fc3bb0281abbf698026b | /tests/WriteReviewScreenTest.java | df2957651513d8ce2716aa000a1a0a9c226ba3e5 | [] | no_license | JackDavidson/CourseConfessions | db8c772d9f6aee84d09db830659f697d2de2f427 | 616dc901b2c92a8d7ea42c8ba30b5621a9149ab3 | refs/heads/master | 2020-04-05T19:03:38.527256 | 2015-06-07T20:46:27 | 2015-06-07T20:46:27 | 34,018,775 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,458 | java | package com.bitsplease.courseconfessions.test;
import activities.writeReview.WriteReviewScreen;
import activities.main.MainMenu;
import android.content.Intent;
import android.test.*;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class WriteReviewScreenTest extends ActivityInstrumentationTestCase2<WriteReviewScreen>
{
private WriteReviewScreen WriteReviewScreenTester;
private EditText reviewText;
private Button submit;
public WriteReviewScreenTest() {
super(WriteReviewScreen.class);
}
protected void setUp() throws Exception {
super.setUp();
//for the main menu
WriteReviewScreenTester = getActivity();
reviewText = (EditText) WriteReviewScreenTester.getReviewText().getEditText();
submit = (Button) WriteReviewScreenTester.getSubmitButton();
}
public void testPreconditions() {
assertNotNull("Write Review Screen is null",WriteReviewScreenTester);
assertNotNull("EditText is null",reviewText);
assertNotNull("Submit button is null",submit);
}
@UiThreadTest
public void testRequestingFocus()
{
assertTrue(reviewText.requestFocus());
assertTrue(reviewText.hasFocus());
}
@UiThreadTest
public void testEditText() {
reviewText.requestFocus();
reviewText.setText("testing writing a review");
assertEquals("the text in the username field is incorrect.",
"testing writing a review", reviewText.getText().toString());
}
}
| [
"r1ouyang@ucsd.edu"
] | r1ouyang@ucsd.edu |
8d837309a18b991f4c54dd647dec8f246786730b | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/yauaa/learning/2188/ParseUserAgentFunction.java | d1a3155f0f4f75c6c21e492739bbf60d7ab82b3c | [] | no_license | ASSERT-KTH/synthetic-checkstyle-error-dataset | 40e8d1e0a7ebe7f7711def96a390891a6922f7bd | 40c057e1669584bfc6fecf789b5b2854660222f3 | refs/heads/master | 2023-03-18T12:50:55.410343 | 2019-01-25T09:54:39 | 2019-01-25T09:54:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,088 | java | /*
* Yet Another UserAgent Analyzer
* Copyright (C) 2013-2018 Niels Basjes
*
* 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 nl.basjes.parse.useragent.drill;
import io.netty.buffer.DrillBuf;
import org.apache.drill.exec.expr.DrillSimpleFunc;
import org.apache.drill.exec.expr.annotations.FunctionTemplate;
import org.apache.drill.exec.expr.annotations.Output;
import org.apache.drill.exec.expr.annotations.Param;
import org.apache.drill.exec.expr.annotations.Workspace;
import org.apache.drill.exec.expr.holders.NullableVarCharHolder;
import org.apache.drill.exec.vector.complex.writer.BaseWriter;
import javax.inject.Inject;
@FunctionTemplate(
name = "parse_user_agent",
scope = FunctionTemplate.FunctionScope.SIMPLE,
nulls = FunctionTemplate.NullHandling.NULL_IF_NULL
)
public class ParseUserAgentFunction implements DrillSimpleFunc {
@Param
NullableVarCharHolder input;
@Output
BaseWriter.ComplexWriter outWriter;
@Inject
DrillBuf outBuffer;
@Workspace
nl.basjes.parse
.useragent.UserAgentAnalyzer uaa;
@Workspace
java.util.List<String> allFields;
public void setup() {
uaa = nl.basjes.parse.useragent.drill.UserAgentAnalyzerPreLoader.getInstance();
allFields = uaa.getAllPossibleFieldNamesSorted();
}
public void eval() {
org.apache.drill.exec.vector.complex.writer.BaseWriter.MapWriter queryMapWriter = outWriter.rootAsMap();
if (input.buffer == null) {
return;
}
String userAgentString = org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(input.start, input.end, input.buffer);
if (userAgentString.isEmpty() || userAgentString.equals("null")) {
userAgentString = "";
}
nl.basjes.parse.useragent.UserAgent agent = uaa.parse(userAgentString);
for (String fieldName: agent.getAvailableFieldNamesSorted()) {
org.apache.drill.exec.expr.holders.VarCharHolder rowHolder = new org.apache.drill.exec.expr.holders.VarCharHolder();
String field = agent.getValue(fieldName);
if (field == null) {
field = "Unknown";
}
byte[] rowStringBytes = field.getBytes();
outBuffer.reallocIfNeeded(rowStringBytes.length);
outBuffer.setBytes(0, rowStringBytes);
rowHolder.start = 0;
rowHolder.end = rowStringBytes.length;
rowHolder.buffer = outBuffer;
queryMapWriter.varChar(fieldName).write(rowHolder);
}
}
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
07d2e3238ad7191e4b688d8c9d483d7a52db7440 | cf679b9e626e7fee2ea10f03743e42c04a1cb504 | /src/myproject/Canteen.java | 3731544501abb7b4a93a47618a0e70ef42a8c90d | [] | no_license | rajveermehra/myproject | df6b5b1bf44c2e24a9e08c2e4f27ead8d3ddde31 | 1913737ce54ec4e141f88e27ef58b25557f52427 | refs/heads/master | 2020-04-28T23:31:27.982760 | 2019-08-17T15:39:15 | 2019-08-17T15:39:15 | 175,657,884 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,678 | 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 myproject;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
*
* @author Rajveermehra
*/
@Entity
@Table(name = "canteen", catalog = "mess", schema = "")
@NamedQueries({
@NamedQuery(name = "Canteen.findAll", query = "SELECT c FROM Canteen c"),
@NamedQuery(name = "Canteen.findByItemid", query = "SELECT c FROM Canteen c WHERE c.itemid = :itemid"),
@NamedQuery(name = "Canteen.findByAccountno", query = "SELECT c FROM Canteen c WHERE c.accountno = :accountno"),
@NamedQuery(name = "Canteen.findByItem", query = "SELECT c FROM Canteen c WHERE c.item = :item"),
@NamedQuery(name = "Canteen.findByPrize", query = "SELECT c FROM Canteen c WHERE c.prize = :prize"),
@NamedQuery(name = "Canteen.findByDay", query = "SELECT c FROM Canteen c WHERE c.day = :day")})
public class Canteen implements Serializable {
@Transient
private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "Itemid")
private Integer itemid;
@Basic(optional = false)
@Column(name = "Accountno")
private String accountno;
@Basic(optional = false)
@Column(name = "Item")
private String item;
@Basic(optional = false)
@Column(name = "Prize")
private String prize;
@Basic(optional = false)
@Column(name = "Day")
private String day;
public Canteen() {
}
public Canteen(Integer itemid) {
this.itemid = itemid;
}
public Canteen(Integer itemid, String accountno, String item, String prize, String day) {
this.itemid = itemid;
this.accountno = accountno;
this.item = item;
this.prize = prize;
this.day = day;
}
public Integer getItemid() {
return itemid;
}
public void setItemid(Integer itemid) {
Integer oldItemid = this.itemid;
this.itemid = itemid;
changeSupport.firePropertyChange("itemid", oldItemid, itemid);
}
public String getAccountno() {
return accountno;
}
public void setAccountno(String accountno) {
String oldAccountno = this.accountno;
this.accountno = accountno;
changeSupport.firePropertyChange("accountno", oldAccountno, accountno);
}
public String getItem() {
return item;
}
public void setItem(String item) {
String oldItem = this.item;
this.item = item;
changeSupport.firePropertyChange("item", oldItem, item);
}
public String getPrize() {
return prize;
}
public void setPrize(String prize) {
String oldPrize = this.prize;
this.prize = prize;
changeSupport.firePropertyChange("prize", oldPrize, prize);
}
public String getDay() {
return day;
}
public void setDay(String day) {
String oldDay = this.day;
this.day = day;
changeSupport.firePropertyChange("day", oldDay, day);
}
@Override
public int hashCode() {
int hash = 0;
hash += (itemid != null ? itemid.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Canteen)) {
return false;
}
Canteen other = (Canteen) object;
if ((this.itemid == null && other.itemid != null) || (this.itemid != null && !this.itemid.equals(other.itemid))) {
return false;
}
return true;
}
@Override
public String toString() {
return "myproject.Canteen[ itemid=" + itemid + " ]";
}
public void addPropertyChangeListener(PropertyChangeListener listener) {
changeSupport.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
changeSupport.removePropertyChangeListener(listener);
}
}
| [
"kaurmehra1021@gmail.com"
] | kaurmehra1021@gmail.com |
2ee5633020e3d2b8089b18f189c395590ef42aa5 | a335ca17558ed4f77a85e6497cf7b7c4130140cd | /1DV607/src/BlackJack/Model/rules/BasicHitStrategy.java | 81e0fd0000babd1f76c0adfccdd0cfb0d2492316 | [] | no_license | RonaZong/Lecture | 4f12ad02e368e7c447448916c0edec8241b96b21 | d357fdf7e3f5a612c673918607e9d0e7a6ce640b | refs/heads/master | 2022-12-31T15:24:05.440593 | 2020-10-22T15:07:33 | 2020-10-22T15:07:33 | 259,694,654 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 262 | java | package BlackJack.Model.rules;
import BlackJack.Model.Player;
public class BasicHitStrategy implements IHitStrategy {
private final int g_hitLimit = 17;
public boolean DoHit(Player a_dealer) {
return a_dealer.CalcScore() < g_hitLimit;
}
}
| [
"xz222bb@student.lnu.se"
] | xz222bb@student.lnu.se |
391b1e42efb24883b795f1dd01c5759beee4aa70 | d7bfc70001e92362029909cc7d4b3a2b5a785a6d | /src/main/java/sr/dac/utils/CountdownDive.java | b833b101fe1d3a164555ab508b204a7438508448 | [] | no_license | banicola/DAC | bcde094fa6354676ec3e46b3d03072516b9bcc3f | c36154e05eea46556875f5cd36ba3c774d6d80ec | refs/heads/master | 2022-12-16T05:14:56.138643 | 2020-09-11T19:07:08 | 2020-09-11T19:07:08 | 265,835,061 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,518 | java | package sr.dac.utils;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import sr.dac.events.StartGame;
import sr.dac.main.Arena;
import sr.dac.main.Main;
import sr.dac.menus.ScoreboardDAC;
public class CountdownDive implements Runnable {
Arena a;
Player diver;
int timeToJump;
public CountdownDive(Player p, Arena arena){
a = arena;
diver = p;
timeToJump = Main.getPlugin().getConfig().getInt("timeForJump");
}
@Override
public void run() {
ScoreboardDAC.setScoreboardPlayingDAC(diver,timeToJump);
if(timeToJump== Main.getPlugin().getConfig().getInt("timeForJump")){
diver.sendMessage(ChatColor.translateAlternateColorCodes('&', Main.f.getString("name") + " " + Main.f.getString("game.jumpCountdownStart").replace("%time%", ""+timeToJump)));
} else if(timeToJump==5 || (timeToJump<=3&&timeToJump>0)){
diver.sendMessage(ChatColor.translateAlternateColorCodes('&', Main.f.getString("name") + " " + Main.f.getString("game.jumpCountdown").replace("%time%", ""+timeToJump)));
} else if(timeToJump==0){
diver.sendMessage(ChatColor.translateAlternateColorCodes('&', Main.f.getString("name") + " " + Main.f.getString("game.jumpCountdownEnd")));
try {
a.setPlayerLives(diver, -1);
diver.teleport(a.getLobbyLocation());
} catch (NullPointerException ignore){}
StartGame.nextDiver(a);
}
timeToJump--;
}
}
| [
"bastien.nicolas@student.unamur.be"
] | bastien.nicolas@student.unamur.be |
d2bbec65f7e78712676bbb4edc6ebe5baefaa8c1 | 527125672cfa1e88e794f413aaae51ea63cf6739 | /t7_calculadorTodo/src/main/java/com/estadisticas/entities/ValuesArray.java | b4bc6494b54bb82ed56c692b28a43a3bee79cd26 | [] | no_license | cirodiaz/Entregas | 0b314386a0007c009f4814bbbc2856f17521a571 | 8f304e9ddb9008113963f4b44cb8cd89e03d0b88 | refs/heads/master | 2021-01-20T14:49:43.777776 | 2017-05-04T04:39:39 | 2017-05-04T04:39:39 | 82,776,579 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,707 | java | package com.estadisticas.entities;
/**
* @author Ciro Diaz
* Programa calculador todos los datos para psp 2.1
* Version: 1.0
* Creado: 02/05/2017
* ultima modificacion: 03/05/2017
*/
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.StringTokenizer;
import org.apache.commons.math3.stat.regression.SimpleRegression;
public class ValuesArray {
//margen de error para los calculos de integrales
private double errorMargin = 0.000000001;
/**
* Toma un arreglo de n pares de valores, y establece los rangos entre VS, S, M, L, VL
* @param valueList
* @return average
*/
public LinkedList<ValueLabel> setRanges(LinkedList<ValueLabel> valueList){
LinkedList<ValueLabel> logarithmList = new LinkedList<ValueLabel>();
LinkedList<ValueLabel> resultList = new LinkedList<ValueLabel>();
for (int i=0;i<valueList.size();i++) {
ValueLabel currVal = new ValueLabel("",0);
//Se hace una lista con los valores de logaritmo natural de cada par de valores
currVal.setLabel(valueList.get(i).getLabel());
currVal.setValue(computeNaturalLogarithm(valueList.get(i).getValue()));
logarithmList.add(currVal);
}
Float avg = (float) computeAverage(logarithmList);
Float stdDev = (float) computeStdDeviation(logarithmList);
for(int i=-2;i<=2;i++){
ValueLabel currVal = new ValueLabel("",0);
float logRange = avg + i*stdDev;
switch (i) {
case -2:
currVal.setLabel(Range.VERY_SMALL.toString());
break;
case -1:
currVal.setLabel(Range.SMALL.toString());
break;
case 0:
currVal.setLabel(Range.MEDIUM.toString());
break;
case 1:
currVal.setLabel(Range.LARGE.toString());
break;
case 2:
currVal.setLabel(Range.VERY_LARGE.toString());
break;
default:
break;
}
currVal.setValue((float)Math.pow(Math.E, logRange));
resultList.add(currVal);
}
return resultList;
}
/**
* Toma un arreglo de n pares de valores, y calcula el promedio para ellos
* @param valuePairs
* @return average
*/
public Float computeNaturalLogarithm(float value){
Float naturalLog = (float) Math.log(value);
return naturalLog;
}
/**
* Toma un arreglo de n pares de valores, y calcula el promedio para ellos
* @param valuePairs
* @return average
*/
public Float computeAverage(LinkedList<ValueLabel> valueList){
Float avg = (float) 0;
Float totalSum = (float) 0;
for (int i=0;i<valueList.size();i++) {
totalSum +=valueList.get(i).getValue();
}
avg = totalSum/valueList.size();
return avg;
}
/**
* Toma un arreglo de n pares de valores, y calcula la desviaci�n est�ndar para ellos
* @param valuePairs
* @return stdDev
*/
public Float computeStdDeviation(LinkedList<ValueLabel> list){
Float stdDev = (float) 0;
Float avg = computeAverage(list);
Float variance = (float) 0;
for(int i=0;i<list.size();i++){
variance=(float) (variance + Math.pow((list.get(i).getValue()-avg), 2));
}
stdDev = (float) Math.sqrt(variance/(list.size()-1));
return stdDev;
}
/**
* Metodo de legado del programa 1; se toman los valores desde un archivo, y se insertan a una variable Value
* @param fileName
* @return list values
* @throws FileNotFoundException
*/
public LinkedList<Value> readFromFile (String fileName) throws FileNotFoundException{
//Se lee el archivo que se encuentra en la ruta ingresada, o se cargan los valores por defecto.
FileInputStream fileStream = new FileInputStream(fileName);
BufferedReader reader = new BufferedReader(new InputStreamReader(fileStream));
//Si no se encuentran valores en el archivo, la lista retorna vacia (null)
LinkedList<Value> list = new LinkedList<Value>();
String values;
try {
values = reader.readLine();
while(values !=null){
if(!values.isEmpty()){
StringTokenizer parts= new StringTokenizer(values,";");
Value currVal = new Value(0,0);
//Cada linea del archivo sera un par de valores label, value para cargar a la lista
if(parts.hasMoreTokens()){
currVal.setxValue(Float.parseFloat(parts.nextToken()));
currVal.setyValue(Float.parseFloat(parts.nextToken()));
}
list.add(currVal);
values=reader.readLine();
}
}
} catch (Exception e) {
// Agarra cualquier excepci�n
e.printStackTrace();
} finally {
try {
reader.close();
} catch (IOException e) {
// Necesario para poder cerrar el reader.
e.printStackTrace();
}
}
return list;
}
//Adiciones al codigo de la clase:
/**
* Toma un arreglo de n pares de valores, y calcula la regresion lineal para ellos
* @param valuePairs
* @return
*/
public LinearRegression computeLinearRegression(LinkedList<Value> valuePairs){
LinearRegression regressionResult = new LinearRegression(0, 0);
SimpleRegression regression = new SimpleRegression();
//Usando la librería Apache Commons, se calcula la regresión lineal de los valores que se ingresen a este método.
for(int i=0;i<valuePairs.size();i++){
Value currVal = valuePairs.get(i);
regression.addData(currVal.getxValue(), currVal.getyValue());
}
regressionResult.setBeta0(regression.getIntercept());
regressionResult.setBeta1(regression.getSlope());
return regressionResult;
}
public double[] computeCorrelation(LinkedList<Value> valuePairs){
SimpleRegression regression = new SimpleRegression();
for(int i=0;i<valuePairs.size();i++){
Value currVal = valuePairs.get(i);
regression.addData(currVal.getxValue(), currVal.getyValue());
}
double[] correlation = {regression.getR(),regression.getRSquare()};
return correlation;
}
/**
* Calcula una estimacion mejorada, con base en la regresion lineal calculada para los valores de entrada
* @param regression
* @param estimation
* @return
*/
public double computeImprovedEstimation(LinearRegression regression,double estimation){
//Si la estimacion no se puede hacer correctamente, el valor sera de cero. Se entiende que una estimacion no puede ser de cero.
double improvedEstimation = 0;
improvedEstimation = regression.getBeta0()+regression.getBeta1()*estimation;
return improvedEstimation;
}
/**
* Calcula la significancia de un conjunto de valores para encontrar si son validos para hacer estimacion
* @param valuePairs
* @return significance
*/
public double computeSignificance(LinkedList<Value> valuePairs){
//Se hacen integracion de la probabilidad desde 0 hasta x (hallado previamente) y con el restante se encuentra 1-2*p, que es la significancia
SimpsonsRuleIntegrator integrator = new SimpsonsRuleIntegrator(errorMargin);
int dataPoints = valuePairs.size();
double[] correlation = this.computeCorrelation(valuePairs);
double r = correlation[0];
double rSquare = correlation[1];
double x = (Math.abs(r)*Math.sqrt(dataPoints-2))/Math.sqrt((1-rSquare));
double probability = integrator.computeFullSimpsons(x, dataPoints-2, 10);
//la significancia es el area bajo la curva que resta desde x hasta el final de la campana de datos.
return 1-2*probability;
}
/**
* Calcula lo minimo y lo maximo que se espera se demore un desarrollo, basado en valores historicos
* @param valuePairs
* @return predictionInterval (double[])
*/
public double[] computePredictionInterval(LinkedList<Value> valuePairs, double expectedX){
//Se hace calculo del rango superior e inferior de prediccion, basado en valores historicos.
LinearRegression regression = this.computeLinearRegression(valuePairs);
int dataPoints = valuePairs.size() - 2;
//primero, se calcula la desviacion estandar, como parte de los valores para hallar el intervalo de prediccion
double linearSum = 0;
for(int i = 1; i <=valuePairs.size();i++ ){
double currVal = valuePairs.get(i-1).getyValue() - regression.getBeta0() - regression.getBeta1()*valuePairs.get(i-1).getxValue();
linearSum += Math.pow(currVal, 2);
}
double variance = (linearSum/dataPoints);
double stdDev = Math.sqrt(variance);
//luego, se calcula la prediccion mejorada
double impPred = computeImprovedEstimation(regression, expectedX);
//se calcula el numerador de la division de la formula de rango:
double avgX = 0;
for(int i=0;i<valuePairs.size();i++){
avgX+=valuePairs.get(i).getxValue();
}
avgX=avgX/valuePairs.size();
double numeratorFlat = expectedX - avgX;
double numerator = Math.pow(numeratorFlat,2);
// ahora el denominador
double denominator = 0;
for(int i = 1;i<=valuePairs.size();i++){
double denSumFlat = valuePairs.get(i-1).getxValue() - avgX;
denominator+= Math.pow(denSumFlat,2);
}
// se halla todo lo que esta dentro de la raiz:
double rootedResult = (double)1 + ((double)1/valuePairs.size())+(numerator/denominator);
//se calcula el valor de x para p = 0.35 y los grados de libertad de dataPoints
XValuesCalculator xValCalc = new XValuesCalculator();
double tResult = xValCalc.computeXValueForP(0.35, dataPoints);
//Se calculan el rango y los valores superior e inferior, y se retornan como un arreglo de tres valores, respectivamente
double [] predictionInterval = {0,0,0};
//el rango
predictionInterval[0] = tResult*stdDev*Math.sqrt(rootedResult);
//el intervalo de prediccion superior
predictionInterval[1] = impPred + predictionInterval[0];
//el intervalo de prediccion inferior
predictionInterval[2] = impPred - predictionInterval[0];
return predictionInterval;
}
}
| [
"ca.diazr1@uniandes.edu.co"
] | ca.diazr1@uniandes.edu.co |
c294d296154b9f740d0695bfea35bd1c6818a760 | 05ad3485ec08799dfd1bfe854fc4857a742d6a5f | /src/main/java/com/bridgelabz/Maximum.java | 521f966e607f8b5d465197a16728dc97de36161b | [] | no_license | mvinchankar/Generics | d8b60310eb0db4cea6221bd2effd1456a9a7d068 | ff54b6b227096c5da6faed7b2b8d49c874c67b5d | refs/heads/master | 2020-09-21T00:40:15.471602 | 2019-11-29T06:02:46 | 2019-11-29T06:02:46 | 224,630,848 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 947 | java | package com.bridgelabz;
public class Maximum<T extends Comparable> {
private T maximumT;
private T maximumU;
private T maximumV;
public Maximum(T maximumT, T maximumU, T maximumV) {
this.maximumT = maximumT;
this.maximumU = maximumU;
this.maximumV = maximumV;
}
public static <T extends Comparable> T testMax(T maximumT, T maximumU, T maximumV) {
T maximum = maximumT;
if (maximumU.compareTo(maximum) > 0) {
maximum = maximumU;
}
if (maximumV.compareTo(maximum) > 0) {
maximum = maximumV;
}
printMax(maximum);
return maximum;
}
public <T> T testMax() {
T maxElememt = (T) testMax(this.maximumT, this.maximumU, this.maximumV);
printMax(maxElememt);
return maxElememt;
}
private static <T> void printMax(T maximumValue) {
System.out.println(maximumValue);
}
}
| [
"mvinchankar18@gmail.com"
] | mvinchankar18@gmail.com |
dfff2a33cfb309a3b6f381d81d6d26b37835485d | 09171166d8be8e35a4b6dbde8beacd27460dabbb | /lib/src/main/java/com/dyh/common/lib/weigit/picker/entity/Province.java | 0596db93a47edaf05f83dc53f2e31bfb1fd6fda4 | [
"ICU"
] | permissive | dongyonghui/CommonLib | d51c99f15258e54344fed6dfdacc0c3aa0c08017 | a57fb995898644bb7b4bcd259417aca1e11944c9 | refs/heads/master | 2021-07-20T06:58:19.536087 | 2021-01-11T09:05:26 | 2021-01-11T09:05:26 | 233,981,794 | 12 | 2 | null | null | null | null | UTF-8 | Java | false | false | 783 | java | package com.dyh.common.lib.weigit.picker.entity;
import java.util.ArrayList;
import java.util.List;
/**
* 省份
* <br/>
* Author:李玉江[QQ:1032694760]
* DateTime:2016-10-15 19:06
* Builder:Android Studio
*/
public class Province extends Area implements LinkageFirst<City> {
private List<City> cities = new ArrayList<>();
public Province() {
super();
}
public Province(String areaName) {
super(areaName);
}
public Province(String areaId, String areaName) {
super(areaId, areaName);
}
public List<City> getCities() {
return cities;
}
public void setCities(List<City> cities) {
this.cities = cities;
}
@Override
public List<City> getSeconds() {
return cities;
}
} | [
"648731994@qq.com"
] | 648731994@qq.com |
0f4bdf09a08dabce2a6fb72f1efc1283f872a1eb | 151a55c9c497cf8750b23fc80328b8f45463382f | /src/test/java/com/thetimes/MyStepdefs.java | 85ef8ef02972d790de7bd2d54e01a857879ed00d | [] | no_license | keshashivam/BDDHomework3 | efd2703cbd616217c9f8a62537c51b13e487cbb0 | a144c5b3743ee6506969400c607f339957cfb019 | refs/heads/master | 2021-01-20T03:25:22.956046 | 2017-04-27T00:43:31 | 2017-04-27T00:43:31 | 89,539,320 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,773 | java | package com.thetimes;
import cucumber.api.PendingException;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.junit.Assert;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import java.util.concurrent.TimeUnit;
/**
* Created by user on 4/27/2017.
*/
public class MyStepdefs {
WebDriver driver;
@Given("^user is on home page$")
public void userIsOnHomePage()
{
driver= new FirefoxDriver();
driver.manage().window().maximize();
driver.manage().deleteAllCookies();
driver.get("https://www.thetimes.co.uk");
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@When("^user Click on Subscripe the times services$")
public void userClickOnSubscripeTheTimesServices()
{
Alert alert=driver.switchTo().alert();
driver.findElement(By.className("CookieMessage-button")).click();
driver.findElement(By.linkText("Subscribe")).click();
}
@And("^user select digital pack for (\\d+) weeks$")
public void userSelectDigitalPackForWeeks(int arg0)
{
driver.findElement(By.linkText("View all Subscriptions")).click();
driver.findElement(By.linkText("Digital Packs")).click();
driver.findElement(By.xpath("(//a[contains(text(),'Viewfulldetails')])[2]")).click();
}
@Then("^user should get digital services subscriptin for (\\d+) weeks$")
public void userShouldGetDigitalServicesSubscriptinForWeeks(int arg0)
{
Assert.assertEquals(driver.findElement(By.cssSelector("div.productName")).getText(),"The Digital Pack");
}
}
| [
"shivamkesha@gmail.com"
] | shivamkesha@gmail.com |
d8d473e0527ba91c2a1f25537b25ac39a12a74a1 | 6bc32c1d5fcf4a9129a0af775a5d12f0f4af8c37 | /DA104G6/src/com/product/model/ProductDAO_interface.java | 6562da9a20e3bc724339e3f25743b324c987cc66 | [] | no_license | Boss-Lin/DA104G6 | 0c3b96ecabbfd0b82d667fe539b4304d7cc26056 | 3bed0208a43777c048523f0a7435b6b5bfe30451 | refs/heads/main | 2023-09-02T13:41:50.403857 | 2021-11-08T01:34:40 | 2021-11-08T01:34:40 | 416,858,200 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 548 | java | package com.product.model;
import java.util.*;
public interface ProductDAO_interface {
public void insert(ProductVO productVO);
public void update(ProductVO productVO);
public void delete(String pro_no);
public ProductVO findByPrimaryKey(String pro_no);
public List<ProductVO> findByCategory(String category_no);
public List<ProductVO> getAll();
public List<ProductVO> findByCompositeQuery(String product, String category_no);
public List<ProductVO> getStatus(Integer status);
public void updateScore(ProductVO productVO);
}
| [
"bbosstw@gmail.com"
] | bbosstw@gmail.com |
d4f33b9b876b0295eb43fce7419fbfda2537edc7 | ef161f26d1dac1de7bd879ce85cd7381003dbd46 | /DreamHouse/build/generated-sources/ap-source-output/cl/starlabs/modelo/Propiedad_.java | 4328b02d9e16d8be64806c685925a4256781b73f | [] | no_license | xqb91/DreamHouse | d217729a706af4882c66f4cad8514b53426c66b5 | 38da738da1807d5ca5deb31c09354a1917935b07 | refs/heads/master | 2016-09-13T00:43:16.552861 | 2016-05-29T00:19:08 | 2016-05-29T00:19:08 | 59,068,734 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,837 | java | package cl.starlabs.modelo;
import cl.starlabs.modelo.Agenda;
import cl.starlabs.modelo.Arriendo;
import cl.starlabs.modelo.Comision;
import cl.starlabs.modelo.Empleado;
import cl.starlabs.modelo.Historialbusqueda;
import cl.starlabs.modelo.Propietario;
import cl.starlabs.modelo.Tipopropiedades;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.annotation.Generated;
import javax.persistence.metamodel.CollectionAttribute;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@Generated(value="EclipseLink-2.5.2.v20140319-rNA", date="2016-05-27T04:52:56")
@StaticMetamodel(Propiedad.class)
public class Propiedad_ {
public static volatile SingularAttribute<Propiedad, Tipopropiedades> tipo;
public static volatile CollectionAttribute<Propiedad, Agenda> agendaCollection;
public static volatile CollectionAttribute<Propiedad, Comision> comisionCollection;
public static volatile SingularAttribute<Propiedad, String> calle;
public static volatile SingularAttribute<Propiedad, Empleado> numempleado;
public static volatile SingularAttribute<Propiedad, BigInteger> hab;
public static volatile SingularAttribute<Propiedad, BigInteger> ciudad;
public static volatile SingularAttribute<Propiedad, Propietario> numpropietario;
public static volatile CollectionAttribute<Propiedad, Arriendo> arriendoCollection;
public static volatile SingularAttribute<Propiedad, BigDecimal> numpropiedad;
public static volatile CollectionAttribute<Propiedad, Historialbusqueda> historialbusquedaCollection;
public static volatile SingularAttribute<Propiedad, Double> renta;
public static volatile SingularAttribute<Propiedad, String> codigopostal;
public static volatile SingularAttribute<Propiedad, Character> disponible;
} | [
"victor.araya92@gmail.com"
] | victor.araya92@gmail.com |
865f6ba57db3fd3c24858c5f89b0dcadccdac5c4 | 4465f98568447abc2566e39194c12afa3a67b65f | /src/main/java/lc/common/util/SpecialBucketHandler.java | 943e4e25c09de674f3be3f9e27d3787d6374ff8d | [] | no_license | irgusite/LanteaCraft | 1d3b331f832083ed35e27c7b2ec0e8ddee463785 | 596e088dfd759f07c4aee145a676fcb336a60b47 | refs/heads/master | 2020-12-27T08:20:30.487360 | 2014-10-11T03:46:40 | 2014-10-11T03:46:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,273 | java | package lc.common.util;
import java.util.HashMap;
import java.util.Map.Entry;
import lc.common.base.LCBlock;
import lc.common.base.LCItemBucket;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBucket;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
/**
* SpecialBucketHandler handles Forge onBucketFill from {@link ItemBucket}.
*
* @author AfterLifeLochie
*
*/
public class SpecialBucketHandler {
/**
* Map of all Block to LCItemBucket mappings.
*/
private static HashMap<Block, LCItemBucket> buckets = new HashMap<Block, LCItemBucket>();
/**
* Register a new mapping of {@link Block} type blockOf with an
* {@link LCItemBucket} itemResult.
*
* @param blockOf
* The fluid host block type.
* @param itemResult
* The resulting LCItemBucket when the host block is collected in
* a bucket.
*/
public static void registerBucketMapping(LCBlock blockOf, LCItemBucket itemResult) {
buckets.put(blockOf, itemResult);
}
@SubscribeEvent
public void onBucketFill(FillBucketEvent event) {
ItemStack result = fillCustomBucket(event.world, event.target);
if (result == null)
return;
event.result = result;
event.setResult(Result.ALLOW);
}
/**
* Attempts to fill a bucket from the source described.
*
* @param world
* The world object.
* @param pos
* The position of the fluid source block.
* @return The resulting ItemStack from collecting the target fluid in a
* bucket, or null if the fluid cannot be collected with an
* {@link LCItemBucket} registered with the handler.
*/
private ItemStack fillCustomBucket(World world, MovingObjectPosition pos) {
Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
for (Entry<Block, LCItemBucket> results : buckets.entrySet())
if (block.equals(results.getKey())) {
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, Block.getBlockById(0));
return new ItemStack(results.getValue());
}
return null;
}
}
| [
"afterlifelochie@afterlifelochie.net"
] | afterlifelochie@afterlifelochie.net |
21462713f930046e87729f0745cf190eaad29034 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_22620.java | c27e977c243ac510d34b8b7b28282df5752a7e01 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 848 | java | /**
* Set the default L & F. While I enjoy the bounty of the sixteen possible exception types that this UIManager method might throw, I feel that in just this one particular case, I'm being spoiled by those engineers at Sun, those Masters of the Abstractionverse. So instead, I'll pretend that I'm not offered eleven dozen ways to report to the user exactly what went wrong, and I'll bundle them all into a single catch-all "Exception". Because in the end, all I really care about is whether things worked or not. And even then, I don't care.
* @throws Exception Just like I said.
*/
public void setLookAndFeel() throws Exception {
String laf=Preferences.get("editor.laf");
if (laf == null || laf.length() == 0) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
else {
UIManager.setLookAndFeel(laf);
}
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
3da4cea4e5d6338f7867a4cc675951f8dc51db20 | 0ea271177f5c42920ac53cd7f01f053dba5c14e4 | /5.3.5/sources/io/fabric/sdk/android/services/persistence/PreferenceStore.java | 67bf398daf58d87eb5cc29c777480cf2197eb2a0 | [] | no_license | alireza-ebrahimi/telegram-talaeii | 367a81a77f9bc447e729b2ca339f9512a4c2860e | 68a67e6f104ab8a0888e63c605e8bbad12c4a20e | refs/heads/master | 2020-03-21T13:44:29.008002 | 2018-12-09T10:30:29 | 2018-12-09T10:30:29 | 138,622,926 | 12 | 1 | null | null | null | null | UTF-8 | Java | false | false | 265 | java | package io.fabric.sdk.android.services.persistence;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
public interface PreferenceStore {
Editor edit();
SharedPreferences get();
boolean save(Editor editor);
}
| [
"alireza.ebrahimi2006@gmail.com"
] | alireza.ebrahimi2006@gmail.com |
a423d4ebaa8e87eedd3b2354c7e99696b55254b2 | bceba483c2d1831f0262931b7fc72d5c75954e18 | /src/qubed/corelogicextensions/ADDRESSESEXTENSION.java | 55605b726172bb1e4a4aaf4fef752e138746de0e | [] | no_license | Nigel-Qubed/credit-services | 6e2acfdb936ab831a986fabeb6cefa74f03c672c | 21402c6d4328c93387fd8baf0efd8972442d2174 | refs/heads/master | 2022-12-01T02:36:57.495363 | 2020-08-10T17:26:07 | 2020-08-10T17:26:07 | 285,552,565 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,451 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2020.08.05 at 04:53:09 AM CAT
//
package qubed.corelogicextensions;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ADDRESSES_EXTENSION complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="ADDRESSES_EXTENSION">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="MISMO" type="{http://www.mismo.org/residential/2009/schemas}MISMO_BASE" minOccurs="0"/>
* <element name="OTHER" type="{http://www.mismo.org/residential/2009/schemas}OTHER_BASE" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ADDRESSES_EXTENSION", propOrder = {
"mismo",
"other"
})
public class ADDRESSESEXTENSION {
@XmlElement(name = "MISMO")
protected MISMOBASE mismo;
@XmlElement(name = "OTHER")
protected OTHERBASE other;
/**
* Gets the value of the mismo property.
*
* @return
* possible object is
* {@link MISMOBASE }
*
*/
public MISMOBASE getMISMO() {
return mismo;
}
/**
* Sets the value of the mismo property.
*
* @param value
* allowed object is
* {@link MISMOBASE }
*
*/
public void setMISMO(MISMOBASE value) {
this.mismo = value;
}
/**
* Gets the value of the other property.
*
* @return
* possible object is
* {@link OTHERBASE }
*
*/
public OTHERBASE getOTHER() {
return other;
}
/**
* Sets the value of the other property.
*
* @param value
* allowed object is
* {@link OTHERBASE }
*
*/
public void setOTHER(OTHERBASE value) {
this.other = value;
}
}
| [
"vectorcrael@yahoo.com"
] | vectorcrael@yahoo.com |
0504dc070a85470c735a9ce3674d604b290ceaa2 | 6d01d0b0ed45a318ca3f4eb1baa215cbe458139e | /programprocessor/experiment-dataset/TrainingData/51CTO-java1200221/MR/077/src/FrameShowException.java | 9fb359341a1ec9ab052d0605b6c1f22a4ccef05d | [] | no_license | yangyixiaof/gitcrawler | 83444de5de1e0e0eb1cb2f1e2f39309f10b52eb5 | f07f0525bcb33c054820cf27e9ff73aa591ed3e0 | refs/heads/master | 2022-09-16T20:07:56.380308 | 2020-04-12T17:03:02 | 2020-04-12T17:03:02 | 46,218,938 | 0 | 1 | null | 2022-09-01T22:36:18 | 2015-11-15T13:36:48 | Java | GB18030 | Java | false | false | 3,644 | java | import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
public class FrameShowException extends JFrame {
private JPanel contentPane;
private JTextField textField;
private JTextArea textArea;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
FrameShowException frame = new FrameShowException();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public FrameShowException() {
setTitle("\u663E\u793A\u5F02\u5E38\u4FE1\u606F");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 253);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel label = new JLabel(
"\u8BF7\u8F93\u5165\u975E\u6570\u5B57\u5B57\u7B26\u4E32\uFF0C\u67E5\u770B\u8F6C\u6362\u4E3A\u6570\u5B57\u65F6\u53D1\u751F\u7684\u5F02\u5E38\u3002");
label.setBounds(10, 10, 414, 15);
contentPane.add(label);
textField = new JTextField();
textField.setBounds(10, 32, 248, 21);
contentPane.add(textField);
textField.setColumns(10);
JButton btninteger = new JButton(
"\u8F6C\u6362\u4E3AInteger\u7C7B\u578B");
btninteger.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
do_btninteger_actionPerformed(e);
}
});
btninteger.setBounds(268, 31, 156, 23);
contentPane.add(btninteger);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setOpaque(false);
scrollPane.setBounds(10, 63, 414, 142);
contentPane.add(scrollPane);
textArea = new JTextArea();
textArea.setText("\u4FE1\u606F\u63D0\u793A\u6846");
textArea.setEditable(false);
scrollPane.setViewportView(textArea);
}
protected void do_btninteger_actionPerformed(ActionEvent e) {
// 创建字节数组输出流
ByteArrayOutputStream stream = new ByteArrayOutputStream();
System.setErr(new PrintStream(stream));// 重定向err输出流
String numStr = textField.getText();// 获取用户输入
try {
Integer value = Integer.valueOf(numStr);// 字符串转整数
} catch (NumberFormatException e1) {
e1.printStackTrace();// 输出错误异常信息
}
String info = stream.toString();// 获取字节输出流的字符串
if (info.isEmpty()) {// 显示正常转换的提示信息
textArea.setText("字符串到Integer的转换没有发生异常。");
} else {// 显示出现异常的提示信息与异常
textArea.setText("错错啦!转换过程中出现了如下异常错误:\n" + info);
}
}
} | [
"yyx@ubuntu"
] | yyx@ubuntu |
4f4d5ce1643e18ffadf8e8764908de6df4d74225 | 1a7e5e94d27520bf8ae371fa55ddc3313e3aa00a | /app/src/main/java/com/example/she_is_a_girl/Models/ModelChat.java | ba197fed02e1905e97d4ebe42d4293ca53fe7fe9 | [] | no_license | Ariful0007/She_IS_a_girl | 76c72e8d3bff588dec0ae721fbefa9527ff89e03 | f7af8cefdee6656156af46dce111b7d582eddf82 | refs/heads/master | 2023-01-02T11:43:30.647504 | 2020-10-20T06:15:36 | 2020-10-20T06:15:36 | 305,605,457 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 726 | java | package com.example.she_is_a_girl.Models;
public class ModelChat {
String message,sender,reciver,time;
boolean isSeen;
public ModelChat() {
}
public ModelChat(String message, String sender, String reciver, String time, boolean isSeen) {
this.message = message;
this.sender = sender;
this.reciver = reciver;
this.time = time;
this.isSeen = isSeen;
}
public String getMessage() {
return message;
}
public String getSender() {
return sender;
}
public String getReciver() {
return reciver;
}
public String getTime() {
return time;
}
public boolean isSeen() {
return isSeen;
}
}
| [
"arifulpub143@gmail.com"
] | arifulpub143@gmail.com |
e04ecbfc01a8dcaea6efacd521be4c0a709058bb | 3376507f08c28d1626f6f2dc87feeb2831fa0a1d | /app/src/main/java/edu/virginia/cs/cs4720/uvabucketlist/BucketListActivity.java | ddc9de842db90f1e1471fc5349e81366df230695 | [] | no_license | PatidarParth/CS4720--Android | bcad5e9162d67be2c58a764f66657844bd9b9811 | 39ce9e7038db068112c9f71bbc5a3437aa647c59 | refs/heads/master | 2021-06-22T20:33:39.844739 | 2017-09-04T17:42:21 | 2017-09-04T17:42:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,793 | java | package edu.virginia.cs.cs4720.uvabucketlist;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;
public class BucketListActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bucket_list);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.addItem);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String popup = "Add an item to your BucketList";
Snackbar.make(view, popup, Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
BucketItem[] data = new BucketItem[]{
new BucketItem("Finish MileStone 1", "9-04-2017"),
new BucketItem("Streak the Lawn", "09-05-2017"),
new BucketItem("Eat Roots", "09-08-2017"),
new BucketItem("Get an A in CS4720", "12-15-2017")
};
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
BucketListAdapter adapter = new BucketListAdapter(data);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);
}
}
| [
"pjp8yf@virginia.edu"
] | pjp8yf@virginia.edu |
58884161e13d99a4917f1ab21bb8b0349fb0c62f | c91604ad90e0abca181d9138896ea99ec398eb9a | /store/src/test/java/cn/tedu/store/service/GoodsServiceTests.java | cd99c6a9ba896725a81242ea38f31ef59b5334f9 | [] | no_license | Hannah-reset/commerce | 76ab8f7363a14f2d4034ada4bf46e7acc30e85dd | 68ab6d5fe07389395ebbcd0ebcb6b7533beac89d | refs/heads/master | 2022-04-12T02:37:34.710839 | 2020-04-05T05:18:12 | 2020-04-05T05:18:12 | 252,925,068 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 804 | java | package cn.tedu.store.service;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import cn.tedu.store.entity.Goods;
@RunWith(SpringRunner.class)
@SpringBootTest
public class GoodsServiceTests {
@Autowired
private IGoodsService service;
@Test
public void getHotList() {
List<Goods> list = service.getHotList();
System.err.println("BEGIN:");
for (Goods item : list) {
System.err.println(item);
}
System.err.println("END.");
}
@Test
public void getById() {
Long id = 10000042L;
Goods result = service.getById(id);
System.err.println(result);
}
}
| [
"329872447@qq.com"
] | 329872447@qq.com |
f9c4960f455b35ac2d00bf88ebbb24ddfb1cbdd8 | 6082617095733f812176af96d92c6ced1c0ab5e9 | /app/src/androidTest/java/com/qdxiaogutou/eye/ApplicationTest.java | e50d9f6e9861c2c0ab48cb46634dc0799f2366f4 | [] | no_license | IceSeaOnly/SmsMailerBoss | 7de3847a1271a69acf795d9d5ce6be89173bc2b4 | 2a00f04c29c496a27bda7cf295d32ed1b07c521d | refs/heads/master | 2021-01-11T15:26:49.636287 | 2017-02-27T13:44:30 | 2017-02-27T13:44:30 | 80,343,652 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 350 | java | package com.qdxiaogutou.eye;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"1041414957@qq.com"
] | 1041414957@qq.com |
6855420c7662a9b592a456000bbb644d2b8950b5 | d47fbb83005f4d7c8fa5bf8d41bcdd8d4627d82e | /Question1/src/Question1.java | e51041fa0daf91f738b7a6e1181f55b5b926ce3e | [] | no_license | karenrojas1994/yearup | d3bb2527f80922b1b2cba77bd9616e73f70feefe | cc8d700d646df16414775882ee461a06ef89e1d2 | refs/heads/master | 2021-03-12T21:47:42.657591 | 2016-01-12T18:04:51 | 2016-01-12T18:04:51 | 42,728,407 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 401 | java | public boolean answerCell(boolean isMorning, boolean isMom, boolean isAsleep)
{
boolean answerCell = true;
if (!isAsleep)
{
if (isMorning)
{
if (!isMom)
{
answerCell =false;
}
}
}
else
{
answerCell = false;
}
}
| [
"arojas@atl.yearup.org"
] | arojas@atl.yearup.org |
82091357178a2bb29065e0a15c0bdb125eda6539 | d1472e3d30868b6184d9a9ea8c8228d4b89d7910 | /Projeto para cadastrar os produtos da loja preço bom - Vetor e POO/src/projeto/para/cadastrar/os/produtos/da/loja/preço/bom/vetor/e/poo/ProjetoParaCadastrarOsProdutosDaLojaPreçoBomVetorEPOO.java | 20ef93047d80f9ffb60d8a45c612e8ab031d29b5 | [] | no_license | ViniLopes87/Projetos-Unicap-Java | 17ec12e55f167dec72f6cb776efcb3bd686daccc | 1178d63e736fed3e99f1c011e7f6a30a234da0e2 | refs/heads/master | 2023-01-03T19:17:33.747267 | 2020-10-29T20:51:59 | 2020-10-29T20:51:59 | 308,178,729 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,740 | java | package projeto.para.cadastrar.os.produtos.da.loja.preço.bom.vetor.e.poo;
import java.util.Scanner;
public class ProjetoParaCadastrarOsProdutosDaLojaPreçoBomVetorEPOO {
public static void MenuAlt(){
System.out.println("Escolha uma operação: ");
System.out.println("1- Aumento");
System.out.println("2- Desconto");
}
public static void Menu(){
System.out.println("Escolha uma operação:");
System.out.println("0 - Para sair");
System.out.println("1 - Cadastrar um novo produto");
System.out.println("2 - Exibir os dados de todos os produtos da loja");
System.out.println("3 - Exibir os dados de todos os produtos de um dado fornecedor");
System.out.println("4 - Alterar o preço de um produto");
System.out.println("5 - Atualizar o estoque de um produto");
System.out.println("6 - Realizar a venda de um produto");
}
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
final int CONT = 100;
String C,D,F;
double V,Percen;
int OP,QE;
Loja L = new Loja(CONT);
Produto P;
System.out.println("Seja bem vindo a loja Preço Bom!");
do{
Menu();
System.out.print("Opção: ");
OP = input.nextInt(); input.nextLine();
switch(OP){
case 0: break;
case 1: System.out.print("Informe o código do produto: ");
C = input.nextLine();
P = new Produto(C);
System.out.print("Informe a definição do produto: ");
D = input.nextLine();
P.setD(D);
System.out.print("Informe a fornecedora do produto: ");
F = input.nextLine();
P.setF(F);
System.out.print("Informe o preço do produto: ");
V = input.nextDouble();
while(V <= 0){
System.out.println("Preço inválido");
System.out.print("Informe o preço do produto que seja maior que 0: ");
V = input.nextDouble();
}
P.setP(V);
System.out.print("Informe a quantidade do produto no estoque: ");
QE = input.nextInt(); input.nextLine();
while(QE < 0){
System.out.println("Quantidade inválida");
System.out.print("Informe a quantidade do produto no estoque que se maior ou igual a 0: ");
QE = input.nextInt(); input.nextLine();
}
P.setQE(QE);
L.Cadastrar(P);
break;
case 2: L.Exibirtodos();
break;
case 3: System.out.print("Informe o nome do fornecedor a ser procurado: ");
F = input.nextLine();
L.ExibirFornecedor(F);
break;
case 4: System.out.print("Informe o código do produto a ser alterado o preço: ");
C = input.nextLine();
System.out.print("Informe o percentual de alteração: ");
Percen = input.nextDouble();
while(Percen <= 0){
System.out.println("Percentual inválido");
System.out.print("Informe o percentual de alteração que seja maior que 0: ");
Percen = input.nextDouble();
}
MenuAlt();
System.out.print("Opção: ");
OP = input.nextInt();
while(OP != 1 && OP != 2){
System.out.println("Opção inválida");
System.out.print("Opção com 1 ou 2: ");
OP = input.nextInt();
}
L.AlterarPreco(C,Percen,OP);
break;
case 5: System.out.print("Informe o código do produto: ");
C = input.nextLine();
System.out.print("Informe quanto deve ser acrescido no estoque do produto: ");
QE = input.nextInt();
while(QE < 0){
System.out.println("Quantidade inválida");
System.out.print("Informe a quantidade do produto que se maior ou igual a 0: ");
QE = input.nextInt(); input.nextLine();
}
L.AlterarQuantidade(C,QE);
break;
case 6: System.out.print("Informe o código do produto que será vendido: ");
C = input.nextLine();
System.out.print("Informe a quantidade à ser vendida: ");
QE = input.nextInt();
while(QE < 0){
System.out.println("Quantidade inválida");
System.out.print("Informe a quantidade do produto que se maior ou igual a 0: ");
QE = input.nextInt(); input.nextLine();
}
L.Venda(C,QE);
break;
default: System.out.println("Opção inválida");
break;
}
}while(OP != 0);
}
} | [
"viniciuslopes_2000@hotmail.com"
] | viniciuslopes_2000@hotmail.com |
9361cfb30b37072e85ad273756d219abb2949131 | f71fa6de9509036c590a845c0560aebf8e1630fb | /src/main/java/serendip/sturts/thymeleaf/struts2_thymeleaf_sampleapp/actions/RegisterListAction.java | dffa640b382122d9bb0b5fc20511e1967b495b3d | [] | no_license | A-pZ/struts2-thymeleaf3-sampleapp | 47dd4f41d8cda3ab26c68aa936637ccf2674d8bd | eef0e50c5791f8c3d8a7ab3bfc6c5a742809a620 | refs/heads/development | 2023-06-29T04:11:23.809988 | 2022-09-10T06:54:31 | 2022-09-10T06:54:31 | 61,311,400 | 1 | 0 | null | 2023-06-14T20:17:11 | 2016-06-16T17:02:47 | HTML | UTF-8 | Java | false | false | 1,346 | java | package serendip.sturts.thymeleaf.struts2_thymeleaf_sampleapp.actions;
import java.util.List;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.util.Element;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.log4j.Log4j2;
import serendip.sturts.thymeleaf.struts2_thymeleaf_sampleapp.model.ProductService;
import serendip.sturts.thymeleaf.struts2_thymeleaf_sampleapp.model.SampleProduct;
/**
* <code>Set welcome message.</code>
*/
@Namespace("/")
@ParentPackage("struts-thymeleaf")
@Results(
{@Result(name=ActionSupport.SUCCESS,type="thymeleaf",location="listInput"),
@Result(name=ActionSupport.INPUT,type="thymeleaf",location="listInput")}
)
@Log4j2
public class RegisterListAction extends ActionSupport {
@Action("registerList")
public String execute() throws Exception {
log.info("- register:{}" , products);
return SUCCESS;
}
@Getter @Setter
//@Element(value=serendip.sturts.thymeleaf.struts2_thymeleaf_sampleapp.model.SampleProduct.class)
List<SampleProduct> products;
}
| [
"a-pz@h4.dion.ne.jp"
] | a-pz@h4.dion.ne.jp |
8c5f00e72b2a6fd719c9641ebcedcae98cde484d | fda1ee633e8dbaae791da9a5e6c747c4d3cf50df | /faceye-hadoop-manager/src/main/java/com/faceye/component/hadoop/service/stock/mapreduce/DailyDataKeyComparator.java | 2632e44ac77b20abb6e915839c99fea47b53607e | [] | no_license | haipenge/faceye-hadoop | 4670fbd55f1cd63bbeb0e962c3851cef3426b48a | 1dff867c820eee16da408ec4d91a089f2a1b0e1b | refs/heads/master | 2021-01-22T02:17:17.733570 | 2018-04-02T13:08:08 | 2018-04-02T13:08:08 | 92,345,654 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 743 | java | package com.faceye.component.hadoop.service.stock.mapreduce;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;
public class DailyDataKeyComparator extends WritableComparator {
public DailyDataKeyComparator() {
super(DailyDataKey.class, true);
}
public int compare(WritableComparable combinationKeyOne, WritableComparable combinationKeyOther) {
int res = 0;
DailyDataKey key1 = (DailyDataKey) combinationKeyOne;
DailyDataKey key2 = (DailyDataKey) combinationKeyOther;
// res=key1.getDate().compareTo(key2.getDate());
// return res;
res = key1.getStockId().compareTo(key2.getStockId());
if (res == 0) {
res = key2.getDate().compareTo(key1.getDate());
}
return res;
}
}
| [
"haipenge@gmail.com"
] | haipenge@gmail.com |
2622de6d4fdec1b0bbd633aba6d81e530572a965 | 3c9a3770e21b032b10f128f5c82e95600daf7fdb | /src/main/java/io/github/ititus/commons/math/expression/Expression.java | 3721b53cd88389e8768f96551713040824892820 | [
"MIT"
] | permissive | iTitus/commons | fcfdde28741693a25d5aedd7cd39583e48f0f825 | 5cf41dc4570bc2a0f8d37c6d0ab2f7d3c2a5136a | refs/heads/main | 2023-08-05T09:36:22.550572 | 2023-07-24T21:20:07 | 2023-07-24T21:20:07 | 217,306,753 | 0 | 2 | MIT | 2023-09-04T18:53:28 | 2019-10-24T13:31:34 | Java | UTF-8 | Java | false | false | 476 | java | package io.github.ititus.commons.math.expression;
import io.github.ititus.commons.math.number.BigComplex;
public abstract class Expression {
public abstract BigComplex evaluate(ComplexEvaluationContext ctx);
protected abstract String toString(boolean inner);
@Override
public final String toString() {
return toString(false);
}
@Override
public abstract boolean equals(Object o);
@Override
public abstract int hashCode();
}
| [
"iTitus@users.noreply.github.com"
] | iTitus@users.noreply.github.com |
57a73ae310ce593e1e2a854e3ebc36012236ac98 | ffb4c0111c2b3a0f1342103fa829630c504f7cfa | /ContatosBD/src/Principal.java | ed4186d0d52be035e83a379d4fceb12e577813eb | [] | no_license | JaySobreiro/JavaBasicoBSI | 8dff2f88b96fe6ab4ff0efb3342278e8814cf5ae | e5e6198616db581c73cf625e358e23c6d7b41a08 | refs/heads/master | 2020-04-04T00:09:19.214435 | 2018-11-07T23:01:16 | 2018-11-07T23:01:16 | 155,641,788 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 5,372 | java | import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Scanner;
public class Principal {
public static void main(String[] args) throws SQLException {
/* teste de conexão
Connection conn = new ConnectionFactory().getConnection();
System.out.println("Conectado com sucesso!\n");
conn.close();*/
int op, op2, op3;
Scanner leitor = new Scanner(System.in);
ContatoDAO dao = new ContatoDAO();
int id;
Contato busca;
do {
System.out.println("\n-----CONTATOS-----");
System.out.println("1) Cadastrar");
System.out.println("2) Listar todos");
System.out.println("3) Buscar");
System.out.println("4) Excluir");
System.out.println("5) Alterar");
System.out.println("0) Sair");
System.out.print("Informe uma opção: ");
op = leitor.nextInt();
switch (op) {
case 1: // cadastro
leitor.nextLine();
Contato c = new Contato();
System.out.println("\nNovo Contato:");
System.out.print("Nome: ");
c.setNome(leitor.nextLine());
System.out.print("Fone: ");
c.setFone(leitor.nextLine());
System.out.print("E-mail: ");
c.setEmail(leitor.nextLine());
dao.cadastrarContato(c);
System.out.println("\nContato cadastrado com sucesso!");
break;
case 2: // listagem
ArrayList<Contato> listaContatos = dao.getContatos();
if(listaContatos.isEmpty()) {
System.out.println("\nAtenção: não há contatos cadastrados!");
}else {
System.out.print("\nContatos Cadastrados:");
for(Contato temp : listaContatos) {
System.out.println("\n" + temp.toString());
}
}
break;
case 3: // buscar contato
System.out.print("\nInforme o ID do contato que deseja encontrar: ");
id = leitor.nextInt();
busca = dao.getContato(id);
if(busca == null) {
System.out.println("\nNão foi encontrado contato com este id...");
}else {
System.out.println("\nContato localizado:");
System.out.println(busca.toString());
}
break;
case 4: // deletar
System.out.print("\nInforme o ID do contato que deseja excluir: ");
id = leitor.nextInt();
busca = dao.getContato(id);
if(busca == null) { // o contato não existe
System.out.println("\nNão foi encontrado contato com este id...");
}else { // o contato existe
// exibe contato
System.out.println("\nContato localizado: ");
System.out.println(busca.toString());
System.out.println("\nDeseja excluir este contato?");
System.out.println("1) Sim");
System.out.println("2) Não");
System.out.print("Sua opção: ");
op2 = leitor.nextInt();
while(op2 != 1 && op2 != 2) {
System.out.println("\nOpção invlálida");
System.out.println("\nDeseja excluir este contato?");
System.out.println("1) Sim");
System.out.println("2) Não");
System.out.print("Sua opção: ");
op2 = leitor.nextInt();
}
if(op2 == 1) {
dao.deletarContato(id);
System.out.println("\nContato nº " + id +" excluido com sucesso!");
}
}
break;
case 5: // alterar
System.out.print("\nInforme o ID do contato que deseja atualizar: ");
id = leitor.nextInt();
busca = dao.getContato(id);
if(busca == null) { // o contato não existe
System.out.println("\nNão foi encontrado contato com este id...");
}else { // o contato existe
System.out.println("Contato localizado: ");
System.out.println(busca.toString() + "\n");
System.out.println("\n--- Menu de Alteração ---");
System.out.println("Informe o campo que deseja atualizar:");
System.out.println("1) Nome");
System.out.println("2) Fone");
System.out.println("3) E-mail");
System.out.println("0) Voltar ao menu principal");
System.out.print("Sua opção: ");
op3 = leitor.nextInt();
while(op3 < 0 || op3 > 3) {
System.out.println("\nOpção invlálida");
System.out.println("\n--- Menu de Alteração ---");
System.out.println("Informe o campo que deseja atualizar:");
System.out.println("1) Nome");
System.out.println("2) Fone");
System.out.println("3) E-mail");
System.out.println("0) Voltar ao menu principal");
System.out.print("Sua opção: ");
op3 = leitor.nextInt();
}
leitor.nextLine();
if(op3 == 1) {
System.out.println("\nNovo nome: ");
busca.setNome(leitor.nextLine());
}else if(op3 == 2) {
System.out.println("\nNovo telefone: ");
busca.setFone(leitor.nextLine());
}else if(op3 == 3){
System.out.println("\nNovo e-mail: ");
busca.setEmail(leitor.nextLine());
}
if(op3 != 0)
{
dao.updateContato(busca, op3);
System.out.println("\nContato alterado com sucesso!");
}
}
break;
case 0: // sair
System.out.println("\nO sistema foi finalizado...");
break;
default:
System.out.println("\nATENÇÃO: opção inválida!");
break;
}
System.out.println();
} while (op != 0);
}
}
| [
"Aluno@DOSO121732.educacional.up"
] | Aluno@DOSO121732.educacional.up |
08414c83b470d2f72fc3c9a9f45ffbb874304cc7 | 6486a9a669a674de8992ea4ba803ac55180a4a87 | /src/main/java/se/swejug/squads/beans/Group.java | f8c1b8f634cb6e277ca7a73cd76132f43cc48662 | [] | no_license | swejug/squads | e50f769894412a2d334217eddafda62c8661f079 | 21056d88627b1b09b0f849ff3ea618c5c8dcd7c8 | refs/heads/master | 2021-01-01T17:48:12.263336 | 2013-02-20T22:45:15 | 2013-02-20T22:45:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 73 | java | package se.swejug.squads.beans;
public class Group extends Content {
}
| [
"github@swejug.se"
] | github@swejug.se |
d6e73ed7bfb352f0a4b76a13dc37b76479e9145d | 242b226b764876e476634a10e9541b3e18b80639 | /app/src/main/java/com/example/user/musicapp/Song.java | 3916a8a4ba3199a477e618f94a00f7045c516cc3 | [] | no_license | anionos/MusicApp | 48b89233c7bfdd792b45faedab4a0971bc7e7102 | ee8c7898b3b05c9244d5553df8996fc54fbbfb82 | refs/heads/master | 2020-03-28T12:27:52.442156 | 2018-09-13T13:25:29 | 2018-09-13T13:25:29 | 148,301,156 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,348 | java | package com.example.user.musicapp;
import org.parceler.Parcel;
import org.parceler.ParcelConstructor;
/**
* Created by user on 8/31/2018.
*/
@Parcel
public class Song {
/**
* {@link Song} represents a vocabulary word that the user wants to learn.
* It contains a default translation and a Miwok translation for that word.
*/
public String mArtistName;
/**
* Miwok translation for the word
*/
public String mSongName;
public int mImageResourceId;
public int mAudioResourceId;
@ParcelConstructor
public Song() {
}
public Song(String artistName, String songName, int imageResourceId, int audioResourceId) {
mArtistName = artistName;
mSongName = songName;
mImageResourceId = imageResourceId;
mAudioResourceId = audioResourceId;
}
/**
* Get the default translation of the word.
*/
public String getArtistName() {
return mArtistName;
}
/**
* Get the Miwok translation of the word.
*/
public String getSongName() {
return mSongName;
}
/**
* Get the the image Id.
*/
public int getmImageResourceId() {
return mImageResourceId;
}
/**
* Get the audio id.
*/
public int getmAudioResourceId() {
return mAudioResourceId;
}
}
| [
"aniebietonoyom32@gmail.com"
] | aniebietonoyom32@gmail.com |
47179fe39e78f5df257d2c1aefa580d77101d682 | 3ebf99be9df3844afccd753a01d5d13273e1f701 | /bukkit-plugins/WebSocket/src/main/java/com/github/minesquad/bukkit/websocket/errors/ChannelNotFoundErrorResponse.java | 16179be683559c1ede71660067a51298c96cd8ca | [] | no_license | minesquad/bukkitws | 28fbfab411d3416c8e3732177ce67e56bbaec640 | 7f60ef7035174445c3f0aebbc884baf5beab40bc | refs/heads/master | 2020-03-08T05:42:51.461680 | 2018-04-05T11:44:24 | 2018-04-05T11:44:24 | 127,954,514 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 492 | java | package com.github.minesquad.bukkit.websocket.errors;
import com.google.gson.JsonObject;
public class ChannelNotFoundErrorResponse extends ErrorResponse {
private String channel;
public ChannelNotFoundErrorResponse(String channel) {
this.channel = channel;
}
@Override
public JsonObject getMessage() {
JsonObject message = new JsonObject();
message.addProperty("error", "Channel `" + channel + "` not found");
return message;
}
}
| [
"a.kluev@php73.ru"
] | a.kluev@php73.ru |
4de93dcd6d4e97ecbba559b7284b94e9e57dd66b | 644d84071154a2c9467fcd365f6dafdf90a06c67 | /app/src/main/java/com/example/sharencare/ui/OnGoingTripDetails.java | efb33900192062177ff402201b935a405c8467e8 | [] | no_license | dpk196/ShareNcare | 47b7ac967c0b4ee56f067f25770a1b3509138e2a | 169ba2da546969c98aa544ce38aa093b912a4305 | refs/heads/master | 2022-12-16T09:35:36.283595 | 2020-09-05T12:40:39 | 2020-09-05T12:40:39 | 176,232,779 | 0 | 1 | null | 2020-09-05T12:40:41 | 2019-03-18T08:03:53 | Java | UTF-8 | Java | false | false | 7,644 | java | package com.example.sharencare.ui;
import android.location.Address;
import android.os.Handler;
import android.os.Looper;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import com.example.sharencare.Models.TripDetail;
import com.example.sharencare.R;
import com.example.sharencare.utils.StaticPoolClass;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.LatLngBounds;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.Polyline;
import com.google.android.gms.maps.model.PolylineOptions;
import com.google.maps.internal.PolylineEncoding;
import com.google.maps.model.DirectionsResult;
import com.google.maps.model.DirectionsRoute;
import java.util.ArrayList;
import java.util.List;
public class OnGoingTripDetails extends AppCompatActivity implements OnMapReadyCallback {
private static final String TAG = "OnGoingTripDetails";
private static final String MAPVIEW_BUNDLE_KEY = "MapViewBundleKey";
private MapView mMapView;
private GoogleMap mMap;
private TripDetail trip=StaticPoolClass.tripDetails;
private TextView tripDistance,tripDuration,tripFare;
private MarkerOptions markerSource;
private MarkerOptions markerDestination;
public static com.google.maps.model.LatLng startPoint;
public static com.google.maps.model.LatLng endPoint;
private LatLngBounds mLatLngBounds;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_on_going_trip_details);
Bundle mapViewBundle = null;
if (savedInstanceState != null) {
mapViewBundle = savedInstanceState.getBundle(MAPVIEW_BUNDLE_KEY);
}
mMapView = findViewById(R.id.on_going_trip_details_map);
mMapView.onCreate(mapViewBundle);
mMapView.getMapAsync(this);
try{
tripDistance=findViewById(R.id.trip_distance_tripDetialsDriver);
tripDuration=findViewById(R.id.trip_duration_tripDetialsDriver);
tripFare=findViewById(R.id.max_fare_value);
tripDistance.setText(StaticPoolClass.tripDetails.getTrip_distance());
tripDuration.setText(StaticPoolClass.tripDetails.getTrip_duration());
tripFare.setText("Rs"+" "+ StaticPoolClass.fare);
}catch(NullPointerException e){
Log.d(TAG, "onCreate: "+e.getMessage());
}
}
@Override
public void onMapReady(GoogleMap googleMap) {
mMap=googleMap;
getStartingEndingCoordinate(StaticPoolClass.directionsResultDriver);
setMapMarker();
setCameraView();
addPolylinesToMap(StaticPoolClass.directionsResultDriver);
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
Bundle mapViewBundle = outState.getBundle(MAPVIEW_BUNDLE_KEY);
if (mapViewBundle == null) {
mapViewBundle = new Bundle();
outState.putBundle(MAPVIEW_BUNDLE_KEY, mapViewBundle);
}
mMapView.onSaveInstanceState(mapViewBundle);
}
private void addPolylinesToMap(final DirectionsResult result) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
Log.d(TAG, "run: result routes: " + result.routes.length);
for (DirectionsRoute route : result.routes) {
Log.d(TAG, "run: leg: " + route.legs[0].toString());
List<com.google.maps.model.LatLng> decodedPath = PolylineEncoding.decode(route.overviewPolyline.getEncodedPath());
List<LatLng> newDecodedPath = new ArrayList<>();
// This loops through all the LatLng coordinates of ONE polyline.
for (com.google.maps.model.LatLng latLng : decodedPath) {
// Log.d(TAG, "run: latlng: " + latLng.toString());
newDecodedPath.add(new LatLng(
latLng.lat,
latLng.lng));
}
Polyline polyline = mMap.addPolyline(new PolylineOptions().addAll(newDecodedPath));
polyline.setColor(ContextCompat.getColor(getApplicationContext(), R.color.blue1));
polyline.setClickable(true);
break;
}
}
});
}
private void getStartingEndingCoordinate(final DirectionsResult result) {
for (DirectionsRoute route : result.routes) {
startPoint = route.legs[0].endLocation;
endPoint = route.legs[0].startLocation;
Log.d(TAG, "getStartingEndingCoordinate:Start:" + startPoint.toString());
Log.d(TAG, "getStartingEndingCoordinate: End:" + endPoint.toString());
Log.d(TAG, "getStartingEndingCoordinate: Start Adress and startLocation" + route.legs[0].startAddress + " location:" + route.legs[0].startLocation.toString());
Log.d(TAG, "getStartingEndingCoordinate: End: Adress and startLocation " + route.legs[0].endAddress + " location:" + route.legs[0].endLocation.toString());
double bottomBoundary = startPoint.lat - 0.1;
double leftBoundary = startPoint.lng - 0.1;
double topBoundary = endPoint.lat + 0.1;
double rightBoundary = endPoint.lng + 0.1;
mLatLngBounds = new LatLngBounds(new LatLng(bottomBoundary, leftBoundary), new LatLng(topBoundary, rightBoundary));
LatLng latlng_src = new LatLng(startPoint.lat, startPoint.lng);
LatLng latLng_dtn = new LatLng(endPoint.lat, endPoint.lng);
markerSource = new MarkerOptions().position(latlng_src).title(StaticPoolClass.tripDetails.getTrip_destination());
markerDestination = new MarkerOptions().position(latLng_dtn).title(StaticPoolClass.tripDetails.getTrip_source());
break;
}
}
private void setCameraView() {
//total view of the map
try {
mMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {
@Override
public void onMapLoaded() {
mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(mLatLngBounds, 10));
}
});
} catch (Exception e) {
Log.d(TAG, "setCameraView: " + e.getMessage());
}
}
@Override
protected void onResume() {
super.onResume();
mMapView.onResume();
}
@Override
protected void onStart() {
super.onStart();
mMapView.onStart();
}
@Override
protected void onStop() {
super.onStop();
mMapView.onStop();
}
@Override
protected void onPause() {
mMapView.onPause();
super.onPause();
}
@Override
protected void onDestroy() {
mMapView.onDestroy();
super.onDestroy();
}
@Override
public void onLowMemory() {
super.onLowMemory();
mMapView.onLowMemory();
}
private void setMapMarker() {
mMap.addMarker(markerDestination);
mMap.addMarker(markerSource);
}
}
| [
"deepakyadav1967@gmail.com"
] | deepakyadav1967@gmail.com |
5b7ba91f8b467cb6847b7904ceedec3d6c9685a9 | eca1e4b3e62a3dcf6e1ca8c633783b394c7b92c8 | /src/main/com/priyakshi/sumitchallenge/factorial/Main.java | 5c9dbd3fb691dee7715e53fd869863175ac55e77 | [] | no_license | erpriyakshi/JavaLearning2020_Basic | 33578cc5bda7152a6709e55b2f16fb2b19b69650 | 98115f2a602e4e683fd6bd05a8e905a60ab3bfe5 | refs/heads/master | 2023-01-02T10:45:14.232872 | 2020-09-21T17:54:22 | 2020-09-21T17:54:22 | 269,474,811 | 0 | 0 | null | 2020-06-12T19:52:49 | 2020-06-04T22:05:06 | Java | UTF-8 | Java | false | false | 671 | java | package com.priyakshi.sumitchallenge.factorial;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
FindFactorial findFactorial = new FindFactorial();
Scanner scanner = new Scanner(System.in);
// loop
System.out.println("Enter Number");
boolean isHasNext = scanner.hasNext();
if(isHasNext){
int number = scanner.nextInt();
double factorial = findFactorial.findFactorial(number);
System.out.println("Factorial is "+ factorial);
}
// Factorial is 2.6525285981219103E32 - Read about E in given representation and teach sumit
}
}
| [
"sumsingh1@publicisgroupe.net"
] | sumsingh1@publicisgroupe.net |
4c0b1d1119f8a43cb953520b4621996427c8f7e0 | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /devops-20210625/src/main/java/com/aliyun/devops20210625/models/ListHostGroupsResponse.java | 9de596b0e50e1a88981a194cc437e6fe9b2539bd | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 1,360 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.devops20210625.models;
import com.aliyun.tea.*;
public class ListHostGroupsResponse extends TeaModel {
@NameInMap("headers")
@Validation(required = true)
public java.util.Map<String, String> headers;
@NameInMap("statusCode")
@Validation(required = true)
public Integer statusCode;
@NameInMap("body")
@Validation(required = true)
public ListHostGroupsResponseBody body;
public static ListHostGroupsResponse build(java.util.Map<String, ?> map) throws Exception {
ListHostGroupsResponse self = new ListHostGroupsResponse();
return TeaModel.build(map, self);
}
public ListHostGroupsResponse setHeaders(java.util.Map<String, String> headers) {
this.headers = headers;
return this;
}
public java.util.Map<String, String> getHeaders() {
return this.headers;
}
public ListHostGroupsResponse setStatusCode(Integer statusCode) {
this.statusCode = statusCode;
return this;
}
public Integer getStatusCode() {
return this.statusCode;
}
public ListHostGroupsResponse setBody(ListHostGroupsResponseBody body) {
this.body = body;
return this;
}
public ListHostGroupsResponseBody getBody() {
return this.body;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
84045ea3ec638a0977d03db64745cd4dfc2f022b | e2cb2f624de130a8393e837eaa000f64b3266e58 | /src/baekjoon/backtracking/Num15649.java | d8370826e4315225bae4438bf19d90d1e2b59af8 | [] | no_license | thkim9373/AlgorithmCode | 566d8c19d675220f20e85842e7033841b145db8a | ae0fecfd09b7a20497b45bac955ec5d28ff73651 | refs/heads/master | 2020-11-28T09:18:23.605884 | 2020-03-28T14:56:24 | 2020-03-28T14:56:24 | 229,768,178 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,486 | java | package baekjoon.backtracking;
import java.io.*;
import java.util.StringTokenizer;
// N과 M (1)
// https://www.acmicpc.net/problem/15649
public class Num15649 {
private static StringBuilder builder = new StringBuilder();
private static int n, m;
private static boolean[] visited;
private static int[] result;
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
n = Integer.parseInt(tokenizer.nextToken());
m = Integer.parseInt(tokenizer.nextToken());
visited = new boolean[n];
result = new int[m];
getCombination(0);
writer.write(builder.toString());
reader.close();
writer.close();
}
private static void getCombination(int apply) {
if (apply < m) {
for (int i = 0; i < n; i++) {
if (!visited[i]) {
visited[i] = true;
result[apply] = i;
getCombination(apply + 1);
visited[i] = false;
}
}
} else if (apply == m) {
for (int value : result) {
builder.append(value + 1).append(" ");
}
builder.append("\n");
}
}
}
| [
"thkim9373@gmail.com"
] | thkim9373@gmail.com |
59a9b2fb319d27e78a9a50dc1c11bc8879413ba1 | 41db913e9df0d55af2c3ed47f61e4d4659e81d38 | /src/main/java/cn/ccb/pattern/creational/abstractfactory/JavaVideo.java | e4a706547f46c3a46e8fb5de3e2aa65cd862bd58 | [] | no_license | 2568808909/desgin_pattern | 522df720066b8e3c8d4a00b7aff762a45f1a8cb6 | 9bb56e1a77cd8e94fc851c44bdd9d64ddda17e7d | refs/heads/master | 2020-07-26T09:06:32.255446 | 2020-06-21T13:05:50 | 2020-06-21T13:05:50 | 208,598,592 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 175 | java | package cn.ccb.pattern.creational.abstractfactory;
public class JavaVideo extends Video {
public void produce() {
System.out.println("录制java视频");
}
}
| [
"2568808909@qq.com"
] | 2568808909@qq.com |
a2eefb94abad7197475caca92c69f0013350f9a4 | 67579cb19807229c216849627f9ea4a643f4cb19 | /Lectures/jpasec2/src/edu/neu/cs5200/ide/jpa/simple/StudentDAO.java | c16c26cad0814e64ec0f377887abd088d36293eb | [] | no_license | viveks91/Restaurant-reservation | 3a9b3d4c765e5845df62efe58a94ca6e50825265 | fee93fe022155f48ae582fda71ff547436dd6a7c | refs/heads/master | 2016-09-06T11:56:07.815619 | 2014-12-12T01:00:39 | 2014-12-12T01:00:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,062 | java | package edu.neu.cs5200.ide.jpa.simple;
import java.util.Date;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
public class StudentDAO {
EntityManagerFactory factory = Persistence.createEntityManagerFactory("jpasec2");
EntityManager em = null;
public StudentDAO() {
em = factory.createEntityManager();
}
public Student createStudent(Student student) {
em.getTransaction().begin();
em.persist(student);
em.getTransaction().commit();
return student;
}
public Student findById(int id) {
em.getTransaction().begin();
Student student = em.find(Student.class, id);
em.getTransaction().commit();
return student;
}
// public Student findByName(String name) {
public List<Student> findByName(String name) {
em.getTransaction().begin();
Query q = em.createQuery("select s from Student s where s.name = :name");
q.setParameter("name", name);
// Student student = (Student) q.getSingleResult();
List<Student> students = q.getResultList();
em.getTransaction().commit();
// return student;
return students;
}
public List<Student> findByNameUsingNamedQuery(String name) {
em.getTransaction().begin();
Query q = em.createNamedQuery("Student.findStudentById");
q.setParameter("name", name);
List<Student> students = q.getResultList();
em.getTransaction().commit();
return students;
}
public List<Student> findAll() {
em.getTransaction().begin();
Query q = em.createNamedQuery("Student.findAll");
List<Student> students = q.getResultList();
em.getTransaction().commit();
return students;
}
public void removeStudentById(int id) {
em.getTransaction().begin();
Student student = em.find(Student.class, id);
em.remove(student);
em.getTransaction().commit();
}
public Student updateStudentNameById(int id, String newName) {
em.getTransaction().begin();
Student student = em.find(Student.class, id);
student.setName(newName);
em.merge(student);
em.getTransaction().commit();
return student;
}
public static void main(String[] args) {
StudentDAO dao = new StudentDAO();
Student s1 = new Student(321, "Dan", new Date());
s1 = dao.createStudent(s1);
System.out.println(s1.getId());
Student s2 = dao.findById(1);
System.out.println(s2);
Student s3 = dao.updateStudentNameById(1, "Greg");
System.out.println(s3);
Student sa = new Student(321, "Greg", new Date());
Student sb = new Student(321, "Greg", new Date());
Student sc = new Student(321, "Charlie", new Date());
Student sd = new Student(321, "Stephen", new Date());
dao.createStudent(sa);
dao.createStudent(sb);
dao.createStudent(sc);
dao.createStudent(sd);
// Student s4 = dao.findByName("Greg");
// List<Student> s4 = dao.findByName("Greg");
List<Student> s4 = dao.findByNameUsingNamedQuery("Greg");
System.out.println(s4);
List<Student> all = dao.findAll();
System.out.println(all);
// dao.removeStudentById(1);
}
}
| [
"s.vivekananda007@gmail.com"
] | s.vivekananda007@gmail.com |
3141598dd5279f98ebb54159d9a9b4cc773d0069 | 37aa8c4b8328d9587aa4b06c481b624156bc6766 | /src/main/java/com/ifmo/epampractice/service/QuestionsService.java | d8792f9abc4da627bb8cc1e44f2af0b123e04a79 | [
"MIT"
] | permissive | java-practice-spb-2020/epam-ifmo-java-practice-2020-1 | 365be6bb9a2f030518c48cb9be78d5755a9e02a8 | 99ad42cd8b03b26d2312793520d969eeb9f6bad6 | refs/heads/develop | 2020-12-29T07:47:33.699914 | 2020-02-27T15:36:48 | 2020-02-27T15:36:48 | 238,520,775 | 0 | 2 | null | 2020-02-28T11:31:25 | 2020-02-05T18:32:28 | Java | UTF-8 | Java | false | false | 2,866 | java | package com.ifmo.epampractice.service;
import com.ifmo.epampractice.dao.QuestionsDAO;
import com.ifmo.epampractice.entity.Questions;
import java.util.List;
public class QuestionsService {
private static final QuestionsDAO QUESTIONS_DAO = new QuestionsDAO();
private static final TestsService TESTS_SERVICE = new TestsService();
private static final AnswersService ANSWERS_SERVICE = new AnswersService();
public Questions addObject(final Questions question) {
if (TESTS_SERVICE.ifTestObjectExist(question.getTestId())) {
System.err.println("This test doesn't exist");
throw new IllegalArgumentException("This object doesn't exist");
}
return QUESTIONS_DAO.addObject(question);
}
public List<Questions> getAll() {
return QUESTIONS_DAO.getAll();
}
public List<Questions> getQuestionsListByTestId(final int testId) {
List<Questions> questionsList;
if (TESTS_SERVICE.ifTestObjectExist(testId)) {
System.err.println("This test doesn't exist");
throw new IllegalArgumentException("This object doesn't exist");
}
questionsList = QUESTIONS_DAO.getQuestionsListByTestId(testId);
return questionsList;
}
public Questions getById(final int questionId) {
return QUESTIONS_DAO.getById(questionId).orElseThrow(() ->
new IllegalArgumentException("This object doesn't exist"));
}
public void updateByObject(final Questions question) {
if (TESTS_SERVICE.ifTestObjectExist(question.getTestId())) {
System.err.println("This test doesn't exist");
throw new IllegalArgumentException("This object doesn't exist");
}
QUESTIONS_DAO.updateByObject(question);
}
public void removeById(final int questionId) {
QUESTIONS_DAO.getById(questionId).orElseThrow(() ->
new IllegalArgumentException("This object doesn't exist"));
QUESTIONS_DAO.removeById(questionId);
}
public List<Questions> getQuestionsWithAnswersListByTestId(final int testId) {
List<Questions> questionsList;
Questions question = new Questions();
if (TESTS_SERVICE.ifTestObjectExist(question.getTestId())) {
System.err.println("This test doesn't exist");
throw new IllegalArgumentException("This object doesn't exist");
}
questionsList = QUESTIONS_DAO.getQuestionsListByTestId(testId);
for (Questions quest : questionsList) {
quest.setAnswersList(ANSWERS_SERVICE.getAnswersListByQuestionId(quest.getTestId()));
}
return questionsList;
}
public Boolean ifQuestionObjectExist(final int id) {
if (QUESTIONS_DAO.getById(id).isPresent()) {
return Boolean.TRUE;
}
return Boolean.FALSE;
}
}
| [
"A970b71c94d"
] | A970b71c94d |
e8067902dee037f4d5fa427c0211647af634f678 | 81fe6bf5282d7a60fda43863815e62113e6d4ea8 | /algoritmo6/src/main/java/br/ufg/inf/es/construcao/algoritmo6/Algoritmo6.java | c13e112c2fccf5cce1e029a53c8799a108c1cb48 | [] | no_license | erickriger/CS2015-Algoritmos | 22a3c02136c8c7848cb8bf8ca31b0e80cfb7cdf7 | 895e520f830267d3a39701687f770dccb556ad37 | refs/heads/master | 2021-01-10T12:37:16.685360 | 2015-11-13T01:09:19 | 2015-11-13T01:09:19 | 45,276,011 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,274 | java | package br.ufg.inf.es.construcao.algoritmo6;
import br.ufg.inf.es.construcao.algoritmo4.Algoritmo4;
/**
* Potenciacao atraves de soma.
*
* @author eric
*/
public class Algoritmo6 {
/**
* Calcula a potencia atraves da utilizacao do metodo produto, do
* Algoritmo4. O metodo produto, por sua vez, utiliza somas para realizar a
* multiplicacao. Sendo assim, a potenciacao e calculada, indiretamente,
* atraves de soma.
*
* @param base Base, deve ser maior que zero.
* @param expoente Expoente, deve ser maior ou igual a um.
* @return O resultado da potenciacao.
* @throws IllegalArgumentException Se algum dos parametros for invalido.
* @see Algoritmo4
*/
public static int potenciaSoma(int base, int expoente) {
if (base <= 0) {
throw new IllegalArgumentException("A base deve ser "
+ "maior que zero.");
}
if (expoente < 1) {
throw new IllegalArgumentException("O expoente deve ser "
+ "maior ou igual a 1.");
}
int i = 1;
int produto = base;
while (i < expoente) {
produto = Algoritmo4.produto(produto, base);
i++;
}
return produto;
}
}
| [
"erickriger@gmail.com"
] | erickriger@gmail.com |
e751d7b2a7367a1620fcd657b7ecde1e9c7d5b51 | 45308e2235fb26e92a0f137df56de98af7e131d5 | /src/proxy/Ebook.java | 6af72af109ef7f3c5eb8dd3771fcf1f3d57aacbf | [] | no_license | nguyenphucthienan/ultimate-design-patterns | 1e8900084eb81dd27ace1297cbd387b310d45d76 | e5029cc087ea2644d0865329330a4593d82d681d | refs/heads/master | 2022-11-07T09:21:13.047946 | 2020-06-19T16:14:38 | 2020-06-19T16:14:38 | 273,383,936 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 88 | java | package proxy;
public interface Ebook {
void show();
String getFileName();
}
| [
"npta97@gmail.com"
] | npta97@gmail.com |
081fe1a9738419fd967cba64ff7486df7779fd1b | 8692972314994b8923b6f12b7ae9e76b30a36391 | /memory_managment/ClassesList/src/Class156.java | e66a77d432e33723cdbfe3f70dab93cfb7e23055 | [] | no_license | Petrash-Samoilenka/2017W-D2D3-ST-Petrash-Samoilenka | d2cd65c1d10bec3c4d1b69b124d4f0aeef1d7308 | 214fbb3682ef6714514af86cc9eaca62f02993e1 | refs/heads/master | 2020-05-27T15:04:52.163194 | 2017-06-16T14:19:38 | 2017-06-16T14:19:38 | 82,560,968 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,746 | java | public class Class156 extends Class1 {
private String _s1;
private String _s2;
private String _s3;
private String _s4;
private String _s5;
private String _s6;
private String _s7;
private String _s8;
public Class156() {
}
public void getValue1(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue2(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue3(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue4(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue5(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue6(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue7(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue8(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue9(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue10(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue11(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue12(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue13(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue14(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue15(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue16(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue17(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue18(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue19(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
public void getValue20(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) {
_s1 = s1;
_s2 = s2;
_s3 = s3;
_s4 = s4;
}
}
| [
"rn.samoylenko@gmail.com"
] | rn.samoylenko@gmail.com |
636f91d5d8a9fe39b8f24f84f00ffffee3c26430 | 84d756df14b35360d9b73da376a5595353ddff18 | /src/by/it/kleban/lesson05/TaskA1.java | 3151861113762787b6be39c3e00e211c89e2a712 | [] | no_license | userpvt/cs2018-06-19 | 877f406773abe93ca85ce54f8babdeb49df872b3 | dedb0f582e807f1eca2cd0f917e4203bbc7f14ef | refs/heads/master | 2020-03-26T09:05:17.935310 | 2018-07-02T12:08:35 | 2018-07-02T12:08:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 986 | java | package by.it.kleban.lesson05;
/* Массив из чисел в обратном порядке
1. Создать массив на 10 чисел.
2. Ввести с клавиатуры 10 целых чисел и записать их в массив.
3. Расположить элементы массива в обратном порядке.
4. Вывести результат на экран, каждое значение выводить с новой строки.
Например, для такого ввода
1 2 3 4 5 6 7 8 9 0
вывод ожидается такой
0
9
8
7
6
5
4
3
2
1
*/
import java.util.Scanner;
public class TaskA1 {
public static void main (String [] arg) {
Scanner sc = new Scanner(System.in);
int[] arr = new int[10];
for (int i = arr.length-1; i >=0 ; i--)
{
arr[i] = sc.nextInt();
}
for (int element : arr) {
System.out.println(element);
}
}
}
| [
"anastasia.kleban@gmail.com"
] | anastasia.kleban@gmail.com |
b23e001037ecd2082a89f2c335ee46f55619301c | e54bb34b9ecd2841082f99d679ec36818a7bb5b0 | /MindlinerClassLib/src/com/mindliner/contentfilter/evaluator/ConfidentialityEvaluator.java | f459631fe5c5a0ec3c753ec0e59c17e80136faaf | [] | no_license | mindliner/mindliner | 6e4f2c16349c59aaf54351e47c6bc23451700711 | 92b3daefb002e77c9922ead62c24b9b41b62a12f | refs/heads/master | 2021-03-27T14:28:37.040304 | 2018-02-28T09:27:38 | 2018-02-28T09:27:38 | 123,269,905 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,109 | java | /*
* ConfidentialityEvaluator.java
*
* Created on 19.06.2007, 21:58:36
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package com.mindliner.contentfilter.evaluator;
import com.mindliner.categories.mlsConfidentiality;
import com.mindliner.contentfilter.ObjectEvaluator;
import com.mindliner.entities.mlsObject;
import com.mindliner.entities.mlsUser;
import java.io.Serializable;
import java.util.Map;
/**
* This class evaluates objects based on their confidentiality settings.
*
* @author Marius Messerli
*/
public class ConfidentialityEvaluator implements ObjectEvaluator, Serializable {
private Map<Integer, mlsConfidentiality> highestAllowedConfidentiality;
private mlsUser currentUser = null;
/**
*
* @param highestAllowedConfidentiality A map with clients ids as keys and
* confidentialities as values to ensure that no objects with higher confi
* are found
* @param u The user for which the objects are to be filtered
*/
public ConfidentialityEvaluator(Map<Integer, mlsConfidentiality> highestAllowedConfidentiality, mlsUser u) {
this.highestAllowedConfidentiality = highestAllowedConfidentiality;
currentUser = u;
}
@Override
public boolean passesEvaluation(mlsObject o) {
if (o == null) {
return false;
}
// if we have a cap for the object's client then check, otherwise let pass
mlsConfidentiality maxConf = highestAllowedConfidentiality == null ? null : highestAllowedConfidentiality.get(o.getClient().getId());
if (maxConf == null) {
maxConf = currentUser.getMaxConfidentiality(o.getClient());
}
if (maxConf == null) {
throw new IllegalStateException("ConfidentialityEvaluator: Cannot determine confidentiality ceiling.");
}
return maxConf.compareTo(o.getConfidentiality()) >= 0;
}
@Override
public boolean isMultipleInstancesAllowed() {
return false;
}
private static final long serialVersionUID = 19640205L;
}
| [
"marius.messerli@mindliner.com"
] | marius.messerli@mindliner.com |
5fdb8cb7874a5025037de27a7aaa74e58130d650 | dbc266fb819b334bb5cf24064fb152eaa35c87b6 | /app/src/main/java/com/praktikum/prak5_mvp_room/database/dao/PersonDao.java | 21a23ea87c87b8a859333a2a5555caedf102aa1c | [] | no_license | fitra-jibjaya/PrakMobileP3 | d7a9f5fc0bcb2c1c34607c210538f16591dda587 | d576e38d26f86aa3e963aa7c28a6905adfdbbca7 | refs/heads/master | 2023-03-29T21:39:32.226765 | 2021-04-02T09:55:40 | 2021-04-02T09:55:40 | 353,977,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 844 | java | package com.praktikum.prak5_mvp_room.database.dao;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import com.praktikum.prak5_mvp_room.database.entity.Person;
import java.util.List;
@Dao
public interface PersonDao {
// Di interface ini berisi query-query untuk mengakses entitas yang telah kita isi sebelumnya
// Ini adalah query-query yang otomatis tersedia dari library dari room database
@Insert
void insertPerson(Person person);
@Update
void update(Person person);
@Delete
void delete(Person person);
// Ini adalah query manual yang kita definisikan sendiri
@Query("SELECT * FROM person")
List<Person> getAll();
@Query("SELECT * FROM person WHERE id=:id")
Person finPerson(long id);
}
| [
"hackerlampung444@gmail.com"
] | hackerlampung444@gmail.com |
39864829e8672a911303113436eeae9725c31fb8 | 7c31053c98962d5405b5be629f528c03d12fc256 | /common/net/minecraftforge/inventory/IStackFilter.java | 4c2983ed0c97056e01c0a7ac494f16528d2899a0 | [] | no_license | immibis/MinecraftForge | 6f950179617f5f38eea907263160a0f5658c724c | ab7f9bef46b9709472bd338115860688bcc48da1 | refs/heads/master | 2021-01-17T22:33:26.947373 | 2013-02-26T09:29:08 | 2013-02-26T09:29:08 | 8,178,403 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 625 | java | package net.minecraftforge.inventory;
import net.minecraft.item.ItemStack;
public interface IStackFilter {
/**
* Returns true if the given item matches this filter. The stack size is
* ignored.
*
* @param item
* The item to match.
* @return True if the item matches the filter.
*/
boolean matchesItem(ItemStack item);
/**
* A default filter that matches any item.
*/
static final IStackFilter MATCH_ANY = new IStackFilter() {
@Override
public boolean matchesItem(ItemStack item)
{
return true;
}
};
}
| [
"immibis@gmail.com"
] | immibis@gmail.com |
7b907e3d2654471b8e5742fc6db67c08f1b2c760 | 26f04b87f6db47e918641f4b4751f5a63cf7d60e | /MyMDApp/src/com/example/activities/DiaryListActivity.java | 3f00e3fba67ead479160c958edfe2229564c0d7a | [] | no_license | mengxiankui/MyMDApp | fc32ba63df3c8f6ef4f075029a115b1cf15a2c00 | ec0ad0a808548b433dc9989e0aa0a6fcf7990814 | refs/heads/master | 2021-01-19T03:41:18.797437 | 2017-08-24T09:21:33 | 2017-08-24T09:21:33 | 49,555,542 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,616 | java | package com.example.activities;
import android.app.AlertDialog;
import android.app.FragmentTransaction;
import android.app.LoaderManager.LoaderCallbacks;
import android.content.ContentUris;
import android.content.Context;
import android.content.CursorLoader;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.Loader;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.CursorAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemLongClickListener;
import butterknife.Bind;
import butterknife.ButterKnife;
import com.example.mymdapp.R;
import com.example.util.Consts.DiaryConst;
import com.example.util.TimeUtil;
import com.mxk.baseapplication.LBaseActivity;
public class DiaryListActivity extends LBaseActivity implements LoaderCallbacks<Cursor>{
@Bind(R.id.diary_list)
ListView listDiary;
@Bind(R.id.btn_create_new)
Button btnCreate;
MyCursorAdapter mAdapter;
@Override
public int getContentView() {
// TODO Auto-generated method stub
return R.layout.activity_diary_list;
}
@Override
public void setToolBar(Toolbar mToolbar) {
// TODO Auto-generated method stub
mToolbar.setTitle("日记本");
}
@Override
public void onAfterOnCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
ButterKnife.bind(this);
setupToolBar();
init();
initAction();
}
private void initAction() {
// TODO Auto-generated method stub
listDiary.setOnItemLongClickListener(new OnItemLongClickListener()
{
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view,
int position, long id)
{
// TODO Auto-generated method stub
Intent intent = new Intent(DiaryListActivity.this, DiaryActivity.class);
Bundle bundle = new Bundle();
Cursor cursor = (Cursor) parent.getAdapter().getItem(position);
bundle.putString(DiaryConst.TID,
cursor.getString(cursor.getColumnIndex(DiaryConst.TID)));
bundle.putString(DiaryConst.TITLE,
cursor.getString(cursor.getColumnIndex(DiaryConst.TITLE)));
bundle.putString(DiaryConst.CONTENT,
cursor.getString(cursor.getColumnIndex(DiaryConst.CONTENT)));
bundle.putString(DiaryConst.DIARY_TYPE, DiaryConst.TYPE_EDIT);
intent.putExtras(bundle);
startActivity(intent);
return true;
}
});
btnCreate.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
// TODO Auto-generated method stub
Intent intent = new Intent(DiaryListActivity.this, DiaryActivity.class);
Bundle bundle = new Bundle();
bundle.putString(DiaryConst.DIARY_TYPE, DiaryConst.TYPE_NEW);
intent.putExtras(bundle);
startActivity(intent);
}
});
}
private void init() {
// TODO Auto-generated method stub
mAdapter = new MyCursorAdapter(this, null);
listDiary.setAdapter(mAdapter);
getLoaderManager().initLoader(0, null, this);
}
private void setupToolBar() {
// TODO Auto-generated method stub
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getToolBar().setNavigationOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
onBackPressed();
}
});
}
public class MyCursorAdapter extends CursorAdapter
{
public MyCursorAdapter(Context context, Cursor c)
{
super(context, c);
// TODO Auto-generated constructor stub
}
public MyCursorAdapter(Context context, Cursor c, boolean autoRequery)
{
super(context, c, autoRequery);
// TODO Auto-generated constructor stub
}
public MyCursorAdapter(Context context, Cursor c, int flags)
{
super(context, c, flags);
// TODO Auto-generated constructor stub
}
@Override
public View newView(Context context, final Cursor cursor, ViewGroup parent)
{
// TODO Auto-generated method stub
View view = LayoutInflater.from(DiaryListActivity.this).inflate(
R.layout.diary_listitem, null);
ViewHolder holder = new ViewHolder();
holder.txtTitle = (TextView) view.findViewById(R.id.title);
holder.txtDate = (TextView) view.findViewById(R.id.date);
holder.btnDelete = (Button) view.findViewById(R.id.delete);
view.setTag(holder);
bindView(view, context, cursor);
return view;
}
@Override
public void bindView(View view, Context context, final Cursor cursor)
{
// TODO Auto-generated method stub
ViewHolder holder = (ViewHolder) view.getTag();
String strTitle = cursor.getString(cursor.getColumnIndex(DiaryConst.TITLE));
if (TextUtils.isEmpty(strTitle))
{
holder.txtTitle.setText("未命名");
}
else
{
holder.txtTitle.setText(strTitle);
}
Long lmilliseconds = cursor.getLong(cursor.getColumnIndex(DiaryConst.DATE));
holder.txtDate.setText(TimeUtil.getDateFormat(lmilliseconds));
final long lId = cursor.getLong(cursor.getColumnIndex(DiaryConst.TID));
holder.btnDelete.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
// TODO Auto-generated method stub
new AlertDialog.Builder(DiaryListActivity.this)
.setMessage(R.string.alert_delete)
.setPositiveButton("确定",
new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
// TODO Auto-generated method stub
DiaryListActivity.this.getContentResolver().delete(
ContentUris.withAppendedId(
DiaryConst.CONTENT_URI, lId),
null, null);
}
})
.setNegativeButton("取消",
new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
// TODO Auto-generated method stub
}
}).create().show();
}
});
}
}
public class ViewHolder
{
private TextView txtTitle;
private TextView txtDate;
private Button btnDelete;
}
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args)
{
// TODO Auto-generated method stub
return new CursorLoader(this, DiaryConst.CONTENT_URI, null, null, null,
DiaryConst.ORDER_DATE_DESC);
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data)
{
// TODO Auto-generated method stub
mAdapter.swapCursor(data);
}
@Override
public void onLoaderReset(Loader<Cursor> loader)
{
// TODO Auto-generated method stub
mAdapter.swapCursor(null);
}
}
| [
"xiankuimeng@pateo.com.cn"
] | xiankuimeng@pateo.com.cn |
dea4ab3babe46052957750e0be47eb721b47eb22 | f78d8109f433faf0016da10506b12c7f70e00952 | /src/main/java/com/base/MultipleDataSource.java | 25212948f92ce53d1a85b76df5a6b34898b087b1 | [] | no_license | gaoqiongxie/order | 1d4abeb04c2def25ce18c20c320f834664c520b8 | 0d4b527202c36d98f2b9ba1a591741236628cc4d | refs/heads/master | 2020-12-15T05:21:49.030736 | 2020-07-22T03:01:14 | 2020-07-22T03:01:14 | 235,005,472 | 0 | 0 | null | 2020-01-20T05:18:42 | 2020-01-20T02:43:50 | Java | UTF-8 | Java | false | false | 801 | java | package com.base;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
/**
* 多数据源配置类
*
* @author xiegaoqiong
*
*/
public class MultipleDataSource extends AbstractRoutingDataSource {
private static final ThreadLocal<String> dataSourceHolder = new ThreadLocal<String>();
/**
* 设置数据源
* @param dataSource 数据源名称
*/
public static void setDataSource(String dataSource) {
dataSourceHolder.set(dataSource);
}
/**
* 获取数据源
* @return
*/
public static String getDatasource() {
return dataSourceHolder.get();
}
/**
* 清除数据源
*/
public static void clearDataSource() {
dataSourceHolder.remove();
}
@Override
protected Object determineCurrentLookupKey() {
return dataSourceHolder.get();
}
}
| [
"15262016002@163.com"
] | 15262016002@163.com |
002673b05e5a240eda54569a5d19008cc99e0639 | b34654bd96750be62556ed368ef4db1043521ff2 | /cockpit_facade_util/branches/bugr_r3/src/java/tests/com/topcoder/service/util/UnitTests.java | 3f99a7fab617b2f8f87d916e3ec5fb747ed3f2ba | [] | no_license | topcoder-platform/tcs-cronos | 81fed1e4f19ef60cdc5e5632084695d67275c415 | c4ad087bb56bdaa19f9890e6580fcc5a3121b6c6 | refs/heads/master | 2023-08-03T22:21:52.216762 | 2019-03-19T08:53:31 | 2019-03-19T08:53:31 | 89,589,444 | 0 | 1 | null | 2019-03-19T08:53:32 | 2017-04-27T11:19:01 | null | UTF-8 | Java | false | false | 683 | java | /*
* Copyright (C) 2010 TopCoder Inc., All Rights Reserved.
*/
package com.topcoder.service.util;
import com.topcoder.service.util.gameplan.SoftwareProjectDataTests;
import com.topcoder.service.util.gameplan.StudioProjectDataTests;
import com.topcoder.service.util.gameplan.TCDirectProjectGamePlanDataTests;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
/**
* <p>This test case aggregates all Unit test cases.</p>
*
* @author FireIce
* @version 1.0
*/
@RunWith(Suite.class)
@Suite.SuiteClasses(
{SoftwareProjectDataTests.class, StudioProjectDataTests.class, TCDirectProjectGamePlanDataTests.class })
public class UnitTests {
} | [
"mashannon168@fb370eea-3af6-4597-97f7-f7400a59c12a"
] | mashannon168@fb370eea-3af6-4597-97f7-f7400a59c12a |
9772966df58d5b31810448ae0075b1467be77041 | 5ce98124cef0f4d70d6afb628554154e2dd85224 | /src/main/java/it/arlanis/reply/models/Campaign.java | 137abc893de86e31f0987fd05e2ce8d54a561e60 | [] | no_license | onofujoHawk/vodafone-bonifica-catalogue | e8f0deb303b6a53e219c5343f245e7879ac3f065 | 346f87dfc09a9e46c301adfe0f9bc2dac156ae09 | refs/heads/master | 2021-01-01T16:54:33.483627 | 2017-07-27T15:24:09 | 2017-07-27T15:24:09 | 97,951,480 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,708 | java | package it.arlanis.reply.models;
import it.arlanis.reply.models.enums.CampaignState;
import it.arlanis.reply.models.enums.CampaignType;
import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@Entity
@Table(name = "campaign")
public class Campaign extends AbstractEagleCatalogueObject implements Serializable {
public static final String CODE_PREFIX = "camp-";
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "campaign_id")
private Long campaignId;
public Long getId() {
return campaignId;
}
@Column(name = "code", unique = true)
private String code;
@Column(name = "name")
private String name;
@Column(name = "description")
private String description;
@Column(name = "type")
@Enumerated(value = EnumType.STRING)
private CampaignType type;
@Column(name = "state")
@Enumerated(value = EnumType.STRING)
private CampaignState state;
@ManyToMany
@JoinTable(name = "campaign_channel_relation", joinColumns = @JoinColumn(name = "campaign", referencedColumnName = "campaign_id"), inverseJoinColumns = @JoinColumn(name = "channel", referencedColumnName = "channel_id"))
private List<Channel> channels = new ArrayList<Channel>();
@OneToMany(mappedBy = "campaign")
private List<EnabledUser> enabledUsers = new ArrayList<EnabledUser>();
@Column(name = "convergenza")
private Boolean convergenza;
@Column(name = "start_date")
private Date startDate;
@Column(name = "end_date")
private Date endDate;
@OneToMany(mappedBy = "campaign")
@Column(nullable = true)
private List<OfferInCampaign> offersInCampaign = new ArrayList<OfferInCampaign>();
public Long getCampaignId() {
return campaignId;
}
public void setCampaignId(Long campaignId) {
this.campaignId = campaignId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public CampaignType getType() {
return type;
}
public void setType(CampaignType type) {
this.type = type;
}
public List<Channel> getChannels() {
return channels;
}
public void setChannel(List<Channel> channels) {
this.channels = channels;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
if (endDate == null) {
this.endDate = null;
return;
}
Calendar date = Calendar.getInstance();
date.setTime(endDate);
date.set(Calendar.HOUR_OF_DAY, 23);
date.set(Calendar.MINUTE, 59);
date.set(Calendar.SECOND, 59);
this.endDate = date.getTime();
}
public List<OfferInCampaign> getOffersInCampaign() {
return offersInCampaign;
}
public void setOffersInCampaign(List<OfferInCampaign> offersInCampaign) {
this.offersInCampaign = offersInCampaign;
}
public Boolean getConvergenza() {
return convergenza;
}
public void setConvergenza(Boolean convergenza) {
this.convergenza = convergenza;
}
public CampaignState getState() {
return state;
}
public void setState(CampaignState state) {
this.state = state;
}
public List<EnabledUser> getEnabledUsers() {
return enabledUsers;
}
public void setEnabledUsers(List<EnabledUser> enabledUsers) {
this.enabledUsers = enabledUsers;
}
public void setChannels(List<Channel> channels) {
this.channels = channels;
}
}
| [
"f.onofrio@reply.it"
] | f.onofrio@reply.it |
0ebeff87c5cdbc479aaaa59c3bd11029a15e8d25 | 4817a306c3b76af1ccb3cd33f2dfe78c4085dc25 | /src/main/java/com/lyl/concurrency/ConcurrencyApplication.java | 7f911f4bdd5e3e72b8ef99f6e1c61585b4b33b49 | [] | no_license | LYL41011/java-concurrency-learning | 36c0206e08f977ea4d40848b118bbbc21d9cb35a | c8ec72d63e7830ecb57fa9eefe5effd0376a1537 | refs/heads/master | 2022-10-18T20:44:11.197037 | 2020-06-06T10:13:54 | 2020-06-06T10:13:54 | 262,068,409 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,040 | java | package com.lyl.concurrency;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@SpringBootApplication
public class ConcurrencyApplication extends WebMvcConfigurerAdapter{
public static void main(String[] args) {
SpringApplication.run(ConcurrencyApplication.class, args);
}
@Bean
public FilterRegistrationBean httpFilter() {
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(new HttpFilter());
registrationBean.addUrlPatterns("/threadLocal/*");
return registrationBean;
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new HttpInterceptor()).addPathPatterns("/**");
}
}
| [
"562373081@qq.com"
] | 562373081@qq.com |
2e1fde25d356870e34924729f5bbfee69a07eae4 | df5b2dbb1466417322a108d27a625b9673861eed | /src/java/service/FurnitureentityFacadeREST.java | a8cce0e99bcfd5bd7ec8aa1bded366e26c843986 | [] | no_license | IS3102-07/IS3102_MobileWS | f35a75fbfa4fc707c7e4f51824b4b2fbc63403bb | 0dc30e377a210a1f6e80873f7298f16d8f8e8baf | refs/heads/master | 2021-01-01T06:33:49.893639 | 2015-03-27T04:14:18 | 2015-03-27T04:14:18 | 25,724,331 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,226 | 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 service;
import Entity.Furnitureentity;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
/**
*
* @author Jason
*/
@Stateless
@Path("entity.furnitureentity")
public class FurnitureentityFacadeREST extends AbstractFacade<Furnitureentity> {
@PersistenceContext(unitName = "WebService_MobilePU")
private EntityManager em;
public FurnitureentityFacadeREST() {
super(Furnitureentity.class);
}
@POST
@Override
@Consumes({"application/xml", "application/json"})
public void create(Furnitureentity entity) {
super.create(entity);
}
@PUT
@Path("{id}")
@Consumes({"application/xml", "application/json"})
public void edit(@PathParam("id") Long id, Furnitureentity entity) {
super.edit(entity);
}
@DELETE
@Path("{id}")
public void remove(@PathParam("id") Long id) {
super.remove(super.find(id));
}
@GET
@Path("{id}")
@Produces({"application/xml", "application/json"})
public Furnitureentity find(@PathParam("id") Long id) {
return super.find(id);
}
@GET
@Override
@Produces({"application/xml", "application/json"})
public List<Furnitureentity> findAll() {
return super.findAll();
}
@GET
@Path("{from}/{to}")
@Produces({"application/xml", "application/json"})
public List<Furnitureentity> findRange(@PathParam("from") Integer from, @PathParam("to") Integer to) {
return super.findRange(new int[]{from, to});
}
@GET
@Path("count")
@Produces("text/plain")
public String countREST() {
return String.valueOf(super.count());
}
@Override
protected EntityManager getEntityManager() {
return em;
}
}
| [
"simmengkiat@gmail.com"
] | simmengkiat@gmail.com |
ecb1e4001ca78ed9cbec8501109552ebc569c057 | 10378c580b62125a184f74f595d2c37be90a5769 | /org/apache/commons/lang3/concurrent/ConcurrentUtils.java | 97185d17a6ff075a1a147f4a5e22d0a6fb20e833 | [] | no_license | ClientPlayground/Melon-Client | 4299d7f3e8f2446ae9f225c0d7fcc770d4d48ecb | afc9b11493e15745b78dec1c2b62bb9e01573c3d | refs/heads/beta-v2 | 2023-04-05T20:17:00.521159 | 2021-03-14T19:13:31 | 2021-03-14T19:13:31 | 347,509,882 | 33 | 19 | null | 2021-03-14T19:13:32 | 2021-03-14T00:27:40 | null | UTF-8 | Java | false | false | 3,414 | java | package org.apache.commons.lang3.concurrent;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
public class ConcurrentUtils {
public static ConcurrentException extractCause(ExecutionException ex) {
if (ex == null || ex.getCause() == null)
return null;
throwCause(ex);
return new ConcurrentException(ex.getMessage(), ex.getCause());
}
public static ConcurrentRuntimeException extractCauseUnchecked(ExecutionException ex) {
if (ex == null || ex.getCause() == null)
return null;
throwCause(ex);
return new ConcurrentRuntimeException(ex.getMessage(), ex.getCause());
}
public static void handleCause(ExecutionException ex) throws ConcurrentException {
ConcurrentException cex = extractCause(ex);
if (cex != null)
throw cex;
}
public static void handleCauseUnchecked(ExecutionException ex) {
ConcurrentRuntimeException crex = extractCauseUnchecked(ex);
if (crex != null)
throw crex;
}
static Throwable checkedException(Throwable ex) {
if (ex != null && !(ex instanceof RuntimeException) && !(ex instanceof Error))
return ex;
throw new IllegalArgumentException("Not a checked exception: " + ex);
}
private static void throwCause(ExecutionException ex) {
if (ex.getCause() instanceof RuntimeException)
throw (RuntimeException)ex.getCause();
if (ex.getCause() instanceof Error)
throw (Error)ex.getCause();
}
public static <T> T initialize(ConcurrentInitializer<T> initializer) throws ConcurrentException {
return (initializer != null) ? initializer.get() : null;
}
public static <T> T initializeUnchecked(ConcurrentInitializer<T> initializer) {
try {
return initialize(initializer);
} catch (ConcurrentException cex) {
throw new ConcurrentRuntimeException(cex.getCause());
}
}
public static <K, V> V putIfAbsent(ConcurrentMap<K, V> map, K key, V value) {
if (map == null)
return null;
V result = map.putIfAbsent(key, value);
return (result != null) ? result : value;
}
public static <K, V> V createIfAbsent(ConcurrentMap<K, V> map, K key, ConcurrentInitializer<V> init) throws ConcurrentException {
if (map == null || init == null)
return null;
V value = map.get(key);
if (value == null)
return putIfAbsent(map, key, init.get());
return value;
}
public static <K, V> V createIfAbsentUnchecked(ConcurrentMap<K, V> map, K key, ConcurrentInitializer<V> init) {
try {
return createIfAbsent(map, key, init);
} catch (ConcurrentException cex) {
throw new ConcurrentRuntimeException(cex.getCause());
}
}
public static <T> Future<T> constantFuture(T value) {
return new ConstantFuture<T>(value);
}
static final class ConstantFuture<T> implements Future<T> {
private final T value;
ConstantFuture(T value) {
this.value = value;
}
public boolean isDone() {
return true;
}
public T get() {
return this.value;
}
public T get(long timeout, TimeUnit unit) {
return this.value;
}
public boolean isCancelled() {
return false;
}
public boolean cancel(boolean mayInterruptIfRunning) {
return false;
}
}
}
| [
"Hot-Tutorials@users.noreply.github.com"
] | Hot-Tutorials@users.noreply.github.com |
a6e573d619b49a6c82637d1399527d1eb6d5ccce | b0c1f026f03afdd511e97cba0d7eddd156cbe846 | /CIT360-Portfolio/src/JUnitTests/JUnitTests.java | 79a24470d41fd45a0f54307bd100cd9967cbb3a8 | [] | no_license | hodges-olan/CIT360-Portfolio | 7666ffc41a6615b992b0aad6bb9619e04bf3c551 | 70f42136296892479965168aa832cb7bd927b5bc | refs/heads/master | 2021-01-09T20:53:11.147594 | 2017-11-30T21:46:16 | 2017-11-30T21:46:16 | 58,292,326 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,227 | java | package JUnitTests;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author co075oh
*/
public class JUnitTests {
public JUnitTests() {
}
public static void main(String[] args) {
testReduceHealthNormal();
}
/**
* Test of reduceHealthNormal method, of class BattleControl.
*/
@Test
public static void testReduceHealthNormal() {
System.out.println("\nreduceHealthNormal");
// Declare variables
double result, weapon, strength, armor, expResult;
BattleControl instance = new BattleControl();
/********************************
* Test Case #1
*/
// Declare test input and expected output
weapon = 8.0;
strength = 4.0;
armor = 20.0;
expResult = 12.0;
// Execute and Verify function
System.out.println("\tTest case #1");
result = instance.reduceHealthNormal(weapon, strength, armor);
assertNotNull(result);
assertEquals(expResult, result, 0.0);
/********************************
* Test Case #2
*/
// Declare test input and expected output
weapon = -1.0;
strength = 10.0;
armor = 10.0;
expResult = -1.0;
// Execute and Verify function
System.out.println("\tTest case #2");
result = instance.reduceHealthNormal(weapon, strength, armor);
assertNotNull(result);
assertEquals(expResult, result, 0.0);
/********************************
* Test Case #3
*/
// Declare test input and expected output
weapon = 10.0;
strength = -1.0;
armor = 5.0;
expResult = -1.0;
// Execute and Verify function
System.out.println("\tTest case #3");
result = instance.reduceHealthNormal(weapon, strength, armor);
assertNotNull(result);
assertEquals(expResult, result, 0.0);
/********************************
* Test Case #4
*/
// Declare test input and expected output
weapon = 4.0;
strength = 6.0;
armor = -1.0;
expResult = -1.0;
// Execute and Verify function
System.out.println("\tTest case #4");
result = instance.reduceHealthNormal(weapon, strength, armor);
assertNotNull(result);
assertEquals(expResult, result, 0.0);
/********************************
* Test Case #5
*/
// Declare test input and expected output
weapon = 0.0;
strength = 12.0;
armor = 7.0;
expResult = -1.0;
// Execute and Verify function
System.out.println("\tTest case #5");
result = instance.reduceHealthNormal(weapon, strength, armor);
assertNotNull(result);
assertEquals(expResult, result, 0.0);
/********************************
* Test Case #6
*/
// Declare test input and expected output
weapon = 9.0;
strength = 0.0;
armor = 3.0;
expResult = -1.0;
// Execute and Verify function
System.out.println("\tTest case #6");
result = instance.reduceHealthNormal(weapon, strength, armor);
assertNotNull(result);
assertEquals(expResult, result, 0.0);
/********************************
* Test Case #7
*/
// Declare test input and expected output
weapon = 3.0;
strength = 2.0;
armor = 0.0;
expResult = -1.0;
// Execute and Verify function
System.out.println("\tTest case #7");
result = instance.reduceHealthNormal(weapon, strength, armor);
assertNotNull(result);
assertEquals(expResult, result, 0.0);
/********************************
* Test Case #8
*/
// Declare test input and expected output
weapon = 1.0;
strength = 8.0;
armor = 2.0;
expResult = 6.0;
// Execute and Verify function
System.out.println("\tTest case #8");
result = instance.reduceHealthNormal(weapon, strength, armor);
assertNotNull(result);
assertEquals(expResult, result, 0.0);
/********************************
* Test Case #9
*/
// Declare test input and expected output
weapon = 11.0;
strength = 1.0;
armor = 7.0;
expResult = 4.0;
// Execute and Verify function
System.out.println("\tTest case #9");
result = instance.reduceHealthNormal(weapon, strength, armor);
assertNotNull(result);
assertEquals(expResult, result, 0.0);
/********************************
* Test Case #10
*/
// Declare test input and expected output
weapon = 10.0;
strength = 8.0;
armor = 1.0;
expResult = 79.0;
// Execute and Verify function
System.out.println("\tTest case #10");
result = instance.reduceHealthNormal(weapon, strength, armor);
assertNotNull(result);
assertEquals(expResult, result, 0.0);
/********************************
* Additional Test Cases
*/
// Below are examples of other test cases found on the following URL
// https://github.com/junit-team/junit4/wiki/Assertions
// This will be true as the byte array will be identical between the two using the same input of "trial"
System.out.println("\tTest case - assertArrayEquals");
byte[] expected = "trial".getBytes();
byte[] actual = "trial".getBytes();
assertArrayEquals(expected, actual);
// This will be true, since it is being handed the boolean value of false
System.out.println("\tTest case - assertFalse");
assertFalse(false);
// These will not be the same as they are different instantiations of the class Object
System.out.println("\tTest case - assertNotSame");
assertNotSame(new Object(), new Object());
// This will be true, since it is being handed no value at all
System.out.println("\tTest case - assertNull");
assertNull(null);
// This will be true since you are comparing the exact same object to itself.
System.out.println("\tTest case - assertSame");
Integer aNumber = 768;
assertSame(aNumber, aNumber);
// This will be true, since it is being handed the boolean value of true
System.out.println("\tTest case - assertTrue");
assertTrue(true);
}
private static class BattleControl {
public BattleControl() {
}
private double reduceHealthNormal(double weapon, double strength, double armor) {
// Declare variables
double damage;
// Validation Checks
if(weapon <= 0 || strength <= 0 || armor <= 0) {
return -1.0;
}
// Calculate damage
damage = (weapon * strength) - armor;
// Return values
return Math.round(damage);
}
}
}
| [
"co075oh@W5136980.ena.us.experian.local"
] | co075oh@W5136980.ena.us.experian.local |
4ac35a8ddec362987943bda4d8fc19d34e70e3d8 | eeffa8e086068b3b1986b220a1a158de902a7ac1 | /app/src/main/java/com/kunminx/puremusic/ui/page/adapter/PlaylistAdapter.java | 1db86eccc3307f81d38c5d4e488746127effe5f3 | [
"Apache-2.0"
] | permissive | yangyugee/Jetpack-MVVM-Best-Practice | cc81a41c7122ac7302c95948aeb58c556172cf36 | 6b69074580a920aca6e5abb5b0e4c1363d76455c | refs/heads/master | 2023-07-07T08:57:15.101098 | 2020-07-18T17:25:36 | 2020-07-18T17:25:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,902 | java | /*
* Copyright 2018-2020 KunMinX
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.kunminx.puremusic.ui.page.adapter;
import android.content.Context;
import android.graphics.Color;
import androidx.recyclerview.widget.RecyclerView;
import com.kunminx.architecture.ui.adapter.SimpleDataBindingAdapter;
import com.kunminx.puremusic.R;
import com.kunminx.puremusic.data.bean.TestAlbum;
import com.kunminx.puremusic.databinding.AdapterPlayItemBinding;
import com.kunminx.puremusic.player.PlayerManager;
/**
* Create by KunMinX at 20/4/19
*/
public class PlaylistAdapter extends SimpleDataBindingAdapter<TestAlbum.TestMusic, AdapterPlayItemBinding> {
public PlaylistAdapter(Context context) {
super(context, R.layout.adapter_play_item, DiffUtils.getInstance().getTestMusicItemCallback());
setOnItemClickListener(((item, position) -> {
PlayerManager.getInstance().playAudio(position);
}));
}
@Override
protected void onBindItem(AdapterPlayItemBinding binding, TestAlbum.TestMusic item, RecyclerView.ViewHolder holder) {
binding.setAlbum(item);
int currentIndex = PlayerManager.getInstance().getAlbumIndex();
binding.ivPlayStatus.setColor(currentIndex == holder.getAdapterPosition()
? binding.getRoot().getContext().getResources().getColor(R.color.gray) : Color.TRANSPARENT);
}
}
| [
"kunminx@gmail.com"
] | kunminx@gmail.com |
b96bdc635502674b61b2849e19871557dff319b2 | 2f662133b388bd8992c4ed8d04ad77f0290d3970 | /src/main/java/migu/algorithm/study/search/BinarySearchLoop.java | 8a7b7ee108e75e7ce8001f946d32e563d1a34c33 | [] | no_license | tinajeong/dsjava | d050f060f180245354e65eef4c4a789e8e93ea3a | aa2c48765f00fb1d6afe076f673798cb80461683 | refs/heads/master | 2022-07-28T13:35:47.860741 | 2020-05-18T08:45:56 | 2020-05-18T08:45:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 908 | java | package migu.algorithm.study.search;
import migu.algorithm.study.util.PrintArray;
public class BinarySearchLoop {
int[] arr;
public BinarySearchLoop() {
}
public BinarySearchLoop(int[] arr) {
this.arr = arr;
}
public boolean binarySearch(int target) {
new PrintArray().printArray(arr);
int first = 0;
int last = arr.length - 1;
int cnt = 0;
while (first <= last) {
int mid = (first + last) / 2;
cnt++;
if (arr[mid] > target) {
last = mid - 1;
} else if (arr[mid] < target) {
first = mid + 1;
} else {
return true;
}
}
System.out.println(cnt);
return false;
}
public int[] getArr() {
return arr;
}
public void setArr(int[] arr) {
this.arr = arr;
}
}
| [
"starandpoem143@gmail.com"
] | starandpoem143@gmail.com |
f29b086d795aa9bee42ba7927ee7cbd7810f1220 | d6c9d1ebf547854c4340d06bf99dc52468c66942 | /src/OfficeHours/_05_13_2020/InstanceTest.java | af8ab4fa184466809f84617ced246e50acaeb79d | [] | no_license | Jmossman14/Spring2020B18_Java | 68d706c9df7f6173e3f58c645ef0263a615364c8 | 223b0d21e1dca6d5a15f27362039df99f5b55c1c | refs/heads/master | 2022-08-16T01:56:45.727008 | 2020-06-22T17:01:18 | 2020-06-22T17:01:18 | 257,957,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 692 | java | package OfficeHours._05_13_2020;
public class InstanceTest {
public static void main(String[] args) {
/*
Each object has its OWN copy of the instance variable
MUST assign each object to the instance variable or else it will output NULL
*/
//create an object to test the functions of Instances class:
Instances obj1 = new Instances();
obj1.name = "Judy"; // calls the String Name
obj1.printName();
Instances obj2 = new Instances();
// since there are 2 objects, MUST assign obj2 to String name
obj2.name = "Keora";
obj2.printName();
// ===========================================================
}
}
| [
"judy.mossman@yahoo.com"
] | judy.mossman@yahoo.com |
1177fff63249c44226cd3c73cc98c37c0c9b630f | ca030864a3a1c24be6b9d1802c2353da4ca0d441 | /classes2.dex_source_from_JADX/com/facebook/photos/creativeediting/swipeable/prompt/FramePromptProvider.java | d9efe65eeb31fd79e238f7dd867ec34774f33bdb | [] | no_license | pxson001/facebook-app | 87aa51e29195eeaae69adeb30219547f83a5b7b1 | 640630f078980f9818049625ebc42569c67c69f7 | refs/heads/master | 2020-04-07T20:36:45.758523 | 2018-03-07T09:04:57 | 2018-03-07T09:04:57 | 124,208,458 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 233 | java | package com.facebook.photos.creativeediting.swipeable.prompt;
import com.facebook.inject.AbstractAssistedProvider;
/* compiled from: mobile_data */
public class FramePromptProvider extends AbstractAssistedProvider<FramePrompt> {
}
| [
"son.pham@jmango360.com"
] | son.pham@jmango360.com |
8d7bd7975aea40352672d89578924a68daa75997 | 8a0ae0b08c884d2749c2e49968454953df4773cd | /viikko5/Ohtu-NhlStatistics3/src/test/java/ohtuesimerkki/StaticsticsTest.java | 22a46ec955c28803497bddbb66d4659eab809e59 | [] | no_license | artokaik/ohtu-harkat | 7821777d8b84f2c252bdcbd1f43126c87aff6eb9 | 872e5b5bf53a607f4401f173ac609ea9e43e24c3 | refs/heads/master | 2021-01-10T21:37:39.737410 | 2013-04-28T10:46:32 | 2013-04-28T10:46:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,566 | java | package ohtuesimerkki;
import java.util.ArrayList;
import java.util.List;
import org.junit.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
public class StaticsticsTest {
Statistics stats;
@Before
public void setUp() {
PlayerReader reader = mock(PlayerReader.class);
ArrayList<Player> players = new ArrayList<Player>();
players.add(new Player("Semenko", "EDM", 4, 12));
players.add(new Player("Lemieux", "PIT", 45, 54));
players.add(new Player("Kurri", "EDM", 37, 53));
players.add(new Player("Yzerman", "DET", 42, 56));
players.add(new Player("Gretzky", "EDM", 35, 89));
when(reader.getPlayers()).thenReturn(players);
stats = new Statistics(reader);
}
@Test
public void playerFound() {
Player p = stats.search("Lemieux");
assertEquals("PIT", p.getTeam());
assertEquals(45, p.getGoals());
assertEquals(54, p.getAssists());
assertEquals(45 + 54, p.getPoints());
}
@Test
public void teamMembersFound() {
List<Player> players = stats.team("EDM");
assertEquals(3, players.size());
for (Player player : players) {
assertEquals("EDM", player.getTeam());
}
}
@Test
public void topScorersFound() {
List<Player> players = stats.topScorers(2);
assertEquals(3, players.size());
assertEquals("Gretzky", players.get(0).getName());
assertEquals("Lemieux", players.get(1).getName());
}
}
| [
"kaikkonen.arto@gmail.com"
] | kaikkonen.arto@gmail.com |
b674ad588354196bbb1bc089bae341af53f44d90 | b96be200dd0d18838d61be34bee0030f0df18c2c | /app/src/main/java/com/magicwind/android/fitness_club/Activity/search.java | 77d4702ece57ed285786f5215cff058b2bccbc8c | [] | no_license | OldAAAA/android-second-homework | ce801448c993416186523733ca515e9dace102f0 | 153bb03b97c063d9244b965d5ed404f6e52faed4 | refs/heads/master | 2020-04-06T12:38:40.223918 | 2018-11-14T05:39:02 | 2018-11-14T05:39:02 | 157,463,953 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 630 | java | package com.magicwind.android.fitness_club.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import com.magicwind.android.fitness_club.R;
public class search extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);
getSupportActionBar().hide();
}
public void searchResult(View view){
Intent intent = new Intent(this,allCourse.class);
startActivity(intent);
}
}
| [
"16301073@bjtu.edu.cn"
] | 16301073@bjtu.edu.cn |
18bf16aea150369ba9dbebbe6f22302517048be9 | 3e64790f1183845f71b1376e7243197581df7b7d | /src/main/java/ee/bcs/koolitus/muisikratt2/spring_app/config/JpaConfiguration.java | b84bb6dbaa6303c2ca643ed28d85449780ffbcde | [] | no_license | Merilis/pd | 9cff4316faebe6fa53ea2ab8f91aa601319c20c2 | 126d43f4686544b7d96925646f6e2e8a83676dfd | refs/heads/master | 2021-04-12T12:24:36.524203 | 2018-03-24T19:32:36 | 2018-03-24T19:32:36 | 126,633,455 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,263 | java | package ee.bcs.koolitus.muisikratt2.spring_app.config;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaDialect;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@EnableJpaRepositories(basePackages = {"ee.bcs.koolitus.muisikratt2.spring_app.repository"})
@EnableTransactionManagement
public class JpaConfiguration {
@Value("${spring.jpa.hibernate.ddl-auto:none}")
private String ddlAuto;
@Value("${spring.jpa.show-sql:false}")
private String showSql;
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) {
LocalContainerEntityManagerFactoryBean entityManagerFactory = new LocalContainerEntityManagerFactoryBean();
entityManagerFactory.setDataSource(dataSource);
entityManagerFactory.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
entityManagerFactory.setJpaDialect(new HibernateJpaDialect());
entityManagerFactory.setPackagesToScan("ee.bcs.koolitus.muisikratt2.spring_app.entity");
entityManagerFactory.setJpaPropertyMap(hibernateJpaProperties());
return entityManagerFactory;
}
private Map<String, ?> hibernateJpaProperties() {
Map<String, String> properties = new HashMap<>();
properties.put("hibernate.hbm2ddl.auto", ddlAuto);
properties.put("hibernate.show_sql", showSql);
properties.put("hibernate.connection.charSet", "UTF-8");
return properties;
}
@Bean
public JpaTransactionManager transactionManager(EntityManagerFactory emf) {
JpaTransactionManager jpaTransactionManager = new JpaTransactionManager();
jpaTransactionManager.setEntityManagerFactory(emf);
return jpaTransactionManager;
}
}
| [
"merilis.roosalu@gmail.com"
] | merilis.roosalu@gmail.com |
62bafc6678b68680f17555ad0efbda3f5b0a5252 | 88cfbdc25670de1fba59c029d96acb3abf9900e6 | /JavaLectures/src/Week8_ogrenci/Ogr.java | b814fa56e28e7bcbc74e51ab016b6bfff3352522 | [] | no_license | hakankocaknyc/JavaLectures | e6c6754280ed6d4e1a4294df798db95e51369085 | 940b5c9a1ea45d47bd9b6a157549d1a57c1e9571 | refs/heads/master | 2022-12-05T05:10:13.468985 | 2020-08-22T17:36:43 | 2020-08-22T17:36:43 | 286,625,020 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 487 | java | package Week8_ogrenci;
public abstract class Ogr {
private String isim;
private int no;
public Ogr(String isim, int no) {
super();
this.isim = isim;
this.no = no;
}
public abstract void bolumSoyle();
public void adsoyle(){
System.out.println(" Adim : " + isim);
}
public String getIsim() {
return isim;
}
public void setIsim(String isim) {
this.isim = isim;
}
public int getNo() {
return no;
}
public void setNo(int no) {
this.no = no;
}
}
| [
"you@example.com"
] | you@example.com |
94328a863beef0a2a6e8bb765af57e86c583978c | 4cebe0d2407e5737a99d67c99ab84ca093f11cff | /src/multithread/chapter6/demo04DCLofLasySingleton/Run.java | 94782ebb5923aa6a3baddd72715ca9a4b10c3bef | [] | no_license | MoXiaogui0301/MultiThread-Program | 049be7ca7084955cb2a2372bf5acb3e9584f4086 | 1492e1add980342fbbcc2aed7866efca119998c9 | refs/heads/master | 2020-04-28T00:14:37.871448 | 2019-04-02T04:20:04 | 2019-04-02T04:20:04 | 174,808,187 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 531 | java | package multithread.chapter6.demo04DCLofLasySingleton;
/**
* P270
* DCL(双检查锁机制)实现多线程环境中的延迟加载单例设计模式
* 在同步代码块(创建对象)之前进行两次非空判断
*
* Result:
* 438618715
* 438618715
* 438618715
*
*/
public class Run {
public static void main(String[] args) {
MyThread th1 = new MyThread();
MyThread th2 = new MyThread();
MyThread th3 = new MyThread();
th1.start();
th2.start();
th3.start();
}
}
| [
"361941176@qq.com"
] | 361941176@qq.com |
3b85cf0667538011ecadbd4000b99a0d9d172603 | 705975f9965eabaa7f81663d25b19b3df20dce6e | /app/src/main/java/com/framgia/forder/screen/searchpage/SearchContainerFragment.java | 89cc86a6ff80e15b76fae1bbc64421a1e8294dcb | [] | no_license | tranminhtri911/android_forder_01 | 27fe0d494f268f966e5ac677fb9ffb74e21bce16 | 1e9f1d82e2bd9a2fa4842f92ff6ff706111c9e10 | refs/heads/logic_order | 2021-01-19T21:28:48.629701 | 2017-04-26T01:33:30 | 2017-04-26T03:29:49 | 82,506,327 | 0 | 0 | null | 2017-06-22T01:39:14 | 2017-02-20T02:04:21 | Java | UTF-8 | Java | false | false | 3,866 | java | package com.framgia.forder.screen.searchpage;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import com.framgia.forder.R;
import com.framgia.forder.data.source.DomainRepository;
import com.framgia.forder.data.source.SearchRepository;
import com.framgia.forder.data.source.local.DomainLocalDataSource;
import com.framgia.forder.data.source.local.UserLocalDataSource;
import com.framgia.forder.data.source.local.sharedprf.SharedPrefsApi;
import com.framgia.forder.data.source.local.sharedprf.SharedPrefsImpl;
import com.framgia.forder.data.source.remote.DomainRemoteDataSource;
import com.framgia.forder.data.source.remote.SearchRemoteDataSource;
import com.framgia.forder.data.source.remote.api.service.FOrderServiceClient;
import com.framgia.forder.databinding.FragmentSearchContainerBinding;
/**
* FragmentSearchContainer Screen.
*/
public class SearchContainerFragment extends Fragment implements SearchView.OnQueryTextListener {
private SearchContainerContract.ViewModel mViewModel;
private FragmentSearchContainerBinding mBinding;
public static SearchContainerFragment newInstance() {
return new SearchContainerFragment();
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
SearchContainerAdapter adapter =
new SearchContainerAdapter(getActivity(), getChildFragmentManager());
mViewModel = new SearchContainerViewModel(adapter);
SearchRepository searchRepository =
new SearchRepository(new SearchRemoteDataSource(FOrderServiceClient.getInstance()));
SharedPrefsApi prefsApi = new SharedPrefsImpl(getActivity().getApplicationContext());
DomainRepository domainRepository =
new DomainRepository(new DomainRemoteDataSource(FOrderServiceClient.getInstance()),
new DomainLocalDataSource(prefsApi, new UserLocalDataSource(prefsApi)));
SearchContainerContract.Presenter presenter =
new SearchContainerPresenter(mViewModel, searchRepository, domainRepository);
mViewModel.setPresenter(presenter);
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_search_container, container,
false);
mBinding.setViewModel((SearchContainerViewModel) mViewModel);
setUpView();
return mBinding.getRoot();
}
@Override
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
getActivity().getMenuInflater().inflate(R.menu.menu_search, menu);
MenuItem item = menu.findItem(R.id.action_search);
SearchView searchView = (SearchView) item.getActionView();
searchView.setIconified(false);
searchView.getBaselineAlignedChildIndex();
searchView.setOnQueryTextListener(this);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}
private void setUpView() {
setHasOptionsMenu(true);
((AppCompatActivity) getActivity()).setSupportActionBar(mBinding.toolbar);
((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayShowTitleEnabled(false);
}
@Override
public boolean onQueryTextSubmit(String query) {
mViewModel.onClickSearch(query);
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
return false;
}
}
| [
"nguyenhuy95dn@gmail.com"
] | nguyenhuy95dn@gmail.com |
bc70092269c40704ff3c4967c4c049ca28d8efbe | 858b82f813bde7b25b2ba571ff71faa05e2b3409 | /src/main/java/com/wcf/mobile/usage/model/CellPhone.java | 1c2011761679bee527a1078974e7dce1959d03cc | [] | no_license | manicpromod/usage | 0ec528d4cfb0977db91b1653849b2d0ccce174bc | 03a8cb574f804af5ccc7f5ac18167e7155719809 | refs/heads/master | 2022-03-14T07:32:39.353006 | 2019-09-16T13:51:01 | 2019-09-16T13:51:01 | 208,166,144 | 0 | 0 | null | 2022-01-21T23:29:48 | 2019-09-12T23:58:28 | Java | UTF-8 | Java | false | false | 407 | java | package com.wcf.mobile.usage.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Builder;
/**
* Created by pmanickam on 9/10/2019 at 9:25 AM
*/
@NoArgsConstructor
@AllArgsConstructor
public class CellPhone {
private int employeeId;
private String employeeName;
private String purchaseDate;
private String model;
}
| [
"pmanickam@incomm.com"
] | pmanickam@incomm.com |
06c94ac46e5ec904699f9d6d1eb9e63f42cf8520 | d312683783d10be97252a316cfa2b3397e67b134 | /src/main/java/com/example/lx/imageutils/utils/Utils.java | ae828724a4e087f7c3f3b80c463911016490da3b | [] | no_license | liaoxinlxw/AndroidStudioProject | a07560f749e95b564ac301da5761104f4afc9edd | 68a790b4e696fa16238104a9adc2bf86679d9fc6 | refs/heads/master | 2020-06-14T00:00:03.340616 | 2016-12-05T15:34:34 | 2016-12-05T15:34:34 | 75,542,145 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,961 | java | package com.example.lx.imageutils.utils;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.net.Uri;
import android.os.Environment;
import android.provider.MediaStore;
import android.util.Log;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.text.DecimalFormat;
/**
* Created by Administrator on 2016/12/3.
*/
public class Utils {
public static void choseImage(Activity activity){
Intent intent = new Intent();
/* 开启Pictures画面Type设定为image */
intent.setType("image/*");
/* 使用Intent.ACTION_GET_CONTENT这个Action */
intent.setAction(Intent.ACTION_GET_CONTENT);
/* 取得相片后返回本画面 */
activity.startActivityForResult(intent, 1);
}
/**
* 获取指定文件大小
* @param uri
* @return
* @throws Exception
*/
public static long getFileSize(Context context, Uri uri) {
InputStream input = null;
int size = 0;
try {
input = context.getContentResolver().openInputStream(uri);
size = input.available();
} catch (FileNotFoundException e) {
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}
return size;
}
public static String getFileSizeString(Context context, Uri uri) {
return getDataSize(getFileSize(context, uri));
}
/**
* 返回byte的数据大小对应的文本
*
* @param size
* @return
*/
public static String getDataSize(long size) {
if (size < 0) {
size = 0;
}
DecimalFormat formater = new DecimalFormat("####.00");
if (size < 1024) {
return size + "bytes";
} else if (size < 1024 * 1024) {
float kbsize = size / 1024f;
return formater.format(kbsize) + "KB";
} else if (size < 1024 * 1024 * 1024) {
float mbsize = size / 1024f / 1024f;
return formater.format(mbsize) + "MB";
} else if (size < 1024 * 1024 * 1024 * 1024) {
float gbsize = size / 1024f / 1024f / 1024f;
return formater.format(gbsize) + "GB";
} else {
return "size: error";
}
}
public static Bitmap getimage(String srcPath) {
BitmapFactory.Options newOpts = new BitmapFactory.Options();
//开始读入图片,此时把options.inJustDecodeBounds 设回true了
newOpts.inJustDecodeBounds = true;
//此时返回bm为空
Bitmap bitmap = BitmapFactory.decodeFile(srcPath,newOpts);
newOpts.inJustDecodeBounds = false;
int w = newOpts.outWidth;
int h = newOpts.outHeight;
//现在主流手机比较多是800*480分辨率,所以高和宽我们设置为
float hh = 800f;//这里设置高度为800f
float ww = 480f;//这里设置宽度为480f
//缩放比。由于是固定比例缩放,只用高或者宽其中一个数据进行计算即可
int be = 1;//be=1表示不缩放
if (w > h && w > ww) {//如果宽度大的话根据宽度固定大小缩放
be = (int) (newOpts.outWidth / ww);
} else if (w < h && h > hh) {//如果高度高的话根据宽度固定大小缩放
be = (int) (newOpts.outHeight / hh);
}
if (be <= 0)
be = 1;
newOpts.inSampleSize = be;//设置缩放比例
//重新读入图片,注意此时已经把options.inJustDecodeBounds 设回false了
bitmap = BitmapFactory.decodeFile(srcPath, newOpts);
return compressImage(bitmap);//压缩好比例大小后再进行质量压缩
}
public static Bitmap compressImage(Bitmap image) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
//质量压缩方法,这里100表示不压缩,把压缩后的数据存放到baos中
image.compress(Bitmap.CompressFormat.JPEG, 100, baos);
int options = 100;
//循环判断如果压缩后图片是否大于100kb,大于继续压缩
while ( baos.toByteArray().length / 1024>50) {
//重置baos即清空baos
baos.reset();
//这里压缩options%,把压缩后的数据存放到baos中
image.compress(Bitmap.CompressFormat.JPEG, options, baos);
options -= 10;//每次都减少10
}
//把压缩后的数据baos存放到ByteArrayInputStream中
ByteArrayInputStream isBm = new ByteArrayInputStream(baos.toByteArray());
//把ByteArrayInputStream数据生成图片
File f = new File("/sdcard/lx", "resize_"+System.currentTimeMillis()+".jpg");
if(!f.getParentFile().exists()){
f.getParentFile().mkdirs();
}
if (f.exists()) {
f.delete();
}
try {
FileOutputStream out = new FileOutputStream(f);
out.write(baos.toByteArray());
out.flush();
out.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Bitmap bitmap = BitmapFactory.decodeStream(isBm, null, null);
return bitmap;
}
/** 保存方法 */
public void saveBitmap(Bitmap bm) {
File f = new File("/sdcard/lx", "resize_"+System.currentTimeMillis()+".jpg");
if(!f.getParentFile().exists()){
f.getParentFile().mkdirs();
}
if (f.exists()) {
f.delete();
}
try {
FileOutputStream out = new FileOutputStream(f);
bm.compress(Bitmap.CompressFormat.JPEG, 90, out);
out.flush();
out.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static Bitmap comp(Bitmap image) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
image.compress(Bitmap.CompressFormat.JPEG, 100, baos);
//判断如果图片大于1M,进行压缩避免在生成图片
//(BitmapFactory.decodeStream)时溢出
if( baos.toByteArray().length / 1024>1024) {
baos.reset();//重置baos即清空baos
//这里压缩50%,把压缩后的数据存放到baos中
image.compress(Bitmap.CompressFormat.JPEG, 50, baos);
}
ByteArrayInputStream isBm = new ByteArrayInputStream(baos.toByteArray());
BitmapFactory.Options newOpts = new BitmapFactory.Options();
//开始读入图片,此时把options.inJustDecodeBounds 设回true了
newOpts.inJustDecodeBounds = true;
Bitmap bitmap = BitmapFactory.decodeStream(isBm, null, newOpts);
newOpts.inJustDecodeBounds = false;
int w = newOpts.outWidth;
int h = newOpts.outHeight;
//现在主流手机比较多是800*480分辨率,所以高和宽我们设置为
float hh = 800f;//这里设置高度为800f
float ww = 480f;//这里设置宽度为480f
//缩放比。由于是固定比例缩放,只用高或者宽其中一个数据进行计算即可
int be = 1;//be=1表示不缩放
if (w > h && w > ww) {//如果宽度大的话根据宽度固定大小缩放
be = (int) (newOpts.outWidth / ww);
} else if (w < h && h > hh) {//如果高度高的话根据宽度固定大小缩放
be = (int) (newOpts.outHeight / hh);
}
if (be <= 0)
be = 1;
newOpts.inSampleSize = be;//设置缩放比例
//重新读入图片,注意此时已经把options.inJustDecodeBounds 设回false了
isBm = new ByteArrayInputStream(baos.toByteArray());
bitmap = BitmapFactory.decodeStream(isBm, null, newOpts);
return compressImage(bitmap);//压缩好比例大小后再进行质量压缩
}
public static long getBitmapSize(Bitmap bitmap){
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
InputStream isBm = new ByteArrayInputStream(baos.toByteArray());
int size = 0;
try {
size = isBm.available();
} catch (IOException e) {
e.printStackTrace();
}
return size;
}
}
| [
"460178191@qq.com"
] | 460178191@qq.com |
da671a8a1323aef7a4dee5e856d073f0d841a1f4 | ea8004509d2b3729303101a69b6a543bc39b9b79 | /ProjectFrontend/src/main/java/com/niit/fileinput/FileInput.java | 21d3d0c94e72d992919b41480a2e8c93a9db12b6 | [] | no_license | HemaR92/Shopping1 | 554c69833690aac67224354385e5a38447b509a0 | 9c31c2090cfec7bccd4b6e6ac49e548d0128d391 | refs/heads/master | 2021-09-03T04:40:33.534081 | 2018-01-05T16:26:41 | 2018-01-05T16:26:41 | 116,404,508 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,071 | java | package com.niit.fileinput;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.springframework.web.multipart.MultipartFile;
public class FileInput {
public static void upload(String path,MultipartFile file,String fileName)
{
if(!file.isEmpty()){
InputStream inputStream =null;
OutputStream outputStream =null;
if(file.getSize()>0)
{
try
{
inputStream=file.getInputStream();
outputStream=new FileOutputStream(path+fileName);
System.out.println("5");
int readBytes =0;
System.out.println("5");
byte[] buffer =new byte[1024];
System.out.println("5");
while((readBytes = inputStream.read(buffer,0,1024))!= -1){
outputStream.write(buffer,0, readBytes);
}
}
catch (IOException e)
{
e.printStackTrace();
}
finally {
try{
outputStream.close();
inputStream.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
}
}
}
| [
"ramya.rb22@gmail.com"
] | ramya.rb22@gmail.com |
e36be0b7a4725ac5d47a541362ad8f310ad09d10 | ed28460c5d24053259ab189978f97f34411dfc89 | /Software Engineering/Java Fundamentals/Java OOP Advanced/Lab/BashSoft/src/main/bg/softuni/io/commands/MakeDirectoryCommand.java | f69b83c7ad56a528fc3cab405bb88178768b0cd2 | [] | no_license | Dimulski/SoftUni | 6410fa10ba770c237bac617205c86ce25c5ec8f4 | 7954b842cfe0d6f915b42702997c0b4b60ddecbc | refs/heads/master | 2023-01-24T20:42:12.017296 | 2020-01-05T08:40:14 | 2020-01-05T08:40:14 | 48,689,592 | 2 | 1 | null | 2023-01-12T07:09:45 | 2015-12-28T11:33:32 | Java | UTF-8 | Java | false | false | 767 | java | package main.bg.softuni.io.commands;
import main.bg.softuni.annotations.Alias;
import main.bg.softuni.annotations.Inject;
import main.bg.softuni.contracts.DirectoryManager;
import main.bg.softuni.exceptions.InvalidInputException;
@Alias("mkdir")
public class MakeDirectoryCommand extends Command {
@Inject
private DirectoryManager ioManager;
public MakeDirectoryCommand(String input,String[] data) {
super(input, data);
}
@Override
public void execute() throws Exception {
String[] data = this.getData();
if (data.length != 2) {
throw new InvalidInputException(this.getInput());
}
String folderName = data[1];
this.ioManager.createDirectoryInCurrentFolder(folderName);
}
}
| [
"george.dimulski@gmail.com"
] | george.dimulski@gmail.com |
2f29ebe463aeb0be37bacc0476213363fa255066 | e4172e79f17efdee764f558d34959fdc909f219b | /src/main/java/com/person/model/response/PersonResponse.java | ea7546ebfcc41f67452a0c008b87738fcdf613ef | [] | no_license | rubens-tersi/person | dc02ffc1d603b468a945c0a190808b953540f4df | 0f02f8fd7e080ec6f8d9eb3a49aee0d67ee3fd02 | refs/heads/master | 2022-12-03T18:01:16.047318 | 2020-08-10T14:37:39 | 2020-08-10T14:37:39 | 286,479,423 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,571 | java | package com.person.model.response;
import java.time.LocalDate;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.person.model.Person;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@JsonInclude(Include.NON_EMPTY)
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PersonResponse {
@JsonIgnore
private Person person;
@ApiModelProperty(value = "Person's autogenerated Id.")
public String getId() {
return person.getId();
}
@ApiModelProperty(value = "Person's associated document number, following type pattern.")
public String getDocumentNumber() {
return person.getDocumentNumber();
}
@ApiModelProperty(value = "Person's complete name.")
public String getFullName() {
return person.getFullName();
}
@ApiModelProperty(value = "Person's social name.")
public String getSocialName() {
return person.getSocialName();
}
@ApiModelProperty(value = "Person's gender.")
public String getGender() {
return person.getGender();
}
@ApiModelProperty(value = "Person's birth date.")
public LocalDate getBirthDate() {
return person.getBirthDate();
}
@ApiModelProperty(value = "Person's associated e-mail address.")
public String getEmail() {
return person.getEmail();
}
}
| [
"rubinho84@hotmail.com"
] | rubinho84@hotmail.com |
08c5e1e6e369fc189320ddf82f1c1bfa64ac1742 | 98e2dd89a590f1018070317d820bf61715f86cdf | /BT2/app/src/main/java/com/example/bt2/fragmentxml/FragmentCreateActivity.java | bb518b76ccf165dfe6883e1fadcb8d08e7b0a86e | [] | no_license | VuIt96/BT-Android | c2e9da1f00fb21c23a1f213bf46ae2f135e460e0 | a80a40366b3bb44e3b48ac70dc4bcead7371ef8b | refs/heads/master | 2020-06-30T22:36:29.448371 | 2019-09-03T01:42:55 | 2019-09-03T01:42:55 | 200,969,749 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,160 | java | package com.example.bt2.fragmentxml;
import androidx.appcompat.app.AppCompatActivity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.View;
import com.example.bt2.R;
public class FragmentCreateActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fragment_create);
}
public void AddFrag(View view) {
Fragment fragment = null;
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
switch (view.getId()) {
case R.id.btFragA:
fragment = new FragmentOne();
break;
case R.id.btFragAddB:
fragment = new FragmentTwo();
break;
}
//fragmentTransaction.add(R.id.Framelayout, fragment);
fragmentTransaction.replace(R.id.Framelayout, fragment);
fragmentTransaction.commit();
}
}
| [
"vuit.hdu@gmail.com"
] | vuit.hdu@gmail.com |
7f4e0c2f98fdfd523846c0167ef7ef500cdd0e4b | 38f204775b93bd8a96b6e6563f56c1cb30441911 | /app/src/main/java/com/example/win8_user/fruitnum/Main7Activity.java | 3b5eaaaf963cda084decfd72f7052b647c76ef9f | [] | no_license | ViviYiWen/Fruitnum | 9bc4018d14cee04478fcbf0191731f738e116fea | 8bacc0c77d13cfb0eca099958ac8984a4b75b811 | refs/heads/master | 2023-03-01T18:08:13.974672 | 2021-02-15T12:29:59 | 2021-02-15T12:29:59 | 339,047,992 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,337 | java | package com.example.win8_user.fruitnum;
import android.content.ContentValues;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
public class Main7Activity extends AppCompatActivity {
// int num1 =1, num2=2, num3=3, result=0;
TextView t2;
TextView t1;
int result=0;
int num1 = (int)(Math.random()*10);//隨機出4個數字
int num2 = (int)(Math.random()*10);
int num3 = (int)(Math.random()*10);
int num4 = (int)(Math.random()*10);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main7);
findView();//抓使用者姓名
Bundle bundle = this.getIntent().getExtras();
String s = bundle.getString("input");
t1.setText(s);
while(num2==num1) num2 = (int)(Math.random()*10);
while(num3==num2 || num3==num1) num3= (int)(Math.random()*10);
while(num4==num2 || num4==num1||num4==num3) num4= (int)(Math.random()*10);
ShowDialog(num1,num2,num3,num4);
Button sure = (Button)findViewById(R.id.sure);
ImageButton mon = (ImageButton)findViewById(R.id.money);
sure.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
result = Result(num1,num2,num3,num4);
if(result==1){
findView();//抓使用者姓名
t2 = (TextView) findViewById(R.id.mon);
int upToDbCoin = 0; //要update至DB的金幣數量
String flag = "N"; //是否更新DB資料
DBHelper dbHelper = new DBHelper(Main7Activity.this);
SQLiteDatabase db=dbHelper.getWritableDatabase();
Cursor cs = db.query("Player",null,"_PLAYERNAME=?",new String[]{t1.getText().toString()},null,null,null); //search玩家資料
if(cs!=null && cs.getCount() >= 1){ //有查詢到資料(比對金幣數)
int rowNum = cs.getCount(); //比數
if(rowNum!=0){
cs.moveToFirst(); //指標移至第一筆
String coin = cs.getString(2); //取得該玩家金幣數
if(coin!=null && coin!=""){
int coinDb = Integer.parseInt(coin); //玩家金幣數(db資料)
int uiCoin = Integer.parseInt(t2.getText().toString()); //UI剩餘金幣數
if(uiCoin>coinDb){ //剩餘金幣數大於原本資料庫金幣數->則update至資料庫中,否則不更新資料
upToDbCoin = uiCoin;
flag = "Y";
}else{
upToDbCoin = coinDb;
flag = "N";
}
}
}
}
if(flag=="Y"){
ContentValues values = new ContentValues();
values.put("_COIN", Integer.toString(upToDbCoin));
db.update("Player", values, "_PLAYERNAME = ?", new String[] {t1.getText().toString()}); //更新玩家剩餘金幣數
}
//ContentValues values = new ContentValues();
//values.put("_COIN", t2.getText().toString());
//db.update("Player", values, "_PLAYERNAME = ?", new String[] {t1.getText().toString()}); //更新玩家剩餘金幣數
db.close();
dbHelper.close();
Intent intent=new Intent();
intent.setClass(Main7Activity.this,Main5Activity.class);
startActivity(intent);
Main7Activity.this.finish();
}
}
});
mon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
TextView hints = (TextView)findViewById(R.id.hints);
TextView mon = (TextView)findViewById(R.id.mon);
LinearLayout layout = (LinearLayout) findViewById(R.id.app);
int mons=Integer.parseInt(mon.getText().toString());
mons=mons-60;
int ask = (int)(Math.random()*4);//select index number
if(ask==0){
int n=num1;
hints.setText("第一個數字為:"+Integer.toString(n));
mon.setText(Integer.toString(mons));
layout.setVisibility(View.VISIBLE);
}
if(ask==1){
int n=num2;
hints.setText("第二個數字為:"+Integer.toString(n));
mon.setText(Integer.toString(mons));
layout.setVisibility(View.VISIBLE);
}
if(ask==2){
int n=num3;
hints.setText("第三個數字為:"+Integer.toString(n));
mon.setText(Integer.toString(mons));
layout.setVisibility(View.VISIBLE);
}
if(ask==3){
int n=num4;
hints.setText("第四個數字為:"+Integer.toString(n));
mon.setText(Integer.toString(mons));
layout.setVisibility(View.VISIBLE);
}
}
});
}
public void findView(){
t1=(TextView)findViewById(R.id.textView5);
}
//@Override
public int Result(int num1, int num2, int num3,int num4){
int grape=0, apple=0;
EditText ed1 = (EditText)findViewById(R.id.editText2);
EditText ed2 = (EditText)findViewById(R.id.editText3);
EditText ed3 = (EditText)findViewById(R.id.editText4);
EditText ed4 = (EditText)findViewById(R.id.editText5);
String re1, re2;
TextView A = (TextView)findViewById(R.id.apple);
TextView G = (TextView)findViewById(R.id.grape);
int a = Integer.parseInt(ed1.getText().toString());
int b = Integer.parseInt(ed2.getText().toString());
int c = Integer.parseInt(ed3.getText().toString());
int d = Integer.parseInt(ed4.getText().toString());
grape=0;
apple=0;
if(a==num1 && b==num2 && c==num3 && d==num4)
return 1;
if(a==num2 || a==num3 || a==num4) grape++;
if(b==num1 || b==num3 || b==num4) grape++;
if(c==num2 || c==num1 || c==num4) grape++;
if(d==num1 || d==num2 || d==num3) grape++;
if(a==num1) apple++;
if(b==num2) apple++;
if(c==num3) apple++;
if(d==num4) apple++;
re1 = Integer.toString(apple);
re2 = Integer.toString(grape);
A.setText(re1);
G.setText(re2);
ed1 = (EditText)findViewById(R.id.editText2);
ed2 = (EditText)findViewById(R.id.editText3);
ed3 = (EditText)findViewById(R.id.editText4);
ed4 = (EditText)findViewById(R.id.editText5);
a = Integer.parseInt(ed1.getText().toString());
b = Integer.parseInt(ed2.getText().toString());
c = Integer.parseInt(ed3.getText().toString());
d = Integer.parseInt(ed4.getText().toString());
return 0;
}
public void ShowDialog(int num1, int num2, int num3,int num4){
AlertDialog.Builder builder = new AlertDialog.Builder(Main7Activity.this);
builder.setTitle("Answer");
builder.setMessage(Integer.toString(num1)+Integer.toString(num2)+Integer.toString(num3)+Integer.toString(num4));
//builder.setPositiveButton("OK",builder.show());
builder.show();
}
public boolean onTouch(View view, MotionEvent motionEvent) {
return false;
}
} | [
"ViviYiWen@users.noreply.github.com"
] | ViviYiWen@users.noreply.github.com |
0b893ed4c1589c1d5cbcdb8cc7368aaab22947df | d9bbcfae6bb5437b68a2667c00172b816616b825 | /app/src/main/java/com/example/grzesiek/myapplication/DayTab.java | 2432afcc3dd7d61b8cf8a76708e17be02af6e3fa | [] | no_license | sarayutt/where-is-my-time | f466d6401f97bd97ab1d54a792aa0c7c008d38d8 | d3c0debf4670939be5cbf45f7cc0d700b65053f6 | refs/heads/master | 2021-04-06T05:29:25.173945 | 2016-03-02T06:07:37 | 2016-03-02T06:07:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 753 | java | package com.example.grzesiek.myapplication;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.support.v4.app.Fragment;
/**
* Created by grzesiek on 25.02.16.
*/
public class DayTab extends Fragment {
public DayTab() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.tab_1, container, false);
}
}
| [
"grzesiek.zajac1@gmail.com"
] | grzesiek.zajac1@gmail.com |
a5a9efa5b71b38d2cdfad398e0f45c921026c52a | 6482753b5eb6357e7fe70e3057195e91682db323 | /io/netty/util/Timeout.java | 4005a32bd0263e0df43bb1c1b70ba323763d60e0 | [] | no_license | TheShermanTanker/Server-1.16.3 | 45cf9996afa4cd4d8963f8fd0588ae4ee9dca93c | 48cc08cb94c3094ebddb6ccfb4ea25538492bebf | refs/heads/master | 2022-12-19T02:20:01.786819 | 2020-09-18T21:29:40 | 2020-09-18T21:29:40 | 296,730,962 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 188 | java | package io.netty.util;
public interface Timeout {
Timer timer();
TimerTask task();
boolean isExpired();
boolean isCancelled();
boolean cancel();
}
| [
"tanksherman27@gmail.com"
] | tanksherman27@gmail.com |
f62df9fb65a766cd5e0bcbc93e8b4e92e08c2c2c | f299f68321ed3e070a4ad2f0a28affa117c740dd | /src/main/java/com/mdv/corefinance/beans/Installment.java | 6291d8dcfc30caf3c593abf618bc9bed6f9a447a | [] | no_license | maxmcold/core-finance | 140a449c3dadd6d57dbe8fbae43bc53b443f39a2 | 35efa7da2272c99baeb0dddbd75c8d5c59a77b3b | refs/heads/master | 2020-04-28T21:43:21.878110 | 2019-07-16T10:32:31 | 2019-07-16T10:32:31 | 175,592,363 | 0 | 0 | null | 2019-07-14T07:41:11 | 2019-03-14T09:43:48 | Java | UTF-8 | Java | false | false | 125 | java | package com.mdv.corefinance.beans;
public class Installment {
private Double principal;
private Double interest;
}
| [
"massimo.delvecchio@channelvas.com"
] | massimo.delvecchio@channelvas.com |
9b9999f855608ccd622d1878ea5acaf67e4a2db7 | 35e5dc561b69b8014fb579d5cd671aa646ad5605 | /serv/src/main/java/at/tugraz/sss/serv/datatype/par/SSEntitiesSharedWithUsersPar.java | 8dbbaf54d3ed4d477a9f5fc4dc7bfb049d6a9e95 | [
"Apache-2.0"
] | permissive | learning-layers/SocialSemanticServer | 6a36e426586b6e73e0328a0d38b3a790417b8752 | 4d9402e11275b0cbbcb858f4c83d3ada165f3b91 | refs/heads/master | 2020-04-05T18:57:33.012817 | 2016-08-22T09:24:50 | 2016-08-22T09:24:50 | 17,632,122 | 6 | 4 | null | 2015-10-15T07:40:03 | 2014-03-11T13:54:18 | Java | UTF-8 | Java | false | false | 1,557 | java | /**
* Code contributed to the Learning Layers project
* http://www.learning-layers.eu
* Development is partly funded by the FP7 Programme of the European Commission under
* Grant Agreement FP7-ICT-318209.
* Copyright (c) 2015, Graz University of Technology - KTI (Knowledge Technologies Institute).
* For a list of contributors see the AUTHORS file at the top-level directory of this distribution.
*
* 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 at.tugraz.sss.serv.datatype.par;
import at.tugraz.sss.serv.datatype.*;
import at.tugraz.sss.serv.datatype.*;
public class SSEntitiesSharedWithUsersPar {
public SSUri user = null;
public SSEntity circle = null;
public boolean withUserRestriction = true;
public SSEntitiesSharedWithUsersPar(
final SSUri user,
final SSEntity circle,
final boolean withUserRestriction){
this.user = user;
this.circle = circle;
this.withUserRestriction = withUserRestriction;
}
}
| [
"dtheiler@tugraz.at"
] | dtheiler@tugraz.at |
ae59181c66b901f45083bb25a77b977324c36b76 | e03dff4bd73617652e9cbb6f38988366a302f367 | /src/main/java/com/netease/shijin/yitao/dao/ItemDao.java | ef04a9effea09137ddd3d3900afedb56ea2c1462 | [] | no_license | orangedy/yitao | 7fdf3d61f86e4ff68d4535518e7cac42dea648e0 | 4e76fdabc5c585b29a8f3b04e0b5258ca8047975 | refs/heads/master | 2020-12-24T17:44:51.295682 | 2014-07-23T17:03:54 | 2014-07-23T17:03:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 603 | java | package com.netease.shijin.yitao.dao;
import java.util.List;
import com.netease.shijin.yitao.bean.ItemBean;
import com.netease.shijin.yitao.bean.ItemDetailBean;
import com.netease.shijin.yitao.bean.QueryBean;
public interface ItemDao {
List<ItemBean> queryItem(QueryBean query);
ItemDetailBean getItemDetial(String itemID);
boolean addItem(ItemDetailBean itemDetail);
List<ItemBean> getMyItem(String userID, int page, int count);
boolean offShelve(String userID, String itemID);
List<ItemBean> searchItem(String keyword, int start, int count);
}
| [
"orangedy@outlook.com"
] | orangedy@outlook.com |
dcff86e0cc36dd263daba0ae2f5f805a0741520b | 53c961beb5382c98883c3525a4e9a6bab7aeef43 | /startrekj/src/main/java/startrekj/hpbasic/BooleanExpression.java | 1217ceb66a16be866b757479a64f2448e86d4455 | [
"MIT"
] | permissive | frankrefischer/STTRJ | 783fa917c0cb7abba545a488c4d1aa0586a67431 | bd08aadb65406a99fd5ff3a7c6c8a3bb5f64867c | refs/heads/master | 2020-05-30T05:13:37.641675 | 2013-10-20T08:57:19 | 2013-10-20T08:57:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 88 | java | package startrekj.hpbasic;
public interface BooleanExpression {
boolean evaluate();
}
| [
"frankfischer@macbook"
] | frankfischer@macbook |
078df9cc7c4427c8194503c57036d6792d0ee850 | ea9e540609817b577aa6411113eea1e451500fe9 | /src/main/java/com/s3corp/domain/Employee.java | e935acd25ddb4544bb2e18a1976f527e67774cff | [] | no_license | nvtrai/sonarTest | 73dddbc0056576cd79022944182b990ef80a5b28 | 4372e025317343c6b21c69e56c22179ef707a862 | refs/heads/master | 2020-03-12T12:49:46.531582 | 2018-04-23T02:14:48 | 2018-04-23T02:14:48 | 130,627,547 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,150 | java | package com.s3corp.domain;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "S3CORP.employee")
public class Employee implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@Column(name = "EMP_NAME")
private String empName;
@Column(name = "EMP_HIRE_DATE")
private Date empHireDate;
@Column(name = "EMP_SALARY")
private Double empSalary;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getEmpName() {
return empName;
}
public void setEmpName(String empName) {
this.empName = empName;
}
public Date getEmpHireDate() {
return empHireDate;
}
public void setEmpHireDate(Date empHireDate) {
this.empHireDate = empHireDate;
}
public Double getEmpSalary() {
return empSalary;
}
public void setEmpSalary(Double empSalary) {
this.empSalary = empSalary;
}
} | [
"nvtrai1989@gmail.com"
] | nvtrai1989@gmail.com |
832d3733dfa1e88cd4abe8fdf7e9d2deeb7eae1e | 0e3ddb7a7053e0c77fc2d49314e4bb652b1f6cf8 | /src/main/java/com/wsicong/enroll/controller/IndexController.java | 784d91a36ec17b210243f9f49077d483deec885e | [] | no_license | wsicong/GraduationProject | 1d15ec6db501978d8ed50794c8eccbcf54dcfae3 | e04a666342edd25320199c4aee833128a2972e5e | refs/heads/master | 2020-05-01T15:01:11.158882 | 2019-05-03T17:20:31 | 2019-05-03T17:20:31 | 177,535,726 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,261 | java | package com.wsicong.enroll.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import java.io.UnsupportedEncodingException;
@Controller
@RequestMapping("/")
public class IndexController {
private static final Logger logger = LoggerFactory.getLogger(IndexController.class);
@RequestMapping("/index")
public String index() {
logger.debug("-------------index------------");
return "index";
}
@RequestMapping("/home")
public String toHome() {
logger.debug("===111-------------home------------");
return "home";
}
@RequestMapping("/login")
public String toLogin() {
logger.debug("===111-------------login------------");
return "login";
}
@RequestMapping("/userLogin")
public String touserLogin() {
logger.debug("===111-------------login------------");
return "userLogin";
}
@RequestMapping("/userRegister")
public String touserRegister() {
logger.debug("===111-------------login------------");
return "userRegister";
}
@RequestMapping("/{page}")
public String toPage(@PathVariable("page") String page) {
logger.debug("-------------toindex------------" + page);
return page;
}
public static void main(String[] args) {
// 年月日文件夹
/*SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
String basedir = sdf.format(new Date());
System.out.println(basedir);*/
// å¶ç»§å
/*
* String str=RPCMD5.TwoMD5("_ja2011mi_"+"1");
*
* System.out.println("str=="+str); å¯ç±ä½ çç¬ 3个èçè
* wkkçå¯å¯
*/
String uniqueFlag = "";
try {
uniqueFlag = new String("çç".getBytes("ISO-8859-1"),
"UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("uniqueFlag==" + uniqueFlag);
}
}
| [
"wsicong@foxmail.com"
] | wsicong@foxmail.com |
28d280687907a740a729f75d1e1ddd11aebecfc7 | 831629a9f25b840a61eb17ec37f05ff19bbc5bac | /yun-authority-core/src/main/java/com/yun/authority/core/exception/NotSafeException.java | b588973bdcc6e1f5712a8bb1657dbd4d96ac5a44 | [] | no_license | kaiyun1206/yun-authority | 8c3f825be637bb4804f2722a1fd50c6ba267cc83 | e1c20643f0a32f272d8353365ea0b5261dd222d1 | refs/heads/master | 2023-07-12T05:28:55.077736 | 2021-08-13T03:23:59 | 2021-08-13T03:23:59 | 395,507,058 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 588 | java | package com.yun.authority.core.exception;
import com.yun.footstone.common.exception.BaseException;
/**
* <p>
* 会话未能通过二级认证
* </p>
*
* @author sunkaiyun
* @version 1.0
* @date 2021-08-10 16:54
*/
public class NotSafeException extends BaseException {
private static final long serialVersionUID = -3876712198628139570L;
/** 异常提示语 */
public static final String BE_MESSAGE = "二级认证失败";
/**
* 一个异常:代表会话未通过二级认证
*/
public NotSafeException() {
super(BE_MESSAGE);
}
}
| [
"sunzhenlei@xdf.cn"
] | sunzhenlei@xdf.cn |
788884536b56d4cd3979f9f798cc3426c653e7b7 | 67ec60c810cdd63eab37d54056a56f8094026065 | /app/src/com/d2cmall/buyer/bean/PhotoDirectory.java | 3a0161ac8796c188e08f9a3ee37a9b0a0fd2dfcb | [] | no_license | sinbara0813/fashion | 2e2ef73dd99c71f2bebe0fc984d449dc67d5c4c5 | 4127db4963b0633cc3ea806851441bc0e08e6345 | refs/heads/master | 2020-08-18T04:43:25.753009 | 2019-10-25T02:28:47 | 2019-10-25T02:28:47 | 215,748,112 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,032 | java | package com.d2cmall.buyer.bean;
import java.util.ArrayList;
import java.util.List;
/**
* Created by donglua on 15/6/28.
*/
public class PhotoDirectory {
private int id;
private String coverPath;
private String name;
private long dateAdded;
private List<Photo> photos = new ArrayList<>();
private boolean selected = false;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof PhotoDirectory)) return false;
PhotoDirectory directory = (PhotoDirectory) o;
return id == directory.getId();
}
public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCoverPath() {
return coverPath;
}
public void setCoverPath(String coverPath) {
this.coverPath = coverPath;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public long getDateAdded() {
return dateAdded;
}
public void setDateAdded(long dateAdded) {
this.dateAdded = dateAdded;
}
public List<Photo> getPhotos() {
return photos;
}
public void setPhotos(List<Photo> photos) {
if (photos == null) return;
for (int i = 0, j = 0, num = photos.size(); i < num; i++) {
Photo p = photos.get(j);
if (p == null) {
photos.remove(j);
} else {
j++;
}
}
this.photos = photos;
}
public List<String> getPhotoPaths() {
List<String> paths = new ArrayList<>(photos.size());
for (Photo photo : photos) {
paths.add(photo.getPath());
}
return paths;
}
public void addPhoto(Photo photo) {
photos.add(photo);
}
}
| [
"940258169@qq.com"
] | 940258169@qq.com |
1b7ed63ceb3327bef7986a58026323b85a5f3b11 | 5f9d7c5ab2e42a92336019bc86dccb8520c746f5 | /src/Unit17/SimplePicture.java | c27ae95112cebba595913cc440a51c34c91f391c | [] | no_license | jsgharib/Unit17 | 0fa8858f7930365bd0cbac8aa3baffc1f9c29cdd | 7ef4193d0ee6d976be7c62d05b2340ed2135593d | refs/heads/master | 2020-05-19T02:36:20.150494 | 2019-05-03T16:01:32 | 2019-05-03T16:01:32 | 184,783,818 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 24,023 | java | package Unit17;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import java.awt.*;
import java.io.*;
import java.awt.geom.*;
/**
* A class that represents a simple picture. A simple picture may have an
* associated file name and a title. A simple picture has pixels, width, and
* height. A simple picture uses a BufferedImage to hold the pixels. You can
* show a simple picture in a PictureFrame (a JFrame). You can also explore a
* simple picture.
*
* @author Barb Ericson ericson@cc.gatech.edu
*/
public class SimplePicture implements DigitalPicture {
/////////////////////// Fields /////////////////////////
/**
* the file name associated with the simple picture
*/
private String fileName;
/**
* the title of the simple picture
*/
private String title;
/**
* buffered image to hold pixels for the simple picture
*/
private BufferedImage bufferedImage;
/**
* frame used to display the simple picture
*/
private PictureFrame pictureFrame;
/**
* extension for this file (jpg or bmp)
*/
private String extension;
/////////////////////// Constructors /////////////////////////
/**
* A Constructor that takes no arguments. It creates a picture with a width
* of 200 and a height of 100 that is all white. A no-argument constructor
* must be given in order for a class to be able to be subclassed. By
* default all subclasses will implicitly call this in their parent's
* no-argument constructor unless a different call to super() is explicitly
* made as the first line of code in a constructor.
*/
public SimplePicture() {
this(200, 100);
}
/**
* A Constructor that takes a file name and uses the file to create a
* picture
*
* @param fileName the file name to use in creating the picture
*/
public SimplePicture(String fileName) {
// load the picture into the buffered image
load("src/images/" + fileName);
}
/**
* A constructor that takes the width and height desired for a picture and
* creates a buffered image of that size. This constructor doesn't show the
* picture. The pixels will all be white.
*
* @param width the desired width
* @param height the desired height
*/
public SimplePicture(int width, int height) {
bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
title = "None";
fileName = "None";
extension = "jpg";
setAllPixelsToAColor(Color.white);
}
/**
* A constructor that takes the width and height desired for a picture and
* creates a buffered image of that size. It also takes the color to use for
* the background of the picture.
*
* @param width the desired width
* @param height the desired height
* @param theColor the background color for the picture
*/
public SimplePicture(int width, int height, Color theColor) {
this(width, height);
setAllPixelsToAColor(theColor);
}
/**
* A Constructor that takes a picture to copy information from
*
* @param copyPicture the picture to copy from
*/
public SimplePicture(SimplePicture copyPicture) {
if (copyPicture.fileName != null) {
this.fileName = new String(copyPicture.fileName);
this.extension = copyPicture.extension;
}
if (copyPicture.title != null) {
this.title = new String(copyPicture.title);
}
if (copyPicture.bufferedImage != null) {
this.bufferedImage = new BufferedImage(copyPicture.getWidth(),
copyPicture.getHeight(), BufferedImage.TYPE_INT_RGB);
this.copyPicture(copyPicture);
}
}
/**
* A constructor that takes a buffered image
*
* @param image the buffered image
*/
public SimplePicture(BufferedImage image) {
this.bufferedImage = image;
title = "None";
fileName = "None";
extension = "jpg";
}
////////////////////////// Methods //////////////////////////////////
/**
* Method to get the extension for this picture
*
* @return the extension (jpg, bmp, giff, etc)
*/
public String getExtension() {
return extension;
}
/**
* Method that will copy all of the passed source picture into the current
* picture object
*
* @param sourcePicture the picture object to copy
*/
public void copyPicture(SimplePicture sourcePicture) {
Pixel sourcePixel = null;
Pixel targetPixel = null;
// loop through the columns
for (int sourceX = 0, targetX = 0;
sourceX < sourcePicture.getWidth()
&& targetX < this.getWidth();
sourceX++, targetX++) {
// loop through the rows
for (int sourceY = 0, targetY = 0;
sourceY < sourcePicture.getHeight()
&& targetY < this.getHeight();
sourceY++, targetY++) {
sourcePixel = sourcePicture.getPixel(sourceX, sourceY);
targetPixel = this.getPixel(targetX, targetY);
targetPixel.setColor(sourcePixel.getColor());
}
}
}
/**
* Method to set the color in the picture to the passed color
*
* @param color the color to set to
*/
public void setAllPixelsToAColor(Color color) {
// loop through all x
for (int x = 0; x < this.getWidth(); x++) {
// loop through all y
for (int y = 0; y < this.getHeight(); y++) {
getPixel(x, y).setColor(color);
}
}
}
/**
* Method to get the buffered image
*
* @return the buffered image
*/
public BufferedImage getBufferedImage() {
return bufferedImage;
}
/**
* Method to get a graphics object for this picture to use to draw on
*
* @return a graphics object to use for drawing
*/
public Graphics getGraphics() {
return bufferedImage.getGraphics();
}
/**
* Method to get a Graphics2D object for this picture which can be used to
* do 2D drawing on the picture
*/
public Graphics2D createGraphics() {
return bufferedImage.createGraphics();
}
/**
* Method to get the file name associated with the picture
*
* @return the file name associated with the picture
*/
public String getFileName() {
return fileName;
}
/**
* Method to set the file name
*
* @param name the full pathname of the file
*/
public void setFileName(String name) {
fileName = name;
}
/**
* Method to get the title of the picture
*
* @return the title of the picture
*/
public String getTitle() {
return title;
}
/**
* Method to set the title for the picture
*
* @param title the title to use for the picture
*/
public void setTitle(String title) {
this.title = title;
if (pictureFrame != null) {
pictureFrame.setTitle(title);
}
}
/**
* Method to get the width of the picture in pixels
*
* @return the width of the picture in pixels
*/
public int getWidth() {
return bufferedImage.getWidth();
}
/**
* Method to get the height of the picture in pixels
*
* @return the height of the picture in pixels
*/
public int getHeight() {
return bufferedImage.getHeight();
}
/**
* Method to get the picture frame for the picture
*
* @return the picture frame associated with this picture (it may be null)
*/
public PictureFrame getPictureFrame() {
return pictureFrame;
}
/**
* Method to set the picture frame for this picture
*
* @param pictureFrame the picture frame to use
*/
public void setPictureFrame(PictureFrame pictureFrame) {
// set this picture object's picture frame to the passed one
this.pictureFrame = pictureFrame;
}
/**
* Method to get an image from the picture
*
* @return the buffered image since it is an image
*/
public Image getImage() {
return bufferedImage;
}
/**
* Method to return the pixel value as an int for the given x and y location
*
* @param x the x coordinate of the pixel
* @param y the y coordinate of the pixel
* @return the pixel value as an integer (alpha, red, green, blue)
*/
public int getBasicPixel(int x, int y) {
return bufferedImage.getRGB(x, y);
}
/**
* Method to set the value of a pixel in the picture from an int
*
* @param x the x coordinate of the pixel
* @param y the y coordinate of the pixel
* @param rgb the new rgb value of the pixel (alpha, red, green, blue)
*/
public void setBasicPixel(int x, int y, int rgb) {
bufferedImage.setRGB(x, y, rgb);
}
/**
* Method to get a pixel object for the given x and y location
*
* @param x the x location of the pixel in the picture
* @param y the y location of the pixel in the picture
* @return a Pixel object for this location
*/
public Pixel getPixel(int x, int y) {
// create the pixel object for this picture and the given x and y location
Pixel pixel = new Pixel(this, x, y);
return pixel;
}
/**
* Method to get a one-dimensional array of Pixels for this simple picture
*
* @return a one-dimensional array of Pixel objects starting with y=0 to
* y=height-1 and x=0 to x=width-1.
*/
public Pixel[] getPixels() {
int width = getWidth();
int height = getHeight();
Pixel[] pixelArray = new Pixel[width * height];
// loop through height rows from top to bottom
for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
pixelArray[row * width + col] = new Pixel(this, col, row);
}
}
return pixelArray;
}
/**
* Method to get a two-dimensional array of Pixels for this simple picture
*
* @return a two-dimensional array of Pixel objects in row-major order.
*/
public Pixel[][] getPixels2D() {
int width = getWidth();
int height = getHeight();
Pixel[][] pixelArray = new Pixel[height][width];
// loop through height rows from top to bottom
for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
pixelArray[row][col] = new Pixel(this, col, row);
}
}
return pixelArray;
}
/**
* Method to load the buffered image with the passed image
*
* @param image the image to use
*/
public void load(Image image) {
// get a graphics context to use to draw on the buffered image
Graphics2D graphics2d = bufferedImage.createGraphics();
// draw the image on the buffered image starting at 0,0
graphics2d.drawImage(image, 0, 0, null);
// show the new image
show();
}
/**
* Method to show the picture in a picture frame
*/
public void show() {
// if there is a current picture frame then use it
if (pictureFrame != null) {
pictureFrame.updateImageAndShowIt();
} // else create a new picture frame with this picture
else {
pictureFrame = new PictureFrame(this);
}
}
/**
* Method to hide the picture display
*/
public void hide() {
if (pictureFrame != null) {
pictureFrame.setVisible(false);
}
}
/**
* Method to make this picture visible or not
*
* @param flag true if you want it visible else false
*/
public void setVisible(boolean flag) {
if (flag) {
this.show();
} else {
this.hide();
}
}
/**
* Method to open a picture explorer on a copy (in memory) of this simple
* picture
*/
public void explore() {
// create a copy of the current picture and explore it
new PictureExplorer(new SimplePicture(this));
}
/**
* Method to force the picture to repaint itself. This is very useful after
* you have changed the pixels in a picture and you want to see the change.
*/
public void repaint() {
// if there is a picture frame tell it to repaint
if (pictureFrame != null) {
pictureFrame.repaint();
} // else create a new picture frame
else {
pictureFrame = new PictureFrame(this);
}
}
/**
* Method to load the picture from the passed file name
*
* @param fileName the file name to use to load the picture from
* @throws IOException if the picture isn't found
*/
public void loadOrFail(String fileName) throws IOException {
// set the current picture's file name
this.fileName = fileName;
// set the extension
int posDot = fileName.indexOf('.');
if (posDot >= 0) {
this.extension = fileName.substring(posDot + 1);
}
// if the current title is null use the file name
if (title == null) {
title = fileName;
}
File file = new File(this.fileName);
if (!file.canRead()) {
// try adding the media path
file = new File(FileChooser.getMediaPath(this.fileName));
if (!file.canRead()) {
throw new IOException(this.fileName
+ " could not be opened. Check that you specified the path");
}
}
bufferedImage = ImageIO.read(file);
}
/**
* Method to read the contents of the picture from a filename without
* throwing errors
*
* @param fileName the name of the file to write the picture to
* @return true if success else false
*/
public boolean load(String fileName) {
try {
this.loadOrFail(fileName);
return true;
} catch (Exception ex) {
System.out.println("There was an error trying to open " + fileName);
bufferedImage = new BufferedImage(600, 200,
BufferedImage.TYPE_INT_RGB);
addMessage("Couldn't load " + fileName, 5, 100);
return false;
}
}
/**
* Method to load the picture from the passed file name this just calls
* load(fileName) and is for name compatibility
*
* @param fileName the file name to use to load the picture from
* @return true if success else false
*/
public boolean loadImage(String fileName) {
return load(fileName);
}
/**
* Method to draw a message as a string on the buffered image
*
* @param message the message to draw on the buffered image
* @param xPos the x coordinate of the leftmost point of the string
* @param yPos the y coordinate of the bottom of the string
*/
public void addMessage(String message, int xPos, int yPos) {
// get a graphics context to use to draw on the buffered image
Graphics2D graphics2d = bufferedImage.createGraphics();
// set the color to white
graphics2d.setPaint(Color.white);
// set the font to Helvetica bold style and size 16
graphics2d.setFont(new Font("Helvetica", Font.BOLD, 16));
// draw the message
graphics2d.drawString(message, xPos, yPos);
}
/**
* Method to draw a string at the given location on the picture
*
* @param text the text to draw
* @param xPos the left x for the text
* @param yPos the top y for the text
*/
public void drawString(String text, int xPos, int yPos) {
addMessage(text, xPos, yPos);
}
/**
* Method to create a new picture by scaling the current picture by the
* given x and y factors
*
* @param xFactor the amount to scale in x
* @param yFactor the amount to scale in y
* @return the resulting picture
*/
public Picture scale(double xFactor, double yFactor) {
// set up the scale transform
AffineTransform scaleTransform = new AffineTransform();
scaleTransform.scale(xFactor, yFactor);
// create a new picture object that is the right size
Picture result = new Picture((int) (getWidth() * xFactor),
(int) (getHeight() * yFactor));
// get the graphics 2d object to draw on the result
Graphics graphics = result.getGraphics();
Graphics2D g2 = (Graphics2D) graphics;
// draw the current image onto the result image scaled
g2.drawImage(this.getImage(), scaleTransform, null);
return result;
}
/**
* Method to create a new picture of the passed width. The aspect ratio of
* the width and height will stay the same.
*
* @param width the desired width
* @return the resulting picture
*/
public Picture getPictureWithWidth(int width) {
// set up the scale transform
double xFactor = (double) width / this.getWidth();
Picture result = scale(xFactor, xFactor);
return result;
}
/**
* Method to create a new picture of the passed height. The aspect ratio of
* the width and height will stay the same.
*
* @param height the desired height
* @return the resulting picture
*/
public Picture getPictureWithHeight(int height) {
// set up the scale transform
double yFactor = (double) height / this.getHeight();
Picture result = scale(yFactor, yFactor);
return result;
}
/**
* Method to load a picture from a file name and show it in a picture frame
*
* @param fileName the file name to load the picture from
* @return true if success else false
*/
public boolean loadPictureAndShowIt(String fileName) {
boolean result = true; // the default is that it worked
// try to load the picture into the buffered image from the file name
result = load(fileName);
// show the picture in a picture frame
show();
return result;
}
/**
* Method to write the contents of the picture to a file with the passed
* name
*
* @param fileName the name of the file to write the picture to
*/
public void writeOrFail(String fileName) throws IOException {
String extension = this.extension; // the default is current
// create the file object
File file = new File(fileName);
File fileLoc = file.getParentFile(); // directory name
// if there is no parent directory use the current media dir
if (fileLoc == null) {
fileName = FileChooser.getMediaPath(fileName);
file = new File(fileName);
fileLoc = file.getParentFile();
}
// check that you can write to the directory
if (!fileLoc.canWrite()) {
throw new IOException(fileName
+ " could not be opened. Check to see if you can write to the directory.");
}
// get the extension
int posDot = fileName.indexOf('.');
if (posDot >= 0) {
extension = fileName.substring(posDot + 1);
}
// write the contents of the buffered image to the file
ImageIO.write(bufferedImage, extension, file);
}
/**
* Method to write the contents of the picture to a file with the passed
* name without throwing errors
*
* @param fileName the name of the file to write the picture to
* @return true if success else false
*/
public boolean write(String fileName) {
try {
this.writeOrFail(fileName);
return true;
} catch (Exception ex) {
System.out.println("There was an error trying to write " + fileName);
ex.printStackTrace();
return false;
}
}
/**
* Method to get the directory for the media
*
* @param fileName the base file name to use
* @return the full path name by appending the file name to the media
* directory
*/
public static String getMediaPath(String fileName) {
return FileChooser.getMediaPath(fileName);
}
/**
* Method to get the coordinates of the enclosing rectangle after this
* transformation is applied to the current picture
*
* @return the enclosing rectangle
*/
public Rectangle2D getTransformEnclosingRect(AffineTransform trans) {
int width = getWidth();
int height = getHeight();
double maxX = width - 1;
double maxY = height - 1;
double minX, minY;
Point2D.Double p1 = new Point2D.Double(0, 0);
Point2D.Double p2 = new Point2D.Double(maxX, 0);
Point2D.Double p3 = new Point2D.Double(maxX, maxY);
Point2D.Double p4 = new Point2D.Double(0, maxY);
Point2D.Double result = new Point2D.Double(0, 0);
Rectangle2D.Double rect = null;
// get the new points and min x and y and max x and y
trans.deltaTransform(p1, result);
minX = result.getX();
maxX = result.getX();
minY = result.getY();
maxY = result.getY();
trans.deltaTransform(p2, result);
minX = Math.min(minX, result.getX());
maxX = Math.max(maxX, result.getX());
minY = Math.min(minY, result.getY());
maxY = Math.max(maxY, result.getY());
trans.deltaTransform(p3, result);
minX = Math.min(minX, result.getX());
maxX = Math.max(maxX, result.getX());
minY = Math.min(minY, result.getY());
maxY = Math.max(maxY, result.getY());
trans.deltaTransform(p4, result);
minX = Math.min(minX, result.getX());
maxX = Math.max(maxX, result.getX());
minY = Math.min(minY, result.getY());
maxY = Math.max(maxY, result.getY());
// create the bounding rectangle to return
rect = new Rectangle2D.Double(minX, minY, maxX - minX + 1, maxY - minY + 1);
return rect;
}
/**
* Method to get the coordinates of the enclosing rectangle after this
* transformation is applied to the current picture
*
* @return the enclosing rectangle
*/
public Rectangle2D getTranslationEnclosingRect(AffineTransform trans) {
return getTransformEnclosingRect(trans);
}
/**
* Method to return a string with information about this picture
*
* @return a string with information about the picture
*/
public String toString() {
String output = "Simple Picture, filename " + fileName
+ " height " + getHeight() + " width " + getWidth();
return output;
}
} // end of SimplePicture class
| [
"gharibj6942@CA-SU-F106-22.sduhsd.lan"
] | gharibj6942@CA-SU-F106-22.sduhsd.lan |
f822f3b648d05d9392c327309ec3bbf8c76451e7 | 0e5a8876c6196fcc79f4ff09f6b1715f64d873d0 | /fun-system/src/main/java/com/fun/system/service/impl/SysRoleServiceImpl.java | f60b861fc7ac2c950dc184ab9d22afc49ad7ef38 | [] | no_license | mrdjun/funboot-multi | d2a9de6d519bbf29e1188c602fa502cb69bfda73 | 9d8ef6be1cc0e0f63c74403737e41c4a0a920af0 | refs/heads/master | 2023-01-19T22:01:36.213283 | 2020-11-30T02:58:39 | 2020-11-30T02:58:39 | 306,553,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,685 | java | package com.fun.system.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.fun.common.annotation.DataScope;
import com.fun.common.constant.UserConstants;
import com.fun.common.core.text.Convert;
import com.fun.common.exception.BusinessException;
import com.fun.common.utils.StringUtils;
import com.fun.common.utils.spring.SpringUtils;
import com.fun.system.domain.SysRole;
import com.fun.system.domain.SysRoleDept;
import com.fun.system.domain.SysRoleMenu;
import com.fun.system.domain.SysUserRole;
import com.fun.system.mapper.SysRoleDeptMapper;
import com.fun.system.mapper.SysRoleMapper;
import com.fun.system.mapper.SysRoleMenuMapper;
import com.fun.system.mapper.SysUserRoleMapper;
import com.fun.system.service.ISysRoleService;
/**
* 角色 业务层处理
*
* @author mrdjun
*/
@Service
public class SysRoleServiceImpl implements ISysRoleService {
@Autowired
private SysRoleMapper roleMapper;
@Autowired
private SysRoleMenuMapper roleMenuMapper;
@Autowired
private SysUserRoleMapper userRoleMapper;
@Autowired
private SysRoleDeptMapper roleDeptMapper;
/**
* 根据条件分页查询角色数据
*
* @param role 角色信息
* @return 角色数据集合信息
*/
@Override
@DataScope(deptAlias = "d")
public List<SysRole> selectRoleList(SysRole role) {
return roleMapper.selectRoleList(role);
}
/**
* 根据用户ID查询权限
*
* @param userId 用户ID
* @return 权限列表
*/
@Override
public Set<String> selectRoleKeys(Long userId) {
List<SysRole> perms = roleMapper.selectRolesByUserId(userId);
Set<String> permsSet = new HashSet<>();
for (SysRole perm : perms) {
if (StringUtils.isNotNull(perm)) {
permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
}
}
return permsSet;
}
/**
* 根据用户ID查询角色
*
* @param userId 用户ID
* @return 角色列表
*/
@Override
public List<SysRole> selectRolesByUserId(Long userId) {
List<SysRole> userRoles = roleMapper.selectRolesByUserId(userId);
List<SysRole> roles = selectRoleAll();
for (SysRole role : roles) {
for (SysRole userRole : userRoles) {
if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) {
role.setFlag(true);
break;
}
}
}
return roles;
}
/**
* 查询所有角色
*
* @return 角色列表
*/
@Override
public List<SysRole> selectRoleAll() {
return SpringUtils.getAopProxy(this).selectRoleList(new SysRole());
}
/**
* 通过角色ID查询角色
*
* @param roleId 角色ID
* @return 角色对象信息
*/
@Override
public SysRole selectRoleById(Long roleId) {
return roleMapper.selectRoleById(roleId);
}
/**
* 通过角色ID删除角色
*
* @param roleId 角色ID
* @return 结果
*/
@Override
public boolean deleteRoleById(Long roleId) {
return roleMapper.deleteRoleById(roleId) > 0 ? true : false;
}
/**
* 批量删除角色信息
*
* @param ids 需要删除的数据ID
* @throws Exception
*/
@Override
public int deleteRoleByIds(String ids) throws BusinessException {
Long[] roleIds = Convert.toLongArray(ids);
for (Long roleId : roleIds) {
checkRoleAllowed(new SysRole(roleId));
SysRole role = selectRoleById(roleId);
if (countUserRoleByRoleId(roleId) > 0) {
throw new BusinessException(String.format("%1$s已分配,不能删除", role.getRoleName()));
}
}
return roleMapper.deleteRoleByIds(roleIds);
}
/**
* 新增保存角色信息
*
* @param role 角色信息
* @return 结果
*/
@Override
@Transactional
public int insertRole(SysRole role) {
// 新增角色信息
roleMapper.insertRole(role);
return insertRoleMenu(role);
}
/**
* 修改保存角色信息
*
* @param role 角色信息
* @return 结果
*/
@Override
@Transactional
public int updateRole(SysRole role) {
// 修改角色信息
roleMapper.updateRole(role);
// 删除角色与菜单关联
roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId());
return insertRoleMenu(role);
}
/**
* 修改数据权限信息
*
* @param role 角色信息
* @return 结果
*/
@Override
@Transactional
public int authDataScope(SysRole role) {
// 修改角色信息
roleMapper.updateRole(role);
// 删除角色与部门关联
roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId());
// 新增角色和部门信息(数据权限)
return insertRoleDept(role);
}
/**
* 新增角色菜单信息
*
* @param role 角色对象
*/
public int insertRoleMenu(SysRole role) {
int rows = 1;
// 新增用户与角色管理
List<SysRoleMenu> list = new ArrayList<SysRoleMenu>();
for (Long menuId : role.getMenuIds()) {
SysRoleMenu rm = new SysRoleMenu();
rm.setRoleId(role.getRoleId());
rm.setMenuId(menuId);
list.add(rm);
}
if (list.size() > 0) {
rows = roleMenuMapper.batchRoleMenu(list);
}
return rows;
}
/**
* 新增角色部门信息(数据权限)
*
* @param role 角色对象
*/
public int insertRoleDept(SysRole role) {
int rows = 1;
// 新增角色与部门(数据权限)管理
List<SysRoleDept> list = new ArrayList<SysRoleDept>();
for (Long deptId : role.getDeptIds()) {
SysRoleDept rd = new SysRoleDept();
rd.setRoleId(role.getRoleId());
rd.setDeptId(deptId);
list.add(rd);
}
if (list.size() > 0) {
rows = roleDeptMapper.batchRoleDept(list);
}
return rows;
}
/**
* 校验角色名称是否唯一
*
* @param role 角色信息
* @return 结果
*/
@Override
public String checkRoleNameUnique(SysRole role) {
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
return UserConstants.ROLE_NAME_NOT_UNIQUE;
}
return UserConstants.ROLE_NAME_UNIQUE;
}
/**
* 校验角色权限是否唯一
*
* @param role 角色信息
* @return 结果
*/
@Override
public String checkRoleKeyUnique(SysRole role) {
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
return UserConstants.ROLE_KEY_NOT_UNIQUE;
}
return UserConstants.ROLE_KEY_UNIQUE;
}
/**
* 校验角色是否允许操作
*
* @param role 角色信息
*/
@Override
public void checkRoleAllowed(SysRole role) {
if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) {
throw new BusinessException("不允许操作超级管理员角色");
}
}
/**
* 通过角色ID查询角色使用数量
*
* @param roleId 角色ID
* @return 结果
*/
@Override
public int countUserRoleByRoleId(Long roleId) {
return userRoleMapper.countUserRoleByRoleId(roleId);
}
/**
* 角色状态修改
*
* @param role 角色信息
* @return 结果
*/
@Override
public int changeStatus(SysRole role) {
return roleMapper.updateRole(role);
}
/**
* 取消授权用户角色
*
* @param userRole 用户和角色关联信息
* @return 结果
*/
@Override
public int deleteAuthUser(SysUserRole userRole) {
return userRoleMapper.deleteUserRoleInfo(userRole);
}
/**
* 批量取消授权用户角色
*
* @param roleId 角色ID
* @param userIds 需要删除的用户数据ID
* @return 结果
*/
@Override
public int deleteAuthUsers(Long roleId, String userIds) {
return userRoleMapper.deleteUserRoleInfos(roleId, Convert.toLongArray(userIds));
}
/**
* 批量选择授权用户角色
*
* @param roleId 角色ID
* @param userIds 需要删除的用户数据ID
* @return 结果
*/
@Override
public int insertAuthUsers(Long roleId, String userIds) {
Long[] users = Convert.toLongArray(userIds);
// 新增用户与角色管理
List<SysUserRole> list = new ArrayList<SysUserRole>();
for (Long userId : users) {
SysUserRole ur = new SysUserRole();
ur.setUserId(userId);
ur.setRoleId(roleId);
list.add(ur);
}
return userRoleMapper.batchUserRole(list);
}
}
| [
"mr.djun@qq.com"
] | mr.djun@qq.com |
7eb434c0adb1f4d00cac0d7a6af1a4d16e58167d | e18aa0964f23c72a60801044dee81826afb2c30b | /cpsc476/Project3/V3.3/UrlShortnerProjV3/source/production/java/com/cpsc476/site/user/UserDaoImp.java | 1a3f6d3c0ab379b561a54c79d80275dd7a85f2f9 | [] | no_license | deannaji/Java-Development | 22267e1cf19eadea9e1a72092521808e6d49909d | 4c342dc2062a8ab1ae8936d65510463267220cb4 | refs/heads/master | 2021-04-29T09:09:59.393439 | 2016-12-29T20:27:17 | 2016-12-29T20:27:17 | 77,637,844 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,950 | java | package com.cpsc476.site.user;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import com.cpsc476.site.url.Url;
public class UserDaoImp extends JdbcDaoSupport implements UserDaoInterface{
/* (non-Javadoc)
* @see com.cpsc476.UserDaoInterface#getOneRow(java.lang.String)
*/
@Override
public Url getOneRow(String username,String password){
return getJdbcTemplate().queryForObject("Select count(username) as counts from project3.userdetails where username = ? and password = ?", new userMapper(),username,password);
}
/* (non-Javadoc)
* @see com.cpsc476.UserDaoInterface#insertOneRow(java.lang.String, java.lang.String)
*/
@Override
public void insertOneRow(String username, String password){
getJdbcTemplate().update("insert into project3.userdetails(username, password) values (?,?)",username,password);
}
/* (non-Javadoc)
* @see com.cpsc476.UserDaoInterface#checkforuser(java.lang.String)
*/
@Override
public Url checkforuser(String username){
return getJdbcTemplate().queryForObject("Select count(username) as counts from project3.userdetails where username = ?", new usercheckerMapper(),username);
}
private static final class userMapper implements RowMapper<Url> {
public Url mapRow(ResultSet rs, int rowNum) throws SQLException {
Url actor = new Url();
actor.setUserCount(rs.getInt("counts"));
//actor.setUsername(rs.getString("username"));
//actor.setPassword(rs.getString("password"));
return actor;
}
}
private static final class usercheckerMapper implements RowMapper<Url> {
public Url mapRow(ResultSet rs, int rowNum) throws SQLException {
Url actor = new Url();
actor.setUserCount(rs.getInt("counts"));
/*actor.setPassword(rs.getString("password"));*/
return actor;
}
}
} | [
"deannaji@csu.fullerton.edu"
] | deannaji@csu.fullerton.edu |
e3f2e56a0d227657baa1c00c98a9a944aa2b521c | 8f59ac1ee3928ac0a769198074d271654374a93c | /src/main/java/com/chensee/aop/Test1.java | b3158dcf90bd79b79bb1154f76e4a610773a3bf9 | [] | no_license | ah0507/designPatterns | 8fcd0d7d021418fa206c59686d9966f01f26629f | 9f8e5e92b45ba89e9d9e9e35690ad277569d2c69 | refs/heads/master | 2022-07-05T19:27:19.691989 | 2020-05-18T06:23:28 | 2020-05-18T06:23:28 | 264,211,293 | 0 | 0 | null | 2020-05-15T14:42:17 | 2020-05-15T14:13:18 | Java | UTF-8 | Java | false | false | 963 | java | package com.chensee.aop;
import com.chensee.DesignPatternsApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
/**
* @author gaohang
* @title: Test
* @projectName DesignPatterns
* @date 2019/10/12 16:54
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = DesignPatternsApplication.class)
public class Test1 {
@Autowired
private BaseService baseService;
@Test
public void bbb(){
System.out.println("单元测试开始");
String msg;
try {
baseService.anoundTest("111",1);
msg = "成功!";
} catch (Exception e) {
e.printStackTrace();
msg = "失败!";
}
System.out.println(msg);
System.out.println("单元测试完成");
}
}
| [
"ahang0507@163.com"
] | ahang0507@163.com |
0eef3183769e7645b0c5051779aaf73cd15a498f | ed3cb95dcc590e98d09117ea0b4768df18e8f99e | /project_1_1/src/j/j/i/Calc_1_1_9984.java | 65d54e6f67755e59677617bde064b54e4acce9f5 | [] | no_license | chalstrick/bigRepo1 | ac7fd5785d475b3c38f1328e370ba9a85a751cff | dad1852eef66fcec200df10083959c674fdcc55d | refs/heads/master | 2016-08-11T17:59:16.079541 | 2015-12-18T14:26:49 | 2015-12-18T14:26:49 | 48,244,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 131 | java | package j.j.i;
public class Calc_1_1_9984 {
/** @return the sum of a and b */
public int add(int a, int b) {
return a+b;
}
}
| [
"christian.halstrick@sap.com"
] | christian.halstrick@sap.com |
abf00dd32588b06ccbf1351bfa5bb135ccdfa054 | 67bd5ecdcfd97b6cdb4cc301410ccef03c358f20 | /app/src/androidTest/java/com/kronos/sample/ExampleInstrumentedTest.java | 71c991207def4d46d073e64edf74f2507854f7f9 | [] | no_license | Leifzhang/DiffUtils | 8522120be2a44eb0d3d2d5295dafcabe51c36969 | d25143d77d26a02db6ce78d6752a090ab0102a42 | refs/heads/master | 2022-09-11T11:20:01.468247 | 2022-08-09T04:02:57 | 2022-08-09T04:02:57 | 189,940,249 | 34 | 7 | null | 2022-08-09T04:02:57 | 2019-06-03T05:29:45 | Kotlin | UTF-8 | Java | false | false | 704 | java | package com.kronos.sample;
import android.content.Context;
import androidx.test.InstrumentationRegistry;
import androidx.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() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.kronos.sample", appContext.getPackageName());
}
}
| [
"454327998@qq.com"
] | 454327998@qq.com |
8ddbb0c4055a2711c625f696230b7d52da2ef51e | 02b95181d373e6e3d0db2a5b98c955ec22d93465 | /src/main/java/com/carlossantos/acmetodolist/entity/Task.java | 20b0761e3b64f4aa338f0949ab2f613333326b0b | [] | no_license | touchdown15/acme_todo_list_backend | c6d27510641e7213de701f180c21b02df2401bd6 | e88e6900235a9712d1ed214097c9d815834eb847 | refs/heads/master | 2023-03-25T17:43:11.211138 | 2021-03-16T21:02:42 | 2021-03-16T21:02:42 | 346,818,272 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,033 | java | package com.carlossantos.acmetodolist.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "task_table")
public class Task {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "name_task")
private String nameTask;
@Column(name = "done")
private boolean isDone;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "todolist_id", referencedColumnName="id")
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private ToDoList toDoList;
}
| [
"chvs1524@gmail.com"
] | chvs1524@gmail.com |
faf6ce2eee62001621746566f529aab80f504569 | d6bc61f75755180802b460a7d80353ab692750a6 | /SearchCustomerForm.java | 03f39cc43acb7476d390cd1ad15310bc18933778 | [] | no_license | BreTuck/LocalBookstore | 32ad86736d108acd32beea1185b1b3622429b070 | 0f6ef20a7e351c4737997f8f2e641d74ee5cde08 | refs/heads/master | 2022-03-10T20:52:06.129944 | 2019-11-21T16:36:51 | 2019-11-21T16:36:51 | 221,477,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,286 | java | import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class SearchCustomerForm extends JPanel {
private static int FRAME_WIDTH = 1000;
private static int FRAME_HEIGHT = 800;
private static int SCROLL_PANE_WIDTH = 800;
private static int SCROLL_PANE_HEIGHT = 400;
private static int GAP_SIZE = 10;
private StoreUI storeInstance;
public SearchCustomerForm(StoreUI store) {
super();
this.storeInstance = store;
SpringLayout formLayout = new SpringLayout();
setPreferredSize(new Dimension(FRAME_WIDTH, FRAME_HEIGHT));
setOpaque(true);
setBackground(new Color(255, 255, 255));
JPanel form = new JPanel(new SpringLayout());
JLabel formTitle = new JLabel("Add a Book to Inventory");
formLayout.putConstraint(SpringLayout.NORTH, this, 100, SpringLayout.NORTH, formTitle);
formLayout.putConstraint(SpringLayout.SOUTH, form, 300, SpringLayout.NORTH, formTitle);
add(formTitle);
final int txtFieldSize = 15;
// Book Title
JLabel firstNameLabel = new JLabel("First Name: ", JLabel.TRAILING);
TextField firstNameField = new TextField(txtFieldSize);
firstNameLabel.setLabelFor(firstNameField);
form.add(firstNameLabel);
form.add(firstNameField);
// Book Author
JLabel lastNameLabel = new JLabel("Last Name: ", JLabel.TRAILING);
TextField lastNameField = new TextField(txtFieldSize);
lastNameLabel.setLabelFor(lastNameField);
form.add(lastNameLabel);
form.add(lastNameField);
SpringUtilities.makeCompactGrid(form, 2, 2, 6, 6, GAP_SIZE, GAP_SIZE);
add(form);
JButton submitForm = new JButton("Search Inventory");
submitForm.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
Customer[] customerResults = storeInstance.mainControl.search(firstNameField.getText(), lastNameField.getText());
JScrollPane infoPane;
if(customerResults.length >= 0) {
infoPane = new JScrollPane(new JTextArea("No Matches Found in Store Clientele", 1, 1));
} else {
JList<Customer> customerData = new JList<Customer>(customerResults);
infoPane = new JScrollPane(customerData);
}
infoPane.setPreferredSize(new Dimension(SCROLL_PANE_WIDTH, SCROLL_PANE_HEIGHT));
JButton backToHome = new JButton("Back to Home Page");
backToHome.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
storeInstance.setHomeScreen();
}
});
removeAll();
add(infoPane);
formLayout.putConstraint(SpringLayout.NORTH, backToHome, 100, SpringLayout.SOUTH, infoPane);
add(backToHome);
revalidate();
repaint();
}
});
formLayout.putConstraint(SpringLayout.NORTH, submitForm, 100, SpringLayout.SOUTH, form);
add(submitForm);
setVisible(true);
}
} | [
"tuckerbreaunna@gmail.com"
] | tuckerbreaunna@gmail.com |
9efc0e5a8f3a74814b544fc780b03b244b4f92b7 | 59030b8268887afac2f9c962e4eab361b4721ca4 | /src/L4_Interfaces_and_Abstraction_Exercises/P3_Birthday_Celebrations/Identifiable.java | 022ab79309af91eb6fa6b229a9b239880e4e6e9e | [] | no_license | BorisIM4/SoftUni-JavaOOP | 2df5de7b9cd3864059cc89ec32cac365599fba33 | 514c339e5530f5b17cc322793c6a593b2c070652 | refs/heads/master | 2023-03-29T06:06:51.980710 | 2021-04-03T15:54:43 | 2021-04-03T15:54:43 | 343,456,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 129 | java | package L4_Interfaces_and_Abstraction_Exercises.P3_Birthday_Celebrations;
public interface Identifiable {
String getId();
}
| [
"jrb@abv.bg"
] | jrb@abv.bg |
5af81e1247353ea5c3790f52a53b933026a80760 | b9c8d6a54c543844921ecb59fc620a7912f24223 | /test/src/main/java/com/deep/test/csv/stock/FastGoHomeMsgDTO.java | 46d32aaeb878e35674957c47216009062b4f9ae9 | [] | no_license | hudepin/test | c9da64a6bb9b49871e36d944bd2df2a0621d3a0d | db15f8c6c2009779aa92f519e55c6f7336cd31cd | refs/heads/master | 2022-12-21T19:35:00.972632 | 2021-11-19T01:40:27 | 2021-11-19T01:40:48 | 98,258,711 | 0 | 0 | null | 2022-05-25T07:14:58 | 2017-07-25T03:10:19 | Java | UTF-8 | Java | false | false | 875 | java | package com.deep.test.csv.stock;
public class FastGoHomeMsgDTO {
private Long goodsId;
private Long channelSid;
private String shopAndStoreCode;
private Long saleStockSum;
public Long getGoodsId() {
return goodsId;
}
public void setGoodsId(Long goodsId) {
this.goodsId = goodsId;
}
public Long getChannelSid() {
return channelSid;
}
public void setChannelSid(Long channelSid) {
this.channelSid = channelSid;
}
public String getShopAndStoreCode() {
return shopAndStoreCode;
}
public void setShopAndStoreCode(String shopAndStoreCode) {
this.shopAndStoreCode = shopAndStoreCode;
}
public Long getSaleStockSum() {
return saleStockSum;
}
public void setSaleStockSum(Long saleStockSum) {
this.saleStockSum = saleStockSum;
}
}
| [
"depin.hu@bl.com"
] | depin.hu@bl.com |
58406d8238ba69ea2db71aae11428cc36de4a4e9 | dc62671d968c73ab9e1bb26906cb4cba1da78cc9 | /Hello-Heroku-Hosting/src/main/java/com/mmit/ServletInitializer.java | d61a6ef576e96e34287c09393e96082e8244cbc1 | [] | no_license | NanEiTheint/Test-Heroku-Hosting | fdd8507a0a0b362f72eca1a516eaa1d8def31f43 | f1dbf9525a9ef06e519dceecc2d5c94324a6ac52 | refs/heads/master | 2023-07-03T17:47:19.839145 | 2021-08-03T05:49:33 | 2021-08-03T05:49:33 | 392,195,083 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package com.mmit;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(HelloHerokuHostingApplication.class);
}
}
| [
"naneieitheint2015@gmail.com"
] | naneieitheint2015@gmail.com |
fe1eb288601cd606bb8b889bdd0e7719f0f5d29e | 05ce26c75d2c088160d86af8570d48c29f5de13f | /app/src/main/java/test/nsr/com/samstestapp/ui/productdetails/ProductInfoActivity.java | 5419716bbd277450cf0413209a11bcb6d6f50bdd | [] | no_license | shekharreddy/SamsTestApp | 0cf2d9459c91b1a65d5b315cf57f471c405fd9eb | 16f7508811a29b595a0f2d6893e1f1d88356910b | refs/heads/master | 2020-03-27T21:08:30.883601 | 2018-09-03T14:34:08 | 2018-09-03T14:34:08 | 147,118,047 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,533 | java | package test.nsr.com.samstestapp.ui.productdetails;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.MenuItem;
import test.nsr.com.samstestapp.R;
/**
* @author shekharreddy
* Activity to show product details with View Pager.
*/
public class ProductInfoActivity extends AppCompatActivity {
public static final String TAG = "ProductInfoActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_product_info);
Log.i(TAG, "OnCreate called");
if (savedInstanceState == null) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
ProductsInfoSlidingFragment fragment = new ProductsInfoSlidingFragment();
transaction.replace(R.id.content_fragment, fragment);
transaction.commit();
}
getSupportActionBar().setTitle(R.string.product_details);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
// back icon in action bar clicked; goto parent activity.
this.finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
| [
"shekhar.nareddy@one.verizon.com"
] | shekhar.nareddy@one.verizon.com |
8ebae0622507672c909864c0a4365e6a8623ef42 | 8eb2c3564fb405427a3f752301be93e5a118b176 | /esale-manager/esale-manager-service/src/main/java/com/esale/service/ItemCatService.java | 7e26f9f3cab41322e6ec6d5d6999de3e0a937dc6 | [] | no_license | littleyaoyaoyao/Esale-Online-Mall-system | c7fca003ea441d6138f0ce30fce722ef65360586 | e7e76d47cfc994dbba64b1829458551bba73361f | refs/heads/master | 2021-01-01T17:43:43.129681 | 2017-09-13T14:15:30 | 2017-09-13T14:15:30 | 98,137,925 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 198 | java | package com.esale.service;
import java.util.List;
import com.esale.common.pojo.EasyUITreeNode;
public interface ItemCatService {
List<EasyUITreeNode> getItemCatList(Long parentId);
}
| [
"littleyaoyaoyao@gmail.com"
] | littleyaoyaoyao@gmail.com |
c3c0378371854b23aa4bd15063efac0868aa40c2 | 5a8f43fb4ef75073f03a1c46d5b485462fd1cbd5 | /src/hotel/management/system/AddCustomer.java | 76c65e723ad5c91facaa3b20eb5cb2c55fb9e4d3 | [] | no_license | kishan166/HotelManagementSystem | b617ff9591fb15422d98da960e9f4c24b7308a92 | 8ed671dfcf9136bcdcb0463b75e289ba39887ad0 | refs/heads/main | 2022-12-28T16:34:54.969051 | 2020-10-09T00:07:20 | 2020-10-09T00:07:20 | 302,466,642 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,438 | java | package hotel.management.system;
import java.awt.Choice;
import java.awt.Color;
import java.awt.Font;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.ResultSet;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class AddCustomer extends JFrame implements ActionListener {
JTextField t1,t2,t3,t4,t5,t6;
JRadioButton r1,r2;
JButton b1,b2;
JComboBox c1;
Choice c2;
public AddCustomer() {
this.setTitle("Add Employee");
JLabel l1 = new JLabel("New Customer Form");
l1.setFont(new Font("Tahoma",Font.PLAIN,30));
l1.setForeground(Color.BLUE);
l1.setBounds(60,30,350,40);
add(l1);
JLabel id = new JLabel("ID"); //ID
id.setFont(new Font("Tahoma",Font.PLAIN,17));
id.setBounds(60,80,120,30);
add(id);
String str[]= {"Passport","Driving-license","id"};
c1 = new JComboBox(str);
c1.setBackground(Color.WHITE);
c1.setBounds(280, 80, 160, 30);
add(c1);
JLabel number = new JLabel("NUMBER"); //number
number.setFont(new Font("Tahoma",Font.PLAIN,17));
number.setBounds(60,130,120,30);
add(number);
t1 = new JTextField();
t1.setBounds(280,130,160,30);
add(t1);
JLabel name = new JLabel("NAME"); //name
name.setFont(new Font("Tahoma",Font.PLAIN,17));
name.setBounds(60,180,120,30);
add(name);
t2 = new JTextField();
t2.setBounds(280,180,160,30);
add(t2);
JLabel gender = new JLabel("GENDER"); //gender
gender.setFont(new Font("Tahoma",Font.PLAIN,17));
gender.setBounds(60,230,120,30);
add(gender);
r1 = new JRadioButton("Male");
r1.setBounds(280,230,70,30);
r1.setBackground(Color.WHITE);
add(r1);
r2 = new JRadioButton("Female");
r2.setBounds(380, 230, 70, 30);
r2.setBackground(Color.WHITE);
add(r2);
JLabel country = new JLabel("COUNTRY"); //country
country.setFont(new Font("Tahoma",Font.PLAIN,17));
country.setBounds(60,280,120,30);
add(country);
t3 = new JTextField();
t3.setBounds(280,280,160,30);
add(t3);
JLabel allroomno = new JLabel("ALOCATED ROOM NUMBER"); //allocated room number
allroomno.setFont(new Font("Tahoma",Font.PLAIN,17));
allroomno.setBounds(60,330,220,30);
add(allroomno);
c2 = new Choice();
try {
conn c = new conn();
String sql = "Select * from room";
ResultSet rs = c.s.executeQuery(sql);
while (rs.next()) {
String allo = rs.getString("available");
if (allo.equals("available")) {
c2.add(rs.getString("room_number"));
} else {
continue;
}
}
} catch (Exception e) {
System.out.println(e);
}
c2.setBounds(280,330,160,30);
add(c2);
JLabel checkin = new JLabel("CHECKED IN"); //checked in
checkin.setFont(new Font("Tahoma",Font.PLAIN,17));
checkin.setBounds(60,380,120,30);
add(checkin);
t4 = new JTextField();
t4.setBounds(280,380,160,30);
add(t4);
JLabel email = new JLabel("DEPOSIT"); //deposit
email.setFont(new Font("Tahoma",Font.PLAIN,17));
email.setBounds(60,430,120,30);
add(email);
t5 = new JTextField();
t5.setBounds(280,430,160,30);
add(t5);
b1=new JButton("Save");
b1.setBounds(105, 480, 120, 30);
b1.setForeground(Color.WHITE);
b1.setBackground(Color.BLACK);
b1.addActionListener(this);
add(b1);
b2 = new JButton("Back");
b2.setBackground(Color.BLACK);
b2.setForeground(Color.WHITE);
b2.addActionListener(this);
b2.setBounds(245,480,120,30);
add(b2);
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/fifth.jpg"));
Image i2 = i1.getImage().getScaledInstance(400, 400, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel l11 = new JLabel(i3);
l11.setBounds(460, 80, 400, 400);
add(l11);
getContentPane().setBackground(Color.WHITE);
setLayout(null);
setBounds(520,230,900,600);
setVisible(true);
}
public static void main(String[] args) {
new AddCustomer().setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource() == b1) {
String id = (String) c1.getSelectedItem();
String number = t1.getText();
String name = t2.getText();
String gender = null;
if(r1.isSelected()) {
gender = "male";
}
else if(r2.isSelected()){
gender = "female";
}
String country = t3.getText();
String allroomno = c2.getSelectedItem();
String checkin = t4.getText();
String deposit = t5.getText();
;
conn c = new conn();
String sql="insert into customer values('"+id+"','"+number+"','"+name+"','"+gender+"','"+country+"','"+allroomno+"','"+checkin+"','"+deposit+"')";
String sql2 = "update room set available = 'occupied' where room_number ='"+allroomno+"'";
try {
c.s.executeUpdate(sql);
c.s.executeUpdate(sql2);
JOptionPane.showMessageDialog(null, "NEW CUSTOMER ADDED");
this.setVisible(true);
} catch (Exception e2) {
System.out.println(e);
}
}
else if(e.getSource() == b2) {
new Reception().setVisible(true);
this.setVisible(false);
}
}
}
| [
"krp10293847@gmail.com"
] | krp10293847@gmail.com |
5473b70a0af70d81674a9105981d82f0ace8ee29 | 425888a80686bb31f64e0956718d81efef5f208c | /src/test/java/com/aol/cyclops/react/base/BaseNumberOperationsTest.java | ca0cc7f4e311b97d74b35c51ab3e5322cb45421d | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | cybernetics/cyclops-react | ca34140519abfbe76750131f39133d31ba6770f2 | f785d9bbe773acee5b07b602c0476dd58e19ef19 | refs/heads/master | 2021-01-22T13:08:10.590701 | 2016-04-22T12:41:13 | 2016-04-22T12:41:13 | 56,901,547 | 1 | 0 | null | 2016-04-23T05:07:15 | 2016-04-23T05:07:15 | null | UTF-8 | Java | false | false | 2,970 | java | package com.aol.cyclops.react.base;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.function.Supplier;
import org.junit.Before;
import org.junit.Test;
import com.aol.cyclops.types.futurestream.LazyFutureStream;
public abstract class BaseNumberOperationsTest {
abstract protected <U> LazyFutureStream<U> of(U... array);
abstract protected <U> LazyFutureStream<U> ofThread(U... array);
abstract protected <U> LazyFutureStream<U> react(Supplier<U>... array);
LazyFutureStream<Integer> empty;
LazyFutureStream<Integer> nonEmpty;
private static final Executor exec = Executors.newFixedThreadPool(1);
@Before
public void setup(){
empty = of();
nonEmpty = of(1);
}
@Test
public void sumInt(){
assertThat(of(1,2,3,4).futureOperations(exec).sumInt(i->i).join(),
equalTo(10));
}
@Test
public void sumDouble(){
assertThat(of(1.0,2.0,3.0,4.0).futureOperations(exec).sumDouble(i->i).join(),
equalTo(10.0));
}
@Test
public void sumLong(){
assertThat(of(1l,2l,3l,4l).futureOperations(exec).sumLong(i->i).join(),
equalTo(10l));
}
@Test
public void maxInt(){
assertThat(of(1,2,3,4).futureOperations(exec).maxInt(i->i).join().getAsInt(),
equalTo(4));
}
@Test
public void maxDouble(){
assertThat(of(1.0,2.0,3.0,4.0).futureOperations(exec).maxDouble(i->i).join().getAsDouble(),
equalTo(4.0));
}
@Test
public void maxLong(){
assertThat(of(1l,2l,3l,4l).futureOperations(exec).maxLong(i->i).join().getAsLong(),
equalTo(4l));
}
@Test
public void minInt(){
assertThat(of(1,2,3,4).futureOperations(exec).minInt(i->i).join().getAsInt(),
equalTo(1));
}
@Test
public void minDouble(){
assertThat(of(1.0,2.0,3.0,4.0).futureOperations(exec).minDouble(i->i).join().getAsDouble(),
equalTo(1.0));
}
@Test
public void minLong(){
assertThat(of(1l,2l,3l,4l).futureOperations(exec).minLong(i->i).join().getAsLong(),
equalTo(1l));
}
@Test
public void averageInt(){
assertThat(of(1,2,3,4).futureOperations(exec).averageInt(i->i).join().getAsDouble(),
equalTo(2.5));
}
@Test
public void averageDouble(){
assertThat(of(1.0,2.0,3.0,4.0).futureOperations(exec).averageDouble(i->i).join().getAsDouble(),
equalTo(2.5));
}
@Test
public void averageLong(){
assertThat(of(1l,2l,3l,4l).futureOperations(exec).averageLong(i->i).join().getAsDouble(),
equalTo(2.5));
}
@Test
public void summaryStatsInt(){
assertThat(of(1,2,3,4).futureOperations(exec).summaryStatisticsInt(i->i).join().getSum(),
equalTo(10L));
}
@Test
public void summaryStatsDouble(){
assertThat(of(1.0,2.0,3.0,4.0).futureOperations(exec)
.summaryStatisticsDouble(i->i).join().getSum(),
equalTo(10.0));
}
@Test
public void summaryStatsLong(){
assertThat(of(1l,2l,3l,4l).futureOperations(exec).summaryStatisticsLong(i->i).join().getSum(),
equalTo(10l));
}
}
| [
"john.mcclean@teamaol.com"
] | john.mcclean@teamaol.com |
4abe5f08abf0344e589742ab0f75c31b8a1b5db6 | da4b363bab129a2764a8d569e0d4160cd6b1678c | /src/main/java/org/ishugaliy/consistent/hash/hasher/DefaultHasher.java | 4967fda7d76512272304228260a4494df80409a0 | [
"MIT"
] | permissive | romabyv/allgood-consistent-hash | 8089c630ef2d30d2688a1b328bde114b2ad5ff62 | 2dcddae93bcfb9178c826e3b520364e0fb127240 | refs/heads/master | 2022-06-08T14:58:37.297735 | 2020-04-30T11:43:55 | 2020-04-30T11:43:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,136 | java | package org.ishugaliy.consistent.hash.hasher;
import net.openhft.hashing.LongHashFunction;
import java.util.function.Function;
public enum DefaultHasher implements Hasher {
/**
* https://github.com/aappleby/smhasher/wiki/MurmurHash3
*/
MURMUR_3(LongHashFunction::murmur_3),
/**
* https://github.com/google/cityhash
*/
CITY_HASH(LongHashFunction::city_1_1),
/**
* https://github.com/google/farmhash
*/
FARM_HASH(LongHashFunction::farmUo),
/**
* https://github.com/jandrewrogers/MetroHash
*/
METRO_HASH(LongHashFunction::metro),
/**
* https://github.com/wangyi-fudan/wyhash
*/
WY_HASH(LongHashFunction::wy_3),
/**
* https://github.com/Cyan4973/xxHash
*/
XX_HASH(LongHashFunction::xx);
private final Function<Integer, LongHashFunction> buildHashFunction;
DefaultHasher(Function<Integer, LongHashFunction> buildHashFunction) {
this.buildHashFunction = buildHashFunction;
}
@Override
public long hash(String key, int seed) {
return buildHashFunction.apply(seed).hashChars(key);
}
}
| [
"iurii.shugalii@slidepresenter.com"
] | iurii.shugalii@slidepresenter.com |
aa9449958f2fca70e8000dd779f5eb63b44b90f1 | 9fbe90085c2985f1ecaa494bfcdcb900d4a3ce75 | /asyncFlow/java/aflux-tool-mainplugins/src/main/java/de/tum/in/aflux/component/samples/tools/impl/SaveToMongoDBTool.java | 79cc4c5738fb87b9313d1e2d67bb961dcf6d48d2 | [
"Apache-2.0"
] | permissive | hmzhangmin/aflux | 48b3dabd7acac583b8742789dab34d2204f0a164 | 1062369b3c978646a4c050b1d058120a280c4217 | refs/heads/master | 2022-12-25T05:10:29.051081 | 2020-04-07T12:03:26 | 2020-04-07T12:03:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 731 | java |
/*
* aFlux: JVM based IoT Mashup Tool
* Copyright 2019 Tanmaya Mahapatra
*
* 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 de.tum.in.aflux.component.samples.tools.impl;
public class SaveToMongoDBTool {
}
| [
"tanmaya.mahapatra@tum.de"
] | tanmaya.mahapatra@tum.de |
2375b54329f756ca90fdbc3d8c4e9690b8cd4900 | 0d86a98cd6a6477d84152026ffc6e33e23399713 | /kata/8-kyu/keep-hydrated-1/test/SolutionTest.java | 8c5df6da7404206c6c84917e8e8832ed2551d03f | [
"MIT"
] | permissive | ParanoidUser/codewars-handbook | 0ce82c23d9586d356b53070d13b11a6b15f2d6f7 | 692bb717aa0033e67995859f80bc7d034978e5b9 | refs/heads/main | 2023-07-28T02:42:21.165107 | 2023-07-27T12:33:47 | 2023-07-27T12:33:47 | 174,944,458 | 224 | 65 | MIT | 2023-09-14T11:26:10 | 2019-03-11T07:07:34 | Java | UTF-8 | Java | false | false | 423 | java | import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
class SolutionTest {
@Test
void sample() {
assertEquals(1, new KeepHydrated().Liters(2));
assertEquals(0, new KeepHydrated().Liters(0.97));
assertEquals(7, new KeepHydrated().Liters(14.64));
assertEquals(40, new KeepHydrated().Liters(80));
assertEquals(800, new KeepHydrated().Liters(1600.20));
}
}
| [
"5120290+ParanoidUser@users.noreply.github.com"
] | 5120290+ParanoidUser@users.noreply.github.com |
7677b234e25086514b2f18c2a86beddf5a0db8a8 | d93bb5eff18517da46d50eb14906f1ccb0185015 | /IslandPrimeWEB/src/java/classes/MessageEncoder.java | b633995729e460fdb382bb3a057781dc6b2666d6 | [] | no_license | pernjie/IslandSystem | 7d557fd3c8994425d440d1632e134c07cef6d37b | d288e8b193729932d99e21546998ee7f7d9c0e25 | refs/heads/master | 2021-01-01T19:01:49.539260 | 2014-11-13T08:47:40 | 2014-11-13T08:47:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 416 | java |
package classes;
import org.primefaces.json.JSONObject;
import org.primefaces.push.Encoder;
/**
* A Simple {@link org.primefaces.push.Encoder} that decode a {@link Message} into a simple JSON object.
*/
public final class MessageEncoder implements Encoder<Message, String> {
//@Override
public String encode(Message message) {
return new JSONObject(message).toString();
}
} | [
"natleoglm93@gmail.com"
] | natleoglm93@gmail.com |
9e239088ef941449230e6a681a3621e1ba48d437 | d4a96f9b598b28e454859a7d42cc3438fc357022 | /app/src/main/java/com/elfosoftware/easycatalog/Adapters.java | 451b1ccca9657b96d196e03ba83c30c5ea0f6c56 | [] | no_license | ermetiko/EasyCatalog2 | 9d47dee1cd112ef7c4121646f3db5ed654a3b0f8 | 0b621f0d4406df57fcd9b96507f1aba6940f017c | refs/heads/master | 2021-01-10T12:38:52.522007 | 2016-03-14T21:05:55 | 2016-03-14T21:05:55 | 52,737,779 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,100 | java | package com.elfosoftware.easycatalog;
import java.io.File;
import java.util.ArrayList;
import android.R.dimen;
import android.R.string;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Environment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
public class Adapters {
//public static int dimensioneGrigliaGrande=0;
public static class Categoria {
int Id;
String Nome;
Integer Articoli;
public Categoria(int id, String nome, Integer numero) {
Id = id;
Nome = nome;
Articoli = numero;
}
@Override
public String toString() {
return this.Nome;
}
}
public static class CategorieAdapter extends ArrayAdapter<Categoria> {
private ArrayList<Categoria> items;
private CategoriaHolder categoriaHolder;
private Context context;
private class CategoriaHolder {
TextView nome;
TextView numero;
}
public CategorieAdapter(Context context, int tvResId, ArrayList<Categoria> items) {
super(context, tvResId, items);
this.context = context;
this.items = items;
}
@Override
public View getView(int pos, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.categorie, null);
categoriaHolder = new CategoriaHolder();
categoriaHolder.nome = (TextView) v.findViewById(R.id.nomeCategoria);
categoriaHolder.numero = (TextView) v.findViewById(R.id.articoliCategoria);
v.setTag(categoriaHolder);
} else
categoriaHolder = (CategoriaHolder) v.getTag();
Categoria cate = items.get(pos);
if (cate != null) {
categoriaHolder.nome.setText(cate.Nome);
categoriaHolder.numero.setText(Integer.toString(cate.Articoli)
+ " articoli");
}
return v;
}
}
public static class Articolo {
int Id;
String Descrizione;
String Categoria;
String Famiglia;
String Fornitore;
Drawable Thumb;
Drawable Immagine;
public Articolo(int id, String descrizione, Drawable thumb, Drawable immagine) {
Id = id;
Descrizione = descrizione;
Thumb = thumb;
Immagine = immagine;
}
@Override
public String toString() {
return this.Descrizione;
}
}
public static class ThumbsAdapter extends ArrayAdapter<Articolo> {
private ArrayList<Articolo> items;
private ItemHolder itemHolder;
private Context context;
private File immaginiPath;
private class ItemHolder {
ImageView img;
TextView nome;
}
public ThumbsAdapter(Context context, int tvResId, ArrayList<Articolo> items, File immaginiPath) {
super(context, tvResId, items);
this.context = context;
this.items = items;
this.immaginiPath = immaginiPath;
}
@Override
public View getView(int pos, View convertView, ViewGroup parent) {
View v = convertView;
if (convertView == null) {
LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.thumb, null);
itemHolder = new ItemHolder();
itemHolder.img = (ImageView) v.findViewById(R.id.thumbImmagine);
itemHolder.nome = (TextView) v.findViewById(R.id.thumbDescrizione);
v.setTag(itemHolder);
} else
itemHolder = (ItemHolder) convertView.getTag();
Articolo arti = items.get(pos);
if (arti != null) {
if (arti.Thumb == null)
arti.Thumb = getImmagine(arti.Id, true, immaginiPath);
itemHolder.img.setImageDrawable(arti.Thumb);
itemHolder.nome.setText(arti.Descrizione);
}
return v;
}
}
public static class ImmagineLargeAdapter extends ArrayAdapter<Articolo> {
private ArrayList<Articolo> items;
private ItemHolder itemHolder;
private Context context;
private File immaginiPath;
private class ItemHolder {
ImageView img;
TextView codice;
TextView nome;
TextView categoria;
TextView sottocategoria;
}
public ImmagineLargeAdapter(Context context, int tvResId, ArrayList<Articolo> items, File immaginiPath) {
super(context, tvResId, items);
this.context = context;
this.items = items;
this.immaginiPath = immaginiPath;
}
@Override
public View getView(int pos, View convertView, ViewGroup parent) {
View v = convertView;
if (convertView == null) {
LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.immagine_large, null);
itemHolder = new ItemHolder();
itemHolder.img = (ImageView) v.findViewById(R.id.immagineLarge);
//itemHolder.img.setLayoutParams(new LayoutParams(dimensioneGrigliaGrande, dimensioneGrigliaGrande));
itemHolder.codice = (TextView) v.findViewById(R.id.imgCodiceArticolo);
itemHolder.nome = (TextView) v.findViewById(R.id.imgDescrizioneArticolo);
itemHolder.categoria = (TextView) v.findViewById(R.id.imgCategoria);
itemHolder.sottocategoria = (TextView) v.findViewById(R.id.imgSottocategoria);
v.setTag(itemHolder);
} else
itemHolder = (ItemHolder) convertView.getTag();
Articolo arti = items.get(pos);
if (arti != null) {
if (arti.Immagine == null)
arti.Immagine = getImmagine(arti.Id, false, immaginiPath);
itemHolder.img.setImageDrawable(arti.Immagine);
itemHolder.codice.setText(Integer.toString(arti.Id));
itemHolder.nome.setText(arti.Descrizione);
itemHolder.categoria.setText("categoria");
itemHolder.sottocategoria.setText("Sottocategoria");
}
return v;
}
}
public static Drawable getImmagine(int idArticolo, boolean ridotta, File immaginiPath) {
Drawable img = null;
int numero = (int) Math.ceil(Math.random() * 79);
//String nomeFile = Environment.getExternalStorageDirectory().getAbsolutePath() + "/EasyCatalogImg/" + Integer.toString(numero + 1) + (ridotta ? "_th.jpg" : ".jpg");
//File pathImg = null; //get ((MyApplication) this.getApplication()).getImmaginiPath();
File file = new File(immaginiPath, Integer.toString(idArticolo) + (ridotta ? "_th.jpg" : ".jpg"));
if (file.exists()) {
img = Drawable.createFromPath(file.getAbsolutePath());
}
return img;
}
/*
public static Drawable getImmagineLarge(int idArticolo)
{
Drawable img=null;
int numero = (int)Math.ceil(Math.random()*72);
String estenzione = (numero<32 ? ".jpg" : ".png");
String nomeFile = Environment.getExternalStorageDirectory().getAbsolutePath() + "/immagini2/" + Integer.toString(numero+1) + estenzione;
File file = new File (nomeFile);
if (file.exists())
{
img= Drawable.createFromPath(file.getAbsolutePath());
}
return img;
}
*/
/*
public static class ImageAdapter extends BaseAdapter {
private Context context;
private Drawable[] images;
public ImageAdapter(Context context, Drawable[] images) {
this.context = context;
this.images = images;
}
@Override
public int getCount() {
return images.length;
}
@Override
public Object getItem(int position) {
return images[position];
}
@Override
public long getItemId(int position) {
return images[position].hashCode();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// ImageView imageView;
View v;
if (convertView == null) {
// * imageView = new ImageView(context);
// * imageView.setLayoutParams(new GridView.LayoutParams(190,
// * 190)); imageView.setScaleType(ImageView.ScaleType.CENTER);
// * imageView.setPadding(5, 5, 5, 5);
LayoutInflater li = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// LayoutInflater li = getLayoutInflater();
v = li.inflate(R.layout.thumb, null);
// v.setLayoutParams(new GridView.LayoutParams(190, 190));
// v.setPadding(5, 5, 5, 5);
TextView tv = (TextView) v.findViewById(R.id.thumbDescrizione);
tv.setText("descrizione " + position);
ImageView iv = (ImageView) v.findViewById(R.id.thumbImmagine);
iv.setImageDrawable(images[position]); // setImageResource(R.drawable.icon);
} else {
v = convertView;
}
// * if (convertView == null) { imageView = new ImageView(context);
// * imageView.setLayoutParams(new GridView.LayoutParams(190, 190));
// * imageView.setScaleType(ImageView.ScaleType.CENTER);
// * imageView.setPadding(5, 5, 5, 5);
// *
// * imageView.setImageDrawable(images[position]); } else { imageView
// * = (ImageView) convertView; }
return v; // imageView;
}
}
*/
public static class BigSpinnerAdapter extends ArrayAdapter<Categoria> implements SpinnerAdapter {
private ArrayList<Categoria> items;
private CategoriaHolder categoriaHolder;
private Context context;
private class CategoriaHolder {
TextView nome;
TextView numero;
}
public BigSpinnerAdapter(Context context, int tvResId,
ArrayList<Categoria> items) {
super(context, tvResId, items);
this.context = context;
this.items = items;
}
@Override
public View getView(int pos, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.categorie, null);
categoriaHolder = new CategoriaHolder();
categoriaHolder.nome = (TextView) v.findViewById(R.id.nomeCategoria);
categoriaHolder.numero = (TextView) v.findViewById(R.id.articoliCategoria);
v.setTag(categoriaHolder);
} else
categoriaHolder = (CategoriaHolder) v.getTag();
Categoria cate = items.get(pos);
if (cate != null) {
categoriaHolder.nome.setText(cate.Nome);
categoriaHolder.numero.setText(Integer.toString(cate.Articoli) + " articoli");
}
return v;
}
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
return getView(position, convertView, parent);
}
}
public static class Marca {
Integer Id;
String Nome;
Integer Articoli;
public Marca(Integer id, String nome, Integer numero) {
Id = id;
Nome = nome;
Articoli = numero;
}
@Override
public String toString() {
return this.Nome;
}
}
}
| [
"f.cannistra@elfosoftware.it"
] | f.cannistra@elfosoftware.it |
181b78c54c95a767e33763cd0eb22207592bd525 | e829b6904fd911c8bdd8defca2645028a56b68fb | /src/X1_Tong_quan_ung_dung_web/Bai_Thuc_Hanh/Ung_dung_chuyen_doi_tien_te.java | f7c4e6ab23f6a31840b0c4c52df7ecf6952e88f9 | [] | no_license | LeDinhQuoc24/LeDinhQuoc-Java_Web | 736fb1bf1d8bcf4e6357e7f83f91cce29a189a44 | 43526fac4b5e5ebd295acd93213360011994dd0b | refs/heads/master | 2021-05-19T00:40:29.183965 | 2020-03-31T12:37:49 | 2020-03-31T12:37:49 | 251,499,067 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,169 | java | package X1_Tong_quan_ung_dung_web.Bai_Thuc_Hanh;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@WebServlet(name = "Ung_dung_chuyen_doi_tien_te",urlPatterns = "/convert")
public class Ung_dung_chuyen_doi_tien_te extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
float rate = Float.parseFloat(request.getParameter("rate"));
float usd = Float.parseFloat(request.getParameter("usd"));
float vnd = rate * usd;
PrintWriter writer = response.getWriter();
writer.println("<html>");
writer.println("<h1>Rate: " + rate+ "</h1>");
writer.println("<h1>USD: " + usd+ "</h1>");
writer.println("<h1>VND: " + vnd+ "</h1>");
writer.println("</html>");
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
| [
"kudo2412@gmail.com"
] | kudo2412@gmail.com |
ba964dd39c82781655f07ae54e9508752adee9de | 713672f5606fb8b8e66165e458ff053320eb7471 | /ToDuyNghia_Nhom1/src/baitapso5/bai1/ViewJFrame.java | 24e93a79d7c7a06d0b8a94638ebb0847797d818b | [] | no_license | luffyMonster/HWJava | 68ba34743d532c0fc160e54cd40f832168c97ae1 | bf484b77667caa7483ec91299068c606c0536322 | refs/heads/master | 2020-06-12T07:07:33.943696 | 2017-01-04T07:01:37 | 2017-01-04T07:01:37 | 75,598,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,128 | 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 baitapso5.bai1;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.table.DefaultTableModel;
/**
*
* @author luffy monster
*/
public class ViewJFrame extends javax.swing.JFrame {
ArrayList<Sach> listSach;
ArrayList<BanDoc> listBD;
ArrayList<QuanLy> listQL;
/**
* Creates new form ViewJFrame
*/
public ViewJFrame() {
initComponents();
listBD = new ArrayList<>();
listSach = new ArrayList<>();
listQL = new ArrayList<>();
docFile(listSach, "SACH.INP");
docFile(listBD, "BD.INP");
docFile(listQL, "QL.INP");
listSach.add(new Sach(123));
loadTable(sachTable, listSach);
}
<E> void docFile(ArrayList<E> list, String fname) {
FileInputStream f;
ObjectInputStream ois;
try {
f = new FileInputStream(fname);
ois = new ObjectInputStream(f);
while (true) {
try {
Object o = ois.readObject();
E e = (E) o;
list.add(e);
} catch (EOFException e) {
break;
} catch (Exception e) {
// e.printStackTrace();
ois = new ObjectInputStream(f);
}
}
} catch (FileNotFoundException e) {
} catch (Exception e) {
System.err.println("Luong doc loi!");
// e.printStackTrace();
} finally {
}
}
static <E> void ghiFile(ArrayList<E> list, String fname) {
FileOutputStream f = null;
ObjectOutputStream oos;
try {
f = new FileOutputStream(fname);
oos = new ObjectOutputStream(f);
for (Object s : list) {
oos.writeObject(s);
}
f.close();
} catch (FileNotFoundException ex) {
Logger.getLogger(ViewJFrame.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(ViewJFrame.class.getName()).log(Level.SEVERE, null, ex);
} finally {
try {
f.close();
} catch (IOException ex) {
Logger.getLogger(ViewJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
<E extends TableIO> void loadTable(javax.swing.JTable table, ArrayList<E> list) {
DefaultTableModel model = (DefaultTableModel) table.getModel();
model.getDataVector().removeAllElements();
for (E e:list){
model.addRow(e.toObject());
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jTabbedPane2 = new javax.swing.JTabbedPane();
jTabbedPane3 = new javax.swing.JTabbedPane();
jTabbedPane4 = new javax.swing.JTabbedPane();
jPanel3 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
tenn = new javax.swing.JLabel();
tacGiaa = new javax.swing.JLabel();
chuyenNganhh = new javax.swing.JLabel();
nam = new javax.swing.JLabel();
ten = new javax.swing.JTextField();
tacGia = new javax.swing.JTextField();
chuyenNganh = new javax.swing.JComboBox();
namXB = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
sachTable = new javax.swing.JTable();
themSach = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
jPanel5 = new javax.swing.JPanel();
jPanel6 = new javax.swing.JPanel();
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jLabel1.setText("Sach");
tenn.setText("Tên");
tacGiaa.setText("Tac Gia");
chuyenNganhh.setText("Chuyen Nganh");
nam.setText("Nam Xuat Ban");
ten.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tenActionPerformed(evt);
}
});
tacGia.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tacGiaActionPerformed(evt);
}
});
chuyenNganh.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Khoa hoc tu nhien", "Dien tu vien thong", "Van hoc Nghe Thuat", "Cong nghe thong tin" }));
chuyenNganh.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
chuyenNganhActionPerformed(evt);
}
});
namXB.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
namXBActionPerformed(evt);
}
});
sachTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null, null},
{null, null, null, null, null},
{null, null, null, null, null},
{null, null, null, null, null}
},
new String [] {
"ID", "Ten sach", "Chuyen Nganh", "Tac Gia", "Nam xuat ban"
}
));
jScrollPane1.setViewportView(sachTable);
themSach.setText("Them");
themSach.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
themSachActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 557, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(248, 248, 248)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(themSach)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(tenn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(nam, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(tacGiaa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(chuyenNganhh, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE))
.addGap(53, 53, 53)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(ten)
.addComponent(tacGia)
.addComponent(chuyenNganh, 0, 266, Short.MAX_VALUE)
.addComponent(namXB))))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(tenn)
.addComponent(ten, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(tacGiaa)
.addComponent(tacGia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(chuyenNganhh)
.addComponent(chuyenNganh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(nam)
.addComponent(namXB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(27, 27, 27)
.addComponent(themSach)
.addGap(33, 33, 33)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jTabbedPane1.addTab("Sach", jPanel1);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 557, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 459, Short.MAX_VALUE)
);
jTabbedPane1.addTab("tab2", jPanel2);
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 557, Short.MAX_VALUE)
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 459, Short.MAX_VALUE)
);
jTabbedPane1.addTab("tab3", jPanel5);
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 557, Short.MAX_VALUE)
);
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 459, Short.MAX_VALUE)
);
jTabbedPane1.addTab("tab4", jPanel6);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane1)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane1)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void namXBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_namXBActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_namXBActionPerformed
private void chuyenNganhActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chuyenNganhActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_chuyenNganhActionPerformed
private void tacGiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tacGiaActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_tacGiaActionPerformed
private void tenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tenActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_tenActionPerformed
private void themSachActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_themSachActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_themSachActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) throws IOException, FileNotFoundException, ClassNotFoundException {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(ViewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(ViewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(ViewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(ViewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ViewJFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JComboBox chuyenNganh;
private javax.swing.JLabel chuyenNganhh;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTabbedPane jTabbedPane2;
private javax.swing.JTabbedPane jTabbedPane3;
private javax.swing.JTabbedPane jTabbedPane4;
private javax.swing.JLabel nam;
private javax.swing.JTextField namXB;
private javax.swing.JTable sachTable;
private javax.swing.JTextField tacGia;
private javax.swing.JLabel tacGiaa;
private javax.swing.JTextField ten;
private javax.swing.JLabel tenn;
private javax.swing.JButton themSach;
// End of variables declaration//GEN-END:variables
}
| [
"wanalove277@gmail.com"
] | wanalove277@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.