blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbb6a7d5e259d2a427aa06afacf0e8fa8b4d5fa3 | d493276f3a09b6f161b9d3a79d5df55f48a0557c | /LeetCode_ClimbingStairs.java | 2aaee60fbae458b7ebc0576b6e5ea302c6524a7d | [] | no_license | AnneMayor/algorithmstudy | 31e034e9e7c8ffab0601f58b9ec29bea62aacf24 | 944870759ff43d0c275b28f0dcf54f5dd4b8f4b1 | refs/heads/master | 2023-04-26T21:25:21.679777 | 2023-04-15T09:08:02 | 2023-04-15T09:08:02 | 182,223,870 | 0 | 0 | null | 2021-06-20T06:49:02 | 2019-04-19T07:42:00 | C++ | UTF-8 | Java | false | false | 328 | java | public class Solution {
public int climbStairs(int n) {
if(n == 1) return 1;
if(n == 2) return 2;
int [] dp = new int[n+1];
dp[1] = 1;
dp[2] = 2;
for(int i = 3; i <= n; i++) {
dp[i] = dp[i - 1] + dp[i - 2];
}
return dp[n];
}
} | [
"[email protected]"
] | |
ce087ea5608a73f986d3a0e3774b93bcf7f62ac4 | b5389245f454bd8c78a8124c40fdd98fb6590a57 | /big_variable_tree/androidAppModule55/src/main/java/androidAppModule55packageJava0/Foo3.java | 956f99d357ad467e95eb3c1833a96dd52a09188b | [] | no_license | jin/android-projects | 3bbf2a70fcf9a220df3716b804a97b8c6bf1e6cb | a6d9f050388cb8af84e5eea093f4507038db588a | refs/heads/master | 2021-10-09T11:01:51.677994 | 2018-12-26T23:10:24 | 2018-12-26T23:10:24 | 131,518,587 | 29 | 1 | null | 2018-12-26T23:10:25 | 2018-04-29T18:21:09 | Java | UTF-8 | Java | false | false | 264 | java | package androidAppModule55packageJava0;
public class Foo3 {
public void foo0() {
new androidAppModule55packageJava0.Foo2().foo3();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
}
| [
"[email protected]"
] | |
90282438755508202c5bdbe7e138aed59b7527cf | d80a0041cfcd8ab1ab248a1652bd0e13b1b8ffd7 | /src/practick_SS/Employee.java | dddbdf1f43302f978e47d04f08f96fb6af1f7997 | [] | no_license | iraVG/JavaPracktic | ed8f8cd53412122e1811eb3fecf9c86c69a45420 | 59ffc05f243152a4c0fb19c73f8f70b8c04e1a63 | refs/heads/master | 2023-07-28T18:08:23.976022 | 2021-09-08T11:05:38 | 2021-09-08T11:05:38 | 404,312,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,195 | java | package practick_SS;
import java.io.Serializable;
import java.util.Objects;
public abstract class Employee implements Serializable {
private int id;
private String name;
public abstract double averageMonthlySalary();
public Employee() {
}
public Employee(int id, String name) {
this.id = id;
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Employee employee = (Employee) o;
return id == employee.id &&
Objects.equals(name, employee.name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public String toString() {
return "Employee{" +
"id=" + id +
", name='" + name + '\'' + " Salary= "+averageMonthlySalary()+
'}';
}
}
| [
"[email protected]"
] | |
cfe47d164b5f8b847e410a1a5ab6c36f4557914f | 72030344b6f1a60df460889fe751253e78f2548a | /Training_Projects/Day5/PageFactorySoftest/PageFactorySoftest/src/packPageObject/SoftestRunner.java | af6c83061409b3acf707d582ab9e1320256eb204 | [] | no_license | mranirudha/WebMarketing_SeleniumProject | 6928542704b8e2a7767bd401d0f23a71e7b9f1af | cfcd5cacf3f7abf1f535f5981b1039e2c16784fc | refs/heads/master | 2023-08-07T12:14:02.140033 | 2021-08-27T10:32:04 | 2021-08-27T10:32:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,199 | java | package packPageObject;
import org.openqa.selenium.support.PageFactory;
import org.testng.Reporter;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import packPageObject.MyDataproviders;
public class SoftestRunner extends OpenAndCloseBrowser
{
Home home ;
Login login ;
Student student;
Library lib;
@BeforeMethod
public void initElem()
{
home = PageFactory.initElements(driver, Home.class);
login = PageFactory.initElements(driver, Login.class);
student=PageFactory.initElements(driver, Student.class);
}
@Test(dataProvider="DP-XL",dataProviderClass=MyDataproviders.class)
public void testLogin(String user,String pwd,String verify,String page,String type) throws Exception
{
Reporter.log("HOME : ",true);
home.OpenHomePage().VerifyHome().VerifyLogo().clickOnLogin();
Reporter.log("Login Type : " + type,true);
login.enterUser(user).enterPwd(pwd).clickSubmit();
lib=new Library(driver);
lib.VerifyExpPage(page);
if(type.equalsIgnoreCase("Valid"))
{
student.VerifyStudent(verify).clickSignout().VerifyHome();
}
else
{
login.VerifyMsg(verify, type);
}
}
}
| [
"[email protected]"
] | |
e2b9101365dcedeabe78058cebc79acb61b31659 | 70722bec203abbdc5159a67563cb2b82a944c668 | /projection/src/InsererF.java | 363a1499d25064c44309f98545d79b2e6c522f07 | [] | no_license | christian-kocke/cpoa_s3 | 7512a5e083be0ce6549ffa6e854fdfaf70dbe8fb | 69d232478a4aa172ce6e4949c9dfb2a4ae0ea768 | refs/heads/master | 2016-09-06T08:25:50.174366 | 2015-01-14T10:22:58 | 2015-01-14T10:22:58 | 27,433,864 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 32,338 | java |
import java.awt.Dimension;
import java.awt.List;
import java.sql.Date;
import java.sql.Time;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.table.DefaultTableModel;
import projection.Creneau;
import projection.DaoCreneau;
import projection.DaoException;
import projection.DaoFilm;
import projection.DaoPlanning;
import projection.DaoProjection;
import projection.DaoSalle;
import projection.Projection;
import projection.Salle;
/*
* 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.
*/
/**
*
* @author Aïssa
*/
public class InsererF extends javax.swing.JFrame {
static final long ONE_MINUTE_IN_MILLIS=60000;//millisecs
public String titre;
public int duree;
/**
* Creates new form InsererF
* @param titre
* @param duree
* @throws projection.DaoException
*/
public InsererF(String titre, int duree) throws DaoException {
this.titre=titre;
this.duree=duree;
initComponents();
this.setLocationRelativeTo(null);
jLabel6.setText("Film sélectionné: " + titre);
jLabel7.setText("Pour cette date, la limite de film de ce concours a été atteinte");
jLabel7.setVisible(false);
DaoProjection daoPr = DaoProjection.getDAO();
Collection<Projection> col2;
col2= new ArrayList();
//Retire le choix de projection officiel si elle est déja programmée
col2=daoPr.ProjectionPrevues(titre);
for (Projection p : col2) {
if(p.getId_type()==1) {
jComboBox1.removeItemAt(0);
}
}
DaoSalle daoS = DaoSalle.getDAO();
Collection<Salle> col;
col = new ArrayList();
col=daoS.salleParType(titre);
//Insertion des salles possibles pour le film sélectionné
for (Salle s : col) {
this.jComboBox3.addItem(s.getNom());
}
Collection<String> col3;
col3 = new ArrayList();
DaoProjection daoP = DaoProjection.getDAO();
col3=daoP.TypeDeProjectionPrevue(titre);
//Ne laisse que le type de projections possibles
if(col3.contains("Officielle")) {
jComboBox1.removeItem("Officielle");
}
if(col3.contains("Lendemain")) {
jComboBox1.removeItem("Lendemain");
}
if(col3.contains("Veille")) {
jComboBox1.removeItem("Veille");
}
}
private InsererF() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
/**
* 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() {
jLabel5 = new javax.swing.JLabel();
jComboBox3 = new javax.swing.JComboBox();
b1 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
b2 = new javax.swing.JLabel();
dateChooserCombo1 = new datechooser.beans.DateChooserCombo();
jLabel7 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jComboBox2 = new javax.swing.JComboBox();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jLabel1 = new javax.swing.JLabel();
jComboBox1 = new javax.swing.JComboBox();
reduce = new javax.swing.JLabel();
close = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMinimumSize(new java.awt.Dimension(791, 578));
setUndecorated(true);
setPreferredSize(new java.awt.Dimension(791, 578));
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel5.setText("Sélectionner une salle pour la projection:");
getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 150, -1, -1));
jComboBox3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox3ActionPerformed(evt);
}
});
getContentPane().add(jComboBox3, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 146, -1, -1));
b1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/valider_default.png"))); // NOI18N
b1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
b1MouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
b1MouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
b1MouseExited(evt);
}
});
getContentPane().add(b1, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 400, 160, 50));
jLabel6.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 90, 300, -1));
b2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/retour_default.png"))); // NOI18N
b2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
b2MouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
b2MouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
b2MouseExited(evt);
}
});
getContentPane().add(b2, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 400, 40, 50));
dateChooserCombo1.setCurrentView(new datechooser.view.appearance.AppearancesList("Contrast",
new datechooser.view.appearance.ViewAppearance("custom",
new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
new java.awt.Color(0, 0, 0),
new java.awt.Color(0, 0, 255),
false,
true,
new datechooser.view.appearance.swing.ButtonPainter()),
new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
new java.awt.Color(0, 0, 0),
new java.awt.Color(0, 0, 255),
true,
true,
new datechooser.view.appearance.swing.ButtonPainter()),
new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
new java.awt.Color(0, 0, 255),
new java.awt.Color(0, 0, 255),
false,
true,
new datechooser.view.appearance.swing.ButtonPainter()),
new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
new java.awt.Color(128, 128, 128),
new java.awt.Color(0, 0, 255),
false,
true,
new datechooser.view.appearance.swing.LabelPainter()),
new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
new java.awt.Color(0, 0, 0),
new java.awt.Color(0, 0, 255),
false,
true,
new datechooser.view.appearance.swing.LabelPainter()),
new datechooser.view.appearance.swing.SwingCellAppearance(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11),
new java.awt.Color(0, 0, 0),
new java.awt.Color(255, 0, 0),
false,
false,
new datechooser.view.appearance.swing.ButtonPainter()),
(datechooser.view.BackRenderer)null,
false,
true)));
dateChooserCombo1.setNothingAllowed(false);
try {
dateChooserCombo1.setDefaultPeriods(new datechooser.model.multiple.PeriodSet(new datechooser.model.multiple.Period(new java.util.GregorianCalendar(2015, 4, 13),
new java.util.GregorianCalendar(2015, 4, 13))));
} catch (datechooser.model.exeptions.IncompatibleDataExeption e1) {
e1.printStackTrace();
}
dateChooserCombo1.setMaxDate(new java.util.GregorianCalendar(2015, 4, 24));
dateChooserCombo1.setMinDate(new java.util.GregorianCalendar(2015, 4, 13));
dateChooserCombo1.addCommitListener(new datechooser.events.CommitListener() {
public void onCommit(datechooser.events.CommitEvent evt) {
dateChooserCombo1actionPerformed(evt);
}
});
getContentPane().add(dateChooserCombo1, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 244, 90, -1));
jLabel7.setFont(new java.awt.Font("Tahoma", 1, 10)); // NOI18N
jLabel7.setForeground(new java.awt.Color(255, 51, 51));
getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 120, 300, -1));
jLabel3.setText("Préférence de date:");
getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 250, -1, -1));
jLabel4.setText("Préférence de créneau:");
getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 300, -1, -1));
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Aucune", "Matinée", "Après-midi", "Soirée" }));
jComboBox2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox2ActionPerformed(evt);
}
});
getContentPane().add(jComboBox2, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 296, -1, -1));
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Créneau(x) disponible(s)"
}
));
jScrollPane1.setViewportView(jTable1);
if (jTable1.getColumnModel().getColumnCount() > 0) {
jTable1.getColumnModel().getColumn(0).setHeaderValue("Créneau(x) disponible(s)");
}
getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 80, 200, 270));
jLabel1.setText("Type de projection:");
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 200, -1, -1));
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Officielle", "Presse", "Veille", "Lendemain" }));
jComboBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox1ActionPerformed(evt);
}
});
getContentPane().add(jComboBox1, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 194, -1, -1));
reduce.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/reduire2_default.png"))); // NOI18N
reduce.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
reduceMouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
reduceMouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
reduceMouseExited(evt);
}
});
getContentPane().add(reduce, new org.netbeans.lib.awtextra.AbsoluteConstraints(740, 10, 20, 20));
close.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/fermer_default.png"))); // NOI18N
close.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
closeMouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
closeMouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
closeMouseExited(evt);
}
});
getContentPane().add(close, new org.netbeans.lib.awtextra.AbsoluteConstraints(762, 5, 20, 20));
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/InsererF.png"))); // NOI18N
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 790, 560));
pack();
}// </editor-fold>//GEN-END:initComponents
private void reduceMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reduceMouseClicked
this.setState(1);
}//GEN-LAST:event_reduceMouseClicked
private void reduceMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reduceMouseEntered
ImageIcon II = new ImageIcon(getClass().getResource("Images/reduire2_hover.png"));
reduce.setIcon(II);
}//GEN-LAST:event_reduceMouseEntered
private void reduceMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reduceMouseExited
ImageIcon II = new ImageIcon(getClass().getResource("Images/reduire2_default.png"));
reduce.setIcon(II);
}//GEN-LAST:event_reduceMouseExited
private void closeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeMouseClicked
System.exit(0);
}//GEN-LAST:event_closeMouseClicked
private void closeMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeMouseEntered
ImageIcon II = new ImageIcon(getClass().getResource("Images/fermer_hover.png"));
close.setIcon(II);
}//GEN-LAST:event_closeMouseEntered
private void closeMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeMouseExited
ImageIcon II = new ImageIcon(getClass().getResource("Images/fermer_default.png"));
close.setIcon(II);
}//GEN-LAST:event_closeMouseExited
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jComboBox1ActionPerformed
private void b2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_b2MouseClicked
ChoixF cf = null;
try {
cf = new ChoixF();
} catch (DaoException ex) {
Logger.getLogger(InsererF.class.getName()).log(Level.SEVERE, null, ex);
}
cf.setVisible(rootPaneCheckingEnabled);
this.dispose();
}//GEN-LAST:event_b2MouseClicked
private void b2MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_b2MouseEntered
ImageIcon II = new ImageIcon(getClass().getResource("Images/retour_hover.png"));
b2.setIcon(II);
}//GEN-LAST:event_b2MouseEntered
private void b2MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_b2MouseExited
ImageIcon II = new ImageIcon(getClass().getResource("Images/retour_default.png"));
b2.setIcon(II);
}//GEN-LAST:event_b2MouseExited
private void b1MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_b1MouseEntered
ImageIcon II = new ImageIcon(getClass().getResource("Images/valider_hover.png"));
b1.setIcon(II);
}//GEN-LAST:event_b1MouseEntered
private void b1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_b1MouseExited
ImageIcon II = new ImageIcon(getClass().getResource("Images/valider_default.png"));
b1.setIcon(II);
}//GEN-LAST:event_b1MouseExited
private void jComboBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox3ActionPerformed
//Récuperer la date sélectionner et proposer des créneaux selon celle-ci
String date = dateChooserCombo1.getText();
String mois = date.substring(3, 5);
String jour = date.substring(0,2);
String date_sql= "2015-" +mois+ "-" +jour;
//Proposer dans créneau selon la salle,la date sélectionnée et la durée du film
try {
DaoProjection daoP = DaoProjection.getDAO();
Collection <Projection> col;
col = new ArrayList();
col = daoP.ProjectionsDuJour(date_sql, jComboBox3.getSelectedItem().toString(), jComboBox2.getSelectedItem().toString());
afficherCreneaux(date_sql,col,jComboBox2.getSelectedItem().toString());
} catch (DaoException ex) {
Logger.getLogger(InsererF.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jComboBox3ActionPerformed
private void dateChooserCombo1actionPerformed(datechooser.events.CommitEvent evt) {//GEN-FIRST:event_dateChooserCombo1actionPerformed
//Récuperer la date sélectionner et proposer des créneaux selon celle-ci
String date = dateChooserCombo1.getText();
String mois = date.substring(3, 5);
String jour = date.substring(0,2);
String date_sql= "2015-" +mois+ "-" +jour;
//Proposer dans créneau selon la salle,la date sélectionnée et la durée du film
try {
DaoProjection daoP = DaoProjection.getDAO();
Collection <Projection> col;
col = new ArrayList();
col = daoP.ProjectionsDuJour(date_sql, jComboBox3.getSelectedItem().toString(), jComboBox2.getSelectedItem().toString());
afficherCreneaux(date_sql,col,jComboBox2.getSelectedItem().toString());
} catch (DaoException ex) {
Logger.getLogger(InsererF.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_dateChooserCombo1actionPerformed
private void jComboBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox2ActionPerformed
//Récuperer la date sélectionner et proposer des créneaux selon celle-ci
String date = dateChooserCombo1.getText();
String mois = date.substring(3, 5);
String jour = date.substring(0,2);
String date_sql= "2015-" +mois+ "-" +jour;
//Proposer dans créneau selon la salle,la date sélectionnée et la durée du film
try {
DaoProjection daoP = DaoProjection.getDAO();
Collection <Projection> col;
col = new ArrayList();
col = daoP.ProjectionsDuJour(date_sql, jComboBox3.getSelectedItem().toString(), jComboBox2.getSelectedItem().toString());
afficherCreneaux(date_sql,col,jComboBox2.getSelectedItem().toString());
} catch (DaoException ex) {
Logger.getLogger(InsererF.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jComboBox2ActionPerformed
private void b1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_b1MouseClicked
DaoPlanning daoPl = null;
try {
daoPl = DaoPlanning.getDAO();
} catch (DaoException ex) {
Logger.getLogger(InsererF.class.getName()).log(Level.SEVERE, null, ex);
}
//Verifie qu'un seul créneau est sélectionné
if(jTable1.getSelectedRowCount()>1) {
jLabel7.setText("Merci de sélectionner un seul créneau horaire");
jLabel7.setVisible(true);
}
else if(jTable1.getSelectedRowCount()<1) {
jLabel7.setText("Merci de sélectionner un créneau horaire");
jLabel7.setVisible(true);
}
//Vérifie qu'un planning existe pour ce film (ce concours)
else try {
if(!daoPl.PlanningExiste(this.titre)) {
jLabel7.setText("Aucun planning n'a été créé pour le concours faisant participer ce film");
jLabel7.setVisible(true);
}
//Récupération des choix et insertion
else {
DaoProjection daoP = DaoProjection.getDAO();
String salle= (String)jComboBox3.getSelectedItem();
String type_proj = (String)jComboBox1.getSelectedItem();
String date = dateChooserCombo1.getText();
String mois = date.substring(3, 5);
String jour = date.substring(0,2);
String date_sql= "2015-" +mois+ "-" +jour;
int ligne = jTable1.getSelectedRow();
String heure_choisie = jTable1.getValueAt(ligne, 0).toString() + ":00"; //Ajout des secondes pour le format SQL
daoP.insérerProjection(type_proj, salle, date_sql, heure_choisie, this.titre);
}
} catch (DaoException ex) {
Logger.getLogger(InsererF.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_b1MouseClicked
public void afficherCreneaux(String date, Collection<Projection> c, String preference) throws DaoException {
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
model.setRowCount(0);
/*OPÉRATION SUR TIME:
Time t = Time.valueOf("09:00:00");
Calendar cal = Calendar.getInstance();
cal.setTime(t);
cal.add(Calendar.MINUTE, 123);
System.out.println(cal.getTime().toString().substring(11, 16));*/
DaoFilm daoF = DaoFilm.getDAO();
//Test des contraintes de nombres de film par jour
if (daoF.testNbFilmParJour(this.titre, date)) {
int indiceTab = 0;
Projection[] tab_proj = new Projection[15];
for (Projection p : c) {
tab_proj[indiceTab] = p;
indiceTab++;
}
indiceTab=0;
System.out.println(c.size());
//Si il y a au moins une projection dejà prevue ce jour la
if (c.size()>0) {
while(indiceTab<14) {
Time debut_creneau_libre = null;
Time fin_creneau_libre = null;
Time heure_possible;
Time fin_default = null;
Time debut_default = null;
Calendar cal_possible=Calendar.getInstance();
Calendar cal_debut = Calendar.getInstance();
Calendar cal_fin = Calendar.getInstance();
//Toute la journée
if (preference.equals("Aucune")){
debut_default=Time.valueOf("09:00:00");
fin_default=Time.valueOf("23:00:00");
}
//Matinée
else if (preference.equals("Matinée")) {
debut_default=Time.valueOf("09:00:00");
fin_default=Time.valueOf("12:00:00");
}
//Après-midi
else if (preference.equals("Après_midi")) {
debut_default=Time.valueOf("13:00:00");
fin_default=Time.valueOf("19:00:00");
}
//Soirée
else if (preference.equals("Soirée")) {
debut_default=Time.valueOf("19:00:00");
fin_default=Time.valueOf("23:00:00");
}
//Si c'est le premier creneau on verifie si il est à la première heure ou non
if (indiceTab==0) {
if(!tab_proj[indiceTab].getHeure().equals(debut_default)) {
debut_creneau_libre=debut_default;
}
else {
debut_creneau_libre=HeureFin(tab_proj[indiceTab]);
}
}
else {
debut_creneau_libre=HeureFin(tab_proj[indiceTab-1]);
if(tab_proj[indiceTab]==null) {
fin_creneau_libre=fin_default;
}
//Si c'était la dernière projection
else{
fin_creneau_libre = Time.valueOf(tab_proj[indiceTab].getHeure());
indiceTab=14;
}
}
cal_debut.setTime(debut_creneau_libre);
cal_fin.setTime(fin_creneau_libre);
int duree_creneau = Math.round(Math.abs((cal_debut.getTimeInMillis()- cal_fin.getTimeInMillis())/ONE_MINUTE_IN_MILLIS));
int i = 0;
//Tant que l'on peut encore placer le film au moins une fois dans le créneau
//Ici, i nous donnera le nombre de fois que l'on peut placer le film dans le créneau
while (duree_creneau>this.duree) {
duree_creneau = duree_creneau - this.duree;
i++;
}
heure_possible = debut_creneau_libre;
cal_possible.setTime(heure_possible);
//Ajout à la jTable des créneaux possibles
for ( int j=0; j<i;j++) {
model.addRow(new Object[]{cal_debut.getTime().toString().substring(11, 16)});
cal_debut.add(Calendar.MINUTE, this.duree);
}
indiceTab++;
}
}
//Si il n'y a pas de projections prévues ce jour là
else {
Time debut_creneau_libre = null;
Time fin_creneau_libre = null;
Time heure_possible;
Calendar cal_possible=Calendar.getInstance();
Calendar cal_debut = Calendar.getInstance();
Calendar cal_fin = Calendar.getInstance();
if (preference.equals("Aucune")) {
debut_creneau_libre= Time.valueOf("09:00:00");
fin_creneau_libre=Time.valueOf("23:00:00");
}
else if (preference.equals("Matinée")) {
debut_creneau_libre= Time.valueOf("09:00:00");
fin_creneau_libre=Time.valueOf("12:00:00");
}
else if (preference.equals("Après-midi")) {
debut_creneau_libre= Time.valueOf("13:00:00");
fin_creneau_libre=Time.valueOf("19:00:00");
}
else if (preference.equals("Soirée")) {
debut_creneau_libre= Time.valueOf("19:00:00");
fin_creneau_libre=Time.valueOf("23:00:00");
}
cal_debut.setTime(debut_creneau_libre);
cal_fin.setTime(fin_creneau_libre);
int duree_creneau = Math.round(Math.abs((cal_debut.getTimeInMillis()- cal_fin.getTimeInMillis())/ONE_MINUTE_IN_MILLIS));
System.out.println("debut_creneau =" + debut_creneau_libre);
System.out.println("fin_creneau =" + fin_creneau_libre);
System.out.println("duree_creneau =" + duree_creneau);
int i = 0;
//Tant que l'on peut encore placer le film au moins une fois dans le créneau
//Ici, i nous donnera le nombre de fois que l'on peut placer le film dans le créneau
while (duree_creneau>this.duree) {
duree_creneau = duree_creneau - this.duree;
i++;
}
System.out.println("i = " +i);
heure_possible = debut_creneau_libre;
cal_possible.setTime(heure_possible);
//Ajout à la jTable des créneaux possibles
for ( int j=0; j<i;j++) {
model.addRow(new Object[]{cal_debut.getTime().toString().substring(11, 16)});
cal_debut.add(Calendar.MINUTE, this.duree);
}
}
}
else {
jLabel7.setVisible(true);
}
}
//Retourne l'heure de fin d'une projection
public Time HeureFin(Projection p) {
Time t = Time.valueOf(p.getHeure());
Calendar cal = Calendar.getInstance();
cal.setTime(t);
cal.add(Calendar.MINUTE, p.getDuree());
Time t1 = Time.valueOf(cal.getTime().toString().substring(11, 19));
return t1;
}
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(InsererF.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(InsererF.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(InsererF.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(InsererF.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
new InsererF().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel b1;
private javax.swing.JLabel b2;
private javax.swing.JLabel close;
private datechooser.beans.DateChooserCombo dateChooserCombo1;
private javax.swing.JComboBox jComboBox1;
private javax.swing.JComboBox jComboBox2;
private javax.swing.JComboBox jComboBox3;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTable1;
private javax.swing.JLabel reduce;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
7b1138689f1aa3c145ebdd39b1e268b86a1a8eb9 | f33516ffd4ac82b741f936ae2f7ef974b5f7e2f9 | /changedPlugins/org.emftext.language.java.resource.java/src-gen/org/emftext/language/java/resource/java/mopp/JavaAntlrScanner.java | a8c5b5e09a485b62ed51cc28cf27d31a3a4bbbf0 | [] | no_license | ichupakhin/sdq | e8328d5fdc30482c2f356da6abdb154e948eba77 | 32cc990e32b761aa37420f9a6d0eede330af50e2 | refs/heads/master | 2023-01-06T13:33:20.184959 | 2020-11-01T13:29:04 | 2020-11-01T13:29:04 | 246,244,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,633 | java | /*******************************************************************************
* Copyright (c) 2006-2015
* Software Technology Group, Dresden University of Technology
* DevBoost GmbH, Dresden, Amtsgericht Dresden, HRB 34001
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Software Technology Group - TU Dresden, Germany;
* DevBoost GmbH - Dresden, Germany
* - initial API and implementation
******************************************************************************/
package org.emftext.language.java.resource.java.mopp;
import org.antlr.runtime3_4_0.ANTLRStringStream;
import org.antlr.runtime3_4_0.Lexer;
import org.antlr.runtime3_4_0.Token;
public class JavaAntlrScanner implements org.emftext.language.java.resource.java.IJavaTextScanner {
private Lexer antlrLexer;
public JavaAntlrScanner(Lexer antlrLexer) {
this.antlrLexer = antlrLexer;
}
public org.emftext.language.java.resource.java.IJavaTextToken getNextToken() {
if (antlrLexer.getCharStream() == null) {
return null;
}
final Token current = antlrLexer.nextToken();
if (current == null || current.getType() < 0) {
return null;
}
org.emftext.language.java.resource.java.IJavaTextToken result = new org.emftext.language.java.resource.java.mopp.JavaANTLRTextToken(current);
return result;
}
public void setText(String text) {
antlrLexer.setCharStream(new ANTLRStringStream(text));
}
}
| [
"[email protected]"
] | |
0e2bd666cf2517379c913c80044bd70a6488692b | 4dd22e45d6216df9cd3b64317f6af953f53677b7 | /LMS/src/main/java/com/ulearning/ulms/content/ugroupship/dao/UGroupShipDAOFactory.java | 2ea405e43ac3f16b4cf6592ce835aef4f7b46c24 | [] | no_license | tianpeijun198371/flowerpp | 1325344032912301aaacd74327f24e45c32efa1e | 169d3117ee844594cb84b2114e3fd165475f4231 | refs/heads/master | 2020-04-05T23:41:48.254793 | 2008-02-16T18:03:08 | 2008-02-16T18:03:08 | 40,278,397 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,032 | java | /**
* Copyright (c) 2000-2005.Huaxia Dadi Distance Learning Services Co.,Ltd.
* All rights reserved.
*/
package com.ulearning.ulms.content.ugroupship.dao;
import com.ulearning.ulms.content.ugroupship.exceptions.UGroupShipDAOSysException;
/**
* Class description goes here.
* <p/>
* Created by Auto Code Produce System
* User: xiejh
* Date: 20060317
* Time: 103906
*/
public class UGroupShipDAOFactory
{
public static UGroupShipDAO getDAO() throws UGroupShipDAOSysException
{
UGroupShipDAO dao = null;
try
{
dao = new UGroupShipDAOImpl();
}
catch (Exception se)
{
throw new UGroupShipDAOSysException(
"UGroupShipDAOFactory.getDAO: Exception while getting DAO type : \n" +
se.getMessage());
}
return dao;
}
}
| [
"flowerpp@aeb45441-6f43-0410-8555-aba96bfc7626"
] | flowerpp@aeb45441-6f43-0410-8555-aba96bfc7626 |
4dec3361f6bd0cc8b3fe765af04de53825678e4d | 481adc8f5686985a7b9241055d50ff6084beea95 | /lifecycle/lifecycle-common/src/main/java/androidx/lifecycle/FullLifecycleObserver.java | c959d0312866b922b2fd437bc5dea0d251b9af95 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | RikkaW/androidx | 5f5e8a996f950a85698073330c16f5341b48e516 | 6d53f95e5d979366cf7935ad7f4f14f76a951ea5 | refs/heads/androidx-main | 2023-06-18T22:35:12.976328 | 2021-07-24T13:53:34 | 2021-07-24T13:53:34 | 389,105,112 | 4 | 0 | Apache-2.0 | 2021-07-24T13:53:34 | 2021-07-24T13:25:43 | null | UTF-8 | Java | false | false | 961 | java | /*
* Copyright (C) 2017 The Android Open Source Project
*
* 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 androidx.lifecycle;
interface FullLifecycleObserver extends LifecycleObserver {
void onCreate(LifecycleOwner owner);
void onStart(LifecycleOwner owner);
void onResume(LifecycleOwner owner);
void onPause(LifecycleOwner owner);
void onStop(LifecycleOwner owner);
void onDestroy(LifecycleOwner owner);
}
| [
"[email protected]"
] | |
f47a037667b0360eb93f5a6cf2c88ebd6ae9174f | 5639be2318fc624d8dac7f00b9cf8838859ec63f | /src/main/java/com/tatvasoft/employeejob/web/rest/DepartmentResource.java | 6a69dac8d161b80bbefbd09315378abaaaa8a050 | [] | no_license | manojrpatil/jhipster_demo | 445ea1f8fe8f04adf44b31e5c808a6f85238d0a3 | 6481260c489001b91372f0e3058ac5233db0b90e | refs/heads/master | 2021-09-01T14:18:56.936775 | 2017-12-27T12:18:02 | 2017-12-27T12:18:02 | 115,495,554 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,835 | java | package com.tatvasoft.employeejob.web.rest;
import com.codahale.metrics.annotation.Timed;
import com.tatvasoft.employeejob.service.DepartmentService;
import com.tatvasoft.employeejob.web.rest.errors.BadRequestAlertException;
import com.tatvasoft.employeejob.web.rest.util.HeaderUtil;
import com.tatvasoft.employeejob.service.dto.DepartmentDTO;
import io.github.jhipster.web.util.ResponseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Optional;
/**
* REST controller for managing Department.
*/
@RestController
@RequestMapping("/api")
public class DepartmentResource {
private final Logger log = LoggerFactory.getLogger(DepartmentResource.class);
private static final String ENTITY_NAME = "department";
private final DepartmentService departmentService;
public DepartmentResource(DepartmentService departmentService) {
this.departmentService = departmentService;
}
/**
* POST /departments : Create a new department.
*
* @param departmentDTO the departmentDTO to create
* @return the ResponseEntity with status 201 (Created) and with body the new departmentDTO, or with status 400 (Bad Request) if the department has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/departments")
@Timed
public ResponseEntity<DepartmentDTO> createDepartment(@Valid @RequestBody DepartmentDTO departmentDTO) throws URISyntaxException {
log.debug("REST request to save Department : {}", departmentDTO);
if (departmentDTO.getId() != null) {
throw new BadRequestAlertException("A new department cannot already have an ID", ENTITY_NAME, "idexists");
}
DepartmentDTO result = departmentService.save(departmentDTO);
return ResponseEntity.created(new URI("/api/departments/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* PUT /departments : Updates an existing department.
*
* @param departmentDTO the departmentDTO to update
* @return the ResponseEntity with status 200 (OK) and with body the updated departmentDTO,
* or with status 400 (Bad Request) if the departmentDTO is not valid,
* or with status 500 (Internal Server Error) if the departmentDTO couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/departments")
@Timed
public ResponseEntity<DepartmentDTO> updateDepartment(@Valid @RequestBody DepartmentDTO departmentDTO) throws URISyntaxException {
log.debug("REST request to update Department : {}", departmentDTO);
if (departmentDTO.getId() == null) {
return createDepartment(departmentDTO);
}
DepartmentDTO result = departmentService.save(departmentDTO);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, departmentDTO.getId().toString()))
.body(result);
}
/**
* GET /departments : get all the departments.
*
* @return the ResponseEntity with status 200 (OK) and the list of departments in body
*/
@GetMapping("/departments")
@Timed
public List<DepartmentDTO> getAllDepartments() {
log.debug("REST request to get all Departments");
return departmentService.findAll();
}
/**
* GET /departments/:id : get the "id" department.
*
* @param id the id of the departmentDTO to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the departmentDTO, or with status 404 (Not Found)
*/
@GetMapping("/departments/{id}")
@Timed
public ResponseEntity<DepartmentDTO> getDepartment(@PathVariable Long id) {
log.debug("REST request to get Department : {}", id);
DepartmentDTO departmentDTO = departmentService.findOne(id);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(departmentDTO));
}
/**
* DELETE /departments/:id : delete the "id" department.
*
* @param id the id of the departmentDTO to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/departments/{id}")
@Timed
public ResponseEntity<Void> deleteDepartment(@PathVariable Long id) {
log.debug("REST request to delete Department : {}", id);
departmentService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
}
}
| [
"[email protected]"
] | |
18815f178e2df308577942658e042b7d414a60b6 | 24130494cd83717c794915642653f62b6cda78a1 | /gof-patterns/src/main/java/br/com/gof/patterns/visitor/FormatoVisitante.java | 775675eed46a8fbc672c9c2cfd0d2621ef68d1dd | [] | no_license | motadiego/gof-patterns | d7cd28d612339b84a65097a384e400d1031458e5 | 116f9c68a4090b5f7265692c8fa9456f2c1e71ea | refs/heads/master | 2023-02-25T09:43:09.257857 | 2021-01-28T02:09:56 | 2021-01-28T02:09:56 | 321,667,732 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 428 | java | package br.com.gof.patterns.visitor;
public interface FormatoVisitante {
public void visitarTitulo(String t);
public void visitarSubtitulo(String t);
public void visitarParagrafo(String p);
public void visitarTabela();
public void visitarTabelaCabecalho(String... ct);
public void visitarTabelaLinha(Object... o);
public void visitarTabelaFim();
public void visitarImagem(String path);
public Object getResultado();
}
| [
"[email protected]"
] | |
69cfb1d43b4925c8f2c5790362ce844dc299f64f | 339265c37840a7a8fece6418c0398f93b0a95ac4 | /src/com/engc/oamobile/ui/home/MainActivity.java | 05d4b19ae2c1c8e32c0b1cf11c9e1aac6151e28f | [] | no_license | giserh/OAMobile | f93b69ea72f21ac8a4b7cc4de032fb7c41fef10b | 98e7fafc63b003f5f6b77e15397a0524a431441e | refs/heads/master | 2021-01-14T14:06:42.335423 | 2014-07-17T16:23:42 | 2014-07-17T16:23:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,303 | java | package com.engc.oamobile.ui.home;
import java.util.ArrayList;
import java.util.List;
import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.engc.oamobile.R;
import com.engc.oamobile.support.utils.BitmapManager;
import com.engc.oamobile.support.utils.GlobalContext;
import com.engc.oamobile.support.widgets.ShowMorePopupWindow;
import com.engc.oamobile.ui.audit.OnlineAudit;
@SuppressLint("NewApi")
public class MainActivity extends Activity {
private GridView gvModem;
public List<String> imgtitleList; // 存放应用标题list
public List<Integer> imgList; // 存放应用图片list
public View[] itemViews;
private ShowMorePopupWindow smPw;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActionBar action = getActionBar();
action.hide();
initView();
initGridData();
}
private void initView() {
gvModem = (GridView) findViewById(R.id.gvmodem);
ImageView imgMore = (ImageView) findViewById(R.id.img_titlebar_more);
imgMore.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showPopupWindow();
showPopupView();
}
});
gvModem.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Intent intent;
switch (position) {
case 0:
intent = new Intent(MainActivity.this, OnlineAudit.class);
startActivity(intent);
break;
case 1:
break;
default:
break;
}
}
});
}
public void showPopupWindow() {
smPw = new ShowMorePopupWindow(MainActivity.this, itemsOnClick);
// 显示窗口
View view = MainActivity.this.findViewById(R.id.img_titlebar_more);
// 计算坐标的偏移量
int xoffInPixels = smPw.getWidth() - view.getWidth() + 10;
smPw.showAsDropDown(view, -xoffInPixels, 0);
}
// 为弹出窗口实现监听类
private OnClickListener itemsOnClick = new OnClickListener() {
public void onClick(View v) {
smPw.dismiss();
}
};
// 设置popupView
private void showPopupView() {
View view = ShowMorePopupWindow.initView();
/* ImageView userFace = (ImageView) view.findViewById(R.id.userface);
TextView userName = (TextView) view.findViewById(R.id.username);*/
// userName.setText(GlobalContext.getInstance().getSpUtil().getUserInfo().getUsername());
// String url
// =GlobalContext.getInstance().getSpUtil().getUserInfo().getPhoto();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
/*
* if (id == R.id.action_settings) { return true; }
*/
return super.onOptionsItemSelected(item);
}
private void initGridData() {
imgtitleList = new ArrayList<String>();
imgList = new ArrayList<Integer>();
imgtitleList.clear();
imgList.clear();
imgtitleList.add("新闻公告");
imgtitleList.add("在线审批");
imgtitleList.add("请假");
imgtitleList.add("即时消息");
imgtitleList.add("通讯录");
imgtitleList.add("请假记录");
imgList.add(R.drawable.icon_news);
imgList.add(R.drawable.icon_online_audit);
imgList.add(R.drawable.icon_leave);
imgList.add(R.drawable.icon_message);
imgList.add(R.drawable.icon_contact);
imgList.add(R.drawable.icon_leave_record);
gvModem.setAdapter(new GridViewModemAdapter(imgtitleList, imgList));
}
/**
*
* @ClassName: GridViewModemAdapter
* @Description: APPs 九宫格 数据适配源
* @author wutao
* @date 2013-10-10 上午11:23:54
*
*/
public class GridViewModemAdapter extends BaseAdapter {
public GridViewModemAdapter(List<String> imgTitles, List<Integer> images) {
itemViews = new View[images.size()];
for (int i = 0; i < itemViews.length; i++) {
itemViews[i] = makeItemView(imgTitles.get(i), images.get(i));
}
}
public View makeItemView(String imageTitilsId, int imageId) {
// try {
// LayoutInflater inflater = (LayoutInflater)
// UtitlsModemFragment.this
// .getSystemService(LAYOUT_INFLATER_SERVICE);
// View
// view=LayoutInflater.from(getActivity().getApplicationContext()).inflate(R.layout.grid_apps_item,
// null);
LayoutInflater inflater = LayoutInflater.from(MainActivity.this);
View itemView = inflater.inflate(R.layout.grid_apps_item, null);
TextView title = (TextView) itemView.findViewById(R.id.TextItemId);
title.setText(imageTitilsId);
ImageView image = (ImageView) itemView
.findViewById(R.id.ImageItemId);
image.setImageResource(imageId);
// image.setScaleType(ImageView.ScaleType.FIT_CENTER);
return itemView;
/*
* } catch (Exception e) {
* System.out.println("makeItemView Exception error" +
* e.getMessage()); return null; }
*/
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return itemViews.length;
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return itemViews[position];
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
if (convertView == null) {
return itemViews[position];
}
return convertView;
}
}
}
| [
"[email protected]"
] | |
e3c66d7b979c36b6eab41b5722fd11101e228c04 | 315cd94cef2f6e43f7a7e532f763604f8c55d574 | /app/src/main/java/self/samsung/gallery/view/SlowerCustomScroller.java | 0504daec9aba877b39ebd5b6cd6a2d9500fcac0a | [] | no_license | subinbabu89/SamsungGalleryUI | ede9dd462ff58b7c7bed7e015e4dfd522eecec02 | 662e158400774046890aff5fddf6872bf300a659 | refs/heads/master | 2021-01-19T00:19:08.990444 | 2017-03-28T23:23:16 | 2017-03-28T23:23:16 | 85,439,060 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,103 | java | package self.samsung.gallery.view;
import android.content.Context;
import android.view.animation.Interpolator;
import android.widget.Scroller;
/**
* Custom slower scroller for the pager view
* <p>
* Created by subin on 3/19/2017.
*/
class SlowerCustomScroller extends Scroller {
private double mScrollFactor = 1;
@SuppressWarnings("unused")
public SlowerCustomScroller(Context context) {
super(context);
}
SlowerCustomScroller(Context context, Interpolator interpolator) {
super(context, interpolator);
}
@SuppressWarnings("unused")
public SlowerCustomScroller(Context context, Interpolator interpolator, boolean flywheel) {
super(context, interpolator, flywheel);
}
/**
* Set the factor by which the duration will change
*/
void setScrollDurationFactor(double scrollFactor) {
mScrollFactor = scrollFactor;
}
@Override
public void startScroll(int startX, int startY, int dx, int dy, int duration) {
super.startScroll(startX, startY, dx, dy, (int) (duration * mScrollFactor));
}
}
| [
"[email protected]"
] | |
fffde435adcfab051f18035aca5c2748cd68e345 | ba2386ce813d793d4ed122065575878bd4a9bd38 | /app/src/main/java/ve/com/abicelis/cryptomaster/data/local/CachedCoinDao.java | 66753330ac7de0cbda6b594ec7cc6985054a61e6 | [
"MIT"
] | permissive | abicelis/CryptoMaster | 1b9bdc9ae5341d0f986562502c54620494563dd9 | cad16738bdad5e36dfc6ae9e091b4db6e35638b1 | refs/heads/master | 2020-03-18T05:10:59.880500 | 2019-01-04T20:47:43 | 2019-01-04T20:47:43 | 134,328,677 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,325 | java | package ve.com.abicelis.cryptomaster.data.local;
import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.RoomWarnings;
import android.arch.persistence.room.Transaction;
import android.arch.persistence.room.Update;
import java.util.List;
import io.reactivex.Maybe;
import io.reactivex.Single;
import ve.com.abicelis.cryptomaster.data.model.CachedCoin;
import ve.com.abicelis.cryptomaster.data.model.Coin;
/**
* Created by abicelis on 23/6/2018.
*/
@Dao
public abstract class CachedCoinDao {
@Query("SELECT count(*) FROM cached_coin")
public abstract Single<Integer> count();
@Query("SELECT * FROM cached_coin")
public abstract Single<List<CachedCoin>> getAll();
@Query("SELECT * FROM cached_coin where cached_coin_id = :cachedCoinId")
public abstract Maybe<CachedCoin> getById(long cachedCoinId);
@Query("SELECT * FROM cached_coin where cached_coin_id IN (:cachedCoinIds)")
public abstract Maybe<List<CachedCoin>> getByIds(long[] cachedCoinIds);
@Query("SELECT * FROM cached_coin where code = :code")
public abstract Maybe<CachedCoin> getByCode(String code);
@Query("SELECT * FROM cached_coin where code IN (:codes)")
public abstract Maybe<List<CachedCoin>> getByCodes(String codes);
@Query("SELECT * FROM cached_coin where name = :name")
public abstract Maybe<CachedCoin> getByName(String name);
@Query("SELECT * FROM cached_coin where name IN (:names)")
public abstract Maybe<List<CachedCoin>> getByNames(String names);
@Query("SELECT * FROM cached_coin ORDER BY rank ASC LIMIT :limit")
public abstract Single<List<CachedCoin>> getByRank(int limit);
@SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) //Skip warning, mismatch with calculated column relevance
@Query("SELECT *" +
",(name LIKE :query) +" +
" (website_slug LIKE :query) +" +
" (CASE WHEN code LIKE :query THEN 2 ELSE 0 END)" +
" AS relevance" +
" FROM cached_coin" +
" WHERE name LIKE :query OR code LIKE :query OR website_slug LIKE :query" +
" ORDER BY [relevance] desc")
public abstract Single<List<CachedCoin>> find(String query);
@SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) //Skip warning, mismatch with calculated column relevance
@Query("SELECT *" +
",(name LIKE :query) +" +
" (website_slug LIKE :query) +" +
" (CASE WHEN code LIKE :query THEN 2 ELSE 0 END)" +
" AS relevance" +
" FROM cached_coin" +
" WHERE name LIKE :query OR code LIKE :query OR website_slug LIKE :query" +
" ORDER BY [relevance] desc" +
" LIMIT :limit")
public abstract Single<List<CachedCoin>> find(String query, int limit);
@Insert(onConflict = OnConflictStrategy.REPLACE)
public abstract long[] insert(List<CachedCoin> coins);
@Query("DELETE FROM cached_coin")
public abstract int deleteAll();
@Transaction
public void deleteCachedCoinsAndInsertNewOnes(List<CachedCoin> coins) {
deleteAll();
insert(coins);
}
}
| [
"[email protected]"
] | |
eb422181c2e070149d39ba027917f944048312c2 | 89acccb1d06415ed13abf94c2e78de294e4fa647 | /src/main/java/org/ibp/api2/web/rest/dto/UserDTO.java | aac3a790d9f4f57d443ffee6a40803353b7bd6f9 | [] | no_license | BulkSecurityGeneratorProject/opturn | 3e8041bce114ad727dd0570c9345743d674b2fab | 9463545162ca3baa46c99b5a5aa405faa1ce04c5 | refs/heads/master | 2022-12-23T15:05:40.347966 | 2015-09-18T05:42:56 | 2015-09-18T05:42:56 | 296,590,918 | 0 | 0 | null | 2020-09-18T10:36:40 | 2020-09-18T10:36:40 | null | UTF-8 | Java | false | false | 2,078 | java | package org.ibp.api2.web.rest.dto;
import org.hibernate.validator.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.List;
public class UserDTO {
public static final int PASSWORD_MIN_LENGTH = 5;
public static final int PASSWORD_MAX_LENGTH = 100;
@Pattern(regexp = "^[a-z0-9]*$")
@NotNull
@Size(min = 1, max = 50)
private String login;
@NotNull
@Size(min = PASSWORD_MIN_LENGTH, max = PASSWORD_MAX_LENGTH)
private String password;
@Size(max = 50)
private String firstName;
@Size(max = 50)
private String lastName;
@Email
@Size(min = 5, max = 100)
private String email;
@Size(min = 2, max = 5)
private String langKey;
private List<String> roles;
public UserDTO() {
}
public UserDTO(String login, String password, String firstName, String lastName, String email, String langKey,
List<String> roles) {
this.login = login;
this.password = password;
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.langKey = langKey;
this.roles = roles;
}
public String getPassword() {
return password;
}
public String getLogin() {
return login;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public String getEmail() {
return email;
}
public String getLangKey() {
return langKey;
}
public List<String> getRoles() {
return roles;
}
@Override
public String toString() {
return "UserDTO{" +
"login='" + login + '\'' +
", password='" + password + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", email='" + email + '\'' +
", langKey='" + langKey + '\'' +
", roles=" + roles +
'}';
}
}
| [
"[email protected]"
] | |
4c336672ace5fb5488997275eb5b48f81058b3b1 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/35/35_7f0863e3a13e435aad9b0eba2d6a314c2adb9f44/IO/35_7f0863e3a13e435aad9b0eba2d6a314c2adb9f44_IO_t.java | 26ffc7dbee366157cfeae5fe5dd72377e495afe3 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,230 | java | package tdt4186.exercise3.code;
public class IO {
private Queue ioQueue;
private Statistics statistics;
private long ioWait;
private Gui gui;
private Process activeProcess = null;
public IO(Queue ioQueue, Statistics statistics, EventQueue eventQueue, long ioWait, Gui gui) {
this.ioQueue = ioQueue;
this.statistics = statistics;
this.gui = gui;
this.ioWait = ioWait;
}
public boolean addProcess(Process p) {
ioQueue.insert(p);
if (activeProcess == null) {
start();
return true;
} else {
return false;
}
}
public Process start() {
if (ioQueue.isEmpty()) {
return null;
}
Process p = (Process) ioQueue.removeNext();
activeProcess = p;
gui.setIoActive(p);
return p;
}
public Process getProcess() {
Process p = activeProcess;
activeProcess = null;
gui.setIoActive(activeProcess);
return p;
}
public long getIoTime() {
return (long) (Math.random() * (ioWait * 2) + ioWait / 2);
}
public void updateTime(long timePassed) {
long l = this.ioQueue.getQueueLength();
statistics.ioQueueLengthTime += l*timePassed;
if(l > statistics.longestIoQueueLength)
statistics.longestIoQueueLength = l;
}
}
| [
"[email protected]"
] | |
3c6b24f265539e79b7a1dedc8a42347e367518bc | 80e32257a04999dbe7fd74cebf9c86df6284c670 | /stage-1/stage-1-lesson-4/src/main/java/com/zhang/deep/in/java/fucntional/FunctionDemo.java | f72118affde7ac43ef7b5faf0a048d5317f3dbe5 | [] | no_license | zhang1990zxc/deep-in-java | 19cede7833b38257b8f5587a8368ee31764c5447 | 0661fcdc48d9f6d702a08797bbd7279cdeab1826 | refs/heads/master | 2023-05-01T05:40:30.117242 | 2020-09-21T10:33:22 | 2020-09-21T10:33:22 | 253,047,624 | 0 | 0 | null | 2023-04-17T19:34:58 | 2020-04-04T16:36:51 | Java | UTF-8 | Java | false | false | 619 | java | package com.zhang.deep.in.java.fucntional;
import java.util.function.Function;
/**
* @ClassName FunctionDemo
* @Description 整条街最靓的仔,写点注释吧
* @Author 天涯
* @Date 2020/4/7 23:30
* @Version 1.0
**/
public class FunctionDemo {
public static void main(String[] args) {
Function<String, Long> stringToLong = Long::valueOf;
System.out.println(stringToLong.apply("1"));
Function<Long, String> longToString = String::valueOf;
System.out.println(longToString.apply(1L));
Long value = stringToLong.compose(String::valueOf).apply(1L);
}
}
| [
"[email protected]"
] | |
a4754d69bfe3b500ec9e4fcb870389bb02de4c46 | c47526d11280ae2872d21ce7a5a36ec1312f7ae5 | /src/main/java/com/artmark/avs5rs/sale/model/Seat.java | 9852cd6f85642198014c804d1615d2464300790e | [] | no_license | ushmodin/avs5rs | ec19a403e9b42dd14e02bf4990782c15b09df173 | 04a7ab39c9155fa44bbd196a13dee8c9ac811635 | refs/heads/master | 2021-01-12T22:15:25.723303 | 2018-08-10T05:00:15 | 2018-08-10T05:00:15 | 68,369,438 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,676 | java |
package com.artmark.avs5rs.sale.model;
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 Seat complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="Seat">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="id" type="{}IDType"/>
* <element name="num" type="{http://www.w3.org/2001/XMLSchema}int"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Seat", propOrder = {
"id",
"num"
})
public class Seat {
@XmlElement(required = true)
protected String id;
protected int num;
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
/**
* Gets the value of the num property.
*
*/
public int getNum() {
return num;
}
/**
* Sets the value of the num property.
*
*/
public void setNum(int value) {
this.num = value;
}
}
| [
"[email protected]"
] | |
518f2786c9376c0cd66c1f38fad5b3b53b4d06c2 | e2912ce67a6946cec4606d4468ca80852dfc178a | /hello-designpattern/src/main/java/com/kilogate/hello/designpattern/proxy/dynamicproxy/jdk/test/ServiceImpl.java | 0f6bf88efd7ba28b3b5b2d460ebe2c072347c7c2 | [] | no_license | kilogate/hellojava | 0377868adf21aa65f1d54e9aa4be9482ef569096 | 57a478cc7bc00ec0003c7d5353d5ab6aa7c29cf2 | refs/heads/master | 2022-07-03T23:38:59.323929 | 2017-11-20T08:47:48 | 2017-11-20T08:47:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 437 | java | package com.kilogate.hello.designpattern.proxy.dynamicproxy.jdk.test;
/**
* 接口具体实现
*
* @author fengquanwei
* @create 2017/4/20 10:53
**/
public class ServiceImpl implements Service1, Service2 {
@Override
public void method1() {
System.out.println("ServiceImpl implements Service1");
}
@Override
public void method2() {
System.out.println("ServiceImpl implements Service2");
}
}
| [
"[email protected]"
] | |
40412014dbe400982682f471562e854f705cba15 | 6ef835c5a60148629bb7520cd006d586151fd646 | /talleres/taller04/Taller4.java | 791ce5ba7f9a528471a3712dc0309586fefb2b36 | [] | no_license | fedevelez0/ST0245-002 | ddd2130043079358bf61473b25c51b329d9fc14d | d89fd152bd2dc928d658bb325a8b76a696f902bd | refs/heads/master | 2023-05-02T02:45:12.019229 | 2021-05-25T20:39:00 | 2021-05-25T20:39:00 | 333,227,806 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 738 | java | public class Taller5 {
public static int arrayMax(int[] array, int n) {
int i, max, temp;
max = array[ ____ ];
if(n ____ 0){
temp = arrayMax(array, _____ );
if(temp ____ max)
max = temp;
}
return max;
}
public static boolean groupSum(int start, int[] nums, int target)
{
if(target == 0)
return true;
if(start == nums.length)
return false;
if(groupSum(start + 1, nums, target - nums[start]))
return true;
return groupSum(start + 1, nums, target);
}
public static long fibonacci(int n) {
if (n <= 1)
return _____ ;
else
return __________ + fibonacci(n-2);
}
} | [
"[email protected]"
] | |
d75135af0bd90036b6d5316250d6eedb293c7c20 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project95/src/main/java/org/gradle/test/performance95_5/Production95_486.java | f40137d57c278ca24f20cf42be6fae7a68014483 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 305 | java | package org.gradle.test.performance95_5;
public class Production95_486 extends org.gradle.test.performance17_5.Production17_486 {
private final String property;
public Production95_486() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
| [
"[email protected]"
] | |
60f288c892794d8eafe5cac8d2e71849bcac399c | dbeb2bc2c0a29a038b9f1675774f9ee0a0047e10 | /src/main/java/soreco/training/designpatterns/creational/builder/HairType.java | 5ad9ff982bb56b68a7a3621c45fc784b8bce402f | [] | no_license | sgr-src/designpatterns | 368bde939518e21f77deba312dc457f2db0b1775 | 2e96975899f2d9bf088d78a8b5e4a3bd78edeae1 | refs/heads/master | 2020-05-18T15:21:44.322574 | 2014-10-23T13:13:34 | 2014-10-23T13:13:34 | 24,752,789 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package soreco.training.designpatterns.creational.builder;
public enum HairType {
BALD, SHORT, CURLY, LONG_STRAIGHT, LONG_CURLY;
@Override
public String toString() {
String s = "";
switch (this) {
case BALD:
s = "bold";
break;
case SHORT:
s = "short";
break;
case CURLY:
s = "curly";
break;
case LONG_STRAIGHT:
s = "long straight";
break;
case LONG_CURLY:
s = "long curly";
break;
}
return s;
}
}
| [
"[email protected]"
] | |
61a63c103db227db0ab72843e27e0b1b744e7f7c | d753126ed72abdcd961138a7eb07f6bdb06f57eb | /src/main/java/modern/annotations/CORS.java | b17e3b7a9f6c460b2437382f57fc6536cdd109df | [] | no_license | Abkholy/Modern | 00ce2de94b62a9e368bcca927d3e2c663c191eca | fbd41c633c6dfab5eae30b42b560fecdb8fe1b20 | refs/heads/master | 2020-05-24T04:59:09.242748 | 2019-05-16T21:38:15 | 2019-05-16T21:38:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 347 | java | package modern.annotations;
import javax.ws.rs.NameBinding;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@NameBinding
public @interface CORS {
}
| [
"[email protected]"
] | |
d8dddaf736af8552f683d3ab220fbf6dfe0f8b5e | 0910327122a149aa546cb721fe51d84e5d9f4150 | /yxx-streaming/src/main/java/com/yxx/framework/config/MySparkContextConfig.java | 9ca4b75120261813e3cf045115b8514c9f071d56 | [] | no_license | HoldMe/yxx-project | 538be14870941ba4f0a8442b9f3040ef7899b558 | 6145fd4e4c3a4bff4787ba51c8e58e863dbd1698 | refs/heads/master | 2022-12-22T16:11:39.694497 | 2021-02-19T00:58:36 | 2021-02-19T00:58:36 | 218,025,927 | 0 | 1 | null | 2022-12-15T23:55:50 | 2019-10-28T10:55:47 | Java | UTF-8 | Java | false | false | 803 | java | package com.yxx.framework.config;
import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* <p>
* desc
* </p>
*
* @author wangpan
* @date 2019/11/4
*/
@Configuration
public class MySparkContextConfig {
@Bean
@ConditionalOnMissingBean(SparkConf.class)
public SparkConf sparkConf(){
return new SparkConf().setAppName("spark_test").setMaster("local");
}
@Bean
@ConditionalOnMissingBean(JavaSparkContext.class)
public JavaSparkContext javaSparkContext() throws Exception {
return new JavaSparkContext(sparkConf());
}
}
| [
"[email protected]"
] | |
c565fd2c9513cc2301672e7c0511744dcf8259a2 | 76d1211346b45c1d84c11d6e45f2998e6d6dbd10 | /user-src.tld/studiranje/ip/taglib/descript/FlipFlopTag.java | d9c70b4ffc3a4ea3784d4dc9bf482e95851bb850 | [] | no_license | mirko-27-93/007YIKorisnici | b8428342f52bd87346324f0dd81182fbef4b7211 | 8642abb2948da2f5d090f6d1cc9edcdbd4d0d7f5 | refs/heads/master | 2022-12-08T04:38:13.692457 | 2020-08-28T15:01:14 | 2020-08-28T15:01:14 | 291,072,006 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,778 | java | package studiranje.ip.taglib.descript;
import java.io.ByteArrayInputStream;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTagSupport;
import nu.xom.Builder;
import nu.xom.Document;
import nu.xom.Element;
import nu.xom.Elements;
import studiranje.ip.taglib.descript.tagcode.enviroment.FlipFlopDescribeEnviroment;
/**
* Таг који се користи за лакше постављање садржаја описа за неки елемент.
* @author Masinacc
* @version 1.0
*/
public class FlipFlopTag extends BodyTagSupport{
private static final long serialVersionUID = 6844367664908175825L;
private String elementId = "";
private String descId = "";
public String getElementId() {
return elementId;
}
public void setElementId(String elementId) {
if(elementId==null) elementId="";
this.elementId = elementId;
}
public String getDescId() {
return descId;
}
public void setDescId(String descId) {
if(descId==null) descId="";
this.descId = descId;
}
public boolean testElementId() {
if(elementId.trim().length()==0) return false;
for(char c: elementId.toCharArray()){
if(Character.isAlphabetic(c)) continue;
if(Character.isDigit(c)) continue;
if(c=='_') continue;
return false;
}
return true;
}
public boolean testDescId() {
if(descId.trim().length()==0) return false;
for(char c: descId.toCharArray()){
if(Character.isAlphabetic(c)) continue;
if(Character.isDigit(c)) continue;
if(c=='_') continue;
return false;
}
return true;
}
@Override
public int doStartTag() throws JspException{
if(pageContext.getAttribute("yi.tag.root.node")!=null) {
throw new JspException("DESC:Describe Tag - duplicate.");
}
pageContext.setAttribute("yi.tag.root.node", this);
pageContext.setAttribute("yi.tag.element.node", null);
pageContext.setAttribute("yi.tag.info.node", null);
return EVAL_BODY_AGAIN;
}
@Override
public int doEndTag() throws JspException {
if(!testDescId() || !testElementId())
throw new RuntimeException("DESC:DESCRIBE - ID names bad syntax. Valid is alphanumerics and downline.");
JspWriter out=pageContext.getOut();
String xmlHtmlContent = "<desc:describe xmlns:desc=\"http://www.yatospace.org/describe\">";
xmlHtmlContent+=bodyContent.getString();
xmlHtmlContent+="</desc:describe>";
try {
FlipFlopDescribeEnviroment schemarValidator = new FlipFlopDescribeEnviroment(xmlHtmlContent);
schemarValidator.exceptioningValidate();
Builder builder = new Builder();
Document document = builder.build(new ByteArrayInputStream(xmlHtmlContent.getBytes("UTF-8")));
Element root = document.getRootElement();
Elements nodes = root.getChildElements();
Element element = null;
Element info = null;
for(int i=0; i<nodes.size(); i++) {
Element node = nodes.get(i);
if(node.getQualifiedName().contentEquals("desc:element"))
element = node;
if(node.getQualifiedName().contentEquals("desc:info"))
info = node;
}
if(info==null) {
System.out.println(element.toXML());
out.print(element.toXML());
}else {
out.println("<div id='"+elementId+"' style='display:block' onclick='descript_flipflop_show(\""+elementId+"\", \""+descId+"\")'>"+element.toXML()+"</div>");
out.println("<div id='"+descId+"' style='display:none'><blockquote><p>"+info.toXML()+"</p></blockquote></div>");
}
}catch(Exception ex) {
throw new JspException(ex);
}finally {
pageContext.setAttribute("yi.tag.root.node", null);
pageContext.setAttribute("yi.tag.element.node", null);
pageContext.setAttribute("yi.tag.info.node", null);
}
return SKIP_BODY;
}
}
| [
"[email protected]"
] | |
cf280d750891e22c068804a8671b8c81953f58bf | 0541dffd53ce59391b0e5988af6e98dd5a6e5919 | /g_a_0/src/main/java/com/wsdc/g_a_0/plugin/IProxy.java | 5a480632e11b5b1c68774963ea95480baa17bc21 | [] | no_license | wsdchigh/t0 | ec7785b50cb1f3761bf3d5fe9a750437facf4f51 | b159865426c73898566af227d63c92cea1f51542 | refs/heads/master | 2020-04-30T10:52:36.494798 | 2019-03-19T18:13:13 | 2019-03-19T18:13:13 | 176,569,099 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 468 | java | package com.wsdc.g_a_0.plugin;
/*
*
* <li> 里面注册了字符串类型的key
* <li> 如果需要处理,必须要有可以
* <li> 如果没有key,会将任务抛给上层的IProxy 进行处理
*/
public interface IProxy<T>{
boolean containKey(Integer key);
IPlugin<T,Integer> plugin();
// 具体的处理函数 因为参数的不确定,所以使用可变参数
boolean proxy(Integer key,Object... args);
}
| [
"[email protected]"
] | |
5d7b6b0dab4f063247f9a97a654ee9568d22280c | 281fc20ae4900efb21e46e8de4e7c1e476f0d132 | /samples/seamEAR/primary-source/src/main/java/org/richfaces/demo/SeamUtil.java | ed1a115e979f678f58cc169e415a5d69a2d7f4f8 | [] | no_license | nuxeo/richfaces-3.3 | c23b31e69668810219cf3376281f669fa4bf256f | 485749c5f49ac6169d9187cc448110d477acab3b | refs/heads/master | 2023-08-25T13:27:08.790730 | 2015-01-05T10:42:11 | 2015-01-05T10:42:11 | 10,627,040 | 3 | 5 | null | null | null | null | UTF-8 | Java | false | false | 56 | java | package org.richfaces.demo;
public class SeamUtil {
}
| [
"[email protected]"
] | |
33735d13db2bc927c0546e581dea466ac809a60e | 32cd70512c7a661aeefee440586339211fbc9efd | /aws-java-sdk-waf/src/main/java/com/amazonaws/services/waf/model/CreateByteMatchSetRequest.java | c0260048eff00dbc564fce711a6983e5a0cf4cc4 | [
"Apache-2.0"
] | permissive | twigkit/aws-sdk-java | 7409d949ce0b0fbd061e787a5b39a93db7247d3d | 0b8dd8cf5e52ad7ae57acd2ce7a584fd83a998be | refs/heads/master | 2020-04-03T16:40:16.625651 | 2018-05-04T12:05:14 | 2018-05-04T12:05:14 | 60,255,938 | 0 | 1 | Apache-2.0 | 2018-05-04T12:48:26 | 2016-06-02T10:40:53 | Java | UTF-8 | Java | false | false | 5,791 | java | /*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights
* Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.waf.model;
import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
*/
public class CreateByteMatchSetRequest extends AmazonWebServiceRequest
implements Serializable, Cloneable {
/**
* <p>
* A friendly name or description of the <a>ByteMatchSet</a>. You can't
* change <code>Name</code> after you create a <code>ByteMatchSet</code>.
* </p>
*/
private String name;
/**
* <p>
* The value returned by the most recent call to <a>GetChangeToken</a>.
* </p>
*/
private String changeToken;
/**
* <p>
* A friendly name or description of the <a>ByteMatchSet</a>. You can't
* change <code>Name</code> after you create a <code>ByteMatchSet</code>.
* </p>
*
* @param name
* A friendly name or description of the <a>ByteMatchSet</a>. You
* can't change <code>Name</code> after you create a
* <code>ByteMatchSet</code>.
*/
public void setName(String name) {
this.name = name;
}
/**
* <p>
* A friendly name or description of the <a>ByteMatchSet</a>. You can't
* change <code>Name</code> after you create a <code>ByteMatchSet</code>.
* </p>
*
* @return A friendly name or description of the <a>ByteMatchSet</a>. You
* can't change <code>Name</code> after you create a
* <code>ByteMatchSet</code>.
*/
public String getName() {
return this.name;
}
/**
* <p>
* A friendly name or description of the <a>ByteMatchSet</a>. You can't
* change <code>Name</code> after you create a <code>ByteMatchSet</code>.
* </p>
*
* @param name
* A friendly name or description of the <a>ByteMatchSet</a>. You
* can't change <code>Name</code> after you create a
* <code>ByteMatchSet</code>.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public CreateByteMatchSetRequest withName(String name) {
setName(name);
return this;
}
/**
* <p>
* The value returned by the most recent call to <a>GetChangeToken</a>.
* </p>
*
* @param changeToken
* The value returned by the most recent call to
* <a>GetChangeToken</a>.
*/
public void setChangeToken(String changeToken) {
this.changeToken = changeToken;
}
/**
* <p>
* The value returned by the most recent call to <a>GetChangeToken</a>.
* </p>
*
* @return The value returned by the most recent call to
* <a>GetChangeToken</a>.
*/
public String getChangeToken() {
return this.changeToken;
}
/**
* <p>
* The value returned by the most recent call to <a>GetChangeToken</a>.
* </p>
*
* @param changeToken
* The value returned by the most recent call to
* <a>GetChangeToken</a>.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public CreateByteMatchSetRequest withChangeToken(String changeToken) {
setChangeToken(changeToken);
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null)
sb.append("Name: " + getName() + ",");
if (getChangeToken() != null)
sb.append("ChangeToken: " + getChangeToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateByteMatchSetRequest == false)
return false;
CreateByteMatchSetRequest other = (CreateByteMatchSetRequest) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null
&& other.getName().equals(this.getName()) == false)
return false;
if (other.getChangeToken() == null ^ this.getChangeToken() == null)
return false;
if (other.getChangeToken() != null
&& other.getChangeToken().equals(this.getChangeToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode
+ ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime
* hashCode
+ ((getChangeToken() == null) ? 0 : getChangeToken().hashCode());
return hashCode;
}
@Override
public CreateByteMatchSetRequest clone() {
return (CreateByteMatchSetRequest) super.clone();
}
} | [
"[email protected]"
] | |
5cba80fc451e3bc3d9c544d9fc5e5715e7631e44 | 8819720c373fdf89bd28c7f35ff4e08a37959d33 | /src/main/java/com/emergon/config/MyInterceptor.java | 2a72489bd37f589c8dfc32d592981ec59a1f83ee | [] | no_license | emergon/SpringMVCJavaBased | 1592a2317fe7ebd4124a9c0120c12db367936a77 | ab11d55b8382abadb858c9021b709ceb614d61a7 | refs/heads/master | 2022-12-28T03:43:59.411067 | 2019-12-11T13:01:30 | 2019-12-11T13:01:30 | 226,889,250 | 1 | 1 | null | 2022-12-16T14:51:13 | 2019-12-09T14:20:34 | Java | UTF-8 | Java | false | false | 885 | java | package com.emergon.config;
import com.emergon.entities.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
public class MyInterceptor extends HandlerInterceptorAdapter{
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
User user = (User)request.getSession().getAttribute("user");
boolean requestToLogin = request.getRequestURI().contains("login")||
request.getRequestURI().contains("logout");
if(!requestToLogin && (user == null||user.getUsername()==null)){
response.sendRedirect(request.getContextPath()+"/login");
}
}
}
| [
"[email protected]"
] | |
3d96a4478eec27eb6183bfa4b87e81e4edd9163b | b112d4811b3af348ce8eafdb38b00d7bd2cb6fa7 | /backend/session/session-api/src/main/java/com/meemaw/session/sessions/resource/v1/SessionResourceImpl.java | 5e90a43dd13e3d5c2d127e89be52a863e941f50a | [] | no_license | renovate-tests/Insight | 5814389c85015e7bda829e94988ddba5da807021 | 4436f31998dbb1b41722326d588ccbe7feed07a1 | refs/heads/master | 2023-01-27T19:46:55.888021 | 2020-11-25T07:54:38 | 2020-11-25T07:54:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,634 | java | package com.meemaw.session.sessions.resource.v1;
import com.meemaw.auth.sso.session.model.AuthPrincipal;
import com.meemaw.session.sessions.datasource.SessionTable;
import com.meemaw.session.sessions.service.SessionService;
import com.meemaw.shared.context.RequestUtils;
import com.meemaw.shared.rest.query.SearchDTO;
import com.meemaw.shared.rest.response.Boom;
import com.meemaw.shared.rest.response.DataResponse;
import java.util.UUID;
import java.util.concurrent.CompletionStage;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class SessionResourceImpl implements SessionResource {
@Context HttpServletRequest request;
@Context UriInfo uriInfo;
@Inject AuthPrincipal principal;
@Inject SessionService sessionService;
@Override
public CompletionStage<Response> retrieve(UUID sessionId) {
String organizationId = principal.user().getOrganizationId();
return sessionService
.getSession(sessionId, organizationId)
.thenApply(
maybePage -> DataResponse.ok(maybePage.orElseThrow(() -> Boom.notFound().exception())));
}
@Override
public CompletionStage<Response> list() {
String organizationId = principal.user().getOrganizationId();
SearchDTO searchDTO =
SearchDTO.withAllowedFields(SessionTable.QUERYABLE_FIELDS)
.rhsColon(RequestUtils.map(uriInfo.getQueryParameters()));
return sessionService.getSessions(organizationId, searchDTO).thenApply(DataResponse::ok);
}
}
| [
"[email protected]"
] | |
ba27bafaa0623586f3bc05569c7bcde380141efd | 18afe6d7aeba352762f6a5d413e0c417390d8d1b | /roboto-examples/roboto-examples-springboot/src/main/java/roboto/examples/springboot/controller/BarController.java | ac61f25ff023d6497fb2030484ef9b5de967751e | [
"Apache-2.0"
] | permissive | gregwhitaker/roboto | 97dbe854dc330337a8ea07701fee62c4c21e5e27 | 81e05074fd29ca0f5d3bedbbce23c55051779d6c | refs/heads/master | 2020-03-18T05:34:33.403138 | 2018-05-27T05:26:31 | 2018-05-27T05:26:31 | 134,349,691 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,467 | java | /*
* Copyright 2018 Greg Whitaker
*
* 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 roboto.examples.springboot.controller;
import com.github.gregwhitaker.roboto.spring.annotation.DisallowRobots;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
/**
* Example controller with all methods excluded from robots.txt file.
*/
@Controller
@DisallowRobots
public class BarController {
// SEO is disabled for this endpoint due to the class-level @DenySEO annotation
@GetMapping("/bar/1")
public String bar1(Model model) {
model.addAttribute("message", "This is Bar1");
return "bar";
}
// SEO is disabled for this endpoint due to the class-level @DenySEO annotation
@GetMapping("/bar/2")
public String bar2(Model model) {
model.addAttribute("message", "This is Bar2");
return "bar";
}
}
| [
"[email protected]"
] | |
3c4e43465aee4cf249dfe640576cb681e5477ca6 | aad9f1801fac79001caabde50a949b7f6812bd0f | /Semana 3 - FabricaAbstrataTemaInterface/src/fabrica/abstrata/botoes/FabricaPadrao.java | fd5aa65ee0eb538a8530add25d286882870d2c97 | [] | no_license | lukasg18/exercicios_POO2 | 0899f1dd9113fd27714ea7700dd634e4e706363d | 13b8178571207265adbb848b9a58924e50fcc27c | refs/heads/master | 2020-03-25T15:41:24.019557 | 2018-08-20T21:03:21 | 2018-08-20T21:03:21 | 143,896,407 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package fabrica.abstrata.botoes;
import javax.swing.JButton;
/**
*
* @author harã heique
*/
public class FabricaPadrao extends FabricaAbstrataBotoes
{
@Override
public JButton criaBotaoOK()
{
return new JButton();
}
@Override
public JButton criaBotaoCancel()
{
return new JButton();
}
}
| [
"[email protected]"
] | |
a7d0642d123845541f2585765b2f59fc41443ea2 | 15e19e16bf109bc771abdebc256eb9416af477b5 | /app/src/main/java/com/example/doit/UserFragment.java | ae8db954cad25caad56cc6c3548e4e15aedd6120 | [] | no_license | mjini-dev/Do-it_Android | 698717e42d72bdd4e7f74903278da47ccaf0b852 | bccc1e8b814d3933bb1de99b2ba8d7dbeb9deb83 | refs/heads/master | 2023-03-08T11:15:45.159790 | 2021-02-26T15:11:46 | 2021-02-26T15:11:46 | 342,642,092 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,471 | java | package com.example.doit;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.toolbox.Volley;
import org.json.JSONObject;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link UserFragment.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link UserFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class UserFragment extends Fragment {
public static Intent serviceIntent;
String ID;
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private OnFragmentInteractionListener mListener;
public UserFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment UserFragment.
*/
// TODO: Rename and change types and number of parameters
public static UserFragment newInstance(String param1, String param2) {
UserFragment fragment = new UserFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_user, container, false);
ID = MainActivity.ID;
serviceIntent = Svc_MyService.serviceIntent;
//관심사 변경 (관심사데이터가 있을경우와 없을경우를 생각)
final TextView interest = rootView.findViewById(R.id.interest);
interest.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Response.Listener<String> responseListener = new Response.Listener<String>() {
@Override
public void onResponse(String response) {
//해당 웹사이트에 접속한 이후, 특정 JSON 응답을 다시 받을 수 있도록작성
try {
JSONObject jsonResponse = new JSONObject(response); //JSONObject를 만들어서 response값을 넣어줌
boolean success = jsonResponse.getBoolean("success"); //해당과정이 정상적으로 진행 되었는지(응답 값 확인)
if(success) { //ID가 없다면(관심사 데이터가 없다->test 진행)
Intent intentR = new Intent(getActivity(), Test_1.class);
intentR.putExtra("userID",ID);
getActivity().startActivity(intentR);
} else { //ID가 있다(관심사 데이터가 있다->관심사 변경)
Intent intentR = new Intent(getActivity(), User_choice_like.class);
intentR.putExtra("userID",ID);
getActivity().startActivity(intentR);
}
} catch (Exception e) {
e.printStackTrace();
}
}
};
//실제로 접속 할 수 있도록 ValidateRequest 생성자를 통해 객체를 만들어 준다.
VolleyR_CheckDBRequest volleyRCheckDBRequest = new VolleyR_CheckDBRequest(ID, responseListener);
//요청을 보낼 수 있도록 큐를 만든다
RequestQueue queue = Volley.newRequestQueue(getActivity());
//만들어진 큐에, ValidateRequest 객체를 넣어준다.
queue.add(volleyRCheckDBRequest);
//onDestroy();
}
});
//비밀번호변경 change_PW
final TextView change_PW = rootView.findViewById(R.id.change_PW);
change_PW.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intentC = new Intent(getActivity(), User_changePassword.class);
intentC.putExtra("userID",ID);
getActivity().startActivity(intentC);
}
});
//로그아웃기능
final TextView logout = rootView.findViewById(R.id.log_out);
logout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
serviceIntent = new Intent(getActivity(), Svc_MyService.class);
getActivity().stopService(serviceIntent);
if (serviceIntent!=null) {
//stopService(serviceIntent);
serviceIntent = null;
}
ID = null;
// ((MainActivity)getActivity()).stopService() //로그아웃하면 서비스 중지.
//((MainActivity)getActivity()).stopService(serviceIntent); //로그아웃하면 서비스 중지.
Intent intent = new Intent(getActivity(), LoginActivity.class);
startActivity(intent);
getActivity().finish();
//onDestroy();
}
});
//return inflater.inflate(R.layout.fragment_user, container, false);
return rootView;
}
// TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnFragmentInteractionListener {
// TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
}
}
| [
"[email protected]"
] | |
f2f970331a97b9cc61daac32b82645cc558d9394 | b43cd9fca4ef6034704e7f63834302b367bfb241 | /LinkedLists/src/Main.java | df063498ec5f78052d1eaa7a57e9e28cadfe0647 | [] | no_license | suhas99/LearnJava | 5b656d4eb8a2e43aa704dec263453b1f4f1837de | 801dc00a917f80f5bbff6c76ee6503fc30f8cb40 | refs/heads/master | 2022-12-27T07:49:40.344766 | 2020-10-01T02:19:01 | 2020-10-01T02:19:01 | 269,268,533 | 7 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,318 | java | import java.util.ArrayList;
import java.util.LinkedList;
import java.util.ListIterator;
public class Main {
private static ArrayList<Album> albums=new ArrayList<Album>();
public static void main(String[] args) {
Album album =new Album("Kannada breakup Album","Mixed breakup singers");
album.addSong("kagadada Doniayalli",3.5);
album.addSong("Bisilu kudre",3);
album.addSong("Marate hogide hrta karana",4);
albums.add(album);
album =new Album("Kannada Love Album","Vijay prakash");
album.addSong("Belgageduu",3.37);
album.addSong("Love you jaanu",4.22);
album.addSong("Its time for mohabat",3.40);
albums.add(album);
LinkedList<Song> playlist =new LinkedList<Song>();
albums.get(0).addToPlayList("Bisilu kudre",playlist);
albums.get(1).addToPlayList("Love you jaanu",playlist);
albums.get(0).addToPlayList(1,playlist);
play(playlist);
}
private static void play(LinkedList<Song> playlist ){
ListIterator<Song> node =playlist.listIterator();
if(playlist.size()==0){
System.out.println("no songs in playlist");
return;
}
else{
System.out.println("now playing "+node.next().toString());
}
}
}
| [
"[email protected]"
] | |
65b72042d90bbea693c72cf228d79fd8a64f7917 | 804b645602f4ff11bba61d1f373813ecd7a130c1 | /MouseControl/src/main/java/ch/unifr/pai/twice/multipointer/provider/client/MouseCursorTimeoutEvent.java | 3ce6a40cb8298fbe08a417068ba90d39b8667e89 | [] | no_license | incidincer/twice-temp2 | 8d5d7d3b8c6ec6a3b981ef9a4cfdba2b06330311 | a98f0bcdf105418595e70cc2a7ea613525407fe3 | refs/heads/master | 2016-09-11T08:37:17.646561 | 2015-07-28T01:40:14 | 2015-07-28T01:40:14 | 39,807,287 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,642 | java | package ch.unifr.pai.twice.multipointer.provider.client;
/*
* Copyright 2013 Oliver Schmid
* 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.
*/
import ch.unifr.pai.twice.multipointer.provider.client.MouseCursorTimeoutEvent.Handler;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
/**
* An event notifying about timed out mouse pointers
*
* @author Oliver Schmid
*
*/
public class MouseCursorTimeoutEvent extends GwtEvent<Handler> {
boolean detached;
/**
* @return true if the cursor is detached from a uuid and therefore free to be used by another user or false if only the visibility timed out and the cursor
* is still assigned to the user.
*/
public boolean isDetached() {
return detached;
}
public static interface Handler extends EventHandler {
public void onMouseCursorTimeout(MouseCursorTimeoutEvent event);
}
public static final Type<Handler> TYPE = new Type<Handler>();
@Override
public Type<Handler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(Handler handler) {
handler.onMouseCursorTimeout(this);
}
}
| [
"[email protected]"
] | |
866ad95ca47a4bed3e02c7814b7ec77fcc26951f | fd49852c3426acf214b390c33927b5a30aeb0e0a | /aosp/javalib/android/graphics/drawable/TransitionDrawable.java | 210746913caef205559a507b76fe420571c7bdfb | [] | no_license | HanChangHun/MobilePlus-Prototype | fb72a49d4caa04bce6edb4bc060123c238a6a94e | 3047c44a0a2859bf597870b9bf295cf321358de7 | refs/heads/main | 2023-06-10T19:51:23.186241 | 2021-06-26T08:28:58 | 2021-06-26T08:28:58 | 333,411,414 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,309 | java | package android.graphics.drawable;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.os.SystemClock;
public class TransitionDrawable extends LayerDrawable implements Drawable.Callback {
private static final int TRANSITION_NONE = 2;
private static final int TRANSITION_RUNNING = 1;
private static final int TRANSITION_STARTING = 0;
private int mAlpha = 0;
private boolean mCrossFade;
private int mDuration;
private int mFrom;
private int mOriginalDuration;
private boolean mReverse;
private long mStartTimeMillis;
private int mTo;
private int mTransitionState = 2;
TransitionDrawable() {
this(new TransitionState(null, null, null), (Resources)null);
}
private TransitionDrawable(TransitionState paramTransitionState, Resources paramResources) {
super(paramTransitionState, paramResources);
}
private TransitionDrawable(TransitionState paramTransitionState, Drawable[] paramArrayOfDrawable) {
super(paramArrayOfDrawable, paramTransitionState);
}
public TransitionDrawable(Drawable[] paramArrayOfDrawable) {
this(new TransitionState(null, null, null), paramArrayOfDrawable);
}
LayerDrawable.LayerState createConstantState(LayerDrawable.LayerState paramLayerState, Resources paramResources) {
return new TransitionState((TransitionState)paramLayerState, this, paramResources);
}
public void draw(Canvas paramCanvas) {
boolean bool = true;
int i = this.mTransitionState;
if (i != 0) {
if (i == 1 && this.mStartTimeMillis >= 0L) {
float f = (float)(SystemClock.uptimeMillis() - this.mStartTimeMillis) / this.mDuration;
if (f >= 1.0F) {
bool = true;
} else {
bool = false;
}
f = Math.min(f, 1.0F);
i = this.mFrom;
this.mAlpha = (int)(i + (this.mTo - i) * f);
}
} else {
this.mStartTimeMillis = SystemClock.uptimeMillis();
bool = false;
this.mTransitionState = 1;
}
i = this.mAlpha;
boolean bool1 = this.mCrossFade;
LayerDrawable.ChildDrawable[] arrayOfChildDrawable = this.mLayerState.mChildren;
if (bool) {
if (!bool1 || i == 0)
(arrayOfChildDrawable[0]).mDrawable.draw(paramCanvas);
if (i == 255)
(arrayOfChildDrawable[1]).mDrawable.draw(paramCanvas);
return;
}
Drawable drawable = (arrayOfChildDrawable[0]).mDrawable;
if (bool1)
drawable.setAlpha(255 - i);
drawable.draw(paramCanvas);
if (bool1)
drawable.setAlpha(255);
if (i > 0) {
Drawable drawable1 = (arrayOfChildDrawable[1]).mDrawable;
drawable1.setAlpha(i);
drawable1.draw(paramCanvas);
drawable1.setAlpha(255);
}
if (!bool)
invalidateSelf();
}
public boolean isCrossFadeEnabled() {
return this.mCrossFade;
}
public void resetTransition() {
this.mAlpha = 0;
this.mTransitionState = 2;
invalidateSelf();
}
public void reverseTransition(int paramInt) {
long l1 = SystemClock.uptimeMillis();
long l2 = this.mStartTimeMillis;
long l3 = this.mDuration;
char c = 'ÿ';
if (l1 - l2 > l3) {
if (this.mTo == 0) {
this.mFrom = 0;
this.mTo = 255;
this.mAlpha = 0;
this.mReverse = false;
} else {
this.mFrom = 255;
this.mTo = 0;
this.mAlpha = 255;
this.mReverse = true;
}
this.mOriginalDuration = paramInt;
this.mDuration = paramInt;
this.mTransitionState = 0;
invalidateSelf();
return;
}
int i = this.mReverse ^ true;
this.mReverse = i;
this.mFrom = this.mAlpha;
paramInt = c;
if (i != 0)
paramInt = 0;
this.mTo = paramInt;
if (this.mReverse) {
l1 -= this.mStartTimeMillis;
} else {
l1 = this.mOriginalDuration - l1 - this.mStartTimeMillis;
}
this.mDuration = (int)l1;
this.mTransitionState = 0;
}
public void setCrossFadeEnabled(boolean paramBoolean) {
this.mCrossFade = paramBoolean;
}
public void showSecondLayer() {
this.mAlpha = 255;
this.mReverse = false;
this.mTransitionState = 2;
invalidateSelf();
}
public void startTransition(int paramInt) {
this.mFrom = 0;
this.mTo = 255;
this.mAlpha = 0;
this.mOriginalDuration = paramInt;
this.mDuration = paramInt;
this.mReverse = false;
this.mTransitionState = 0;
invalidateSelf();
}
static class TransitionState extends LayerDrawable.LayerState {
TransitionState(TransitionState param1TransitionState, TransitionDrawable param1TransitionDrawable, Resources param1Resources) {
super(param1TransitionState, param1TransitionDrawable, param1Resources);
}
public int getChangingConfigurations() {
return this.mChangingConfigurations;
}
public Drawable newDrawable() {
return new TransitionDrawable(this, (Resources)null);
}
public Drawable newDrawable(Resources param1Resources) {
return new TransitionDrawable(this, param1Resources);
}
}
}
/* Location: /home/chun/Desktop/temp/!/android/graphics/drawable/TransitionDrawable.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/ | [
"[email protected]"
] | |
9b8c34f48b51ccf6703193d3732acdc116b81c38 | 6dc3bdad488314ed86b04559ac3a7208778d7963 | /app/src/main/java/com/example/dickysuryo/moviecatalogue/Model/DetailPopular_Model.java | 609ed36fb1e8954197ae130f7a0fa136772e0616 | [] | no_license | dickysuryos/dicodingMovie | 3f52b008db75c081d57b6c43ee8e28315c630bd3 | 37fe74501385071df2ae46a73a055e95ece5df4c | refs/heads/master | 2020-07-26T19:29:01.027006 | 2019-10-05T15:22:24 | 2019-10-05T15:22:24 | 208,745,607 | 0 | 2 | null | 2019-10-08T16:31:17 | 2019-09-16T08:12:48 | Java | UTF-8 | Java | false | false | 5,651 | java | package com.example.dickysuryo.moviecatalogue.Model;
import java.util.ArrayList;
import java.util.List;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class DetailPopular_Model implements Parcelable
{
@SerializedName("vote_count")
@Expose
private Integer voteCount;
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("video")
@Expose
private Boolean video;
@SerializedName("vote_average")
@Expose
private Double voteAverage;
@SerializedName("title")
@Expose
private String title;
@SerializedName("popularity")
@Expose
private Double popularity;
@SerializedName("poster_path")
@Expose
private String posterPath;
@SerializedName("original_language")
@Expose
private String originalLanguage;
@SerializedName("original_title")
@Expose
private String originalTitle;
@SerializedName("backdrop_path")
@Expose
private String backdropPath;
@SerializedName("adult")
@Expose
private Boolean adult;
@SerializedName("overview")
@Expose
private String overview;
@SerializedName("release_date")
@Expose
private String releaseDate;
public final static Parcelable.Creator<DetailPopular_Model> CREATOR = new Creator<DetailPopular_Model>() {
@SuppressWarnings({
"unchecked"
})
public DetailPopular_Model createFromParcel(Parcel in) {
return new DetailPopular_Model(in);
}
public DetailPopular_Model[] newArray(int size) {
return (new DetailPopular_Model[size]);
}
}
;
protected DetailPopular_Model(Parcel in) {
this.voteCount = ((Integer) in.readValue((Integer.class.getClassLoader())));
this.id = ((Integer) in.readValue((Integer.class.getClassLoader())));
this.video = ((Boolean) in.readValue((Boolean.class.getClassLoader())));
this.voteAverage = ((Double) in.readValue((Double.class.getClassLoader())));
this.title = ((String) in.readValue((String.class.getClassLoader())));
this.popularity = ((Double) in.readValue((Double.class.getClassLoader())));
this.posterPath = ((String) in.readValue((String.class.getClassLoader())));
this.originalLanguage = ((String) in.readValue((String.class.getClassLoader())));
this.originalTitle = ((String) in.readValue((String.class.getClassLoader())));
this.backdropPath = ((String) in.readValue((String.class.getClassLoader())));
this.adult = ((Boolean) in.readValue((Boolean.class.getClassLoader())));
this.overview = ((String) in.readValue((String.class.getClassLoader())));
this.releaseDate = ((String) in.readValue((String.class.getClassLoader())));
}
public DetailPopular_Model() {
}
public Integer getVoteCount() {
return voteCount;
}
public void setVoteCount(Integer voteCount) {
this.voteCount = voteCount;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Boolean getVideo() {
return video;
}
public void setVideo(Boolean video) {
this.video = video;
}
public Double getVoteAverage() {
return voteAverage;
}
public void setVoteAverage(Double voteAverage) {
this.voteAverage = voteAverage;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Double getPopularity() {
return popularity;
}
public void setPopularity(Double popularity) {
this.popularity = popularity;
}
public String getPosterPath() {
return posterPath;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
public String getOriginalLanguage() {
return originalLanguage;
}
public void setOriginalLanguage(String originalLanguage) {
this.originalLanguage = originalLanguage;
}
public String getOriginalTitle() {
return originalTitle;
}
public void setOriginalTitle(String originalTitle) {
this.originalTitle = originalTitle;
}
public String getBackdropPath() {
return backdropPath;
}
public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}
public Boolean getAdult() {
return adult;
}
public void setAdult(Boolean adult) {
this.adult = adult;
}
public String getOverview() {
return overview;
}
public void setOverview(String overview) {
this.overview = overview;
}
public String getReleaseDate() {
return releaseDate;
}
public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeValue(voteCount);
dest.writeValue(id);
dest.writeValue(video);
dest.writeValue(voteAverage);
dest.writeValue(title);
dest.writeValue(popularity);
dest.writeValue(posterPath);
dest.writeValue(originalLanguage);
dest.writeValue(originalTitle);
dest.writeValue(backdropPath);
dest.writeValue(adult);
dest.writeValue(overview);
dest.writeValue(releaseDate);
}
public int describeContents() {
return 0;
}
} | [
"[email protected]"
] | |
987e65e6e58f2ed60f182c97c0504a921656e334 | d4439f3ea17fefbc63011fb6e1b48f3758329944 | /src/test/java/com/pm/demo/DemoApplicationTests.java | bd3ca1aaf2a8136fbb2dbd118f5177d94d00f643 | [] | no_license | sameershrestha333/PersonalProjectManagement | a211a003399ef6766e26bee9a673090d6b037757 | 6bd22e601c19ed3d0b9857c41c683c1589b7436a | refs/heads/master | 2020-09-11T18:08:44.236234 | 2019-11-16T19:22:44 | 2019-11-16T19:22:44 | 222,113,845 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package com.pm.demo;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class DemoApplicationTests {
@Test
void contextLoads() {
}
}
| [
"[email protected]"
] | |
21e3c143131ad8ac1f9e3b318ba1903eee22d188 | fb251da39ed2702a9fbfc4eb185ca8e0daa784c9 | /src/main/java/com/example/demo/study/thread/resourceshare/newcomponent/countlatch/CountDownLatchDemo.java | 0bc879133b229dd87f97af6cf3b87176ade4d977 | [] | no_license | yinfeng201809/springboot | fec53a3dceaff59be6b2f434b0b69775eab01971 | 0479a3035f1f78f4f79393b42219c53239564839 | refs/heads/master | 2023-06-24T04:29:05.558904 | 2022-07-31T04:13:29 | 2022-07-31T04:13:29 | 162,996,052 | 0 | 0 | null | 2023-06-14T22:33:09 | 2018-12-24T14:00:19 | Java | UTF-8 | Java | false | false | 725 | java | package com.example.demo.study.thread.resourceshare.newcomponent.countlatch;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class CountDownLatchDemo {
static final int size=100;
public static void main(String[] args) {
ExecutorService exec = Executors.newCachedThreadPool();
CountDownLatch latch = new CountDownLatch(size);
for (int i = 0; i < 10; i++) {
exec.execute(new WaitingTask(latch));
}
for (int i = 0; i < size; i++) {
exec.execute(new TaskPortion(latch));
}
System.out.println("启动了所有任务");
exec.shutdown();
}
}
| [
"[email protected]"
] | |
a88e8a59febfd47b54bd7ef63988c95f576b9b65 | afefdb0541c3bdcc5fe8a3e7983406dfa889aad7 | /src/main/java/jbasis/util/JBasisException.java | bd3c7129653fb4e10bf6834ac34fb13d75b140d9 | [
"MIT"
] | permissive | jeffdoolittle/jbasis | 8fde0c066d865d83cc83e387707269b517debb56 | ba5cec4cbe28e35b6af6f69e699491183d757167 | refs/heads/master | 2020-07-14T18:40:23.233539 | 2019-09-19T21:35:51 | 2019-09-20T03:50:45 | 205,376,008 | 0 | 0 | MIT | 2019-09-19T22:45:31 | 2019-08-30T12:16:05 | Java | UTF-8 | Java | false | false | 601 | java | package jbasis.util;
/**
* Exception type for all jbasis exceptions.
* <p>
* Note that this is a RuntimeException. Checked exceptions
* have their place but can lead to bloated exception
* handling that is better addressed with test coverage.
* <p>
* Let the exceptions bubble up and deal with them at the
* edges.
*/
public class JBasisException extends RuntimeException {
private static final long serialVersionUID = 1L;
public JBasisException(String message) {
super(message);
}
public JBasisException(String message, Throwable cause) {
super(message, cause);
}
} | [
"[email protected]"
] | |
07e0b6fc34b7cceb8155d25aa168218252538161 | f77d2d84af7b1d555a96f5ab9f42f1b7c7abd60c | /src/_java/dsa/ComparatorLexicographic.java | 4414f672376ee065941fb6430a13becf09d9d58d | [] | no_license | pangpang20/data-structure | d8e43a2cf167c88a64d9128b165ed438f194d3e5 | 53a2f76919eda2add01f6e60bc40c4c13365d481 | refs/heads/main | 2023-05-01T01:43:06.359569 | 2021-05-26T07:14:23 | 2021-05-26T07:14:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 845 | java | /******************************************************************************************
* Data Structures in C++
* ISBN: 7-302-33064-6 & 7-302-33065-3 & 7-302-29652-2 & 7-302-26883-3
* Junhui DENG, [email protected]
* Computer Science & Technology, Tsinghua University
* Copyright (c) 2003-2020. All rights reserved.
******************************************************************************************/
/*
* 按照字典序确定平面点之间次序的比较器
*/
package dsa;
public class ComparatorLexicographic implements Comparator {
public int compare(Object a, Object b) throws ClassCastException {
int ax = ((Point2D) a).getX();
int ay = ((Point2D) a).getY();
int bx = ((Point2D) b).getX();
int by = ((Point2D) b).getY();
return (ax != bx) ? (ax - bx) : (ay - by);
}
} | [
"[email protected]"
] | |
60b87fec288c372c514ec40ea9ce69dfae58a1e2 | 73f14233f8fc78b352b5b1c3e1c3f33876487fdd | /pandapay/src/com/pandapay/controller/back/BackerInviteCodeRecordController.java | 1ccb460fa45c825f16754b039676c8543c9706f2 | [] | no_license | vemwyzys/xsmcvifu | faf709d9c2c85dd811a689e7955e6aba1fb39f69 | d241530bbfbe10be7b1baef43846c1daaa53e85c | refs/heads/master | 2021-08-28T05:07:54.165198 | 2017-12-11T08:37:37 | 2017-12-11T08:37:37 | 113,831,995 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,784 | java | package com.pandapay.controller.back;
import java.sql.Timestamp;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.iqmkj.utils.StringUtil;
import com.pandapay.entity.DO.BackerRecordInviteCodeDO;
import com.pandapay.interceptor.BackerWebInterceptor;
import com.pandapay.service.IBackerRecordInviteCodeService;
/**
* 发放邀请码记录
* @author zjl
*
*/
@Controller
@Scope(value = "prototype")
@RequestMapping("/backerWeb/backerInviteCodeRecord/")
public class BackerInviteCodeRecordController {
/** 邀请码记录服务*/
@Autowired
private IBackerRecordInviteCodeService backerRecordInviteCodeService;
/** 查询数据*/
public void showList(HttpServletRequest request){
String userAccount = StringUtil.stringNullHandle(request.getParameter("userAccount"));
String remarks = StringUtil.stringNullHandle(request.getParameter("remarks"));
String backerAccount = StringUtil.stringNullHandle(request.getParameter("backerAccount"));
String startTimeStr = StringUtil.stringNullHandle(request.getParameter("startTime"));
String endTimeStr = StringUtil.stringNullHandle(request.getParameter("endTime"));
String pageNumberStr = StringUtil.stringNullHandle(request.getParameter("pageNumber"));
Timestamp startTime = null;
if(StringUtil.isNotNull(startTimeStr)){
startTime = Timestamp.valueOf(startTimeStr);
}
Timestamp endTime = null;
if(StringUtil.isNotNull(endTimeStr)){
endTime = Timestamp.valueOf(endTimeStr);
}
int pageNumber = 0;
if(StringUtil.isNotNull(pageNumberStr)){
pageNumber = Integer.parseInt(pageNumberStr);
}
int pageSize = 20;
int totalNumber = backerRecordInviteCodeService.queryRecordTotalOfBack(userAccount, remarks, backerAccount, startTime, endTime);
//总页码数
int totalPageNumber = (int) (totalNumber/1.0/pageSize);
//若页码总数恰为页码大小的整数倍,则总数减一
if (totalNumber > 0 && Math.ceil(totalNumber/1.0/pageSize) == totalPageNumber) {
totalPageNumber--;
}
if(pageNumber > totalPageNumber){
pageNumber = totalPageNumber;
}
List<BackerRecordInviteCodeDO> list = null;
if(totalNumber > 0){
list = backerRecordInviteCodeService.queryRecordListOfBack(userAccount, remarks, backerAccount, startTime, endTime, pageNumber, pageSize);
}
request.setAttribute("userAccount", userAccount);
request.setAttribute("remarks", remarks);
request.setAttribute("backerAccount", backerAccount);
request.setAttribute("startTime", startTimeStr);
request.setAttribute("endTime", endTimeStr);
request.setAttribute("totalNumber", totalNumber);
request.setAttribute("pageNumber", pageNumber);
request.setAttribute("totalPageNumber", totalPageNumber);
request.setAttribute("list", list);
//添加当前页面,页面权限码
request.getSession().setAttribute("backer_pagePowerId", 181200);
}
/** 显示页面*/
@RequestMapping("show.htm")
public String show(HttpServletRequest request){
boolean result = BackerWebInterceptor.validatePower(request, 181201);
if (!result) {
request.setAttribute("code", 2);
request.setAttribute("message", "您没有该权限!");
request.getSession().setAttribute("backer_pagePowerId", 0);
return "page/back/index";
}
showList(request);
request.setAttribute("code", 1);
request.setAttribute("message", "操作成功!");
return "page/back/backerRecordInviteCode";
}
}
| [
"[email protected]"
] | |
b0fed811e3a993cbb07addb56b67f9270545859a | 08ec6edd01c58978c1052866fac3db105f959c4b | /src/chapter07/gitHubQueen.java | b75cb8618b38ce2e97968cdd35d7cb8e143ae41b | [] | no_license | EvgeniiaVak/introToJava | a2c246dec152a654bca0efd9f0e3c31cadb546d6 | 7491578039ad760ea970a3216743a3f81e31ebdd | refs/heads/master | 2021-01-20T08:46:12.311048 | 2018-10-17T14:49:41 | 2018-10-17T14:49:41 | 101,567,532 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,012 | java | package chapter07;
/*********************************************************************************
* (Game: Eight Queens) The classic Eight Queens puzzle is to place eight queens *
* on a chessboard such that no two queens can attack each other (i.e., no two *
* queens are on the same row, same column, or same diagonal). There are many *
* possible solutions. Write a program that displays one such solution. *
*********************************************************************************/
public class gitHubQueen {
/** Main method */
public static void main(String[] args) {
char[] board; // Create an array
// Repeat while queens are attacking
do {
// Generate a board
board = getNewBoard();
// Place eight queens
placeQueens(board);
} while (isAttacking(board));
// Display solution
print(board);
}
/** placeQueens randomly places eight queens on the board*/
public static void placeQueens(char[] board) {
int location;
for (int i = 0; i < 8; i++) {
do {
location = placeQueens();
} while (isOccupied(board[location]));
board[location] = 'Q';
}
}
/** placeQueens randomly places one queen on the board */
public static int placeQueens() {
return (int)(Math.random() * 64);
}
/** isAttacking returns true if two queens are attacking each other */
public static boolean isAttacking(char[] board) {
return isSameRow(board) || isSameColumn(board) || isSameDiagonal(board);
}
/** isSameRow returns true if two queens are in the same row */
public static boolean isSameRow(char[] board) {
int[] rows = new int[8];
for (int i = 0; i < board.length; i++) {
if (isOccupied(board[i])) {
rows[getRow(i)]++;
}
if (rows[getRow(i)] > 1)
return true;
}
return false;
}
/** isSameColumn returns true if two queens are in the same column */
public static boolean isSameColumn(char[] board) {
int[] columns = new int[8];
for (int i = 0; i < board.length; i++) {
if (isOccupied(board[i])) {
columns[getColumn(i)]++;
}
if (columns[getColumn(i)] > 1)
return true;
}
return false;
}
/** isSameDiagonal returns true if two queens are on the same diagonal */
public static boolean isSameDiagonal(char[] board) {
for (int i = 0; i < board.length; i++) {
if (isOccupied(board[i])) {
for (int j = 0; j < board.length; j++) {
if (isOccupied(board[j]) && Math.abs(getColumn(j) - getColumn(i)) ==
Math.abs(getRow(j) - getRow(i)) && j != i) {
return true;
}
}
}
}
return false;
}
/** isOccupied returns true if the element in x is the char Q */
public static boolean isOccupied(char x) {
return x == 'Q';
}
/** getNewBoard returns a char array filled with blank space */
public static char[] getNewBoard() {
char[] board = new char[64];
for (int i = 0; i < board.length; i++)
board[i] = ' ';
return board;
}
/** print displays the board */
public static void print(char[] board) {
for (int i = 0; i < board.length; i++) {
System.out.print(
"|" + ((getRow(i + 1) == 0) ? board[i] + "|\n" : board[i]));
}
}
/** getRow returns the row number that corresponds to the given index */
public static int getRow(int index) {
return index % 8;
}
/** getColumn returns the column number that corresponds to the given index */
public static int getColumn(int index) {
return index / 8;
}
}
| [
"[email protected]"
] | |
569d48d7e6f7cc9a70fd25a060d1afd386f67c32 | ba98b26212abd001f4152d22409e1e2aae9decf8 | /src/OOP_3/IceCream/MainClass.java | 3d905d358734dae54c9fa423efb6347eb8c1ead7 | [] | no_license | fatihakbuluttr/lessonOOP | b184aadf28908f3af4cce681cc46daf2311163cc | 7a960a61ae0e781d737c2f59040b4fb59d13ed34 | refs/heads/main | 2023-03-24T12:20:38.099393 | 2021-03-23T19:26:37 | 2021-03-23T19:26:37 | 350,238,947 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 976 | java | package OOP_3.IceCream;
import java.util.Arrays;
public class MainClass {
public static void main(String[] args) {
IceCream ice1=new IceCream("Chocolate",13);
IceCream ice2=new IceCream("Vanilla",0);
IceCream ice3=new IceCream("Strawberry",7);
IceCream ice4=new IceCream("Plain",18);
IceCream ice5=new IceCream("ChocolateChip",3);
IceCream[] array1= {ice1,ice2,ice3,ice4,ice5};
IceCream[] array2= {ice2,ice3};
sweetestIceCream(array1);
sweetestIceCream(array2);
}
private static int sweetestIceCream(IceCream[] iceCreamArray){
int[] arraySweetness=new int[iceCreamArray.length];
for (int i = 0; i < iceCreamArray.length; i++) {
arraySweetness[i]=iceCreamArray[i].getValue();
}
Arrays.sort(arraySweetness);
System.out.println(arraySweetness[arraySweetness.length-1]);
return arraySweetness[arraySweetness.length-1];
}
}
| [
"User@DESKTOP-ENT97T7"
] | User@DESKTOP-ENT97T7 |
3c6c414122b9b19baa0caf4cf519279dc20c0bf5 | f93013d9464a50ab9944f270177ad21139e7391c | /Production_ERP/src/main/java/com/nosuchteam/service/WorkService.java | b9f2fb412064a9587adf7bdc3d68bbb0f03c9255 | [] | no_license | San-Qian/Production_ERP | 6100c435bda7d111813def74ded8022391035601 | 38c953f31b4edc808fd4e7942376c8d759382a64 | refs/heads/master | 2020-04-09T17:48:24.003112 | 2018-12-14T13:44:23 | 2018-12-14T13:44:23 | 160,491,822 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 455 | java | package com.nosuchteam.service;
import com.nosuchteam.bean.Work;
import com.nosuchteam.util.commons.PageInfo;
/**
* @Author: Evan
* @Date: 2018/12/5 15:59
* @Description:
*/
public interface WorkService {
void save(Work work) throws Exception;
PageInfo selectByPage(Work work, Integer page, Integer rows);
void update(Work work) throws Exception;
void delete(String[] ids) throws Exception;
Work selectById(String workId);
}
| [
"[email protected]"
] | |
ccecde01245a83d32fe189e2647d9574e36c36fe | 9232d83f1e1a64c50c9bd9a180f4129ec43636cf | /app/src/main/java/com/example/wyattsullivan/fridgeio/UpdateTriplet.java | cefc307b9d908ee0b31b49030a7264ff33cb6b4d | [] | no_license | wsull001/FridgeIo | b629f88c42ddf204a72057f85eafee39ecfa69fd | 9c9e46b80be8126e70c363c22446b8a3da14af7c | refs/heads/master | 2021-05-04T23:53:18.268702 | 2018-03-12T18:06:01 | 2018-03-12T18:06:01 | 119,436,485 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 498 | java | package com.example.wyattsullivan.fridgeio;
/**
* Created by wyattsullivan on 3/11/18.
*/
public class UpdateTriplet {
private final int type;
private final int updID;
private final String prodID;
public UpdateTriplet(int tp, int uID, String pID) {
this.type = tp;
this.updID = uID;
this.prodID = pID;
}
public int getType() { return type; }
public int getUpdateID() { return updID; }
public String getProductID() { return prodID; }
} | [
"[email protected]"
] | |
1185a6649c6c4177c12133c2fbbe223d18d867b6 | 5fa7462dc506c5dee385c2186db9d5ab54436b05 | /src/main/java/com/pendownabook/constraint/FieldMatchValidator.java | de2d6c9a11e6946a5b5aab9ab0686b244c6d785e | [] | no_license | Vishvin95/PenDownABook | a61bdf1a56a904f24d5cfed75874c95001b48648 | 1c4c55b6b5582fb6323e45e50fe473c9a314b061 | refs/heads/master | 2023-01-27T13:09:48.329132 | 2020-12-09T18:55:18 | 2020-12-09T18:55:18 | 261,965,692 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 932 | java | package com.pendownabook.constraint;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.apache.commons.beanutils.BeanUtils;
public class FieldMatchValidator implements ConstraintValidator<FieldMatch, Object> {
private String firstFieldName;
private String secondFieldName;
@Override
public void initialize(final FieldMatch constraintAnnotation) {
firstFieldName = constraintAnnotation.first();
secondFieldName = constraintAnnotation.second();
}
@Override
public boolean isValid(final Object value, final ConstraintValidatorContext context) {
try {
final Object firstObj = BeanUtils.getProperty(value, firstFieldName);
final Object secondObj = BeanUtils.getProperty(value, secondFieldName);
return firstObj == null && secondObj == null || firstObj != null && firstObj.equals(secondObj);
} catch (final Exception ignore) {
}
return true;
}
}
| [
"[email protected]"
] | |
8f43641cedeab56b9e81215167e90eed90c89352 | 9fd8d06e5dd9731d45c49104be21ef6554596a08 | /src/com/Project273/Server/LWM2MServer.java | 020e0395707a58d5153c5029e6976f9bfccd1af3 | [] | no_license | shibunath/273 | ff8e0a9c7b5d2371b0cffd2cb326e1aa00847cf7 | c7785db04a68d38466c792ac97d476df71c010c7 | refs/heads/master | 2021-01-10T03:46:29.212762 | 2016-02-07T07:42:48 | 2016-02-07T07:42:48 | 51,239,814 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,343 | java | package com.Project273.Server;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import com.Project273.Client.Track;
import com.mongodb.BasicDBObject;
import com.mongodb.BasicDBObjectBuilder;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.mongodb.MongoClient;
@Path("/api")
public class LWM2MServer {
@POST
@Path("/registration")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.TEXT_PLAIN )
public String createTrackInJSON() throws Exception {
DBObject doc;
String result="";
MongoClient mongoClient = new MongoClient("localhost", 27017);
try
{
DB db = mongoClient.getDB("adas");
boolean auth = db.authenticate("cmpe273", "1234567a".toCharArray());
if(auth)
{
DBCollection col = db.getCollection("ClientRegistration");
doc = createDBObject();
col.insert(doc);
result = "Registered";
}
else
{
result = "Not Registered";
}
}
catch(Exception e)
{
throw e;
}
mongoClient.close();
return result;
}
private static DBObject createDBObject() {
BasicDBObjectBuilder docBuilder = BasicDBObjectBuilder.start();
docBuilder.append("_id", "client-id1");
docBuilder.append("ClientEndPointName","Client1");
docBuilder.append("Lifetime", 12345);
docBuilder.append("Lwm2mVersion", 1.4);
docBuilder.append("BindingMode", "S");
docBuilder.append("SmsNumber", 512578672);
docBuilder.append("ObjectInstances", "Yes");
return docBuilder.get();
}
@GET
@Path("/select/{id}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public List<Track> selectTrackInJSON(@PathParam("id") String _id) throws Exception {
DBObject dbo = null;
BasicDBObject whereQuery = new BasicDBObject();
whereQuery.put("_id", _id);
Track cr = new Track();
List<Track> lis = new ArrayList<Track>();
MongoClient mongoClient = new MongoClient("167.88.36.125", 27017);
try
{
DB db = mongoClient.getDB("adas");
boolean auth = db.authenticate("cmpe273", "1234567a".toCharArray());
if(auth)
{
DBCollection col = db.getCollection("ClientRegistration");
dbo = col.findOne(whereQuery);
String id = (String) dbo.get("_id");
String clientEndPointName = (String) dbo.get("ClientEndPointName");
int lifetime = (int) dbo.get("Lifetime");
double lwm2m_version = (Double) dbo.get("Lwm2mVersion");
String binding_mode = (String) dbo.get("BindingMode");
int smsNumber = (int) dbo.get("SmsNumber");
String object_instances = (String) dbo.get("ObjectInstances");
cr.setId(id);
cr.setClientEndPointName(clientEndPointName);
cr.setLifetime(lifetime);
cr.setBindingMode(binding_mode);
cr.setLwm2mVersion(lwm2m_version);
cr.setSmsNumber(smsNumber);
cr.setObjInst(object_instances);
lis.add(cr);
}
}
catch(Exception e)
{
throw e;
}
mongoClient.close();
return lis;
}
@POST
@Path("/update/{id}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.TEXT_PLAIN)
public String updateTrackInJSON(@PathParam("id")String _id) throws Exception {
String result = null;
MongoClient mongoClient = new MongoClient("167.88.36.125", 27017);
try
{
DB db = mongoClient.getDB("adas");
boolean auth = db.authenticate("cmpe273", "1234567a".toCharArray());
if(auth)
{
DBCollection col = db.getCollection("Trackistration");
BasicDBObject newDocument = new BasicDBObject();
newDocument.append("$set", new BasicDBObject().append("Lwm2mVersion", 2.2));
BasicDBObject searchQuery = new BasicDBObject().append("_id", _id);
col.update(searchQuery, newDocument);
result = "Updated Successfully";
}
else
{
result = "Update Failed";
}
}
catch(Exception e)
{
throw e;
}
mongoClient.close();
return result;
}
@POST
@Path("/delete/{id}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.TEXT_PLAIN)
public String deleteTrackinJSON(@PathParam("id")String _id) throws Exception {
String result = null;
MongoClient mongoClient = new MongoClient("167.88.36.125", 27017);
try
{
DB db = mongoClient.getDB("adas");
boolean auth = db.authenticate("cmpe273", "1234567a".toCharArray());
if(auth)
{
DBCollection col = db.getCollection("ClientRegistration");
BasicDBObject document = new BasicDBObject();
document.put("_id", _id);
col.remove(document);
result = "Deleted Successfully";
}
else
{
result = "Delete Failed";
}
}
catch(Exception e)
{
throw e;
}
mongoClient.close();
return result;
}
}
| [
"[email protected]"
] | |
387c5bb286e065c8a55d4d24179d87965471c422 | dc3fc648784a42dd8271e352555c7958f094d3ca | /src/test/java/org/zeroturnaround/zip/CharsetTest.java | cfcdbfbd86fa4554d4f9c753747c5e92f63897e6 | [
"Apache-2.0"
] | permissive | zeroturnaround/zt-zip | 6d31a2d4e351ff1de58071f00d0e977c2863f3f7 | 5e6ccbd4179cb16d1088674f0cc33959713acf60 | refs/heads/master | 2023-08-30T21:17:22.450509 | 2023-08-03T11:56:10 | 2023-08-03T11:56:10 | 2,828,642 | 1,260 | 275 | Apache-2.0 | 2023-03-30T17:45:24 | 2011-11-22T15:26:37 | Java | UTF-8 | Java | false | false | 5,696 | java | package org.zeroturnaround.zip;
/**
* Copyright (C) 2012 ZeroTurnaround LLC <[email protected]>
*
* 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.
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import junit.framework.TestCase;
public class CharsetTest extends TestCase {
private static final File file = new File("src/test/resources/umlauts-o\u0308a\u0308s\u030c.zip");
// See StackOverFlow post why I'm not using just unicode
// http://stackoverflow.com/questions/6153345/different-utf8-encoding-in-filenames-os-x/6153713#6153713
private static final List fileContents = new ArrayList() {
{
add("umlauts-öäš/");
add("umlauts-öäš/Ro\u0308mer.txt"); // Römer - but using the escape code that HFS uses
add("umlauts-öäš/Raudja\u0308rv.txt"); // Raudjärv - but escape code from HFS
add("umlauts-öäš/S\u030celajev.txt"); // Šelajev - but escape code from HFS
}
};
public boolean ignoreTestIfJava6() {
return (System.getProperty("java.version").startsWith("1.6"));
}
public void testIterateWithCharset() throws Exception {
if (ignoreTestIfJava6()) {
return;
}
FileInputStream fis = new FileInputStream(file);
ZipUtil.iterate(fis, new ZipEntryCallback() {
public void process(InputStream in, ZipEntry zipEntry) throws IOException {
assertTrue(zipEntry.getName(), fileContents.contains(zipEntry.getName()));
}
}, Charset.forName("UTF8"));
}
public void testIterateWithEntryNamesAndCharset() throws Exception {
if (ignoreTestIfJava6()) {
return;
}
FileInputStream fis = new FileInputStream(file);
String[] entryNames = (String[]) fileContents.toArray(new String[] {});
ZipUtil.iterate(fis, entryNames, new ZipEntryCallback() {
public void process(InputStream in, ZipEntry zipEntry) throws IOException {
assertTrue(zipEntry.getName(), fileContents.contains(zipEntry.getName()));
}
}, Charset.forName("UTF8"));
}
public void testZipFileGetEntriesWithCharset() throws Exception {
if (ignoreTestIfJava6()) {
return;
}
ZipFile zf = ZipFileUtil.getZipFile(file, Charset.forName("UTF8"));
Enumeration entries = zf.entries();
while (entries.hasMoreElements()) {
ZipEntry ze = (ZipEntry) entries.nextElement();
assertTrue(ze.getName(), fileContents.contains(ze.getName()));
}
}
/*
* I'm using a archive created on Windows 10. The files in the archive have
* umlauts in their name. The default encoding in compression is IBM437 (I didn't
* know that but found out from [1]. Unpacking this archive with any other encoding
* will result in wrong filenames (windows-1252) or Zip exception during the
* getEntry() or when opening the file.
*
* [1] http://stackoverflow.com/questions/1510791/how-to-create-zip-files-with-specific-encoding
*/
public void testIterateExtractWithCharset() throws Exception {
if (ignoreTestIfJava6()) {
return;
}
final File src = new File("src/test/resources/windows-compressed.zip");
FileInputStream inputStream = new FileInputStream(src);
ZipUtil.iterate(inputStream, new ZipEntryCallback() {
public void process(InputStream in, ZipEntry zipEntry) throws IOException {
if (zipEntry.getName().indexOf("raud") != -1) {
assertEquals("windows-default-encoded/raudjärv.txt", zipEntry.getName());
}
else {
assertEquals("windows-default-encoded/römer.txt", zipEntry.getName());
}
}
}, Charset.forName("IBM437"));
inputStream.close();
}
/*
* If a charset is not specified for the unpack then the test will just fail.
*/
public void testExtractWithCharset() throws Exception {
if (ignoreTestIfJava6()) {
return;
}
final File src = new File("src/test/resources/windows-compressed.zip");
File tmpDir = Files.createTempDirectory("zt-zip-tests").toFile();
ZipUtil.unpack(src, tmpDir, Charset.forName("IBM437"));
}
public void testExtractEntryWithCharset() throws Exception {
if (ignoreTestIfJava6()) {
return;
}
final File src = new File("src/test/resources/windows-compressed.zip");
byte[] bytes = ZipUtil.unpackEntry(src, "windows-default-encoded/römer.txt", Charset.forName("IBM437"));
assertTrue(bytes.length > 0);
}
/*
* If a charset is not specified for the unpack then the test will just fail.
*/
public void testExtractWithCharsetUsingStream() throws Exception {
if (ignoreTestIfJava6()) {
return;
}
final File src = new File("src/test/resources/windows-compressed.zip");
FileInputStream inputStream = new FileInputStream(src);
File tmpDir = Files.createTempDirectory("zt-zip-tests").toFile();
ZipUtil.unpack(inputStream, tmpDir, Charset.forName("IBM437"));
inputStream.close();
}
}
| [
"[email protected]"
] | |
6eb7423838b56967e576923e0cde2b7404161a52 | a5d27cf82b8830b91fdfe216bda48697ecb9c01f | /src/main/java/org/kordamp/jsr377/formatter/ShortFormatter.java | 3dfb352283b6e484160ae67964305ceddc09fe38 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | jsr377/jsr377-converters | 20c1912d062ca2ac628b65a708d78c6771e587dd | 36d9881ec4502fda994fe577917053e66a1e705a | refs/heads/master | 2021-11-25T08:48:51.816639 | 2021-11-06T23:15:20 | 2021-11-06T23:15:20 | 109,632,426 | 0 | 3 | Apache-2.0 | 2018-09-28T16:00:31 | 2017-11-06T01:25:46 | Java | UTF-8 | Java | false | false | 1,229 | java | /*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kordamp.jsr377.formatter;
/**
* @author Andres Almiray
*/
public class ShortFormatter extends AbstractNumberFormatter<Short> {
public ShortFormatter() {
this(null);
}
public ShortFormatter(String pattern) {
super(pattern);
}
@Override
public Short parse(String str) throws ParseException {
if (isBlank(str)) { return null; }
try {
return numberFormat.parse(str).shortValue();
} catch (java.text.ParseException e) {
throw new ParseException(e);
}
}
}
| [
"[email protected]"
] | |
1aa162b0ae74834166750ea62432bd2b1b16404a | 7c80a13408420b14a6feab806ca81b6685b41228 | /colab/colab-test/colab/client/ColabClientTester.java | 7b10acc1f7c2c42dd6fcf5bb336a3ee28aceef27 | [] | no_license | chris-martin/gatech-cs-3300-software-engineering | 41537c68b2b2d795ab294a2efc04f1ba9e8e0d22 | f95d150ce131426687e3ee9b69690045d7bb9bdc | refs/heads/master | 2021-01-22T14:32:31.691027 | 2014-01-06T06:37:24 | 2014-01-06T06:38:45 | 15,667,013 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,244 | java | package colab.client;
import junit.framework.TestCase;
import colab.common.exception.UnableToConnectException;
import colab.server.ColabServer;
import colab.server.MockColabServer;
/**
* Test cases for {@link ColabClient}.
*/
public final class ColabClientTester extends TestCase {
/** The port on which the server runs. */
private static final int PORT = 12863;
/** A server used for testing connectivity. */
private ColabServer server;
/**
* Creates a server and binds it to the RMI registry.
*
* @throws Exception if any exception is thrown
*/
@Override
public void setUp() throws Exception {
this.server = new MockColabServer();
this.server.publish(PORT);
}
/**
* Unbinds the server from the RMI registry.
*
* @throws Exception if any exception is thrown
*/
@Override
public void tearDown() throws Exception {
this.server.unpublish();
}
/**
* Tests attempting to connect to an incorrect address.
*
* @throws Exception if any unexpected exception is thrown
*/
public void testConnectFailure() throws Exception {
ColabClient client = new ColabClient();
UnableToConnectException expectedException = null;
try {
client.connect("bad server");
} catch (UnableToConnectException e) {
expectedException = e;
}
assertNotNull(expectedException);
}
/**
* Creates a new client and connects to the server.
*
* @throws Exception if any exception is thrown
*/
public void testConnectSuccess() throws Exception {
ColabClient client = new ColabClient();
client.connect("localhost:" + PORT);
}
/*
ConnectionRemote connection = server.connect(client);
connection.logIn(new UserName("Chris"), "pass4".toCharArray());
Logger.log("User logged in.");
CommunityName communityName = new CommunityName("Team Awesome");
connection.logIn(communityName, "awesomePass".toCharArray());
Logger.log("Logged into community.");
*/
}
| [
"[email protected]"
] | |
3c735e4583a518f211821aec77dc9503d9508598 | c212b9e333f8a488393b3e432a6a5425c18ab68c | /kylodw_pay/src/androidTest/java/com/kylodw/kylodw/pay/ExampleInstrumentedTest.java | a5fbb849717af87a33479a9a46c09805160df3c5 | [] | no_license | kylodw/JavaBasicKnowledge | fc1aaa56a014e07ad5ecde5d0a527ccc597797d6 | 296ece03f45bc42e163c8fcd616a7ecfc39467b2 | refs/heads/master | 2020-05-17T08:16:30.910324 | 2019-05-13T00:39:50 | 2019-05-13T00:39:50 | 183,600,984 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 731 | java | package com.kylodw.kylodw.pay;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.kylodw.kylodw.pay.test", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
49306b9671b77320229a53fa0b1566114cb3e857 | 82841e03823b3f7a5c1e0a83a26bf7b48d237204 | /app/src/main/java/com/blog/ken/myblog/MainActivity.java | 26ad1b6b1fda8e0c2dbc879e3ab30844d0a2b0c3 | [] | no_license | huangyuekai/MyBlog | 8b91d9a6bba9264321e3a1dfd422535cfb2f5ec1 | 012aee398961dfd9c62a6ea2702ef2de35b3e198 | refs/heads/master | 2020-06-12T09:02:04.314946 | 2016-12-09T06:48:18 | 2016-12-09T06:48:18 | 75,595,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,777 | java | package com.blog.ken.myblog;
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.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
291f2e270ba4bbf8643336e7dc228770668c0f0b | 73b00b58acdffd869d061116a86de9fcec009c50 | /app/controllers/IngredientController.java | 742ca9196a4e91bea9e1a0d39f2212e92f8c99c8 | [
"CC0-1.0"
] | permissive | NachoHAF/Receta-Api-Playframework-MIMO | 3437c68833c243e528a02906d73fe7e660ee4ac2 | 8541dfa00cb5dbacc68b782ddf0fc376bb16f56a | refs/heads/main | 2023-03-24T19:11:53.685923 | 2021-03-01T20:35:31 | 2021-03-01T20:35:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,684 | java | package controllers;
import com.fasterxml.jackson.databind.node.ObjectNode;
import models.Ingredient;
import models.Recipe;
import play.data.Form;
import play.data.FormFactory;
import play.i18n.Messages;
import play.i18n.MessagesApi;
import play.mvc.Controller;
import play.mvc.Http;
import play.mvc.Result;
import play.mvc.Results;
import play.twirl.api.Content;
import javax.inject.Inject;
import java.util.List;
/**
* This controller contains an action to handle HTTP requests
* to the application's home page.
*/
public class IngredientController extends Controller {
@Inject
private FormFactory formFactory;
private final play.i18n.MessagesApi messagesApi;
@Inject
public IngredientController(MessagesApi messagesApi) {
this.messagesApi = messagesApi;
}
public boolean check_duplicate( Ingredient ingredient )
{
for ( int i = 0; i < Ingredient.allIngredients().size(); i++ )
{
if ( Ingredient.allIngredients().get( i ).getName_ingredient().equals( ingredient.getName_ingredient() ) )
{
return(true);
}
}
return(false);
}
public Result createIngredient(Http.Request request) {
{
Messages messages = this.messagesApi.preferred(request);
Form<Ingredient> ingredientForm = formFactory.form( Ingredient.class ).bindFromRequest( request );
if ( ingredientForm.hasErrors() )
{
return(Results.badRequest( ingredientForm.errorsAsJson() ) );
}else{
Ingredient ingredient = ingredientForm.get();
if ( check_duplicate( ingredient ) )
{
return(Results.badRequest( messages.at("Repeat_ingredient") ) );
}
ingredient.save();
return(Results.ok( messages.at("Saved_ingredient") ) );
}
}
}
public Result showIngredients(Http.Request request)
{
Messages messages = this.messagesApi.preferred(request);
List<Ingredient> ingredientList = Ingredient.allIngredients();
if ( Ingredient.allIngredients().isEmpty() )
{
return(Results.badRequest( messages.at("No_ingredient_list")) );
} else {
if ( request.accepts( "application/json" ) )
{
ObjectNode result = play.libs.Json.newObject();
int counter = 0;
for ( Ingredient c : ingredientList )
{
result.put( Integer.toString( ++counter ), c.getName_ingredient() );
}
return(Results.ok( result ) );
} else if ( request.accepts( "application/xml" ) )
{
Content content = views.xml.ingredients.render( ingredientList );
return(Results.ok( content ) );
}
}
return(Results.status( 406 ) );
}
public Result showIngredient(Long ingredient_id, Http.Request request) {
Messages messages = this.messagesApi.preferred(request);
Ingredient ingredient = Ingredient.findById( ingredient_id );
if ( ingredient == null )
{
return(Results.badRequest( messages.at("No_ingredient") ) );
}else {
if ( request.accepts( "application/json" ) )
{
ObjectNode result = play.libs.Json.newObject();
result.put( "Ingredient_name", ingredient.getName_ingredient() );
return(Results.ok( result ) );
}else if ( request.accepts( "application/xml" ) )
{
Content content = views.xml.ingredient.render( ingredient );
return(Results.ok( content ) );
}
}
return(Results.status( 406 ) );
}
public Result updateIngredient(Long ingredient_id, Http.Request request) {
Messages messages = this.messagesApi.preferred(request);
Form<Ingredient> ingredientForm = formFactory.form( Ingredient.class ).bindFromRequest( request );
if ( ingredientForm.hasErrors() )
{
return(Results.badRequest( ingredientForm.errorsAsJson() ) );
} else {
Ingredient ingredientform = ingredientForm.get();
Ingredient ingredient = Ingredient.findById( ingredient_id );
if ( ingredient == null )
{
return(Results.badRequest( messages.at("No_found_update") ) );
} else {
if ( check_duplicate( ingredientform ) )
{
return(Results.badRequest( messages.at("Already_exist_ingredient") ) );
}
ingredient.setName_ingredient( ingredientform.getName_ingredient() );
ingredient.update();
return(Results.ok( messages.at("Success_update") ) );
}
}
}
public Result deleteIngredient(Long ingredient_id, Http.Request request) {
Messages messages = this.messagesApi.preferred(request);
Ingredient ingredient = Ingredient.findById( ingredient_id );
if ( ingredient == null )
{
return(Results.badRequest( messages.at("No_found_delete") ) );
} else {
ingredient.delete();
return(Results.ok( messages.at("Deleted")) );
}
}
public Result showRecipesForIngredient(Long ingredient_id, Http.Request request)
{
Messages messages = this.messagesApi.preferred(request);
Ingredient ingredient = Ingredient.findById(ingredient_id);
if (ingredient == null) {
return (Results.badRequest(messages.at("No_exist_this_ingredient")));
} else {
List<Recipe> recipesList = ingredient.get_all_recipes();
if (recipesList.isEmpty()) {
return Results.badRequest(messages.at("No_exist_recipes_ingredient"));
}
if (request.accepts("application/json")) {
ObjectNode result = play.libs.Json.newObject();
int counter = 0;
for (Recipe c : recipesList) {
result.put(Integer.toString(++counter), c.getRecipe_name());
}
return (Results.ok(result));
} else if (request.accepts("application/xml")) {
Content content = views.xml.recipes.render(recipesList);
return (Results.ok(content));
}
return(Results.status( 406 ) );
}
}
}
| [
"[email protected]"
] | |
cf135120f7479bd8557645f05e10fa6c9d0b3932 | 319b83e461e71d360a7873e54d08fe431c480b1c | /app/src/main/java/com/nextep/pelmel/providers/impl/UserInfoProvider.java | 1665d74ee0c70b05fadcf46918860ca4a9535c08 | [] | no_license | christophefondacci/pelmel-android | f9c990add3e452f198458d5037d9b841104fe41d | 4df6507b42bc8b9ba34d6448aa7bae9e6505e6d0 | refs/heads/master | 2022-11-04T05:29:40.495780 | 2015-10-29T18:03:52 | 2015-10-29T18:03:52 | 39,413,341 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,779 | java | package com.nextep.pelmel.providers.impl;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.widget.LinearLayout;
import com.nextep.pelmel.PelMelApplication;
import com.nextep.pelmel.R;
import com.nextep.pelmel.activities.Refreshable;
import com.nextep.pelmel.helpers.Strings;
import com.nextep.pelmel.model.Action;
import com.nextep.pelmel.model.CalObject;
import com.nextep.pelmel.model.Event;
import com.nextep.pelmel.model.Image;
import com.nextep.pelmel.model.NetworkStatus;
import com.nextep.pelmel.model.User;
import com.nextep.pelmel.providers.CountersProvider;
import com.nextep.pelmel.providers.CountersProviderExtended;
import com.nextep.pelmel.providers.SnippetInfoProvider;
import com.nextep.pelmel.services.ActionManager;
import com.nextep.pelmel.services.ConversionService;
import java.util.Collections;
import java.util.List;
/**
* Created by cfondacci on 28/07/15.
*/
public class UserInfoProvider implements SnippetInfoProvider, CountersProviderExtended {
private User user;
public UserInfoProvider(User user) {
this.user = user;
}
@Override
public CalObject getItem() {
return user;
}
@Override
public String getTitle() {
return user.getName();
}
@Override
public String getSubtitle() {
return Strings.getText(user.isOnline() ? R.string.online : R.string.offline);
}
@Override
public Bitmap getSubtitleIcon() {
int res = user.isOnline() ? R.drawable.online : R.drawable.offline;
return BitmapFactory.decodeResource(PelMelApplication.getInstance().getResources(), res);
}
@Override
public Image getSnippetImage() {
return user.getThumb();
}
@Override
public int getLikesCount() {
return user.getLikeCount();
}
@Override
public int getReviewsCount() {
return 0;
}
@Override
public int getCheckinsCount() {
return 0;
}
@Override
public String getDescription() {
return user.getDescription();
}
@Override
public String getItemTypeLabel() {
return null;
}
@Override
public String getCity() {
return user.getCityName();
}
@Override
public String getHoursBadgeSubtitle() {
return null;
}
@Override
public String getHoursBadgeTitle() {
return null;
}
@Override
public int getHoursColor() {
return 0;
}
@Override
public String getDistanceIntroText() {
return null;
}
@Override
public String getDistanceText() {
final ConversionService conversionService = PelMelApplication.getConversionService();
return conversionService.getDistanceStringForMiles(user.getRawDistanceMiles());
}
@Override
public List<String> getAddressComponents() {
return Collections.emptyList();
}
@Override
public List<Event> getEvents() {
return null;
}
@Override
public boolean hasCustomSnippetView() {
return false;
}
@Override
public void createCustomSnippetView(Context context, LinearLayout parent) {
}
@Override
public void refreshCustomSnippetView(Context context, LinearLayout parent) {
}
@Override
public CountersProvider getCountersProvider() {
return this;
}
@Override
public int getThumbListsRowCount() {
int rowCount = 0;
if(!user.getLikedPlaces().isEmpty()) {
rowCount++;
}
if(!user.getLikedUsers().isEmpty()) {
rowCount++;
}
return rowCount;
}
@Override
public List<CalObject> getThumbListObjects(int row) {
if(row==0 && !user.getLikedPlaces().isEmpty()) {
return (List)user.getLikedPlaces();
} else {
return (List)user.getLikedUsers();
}
}
@Override
public String getThumbListSectionTitle(int row) {
if(row==0 && !user.getLikedPlaces().isEmpty()) {
return Strings.getCountedText(R.string.thumbs_section_liked_places_singular,R.string.thumbs_section_liked_places,user.getLikedPlaces().size()).toString();
} else {
return Strings.getCountedText(R.string.thumbs_section_liked_users_singular, R.string.thumbs_section_liked_users, user.getLikedUsers().size()).toString();
}
}
@Override
public Bitmap getThumbListSectionIcon(int row) {
Resources resources = PelMelApplication.getInstance().getResources();
if(row==0 && !user.getLikedPlaces().isEmpty()) {
return BitmapFactory.decodeResource(resources,R.drawable.ovv_icon_check_white);
} else {
return BitmapFactory.decodeResource(resources,R.drawable.snp_icon_like_white);
}
}
@Override
public String getCounterLabelAtIndex(int index) {
switch(index) {
case COUNTER_LIKE:
return Strings.getCountedText(R.string.counter_likes_singular,R.string.counter_likes,user.getLikeCount()).toString();
case COUNTER_CHECKIN:
return Strings.getText(R.string.counter_network);
case COUNTER_CHAT:
return Strings.getText(R.string.action_chat);
}
return null;
}
@Override
public String getCounterActionLabelAtIndex(int index) {
int res = 0;
switch(index) {
case COUNTER_LIKE:
if(user.isLiked()) {
res = R.string.action_unlike;
} else {
res = R.string.action_like;
}
break;
case COUNTER_CHECKIN:
final NetworkStatus status = PelMelApplication.getUserService().getNetworkStatusFor(user);
switch(status) {
case PENDING_APPROVAL:
res = R.string.counter_network_accept;
break;
case PENDING_REQUEST:
res = R.string.counter_network_cancel;
break;
case FRIENDS:
res = R.string.counter_network_friends;
break;
case NOT_IN_NETWORK:
res = R.string.counter_network_add;
break;
}
break;
case COUNTER_CHAT:
res = R.string.action_chat;
}
if(res!=0) {
return Strings.getText(res);
}
return null;
}
@Override
public boolean isCounterSelectedAtIndex(int index) {
switch(index) {
case COUNTER_LIKE:
return user.isLiked();
case COUNTER_CHECKIN:
final NetworkStatus status = PelMelApplication.getUserService().getNetworkStatusFor(user);
return status != NetworkStatus.NOT_IN_NETWORK;
default:
return false;
}
}
@Override
public void executeCounterActionAtIndex(final Context context, final Refreshable refreshable, int index) {
ActionManager mgr = PelMelApplication.getActionManager();
final boolean selected = isCounterSelectedAtIndex(index);
switch(index) {
case COUNTER_LIKE:
mgr.executeAction(selected ? Action.UNLIKE : Action.LIKE, user, new ActionManager.ActionCallback() {
@Override
public void actionCompleted(boolean isSucess, Object result) {
if(!selected) {
PelMelApplication.getUiService().showInfoMessage(context, R.string.alert_like_success_title, R.string.alert_like_user_success);
} else {
PelMelApplication.getUiService().showInfoMessage(context, R.string.alert_unlike_success_title, R.string.alert_unlike_user_success);
}
refreshable.updateData();
}
});
break;
case COUNTER_CHECKIN:
final NetworkStatus status = PelMelApplication.getUserService().getNetworkStatusFor(user);
Action action = null;
switch(status) {
case FRIENDS:
case PENDING_REQUEST:
action = Action.NETWORK_CANCEL;
break;
case NOT_IN_NETWORK:
action = Action.NETWORK_REQUEST;
break;
case PENDING_APPROVAL:
action = Action.NETWORK_RESPOND;
break;
}
if(action != null) {
mgr.executeAction(action, user);
}
break;
case COUNTER_CHAT:
mgr.executeAction(Action.CHAT,user);
break;
}
}
@Override
public CalObject getCounterObject() {
return null;
}
@Override
public int getCounterBackgroundResource(int index) {
boolean isSelected = isCounterSelectedAtIndex(index);
if(!isSelected) {
return R.drawable.bg_counter;
} else {
return index == COUNTER_CHECKIN ? R.drawable.bg_counter_network_selected : R.drawable.bg_counter_selected;
}
}
@Override
public Bitmap getCounterImageAtIndex(int index) {
switch(index) {
case COUNTER_LIKE:
return BitmapFactory.decodeResource(PelMelApplication.getInstance().getResources(),R.drawable.snp_icon_like_white);
case COUNTER_CHECKIN:
final NetworkStatus status = PelMelApplication.getUserService().getNetworkStatusFor(user);
int resId = 0;
switch(status) {
case NOT_IN_NETWORK:
resId = R.drawable.btn_snp_network_add;
break;
case FRIENDS:
resId = R.drawable.btn_snp_network_friends;
break;
default:
resId = R.drawable.btn_snp_network_pending;
break;
}
return BitmapFactory.decodeResource(PelMelApplication.getInstance().getResources(),resId);
case COUNTER_CHAT:
return BitmapFactory.decodeResource(PelMelApplication.getInstance().getResources(),R.drawable.snp_icon_chat);
}
return null;
}
@Override
public boolean hasCounter(int index) {
return true;
}
}
| [
"[email protected]"
] | |
09ecfd166a775210a86cd82a61ec6eaa2d634360 | d5ea46cbbec89fedd6b0ba6a6646b7b14424748f | /app/src/androidTest/java/com/joe/bibi/ApplicationTest.java | 52ec6da6da4434be8133e0a5243495f050234e8e | [
"Apache-2.0"
] | permissive | JoeSteven/BiBi | 9b22b35588b84005cced60463ec0f43a5d84e204 | 9ec529e74e8ff9b61b72800b5c4fa3dd491e619f | refs/heads/master | 2021-01-10T16:39:18.849791 | 2016-03-13T14:10:17 | 2016-03-13T14:10:19 | 51,812,308 | 6 | 1 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | package com.joe.bibi;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"[email protected]"
] | |
0e2c06aef9ea187e12fe2162fc9b3fe3456e6a7c | 98d313cf373073d65f14b4870032e16e7d5466f0 | /gradle-open-labs/example/src/main/java/se/molybden/Class13642.java | e1e318650e486cc974f11674216254eb2d3d730a | [] | no_license | Molybden/gradle-in-practice | 30ac1477cc248a90c50949791028bc1cb7104b28 | d7dcdecbb6d13d5b8f0ff4488740b64c3bbed5f3 | refs/heads/master | 2021-06-26T16:45:54.018388 | 2016-03-06T20:19:43 | 2016-03-06T20:19:43 | 24,554,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 110 | java |
public class Class13642{
public void callMe(){
System.out.println("called");
}
}
| [
"[email protected]"
] | |
334b74ab1da24ed363e07a6bc342cb6a4dad2984 | ea215a8ab80cdb71c353d047fc865a35d1e37a02 | /backend/medical/src/main/java/com/hectormercado/medical/MedicalApplication.java | 647b6909073b91c1bc86f39dd0b22770d5ef4470 | [] | no_license | hecale/medical_consult | 56d7d0f6cd0f56c8f1757f2ff0fca0877cfe0e20 | 380d0e06d42a51f1b3cd4dccd67395e0fdc14a90 | refs/heads/main | 2023-06-05T00:30:01.181302 | 2021-06-30T14:44:14 | 2021-06-30T14:44:14 | 381,578,964 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 320 | java | package com.hectormercado.medical;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MedicalApplication {
public static void main(String[] args) {
SpringApplication.run(MedicalApplication.class, args);
}
}
| [
"[email protected]"
] | |
bf420274b4fd4fabd9cf68cbcfda518b8ca7f02b | 46c85c555ba602f90503edc6ba035352ffc08ccb | /solutionprograms/fragile_solve.java | 2ecb1efb0237c0e8773921622020e5f5b1893675 | [] | no_license | csn3rd/HouseplantCTFRevWriteups | f82224f5676601912159d164a12fb18a3b40a90e | 6ab7da842a6854fc63224b1b91a8cd03cf4bd156 | refs/heads/master | 2022-04-21T19:50:24.665542 | 2020-04-26T20:24:31 | 2020-04-26T20:24:31 | 259,124,603 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 345 | java | import java.util.*;
public class fragile_solve {
public static void main(String args[]) {
String a = "ÐdØÓ§åÍaèÒÁ¡";
String b = "h1_th3r3_1ts_m3";
String c = "";
for (int i = 0; i < 15; i++) {
c += (char)((int)a.charAt(i)-(int)b.charAt(i));
}
System.out.println((c));
}
}
| [
"[email protected]"
] | |
400a38ff76bad2e05cd65c2c8bffc51c86ac25f6 | ca03d018498f251da38ea6f91ce52f7579896e85 | /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/TomcatTest/org/apache/jsp/security_jsp.java | 9100cb7652ce7b13325d77f34a91fc9db8c728c4 | [] | no_license | Miyanaqy/Tomcat_JSP | ddbd6da30c93a97b8f2428f206bc45dcb87cbb33 | dbca60b06b157553a237bc512e302591b5919af8 | refs/heads/master | 2020-12-02T07:47:44.116155 | 2017-08-04T06:27:05 | 2017-08-04T06:27:05 | 96,727,258 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,087 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.79
* Generated at: 2017-07-08 09:32:38 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class security_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private volatile javax.el.ExpressionFactory _el_expressionfactory;
private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
if (_el_expressionfactory == null) {
synchronized (this) {
if (_el_expressionfactory == null) {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
}
}
}
return _el_expressionfactory;
}
public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
if (_jsp_instancemanager == null) {
synchronized (this) {
if (_jsp_instancemanager == null) {
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
}
}
return _jsp_instancemanager;
}
public void _jspInit() {
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("<title>Insert title here</title>\r\n");
out.write("</head>\r\n");
out.write("<body>\r\n");
if(request.isUserInRole("admin")){
out.write("\r\n");
out.write("<h2>welcome to China</h2>\r\n");
}
out.write("\r\n");
out.write("</body>\r\n");
out.write("</html>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try {
if (response.isCommitted()) {
out.flush();
} else {
out.clearBuffer();
}
} catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| [
"[email protected]"
] | |
2c5c29b663999a0c9c6aba98cac0890195a3e790 | 6e90a9a893a09a89032be47460d5142a8a105d41 | /src/main/java/com/kpi/lubchenko/lab1/Ball.java | eca53f56304d0959ac0713eb8d54959c4d64d8ee | [] | no_license | LubchenkoGleb/java-concurrent-kpi | d870b8111003b18fe629dd88944251f0140d9caa | 8a4a68d04ae1610ae9ee12e381167ac2215af6c8 | refs/heads/master | 2021-01-23T17:56:44.496671 | 2017-11-19T19:50:49 | 2017-11-19T19:50:49 | 102,783,903 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,044 | java | package com.kpi.lubchenko.lab1;
import lombok.Data;
import java.awt.*;
import java.awt.geom.Ellipse2D;
import java.util.Random;
@Data
class Ball {
private int speed = 50;
private boolean isInPocket;
private Color color;
private BallCanvas canvas;
private int size = 20;
private int x = 0;
private int y = 0;
private int dx = 2;
private int dy = 2;
public Ball(BallCanvas c, Color color) {
this.color = color;
this.canvas = c;
if (Math.random() < 0.5) {
x = new Random().nextInt(this.canvas.getWidth() - this.canvas.pocketRadius) + this.canvas.pocketRadius;
y = 0;
} else {
x = 0;
y = new Random().nextInt(this.canvas.getHeight() - this.canvas.pocketRadius) + this.canvas.pocketRadius;
}
}
public void draw(Graphics2D g2, Integer number) {
Ellipse2D.Double ball = new Ellipse2D.Double(x, y, size, size);
g2.setPaint(color);
g2.fill(ball);
g2.drawString(number.toString(), x, y);
checkBallInThePocket(x, y);
}
public void move() {
x += dx;
y += dy;
if (x < 0) {
x = 0;
dx = -dx;
}
if (x + size >= this.canvas.getWidth()) {
x = this.canvas.getWidth() - size;
dx = -dx;
}
if (y < 0) {
y = 0;
dy = -dy;
}
if (y + size >= this.canvas.getHeight()) {
y = this.canvas.getHeight() - size;
dy = -dy;
}
this.canvas.repaint();
}
private void checkBallInThePocket(int x, int y) {
boolean leftX = x + size < canvas.pocketRadius;
boolean rightX = x > canvas.getWidth() - canvas.pocketRadius;
boolean topY = y + size < canvas.pocketRadius;
boolean downY = y > canvas.getHeight() - canvas.pocketRadius;
if((leftX && topY) || (rightX && topY) || (rightX && downY) || (leftX && downY)) {
isInPocket = true;
}
}
} | [
"[email protected]"
] | |
184c75413a86c12d4d3bd4a8d75ff10abf55309f | 5f5d8a57e508699ddd22b7730d1f52b51098ce9e | /webStudy04_MVC/src/main/java/kr/or/ddit/vo/FreeReplyVO.java | 2c07c60f538430258288d9698a49f8fcb4a5d3f4 | [] | no_license | HYEONSEONG-KIM/JSP_Study | 354f90675cdfb07b623b466817c858cb386f49e0 | 7f8460dc7acfb13524d4c6ead2108017b2c68ab7 | refs/heads/main | 2023-07-07T21:19:07.071264 | 2021-07-30T12:53:14 | 2021-07-30T12:53:14 | 376,468,033 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 403 | java | package kr.or.ddit.vo;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(of="repNo")
public class FreeReplyVO implements Serializable{
private Integer repNo;
private Integer boNo;
private String repContent;
private String repWriter;
private String repMail;
private String repPass;
private String preDate;
private Integer repParent;
}
| [
"[email protected]"
] | |
c9febc1b48f91bcab515c8769c5a799bdd13aee0 | a549f89462ebe404fafd186045b7241b98c86cd0 | /service/service-edu/src/test/java/com/atguigu/guli/service/edu/CodeGenerator.java | d906ff2a922aab1d95364aeb58658b76dc48f1cb | [] | no_license | chen106/guli-edu | bc939da0dcfcbf3c07822169442bed9f04e8ee5c | 24ca25d04807907c3ea1ab7ee7557bdab51fb74d | refs/heads/master | 2022-07-13T17:20:47.593518 | 2019-11-20T12:30:18 | 2019-11-20T12:30:18 | 222,874,542 | 0 | 0 | null | 2022-06-17T02:41:50 | 2019-11-20T07:15:12 | Java | UTF-8 | Java | false | false | 3,981 | java | package com.atguigu.guli.service.edu;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.po.TableFill;
import com.baomidou.mybatisplus.generator.config.rules.DateType;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import org.junit.Test;
import java.util.ArrayList;
/**
* @author chen
* @date 2019/11/20/16:49
*/
public class CodeGenerator {
@Test
public void genCode() {
String prefix = "chen_";
String moduleName = "edu";
// 1、创建代码生成器
AutoGenerator mpg = new AutoGenerator();
// 2、全局配置
GlobalConfig gc = new GlobalConfig();
String projectPath = System.getProperty("user.dir");
gc.setOutputDir(projectPath + "/src/main/java");
gc.setAuthor("Chen");
gc.setOpen(false); //生成后是否打开资源管理器
gc.setFileOverride(false); //重新生成时文件是否覆盖
gc.setServiceName("%sService"); //去掉Service接口的首字母I
gc.setIdType(IdType.ID_WORKER_STR); //主键策略
gc.setDateType(DateType.ONLY_DATE);//定义生成的实体类中日期类型
gc.setSwagger2(true);//开启Swagger2模式
mpg.setGlobalConfig(gc);
// 3、数据源配置
DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl("jdbc:mysql://192.168.67.128:3306/" + prefix + "guli_" + moduleName);
dsc.setDriverName("com.mysql.jdbc.Driver");
dsc.setUsername("root");
dsc.setPassword("root");
dsc.setDbType(DbType.MYSQL);
mpg.setDataSource(dsc);
// 4、包配置
PackageConfig pc = new PackageConfig();
pc.setModuleName(moduleName); //模块名
pc.setParent("com.atguigu.guli.service");
pc.setController("controller");
pc.setEntity("entity");
pc.setService("service");
pc.setMapper("mapper");
mpg.setPackageInfo(pc);
// 5、策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setInclude(moduleName + "_\\w*");//设置要映射的表名
strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略
strategy.setTablePrefix(pc.getModuleName() + "_");//设置表前缀不生成
strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略
strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作
strategy.setLogicDeleteFieldName("is_deleted");//逻辑删除字段名
strategy.setEntityBooleanColumnRemoveIsPrefix(true);//去掉布尔值的is_前缀
//自动填充
TableFill gmtCreate = new TableFill("gmt_create", FieldFill.INSERT);
TableFill gmtModified = new TableFill("gmt_modified", FieldFill.INSERT_UPDATE);
ArrayList<TableFill> tableFills = new ArrayList<>();
tableFills.add(gmtCreate);
tableFills.add(gmtModified);
strategy.setTableFillList(tableFills);
strategy.setRestControllerStyle(true); //restful api风格控制器
strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符
//设置BaseEntity
strategy.setSuperEntityClass("BaseEntity");
// 写于BaseEntity中的公共字段
strategy.setSuperEntityColumns("id", "gmt_create", "gmt_modified");
mpg.setStrategy(strategy);
// 6、执行
mpg.execute();
}
}
| [
"[email protected]"
] | |
d6b2498f15f6179f680a06f3e94930dfd12cc89f | daa2170cf85046fc1f45a034e87b5bb10b6e4022 | /src/main/java/cn/livorth/Pojo/Books.java | debef4e12b382ccb0f12d83680ebbe54f54a2a03 | [] | no_license | Livorth/SSM-Model | bbcbc66a1128f83a447a1bdc4e45e9a2b2ca50b1 | 8d79f12760e260cc83b27a17afb7540fead1c626 | refs/heads/master | 2023-04-01T17:23:57.115416 | 2021-03-26T12:38:53 | 2021-03-26T12:38:53 | 351,630,066 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 291 | java | package cn.livorth.Pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Books {
private int bookID;
private String bookName;
private int bookCounts;
private String detail;
}
| [
"[email protected]"
] | |
f2c9a35abdaeaf7b12d58dc28e402dbf1d8a2a66 | 2a7906626f6f57fba24b5b236d817d9e69c023ae | /exercise20_1/src/main/java/cs544/exercise20_1/IBookDao.java | 6caf40f5c23ea9823bc02a70b5c3fb3958256e1e | [] | no_license | jimkatunguka/Enterprise-Architecture | 60d0c4ccf2f821ab5efc31e718f843d1a58161f5 | 9658455c44e06d018806cafc40189759cb68914e | refs/heads/master | 2022-12-23T12:01:47.760506 | 2020-03-11T19:07:16 | 2020-03-11T19:07:16 | 243,116,570 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 295 | java | package cs544.exercise20_1;
import java.util.List;
public interface IBookDao {
public abstract List<Book> getAll();
public abstract void add(Book book);
public abstract Book get(int id);
public abstract void update(int bookId, Book book);
public abstract void delete(int bookId);
} | [
"[email protected]"
] | |
ce68e8f123e90f8efdfec31ae0ce7ca0c25baf77 | c365281a0d65dfc588001d1c42535d594f85a98a | /batch-server/src/main/java/com/example/model/JobRunModel.java | e6ea6bc67bcee0e9711309c13b88bbbc260b2c25 | [] | no_license | aegis78/spring-boot-batch-sample | 39ef20a2db7a18fce4238cee1b3591a5f2b59ec0 | 906cc5fbde1d313a0acf8aac08d257e4c1d83176 | refs/heads/master | 2021-08-28T02:28:24.978271 | 2017-12-11T03:32:53 | 2017-12-11T03:32:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 180 | java | package com.example.model;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
public class JobRunModel {
private String jobName;
private String jobParameters;
}
| [
"[email protected]"
] | |
62a9eb92c4ec9cd6565600fb3a8995e28e15e895 | fb7797b6f7324cf6c6d3ad5c3b2465cdfadabc09 | /MyProject/app/src/main/java/com/dpkpranay/myproject/Main3Activity.java | 7e7a19611ace82c1c202b42db1cb1ae55343bd74 | [] | no_license | deShodhan/College-management | a5c7484d28b08352b3988af24cdfdaf1601b542d | 19af9fb3eb9e72acbd7bcaa28ceaad2708efdc4d | refs/heads/main | 2023-08-07T20:11:37.897372 | 2021-09-22T03:36:16 | 2021-09-22T03:36:16 | 409,053,819 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 715 | java | package com.dpkpranay.myproject;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import java.util.Timer;
import java.util.TimerTask;
public class Main3Activity extends AppCompatActivity {
Timer timer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main3);
timer=new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
Intent intent=new Intent(Main3Activity.this,startingActivity.class);
startActivity(intent);
}
},5000);
}
}
| [
"[email protected]"
] | |
1ba124ba5253908e93969e56cdf556b777926f13 | 7e156c3a4e52c107143acf0a4c96483b2a5e5719 | /library/common/src/main/java/com/arksh/common/utils/ImageLoaderUtils.java | 5a44ef57e2ec909dfee58d24eb6f6d74956d97de | [] | no_license | wscaco3/summer | 37f8778c688cc6681859e1a467d487c3277c9b34 | 2268da2eb21353ae7b00ab13eab176ce3c19e39a | refs/heads/master | 2021-01-11T07:24:58.234125 | 2016-11-22T06:28:20 | 2016-11-22T06:28:20 | 71,984,542 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,619 | java | package com.arksh.common.utils;
import android.content.Context;
import android.widget.ImageView;
import com.arksh.common.R;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DecodeFormat;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import java.io.File;
/**
* Description : 图片加载工具类 使用glide框架封装
*/
public class ImageLoaderUtils {
public static void display(Context context, ImageView imageView, String url, int placeholder, int error) {
if (imageView == null) {
throw new IllegalArgumentException("argument error");
}
Glide.with(context).load(url).placeholder(placeholder)
.error(error).crossFade().into(imageView);
}
public static void display(Context context, ImageView imageView, String url) {
if (imageView == null) {
throw new IllegalArgumentException("argument error");
}
Glide.with(context).load(url)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.centerCrop()
.placeholder(R.drawable.ic_image_loading)
.error(R.drawable.ic_empty_picture)
.crossFade().into(imageView);
}
public static void display(Context context, ImageView imageView, File url) {
if (imageView == null) {
throw new IllegalArgumentException("argument error");
}
Glide.with(context).load(url)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.centerCrop()
.placeholder(R.drawable.ic_image_loading)
.error(R.drawable.ic_empty_picture)
.crossFade().into(imageView);
}
public static void displaySmallPhoto(Context context, ImageView imageView, String url) {
if (imageView == null) {
throw new IllegalArgumentException("argument error");
}
Glide.with(context).load(url).asBitmap()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.placeholder(R.drawable.ic_image_loading)
.error(R.drawable.ic_empty_picture)
.thumbnail(0.5f)
.into(imageView);
}
public static void displayBigPhoto(Context context, ImageView imageView, String url) {
if (imageView == null) {
throw new IllegalArgumentException("argument error");
}
Glide.with(context).load(url).asBitmap()
.format(DecodeFormat.PREFER_ARGB_8888)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.placeholder(R.drawable.ic_image_loading)
.error(R.drawable.ic_empty_picture)
.into(imageView);
}
public static void display(Context context, ImageView imageView, int url) {
if (imageView == null) {
throw new IllegalArgumentException("argument error");
}
Glide.with(context).load(url)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.centerCrop()
.placeholder(R.drawable.ic_image_loading)
.error(R.drawable.ic_empty_picture)
.crossFade().into(imageView);
}
public static void displayRound(Context context, ImageView imageView, String url) {
if (imageView == null) {
throw new IllegalArgumentException("argument error");
}
Glide.with(context).load(url)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.error(R.drawable.toux2)
.centerCrop().transform(new GlideRoundTransformUtil(context)).into(imageView);
}
}
| [
"[email protected]"
] | |
01b25c66ff33df7fce994317227d9fa9b9e12b6e | 200cf734e286f2ab15385213da9712388da308db | /src/main/java/com/diamond/ElevatorMetrics.java | a9993634e8f588975bf2822134be8fb60c6ec8c4 | [] | no_license | sdiamond/elevator-sample | 6363ad98436302b3e80ff53d38facc108c16f4c0 | 2ce81fc58467fa5986d3599bc9158ebf3c036b6c | refs/heads/master | 2021-06-25T23:48:25.621245 | 2018-09-13T12:40:16 | 2018-09-13T12:40:16 | 147,271,115 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,869 | java | package com.diamond;
public class ElevatorMetrics {
private static long totalWaitTime = 0;
private static int totalRequests = 0;
private static int totalRides = 0; // number of elevator rides ;a ride is one direction;
private static int totalEmptyTraversals = 0; //not sure how to count this
private static int totalStops= 0; // how many time all elevators stop, combine with total rides and number of riders
// to get number of stops in each ride per rider.
public static void addWaitTime (long waitTime){
ElevatorMetrics.totalWaitTime = ElevatorMetrics.totalWaitTime + waitTime;
}
public static void incrementTotalRequests(){
ElevatorMetrics.totalRequests++;
}
public static void incrementTotalRides(){
ElevatorMetrics.totalRides++;
}
public static void incrementEmptyTraversals (){
ElevatorMetrics.totalEmptyTraversals++;
}
public static void incrementTotalStops(){
ElevatorMetrics.totalStops++;
}
public static int getTotalRides (){
return totalRides;
}
public static int getTotalRequests(){
return totalRequests;
}
public static int getTotalStops(){
return totalStops;
}
public static int getEmptyTraversals(){
return totalEmptyTraversals;
}
public static float getAvgNumberRidersPerRide(){
if (totalRides != 0){
return (float)ElevatorMetrics.totalRequests/ElevatorMetrics.totalRides;
} else{
return 0;
}
}
public static float getStopsPerRidePerRider(){
if (totalRides > 0 && totalRequests > 0){
return (ElevatorMetrics.totalStops/(ElevatorMetrics.totalRides*ElevatorMetrics.totalRequests));
}
return 0;
}
public static void printOutMetrics(){
System.out.println("*************** Metrics *****************");
System.out.println("total reqeusts: "+ ElevatorMetrics.totalRequests);
System.out.println("total rides: "+ totalRides);
System.out.println("total stops: "+ totalStops);
if (totalRequests != 0){
System.out.println("Wait Time Per Request: "+ ElevatorMetrics.totalWaitTime/ElevatorMetrics.totalRequests);
} else{
System.out.println("Wait Time not calculated due to zero value total requests");
}
System.out.println("Number of Riders on Each ride (average): "+ getAvgNumberRidersPerRide());
System.out.println("Idle Traversals: "+ ElevatorMetrics.totalEmptyTraversals);
System.out.println("Number of stops in each ride per rider (average): "+ getStopsPerRidePerRider());
}
public static void reset() {
totalWaitTime = 0;
totalRequests = 0;
totalRides = 0;
totalEmptyTraversals = 0;
totalStops = 0;
}
} | [
"[email protected]"
] | |
752842697adf95adaea43fcceb66b59f4dbebd2f | 62190fd11f54fdf9adf014481f367677ec07e4d7 | /src/de/uni_tuebingen/wsi/ct/slang2/dbc/data/Isotope.java | 04042fb7bfa879e88b24c23ef4269c6452f8fbf4 | [] | no_license | rogerbraun/Slang-DBC | 8f5f3321e924671885e212c141180419952128d3 | 8508137bdd73f4218dedeb01cbfb176a3cbd4515 | refs/heads/master | 2020-05-26T18:16:30.000495 | 2010-06-01T09:53:18 | 2010-06-01T09:53:18 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 1,901 | java | /*
* Erstellt: 21.12.2004
*/
package de.uni_tuebingen.wsi.ct.slang2.dbc.data;
import de.uni_tuebingen.wsi.ct.slang2.dbc.share.DBC_Key;
/**
* Repräsentiert die Verbindung von einem Wort zu einer Isotopiekategorie.
*
* @author Volker Klöbb
*/
public class Isotope extends DB_Element {
/**
*
*/
private static final long serialVersionUID = -8098356250731727256L;
private transient Chapter chapter;
private transient Word word;
private String category;
private int wordIndex;
Isotope(int id, Chapter chapter, String category, Word word) {
super(id);
this.chapter = chapter;
this.category = category;
this.word = word;
wordIndex = word.getIndex();
}
/**
* Die Kategorie dieser Isotopie
*/
public String getCategory() {
return category;
}
/**
* Setzt die Kategorie neu
*/
public void setCategory(String category) {
this.category = category;
changeState(CHANGE);
}
/**
* Das Kapitel, in dem diese Isotopie vorkommt.
*/
public Chapter getChapter() {
return chapter;
}
/**
* Das Word, auf das sich diese Kategorie bezieht.
*/
public Word getWord() {
return word;
}
public boolean equals(Object o) {
if (o instanceof Isotope) {
Isotope i = (Isotope) o;
return category.equals(i.category) && word == i.word;
}
return false;
}
public String toString() {
return category + ": " + word.getContent();
}
public int getIndex() {
return 0;
}
/**
* Wird vom DBC benötigt.
*/
public void setChapter(DBC_Key key, Chapter chapter) {
key.unlock();
this.chapter = chapter;
this.word = (Word) chapter.getTokenAtIndex(wordIndex);
}
public boolean remove() {
changeState(REMOVE);
return true;
}
} | [
"hoesler"
] | hoesler |
f1cc5233538b549214a80b459fecd5526d2539be | 37b612f49be0b799c638ae9d7a3bf8d00ce45cc1 | /app/src/main/java/com/astgo/naoxuanfeng/tools/XmlUtil.java | 7ffdcbd80aca8691536b9a2a64fce4b95b11b711 | [] | no_license | 3051619471/NewSimple-fenxiao | 76afd03ae2d3d0f3dd0093cbb644af60eaf42ed3 | 115720f8da158a6f1fc8b0974d97730d1d799f77 | refs/heads/master | 2020-04-07T19:03:40.303021 | 2018-12-19T07:35:16 | 2018-12-19T07:36:09 | 158,634,742 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,306 | java | package com.astgo.naoxuanfeng.tools;
import android.text.TextUtils;
import android.util.Log;
import com.astgo.naoxuanfeng.MyConstant;
import com.astgo.naoxuanfeng.bean.RingPhoneBean;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Leef on 2015/4/19.
* XmlPullParser 解析 XML 工具类
*/
public class XmlUtil {
// private static final String ENCODE = "UTF-8";
// 获取 API 请求返回的 XML 字符串中的 Ret 节点值
public static int getRetXML(String xml) {
try {
return Integer.parseInt(parserFilterXML(xml, MyConstant.RET));
} catch (NumberFormatException e) {
e.printStackTrace();
return -1;
}
}
/**
* @param xmlData 需要解析的 XML 字符串
* @param field 指定要解析的节点
* @return 解析结果
*/
public static String parserFilterXML(String xmlData, String field) {
String result = null;
if(!TextUtils.isEmpty(xmlData)){
try {
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
XmlPullParser xpp = factory.newPullParser();
xpp.setInput(new StringReader(xmlData));
int eventType = xpp.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
String nodeName = xpp.getName();
switch (eventType) {
case XmlPullParser.START_TAG:
if (field.equals(nodeName)) {
result = xpp.nextText();
}
break;
case XmlPullParser.END_TAG:
break;
default:
break;
}
eventType = xpp.next();
}
} catch (XmlPullParserException | IOException e) {
// e.printStackTrace();
}
}
return result;
}
public static List<RingPhoneBean> parserRingPhoneXML(String xmlData){
Log.d("parserRingPhoneXML", xmlData);
List<RingPhoneBean> list = new ArrayList<>();
RingPhoneBean ringPhoneBean = null;
List<String> phones = null;
try {
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
XmlPullParser xpp = factory.newPullParser();
xpp.setInput(getStringStream(xmlData) ,"utf-8");
int eventType = xpp.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
switch (eventType) {
case XmlPullParser.START_TAG:
if("Item".equals(xpp.getName())){
ringPhoneBean = new RingPhoneBean();
}else if("Name".equals(xpp.getName())){
ringPhoneBean.setPhoneName(xpp.nextText());
}else if("PhoneList".equals(xpp.getName())){
phones = new ArrayList<>();
int eventType1 = xpp.getEventType();
while(eventType1 != XmlPullParser.END_TAG || !"PhoneList".equals(xpp.getName())){
if(xpp.getEventType() == XmlPullParser.START_TAG && "Item".equals(xpp.getName())){
phones.add(xpp.nextText());
}
eventType1 = xpp.next();
}
ringPhoneBean.setPhoneListNum(phones);
}
break;
case XmlPullParser.END_TAG:
if("Item".equals(xpp.getName())){
list.add(ringPhoneBean);
ringPhoneBean = null;
}
break;
default:
break;
}
eventType = xpp.next();
}
} catch (XmlPullParserException | IOException e) {
// e.printStackTrace();
}
return list;
}
//将流对象读取到内存中转换成字符串
public static byte[] readInput(InputStream in ) throws IOException{
ByteArrayOutputStream out=new ByteArrayOutputStream();
int len=0;
byte[] buffer=new byte[1024];
while((len=in.read(buffer))>0){
out.write(buffer,0,len);
}
out.close();
in.close();
return out.toByteArray();
}
//以流的方式从内存中读出
public static InputStream getStringStream(String sInputString){
ByteArrayInputStream tInputStringStream=null;
if (sInputString != null && !sInputString.trim().equals("")){
tInputStringStream = new ByteArrayInputStream(sInputString.getBytes());
}
return tInputStringStream;
}
}
| [
"[email protected]"
] | |
7be846fc337de29a50b3ffa63057ca7893441508 | e02042bb32f65850fa5691d087a232324016f1e1 | /src/com/jspProj/designer/web/DesignerInsert.java | 57291fc23b807e1f23b05607fbee881c9bf3d7cc | [] | no_license | choqqd/jspProj | 168ba37bfe76d9f8dd0e3366f07ec765bc195780 | 50cc6693c562dfe956ad5d8fd476d28f49ff7d43 | refs/heads/master | 2023-05-07T18:23:26.477232 | 2021-06-07T07:32:43 | 2021-06-07T07:32:43 | 371,582,724 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,088 | java | package com.jspProj.designer.web;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jspProj.common.DbCommand;
import com.jspProj.designer.service.DesignerService;
import com.jspProj.designer.serviceImpl.DesignerServiceImpl;
import com.jspProj.designer.vo.DesignerVO;
import com.oreilly.servlet.MultipartRequest;
import com.oreilly.servlet.multipart.DefaultFileRenamePolicy;
public class DesignerInsert implements DbCommand {
@Override
public String execute(HttpServletRequest request, HttpServletResponse response) {
response.setCharacterEncoding("UTF-8");
int size = 10 * 1024 * 1024;
String path = "c:/tmp";
ServletContext sc = request.getServletContext();
path = sc.getRealPath("designer");
String fileName="";
MultipartRequest multi = null;
try {
multi = new MultipartRequest(request, path, size, "utf-8", new DefaultFileRenamePolicy());
Enumeration files = multi.getFileNames();
while(files.hasMoreElements()) {
String itemImage = (String) files.nextElement();
fileName = multi.getFilesystemName(itemImage);
}
} catch (IOException e) {
e.printStackTrace();
}
String dsname = multi.getParameter("designerName");
String dsinfo = multi.getParameter("designerinfo");
DesignerVO vo = new DesignerVO();
vo.setDsName(dsname);
vo.setDsInfo(dsinfo);
vo.setDsImage(fileName);
DesignerService service = new DesignerServiceImpl();
int r = service.insertDesigner(vo);
String page="";
if(r>0) {
page = "designerPage.do";
}else {
PrintWriter script;
try {
script = response.getWriter();
script.println("<script>");
script.println("window.alert('등록에 실패했습니다.')");
script.println("history.go(-1)");
script.println("</script>");
} catch (IOException e) {
e.printStackTrace();
}
}
return page;
}
}
| [
"admin@DESKTOP-2NVHVIH"
] | admin@DESKTOP-2NVHVIH |
ff7f853ebe0476e6658436e72fe56deb404706a6 | ef4a5ac5a4497d52d2c2dd831c5fce8fb36ae88b | /src/stringprevie/Prime.java | 037a4c770713b0934af98597f9beedf38ea57355 | [] | no_license | manikandankasinathan/String | 7db4dca9d1b51fd25a767e5c68289139fcf743f7 | e0a90521f9c8be550eb6a3bb42ff472bec29a271 | refs/heads/master | 2020-05-16T11:00:50.790128 | 2019-08-15T12:58:57 | 2019-08-15T12:58:57 | 183,001,999 | 0 | 0 | null | 2019-08-15T12:10:39 | 2019-04-23T11:38:53 | Java | UTF-8 | Java | false | false | 523 | java | package stringprevie;
public class Prime {
//prime number or not
/*public static int input()
{
int inputnumber=15;
for(int i=2;i<=inputnumber/2;i++)
{
if((inputnumber % i) == 0)
{
System.out.print("prime");
}
}
return inputnumber;
}*/
public static void main(String args[])
{
//input();
int inputnumber=4;
for(int i=2;i<=inputnumber/2;i++)
{
if((inputnumber % i) == 0)
{
System.out.print("prime");
}
}
//return inputnumber;
}
}
| [
"Manikandan@Sony-PC"
] | Manikandan@Sony-PC |
a132387d9d518686388ab075ecdb1b16882720d5 | 9f357dfa2227f3514c8478cf40a934bb2af69551 | /week13/CalculatorFerdig.java | 42053a229d52a0270738d33c9ed5e7e5537b1e32 | [] | no_license | erikfsk/in1010 | 814b7b56c9404e3ff1bd7992251cd07161e9a25e | d3123440a2c804c998ca161cda2b64e908a419e5 | refs/heads/master | 2021-05-11T02:45:08.389673 | 2018-04-27T12:11:59 | 2018-04-27T12:11:59 | 118,371,580 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,544 | java | import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.layout.HBox;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.event.EventHandler;
import javafx.event.ActionEvent;
import javafx.geometry.Pos;
public class CalculatorFerdig extends Application {
/*Trenger aa kunne hente ut disse i ButtonHandler*/
HBox textPane;
TextField t1, t2;
HBox buttonPane;
TextField res;
@Override
public void start (Stage stage) {
VBox rootPane = new VBox();
textPane = new HBox();
textPane.setAlignment(Pos.CENTER);
t1 = new TextField("Number 1");
t2 = new TextField("Number 2");
textPane.getChildren().addAll(t1, t2);
buttonPane = new HBox();
buttonPane.setAlignment(Pos.CENTER);
Button plusB = new Button("+");
Button minusB = new Button("-");
Button multB = new Button("X");
Button divB = new Button ("/");
buttonPane.getChildren().addAll(plusB, minusB, multB, divB);
ButtonHandler btnH = new ButtonHandler();
plusB.setOnAction(btnH);
minusB.setOnAction(btnH);
multB.setOnAction(btnH);
divB.setOnAction(btnH);
res = new TextField("Result");
rootPane.getChildren().addAll(textPane, buttonPane, res);
stage.setScene(new Scene(rootPane, 200, 100));
stage.setTitle("My Calculator");
stage.show();
}
public static void main(String[] args) {
launch (args);
}
//(Bedre?) alternativ -> 4 handlers
class ButtonHandler implements EventHandler<ActionEvent>{
@Override
public void handle (ActionEvent e) {
/*Finner ut hvilken knapp som har vært trykket*/
Button tmp = (Button) e.getSource();
Double num1 = 0.0, num2 = 0.0;
try {
num1 = Double.parseDouble(t1.getText());
num2 = Double.parseDouble(t2.getText());
} catch (NumberFormatException nfe) {
System.out.println("Those aren't numbers!");
return;
}
String op = tmp.getText();
double r = 0;
switch (op){
case "+":
r = num1+num2;
break;
case "-":
r = num1-num2;
break;
case "X":
r = num1*num2;
break;
case "/":
r = num1/num2;
break;
}
res.setText(""+r);
}
}
}
| [
"[email protected]"
] | |
68d505cd25b65e71300021e3a3e29f6a841e5e35 | f15889af407de46a94fd05f6226c66182c6085d0 | /smartsis/src/main/java/com/oreon/smartsis/web/action/domain/DepartmentActionBase.java | 03538e4e32d3d774c468a68ddb8c6ebe23e8dea6 | [] | no_license | oreon/sfcode-full | 231149f07c5b0b9b77982d26096fc88116759e5b | bea6dba23b7824de871d2b45d2a51036b88d4720 | refs/heads/master | 2021-01-10T06:03:27.674236 | 2015-04-27T10:23:10 | 2015-04-27T10:23:10 | 55,370,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,166 | java | package com.oreon.smartsis.web.action.domain;
import com.oreon.smartsis.domain.Department;
import org.witchcraft.seam.action.BaseAction;
import java.util.ArrayList;
import java.util.List;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import javax.persistence.EntityManager;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.apache.commons.lang.StringUtils;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.End;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.Component;
import org.jboss.seam.security.Identity;
import org.jboss.seam.annotations.datamodel.DataModel;
import org.jboss.seam.annotations.datamodel.DataModelSelection;
import org.jboss.seam.faces.FacesMessages;
import org.jboss.seam.log.Log;
import org.jboss.seam.annotations.Observer;
import org.witchcraft.base.entity.FileAttachment;
import org.apache.commons.io.FileUtils;
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
import com.oreon.smartsis.domain.Employee;
public abstract class DepartmentActionBase extends BaseAction<Department>
implements
java.io.Serializable {
@In(create = true)
@Out(required = false)
@DataModelSelection
private Department department;
@In(create = true, value = "employeeAction")
com.oreon.smartsis.web.action.domain.EmployeeAction employeesAction;
@DataModel
private List<Department> departmentRecordList;
public void setDepartmentId(Long id) {
if (id == 0) {
clearInstance();
clearLists();
loadAssociations();
return;
}
setId(id);
if (!isPostBack())
loadAssociations();
}
/** for modal dlg we need to load associaitons regardless of postback
* @param id
*/
public void setDepartmentIdForModalDlg(Long id) {
setId(id);
clearLists();
loadAssociations();
}
public Long getDepartmentId() {
return (Long) getId();
}
public Department getEntity() {
return department;
}
//@Override
public void setEntity(Department t) {
this.department = t;
loadAssociations();
}
public Department getDepartment() {
return (Department) getInstance();
}
@Override
protected Department createInstance() {
Department instance = super.createInstance();
return instance;
}
public void load() {
if (isIdDefined()) {
wire();
}
}
public void wire() {
getInstance();
}
public boolean isWired() {
return true;
}
public Department getDefinedInstance() {
return (Department) (isIdDefined() ? getInstance() : null);
}
public void setDepartment(Department t) {
this.department = t;
if (department != null)
setDepartmentId(t.getId());
loadAssociations();
}
@Override
public Class<Department> getEntityClass() {
return Department.class;
}
public com.oreon.smartsis.domain.Department findByUnqName(String name) {
return executeSingleResultNamedQuery("department.findByUnqName", name);
}
/** This function is responsible for loading associations for the given entity e.g. when viewing an order, we load the customer so
* that customer can be shown on the customer tab within viewOrder.xhtml
* @see org.witchcraft.seam.action.BaseAction#loadAssociations()
*/
public void loadAssociations() {
initListEmployees();
}
public void updateAssociations() {
com.oreon.smartsis.domain.Employee employees = (com.oreon.smartsis.domain.Employee) org.jboss.seam.Component
.getInstance("employee");
employees.setDepartment(department);
events.raiseTransactionSuccessEvent("archivedEmployee");
}
protected List<com.oreon.smartsis.domain.Employee> listEmployees = new ArrayList<com.oreon.smartsis.domain.Employee>();
void initListEmployees() {
if (listEmployees.isEmpty())
listEmployees.addAll(getInstance().getEmployees());
}
public List<com.oreon.smartsis.domain.Employee> getListEmployees() {
prePopulateListEmployees();
return listEmployees;
}
public void prePopulateListEmployees() {
}
public void setListEmployees(
List<com.oreon.smartsis.domain.Employee> listEmployees) {
this.listEmployees = listEmployees;
}
public void deleteEmployees(int index) {
listEmployees.remove(index);
}
@Begin(join = true)
public void addEmployees() {
initListEmployees();
Employee employees = new Employee();
employees.setDepartment(getInstance());
getListEmployees().add(employees);
}
public void updateComposedAssociations() {
if (listEmployees != null) {
getInstance().getEmployees().clear();
getInstance().getEmployees().addAll(listEmployees);
}
}
public void clearLists() {
listEmployees.clear();
}
public String viewDepartment() {
load(currentEntityId);
return "viewDepartment";
}
}
| [
"singhj@38423737-2f20-0410-893e-9c0ab9ae497d"
] | singhj@38423737-2f20-0410-893e-9c0ab9ae497d |
12c8eeb09c20178c16c96ebd7f3a97f4d0de5305 | c6a2bd81902df5b42019a183c9633f8e1310ba30 | /src/main/java/com/example/demo/web/model/BeerInventoryDto.java | 3e107e16197aa7b1c97535abb5c31cfe5e07c934 | [] | no_license | Rohan9841/ms-beer-service | 22f3092ec3696ef2aebce4fccf7f3139a6a621f7 | 15e228d2c26703d420ea1c24ed82fa28b623a3db | refs/heads/master | 2022-12-17T21:23:49.182894 | 2020-09-11T20:54:40 | 2020-09-11T20:54:40 | 288,028,145 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 445 | java | package com.example.demo.web.model;
import java.time.OffsetDateTime;
import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class BeerInventoryDto {
private UUID id;
private OffsetDateTime createdDate;
private OffsetDateTime lastModifiedDate;
private UUID beerId;
private Integer quantityOnHand;
}
| [
"[email protected]"
] | |
d8bd9586e74e636a9b465a84744fcb0e202a2db6 | 68022d311463a775dd7d184369f6086c31f91c69 | /Gedistribueerde Systemen/voorbeeld TCP-IP/src/be/kdg/componenten/client/Client.java | 6049121721ce0d293a7315bb422a4dd27216dd7b | [
"Apache-2.0"
] | permissive | XavierGeerinck/KdG_IAO301A | 067e18fc9f803e9796a0ff4517eb6b494ee0282e | 6937c5fa10f6b1cfce31979551b16f7186532483 | refs/heads/master | 2021-05-26T20:53:30.074092 | 2013-12-04T15:29:58 | 2013-12-04T15:29:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,985 | java | /*
* Gedistribueerde systemen
* Karel de Grote-Hogeschool
* 2006-2007
* Kris Demuynck
*/
package be.kdg.componenten.client;
import be.kdg.componenten.communication.NetworkAddress;
import be.kdg.componenten.contacts.Address;
import be.kdg.componenten.contacts.Contacts;
import be.kdg.componenten.contacts.ContactsStub;
/**
* Represents a client component that tests the Contacts component.
*/
public class Client {
private Contacts contacts;
/**
* Creates a new Client component.
*
* @param contactsAddress the address of the Contacts component.
*/
public Client(NetworkAddress contactsAddress) {
contacts = new ContactsStub(contactsAddress);
}
/**
* Adds two contacts (1 invalid and one correct) to the Contacts component
* and tests if they are present.
*/
private void run() {
Address address = new Address("Langestraat", "42", "2000", "Ergens");
contacts.add("ikke", address, "03/123.45.67");
address = new Address("Langestraat", "42", "2000", "Antwerpen");
contacts.add("gij", address, "03/765.43.21");
System.out.println("address of ikke is:");
address = contacts.addressOf("ikke");
System.out.println(address);
System.out.println("address of gij is:");
address = contacts.addressOf("gij");
System.out.println(address);
}
/**
* Starts this component.
*
* @param args the ip-address and port-number of the Contacts component.
*/
public static void main(String[] args) {
if (args.length != 2) {
System.err.println("Usage: java Client <contactsIP> <contactsPort>");
System.exit(1);
}
int port = Integer.parseInt(args[1]);
NetworkAddress contactsAddress = new NetworkAddress(args[0], port);
Client client = new Client(contactsAddress);
client.run();
}
}
| [
"[email protected]"
] | |
f0f86d0175c0534fcc7256dd8d479f759a92dcca | e3b4fbb378bd349bd5eb87b8f8bd4145a1f0c2ad | /ComponentImpl/src/main/java/com/xiaojinzi/component/impl/interceptor/OpenOnceInterceptor.java | 683fde2a6e1f24b5153212a71370f0a49174a440 | [
"Apache-2.0"
] | permissive | hpdx/Component | ffd00061c6f014ce55c96355570eaa85da381a94 | d5ff6d370fbb8084523256b8afbb8036d14576df | refs/heads/master | 2020-07-30T13:05:17.523507 | 2019-09-15T08:48:01 | 2019-09-15T08:48:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,054 | java | package com.xiaojinzi.component.impl.interceptor;
import android.net.Uri;
import com.xiaojinzi.component.error.ignore.NavigationFailException;
import com.xiaojinzi.component.impl.RouterInterceptor;
/**
* 这个拦截器必须在其他任何一个拦截器之前执行
* 从根本上限制同一个界面在一秒钟内只能打开一次,这个拦截器会被框架最先执行
* note: 这个拦截器没有连同 {@link Uri#getScheme()} 一起判断,其实应该一起的,
* 但是现实中应该也不会出现一秒钟 host 和 path 都相同的两次路由了
*
* time : 2019/01/23
*
* @author : xiaojinzi 30212
*/
public class OpenOnceInterceptor implements RouterInterceptor {
private OpenOnceInterceptor() {
}
private static class SingletonInstance {
private static final OpenOnceInterceptor INSTANCE = new OpenOnceInterceptor();
}
public static OpenOnceInterceptor getInstance() {
return OpenOnceInterceptor.SingletonInstance.INSTANCE;
}
private String preHost;
private String prePath;
/**
* 记录上一个界面跳转的时间
*/
private long preTargetTime;
@Override
public void intercept(Chain chain) throws Exception {
Uri uri = chain.request().uri;
String currentHost = uri.getHost();
String currentPath = uri.getPath();
// 调试的情况下可能会失效,因为你断点打到这里慢慢的往下走那么可能时间已经过了一秒,就失去了限制的作用
long currentTime = System.currentTimeMillis();
// 如果匹配了
if (currentHost.equals(preHost) && currentPath.equals(prePath) && (currentTime - preTargetTime) < 1000) {
chain.callback().onError(new NavigationFailException("target '" + uri.toString() + "' can't launch twice in a second"));
} else {
preHost = currentHost;
prePath = currentPath;
preTargetTime = currentTime;
// 放过执行
chain.proceed(chain.request());
}
}
}
| [
"[email protected]"
] | |
74fcdd3e7bf83ec8ca9842bed762f341b1045138 | b743bd285fffdccdd5558bb0ae266ea5bc824fd7 | /Lec_48/BTree.java | 89682534915c4c085eecba632508790bf4d0363f | [] | no_license | devsumanprasad/Nagarro | f6f91d2ef3ff62deb5f5ac037e25665fc5a71d1a | 5136cab32fae59276b9d7c75c5ed7346a7107262 | refs/heads/main | 2023-08-29T09:06:24.642882 | 2021-10-22T17:49:45 | 2021-10-22T17:49:45 | 357,958,762 | 1 | 0 | null | 2021-04-14T20:34:58 | 2021-04-14T15:44:51 | Java | UTF-8 | Java | false | false | 3,310 | java | package Lec_48;
import java.util.Scanner;
public class BTree {
private class Node {
int data;
Node left;
Node right;
}
private Node root;
public BTree() {
// TODO Auto-generated constructor stub
root = Cons(null, false);
}
Scanner scn = new Scanner(System.in);
private Node Cons(Node parent, boolean is_left) {
if (parent == null) {
System.out.println("Root node ka data ?");
} else if (is_left) {
System.out.println(parent.data + " ke Left Childs ka data ?");
} else {
System.out.println(parent.data + " ke Right Childs ka data ?");
}
Node nn = new Node();
nn.data = scn.nextInt();
System.out.println(nn.data + " Has left child ?");
boolean has_left = scn.nextBoolean();
if (has_left) {
nn.left = Cons(nn, true);
}
System.out.println(nn.data + " Has right child ?");
boolean has_right = scn.nextBoolean();
if (has_right) {
nn.right = Cons(nn, false);
}
return nn;
}
public void Disp() {
Disp(root);
}
private void Disp(Node nn) {
if (nn == null) {
return;
}
// Self Work
String str = "";
if (nn.left != null) {
str = str + nn.left.data;
}
str = str + " -> " + nn.data + " <- ";
if (nn.right != null) {
str = str + nn.right.data;
}
System.out.println(str);
// Smaller Probl
Disp(nn.left);
Disp(nn.right);
}
public int Size() {
return Size(this.root);
}
private int Size(Node nn) {
if (nn == null) {
return 0;
}
int Left_ST = Size(nn.left);
int Right_ST = Size(nn.right);
return Left_ST + Right_ST + 1;
}
public int Max() {
return Max(root);
}
private int Max(Node nn) {
if (nn == null) {
return Integer.MIN_VALUE;
}
int Max_L = Max(nn.left);
int Max_R = Max(nn.right);
return Math.max(nn.data, Math.max(Max_L, Max_R));
}
public boolean Find(int ele) {
return Find(root, ele);
}
private boolean Find(Node nn, int item) {
if (nn == null) {
return false;
}
if (nn.data == item) {
return true;
}
boolean present_LST = Find(nn.left, item);
boolean present_RST = Find(nn.right, item);
return present_LST || present_RST;
}
public int Ht() {
return Ht(root);
}
private int Ht(Node nn) {
if (nn == null) {
return -1;
}
int Ht_LST = Ht(nn.left); // L1
int Ht_RST = Ht(nn.right); // L1
return Math.max(Ht_LST, Ht_RST) + 1; // L0
}
public int Leaf() {
return Leaf(root);
}
private int Leaf(Node nn) {
if (nn == null) {
return 0;
}
// Leaf Node ans = 1
if (nn.left == null && nn.right == null) {
return 1;
}
int LST = Leaf(nn.left);
int RST = Leaf(nn.right);
return LST + RST;
}
public int Diameter() {
Diameter(root);
return max_Dia;
}
int max_Dia = -1;
public void Diameter(Node nn) {
if (nn == null) {
return;
}
// Go to every Node
// 2T(n/2)
Diameter(nn.left);
Diameter(nn.right);
// Find your maximum distance between 2 nodes passing through nn
// O(n) = 2 * T(n/2)
int L_Ht = Ht(nn.left);
int R_Ht = Ht(nn.right);
int Curr_Dia = L_Ht + R_Ht + 2;
max_Dia = Math.max(max_Dia, Curr_Dia);
System.out.println(nn.data + " : " + Curr_Dia);
}
}
| [
"[email protected]"
] | |
ed2353e468b8d14d1dc764c3607fa31983212bed | d15058fec18f4cd2c4d869f6a5e2fb5116215eb3 | /src/main/java/com/tranzvision/gd/TZMyEnrollmentClueBundle/model/PsTzXsLabelTblKey.java | 536a1d8cbcff21e13872760682f3fe9854705fc5 | [] | no_license | YujunWu-King/university | 1c08118d753c870f4c3fa410f7127d910a4e3f2d | bac7c919f537153025bec9de2942f0c9890d1b7a | refs/heads/BaseLocal | 2022-12-26T19:51:20.994957 | 2019-12-30T11:38:20 | 2019-12-30T11:38:20 | 231,065,763 | 0 | 0 | null | 2022-12-16T06:34:06 | 2019-12-31T09:43:56 | Java | UTF-8 | Java | false | false | 535 | java | package com.tranzvision.gd.TZMyEnrollmentClueBundle.model;
public class PsTzXsLabelTblKey {
private String tzLeadId;
private String tzLabelId;
public String getTzLeadId() {
return tzLeadId;
}
public void setTzLeadId(String tzLeadId) {
this.tzLeadId = tzLeadId == null ? null : tzLeadId.trim();
}
public String getTzLabelId() {
return tzLabelId;
}
public void setTzLabelId(String tzLabelId) {
this.tzLabelId = tzLabelId == null ? null : tzLabelId.trim();
}
} | [
"[email protected]"
] | |
d5706e08bea28683ff9c18322ae4368efe213c6d | 58fcc56982486817b13f65fc10c1e04e0a4c81f8 | /src/main/java/com/ruyicai/scorecenter/controller/ResponseData.java | 8ac56bf28fa5acf1d597b7253642af98feb4078c | [] | no_license | yilucode/scorecenter | c44dac8ad73da07f94267852532d28c4902e6bc2 | 322da4b4aba58a539445a70b08e310ea88a25de0 | refs/heads/master | 2021-05-27T07:07:31.731494 | 2014-08-19T02:32:06 | 2014-08-19T02:32:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 259 | java | package com.ruyicai.scorecenter.controller;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.json.RooJson;
@RooJson
@RooJavaBean
public class ResponseData {
private String errorCode;
private Object value;
}
| [
"[email protected]"
] | |
0f4e5a596eaee1b6f73d5b84b0118a5cde328440 | 56778297c5917beef88e462d978ef4edc491da71 | /keshe/app/src/main/java/com/example/keshe/RegistActivity.java | 5cfb686c6d0525d405aa4c7cd2a59a3ad75f3b89 | [] | no_license | TEANAET/Plant-ventilation-system | 0f3f90c72ea65d7a3702e595ea89e4ded6c7260d | c97ec2792ba30ec1ebbf14d692eb87a47b12d25d | refs/heads/main | 2023-07-19T18:36:25.399382 | 2021-09-02T00:57:47 | 2021-09-02T00:57:47 | 402,244,469 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,305 | java | package com.example.keshe;
import android.os.Bundle;
import android.os.Looper;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import base.BaseActivity;
import mysqllink.DBUtils;
import static android.content.ContentValues.TAG;
public class RegistActivity extends BaseActivity implements View.OnClickListener{
private EditText user_et;
private EditText pas_et;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_regist);
init();
}
private void init(){
user_et=findViewById(R.id.username);
pas_et=findViewById(R.id.password);
Button regist=findViewById(R.id.regist);
regist.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.regist:
new Thread(new Runnable() {
@Override
public void run() {
String n = user_et.getText().toString().trim();
String psw = pas_et.getText().toString().trim();
if(n.equals("")||psw.equals("")){
Looper.prepare();
Toast toast = Toast.makeText(RegistActivity.this,"输入的账户名或密码不能为空!",Toast.LENGTH_SHORT);
toast.show();
Looper.loop();
}
DBUtils dbUtils = new DBUtils();
boolean result =dbUtils.regist(n,psw);
if (!result){
Looper.prepare();
Toast toast = Toast.makeText(RegistActivity.this,"注册成功!",Toast.LENGTH_SHORT);
toast.show();
//Looper.loop();
open(LoginActivity.class);
finish();
}
//以上为jdbc注册
}
}).start();
break;
default:
break;
}
}
}
| [
"[email protected]"
] | |
cac68e361fe2ab981787bdfb8c7dd6c2704248dc | 132b755058e5cc6dd6e63ecabcb55ca845dbd549 | /app/src/main/java/com/example/user/testapphandh/data/BaseRequest.java | 9dc1cef1e6b92a969f7bf34ecadb55432fa59c01 | [] | no_license | luck-alex13/TestAppHandH | 4754ede37823557efa1fd9c2e2193609f3669e82 | 2c298a9caf7102e35827b57a0c58ebc4e1708930 | refs/heads/master | 2020-04-26T12:16:15.160928 | 2019-08-18T08:19:07 | 2019-08-18T08:19:07 | 173,543,983 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 424 | java | package com.example.user.testapphandh.data;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class BaseRequest {
@SerializedName("code")
@Expose
private int code;
public BaseRequest(int code) {
this.code = code;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}
| [
"[email protected]"
] | |
bbfadaa63bbde3400ed2113114aa53cb95f57df3 | 4e9b445b1f4453078994f6bc9c5b59183f1b2be1 | /HW_02/src/hr/fer/zemris/java/custom/collections/EmptyStackException.java | d0faea8f9c84ab5b80b2dffdab294309ef56036a | [] | no_license | antespajic/java-fer | e286ad672bb9d1975e1e0f8942208c094a3867d5 | 0bd6cf121b2df4586a974230119a18eba880cae4 | refs/heads/master | 2021-07-22T19:08:15.210926 | 2017-11-02T05:48:27 | 2017-11-02T05:48:27 | 53,845,916 | 0 | 4 | null | null | null | null | UTF-8 | Java | false | false | 648 | java | package hr.fer.zemris.java.custom.collections;
/**
* Thrown by methods in the <code>ObjectStack</code> class to indicate that the
* stack is empty.
*
* @author Ante Spajic
*/
public class EmptyStackException extends RuntimeException {
private static final long serialVersionUID = 5084686378493302095L;
/**
* Constructs a new <code>EmptyStackException</code> with <tt>null</tt> as
* its error message string.
*/
public EmptyStackException() {
}
/**
* Constructs a new <code>EmptyStackException</code> with provided message
* as its error message string.
*/
public EmptyStackException(String string) {
super(string);
}
}
| [
"[email protected]"
] | |
13d53b2d5c67b535ce9ff8955c17f267d0c86c57 | 482d9b166afae981b5bbc23eb4e2167138b96063 | /src/solutions/Ch16Moderate/Q16_18_Pattern_Matcher/QuestionA.java | 7542b370649c901c1f8b22c1ac6fb9ca828927bf | [] | no_license | dhirajhimani/JavaCodePrep | 6a7c34efa02c3763da4291bab588eeac8b5fd141 | 528148894385c74d594454044d2cedae3370c7f1 | refs/heads/master | 2023-01-13T04:05:19.010479 | 2020-11-20T10:50:39 | 2020-11-20T10:50:39 | 311,274,533 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,362 | java | package solutions.Ch16Moderate.Q16_18_Pattern_Matcher;
public class QuestionA {
public static boolean doesMatch(String pattern, String value) {
if (pattern.length() == 0) return value.length() == 0;
int size = value.length();
for (int mainSize = 0; mainSize <= size; mainSize++) {
String main = value.substring(0, mainSize);
for (int altStart = mainSize; altStart <= size; altStart++) {
for (int altEnd = altStart; altEnd <= size; altEnd++) {
String alt = value.substring(altStart, altEnd);
String cand = buildFromPattern(pattern, main, alt);
if (cand.equals(value)) {
System.out.println(main + ", " + alt);
return true;
}
}
}
}
return false;
}
public static String buildFromPattern(String pattern, String main, String alt) {
StringBuffer sb = new StringBuffer();
char first = pattern.charAt(0);
for (char c : pattern.toCharArray()) {
if (c == first) {
sb.append(main);
} else {
sb.append(alt);
}
}
return sb.toString();
}
public static void main(String[] args) {
String[][] tests = {{"ababb", "backbatbackbatbat"}, {"abab", "backsbatbackbats"}, {"aba", "backsbatbacksbat"}};
for (String[] test : tests) {
String pattern = test[0];
String value = test[1];
System.out.println(pattern + ", " + value + ": " + doesMatch(pattern, value));
}
}
}
| [
"[email protected]"
] | |
f41d2ef47f2ec7f785a6ea56ca6d7e662cde7f9e | 70fac9f57ee95ef37310b16e2ac5cf41ec54abd6 | /kurtgeiger/src/test/java/pageobject/CheckOutPage.java | f3b4ef6a1f67e23d99339d2121a4cd0375af2b0b | [] | no_license | hirenh/es.kurtgeiger | 0fe67f67996aa27aa00f284bcfef779b3c435704 | 8f3a765f9360148cd68ea05bf171674c636e09e2 | refs/heads/master | 2020-03-19T01:35:35.465944 | 2018-05-31T09:14:47 | 2018-05-31T09:14:47 | 135,556,661 | 0 | 0 | null | 2018-05-31T09:49:26 | 2018-05-31T08:40:51 | Java | UTF-8 | Java | false | false | 2,832 | java | package pageobject;
import driver_helpers.DriverHelpers;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
public class CheckOutPage extends DriverHelpers {
public void loginAsAGuest() {
driver.findElement(By.id("register-guest:email")).sendKeys("[email protected]");
driver.findElement(By.cssSelector(".buttons-set.login>button>span>span")).click();
}
public void dropDownTitleByPassingValue() {
driver.findElement(By.cssSelector(".input-box>input[id=\"shipping:firstname\"]")).sendKeys("john");
driver.findElement(By.cssSelector(".input-box>input[id=\"shipping:lastname\"]")).sendKeys("smith");
driver.findElement(By.cssSelector(".input-box>input[id=\"shipping:telephone\"]")).sendKeys("07852071592");
new Select(driver.findElement(By.id("addressfinder:shippingcountry"))).selectByVisibleText("Spain");
driver.findElement(By.cssSelector("input[ id=\"addressfinder:shipping\"]")).sendKeys("Calle Evangelios, 4");
driver.findElement(By.cssSelector("input[id=\"shipping:street1\"]")).sendKeys("28026 Madrid");
driver.findElement(By.cssSelector("input[id=\"shipping:city\"]")).sendKeys("spain");
new Select(driver.findElement(By.name("shipping[region_id]"))).selectByVisibleText("Alava");
}
public void contiuneToPayment() {
driver.findElement(By.cssSelector(".button[title=\"Continue to Payment\"]")).click();
}
public String paymentSummeryPage() {
String actual = driver.findElement(By.cssSelector(".page-title>h2")).getText();
System.out.println(actual);
return actual;
}
public void selectPaymentMethod() {
driver.findElement(By.cssSelector("#p_method_sagepayserver_label")).click();
}
public void enterCreditCardAndExpiryDetails(String creditCardNumber, String expiry) {
driver.switchTo().frame("sagepaysuite-server-incheckout-iframe");
WebElement card = driver.findElement(By.id("form-card_details.field-pan"));
WebElement expirydate = driver.findElement(By.cssSelector(".form-group__controls>div>input"));
card.sendKeys(creditCardNumber);
expirydate.sendKeys(expiry);
}
public void cvcDetails(String cvcNumber) {
WebElement searchBox1 = driver.findElement(By.cssSelector(".form-group__controls>input"));
searchBox1.sendKeys(cvcNumber);
}
public void cardDetails() {
WebElement confirmCardDetails = driver.findElement(By.cssSelector("button[value=\"proceed\"]"));
confirmCardDetails.click();
}
public String cardValidityChecks() {
String actual = driver.findElement(By.cssSelector(".form-group__error")).getText();
System.out.println(actual);
return actual;
}
}
| [
"[email protected]"
] | |
442bdeac66c6af852b37e3c3312d40ff2a88fc70 | 775de28f30260bf433e604aedb7c8d670b0f0d1f | /src/main/java/root/appConfiguration/ApplicationConfig.java | b28042f6baa0ba0e7208265bcf0bb2944eb0186c | [] | no_license | league55/car-server | 5bd38893b5761f2e1e5fb0895a12cf2f9001b30e | ac993530fe372c6c9e158f0c09a183ea1a65e7bc | refs/heads/master | 2021-04-12T03:46:12.954910 | 2018-04-16T07:29:33 | 2018-04-16T07:29:33 | 125,924,078 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 163 | java | package root.appConfiguration;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ApplicationConfig {
// not used now
}
| [
"[email protected]"
] | |
b40e4cca5870c109b6d2ec4e89f61acc31f0b747 | 9d0b5f0e99925fcfb73f5aebdc74081040db8973 | /PatternsComportamentais/src/Strategy_ex6_1/MensagemDeTerca.java | c42100f56d219165ffda03c1b6feff46c696f50a | [] | no_license | vtrcavassana/java_Patterns_Comportamentais | 19df786d464e505aa823093b115baaa7073590cb | d3ab6d01302c4070e2be79c0f190b28007282a97 | refs/heads/master | 2022-09-16T23:51:49.735297 | 2020-06-06T02:49:18 | 2020-06-06T02:49:18 | 269,827,551 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 364 | java | package Strategy_ex6_1;
public class MensagemDeTerca implements MensagemDoDia {
@Override
public String mensagem() {
return "Hoje infelizmente ainda é terça! Eclipse IDE, StackOverflow e fóruns de informática com alguém DESESPERADO pedindo ajuda com o mesmo problema que você está enfrentando AGORA, porém em 2002, e infelizmente sem resposta.";
}
} | [
"[email protected]"
] | |
4af5d3b5903610b7885477347180b86add456942 | 731646da78a4e5f672c49cb713c65734c82e0070 | /trabalhoProgramacao1/Ex09Teste.java | 4d614107e2e690f2985a91e4a760102c9a2e30cc | [] | no_license | OverRadius/estacio_java | 3476e0735d43b340c19097316e6f066ee2d9026e | 63057e9bd781e6f20493095e6a6638ee0fdb39cb | refs/heads/master | 2021-01-19T07:30:13.846212 | 2017-06-17T15:51:33 | 2017-06-17T15:51:33 | 87,546,876 | 0 | 0 | null | 2017-04-28T03:50:15 | 2017-04-07T13:11:34 | Java | UTF-8 | Java | false | false | 532 | 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 trabalhoProgramacao1;
/**
*
* @author Carlos
*/
public class Ex09Teste {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Ex09MaiorNumero n = new Ex09MaiorNumero();
System.out.println(n.maiorNum(22, 45));
}
}
| [
"[email protected]"
] | |
724a2e48c770bf88f4e502acdb198171b155f2a7 | 542efb2d447273d5142ef92129bbbdd9914344a2 | /onedrivesdk/src/main/java/com/onedrive/sdk/generated/IBaseThumbnailStreamRequestBuilder.java | 9c329046dd3023b49a74979fe7bd316330e8e4fa | [
"MIT"
] | permissive | spudi/onedrive-sdk-android | d8c58640345a7f7e6e35efc6e1c68384c93e21df | 1553371690e52d9b4ff9c9ee0b89c44879b43711 | refs/heads/master | 2021-04-27T00:22:41.735684 | 2018-03-05T14:32:55 | 2018-03-05T14:32:55 | 123,801,688 | 0 | 0 | MIT | 2018-03-04T15:25:44 | 2018-03-04T15:25:44 | null | UTF-8 | Java | false | false | 2,089 | java | // ------------------------------------------------------------------------------
// Copyright (c) 2015 Microsoft Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ------------------------------------------------------------------------------
package com.onedrive.sdk.generated;
import com.onedrive.sdk.concurrency.*;
import com.onedrive.sdk.core.*;
import com.onedrive.sdk.extensions.*;
import com.onedrive.sdk.http.*;
import com.onedrive.sdk.generated.*;
import com.onedrive.sdk.options.*;
import com.onedrive.sdk.serializer.*;
import java.util.*;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The interface for the Base Thumbnail Stream Request Builder.
*/
public interface IBaseThumbnailStreamRequestBuilder extends IRequestBuilder {
/**
* Creates the request
*/
IThumbnailStreamRequest buildRequest();
/**
* Creates the request with specific options instead of the existing options
*/
IThumbnailStreamRequest buildRequest(final List<Option> options);
}
| [
"[email protected]"
] | |
c0982f4df0b247853bd63dcd0a97e446d93fa011 | 701c9f82e5a5e6f1e5ea74dbcd9978b7793f3376 | /SmartBoardGUI/build/generated-sources/jax-ws/WSClient/LoginService.java | 2db9acab45b08317694fd3bf35b7df9dde5845b7 | [] | no_license | dossee-tsi/iwb_gui | 4b8f33b3449e737ae4fb02c5d2fd363f59fbd464 | 5adc7903fdeb1d1e24361f137aee6def4c2a6dd3 | refs/heads/master | 2021-01-10T20:55:38.673653 | 2011-03-18T10:21:27 | 2011-03-18T10:21:27 | 1,356,181 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,799 | java |
package WSClient;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature;
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2-hudson-752-
* Generated source version: 2.2
*
*/
@WebServiceClient(name = "LoginService", targetNamespace = "http://users/", wsdlLocation = "http://192.168.199.36:8000/WS/LoginService?wsdl")
public class LoginService
extends Service
{
private final static URL LOGINSERVICE_WSDL_LOCATION;
private final static WebServiceException LOGINSERVICE_EXCEPTION;
private final static QName LOGINSERVICE_QNAME = new QName("http://users/", "LoginService");
static {
URL url = null;
WebServiceException e = null;
try {
url = new URL("http://192.168.199.36:8000/WS/LoginService?wsdl");
} catch (MalformedURLException ex) {
e = new WebServiceException(ex);
}
LOGINSERVICE_WSDL_LOCATION = url;
LOGINSERVICE_EXCEPTION = e;
}
public LoginService() {
super(__getWsdlLocation(), LOGINSERVICE_QNAME);
}
public LoginService(WebServiceFeature... features) {
super(__getWsdlLocation(), LOGINSERVICE_QNAME, features);
}
public LoginService(URL wsdlLocation) {
super(wsdlLocation, LOGINSERVICE_QNAME);
}
public LoginService(URL wsdlLocation, WebServiceFeature... features) {
super(wsdlLocation, LOGINSERVICE_QNAME, features);
}
public LoginService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public LoginService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns Login
*/
@WebEndpoint(name = "LoginPort")
public Login getLoginPort() {
return super.getPort(new QName("http://users/", "LoginPort"), Login.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns Login
*/
@WebEndpoint(name = "LoginPort")
public Login getLoginPort(WebServiceFeature... features) {
return super.getPort(new QName("http://users/", "LoginPort"), Login.class, features);
}
private static URL __getWsdlLocation() {
if (LOGINSERVICE_EXCEPTION!= null) {
throw LOGINSERVICE_EXCEPTION;
}
return LOGINSERVICE_WSDL_LOCATION;
}
}
| [
"[email protected]"
] | |
7ad503eb6a5e3a8d821fb897c31fac65043711f4 | 7ac08ae2bf5ca5b5de9ea50834add1a94e4216e0 | /webapp/src/main/java/de/nitram509/mkat/api/search/KeywordCombination.java | 894c41022034201e7bddc4d41fb4dee67a902fa6 | [] | no_license | nitram509/mkat | bdae7c37b4dabbac69a9a10a53309ed01b1d8292 | 64f68d633df715e837769871915f94d361287f5b | refs/heads/master | 2023-01-23T21:38:09.757682 | 2023-01-21T10:47:55 | 2023-01-21T10:47:55 | 15,527,535 | 2 | 0 | null | 2023-01-21T10:48:33 | 2013-12-30T12:41:39 | Java | UTF-8 | Java | false | false | 433 | java | package de.nitram509.mkat.api.search;
public enum KeywordCombination {
OR,
AND;
public static KeywordCombination valueFrom(String value, KeywordCombination defaultValue) {
if (value != null) {
value = value.toUpperCase();
for (KeywordCombination keywordCombination : values()) {
if (keywordCombination.toString().equals(value)) return keywordCombination;
}
}
return defaultValue;
}
}
| [
"[email protected]"
] | |
2a75708ce60c6f935b0a71a61b0a50fb853e6935 | 7e9b2cd18fa960995e0988c71d34143444fd8b43 | /ProjectManager_Service/src/main/java/com/fsd/projectmanager/bo/TaskDTO.java | 17cfda27e507a83abaa12aeb24fac303e73845de | [] | no_license | vivekengineer/projectmanager | 616c0ca164544a76e5cea4da0f3b8047c7d10e74 | eb3e143a0748160322598e8ae2119f29ea9a91b5 | refs/heads/master | 2023-01-07T08:56:16.646868 | 2020-03-09T14:44:30 | 2020-03-09T14:44:30 | 246,035,690 | 0 | 0 | null | 2023-01-06T02:20:18 | 2020-03-09T12:56:48 | Java | UTF-8 | Java | false | false | 1,774 | java | package com.fsd.projectmanager.bo;
public class TaskDTO {
private Long taskId;
private String taskName;
private Long parentTaskId;
private String parentTaskName;
private String priority;
private String startDate;
private String endDate;
private String status;
private Long projectId;
private String employeeId;
public TaskDTO() {
super();
}
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public Long getParentTaskId() {
return parentTaskId;
}
public void setParentTaskId(Long parentTaskId) {
this.parentTaskId = parentTaskId;
}
public String getParentTaskName() {
return parentTaskName;
}
public void setParentTaskName(String parentTaskName) {
this.parentTaskName = parentTaskName;
}
public String getPriority() {
return priority;
}
public void setPriority(String priority) {
this.priority = priority;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Long getProjectId() {
return projectId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
public String getEmployeeId() {
return employeeId;
}
public void setEmployeeId(String employeeId) {
this.employeeId = employeeId;
}
}
| [
"[email protected]"
] | |
a9a233169c7e63dc0adade8a189e32002c5c74bf | 37d571cca76e4e671605d6866f82d2d59554c769 | /app/src/main/java/com/gg/robot/utils/HttpUtils.java | b09b23690b198b9c6c145e6d735738fa18e014b3 | [] | no_license | jiangzhiguo1992/Robot | e140e0f5cd351a80040df03b62bd63bb1eb792d3 | 1206849bc7c6643d35e404b4602a8668faf998c7 | refs/heads/master | 2021-05-30T21:23:32.197467 | 2016-01-17T06:35:27 | 2016-01-17T06:35:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,661 | java | package com.gg.robot.utils;
import android.util.Log;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
/**
* author cipherGG
* Created by Administrator on 2015/12/25.
* describe
*/
public class HttpUtils {
public static final String ROBOT_KEY = "141724ebf2336e4dee725909b41df44e";
public static final String ROBOT_INDEX_PATH = "http://op.juhe.cn/robot/index";
public static final String ROBOT_CODE_PATH = "http://op.juhe.cn/robot/code";
public static ResponseBody getBody(String url, HashMap<String, Object> params) {
OkHttpClient client = new OkHttpClient();
try {
StringBuilder buffer = new StringBuilder();
//GET里记得加上?
buffer.append("?");
if (params != null) {
for (Map.Entry<String, Object> entry : params.entrySet()) {
buffer.append(entry.getKey())
.append("=")
.append(URLEncoder.encode(entry.getValue().toString(), "utf-8"))
.append("&");
}
//删去最后一个符号&
buffer.deleteCharAt(buffer.length() - 1);
}
Request request = new Request.Builder()
.url(url + buffer.toString())
.build();
Response response = client.newCall(request).execute();
if (response != null) {
return response.body();
}
} catch (IOException e) {
e.printStackTrace();
}
Log.e("Response", " == null");
return null;
}
public static String getString(String url, HashMap<String, Object> params) {
ResponseBody responseBody = getBody(url, params);
if (responseBody != null) {
try {
return responseBody.string();//看清楚是string,不是toString!!!
} catch (IOException e) {
e.printStackTrace();
}
}
Log.e("ResponseBody", "== null");
return null;
}
public static InputStream getStream(String url, HashMap<String, Object> params) {
ResponseBody responseBody = getBody(url, params);
if (responseBody != null) {
return responseBody.byteStream();
}
Log.e("ResponseBody", "== null");
return null;
}
public static byte[] getBytes(String url, HashMap<String, Object> params) {
ResponseBody responseBody = getBody(url, params);
if (responseBody != null) {
try {
return responseBody.bytes();
} catch (IOException e) {
e.printStackTrace();
}
}
Log.e("ResponseBody", "== null");
return null;
}
public static ResponseBody postBody(String url, String json) {
OkHttpClient client = new OkHttpClient();
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
RequestBody body = RequestBody.create(JSON, json);
Request request = new Request.Builder()
.url(url)
.post(body)
.build();
try {
Response response = client.newCall(request).execute();
return response.body();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
| [
"[email protected]"
] | |
63850511177d8b81cc27a0db7ac5902de0c07259 | 46afd53f643b062454de798bcd4f9565f78f667a | /src/main/java/com/neusoft/SSMTest/bean/Game.java | eb13120ae06e598b4e9b8c78cfa890fa83312d56 | [] | no_license | 1820057132/maven-ssm | 85e7970547c0360955be8e1320eca3a1f34da39e | 25d12d596545aed90f933318c29734ace724d931 | refs/heads/master | 2020-03-28T19:23:58.711163 | 2018-09-16T07:12:08 | 2018-09-16T07:12:08 | 148,972,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,172 | java | package com.neusoft.SSMTest.bean;
/**
* Created by xhbg on 2018/9/5.
*/
public class Game {
//public static final String TABLE_ALIAS = "Game";
//public static final String ALIAS_ID = "游戏Id 自增生成,必须是唯一的";
//public static final String ALIAS_NAME = "游戏名";
//public static final String ALIAS_HOT = "热度";
//public static final String ALIAS_ICON = "图标地址";
//public static final String ALIAS_LETTER = "首字母";
//public static final String ALIAS_HOMEPAGE = "是否首页";
//public static final String ALIAS_TYPE = "type";
//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
//columns START
//
//游戏Id 自增生成,必须是唯一的
private Integer id;
//@Length(max=100)
//游戏名
private String name;
//
//热度
private Integer hot;
//@Length(max=100)
//图标地址
private String icon;
//@Length(max=10)
//首字母
private String letter;
//@Length(max=10)
//是否首页
private String homepage;
//@Length(max=10)
//type
private String type;
//columns END
public void setId(Integer value) {
this.id = value;
}
public Integer getId() {
return this.id;
}
public void setName(String value) {
this.name = value;
}
public String getName() {
return this.name;
}
public void setHot(Integer value) {
this.hot = value;
}
public Integer getHot() {
return this.hot;
}
public void setIcon(String value) {
this.icon = value;
}
public String getIcon() {
return this.icon;
}
public void setLetter(String value) {
this.letter = value;
}
public String getLetter() {
return this.letter;
}
public void setHomepage(String value) {
this.homepage = value;
}
public String getHomepage() {
return this.homepage;
}
public void setType(String value) {
this.type = value;
}
public String getType() {
return this.type;
}
}
| [
"[email protected]"
] | |
d93125be0175f51e32d5a442848f1d787a63a7ba | 7e3d5d0a35ec01c562a75150220b7f9afe9a6f12 | /src/pl/datasets/utils/Pallete.java | e67596c28c6ab83c2b6132c2929a14c8a6b2cbe4 | [] | no_license | Marchuck/Datasets | 48bfd8682e2da8b3f14b529c480e391c8030f338 | be7c02076dec17e6e35e20dff8b31084a2c82d6c | refs/heads/master | 2020-05-21T23:13:27.320040 | 2016-06-22T22:42:30 | 2016-06-22T22:42:30 | 59,765,238 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 884 | java | package pl.datasets.utils;
import java.awt.*;
/**
* @author Lukasz
* @since 26.05.2016.
* Defines the app colors here
*/
public class Pallete {
private Pallete() {
}
public static Color hex2Rgb(String colorStr) {
return new Color(
Integer.valueOf(colorStr.substring(1, 3), 16),
Integer.valueOf(colorStr.substring(3, 5), 16),
Integer.valueOf(colorStr.substring(5, 7), 16));
}
public static Color primaryColor() {
return hex2Rgb("#3F51B5");
}
public static Color primaryDarkColor() {
return hex2Rgb("#FFC107");
}
public static Color accentColor() {
return hex2Rgb("#3f51b5");
}
public static Color primaryTextColor() {
return hex2Rgb("#212121");
}
public static Color secondaryTextColor() {
return hex2Rgb("#727272");
}
}
| [
"[email protected]"
] | |
656af46c8eb2d2271bdb6d6d07c8970712b89ee8 | a889b5b6e35667e76178b7914146a534dd22aa5e | /W6_GeoQuiz_MVC_start/app/src/main/java/itp341/geoquiz/Model/QuizQuestion.java | 6df8b36d55a55261fa26317a131f5820e75c088a | [] | no_license | Shamitbh/ITP-341 | 361563de81f263f8746c14c1e174bd09e609606b | 4eb9196cd1af6ef88c699390e16bde42826faf30 | refs/heads/master | 2021-01-25T10:07:51.423914 | 2018-02-28T20:53:17 | 2018-02-28T20:53:17 | 123,340,661 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,067 | java | package itp341.geoquiz.Model;
import java.io.Serializable;
/**
* Created by Shamit on 9/25/17.
*/
public class QuizQuestion implements Serializable{
private String question;
private boolean answer;
public QuizQuestion(String question, boolean answer) {
this.question = question;
this.answer = answer;
}
public QuizQuestion(String question, int booleanAsInt) {
this.question = question;
if (booleanAsInt == 0){
this.answer = false;
}
else{
this.answer = true;
}
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
public boolean isAnswer() {
return answer;
}
public void setAnswer(boolean answer) {
this.answer = answer;
}
@Override
public String toString() {
return "QuizQuestion{" +
"question='" + question + '\'' +
", answer=" + answer +
'}';
}
}
| [
"[email protected]"
] | |
309277c353dc548634fcfee6bb71fcd78486d7b9 | bfcac99207b4d362572f025a28e7ceb2b9d71385 | /src/main/java/temperatus/model/dao/impl/GameDaoImpl.java | bd66b02461bb89132f0b526a8f5e7fe948e66f38 | [] | no_license | albertoqa/temperatus | e0885ac2e988c53a7edf7d7f6d50ec617d17674e | 913d40d6a4d8f0f173921a6f991710af39d906ce | refs/heads/master | 2021-03-27T17:30:40.107243 | 2019-03-17T19:49:18 | 2019-03-17T19:49:18 | 51,263,280 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 284 | java | package temperatus.model.dao.impl;
import org.springframework.stereotype.Repository;
import temperatus.model.dao.GameDao;
/**
* Created by alberto on 26/12/15.
*/
@Repository
public class GameDaoImpl extends GenericDaoImpl implements GameDao{
public GameDaoImpl() {
}
}
| [
"[email protected]"
] | |
66f5f117779e0a7433dbd38c11308cef69cb61d9 | aaccdc6095fe8111f7c6a0d6368f3da893cff573 | /src/com/freedom/search/services/ArticleService.java | 09d374607b5e0f06dd413a1de538210116490a48 | [] | no_license | hecj/solr-search | b08daf1b579684c90fe42c29ef9629a9b9adf1a2 | 65a7fb89ea0c5663a47c6b223ccce5fb1d3a2b41 | refs/heads/master | 2021-01-01T16:31:16.937843 | 2015-03-19T08:43:25 | 2015-03-19T08:43:25 | 27,591,848 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,073 | java | package com.freedom.search.services;
import java.util.List;
import java.util.Map;
import com.freedom.search.hibernate.entity.LaArticle;
/**
* @类功能说明:文章业务类
* @类修改者:
* @修改日期:
* @修改说明:
* @作者:HECJ
* @创建时间:2014-12-4 上午09:45:35
* @版本:V1.0
*/
public interface ArticleService {
/**
* @函数功能说明 根据文章ID查询
* @修改作者名字 HECJ
* @修改时间 2014-12-2
* @修改内容
* @参数: @param id
* @参数: @return
* @return Article
* @throws
*/
public LaArticle searchArticleById(String pArticleNo);
/**
* @函数功能说明 添加
* @修改作者名字 HECJ
* @修改时间 2014-12-3
* @修改内容
* @参数: @param article
* @return void
* @throws
*/
public void addArticle(LaArticle pArticle);
/**
* @函数功能说明 添加
* @修改作者名字 HECJ
* @修改时间 2014-12-3
* @修改内容
* @参数: @param article
* @return void
* @throws
*/
public void addArticle(List<LaArticle> pArticles);
/**
* @函数功能说明 根据文章Id删除
* @修改作者名字 HECJ
* @修改时间 2014-12-5
* @修改内容
* @参数: @param pArticleNo
* @return void
* throws
*/
public void deleteArticle(String pArticleNo);
/**
* @函数功能说明 分页查询文章集合
* @修改作者名字 HECJ
* @修改时间 2014-12-5
* @修改内容
* @参数: @param pParams{pagination:Pagination}<br>
* @参数: @return{rArticleList:List<Article/>,pPagination:Pagination}
* @return Map<String,Object>
* throws
*/
public Map<String,Object> searchArticleList(Map<String,Object> pParams);
/**
* @函数功能说明 从solr中查询文章集合
* @修改作者名字 HECJ
* @修改时间 2014-12-8
* @修改内容
* @参数: @param pParams
* @参数: @return
* @return Map<String,Object>
* throws
*/
public Map<String,Object> searchArticleListBySolr(Map<String,Object> pParams);
}
| [
"[email protected]"
] | |
6429b1ca90151d30e843d9d0eb79e16d192ecabe | 40d6492ab8e60fe78392d1e744dd6b4a707a30d2 | /180517/NoVlakna/src/test/java/NoVlaknaTest.java | 638473348590b22d9818af5b58f549ccb3f7dab3 | [] | no_license | kockahonza/UvodDoProgramovani | f99f13e03c59b067083f8e96ef7f387fc9654c0f | ed70c90bd596360c6aad1729fc476cf3e8788269 | refs/heads/master | 2018-12-13T00:53:15.433958 | 2018-09-13T13:53:22 | 2018-09-13T13:53:22 | 111,068,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 174 | java | import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class NoVlaknaTest {
@Test
public void NoVlaknaExists() {
NoVlakna SMC = new NoVlakna();
}
}
| [
"[email protected]"
] | |
3fb10e5fbd4429a4d6075b7f9c3d5419ac8cc663 | 3158f150b6e9c7dfc2d705d6335be94b43474d0b | /src/main/java/com/king/modules/sys/home/entity/HomeViewList.java | b7273d7a487ec83730edd205862836ac5b7b5d18 | [] | no_license | KINGYJH/AmazeUI-Admin | 171cad93f3e97cd48e8c0207e826313c51c043e2 | e1adc7b6ef1a9ff8ba10fa75478133fc828dd990 | refs/heads/master | 2020-11-30T00:33:25.328811 | 2017-09-25T08:29:37 | 2017-09-25T08:29:37 | 95,857,949 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,456 | java | package com.king.modules.sys.home.entity;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**
* Created by YJH
* on 2017/7/26 15:46.
* 注释:
*/
//设置生成的xml的根节点的名称
@XmlRootElement(name = "MenuViews")
public class HomeViewList implements Serializable {
private List<HomeView> homeViews = new ArrayList<>();
@XmlElement(name = "MenuView")
public List<HomeView> getHomeViews() {
return homeViews;
}
public void setHomeViews(List<HomeView> homeViews) {
this.homeViews = homeViews;
}
public HomeViewList sort() {
Collections.sort(this.homeViews, new Comparator<HomeView>() {
@Override
public int compare(HomeView o1, HomeView o2) {
return o1.getSort().compareTo(o2.getSort());
}
});
return this;
}
public List<HomeView> getShowHomeViews() {
List<HomeView> returnList = new ArrayList<>();
for (HomeView item : this.homeViews) {
if (item.getIsShow().equals("0")) {
returnList.add(item);
}
}
return returnList;
}
}
| [
"[email protected]"
] |
Subsets and Splits